summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-11-04 12:21:16 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-11-06 14:19:08 -0800
commit3bc4d05ff753c1b8357455a614bc5d11fffcfc0e (patch)
tree5f73b4f9f9a0f53ef4292af6f80a51b5f75f5d44 /hash.c
parent19137ec2f129f91ce3adb46218c86e1bf547e661 (diff)
Resolve some -Wsign-conversion warnings from clang
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hash.c b/hash.c
index 5877dc6..6a60896 100644
--- a/hash.c
+++ b/hash.c
@@ -174,14 +174,14 @@ value_first_cmp(const void *v1, const void *v2)
HashBucketPtr *
hashArray(HashTablePtr table, int value_first)
{
- int j;
+ unsigned int j;
int n = hashElements(table);
HashBucketPtr *dst = malloc((n + 1) * sizeof(HashBucketPtr));
if (dst == NULL)
return NULL;
j = 0;
- for (int i = 0; i < NUMBUCKETS; i++) {
+ for (unsigned int i = 0; i < NUMBUCKETS; i++) {
while (table[i]) {
dst[j++] = table[i];
table[i] = table[i]->next;
@@ -198,7 +198,7 @@ hashArray(HashTablePtr table, int value_first)
void
destroyHashArray(HashBucketPtr *array)
{
- int i = 0;
+ unsigned int i = 0;
while (array[i]) {
free(array[i]->key);