[asterisk-commits] murf: trunk r164415 - /trunk/include/asterisk/strings.h

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 15 13:42:06 CST 2008


Author: murf
Date: Mon Dec 15 13:42:05 2008
New Revision: 164415

URL: http://svn.digium.com/view/asterisk?view=rev&rev=164415
Log:
I was getting this warning during a compile
on a 64-bit machine running ubuntu server 8.10, 
and gcc-4.3.2:

   [CXXi] chan_vpb.ii -> chan_vpb.oo
cc1plus: warnings being treated as errors
In file included from /home/murf/asterisk/trunk/include/asterisk/utils.h:671,
                 from chan_vpb.cc:46:
/home/murf/asterisk/trunk/include/asterisk/strings.h: In function ‘char* ast_str_truncate(ast_str*, ssize_t)’:
/home/murf/asterisk/trunk/include/asterisk/strings.h:479: error: comparison between signed and unsigned integer expressions
make[1]: *** [chan_vpb.oo] Error 1
make: *** [channels] Error 2

which this fix silences


Modified:
    trunk/include/asterisk/strings.h

Modified: trunk/include/asterisk/strings.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/strings.h?view=diff&rev=164415&r1=164414&r2=164415
==============================================================================
--- trunk/include/asterisk/strings.h (original)
+++ trunk/include/asterisk/strings.h Mon Dec 15 13:42:05 2008
@@ -481,7 +481,7 @@
 {
 #ifdef DEBUG_OPAQUE
 	if (len < 0) {
-		buf->used2 += ((ssize_t) abs(len)) > buf->used2 ? -buf->used2 : len;
+		buf->used2 += ((ssize_t) abs(len)) > (ssize_t) buf->used2 ? -buf->used2 : len;
 	} else {
 		buf->used2 = len;
 	}
@@ -489,7 +489,7 @@
 	return buf->str2;
 #else
 	if (len < 0) {
-		buf->used += ((ssize_t) abs(len)) > buf->used ? -buf->used : len;
+		buf->used += ((ssize_t) abs(len)) > (ssize_t) buf->used ? -buf->used : len;
 	} else {
 		buf->used = len;
 	}




More information about the asterisk-commits mailing list