From 67bb2c46b2b3882ba1ceadcbf94fab7d44b39ef6 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 7 Apr 2014 08:57:05 +0200 Subject: [PATCH] Add casting to match printf format. adjustOpenFilesLimit() and clusterUpdateSlotsWithConfig() that were assuming uint64_t is the same as unsigned long long, which is true probably for all the systems out there that we target, but still GCC emitted a warning since technically they are two different types. --- src/cluster.c | 5 +++-- src/redis.c | 14 +++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index 0e2f41456..106c5a41b 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1178,8 +1178,9 @@ void clusterUpdateSlotsConfigWith(clusterNode *sender, uint64_t senderConfigEpoc "I've still keys about this slot! " "Putting the slot in IMPORTING state. " "Please run the 'redis-trib fix' command.", - j, sender->name, senderConfigEpoch, - myself->configEpoch); + j, sender->name, + (unsigned long long) senderConfigEpoch, + (unsigned long long) myself->configEpoch); server.cluster->importing_slots_from[j] = sender; } diff --git a/src/redis.c b/src/redis.c index cc48f1de8..da821abf7 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1555,24 +1555,28 @@ void adjustOpenFilesLimit(void) { redisLog(REDIS_WARNING,"Your current 'ulimit -n' " "of %llu is not enough for Redis to start. " "Please increase your open file limit to at least " - "%llu. Exiting.", oldlimit, maxfiles); + "%llu. Exiting.", + (unsigned long long) oldlimit, + (unsigned long long) maxfiles); exit(1); } redisLog(REDIS_WARNING,"You requested maxclients of %d " "requiring at least %llu max file descriptors.", - old_maxclients, maxfiles); + old_maxclients, + (unsigned long long) maxfiles); redisLog(REDIS_WARNING,"Redis can't set maximum open files " "to %llu because of OS error: %s.", - maxfiles, strerror(setrlimit_error)); + (unsigned long long) maxfiles, strerror(setrlimit_error)); redisLog(REDIS_WARNING,"Current maximum open files is %llu. " "maxclients has been reduced to %d to compensate for " "low ulimit. " "If you need higher maxclients increase 'ulimit -n'.", - oldlimit, server.maxclients); + (unsigned long long) oldlimit, server.maxclients); } else { redisLog(REDIS_NOTICE,"Increased maximum number of open files " "to %llu (it was originally set to %llu).", - maxfiles, oldlimit); + (unsigned long long) maxfiles, + (unsigned long long) oldlimit); } } }