[asterisk-commits] mjordan: branch 1.8 r372959 - in /branches/1.8: include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 12 10:42:39 CDT 2012


Author: mjordan
Date: Wed Sep 12 10:42:35 2012
New Revision: 372959

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=372959
Log:
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


Modified:
    branches/1.8/include/asterisk/astobj2.h
    branches/1.8/main/astobj2.c

Modified: branches/1.8/include/asterisk/astobj2.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/include/asterisk/astobj2.h?view=diff&rev=372959&r1=372958&r2=372959
==============================================================================
--- branches/1.8/include/asterisk/astobj2.h (original)
+++ branches/1.8/include/asterisk/astobj2.h Wed Sep 12 10:42:35 2012
@@ -462,7 +462,7 @@
 
 #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);
 
 /*! @} */

Modified: branches/1.8/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/astobj2.c?view=diff&rev=372959&r1=372958&r2=372959
==============================================================================
--- branches/1.8/main/astobj2.c (original)
+++ branches/1.8/main/astobj2.c Wed Sep 12 10:42:35 2012
@@ -207,7 +207,7 @@
  */
 
 
-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);
 	




More information about the asterisk-commits mailing list