Unverified Commit 5e3be1be authored by Madelyn Olson's avatar Madelyn Olson Committed by GitHub
Browse files

Remove prototypes with empty declarations (#12020)

Technically declaring a prototype with an empty declaration has been deprecated since the early days of C, but we never got a warning for it. C2x will apparently be introducing a breaking change if you are using this type of declarator, so Clang 15 has started issuing a warning with -pedantic. Although not apparently a problem for any of the compiler we build on, if feels like the right thing is to properly adhere to the C standard and use (void).
parent 8163e816
...@@ -789,7 +789,7 @@ int RM_GetApi(const char *funcname, void **targetPtrPtr) { ...@@ -789,7 +789,7 @@ int RM_GetApi(const char *funcname, void **targetPtrPtr) {
return REDISMODULE_OK; return REDISMODULE_OK;
} }
   
void modulePostExecutionUnitOperations() { void modulePostExecutionUnitOperations(void) {
if (server.execution_nesting) if (server.execution_nesting)
return; return;
   
...@@ -2276,7 +2276,7 @@ uint64_t RM_MonotonicMicroseconds(void) { ...@@ -2276,7 +2276,7 @@ uint64_t RM_MonotonicMicroseconds(void) {
} }
   
/* Return the current UNIX time in microseconds */ /* Return the current UNIX time in microseconds */
ustime_t RM_Microseconds() { ustime_t RM_Microseconds(void) {
return ustime(); return ustime();
} }
   
...@@ -2286,7 +2286,7 @@ ustime_t RM_Microseconds() { ...@@ -2286,7 +2286,7 @@ ustime_t RM_Microseconds() {
* key space notification, causing a module to execute a RedisModule_Call, * key space notification, causing a module to execute a RedisModule_Call,
* causing another notification, etc. * causing another notification, etc.
* It makes sense that all this callbacks would use the same clock. */ * It makes sense that all this callbacks would use the same clock. */
ustime_t RM_CachedMicroseconds() { ustime_t RM_CachedMicroseconds(void) {
return server.ustime; return server.ustime;
} }
   
...@@ -3913,7 +3913,7 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) { ...@@ -3913,7 +3913,7 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
* garbage collection tasks, or that do writes and replicate such writes * garbage collection tasks, or that do writes and replicate such writes
* periodically in timer callbacks or other periodic callbacks. * periodically in timer callbacks or other periodic callbacks.
*/ */
int RM_AvoidReplicaTraffic() { int RM_AvoidReplicaTraffic(void) {
return !!(isPausedActionsWithUpdate(PAUSE_ACTION_REPLICA)); return !!(isPausedActionsWithUpdate(PAUSE_ACTION_REPLICA));
} }
   
...@@ -4023,7 +4023,7 @@ RedisModuleKey *RM_OpenKey(RedisModuleCtx *ctx, robj *keyname, int mode) { ...@@ -4023,7 +4023,7 @@ RedisModuleKey *RM_OpenKey(RedisModuleCtx *ctx, robj *keyname, int mode) {
* // REDISMODULE_OPEN_KEY_NOTOUCH is not supported * // REDISMODULE_OPEN_KEY_NOTOUCH is not supported
* } * }
*/ */
int RM_GetOpenKeyModesAll() { int RM_GetOpenKeyModesAll(void) {
return _REDISMODULE_OPEN_KEY_ALL; return _REDISMODULE_OPEN_KEY_ALL;
} }
   
...@@ -6950,7 +6950,7 @@ void moduleRDBLoadError(RedisModuleIO *io) { ...@@ -6950,7 +6950,7 @@ void moduleRDBLoadError(RedisModuleIO *io) {
/* Returns 0 if there's at least one registered data type that did not declare /* Returns 0 if there's at least one registered data type that did not declare
* REDISMODULE_OPTIONS_HANDLE_IO_ERRORS, in which case diskless loading should * REDISMODULE_OPTIONS_HANDLE_IO_ERRORS, in which case diskless loading should
* be avoided since it could cause data loss. */ * be avoided since it could cause data loss. */
int moduleAllDatatypesHandleErrors() { int moduleAllDatatypesHandleErrors(void) {
dictIterator *di = dictGetIterator(modules); dictIterator *di = dictGetIterator(modules);
dictEntry *de; dictEntry *de;
   
...@@ -6970,7 +6970,7 @@ int moduleAllDatatypesHandleErrors() { ...@@ -6970,7 +6970,7 @@ int moduleAllDatatypesHandleErrors() {
/* Returns 0 if module did not declare REDISMODULE_OPTIONS_HANDLE_REPL_ASYNC_LOAD, in which case /* Returns 0 if module did not declare REDISMODULE_OPTIONS_HANDLE_REPL_ASYNC_LOAD, in which case
* diskless async loading should be avoided because module doesn't know there can be traffic during * diskless async loading should be avoided because module doesn't know there can be traffic during
* database full resynchronization. */ * database full resynchronization. */
int moduleAllModulesHandleReplAsyncLoad() { int moduleAllModulesHandleReplAsyncLoad(void) {
dictIterator *di = dictGetIterator(modules); dictIterator *di = dictGetIterator(modules);
dictEntry *de; dictEntry *de;
   
...@@ -8418,7 +8418,7 @@ void RM_FreeThreadSafeContext(RedisModuleCtx *ctx) { ...@@ -8418,7 +8418,7 @@ void RM_FreeThreadSafeContext(RedisModuleCtx *ctx) {
zfree(ctx); zfree(ctx);
} }
   
void moduleGILAfterLock() { void moduleGILAfterLock(void) {
/* We should never get here if we already inside a module /* We should never get here if we already inside a module
* code block which already opened a context. */ * code block which already opened a context. */
serverAssert(server.execution_nesting == 0); serverAssert(server.execution_nesting == 0);
...@@ -8454,7 +8454,7 @@ int RM_ThreadSafeContextTryLock(RedisModuleCtx *ctx) { ...@@ -8454,7 +8454,7 @@ int RM_ThreadSafeContextTryLock(RedisModuleCtx *ctx) {
return REDISMODULE_OK; return REDISMODULE_OK;
} }
   
void moduleGILBeforeUnlock() { void moduleGILBeforeUnlock(void) {
/* We should never get here if we already inside a module /* We should never get here if we already inside a module
* code block which already opened a context, except * code block which already opened a context, except
* the bump-up from moduleGILAcquired. */ * the bump-up from moduleGILAcquired. */
...@@ -8569,7 +8569,7 @@ int RM_SubscribeToKeyspaceEvents(RedisModuleCtx *ctx, int types, RedisModuleNoti ...@@ -8569,7 +8569,7 @@ int RM_SubscribeToKeyspaceEvents(RedisModuleCtx *ctx, int types, RedisModuleNoti
return REDISMODULE_OK; return REDISMODULE_OK;
} }
   
void firePostExecutionUnitJobs() { void firePostExecutionUnitJobs(void) {
/* Avoid propagation of commands. /* Avoid propagation of commands.
* In that way, postExecutionUnitOperations will prevent * In that way, postExecutionUnitOperations will prevent
* recursive calls to firePostExecutionUnitJobs. * recursive calls to firePostExecutionUnitJobs.
...@@ -8622,7 +8622,7 @@ int RM_AddPostNotificationJob(RedisModuleCtx *ctx, RedisModulePostNotificationJo ...@@ -8622,7 +8622,7 @@ int RM_AddPostNotificationJob(RedisModuleCtx *ctx, RedisModulePostNotificationJo
   
/* Get the configured bitmap of notify-keyspace-events (Could be used /* Get the configured bitmap of notify-keyspace-events (Could be used
* for additional filtering in RedisModuleNotificationFunc) */ * for additional filtering in RedisModuleNotificationFunc) */
int RM_GetNotifyKeyspaceEvents() { int RM_GetNotifyKeyspaceEvents(void) {
return server.notify_keyspace_events; return server.notify_keyspace_events;
} }
   
...@@ -9337,7 +9337,7 @@ int RM_EventLoopAddOneShot(RedisModuleEventLoopOneShotFunc func, void *user_data ...@@ -9337,7 +9337,7 @@ int RM_EventLoopAddOneShot(RedisModuleEventLoopOneShotFunc func, void *user_data
   
/* This function will check the moduleEventLoopOneShots queue in order to /* This function will check the moduleEventLoopOneShots queue in order to
* call the callback for the registered oneshot events. */ * call the callback for the registered oneshot events. */
static void eventLoopHandleOneShotEvents() { static void eventLoopHandleOneShotEvents(void) {
pthread_mutex_lock(&moduleEventLoopMutex); pthread_mutex_lock(&moduleEventLoopMutex);
if (moduleEventLoopOneShots) { if (moduleEventLoopOneShots) {
while (listLength(moduleEventLoopOneShots)) { while (listLength(moduleEventLoopOneShots)) {
...@@ -10438,7 +10438,7 @@ int RM_ExportSharedAPI(RedisModuleCtx *ctx, const char *apiname, void *func) { ...@@ -10438,7 +10438,7 @@ int RM_ExportSharedAPI(RedisModuleCtx *ctx, const char *apiname, void *func) {
* *
* Here is an example: * Here is an example:
* *
* int ... myCommandImplementation() { * int ... myCommandImplementation(void) {
* if (getExternalAPIs() == 0) { * if (getExternalAPIs() == 0) {
* reply with an error here if we cannot have the APIs * reply with an error here if we cannot have the APIs
* } * }
...@@ -10771,7 +10771,7 @@ size_t RM_MallocSizeDict(RedisModuleDict* dict) { ...@@ -10771,7 +10771,7 @@ size_t RM_MallocSizeDict(RedisModuleDict* dict) {
* * Exactly 1 - Memory limit reached. * * Exactly 1 - Memory limit reached.
* * Greater 1 - More memory used than the configured limit. * * Greater 1 - More memory used than the configured limit.
*/ */
float RM_GetUsedMemoryRatio(){ float RM_GetUsedMemoryRatio(void){
float level; float level;
getMaxmemoryState(NULL, NULL, NULL, &level); getMaxmemoryState(NULL, NULL, NULL, &level);
return level; return level;
...@@ -10810,7 +10810,7 @@ static void moduleScanCallback(void *privdata, const dictEntry *de) { ...@@ -10810,7 +10810,7 @@ static void moduleScanCallback(void *privdata, const dictEntry *de) {
} }
   
/* Create a new cursor to be used with RedisModule_Scan */ /* Create a new cursor to be used with RedisModule_Scan */
RedisModuleScanCursor *RM_ScanCursorCreate() { RedisModuleScanCursor *RM_ScanCursorCreate(void) {
RedisModuleScanCursor* cursor = zmalloc(sizeof(*cursor)); RedisModuleScanCursor* cursor = zmalloc(sizeof(*cursor));
cursor->cursor = 0; cursor->cursor = 0;
cursor->done = 0; cursor->done = 0;
...@@ -13068,7 +13068,7 @@ int RM_GetLFU(RedisModuleKey *key, long long *lfu_freq) { ...@@ -13068,7 +13068,7 @@ int RM_GetLFU(RedisModuleKey *key, long long *lfu_freq) {
* // REDISMODULE_OPTIONS_ALLOW_NESTED_KEYSPACE_NOTIFICATIONS is not supported * // REDISMODULE_OPTIONS_ALLOW_NESTED_KEYSPACE_NOTIFICATIONS is not supported
* } * }
*/ */
int RM_GetModuleOptionsAll() { int RM_GetModuleOptionsAll(void) {
return _REDISMODULE_OPTIONS_FLAGS_NEXT - 1; return _REDISMODULE_OPTIONS_FLAGS_NEXT - 1;
} }
   
...@@ -13085,7 +13085,7 @@ int RM_GetModuleOptionsAll() { ...@@ -13085,7 +13085,7 @@ int RM_GetModuleOptionsAll() {
* // REDISMODULE_CTX_FLAGS_MULTI is not supported * // REDISMODULE_CTX_FLAGS_MULTI is not supported
* } * }
*/ */
int RM_GetContextFlagsAll() { int RM_GetContextFlagsAll(void) {
return _REDISMODULE_CTX_FLAGS_NEXT - 1; return _REDISMODULE_CTX_FLAGS_NEXT - 1;
} }
   
...@@ -13102,7 +13102,7 @@ int RM_GetContextFlagsAll() { ...@@ -13102,7 +13102,7 @@ int RM_GetContextFlagsAll() {
* // REDISMODULE_NOTIFY_LOADED is not supported * // REDISMODULE_NOTIFY_LOADED is not supported
* } * }
*/ */
int RM_GetKeyspaceNotificationFlagsAll() { int RM_GetKeyspaceNotificationFlagsAll(void) {
return _REDISMODULE_NOTIFY_NEXT - 1; return _REDISMODULE_NOTIFY_NEXT - 1;
} }
   
...@@ -13110,7 +13110,7 @@ int RM_GetKeyspaceNotificationFlagsAll() { ...@@ -13110,7 +13110,7 @@ int RM_GetKeyspaceNotificationFlagsAll() {
* Return the redis version in format of 0x00MMmmpp. * Return the redis version in format of 0x00MMmmpp.
* Example for 6.0.7 the return value will be 0x00060007. * Example for 6.0.7 the return value will be 0x00060007.
*/ */
int RM_GetServerVersion() { int RM_GetServerVersion(void) {
return REDIS_VERSION_NUM; return REDIS_VERSION_NUM;
} }
   
...@@ -13119,7 +13119,7 @@ int RM_GetServerVersion() { ...@@ -13119,7 +13119,7 @@ int RM_GetServerVersion() {
* You can use that when calling RM_CreateDataType to know which fields of * You can use that when calling RM_CreateDataType to know which fields of
* RedisModuleTypeMethods are gonna be supported and which will be ignored. * RedisModuleTypeMethods are gonna be supported and which will be ignored.
*/ */
int RM_GetTypeMethodVersion() { int RM_GetTypeMethodVersion(void) {
return REDISMODULE_TYPE_METHOD_VERSION; return REDISMODULE_TYPE_METHOD_VERSION;
} }
   
......
...@@ -32,11 +32,11 @@ static char monotonic_info_string[32]; ...@@ -32,11 +32,11 @@ static char monotonic_info_string[32];
static long mono_ticksPerMicrosecond = 0; static long mono_ticksPerMicrosecond = 0;
static monotime getMonotonicUs_x86() { static monotime getMonotonicUs_x86(void) {
return __rdtsc() / mono_ticksPerMicrosecond; return __rdtsc() / mono_ticksPerMicrosecond;
} }
static void monotonicInit_x86linux() { static void monotonicInit_x86linux(void) {
const int bufflen = 256; const int bufflen = 256;
char buf[bufflen]; char buf[bufflen];
regex_t cpuGhzRegex, constTscRegex; regex_t cpuGhzRegex, constTscRegex;
...@@ -99,24 +99,24 @@ static void monotonicInit_x86linux() { ...@@ -99,24 +99,24 @@ static void monotonicInit_x86linux() {
static long mono_ticksPerMicrosecond = 0; static long mono_ticksPerMicrosecond = 0;
/* Read the clock value. */ /* Read the clock value. */
static inline uint64_t __cntvct() { static inline uint64_t __cntvct(void) {
uint64_t virtual_timer_value; uint64_t virtual_timer_value;
__asm__ volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); __asm__ volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
return virtual_timer_value; return virtual_timer_value;
} }
/* Read the Count-timer Frequency. */ /* Read the Count-timer Frequency. */
static inline uint32_t cntfrq_hz() { static inline uint32_t cntfrq_hz(void) {
uint64_t virtual_freq_value; uint64_t virtual_freq_value;
__asm__ volatile("mrs %0, cntfrq_el0" : "=r"(virtual_freq_value)); __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(virtual_freq_value));
return (uint32_t)virtual_freq_value; /* top 32 bits are reserved */ return (uint32_t)virtual_freq_value; /* top 32 bits are reserved */
} }
static monotime getMonotonicUs_aarch64() { static monotime getMonotonicUs_aarch64(void) {
return __cntvct() / mono_ticksPerMicrosecond; return __cntvct() / mono_ticksPerMicrosecond;
} }
static void monotonicInit_aarch64() { static void monotonicInit_aarch64(void) {
mono_ticksPerMicrosecond = (long)cntfrq_hz() / 1000L / 1000L; mono_ticksPerMicrosecond = (long)cntfrq_hz() / 1000L / 1000L;
if (mono_ticksPerMicrosecond == 0) { if (mono_ticksPerMicrosecond == 0) {
fprintf(stderr, "monotonic: aarch64, unable to determine clock rate"); fprintf(stderr, "monotonic: aarch64, unable to determine clock rate");
...@@ -130,7 +130,7 @@ static void monotonicInit_aarch64() { ...@@ -130,7 +130,7 @@ static void monotonicInit_aarch64() {
#endif #endif
static monotime getMonotonicUs_posix() { static monotime getMonotonicUs_posix(void) {
/* clock_gettime() is specified in POSIX.1b (1993). Even so, some systems /* clock_gettime() is specified in POSIX.1b (1993). Even so, some systems
* did not support this until much later. CLOCK_MONOTONIC is technically * did not support this until much later. CLOCK_MONOTONIC is technically
* optional and may not be supported - but it appears to be universal. * optional and may not be supported - but it appears to be universal.
...@@ -140,7 +140,7 @@ static monotime getMonotonicUs_posix() { ...@@ -140,7 +140,7 @@ static monotime getMonotonicUs_posix() {
return ((uint64_t)ts.tv_sec) * 1000000 + ts.tv_nsec / 1000; return ((uint64_t)ts.tv_sec) * 1000000 + ts.tv_nsec / 1000;
} }
static void monotonicInit_posix() { static void monotonicInit_posix(void) {
/* Ensure that CLOCK_MONOTONIC is supported. This should be supported /* Ensure that CLOCK_MONOTONIC is supported. This should be supported
* on any reasonably current OS. If the assertion below fails, provide * on any reasonably current OS. If the assertion below fails, provide
* an appropriate alternate implementation. */ * an appropriate alternate implementation. */
...@@ -155,7 +155,7 @@ static void monotonicInit_posix() { ...@@ -155,7 +155,7 @@ static void monotonicInit_posix() {
const char * monotonicInit() { const char * monotonicInit(void) {
#if defined(USE_PROCESSOR_CLOCK) && defined(__x86_64__) && defined(__linux__) #if defined(USE_PROCESSOR_CLOCK) && defined(__x86_64__) && defined(__linux__)
if (getMonotonicUs == NULL) monotonicInit_x86linux(); if (getMonotonicUs == NULL) monotonicInit_x86linux();
#endif #endif
...@@ -169,11 +169,11 @@ const char * monotonicInit() { ...@@ -169,11 +169,11 @@ const char * monotonicInit() {
return monotonic_info_string; return monotonic_info_string;
} }
const char *monotonicInfoString() { const char *monotonicInfoString(void) {
return monotonic_info_string; return monotonic_info_string;
} }
monotonic_clock_type monotonicGetType() { monotonic_clock_type monotonicGetType(void) {
if (getMonotonicUs == getMonotonicUs_posix) if (getMonotonicUs == getMonotonicUs_posix)
return MONOTONIC_CLOCK_POSIX; return MONOTONIC_CLOCK_POSIX;
return MONOTONIC_CLOCK_HW; return MONOTONIC_CLOCK_HW;
......
...@@ -33,13 +33,13 @@ typedef enum monotonic_clock_type { ...@@ -33,13 +33,13 @@ typedef enum monotonic_clock_type {
* needs to be called once, it may be called additional times without impact. * needs to be called once, it may be called additional times without impact.
* Returns a printable string indicating the type of clock initialized. * Returns a printable string indicating the type of clock initialized.
* (The returned string is static and doesn't need to be freed.) */ * (The returned string is static and doesn't need to be freed.) */
const char *monotonicInit(); const char *monotonicInit(void);
/* Return a string indicating the type of monotonic clock being used. */ /* Return a string indicating the type of monotonic clock being used. */
const char *monotonicInfoString(); const char *monotonicInfoString(void);
/* Return the type of monotonic clock being used. */ /* Return the type of monotonic clock being used. */
monotonic_clock_type monotonicGetType(); monotonic_clock_type monotonicGetType(void);
/* Functions to measure elapsed time. Example: /* Functions to measure elapsed time. Example:
* monotime myTimer; * monotime myTimer;
......
...@@ -3981,7 +3981,7 @@ void updatePausedActions(void) { ...@@ -3981,7 +3981,7 @@ void updatePausedActions(void) {
/* Unblock all paused clients (ones that where blocked by BLOCKED_POSTPONE (possibly in processCommand). /* Unblock all paused clients (ones that where blocked by BLOCKED_POSTPONE (possibly in processCommand).
* This means they'll get re-processed in beforeSleep, and may get paused again if needed. */ * This means they'll get re-processed in beforeSleep, and may get paused again if needed. */
void unblockPostponedClients() { void unblockPostponedClients(void) {
listNode *ln; listNode *ln;
listIter li; listIter li;
listRewind(server.postponed_clients, &li); listRewind(server.postponed_clients, &li);
......
...@@ -207,12 +207,12 @@ void addReplyPubsubPatUnsubscribed(client *c, robj *pattern) { ...@@ -207,12 +207,12 @@ void addReplyPubsubPatUnsubscribed(client *c, robj *pattern) {
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
/* Return the number of pubsub channels + patterns is handled. */ /* Return the number of pubsub channels + patterns is handled. */
int serverPubsubSubscriptionCount() { int serverPubsubSubscriptionCount(void) {
return dictSize(server.pubsub_channels) + dictSize(server.pubsub_patterns); return dictSize(server.pubsub_channels) + dictSize(server.pubsub_patterns);
} }
/* Return the number of pubsub shard level channels is handled. */ /* Return the number of pubsub shard level channels is handled. */
int serverPubsubShardSubscriptionCount() { int serverPubsubShardSubscriptionCount(void) {
return dictSize(server.pubsubshard_channels); return dictSize(server.pubsubshard_channels);
} }
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
static uint32_t x[3] = { X0, X1, X2 }, a[3] = { A0, A1, A2 }, c = C; static uint32_t x[3] = { X0, X1, X2 }, a[3] = { A0, A1, A2 }, c = C;
static void next(void); static void next(void);
int32_t redisLrand48() { int32_t redisLrand48(void) {
next(); next();
return (((int32_t)x[2] << (N - 1)) + (x[1] >> 1)); return (((int32_t)x[2] << (N - 1)) + (x[1] >> 1));
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#ifndef REDIS_RANDOM_H #ifndef REDIS_RANDOM_H
#define REDIS_RANDOM_H #define REDIS_RANDOM_H
int32_t redisLrand48(); int32_t redisLrand48(void);
void redisSrand48(int32_t seedval); void redisSrand48(int32_t seedval);
#define REDIS_LRAND48_MAX INT32_MAX #define REDIS_LRAND48_MAX INT32_MAX
......
...@@ -192,7 +192,7 @@ static void writeHandler(aeEventLoop *el, int fd, void *privdata, int mask); ...@@ -192,7 +192,7 @@ static void writeHandler(aeEventLoop *el, int fd, void *privdata, int mask);
static void createMissingClients(client c); static void createMissingClients(client c);
static benchmarkThread *createBenchmarkThread(int index); static benchmarkThread *createBenchmarkThread(int index);
static void freeBenchmarkThread(benchmarkThread *thread); static void freeBenchmarkThread(benchmarkThread *thread);
static void freeBenchmarkThreads(); static void freeBenchmarkThreads(void);
static void *execBenchmarkThread(void *ptr); static void *execBenchmarkThread(void *ptr);
static clusterNode *createClusterNode(char *ip, int port); static clusterNode *createClusterNode(char *ip, int port);
static redisConfig *getRedisConfig(const char *ip, int port, static redisConfig *getRedisConfig(const char *ip, int port,
...@@ -201,7 +201,7 @@ static redisContext *getRedisContext(const char *ip, int port, ...@@ -201,7 +201,7 @@ static redisContext *getRedisContext(const char *ip, int port,
const char *hostsocket); const char *hostsocket);
static void freeRedisConfig(redisConfig *cfg); static void freeRedisConfig(redisConfig *cfg);
static int fetchClusterSlotsConfiguration(client c); static int fetchClusterSlotsConfiguration(client c);
static void updateClusterSlotsConfiguration(); static void updateClusterSlotsConfiguration(void);
int showThroughput(struct aeEventLoop *eventLoop, long long id, int showThroughput(struct aeEventLoop *eventLoop, long long id,
void *clientData); void *clientData);
...@@ -958,7 +958,7 @@ static void showLatencyReport(void) { ...@@ -958,7 +958,7 @@ static void showLatencyReport(void) {
} }
} }
static void initBenchmarkThreads() { static void initBenchmarkThreads(void) {
int i; int i;
if (config.threads) freeBenchmarkThreads(); if (config.threads) freeBenchmarkThreads();
config.threads = zmalloc(config.num_threads * sizeof(benchmarkThread*)); config.threads = zmalloc(config.num_threads * sizeof(benchmarkThread*));
...@@ -968,7 +968,7 @@ static void initBenchmarkThreads() { ...@@ -968,7 +968,7 @@ static void initBenchmarkThreads() {
} }
} }
static void startBenchmarkThreads() { static void startBenchmarkThreads(void) {
int i; int i;
for (i = 0; i < config.num_threads; i++) { for (i = 0; i < config.num_threads; i++) {
benchmarkThread *t = config.threads[i]; benchmarkThread *t = config.threads[i];
...@@ -1035,7 +1035,7 @@ static void freeBenchmarkThread(benchmarkThread *thread) { ...@@ -1035,7 +1035,7 @@ static void freeBenchmarkThread(benchmarkThread *thread) {
zfree(thread); zfree(thread);
} }
static void freeBenchmarkThreads() { static void freeBenchmarkThreads(void) {
int i = 0; int i = 0;
for (; i < config.num_threads; i++) { for (; i < config.num_threads; i++) {
benchmarkThread *thread = config.threads[i]; benchmarkThread *thread = config.threads[i];
...@@ -1096,7 +1096,7 @@ static void freeClusterNode(clusterNode *node) { ...@@ -1096,7 +1096,7 @@ static void freeClusterNode(clusterNode *node) {
zfree(node); zfree(node);
} }
static void freeClusterNodes() { static void freeClusterNodes(void) {
int i = 0; int i = 0;
for (; i < config.cluster_node_count; i++) { for (; i < config.cluster_node_count; i++) {
clusterNode *n = config.cluster_nodes[i]; clusterNode *n = config.cluster_nodes[i];
...@@ -1118,7 +1118,7 @@ static clusterNode **addClusterNode(clusterNode *node) { ...@@ -1118,7 +1118,7 @@ static clusterNode **addClusterNode(clusterNode *node) {
/* TODO: This should be refactored to use CLUSTER SLOTS, the migrating/importing /* TODO: This should be refactored to use CLUSTER SLOTS, the migrating/importing
* information is anyway not used. * information is anyway not used.
*/ */
static int fetchClusterConfiguration() { static int fetchClusterConfiguration(void) {
int success = 1; int success = 1;
redisContext *ctx = NULL; redisContext *ctx = NULL;
redisReply *reply = NULL; redisReply *reply = NULL;
...@@ -1377,7 +1377,7 @@ cleanup: ...@@ -1377,7 +1377,7 @@ cleanup:
} }
/* Atomically update the new slots configuration. */ /* Atomically update the new slots configuration. */
static void updateClusterSlotsConfiguration() { static void updateClusterSlotsConfiguration(void) {
pthread_mutex_lock(&config.is_updating_slots_mutex); pthread_mutex_lock(&config.is_updating_slots_mutex);
atomicSet(config.is_updating_slots, 1); atomicSet(config.is_updating_slots, 1);
int i; int i;
......
...@@ -848,7 +848,7 @@ static size_t cliLegacyCountCommands(struct commandDocs *commands, sds version) ...@@ -848,7 +848,7 @@ static size_t cliLegacyCountCommands(struct commandDocs *commands, sds version)
/* Gets the server version string by calling INFO SERVER. /* Gets the server version string by calling INFO SERVER.
* Stores the result in config.server_version. * Stores the result in config.server_version.
* When not connected, or not possible, returns NULL. */ * When not connected, or not possible, returns NULL. */
static sds cliGetServerVersion() { static sds cliGetServerVersion(void) {
static const char *key = "\nredis_version:"; static const char *key = "\nredis_version:";
redisReply *serverInfo = NULL; redisReply *serverInfo = NULL;
char *pos; char *pos;
...@@ -1724,7 +1724,7 @@ static int cliConnect(int flags) { ...@@ -1724,7 +1724,7 @@ static int cliConnect(int flags) {
/* In cluster, if server replies ASK, we will redirect to a different node. /* In cluster, if server replies ASK, we will redirect to a different node.
* Before sending the real command, we need to send ASKING command first. */ * Before sending the real command, we need to send ASKING command first. */
static int cliSendAsking() { static int cliSendAsking(void) {
redisReply *reply; redisReply *reply;
config.cluster_send_asking = 0; config.cluster_send_asking = 0;
...@@ -2319,7 +2319,7 @@ static int cliReadReply(int output_raw_strings) { ...@@ -2319,7 +2319,7 @@ static int cliReadReply(int output_raw_strings) {
} }
/* Simultaneously wait for pubsub messages from redis and input on stdin. */ /* Simultaneously wait for pubsub messages from redis and input on stdin. */
static void cliWaitForMessagesOrStdin() { static void cliWaitForMessagesOrStdin(void) {
int show_info = config.output != OUTPUT_RAW && (isatty(STDOUT_FILENO) || int show_info = config.output != OUTPUT_RAW && (isatty(STDOUT_FILENO) ||
getenv("FAKETTY")); getenv("FAKETTY"));
int use_color = show_info && isColorTerm(); int use_color = show_info && isColorTerm();
...@@ -2965,7 +2965,7 @@ static int parseOptions(int argc, char **argv) { ...@@ -2965,7 +2965,7 @@ static int parseOptions(int argc, char **argv) {
return i; return i;
} }
static void parseEnv() { static void parseEnv(void) {
/* Set auth from env, but do not overwrite CLI arguments if passed */ /* Set auth from env, but do not overwrite CLI arguments if passed */
char *auth = getenv(REDIS_CLI_AUTH_ENV); char *auth = getenv(REDIS_CLI_AUTH_ENV);
if (auth != NULL && config.conn_info.auth == NULL) { if (auth != NULL && config.conn_info.auth == NULL) {
...@@ -5870,7 +5870,7 @@ static clusterManagerNode * clusterManagerGetNodeWithMostKeysInSlot(list *nodes, ...@@ -5870,7 +5870,7 @@ static clusterManagerNode * clusterManagerGetNodeWithMostKeysInSlot(list *nodes,
* in the cluster. If there are multiple masters with the same smaller * in the cluster. If there are multiple masters with the same smaller
* number of replicas, one at random is returned. */ * number of replicas, one at random is returned. */
static clusterManagerNode *clusterManagerNodeWithLeastReplicas() { static clusterManagerNode *clusterManagerNodeWithLeastReplicas(void) {
clusterManagerNode *node = NULL; clusterManagerNode *node = NULL;
int lowest_count = 0; int lowest_count = 0;
listIter li; listIter li;
...@@ -5889,7 +5889,7 @@ static clusterManagerNode *clusterManagerNodeWithLeastReplicas() { ...@@ -5889,7 +5889,7 @@ static clusterManagerNode *clusterManagerNodeWithLeastReplicas() {
/* This function returns a random master node, return NULL if none */ /* This function returns a random master node, return NULL if none */
static clusterManagerNode *clusterManagerNodeMasterRandom() { static clusterManagerNode *clusterManagerNodeMasterRandom(void) {
int master_count = 0; int master_count = 0;
int idx; int idx;
listIter li; listIter li;
...@@ -8391,7 +8391,7 @@ int sendReplconf(const char* arg1, const char* arg2) { ...@@ -8391,7 +8391,7 @@ int sendReplconf(const char* arg1, const char* arg2) {
return res; return res;
} }
void sendCapa() { void sendCapa(void) {
sendReplconf("capa", "eof"); sendReplconf("capa", "eof");
} }
......
...@@ -976,7 +976,7 @@ REDISMODULE_API int (*RedisModule_GetSelectedDb)(RedisModuleCtx *ctx) REDISMODUL ...@@ -976,7 +976,7 @@ REDISMODULE_API int (*RedisModule_GetSelectedDb)(RedisModuleCtx *ctx) REDISMODUL
REDISMODULE_API int (*RedisModule_SelectDb)(RedisModuleCtx *ctx, int newid) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_SelectDb)(RedisModuleCtx *ctx, int newid) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_KeyExists)(RedisModuleCtx *ctx, RedisModuleString *keyname) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_KeyExists)(RedisModuleCtx *ctx, RedisModuleString *keyname) REDISMODULE_ATTR;
REDISMODULE_API RedisModuleKey * (*RedisModule_OpenKey)(RedisModuleCtx *ctx, RedisModuleString *keyname, int mode) REDISMODULE_ATTR; REDISMODULE_API RedisModuleKey * (*RedisModule_OpenKey)(RedisModuleCtx *ctx, RedisModuleString *keyname, int mode) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetOpenKeyModesAll)() REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_GetOpenKeyModesAll)(void) REDISMODULE_ATTR;
REDISMODULE_API void (*RedisModule_CloseKey)(RedisModuleKey *kp) REDISMODULE_ATTR; REDISMODULE_API void (*RedisModule_CloseKey)(RedisModuleKey *kp) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_KeyType)(RedisModuleKey *kp) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_KeyType)(RedisModuleKey *kp) REDISMODULE_ATTR;
REDISMODULE_API size_t (*RedisModule_ValueLength)(RedisModuleKey *kp) REDISMODULE_ATTR; REDISMODULE_API size_t (*RedisModule_ValueLength)(RedisModuleKey *kp) REDISMODULE_ATTR;
...@@ -1098,7 +1098,7 @@ REDISMODULE_API int (*RedisModule_SetClientNameById)(uint64_t id, RedisModuleStr ...@@ -1098,7 +1098,7 @@ REDISMODULE_API int (*RedisModule_SetClientNameById)(uint64_t id, RedisModuleStr
REDISMODULE_API int (*RedisModule_PublishMessage)(RedisModuleCtx *ctx, RedisModuleString *channel, RedisModuleString *message) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_PublishMessage)(RedisModuleCtx *ctx, RedisModuleString *channel, RedisModuleString *message) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_PublishMessageShard)(RedisModuleCtx *ctx, RedisModuleString *channel, RedisModuleString *message) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_PublishMessageShard)(RedisModuleCtx *ctx, RedisModuleString *channel, RedisModuleString *message) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetContextFlags)(RedisModuleCtx *ctx) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_GetContextFlags)(RedisModuleCtx *ctx) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_AvoidReplicaTraffic)() REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_AvoidReplicaTraffic)(void) REDISMODULE_ATTR;
REDISMODULE_API void * (*RedisModule_PoolAlloc)(RedisModuleCtx *ctx, size_t bytes) REDISMODULE_ATTR; REDISMODULE_API void * (*RedisModule_PoolAlloc)(RedisModuleCtx *ctx, size_t bytes) REDISMODULE_ATTR;
REDISMODULE_API RedisModuleType * (*RedisModule_CreateDataType)(RedisModuleCtx *ctx, const char *name, int encver, RedisModuleTypeMethods *typemethods) REDISMODULE_ATTR; REDISMODULE_API RedisModuleType * (*RedisModule_CreateDataType)(RedisModuleCtx *ctx, const char *name, int encver, RedisModuleTypeMethods *typemethods) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_ModuleTypeSetValue)(RedisModuleKey *key, RedisModuleType *mt, void *value) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_ModuleTypeSetValue)(RedisModuleKey *key, RedisModuleType *mt, void *value) REDISMODULE_ATTR;
...@@ -1201,17 +1201,17 @@ REDISMODULE_API RedisModuleBlockedClient * (*RedisModule_BlockClientOnKeys)(Redi ...@@ -1201,17 +1201,17 @@ REDISMODULE_API RedisModuleBlockedClient * (*RedisModule_BlockClientOnKeys)(Redi
REDISMODULE_API RedisModuleBlockedClient * (*RedisModule_BlockClientOnKeysWithFlags)(RedisModuleCtx *ctx, RedisModuleCmdFunc reply_callback, RedisModuleCmdFunc timeout_callback, void (*free_privdata)(RedisModuleCtx*,void*), long long timeout_ms, RedisModuleString **keys, int numkeys, void *privdata, int flags) REDISMODULE_ATTR; REDISMODULE_API RedisModuleBlockedClient * (*RedisModule_BlockClientOnKeysWithFlags)(RedisModuleCtx *ctx, RedisModuleCmdFunc reply_callback, RedisModuleCmdFunc timeout_callback, void (*free_privdata)(RedisModuleCtx*,void*), long long timeout_ms, RedisModuleString **keys, int numkeys, void *privdata, int flags) REDISMODULE_ATTR;
REDISMODULE_API void (*RedisModule_SignalKeyAsReady)(RedisModuleCtx *ctx, RedisModuleString *key) REDISMODULE_ATTR; REDISMODULE_API void (*RedisModule_SignalKeyAsReady)(RedisModuleCtx *ctx, RedisModuleString *key) REDISMODULE_ATTR;
REDISMODULE_API RedisModuleString * (*RedisModule_GetBlockedClientReadyKey)(RedisModuleCtx *ctx) REDISMODULE_ATTR; REDISMODULE_API RedisModuleString * (*RedisModule_GetBlockedClientReadyKey)(RedisModuleCtx *ctx) REDISMODULE_ATTR;
REDISMODULE_API RedisModuleScanCursor * (*RedisModule_ScanCursorCreate)() REDISMODULE_ATTR; REDISMODULE_API RedisModuleScanCursor * (*RedisModule_ScanCursorCreate)(void) REDISMODULE_ATTR;
REDISMODULE_API void (*RedisModule_ScanCursorRestart)(RedisModuleScanCursor *cursor) REDISMODULE_ATTR; REDISMODULE_API void (*RedisModule_ScanCursorRestart)(RedisModuleScanCursor *cursor) REDISMODULE_ATTR;
REDISMODULE_API void (*RedisModule_ScanCursorDestroy)(RedisModuleScanCursor *cursor) REDISMODULE_ATTR; REDISMODULE_API void (*RedisModule_ScanCursorDestroy)(RedisModuleScanCursor *cursor) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_Scan)(RedisModuleCtx *ctx, RedisModuleScanCursor *cursor, RedisModuleScanCB fn, void *privdata) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_Scan)(RedisModuleCtx *ctx, RedisModuleScanCursor *cursor, RedisModuleScanCB fn, void *privdata) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_ScanKey)(RedisModuleKey *key, RedisModuleScanCursor *cursor, RedisModuleScanKeyCB fn, void *privdata) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_ScanKey)(RedisModuleKey *key, RedisModuleScanCursor *cursor, RedisModuleScanKeyCB fn, void *privdata) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetContextFlagsAll)() REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_GetContextFlagsAll)(void) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetModuleOptionsAll)() REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_GetModuleOptionsAll)(void) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetKeyspaceNotificationFlagsAll)() REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_GetKeyspaceNotificationFlagsAll)(void) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_IsSubEventSupported)(RedisModuleEvent event, uint64_t subevent) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_IsSubEventSupported)(RedisModuleEvent event, uint64_t subevent) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetServerVersion)() REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_GetServerVersion)(void) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetTypeMethodVersion)() REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_GetTypeMethodVersion)(void) REDISMODULE_ATTR;
REDISMODULE_API void (*RedisModule_Yield)(RedisModuleCtx *ctx, int flags, const char *busy_reply) REDISMODULE_ATTR; REDISMODULE_API void (*RedisModule_Yield)(RedisModuleCtx *ctx, int flags, const char *busy_reply) REDISMODULE_ATTR;
REDISMODULE_API RedisModuleBlockedClient * (*RedisModule_BlockClient)(RedisModuleCtx *ctx, RedisModuleCmdFunc reply_callback, RedisModuleCmdFunc timeout_callback, void (*free_privdata)(RedisModuleCtx*,void*), long long timeout_ms) REDISMODULE_ATTR; REDISMODULE_API RedisModuleBlockedClient * (*RedisModule_BlockClient)(RedisModuleCtx *ctx, RedisModuleCmdFunc reply_callback, RedisModuleCmdFunc timeout_callback, void (*free_privdata)(RedisModuleCtx*,void*), long long timeout_ms) REDISMODULE_ATTR;
REDISMODULE_API void * (*RedisModule_BlockClientGetPrivateData)(RedisModuleBlockedClient *blocked_client) REDISMODULE_ATTR; REDISMODULE_API void * (*RedisModule_BlockClientGetPrivateData)(RedisModuleBlockedClient *blocked_client) REDISMODULE_ATTR;
...@@ -1234,7 +1234,7 @@ REDISMODULE_API void (*RedisModule_ThreadSafeContextUnlock)(RedisModuleCtx *ctx) ...@@ -1234,7 +1234,7 @@ REDISMODULE_API void (*RedisModule_ThreadSafeContextUnlock)(RedisModuleCtx *ctx)
REDISMODULE_API int (*RedisModule_SubscribeToKeyspaceEvents)(RedisModuleCtx *ctx, int types, RedisModuleNotificationFunc cb) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_SubscribeToKeyspaceEvents)(RedisModuleCtx *ctx, int types, RedisModuleNotificationFunc cb) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_AddPostNotificationJob)(RedisModuleCtx *ctx, RedisModulePostNotificationJobFunc callback, void *pd, void (*free_pd)(void*)) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_AddPostNotificationJob)(RedisModuleCtx *ctx, RedisModulePostNotificationJobFunc callback, void *pd, void (*free_pd)(void*)) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_NotifyKeyspaceEvent)(RedisModuleCtx *ctx, int type, const char *event, RedisModuleString *key) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_NotifyKeyspaceEvent)(RedisModuleCtx *ctx, int type, const char *event, RedisModuleString *key) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_GetNotifyKeyspaceEvents)() REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_GetNotifyKeyspaceEvents)(void) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_BlockedClientDisconnected)(RedisModuleCtx *ctx) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_BlockedClientDisconnected)(RedisModuleCtx *ctx) REDISMODULE_ATTR;
REDISMODULE_API void (*RedisModule_RegisterClusterMessageReceiver)(RedisModuleCtx *ctx, uint8_t type, RedisModuleClusterMessageReceiver callback) REDISMODULE_ATTR; REDISMODULE_API void (*RedisModule_RegisterClusterMessageReceiver)(RedisModuleCtx *ctx, uint8_t type, RedisModuleClusterMessageReceiver callback) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_SendClusterMessage)(RedisModuleCtx *ctx, const char *target_id, uint8_t type, const char *msg, uint32_t len) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_SendClusterMessage)(RedisModuleCtx *ctx, const char *target_id, uint8_t type, const char *msg, uint32_t len) REDISMODULE_ATTR;
...@@ -1263,7 +1263,7 @@ REDISMODULE_API int (*RedisModule_Fork)(RedisModuleForkDoneHandler cb, void *use ...@@ -1263,7 +1263,7 @@ REDISMODULE_API int (*RedisModule_Fork)(RedisModuleForkDoneHandler cb, void *use
REDISMODULE_API void (*RedisModule_SendChildHeartbeat)(double progress) REDISMODULE_ATTR; REDISMODULE_API void (*RedisModule_SendChildHeartbeat)(double progress) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_ExitFromChild)(int retcode) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_ExitFromChild)(int retcode) REDISMODULE_ATTR;
REDISMODULE_API int (*RedisModule_KillForkChild)(int child_pid) REDISMODULE_ATTR; REDISMODULE_API int (*RedisModule_KillForkChild)(int child_pid) REDISMODULE_ATTR;
REDISMODULE_API float (*RedisModule_GetUsedMemoryRatio)() REDISMODULE_ATTR; REDISMODULE_API float (*RedisModule_GetUsedMemoryRatio)(void) REDISMODULE_ATTR;
REDISMODULE_API size_t (*RedisModule_MallocSize)(void* ptr) REDISMODULE_ATTR; REDISMODULE_API size_t (*RedisModule_MallocSize)(void* ptr) REDISMODULE_ATTR;
REDISMODULE_API size_t (*RedisModule_MallocUsableSize)(void *ptr) REDISMODULE_ATTR; REDISMODULE_API size_t (*RedisModule_MallocUsableSize)(void *ptr) REDISMODULE_ATTR;
REDISMODULE_API size_t (*RedisModule_MallocSizeString)(RedisModuleString* str) REDISMODULE_ATTR; REDISMODULE_API size_t (*RedisModule_MallocSizeString)(RedisModuleString* str) REDISMODULE_ATTR;
......
...@@ -55,7 +55,7 @@ int cancelReplicationHandshake(int reconnect); ...@@ -55,7 +55,7 @@ int cancelReplicationHandshake(int reconnect);
int RDBGeneratedByReplication = 0; int RDBGeneratedByReplication = 0;
/* --------------------------- Utility functions ---------------------------- */ /* --------------------------- Utility functions ---------------------------- */
static ConnectionType *connTypeOfReplication() { static ConnectionType *connTypeOfReplication(void) {
if (server.tls_replication) { if (server.tls_replication) {
return connectionTypeTls(); return connectionTypeTls();
} }
...@@ -1793,7 +1793,7 @@ void replicationCreateMasterClient(connection *conn, int dbid) { ...@@ -1793,7 +1793,7 @@ void replicationCreateMasterClient(connection *conn, int dbid) {
* master-replica synchronization: if it fails after multiple attempts * master-replica synchronization: if it fails after multiple attempts
* the replica cannot be considered reliable and exists with an * the replica cannot be considered reliable and exists with an
* error. */ * error. */
void restartAOFAfterSYNC() { void restartAOFAfterSYNC(void) {
unsigned int tries, max_tries = 10; unsigned int tries, max_tries = 10;
for (tries = 0; tries < max_tries; ++tries) { for (tries = 0; tries < max_tries; ++tries) {
if (startAppendOnly() == C_OK) break; if (startAppendOnly() == C_OK) break;
...@@ -1810,7 +1810,7 @@ void restartAOFAfterSYNC() { ...@@ -1810,7 +1810,7 @@ void restartAOFAfterSYNC() {
} }
} }
static int useDisklessLoad() { static int useDisklessLoad(void) {
/* compute boolean decision to use diskless load */ /* compute boolean decision to use diskless load */
int enabled = server.repl_diskless_load == REPL_DISKLESS_LOAD_SWAPDB || int enabled = server.repl_diskless_load == REPL_DISKLESS_LOAD_SWAPDB ||
(server.repl_diskless_load == REPL_DISKLESS_LOAD_WHEN_DB_EMPTY && dbTotalServerKeyCount()==0); (server.repl_diskless_load == REPL_DISKLESS_LOAD_WHEN_DB_EMPTY && dbTotalServerKeyCount()==0);
...@@ -1849,7 +1849,7 @@ void disklessLoadDiscardTempDb(redisDb *tempDb) { ...@@ -1849,7 +1849,7 @@ void disklessLoadDiscardTempDb(redisDb *tempDb) {
* we have no way to incrementally feed our replicas after that. * we have no way to incrementally feed our replicas after that.
* We want our replicas to resync with us as well, if we have any sub-replicas. * We want our replicas to resync with us as well, if we have any sub-replicas.
* This is useful on readSyncBulkPayload in places where we just finished transferring db. */ * This is useful on readSyncBulkPayload in places where we just finished transferring db. */
void replicationAttachToNewMaster() { void replicationAttachToNewMaster(void) {
/* Replica starts to apply data from new master, we must discard the cached /* Replica starts to apply data from new master, we must discard the cached
* master structure. */ * master structure. */
serverAssert(server.master == NULL); serverAssert(server.master == NULL);
...@@ -3993,7 +3993,7 @@ static client *findReplica(char *host, int port) { ...@@ -3993,7 +3993,7 @@ static client *findReplica(char *host, int port) {
return NULL; return NULL;
} }
const char *getFailoverStateString() { const char *getFailoverStateString(void) {
switch(server.failover_state) { switch(server.failover_state) {
case NO_FAILOVER: return "no-failover"; case NO_FAILOVER: return "no-failover";
case FAILOVER_IN_PROGRESS: return "failover-in-progress"; case FAILOVER_IN_PROGRESS: return "failover-in-progress";
...@@ -4005,7 +4005,7 @@ const char *getFailoverStateString() { ...@@ -4005,7 +4005,7 @@ const char *getFailoverStateString() {
/* Resets the internal failover configuration, this needs /* Resets the internal failover configuration, this needs
* to be called after a failover either succeeds or fails * to be called after a failover either succeeds or fails
* as it includes the client unpause. */ * as it includes the client unpause. */
void clearFailoverState() { void clearFailoverState(void) {
server.failover_end_time = 0; server.failover_end_time = 0;
server.force_failover = 0; server.force_failover = 0;
zfree(server.target_replica_host); zfree(server.target_replica_host);
......
...@@ -60,16 +60,16 @@ static void enterScriptTimedoutMode(scriptRunCtx *run_ctx) { ...@@ -60,16 +60,16 @@ static void enterScriptTimedoutMode(scriptRunCtx *run_ctx) {
blockingOperationStarts(); blockingOperationStarts();
} }
int scriptIsTimedout() { int scriptIsTimedout(void) {
return scriptIsRunning() && (curr_run_ctx->flags & SCRIPT_TIMEDOUT); return scriptIsRunning() && (curr_run_ctx->flags & SCRIPT_TIMEDOUT);
} }
client* scriptGetClient() { client* scriptGetClient(void) {
serverAssert(scriptIsRunning()); serverAssert(scriptIsRunning());
return curr_run_ctx->c; return curr_run_ctx->c;
} }
client* scriptGetCaller() { client* scriptGetCaller(void) {
serverAssert(scriptIsRunning()); serverAssert(scriptIsRunning());
return curr_run_ctx->original_client; return curr_run_ctx->original_client;
} }
...@@ -269,16 +269,16 @@ void scriptResetRun(scriptRunCtx *run_ctx) { ...@@ -269,16 +269,16 @@ void scriptResetRun(scriptRunCtx *run_ctx) {
} }
/* return true if a script is currently running */ /* return true if a script is currently running */
int scriptIsRunning() { int scriptIsRunning(void) {
return curr_run_ctx != NULL; return curr_run_ctx != NULL;
} }
const char* scriptCurrFunction() { const char* scriptCurrFunction(void) {
serverAssert(scriptIsRunning()); serverAssert(scriptIsRunning());
return curr_run_ctx->funcname; return curr_run_ctx->funcname;
} }
int scriptIsEval() { int scriptIsEval(void) {
serverAssert(scriptIsRunning()); serverAssert(scriptIsRunning());
return curr_run_ctx->flags & SCRIPT_EVAL_MODE; return curr_run_ctx->flags & SCRIPT_EVAL_MODE;
} }
...@@ -571,7 +571,7 @@ error: ...@@ -571,7 +571,7 @@ error:
incrCommandStatsOnError(cmd, ERROR_COMMAND_REJECTED); incrCommandStatsOnError(cmd, ERROR_COMMAND_REJECTED);
} }
long long scriptRunDuration() { long long scriptRunDuration(void) {
serverAssert(scriptIsRunning()); serverAssert(scriptIsRunning());
return elapsedMs(curr_run_ctx->start_time); return elapsedMs(curr_run_ctx->start_time);
} }
...@@ -100,12 +100,12 @@ int scriptSetRepl(scriptRunCtx *r_ctx, int repl); ...@@ -100,12 +100,12 @@ int scriptSetRepl(scriptRunCtx *r_ctx, int repl);
void scriptCall(scriptRunCtx *r_ctx, sds *err); void scriptCall(scriptRunCtx *r_ctx, sds *err);
int scriptInterrupt(scriptRunCtx *r_ctx); int scriptInterrupt(scriptRunCtx *r_ctx);
void scriptKill(client *c, int is_eval); void scriptKill(client *c, int is_eval);
int scriptIsRunning(); int scriptIsRunning(void);
const char* scriptCurrFunction(); const char* scriptCurrFunction(void);
int scriptIsEval(); int scriptIsEval(void);
int scriptIsTimedout(); int scriptIsTimedout(void);
client* scriptGetClient(); client* scriptGetClient(void);
client* scriptGetCaller(); client* scriptGetCaller(void);
long long scriptRunDuration(); long long scriptRunDuration(void);
#endif /* __SCRIPT_H_ */ #endif /* __SCRIPT_H_ */
...@@ -1740,7 +1740,7 @@ const char *sentinelCheckCreateInstanceErrors(int role) { ...@@ -1740,7 +1740,7 @@ const char *sentinelCheckCreateInstanceErrors(int role) {
} }
/* init function for server.sentinel_config */ /* init function for server.sentinel_config */
void initializeSentinelConfig() { void initializeSentinelConfig(void) {
server.sentinel_config = zmalloc(sizeof(struct sentinelConfig)); server.sentinel_config = zmalloc(sizeof(struct sentinelConfig));
server.sentinel_config->monitor_cfg = listCreate(); server.sentinel_config->monitor_cfg = listCreate();
server.sentinel_config->pre_monitor_cfg = listCreate(); server.sentinel_config->pre_monitor_cfg = listCreate();
...@@ -1751,7 +1751,7 @@ void initializeSentinelConfig() { ...@@ -1751,7 +1751,7 @@ void initializeSentinelConfig() {
} }
/* destroy function for server.sentinel_config */ /* destroy function for server.sentinel_config */
void freeSentinelConfig() { void freeSentinelConfig(void) {
/* release these three config queues since we will not use it anymore */ /* release these three config queues since we will not use it anymore */
listRelease(server.sentinel_config->pre_monitor_cfg); listRelease(server.sentinel_config->pre_monitor_cfg);
listRelease(server.sentinel_config->monitor_cfg); listRelease(server.sentinel_config->monitor_cfg);
...@@ -3179,7 +3179,7 @@ void sentinelSendPeriodicCommands(sentinelRedisInstance *ri) { ...@@ -3179,7 +3179,7 @@ void sentinelSendPeriodicCommands(sentinelRedisInstance *ri) {
/* =========================== SENTINEL command ============================= */ /* =========================== SENTINEL command ============================= */
const char* getLogLevel() { const char* getLogLevel(void) {
switch (server.verbosity) { switch (server.verbosity) {
case LL_DEBUG: return "debug"; case LL_DEBUG: return "debug";
case LL_VERBOSE: return "verbose"; case LL_VERBOSE: return "verbose";
......
...@@ -656,11 +656,11 @@ const char *strChildType(int type) { ...@@ -656,11 +656,11 @@ const char *strChildType(int type) {
/* Return true if there are active children processes doing RDB saving, /* Return true if there are active children processes doing RDB saving,
* AOF rewriting, or some side process spawned by a loaded module. */ * AOF rewriting, or some side process spawned by a loaded module. */
int hasActiveChildProcess() { int hasActiveChildProcess(void) {
return server.child_pid != -1; return server.child_pid != -1;
} }
void resetChildState() { void resetChildState(void) {
server.child_type = CHILD_TYPE_NONE; server.child_type = CHILD_TYPE_NONE;
server.child_pid = -1; server.child_pid = -1;
server.stat_current_cow_peak = 0; server.stat_current_cow_peak = 0;
...@@ -682,7 +682,7 @@ int isMutuallyExclusiveChildType(int type) { ...@@ -682,7 +682,7 @@ int isMutuallyExclusiveChildType(int type) {
} }
/* Returns true when we're inside a long command that yielded to the event loop. */ /* Returns true when we're inside a long command that yielded to the event loop. */
int isInsideYieldingLongCommand() { int isInsideYieldingLongCommand(void) {
return scriptIsTimedout() || server.busy_module_yield_flags; return scriptIsTimedout() || server.busy_module_yield_flags;
} }
...@@ -1148,7 +1148,7 @@ void enterExecutionUnit(int update_cached_time, long long us) { ...@@ -1148,7 +1148,7 @@ void enterExecutionUnit(int update_cached_time, long long us) {
} }
} }
void exitExecutionUnit() { void exitExecutionUnit(void) {
--server.execution_nesting; --server.execution_nesting;
} }
...@@ -1204,7 +1204,7 @@ void checkChildrenDone(void) { ...@@ -1204,7 +1204,7 @@ void checkChildrenDone(void) {
} }
/* Called from serverCron and cronUpdateMemoryStats to update cached memory metrics. */ /* Called from serverCron and cronUpdateMemoryStats to update cached memory metrics. */
void cronUpdateMemoryStats() { void cronUpdateMemoryStats(void) {
/* Record the max memory used since the server was started. */ /* Record the max memory used since the server was started. */
if (zmalloc_used_memory() > server.stat_peak_memory) if (zmalloc_used_memory() > server.stat_peak_memory)
server.stat_peak_memory = zmalloc_used_memory(); server.stat_peak_memory = zmalloc_used_memory();
...@@ -1518,14 +1518,14 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { ...@@ -1518,14 +1518,14 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
} }
void blockingOperationStarts() { void blockingOperationStarts(void) {
if(!server.blocking_op_nesting++){ if(!server.blocking_op_nesting++){
updateCachedTime(0); updateCachedTime(0);
server.blocked_last_cron = server.mstime; server.blocked_last_cron = server.mstime;
} }
} }
void blockingOperationEnds() { void blockingOperationEnds(void) {
if(!(--server.blocking_op_nesting)){ if(!(--server.blocking_op_nesting)){
server.blocked_last_cron = 0; server.blocked_last_cron = 0;
} }
...@@ -1536,7 +1536,7 @@ void blockingOperationEnds() { ...@@ -1536,7 +1536,7 @@ void blockingOperationEnds() {
* It attempts to do its duties at a similar rate as the configured server.hz, * It attempts to do its duties at a similar rate as the configured server.hz,
* and updates cronloops variable so that similarly to serverCron, the * and updates cronloops variable so that similarly to serverCron, the
* run_with_period can be used. */ * run_with_period can be used. */
void whileBlockedCron() { void whileBlockedCron(void) {
/* Here we may want to perform some cron jobs (normally done server.hz times /* Here we may want to perform some cron jobs (normally done server.hz times
* per second). */ * per second). */
...@@ -1954,7 +1954,7 @@ void createSharedObjects(void) { ...@@ -1954,7 +1954,7 @@ void createSharedObjects(void) {
shared.maxstring = sdsnew("maxstring"); shared.maxstring = sdsnew("maxstring");
} }
void initServerClientMemUsageBuckets() { void initServerClientMemUsageBuckets(void) {
if (server.client_mem_usage_buckets) if (server.client_mem_usage_buckets)
return; return;
server.client_mem_usage_buckets = zmalloc(sizeof(clientMemUsageBucket)*CLIENT_MEM_USAGE_BUCKETS); server.client_mem_usage_buckets = zmalloc(sizeof(clientMemUsageBucket)*CLIENT_MEM_USAGE_BUCKETS);
...@@ -1964,7 +1964,7 @@ void initServerClientMemUsageBuckets() { ...@@ -1964,7 +1964,7 @@ void initServerClientMemUsageBuckets() {
} }
} }
void freeServerClientMemUsageBuckets() { void freeServerClientMemUsageBuckets(void) {
if (!server.client_mem_usage_buckets) if (!server.client_mem_usage_buckets)
return; return;
for (int j = 0; j < CLIENT_MEM_USAGE_BUCKETS; j++) for (int j = 0; j < CLIENT_MEM_USAGE_BUCKETS; j++)
...@@ -2717,7 +2717,7 @@ void initServer(void) { ...@@ -2717,7 +2717,7 @@ void initServer(void) {
initServerClientMemUsageBuckets(); initServerClientMemUsageBuckets();
} }
void initListeners() { void initListeners(void) {
/* Setup listeners from server config for TCP/TLS/Unix */ /* Setup listeners from server config for TCP/TLS/Unix */
int conn_index; int conn_index;
connListener *listener; connListener *listener;
...@@ -2794,7 +2794,7 @@ void initListeners() { ...@@ -2794,7 +2794,7 @@ void initListeners() {
* Specifically, creation of threads due to a race bug in ld.so, in which * Specifically, creation of threads due to a race bug in ld.so, in which
* Thread Local Storage initialization collides with dlopen call. * Thread Local Storage initialization collides with dlopen call.
* see: https://sourceware.org/bugzilla/show_bug.cgi?id=19329 */ * see: https://sourceware.org/bugzilla/show_bug.cgi?id=19329 */
void InitServerLast() { void InitServerLast(void) {
bioInit(); bioInit();
initThreadedIO(); initThreadedIO();
set_jemalloc_bg_thread(server.jemalloc_bg_thread); set_jemalloc_bg_thread(server.jemalloc_bg_thread);
...@@ -3304,7 +3304,7 @@ void updateCommandLatencyHistogram(struct hdr_histogram **latency_histogram, int ...@@ -3304,7 +3304,7 @@ void updateCommandLatencyHistogram(struct hdr_histogram **latency_histogram, int
/* Handle the alsoPropagate() API to handle commands that want to propagate /* Handle the alsoPropagate() API to handle commands that want to propagate
* multiple separated commands. Note that alsoPropagate() is not affected * multiple separated commands. Note that alsoPropagate() is not affected
* by CLIENT_PREVENT_PROP flag. */ * by CLIENT_PREVENT_PROP flag. */
static void propagatePendingCommands() { static void propagatePendingCommands(void) {
if (server.also_propagate.numops == 0) if (server.also_propagate.numops == 0)
return; return;
...@@ -3360,7 +3360,7 @@ static void propagatePendingCommands() { ...@@ -3360,7 +3360,7 @@ static void propagatePendingCommands() {
* currently with respect to replication and post jobs, but in the future there might * currently with respect to replication and post jobs, but in the future there might
* be other considerations. So we basically want the `postUnitOperations` to trigger * be other considerations. So we basically want the `postUnitOperations` to trigger
* after the entire chain finished. */ * after the entire chain finished. */
void postExecutionUnitOperations() { void postExecutionUnitOperations(void) {
if (server.execution_nesting) if (server.execution_nesting)
return; return;
...@@ -6505,7 +6505,7 @@ void setupChildSignalHandlers(void) { ...@@ -6505,7 +6505,7 @@ void setupChildSignalHandlers(void) {
* of the parent process, e.g. fd(socket or flock) etc. * of the parent process, e.g. fd(socket or flock) etc.
* should close the resources not used by the child process, so that if the * should close the resources not used by the child process, so that if the
* parent restarts it can bind/lock despite the child possibly still running. */ * parent restarts it can bind/lock despite the child possibly still running. */
void closeChildUnusedResourceAfterFork() { void closeChildUnusedResourceAfterFork(void) {
closeListeningSockets(0); closeListeningSockets(0);
if (server.cluster_enabled && server.cluster_config_file_lock_fd != -1) if (server.cluster_enabled && server.cluster_config_file_lock_fd != -1)
close(server.cluster_config_file_lock_fd); /* don't care if this fails */ close(server.cluster_config_file_lock_fd); /* don't care if this fails */
......
...@@ -1372,9 +1372,8 @@ typedef struct redisOp { ...@@ -1372,9 +1372,8 @@ typedef struct redisOp {
/* Defines an array of Redis operations. There is an API to add to this /* Defines an array of Redis operations. There is an API to add to this
* structure in an easy way. * structure in an easy way.
* *
* redisOpArrayInit(); * int redisOpArrayAppend(redisOpArray *oa, int dbid, robj **argv, int argc, int target);
* redisOpArrayAppend(); * void redisOpArrayFree(redisOpArray *oa);
* redisOpArrayFree();
*/ */
typedef struct redisOpArray { typedef struct redisOpArray {
redisOp *ops; redisOp *ops;
...@@ -2472,14 +2471,14 @@ void moduleAcquireGIL(void); ...@@ -2472,14 +2471,14 @@ void moduleAcquireGIL(void);
int moduleTryAcquireGIL(void); int moduleTryAcquireGIL(void);
void moduleReleaseGIL(void); void moduleReleaseGIL(void);
void moduleNotifyKeyspaceEvent(int type, const char *event, robj *key, int dbid); void moduleNotifyKeyspaceEvent(int type, const char *event, robj *key, int dbid);
void firePostExecutionUnitJobs(); void firePostExecutionUnitJobs(void);
void moduleCallCommandFilters(client *c); void moduleCallCommandFilters(client *c);
void modulePostExecutionUnitOperations(); void modulePostExecutionUnitOperations(void);
void ModuleForkDoneHandler(int exitcode, int bysignal); void ModuleForkDoneHandler(int exitcode, int bysignal);
int TerminateModuleForkChild(int child_pid, int wait); int TerminateModuleForkChild(int child_pid, int wait);
ssize_t rdbSaveModulesAux(rio *rdb, int when); ssize_t rdbSaveModulesAux(rio *rdb, int when);
int moduleAllDatatypesHandleErrors(); int moduleAllDatatypesHandleErrors(void);
int moduleAllModulesHandleReplAsyncLoad(); int moduleAllModulesHandleReplAsyncLoad(void);
sds modulesCollectInfo(sds info, dict *sections_dict, int for_crash_report, int sections); sds modulesCollectInfo(sds info, dict *sections_dict, int for_crash_report, int sections);
void moduleFireServerEvent(uint64_t eid, int subid, void *data); void moduleFireServerEvent(uint64_t eid, int subid, void *data);
void processModuleLoadingProgressEvent(int is_aof); void processModuleLoadingProgressEvent(int is_aof);
...@@ -2607,11 +2606,11 @@ void unpauseActions(pause_purpose purpose); ...@@ -2607,11 +2606,11 @@ void unpauseActions(pause_purpose purpose);
uint32_t isPausedActions(uint32_t action_bitmask); uint32_t isPausedActions(uint32_t action_bitmask);
uint32_t isPausedActionsWithUpdate(uint32_t action_bitmask); uint32_t isPausedActionsWithUpdate(uint32_t action_bitmask);
void updatePausedActions(void); void updatePausedActions(void);
void unblockPostponedClients(); void unblockPostponedClients(void);
void processEventsWhileBlocked(void); void processEventsWhileBlocked(void);
void whileBlockedCron(); void whileBlockedCron(void);
void blockingOperationStarts(); void blockingOperationStarts(void);
void blockingOperationEnds(); void blockingOperationEnds(void);
int handleClientsWithPendingWrites(void); int handleClientsWithPendingWrites(void);
int handleClientsWithPendingWritesUsingThreads(void); int handleClientsWithPendingWritesUsingThreads(void);
int handleClientsWithPendingReadsUsingThreads(void); int handleClientsWithPendingReadsUsingThreads(void);
...@@ -2777,7 +2776,7 @@ void replicationCron(void); ...@@ -2777,7 +2776,7 @@ void replicationCron(void);
void replicationStartPendingFork(void); void replicationStartPendingFork(void);
void replicationHandleMasterDisconnection(void); void replicationHandleMasterDisconnection(void);
void replicationCacheMaster(client *c); void replicationCacheMaster(client *c);
void resizeReplicationBacklog(); void resizeReplicationBacklog(void);
void replicationSetMaster(char *ip, int port); void replicationSetMaster(char *ip, int port);
void replicationUnsetMaster(void); void replicationUnsetMaster(void);
void refreshGoodSlavesCount(void); void refreshGoodSlavesCount(void);
...@@ -2806,7 +2805,7 @@ void rdbPipeWriteHandlerConnRemoved(struct connection *conn); ...@@ -2806,7 +2805,7 @@ void rdbPipeWriteHandlerConnRemoved(struct connection *conn);
void clearFailoverState(void); void clearFailoverState(void);
void updateFailoverStatus(void); void updateFailoverStatus(void);
void abortFailover(const char *err); void abortFailover(const char *err);
const char *getFailoverStateString(); const char *getFailoverStateString(void);
/* Generic persistence functions */ /* Generic persistence functions */
void startLoadingFile(size_t size, char* filename, int rdbflags); void startLoadingFile(size_t size, char* filename, int rdbflags);
...@@ -2840,7 +2839,7 @@ void stopAppendOnly(void); ...@@ -2840,7 +2839,7 @@ void stopAppendOnly(void);
int startAppendOnly(void); int startAppendOnly(void);
void backgroundRewriteDoneHandler(int exitcode, int bysignal); void backgroundRewriteDoneHandler(int exitcode, int bysignal);
void killAppendOnlyChild(void); void killAppendOnlyChild(void);
void restartAOFAfterSYNC(); void restartAOFAfterSYNC(void);
void aofLoadManifestFromDisk(void); void aofLoadManifestFromDisk(void);
void aofOpenIfNeededOnServerStart(void); void aofOpenIfNeededOnServerStart(void);
void aofManifestFree(aofManifest *am); void aofManifestFree(aofManifest *am);
...@@ -2857,8 +2856,8 @@ void receiveChildInfo(void); ...@@ -2857,8 +2856,8 @@ void receiveChildInfo(void);
/* Fork helpers */ /* Fork helpers */
int redisFork(int purpose); int redisFork(int purpose);
int hasActiveChildProcess(); int hasActiveChildProcess(void);
void resetChildState(); void resetChildState(void);
int isMutuallyExclusiveChildType(int type); int isMutuallyExclusiveChildType(int type);
/* acl.c -- Authentication related prototypes. */ /* acl.c -- Authentication related prototypes. */
...@@ -2912,13 +2911,13 @@ int ACLLoadConfiguredUsers(void); ...@@ -2912,13 +2911,13 @@ int ACLLoadConfiguredUsers(void);
robj *ACLDescribeUser(user *u); robj *ACLDescribeUser(user *u);
void ACLLoadUsersAtStartup(void); void ACLLoadUsersAtStartup(void);
void addReplyCommandCategories(client *c, struct redisCommand *cmd); void addReplyCommandCategories(client *c, struct redisCommand *cmd);
user *ACLCreateUnlinkedUser(); user *ACLCreateUnlinkedUser(void);
void ACLFreeUserAndKillClients(user *u); void ACLFreeUserAndKillClients(user *u);
void addACLLogEntry(client *c, int reason, int context, int argpos, sds username, sds object); void addACLLogEntry(client *c, int reason, int context, int argpos, sds username, sds object);
sds getAclErrorMessage(int acl_res, user *user, struct redisCommand *cmd, sds errored_val, int verbose); sds getAclErrorMessage(int acl_res, user *user, struct redisCommand *cmd, sds errored_val, int verbose);
void ACLUpdateDefaultUserPassword(sds password); void ACLUpdateDefaultUserPassword(sds password);
sds genRedisInfoStringACLStats(sds info); sds genRedisInfoStringACLStats(sds info);
void ACLRecomputeCommandBitsFromCommandRulesAllUsers(); void ACLRecomputeCommandBitsFromCommandRulesAllUsers(void);
/* Sorted sets data type */ /* Sorted sets data type */
...@@ -2990,7 +2989,7 @@ int zslLexValueLteMax(sds value, zlexrangespec *spec); ...@@ -2990,7 +2989,7 @@ int zslLexValueLteMax(sds value, zlexrangespec *spec);
/* Core functions */ /* Core functions */
int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *level); int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *level);
size_t freeMemoryGetNotCountedMemory(); size_t freeMemoryGetNotCountedMemory(void);
int overMaxmemoryAfterAlloc(size_t moremem); int overMaxmemoryAfterAlloc(size_t moremem);
uint64_t getCommandFlags(client *c); uint64_t getCommandFlags(client *c);
int processCommand(client *c); int processCommand(client *c);
...@@ -3011,11 +3010,11 @@ struct redisCommand *lookupCommandByCString(const char *s); ...@@ -3011,11 +3010,11 @@ struct redisCommand *lookupCommandByCString(const char *s);
struct redisCommand *lookupCommandOrOriginal(robj **argv, int argc); struct redisCommand *lookupCommandOrOriginal(robj **argv, int argc);
int commandCheckExistence(client *c, sds *err); int commandCheckExistence(client *c, sds *err);
int commandCheckArity(client *c, sds *err); int commandCheckArity(client *c, sds *err);
void startCommandExecution(); void startCommandExecution(void);
int incrCommandStatsOnError(struct redisCommand *cmd, int flags); int incrCommandStatsOnError(struct redisCommand *cmd, int flags);
void call(client *c, int flags); void call(client *c, int flags);
void alsoPropagate(int dbid, robj **argv, int argc, int target); void alsoPropagate(int dbid, robj **argv, int argc, int target);
void postExecutionUnitOperations(); void postExecutionUnitOperations(void);
void redisOpArrayFree(redisOpArray *oa); void redisOpArrayFree(redisOpArray *oa);
void forceCommandPropagation(client *c, int flags); void forceCommandPropagation(client *c, int flags);
void preventCommandPropagation(client *c); void preventCommandPropagation(client *c);
...@@ -3047,7 +3046,7 @@ void incrementErrorCount(const char *fullerr, size_t namelen); ...@@ -3047,7 +3046,7 @@ void incrementErrorCount(const char *fullerr, size_t namelen);
void closeListeningSockets(int unlink_unix_socket); void closeListeningSockets(int unlink_unix_socket);
void updateCachedTime(int update_daylight_info); void updateCachedTime(int update_daylight_info);
void enterExecutionUnit(int update_cached_time, long long us); void enterExecutionUnit(int update_cached_time, long long us);
void exitExecutionUnit(); void exitExecutionUnit(void);
void resetServerStats(void); void resetServerStats(void);
void activeDefragCycle(void); void activeDefragCycle(void);
unsigned int getLRUClock(void); unsigned int getLRUClock(void);
...@@ -3121,8 +3120,8 @@ int pubsubUnsubscribeAllPatterns(client *c, int notify); ...@@ -3121,8 +3120,8 @@ int pubsubUnsubscribeAllPatterns(client *c, int notify);
int pubsubPublishMessage(robj *channel, robj *message, int sharded); int pubsubPublishMessage(robj *channel, robj *message, int sharded);
int pubsubPublishMessageAndPropagateToCluster(robj *channel, robj *message, int sharded); int pubsubPublishMessageAndPropagateToCluster(robj *channel, robj *message, int sharded);
void addReplyPubsubMessage(client *c, robj *channel, robj *msg, robj *message_bulk); void addReplyPubsubMessage(client *c, robj *channel, robj *msg, robj *message_bulk);
int serverPubsubSubscriptionCount(); int serverPubsubSubscriptionCount(void);
int serverPubsubShardSubscriptionCount(); int serverPubsubShardSubscriptionCount(void);
size_t pubsubMemOverhead(client *c); size_t pubsubMemOverhead(client *c);
/* Keyspace events notification */ /* Keyspace events notification */
...@@ -3176,12 +3175,12 @@ struct rewriteConfigState; /* Forward declaration to export API. */ ...@@ -3176,12 +3175,12 @@ struct rewriteConfigState; /* Forward declaration to export API. */
int rewriteConfigRewriteLine(struct rewriteConfigState *state, const char *option, sds line, int force); int rewriteConfigRewriteLine(struct rewriteConfigState *state, const char *option, sds line, int force);
void rewriteConfigMarkAsProcessed(struct rewriteConfigState *state, const char *option); void rewriteConfigMarkAsProcessed(struct rewriteConfigState *state, const char *option);
int rewriteConfig(char *path, int force_write); int rewriteConfig(char *path, int force_write);
void initConfigValues(); void initConfigValues(void);
void removeConfig(sds name); void removeConfig(sds name);
sds getConfigDebugInfo(); sds getConfigDebugInfo(void);
int allowProtectedAction(int config, client *c); int allowProtectedAction(int config, client *c);
void initServerClientMemUsageBuckets(); void initServerClientMemUsageBuckets(void);
void freeServerClientMemUsageBuckets(); void freeServerClientMemUsageBuckets(void);
/* Module Configuration */ /* Module Configuration */
typedef struct ModuleConfig ModuleConfig; typedef struct ModuleConfig ModuleConfig;
...@@ -3249,7 +3248,7 @@ robj *dbUnshareStringValue(redisDb *db, robj *key, robj *o); ...@@ -3249,7 +3248,7 @@ robj *dbUnshareStringValue(redisDb *db, robj *key, robj *o);
long long emptyData(int dbnum, int flags, void(callback)(dict*)); long long emptyData(int dbnum, int flags, void(callback)(dict*));
long long emptyDbStructure(redisDb *dbarray, int dbnum, int async, void(callback)(dict*)); long long emptyDbStructure(redisDb *dbarray, int dbnum, int async, void(callback)(dict*));
void flushAllDataAndResetRDB(int flags); void flushAllDataAndResetRDB(int flags);
long long dbTotalServerKeyCount(); long long dbTotalServerKeyCount(void);
redisDb *initTempDb(void); redisDb *initTempDb(void);
void discardTempDb(redisDb *tempDb, void(callback)(dict*)); void discardTempDb(redisDb *tempDb, void(callback)(dict*));
...@@ -3326,16 +3325,16 @@ sds luaCreateFunction(client *c, robj *body); ...@@ -3326,16 +3325,16 @@ sds luaCreateFunction(client *c, robj *body);
void luaLdbLineHook(lua_State *lua, lua_Debug *ar); void luaLdbLineHook(lua_State *lua, lua_Debug *ar);
void freeLuaScriptsAsync(dict *lua_scripts); void freeLuaScriptsAsync(dict *lua_scripts);
void freeFunctionsAsync(functionsLibCtx *lib_ctx); void freeFunctionsAsync(functionsLibCtx *lib_ctx);
int ldbIsEnabled(); int ldbIsEnabled(void);
void ldbLog(sds entry); void ldbLog(sds entry);
void ldbLogRedisReply(char *reply); void ldbLogRedisReply(char *reply);
void sha1hex(char *digest, char *script, size_t len); void sha1hex(char *digest, char *script, size_t len);
unsigned long evalMemory(); unsigned long evalMemory(void);
dict* evalScriptsDict(); dict* evalScriptsDict(void);
unsigned long evalScriptsMemory(); unsigned long evalScriptsMemory(void);
uint64_t evalGetCommandFlags(client *c, uint64_t orig_flags); uint64_t evalGetCommandFlags(client *c, uint64_t orig_flags);
uint64_t fcallGetCommandFlags(client *c, uint64_t orig_flags); uint64_t fcallGetCommandFlags(client *c, uint64_t orig_flags);
int isInsideYieldingLongCommand(); int isInsideYieldingLongCommand(void);
typedef struct luaScript { typedef struct luaScript {
uint64_t flags; uint64_t flags;
...@@ -3691,7 +3690,7 @@ dict *genInfoSectionDict(robj **argv, int argc, char **defaults, int *out_all, i ...@@ -3691,7 +3690,7 @@ dict *genInfoSectionDict(robj **argv, int argc, char **defaults, int *out_all, i
void releaseInfoSectionDict(dict *sec); void releaseInfoSectionDict(dict *sec);
sds genRedisInfoString(dict *section_dict, int all_sections, int everything); sds genRedisInfoString(dict *section_dict, int all_sections, int everything);
sds genModulesInfoString(sds info); sds genModulesInfoString(sds info);
void applyWatchdogPeriod(); void applyWatchdogPeriod(void);
void watchdogScheduleSignal(int period); void watchdogScheduleSignal(int period);
void serverLogHexDump(int level, char *descr, void *value, size_t len); void serverLogHexDump(int level, char *descr, void *value, size_t len);
int memtest_preserving_test(unsigned long *m, size_t bytes, int passes); int memtest_preserving_test(unsigned long *m, size_t bytes, int passes);
......
...@@ -464,7 +464,7 @@ int connRecvTimeout(connection *conn, long long ms) { ...@@ -464,7 +464,7 @@ int connRecvTimeout(connection *conn, long long ms) {
return anetRecvTimeout(NULL, conn->fd, ms); return anetRecvTimeout(NULL, conn->fd, ms);
} }
int RedisRegisterConnectionTypeSocket() int RedisRegisterConnectionTypeSocket(void)
{ {
return connTypeRegister(&CT_Socket); return connTypeRegister(&CT_Socket);
} }
...@@ -1062,13 +1062,13 @@ static const char *connTLSGetType(connection *conn_) { ...@@ -1062,13 +1062,13 @@ static const char *connTLSGetType(connection *conn_) {
return CONN_TYPE_TLS; return CONN_TYPE_TLS;
} }
static int tlsHasPendingData() { static int tlsHasPendingData(void) {
if (!pending_list) if (!pending_list)
return 0; return 0;
return listLength(pending_list) > 0; return listLength(pending_list) > 0;
} }
static int tlsProcessPendingData() { static int tlsProcessPendingData(void) {
listIter li; listIter li;
listNode *ln; listNode *ln;
...@@ -1151,13 +1151,13 @@ static ConnectionType CT_TLS = { ...@@ -1151,13 +1151,13 @@ static ConnectionType CT_TLS = {
.get_peer_cert = connTLSGetPeerCert, .get_peer_cert = connTLSGetPeerCert,
}; };
int RedisRegisterConnectionTypeTLS() { int RedisRegisterConnectionTypeTLS(void) {
return connTypeRegister(&CT_TLS); return connTypeRegister(&CT_TLS);
} }
#else /* USE_OPENSSL */ #else /* USE_OPENSSL */
int RedisRegisterConnectionTypeTLS() { int RedisRegisterConnectionTypeTLS(void) {
serverLog(LL_VERBOSE, "Connection type %s not builtin", CONN_TYPE_TLS); serverLog(LL_VERBOSE, "Connection type %s not builtin", CONN_TYPE_TLS);
return C_ERR; return C_ERR;
} }
......
...@@ -200,7 +200,7 @@ static ConnectionType CT_Unix = { ...@@ -200,7 +200,7 @@ static ConnectionType CT_Unix = {
.process_pending_data = NULL, .process_pending_data = NULL,
}; };
int RedisRegisterConnectionTypeUnix() int RedisRegisterConnectionTypeUnix(void)
{ {
return connTypeRegister(&CT_Unix); return connTypeRegister(&CT_Unix);
} }
...@@ -1694,7 +1694,7 @@ unsigned int ziplistRandomPairsUnique(unsigned char *zl, unsigned int count, zip ...@@ -1694,7 +1694,7 @@ unsigned int ziplistRandomPairsUnique(unsigned char *zl, unsigned int count, zip
#define debug(f, ...) { if (DEBUG) printf(f, __VA_ARGS__); } #define debug(f, ...) { if (DEBUG) printf(f, __VA_ARGS__); }
static unsigned char *createList() { static unsigned char *createList(void) {
unsigned char *zl = ziplistNew(); unsigned char *zl = ziplistNew();
zl = ziplistPush(zl, (unsigned char*)"foo", 3, ZIPLIST_TAIL); zl = ziplistPush(zl, (unsigned char*)"foo", 3, ZIPLIST_TAIL);
zl = ziplistPush(zl, (unsigned char*)"quux", 4, ZIPLIST_TAIL); zl = ziplistPush(zl, (unsigned char*)"quux", 4, ZIPLIST_TAIL);
...@@ -1703,7 +1703,7 @@ static unsigned char *createList() { ...@@ -1703,7 +1703,7 @@ static unsigned char *createList() {
return zl; return zl;
} }
static unsigned char *createIntList() { static unsigned char *createIntList(void) {
unsigned char *zl = ziplistNew(); unsigned char *zl = ziplistNew();
char buf[32]; char buf[32];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment