]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
format_cap: make function parameters 'const'
authorKevin Harwell <kharwell@digium.com>
Mon, 24 Feb 2020 18:44:43 +0000 (12:44 -0600)
committerKevin Harwell <kharwell@digium.com>
Mon, 24 Feb 2020 19:37:37 +0000 (13:37 -0600)
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

include/asterisk/format_cap.h
main/format_cap.c

index 8b69e08b1969d7377fc0fba68ff0ff7fd7d3b30c..37021ebeb094d72e70034e54d370c60a90e540e8 100644 (file)
@@ -308,7 +308,7 @@ int ast_format_cap_has_type(const struct ast_format_cap *cap, enum ast_media_typ
  *
  * \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 @@ const char *ast_format_cap_get_names(struct ast_format_cap *cap, struct ast_str
  * \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 */
index d71ccdbaa5787c4e7670866dce9a1215e630c2ed..ca60557a91621d4bb175059f9284ca241ead7cdc 100644 (file)
@@ -699,7 +699,7 @@ int ast_format_cap_identical(const struct ast_format_cap *cap1, const struct ast
        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 @@ const char *ast_format_cap_get_names(struct ast_format_cap *cap, struct ast_str
        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);