Update of /usr/cvsroot/asterisk/include/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv32258/include/asterisk

Modified Files:
        astobj.h 
Log Message:
minor fix for refcount/flags to be unsigned
explicitly test refcount as a logical value for builtin_expect (thanks to rizzo 
for the cluebat!)


Index: astobj.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/astobj.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- astobj.h    4 May 2005 19:50:36 -0000       1.15
+++ astobj.h    14 May 2005 23:32:31 -0000      1.16
@@ -129,8 +129,8 @@
  */
 #define ASTOBJ_COMPONENTS_NOLOCK_FULL(type,namelen,hashes) \
        char name[namelen]; \
-       int refcount; \
-       int objflags; \
+       unsigned int refcount; \
+       unsigned int objflags; \
        __ASTOBJ_HASH(type,hashes)
        
 /*! \brief Add ASTOBJ components to a struct (without locking support).
@@ -213,7 +213,7 @@
        do { \
                int newcount = 0; \
                ASTOBJ_WRLOCK(object); \
-               if (__builtin_expect((object)->refcount, 1)) \
+               if (__builtin_expect((object)->refcount > 0, 1)) \
                        newcount = --((object)->refcount); \
                else \
                        ast_log(LOG_WARNING, "Unreferencing unreferenced 
(object)!\n"); \

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to