Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-06-20 23:39:29 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-20 23:39:29 +0400
commit2efea8cf03f9bcb923d969b9ba4c905503e306dc (patch)
tree0179a6aa6b050d825ec8132cbbe8e982bcc89f95 /source/blender/blenlib/intern/BLI_ghash.c
parent6a269e2a8e327fdc81f158b4e24c8909837f013c (diff)
reduce sign comparisons for ghash and add more strict warnings for gcc.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash.c')
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index 749c008d8c3..5cd5a904996 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -44,6 +44,8 @@
#ifdef __GNUC__
# pragma GCC diagnostic error "-Wsign-conversion"
+# pragma GCC diagnostic error "-Wsign-compare"
+# pragma GCC diagnostic error "-Wconversion"
#endif
const unsigned int hashsizes[] = {
@@ -152,7 +154,7 @@ bool BLI_ghash_remove(GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFr
void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
{
- int i;
+ unsigned int i;
if (keyfreefp || valfreefp) {
for (i = 0; i < gh->nbuckets; i++) {
@@ -220,7 +222,7 @@ bool BLI_ghash_haskey(GHash *gh, const void *key)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
{
- int i;
+ unsigned int i;
if (keyfreefp || valfreefp) {
for (i = 0; i < gh->nbuckets; i++) {
@@ -252,7 +254,7 @@ GHashIterator *BLI_ghashIterator_new(GHash *gh)
GHashIterator *ghi = MEM_mallocN(sizeof(*ghi), "ghash iterator");
ghi->gh = gh;
ghi->curEntry = NULL;
- ghi->curBucket = -1;
+ ghi->curBucket = (unsigned int)-1;
while (!ghi->curEntry) {
ghi->curBucket++;
if (ghi->curBucket == ghi->gh->nbuckets)
@@ -265,7 +267,7 @@ void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh)
{
ghi->gh = gh;
ghi->curEntry = NULL;
- ghi->curBucket = -1;
+ ghi->curBucket = (unsigned int)-1;
while (!ghi->curEntry) {
ghi->curBucket++;
if (ghi->curBucket == ghi->gh->nbuckets)