Fix mac build warnings

This commit is contained in:
John Sully 2022-03-07 19:28:39 -05:00
parent 650553255c
commit f73ce412c8
6 changed files with 11 additions and 10 deletions

View File

@ -121,9 +121,9 @@ void StorageCache::bulkInsert(char **rgkeys, size_t *rgcbkeys, char **rgvals, si
* the element already exists. */ * the element already exists. */
long index; long index;
if ((index = _dictKeyIndex(m_pdict, de->key, (uint64_t)de->key, nullptr)) == -1) { if ((index = _dictKeyIndex(m_pdict, de->key, (uint64_t)de->key, nullptr)) == -1) {
dictEntry *de = dictFind(m_pdict, de->key); dictEntry *deLocal = dictFind(m_pdict, de->key);
serverAssert(de != nullptr); serverAssert(deLocal != nullptr);
de->v.s64++; deLocal->v.s64++;
m_collisionCount++; m_collisionCount++;
zfree(de); zfree(de);
} else { } else {

View File

@ -145,7 +145,7 @@ client *createClient(connection *conn, int iel) {
client_id = g_pserver->next_client_id.fetch_add(1); client_id = g_pserver->next_client_id.fetch_add(1);
c->iel = iel; c->iel = iel;
c->id = client_id; c->id = client_id;
sprintf(c->lock.szName, "client %lu", client_id); sprintf(c->lock.szName, "client %" PRIu64, client_id);
c->resp = 2; c->resp = 2;
c->conn = conn; c->conn = conn;
c->name = NULL; c->name = NULL;
@ -1345,7 +1345,7 @@ void acceptOnThread(connection *conn, int flags, char *cip)
szT = (char*)zmalloc(NET_IP_STR_LEN, MALLOC_LOCAL); szT = (char*)zmalloc(NET_IP_STR_LEN, MALLOC_LOCAL);
memcpy(szT, cip, NET_IP_STR_LEN); memcpy(szT, cip, NET_IP_STR_LEN);
} }
int res = aePostFunction(g_pserver->rgthreadvar[ielTarget].el, [conn, flags, ielTarget, szT, fBootLoad] { int res = aePostFunction(g_pserver->rgthreadvar[ielTarget].el, [conn, flags, ielTarget, szT] {
connMarshalThread(conn); connMarshalThread(conn);
acceptCommonHandler(conn,flags,szT,ielTarget); acceptCommonHandler(conn,flags,szT,ielTarget);
rgacceptsInFlight[ielTarget].fetch_sub(1, std::memory_order_relaxed); rgacceptsInFlight[ielTarget].fetch_sub(1, std::memory_order_relaxed);

View File

@ -1204,7 +1204,7 @@ int rdbSaveSnapshotForReplication(struct rdbSaveInfo *rsi) {
size_t snapshotDeclaredCount = spsnapshot->count(); size_t snapshotDeclaredCount = spsnapshot->count();
replBuf.addArrayLen(snapshotDeclaredCount); replBuf.addArrayLen(snapshotDeclaredCount);
size_t count = 0; size_t count = 0;
bool result = spsnapshot->enumerate([&replBuf, &count, &cbData, &lastLogTime, timeStart, &cbLastUpdate](const char *rgchKey, size_t cchKey, const void *rgchVal, size_t cchVal) -> bool{ bool result = spsnapshot->enumerate([&replBuf, &count, &cbData, &lastLogTime, &cbLastUpdate](const char *rgchKey, size_t cchKey, const void *rgchVal, size_t cchVal) -> bool{
replBuf.addArrayLen(2); replBuf.addArrayLen(2);
replBuf.addString(rgchKey, cchKey); replBuf.addString(rgchKey, cchKey);
@ -1578,7 +1578,7 @@ LError:
return; return;
} }
void processReplconfLicense(client *c, robj *arg) void processReplconfLicense(client *c, robj *)
{ {
// Only for back-compat // Only for back-compat
addReply(c, shared.ok); addReply(c, shared.ok);

View File

@ -1106,7 +1106,8 @@ public:
redisDbPersistentData(); redisDbPersistentData();
virtual ~redisDbPersistentData(); virtual ~redisDbPersistentData();
redisDbPersistentData(redisDbPersistentData &&) = default; redisDbPersistentData(const redisDbPersistentData &) = delete;
redisDbPersistentData(redisDbPersistentData &&) = delete;
size_t slots() const { return dictSlots(m_pdict); } size_t slots() const { return dictSlots(m_pdict); }
size_t size(bool fCachedOnly = false) const; size_t size(bool fCachedOnly = false) const;

View File

@ -626,7 +626,7 @@ bool redisDbPersistentDataSnapshot::iterate_threadsafe_core(std::function<bool(c
__atomic_load(&m_pdbSnapshot, &psnapshot, __ATOMIC_ACQUIRE); __atomic_load(&m_pdbSnapshot, &psnapshot, __ATOMIC_ACQUIRE);
if (fResult && psnapshot != nullptr) if (fResult && psnapshot != nullptr)
{ {
std::function<bool(const char*, robj_roptr o)> fnNew = [this, &fn, &celem, dictTombstone](const char *key, robj_roptr o) { std::function<bool(const char*, robj_roptr o)> fnNew = [&fn, &celem, dictTombstone](const char *key, robj_roptr o) {
dictEntry *deTombstone = dictFind(dictTombstone, key); dictEntry *deTombstone = dictFind(dictTombstone, key);
if (deTombstone != nullptr) if (deTombstone != nullptr)
return true; return true;

View File

@ -8,7 +8,7 @@ class TestStorageFactory : public IStorageFactory
virtual class IStorage *createMetadataDb() override; virtual class IStorage *createMetadataDb() override;
virtual const char *name() const override; virtual const char *name() const override;
virtual size_t totalDiskspaceUsed() const override { return 0; } virtual size_t totalDiskspaceUsed() const override { return 0; }
virtual bool FSlow() const { return false; } virtual bool FSlow() const override { return false; }
}; };
class TestStorageProvider final : public IStorage class TestStorageProvider final : public IStorage