[Asterisk-code-review] format_cap: make function parameters 'const' (asterisk[17])
Kevin Harwell
asteriskteam at digium.com
Thu Feb 27 13:16:31 CST 2020
Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13837 )
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 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/+/13837
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 17
Gerrit-Change-Id: Ife753fb16a962d842a6b44f45363a61a66bfdb2e
Gerrit-Change-Number: 13837
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/34bfd5c8/attachment.html>
More information about the asterisk-code-review
mailing list