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

Kevin Harwell asteriskteam at digium.com
Mon Feb 24 13:37:09 CST 2020


Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/13841 )


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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/41/13841/1

diff --git a/include/asterisk/format_cap.h b/include/asterisk/format_cap.h
index 8b69e08..37021eb 100644
--- a/include/asterisk/format_cap.h
+++ b/include/asterisk/format_cap.h
@@ -308,7 +308,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. */
@@ -322,6 +322,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 d71ccdb..ca60557 100644
--- a/main/format_cap.c
+++ b/main/format_cap.c
@@ -699,7 +699,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;
 
@@ -725,7 +725,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/+/13841
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ife753fb16a962d842a6b44f45363a61a66bfdb2e
Gerrit-Change-Number: 13841
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200224/e8d8c5bf/attachment.html>


More information about the asterisk-code-review mailing list