From 50ce24a10c0ac780b833c957f976b90873ba71cc Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 3 Mar 2021 22:12:51 +0000 Subject: [PATCH] Fix compile warnings Former-commit-id: c314cab888e9c8b3e825b2dfe0c0392ee998bdc4 --- src/db.cpp | 1 + src/dict.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index 66c19552b..8b6b24d31 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -620,6 +620,7 @@ const dbBackup *backupDb(void) { /* Discard a previously created backup, this can be slow (similar to FLUSHALL) * Arguments are similar to the ones of emptyDb, see EMPTYDB_ flags. */ void discardDbBackup(const dbBackup *backup, int flags, void(callback)(void*)) { + UNUSED(callback); int async = (flags & EMPTYDB_ASYNC); /* Release main DBs backup . */ diff --git a/src/dict.cpp b/src/dict.cpp index 1d0a0e266..7a05ed062 100644 --- a/src/dict.cpp +++ b/src/dict.cpp @@ -378,7 +378,7 @@ dictAsyncRehashCtl *dictRehashAsyncStart(dict *d, int buckets) { int empty_visits = buckets * 10; - while (d->asyncdata->queue.size() < (size_t)buckets && d->rehashidx < d->ht[0].size) { + while (d->asyncdata->queue.size() < (size_t)buckets && (size_t)d->rehashidx < d->ht[0].size) { dictEntry *de; /* Note that rehashidx can't overflow as we are sure there are more @@ -386,7 +386,7 @@ dictAsyncRehashCtl *dictRehashAsyncStart(dict *d, int buckets) { while(d->ht[0].table[d->rehashidx] == NULL) { d->rehashidx++; if (--empty_visits == 0) goto LDone; - if (d->rehashidx >= d->ht[0].size) goto LDone; + if ((size_t)d->rehashidx >= d->ht[0].size) goto LDone; } de = d->ht[0].table[d->rehashidx]; @@ -666,7 +666,7 @@ static dictEntry *dictGenericDelete(dict *d, const void *key, int nofree) { else d->ht[table].table[idx] = he->next; if (!nofree) { - if (table == 0 && d->asyncdata != nullptr && idx < d->rehashidx) { + if (table == 0 && d->asyncdata != nullptr && (ssize_t)idx < d->rehashidx) { he->next = d->asyncdata->deGCList; d->asyncdata->deGCList = he->next; } else { @@ -746,7 +746,7 @@ int _dictClear(dict *d, dictht *ht, void(callback)(void *)) { if ((he = ht->table[i]) == NULL) continue; while(he) { nextHe = he->next; - if (d->asyncdata && i < d->rehashidx) { + if (d->asyncdata && (ssize_t)i < d->rehashidx) { he->next = d->asyncdata->deGCList; d->asyncdata->deGCList = he; } else {