aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/astobj.h
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-14 23:32:31 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-14 23:32:31 +0000
commit22dd5e0c8d3023f7dcad15489703f52b8cad395f (patch)
tree94d73ee7914d5d455d70884461e7e48e88d9dd77 /include/asterisk/astobj.h
parentc8e14efd1a8f15724bf2c8e94b4942e3bbc6982f (diff)
minor fix for refcount/flags to be unsigned
explicitly test refcount as a logical value for builtin_expect (thanks to rizzo for the cluebat!) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5651 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/astobj.h')
-rwxr-xr-xinclude/asterisk/astobj.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asterisk/astobj.h b/include/asterisk/astobj.h
index ca18cf53c..ac1b280d7 100755
--- a/include/asterisk/astobj.h
+++ b/include/asterisk/astobj.h
@@ -129,8 +129,8 @@ extern "C" {
*/
#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 @@ extern "C" {
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"); \