diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-19 11:51:39 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-01-19 11:51:39 -0800 |
commit | 547517571e695728278a264eedbac47b6e1f43bc (patch) | |
tree | 3bb3d1c1e61b4bf97c1e9970b778b3bf74d9868e /hash.c | |
parent | 1157b3039551b552b483f05f6a411e57941a87c0 (diff) |
Since hash() returns unsigned int, store results in unsigned ints
Clears clang warnings:
hash.c:82:13: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
int i = hash(key);
~ ^~~~~~~~~
hash.c:94:13: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
int i = hash(key);
~ ^~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -79,7 +79,7 @@ destroyHashTable(HashTablePtr table) char * getHash(HashTablePtr table, const char *key) { - int i = hash(key); + unsigned int i = hash(key); HashBucketPtr bp; for(bp = table[i]; bp; bp = bp->next) { if(strcasecmp(bp->key, key) == 0) @@ -91,7 +91,7 @@ getHash(HashTablePtr table, const char *key) int putHash(HashTablePtr table, char *key, char *value, int prio) { - int i = hash(key); + unsigned int i = hash(key); char *keycopy = NULL, *valuecopy = NULL; HashBucketPtr bp; for(bp = table[i]; bp; bp = bp->next) { |