From: Victor Julien Date: Wed, 5 Apr 2017 13:13:17 +0000 (+0200) Subject: pool: fix compiler warning X-Git-Tag: suricata-4.0.0-beta1~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1bf48c0ee89d16b2fc0867b4958dbad814b55ec;p=thirdparty%2Fsuricata.git pool: fix compiler warning clang-4.0 reported: util-pool.c:242:13: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses] if (! pb->flags & POOL_BUCKET_PREALLOCATED) { ^ ~ util-pool.c:242:13: note: add parentheses after the '!' to evaluate the bitwise operator first if (! pb->flags & POOL_BUCKET_PREALLOCATED) { ^ ( ) util-pool.c:242:13: note: add parentheses around left hand side expression to silence this warning if (! pb->flags & POOL_BUCKET_PREALLOCATED) { ^ ( ) util-pool.c:261:13: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses] if (! pb->flags & POOL_BUCKET_PREALLOCATED) { ^ ~ util-pool.c:261:13: note: add parentheses after the '!' to evaluate the bitwise operator first if (! pb->flags & POOL_BUCKET_PREALLOCATED) { ^ ( ) util-pool.c:261:13: note: add parentheses around left hand side expression to silence this warning if (! pb->flags & POOL_BUCKET_PREALLOCATED) { ^ ( ) 2 warnings generated. --- diff --git a/src/util-pool.c b/src/util-pool.c index dc536df7ff..4706222d8d 100644 --- a/src/util-pool.c +++ b/src/util-pool.c @@ -239,7 +239,7 @@ void PoolFree(Pool *p) SCFree(pb->data); } pb->data = NULL; - if (! pb->flags & POOL_BUCKET_PREALLOCATED) { + if (!(pb->flags & POOL_BUCKET_PREALLOCATED)) { SCFree(pb); } } @@ -258,7 +258,7 @@ void PoolFree(Pool *p) } pb->data = NULL; } - if (! pb->flags & POOL_BUCKET_PREALLOCATED) { + if (!(pb->flags & POOL_BUCKET_PREALLOCATED)) { SCFree(pb); } }