[Asterisk-code-review] format_cap: make function parameters 'const' (asterisk[13])

Kevin Harwell asteriskteam at digium.com
Thu Feb 27 13:15:59 CST 2020


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13835 )

Change subject: format_cap: make function parameters 'const'
......................................................................

format_cap: make function parameters 'const'

There were a couple places where the format cap function parameter was not
'const' when it should have been. This patch makes them 'const'.

Change-Id: Ife753fb16a962d842a6b44f45363a61a66bfdb2e
---
M include/asterisk/format_cap.h
M main/format_cap.c
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit



diff --git a/include/asterisk/format_cap.h b/include/asterisk/format_cap.h
index a86fd21..d571067 100644
--- a/include/asterisk/format_cap.h
+++ b/include/asterisk/format_cap.h
@@ -319,7 +319,7 @@
  *
  * \return The contents of the buffer in \c buf
  */
-const char *ast_format_cap_get_names(struct ast_format_cap *cap, struct ast_str **buf);
+const char *ast_format_cap_get_names(const struct ast_format_cap *cap, struct ast_str **buf);
 
 #ifndef AST_FORMAT_CAP_NAMES_LEN
 /*! Buffer size for callers of ast_format_cap_get_names to allocate. */
@@ -333,6 +333,6 @@
  * \retval 1 The format cap has zero formats or only ast_format_none
  * \retval 0 The format cap has at least one format
  */
-int ast_format_cap_empty(struct ast_format_cap *cap);
+int ast_format_cap_empty(const struct ast_format_cap *cap);
 
 #endif /* _AST_FORMAT_CAP_H */
diff --git a/main/format_cap.c b/main/format_cap.c
index 8a00ed6..86e8e1f 100644
--- a/main/format_cap.c
+++ b/main/format_cap.c
@@ -734,7 +734,7 @@
 	return internal_format_cap_identical(cap2, cap1);
 }
 
-const char *ast_format_cap_get_names(struct ast_format_cap *cap, struct ast_str **buf)
+const char *ast_format_cap_get_names(const struct ast_format_cap *cap, struct ast_str **buf)
 {
 	int i;
 
@@ -760,7 +760,7 @@
 	return ast_str_buffer(*buf);
 }
 
-int ast_format_cap_empty(struct ast_format_cap *cap)
+int ast_format_cap_empty(const struct ast_format_cap *cap)
 {
 	int count = ast_format_cap_count(cap);
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13835
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ife753fb16a962d842a6b44f45363a61a66bfdb2e
Gerrit-Change-Number: 13835
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200227/bfa7bbf5/attachment-0001.html>


More information about the asterisk-code-review mailing list