summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-19 11:51:39 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-19 11:51:39 -0800
commit547517571e695728278a264eedbac47b6e1f43bc (patch)
tree3bb3d1c1e61b4bf97c1e9970b778b3bf74d9868e
parent1157b3039551b552b483f05f6a411e57941a87c0 (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>
-rw-r--r--hash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 135380b..c2cf9ca 100644
--- a/hash.c
+++ b/hash.c
@@ -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) {