diff options
author | Jan Moskyto Matejka <mq@ucw.cz> | 2016-10-14 15:37:04 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-11-01 14:52:54 +0100 |
commit | 3e236955c9369475872b9b86a58502fa777b50b9 (patch) | |
tree | d43b519c2289a353e56c32b42c402f9fa12d0e13 /lib/hash.h | |
parent | 17fe57d8dcc89aea520788914b252cf49cf060ff (diff) |
Build: switch on -Wextra, get rid of most of the warnings
There are several unresolved -Wmissing-field-initializers on older
versions of GCC than 5.1, all of them false positive.
Diffstat (limited to 'lib/hash.h')
-rw-r--r-- | lib/hash.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2,7 +2,7 @@ #define HASH(type) struct { type **data; uint count, order; } #define HASH_TYPE(v) typeof(** (v).data) -#define HASH_SIZE(v) (1 << (v).order) +#define HASH_SIZE(v) (1U << (v).order) #define HASH_EQ(v,id,k1,k2...) (id##_EQ(k1, k2)) #define HASH_FN(v,id,key...) ((u32) (id##_FN(key)) >> (32 - (v).order)) @@ -116,12 +116,12 @@ #define HASH_MAY_RESIZE_DOWN_(v,pool,rehash_fn,args) \ ({ \ - int _o = (v).order; \ - while (((v).count < ((1 << _o) REHASH_LO_MARK(args))) && \ + uint _o = (v).order; \ + while (((v).count < ((1U << _o) REHASH_LO_MARK(args))) && \ (_o > (REHASH_LO_BOUND(args)))) \ _o -= (REHASH_LO_STEP(args)); \ if (_o < (v).order) \ - rehash_fn(&(v), pool, _o - (int) (v).order); \ + rehash_fn(&(v), pool, _o - (v).order); \ }) |