summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Lefèvre <lefevre00@yahoo.fr>2015-03-13 15:46:44 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-03-19 10:39:41 +0000
commitb18bd0b774436ad33332a85b95491a3efd02c249 (patch)
tree42d5a033bd6f18ca593e5e2590838ba34441eb6b
parentb8d6062a120a70f155e296c72a856cde2c5d142c (diff)
CppCheck cleaning : scope reduction and printf format
Change-Id: I43ba76194ee135ffe2398267ed810cca116a1e43 Reviewed-on: https://gerrit.libreoffice.org/14854 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sal/android/uthash.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/sal/android/uthash.h b/sal/android/uthash.h
index 076046903046..fe9d13d79f9f 100644
--- a/sal/android/uthash.h
+++ b/sal/android/uthash.h
@@ -81,9 +81,9 @@ typedef unsigned int uint32_t;
#define HASH_FIND(hh,head,keyptr,keylen,out) \
do { \
- unsigned _hf_bkt,_hf_hashv; \
out=NULL; \
if (head) { \
+ unsigned _hf_bkt,_hf_hashv; \
HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt); \
if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) { \
HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], \
@@ -247,11 +247,11 @@ do {
#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)
#define HASH_FSCK(hh,head) \
do { \
- unsigned _bkt_i; \
- unsigned _count, _bkt_count; \
- char *_prev; \
- struct UT_hash_handle *_thh; \
if (head) { \
+ unsigned _bkt_i; \
+ unsigned _count, _bkt_count; \
+ char *_prev; \
+ struct UT_hash_handle *_thh; \
_count = 0; \
for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) { \
_bkt_count = 0; \
@@ -268,12 +268,12 @@ do {
} \
_count += _bkt_count; \
if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \
- HASH_OOPS("invalid bucket count %d, actual %d\n", \
+ HASH_OOPS("invalid bucket count %d, actual %u\n", \
(head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \
} \
} \
if (_count != (head)->hh.tbl->num_items) { \
- HASH_OOPS("invalid hh item count %d, actual %d\n", \
+ HASH_OOPS("invalid hh item count %d, actual %u\n", \
(head)->hh.tbl->num_items, _count ); \
} \
/* traverse hh in app order; check next/prev integrity, count */ \
@@ -291,7 +291,7 @@ do {
(head)->hh.tbl->hho) : NULL ); \
} \
if (_count != (head)->hh.tbl->num_items) { \
- HASH_OOPS("invalid app item count %d, actual %d\n", \
+ HASH_OOPS("invalid app item count %d, actual %u\n", \
(head)->hh.tbl->num_items, _count ); \
} \
} \