diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-23 00:20:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-23 00:20:06 +0400 |
commit | 1fb980e7df3587982e9117c409f4c1e5af50c90a (patch) | |
tree | 8ab7180e68aecc113ee6db633cfee79dce7b3063 /source/blender/blenlib/intern/smallhash.c | |
parent | d23bf097128b4baf032d14c345e9d97656f2da78 (diff) |
reduce sign conversion comparisons for smallhash and tweak warnings elsewhere.
Diffstat (limited to 'source/blender/blenlib/intern/smallhash.c')
-rw-r--r-- | source/blender/blenlib/intern/smallhash.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/smallhash.c b/source/blender/blenlib/intern/smallhash.c index 600433fe1b1..d255b4a9af6 100644 --- a/source/blender/blenlib/intern/smallhash.c +++ b/source/blender/blenlib/intern/smallhash.c @@ -44,8 +44,11 @@ #define SMHASH_CELL_FREE ((void *)0x7FFFFFFD) #ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wstrict-overflow" # pragma GCC diagnostic error "-Wsign-conversion" +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 /* gcc4.6+ only */ +# pragma GCC diagnostic error "-Wsign-compare" +# pragma GCC diagnostic error "-Wconversion" +# endif #endif /* typically this re-assigns 'h' */ @@ -59,7 +62,7 @@ extern unsigned int hashsizes[]; void BLI_smallhash_init(SmallHash *hash) { - int i; + unsigned int i; memset(hash, 0, sizeof(*hash)); @@ -90,7 +93,7 @@ void BLI_smallhash_insert(SmallHash *hash, uintptr_t key, void *item) if (hash->size < hash->used * 3) { unsigned int newsize = hashsizes[++hash->curhash]; SmallHashEntry *tmp; - int i = 0; + unsigned int i = 0; if (hash->table != hash->stacktable || newsize > SMSTACKSIZE) { tmp = MEM_callocN(sizeof(*hash->table) * newsize, __func__); |