Skip to content
Snippets Groups Projects
Commit d825e581 authored by Kevin P. Fleming's avatar Kevin P. Fleming
Browse files

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: https://origsvn.digium.com/svn/asterisk/trunk@5651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 251e6bc2
No related branches found
No related tags found
No related merge requests found
......@@ -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"); \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment