[Asterisk-cvs] asterisk/include/asterisk astobj.h,1.15,1.16
kpfleming at lists.digium.com
kpfleming at lists.digium.com
Sat May 14 19:27:01 CDT 2005
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"); \
More information about the svn-commits
mailing list