From: Matthew Jordan Date: Fri, 14 Sep 2012 18:28:40 +0000 (+0000) Subject: Constify __ao2_ref_debug in astobj2 X-Git-Tag: 10.10.0-rc1~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f63923c93d09ceb27784fdc40c1dc86758c258f;p=thirdparty%2Fasterisk.git Constify __ao2_ref_debug in astobj2 When REF_DEBUG is enabled in certain files - most notably ccss.c - the 'tag' parameter passed to __ao2_ref_debug will be a const char *. The function currently expects that parameter to not be const. This causes a warning when compiling, as the const qualifier is being discarded. With dev-mode enabled, this prevents compiling Asterisk. This patch makes __ao2_ref_debug's tag and file parameters const. (closes issue ASTERISK-20408) Reported by: mjordan ........ Merged revisions 372959 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@373059 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/astobj2.h b/include/asterisk/astobj2.h index b19f828f27..77129c7784 100644 --- a/include/asterisk/astobj2.h +++ b/include/asterisk/astobj2.h @@ -462,7 +462,7 @@ void *__ao2_alloc(const size_t data_size, ao2_destructor_fn destructor_fn); #endif -int __ao2_ref_debug(void *o, int delta, char *tag, char *file, int line, const char *funcname); +int __ao2_ref_debug(void *o, int delta, const char *tag, const char *file, int line, const char *funcname); int __ao2_ref(void *o, int delta); /*! @} */ diff --git a/main/astobj2.c b/main/astobj2.c index 5da94679c4..59322d261f 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -207,7 +207,7 @@ void *ao2_object_get_lockaddr(void *obj) */ -int __ao2_ref_debug(void *user_data, const int delta, char *tag, char *file, int line, const char *funcname) +int __ao2_ref_debug(void *user_data, const int delta, const char *tag, const char *file, int line, const char *funcname) { struct astobj2 *obj = INTERNAL_OBJ(user_data);