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
...@@ -40,7 +40,7 @@ ifneq (,$(findstring FreeBSD,$(uname_S))) ...@@ -40,7 +40,7 @@ ifneq (,$(findstring FreeBSD,$(uname_S)))
STD+=-Wno-c11-extensions STD+=-Wno-c11-extensions
endif endif
endif endif
WARN=-Wall -W -Wno-missing-field-initializers -Werror=deprecated-declarations WARN=-Wall -W -Wno-missing-field-initializers -Werror=deprecated-declarations -Wstrict-prototypes
OPT=$(OPTIMIZATION) OPT=$(OPTIMIZATION)
# Detect if the compiler supports C11 _Atomic. # Detect if the compiler supports C11 _Atomic.
......
...@@ -642,7 +642,7 @@ void ACLSetSelectorCommandBitsForCategory(dict *commands, aclSelector *selector, ...@@ -642,7 +642,7 @@ void ACLSetSelectorCommandBitsForCategory(dict *commands, aclSelector *selector,
/* This function is responsible for recomputing the command bits for all selectors of the existing users. /* This function is responsible for recomputing the command bits for all selectors of the existing users.
* It uses the 'command_rules', a string representation of the ordered categories and commands, * It uses the 'command_rules', a string representation of the ordered categories and commands,
* to recompute the command bits. */ * to recompute the command bits. */
void ACLRecomputeCommandBitsFromCommandRulesAllUsers() { void ACLRecomputeCommandBitsFromCommandRulesAllUsers(void) {
raxIterator ri; raxIterator ri;
raxStart(&ri,Users); raxStart(&ri,Users);
raxSeek(&ri,"^",NULL,0); raxSeek(&ri,"^",NULL,0);
......
...@@ -164,12 +164,12 @@ void aofManifestFree(aofManifest *am) { ...@@ -164,12 +164,12 @@ void aofManifestFree(aofManifest *am) {
zfree(am); zfree(am);
} }
sds getAofManifestFileName() { sds getAofManifestFileName(void) {
return sdscatprintf(sdsempty(), "%s%s", server.aof_filename, return sdscatprintf(sdsempty(), "%s%s", server.aof_filename,
MANIFEST_NAME_SUFFIX); MANIFEST_NAME_SUFFIX);
} }
sds getTempAofManifestFileName() { sds getTempAofManifestFileName(void) {
return sdscatprintf(sdsempty(), "%s%s%s", TEMP_FILE_NAME_PREFIX, return sdscatprintf(sdsempty(), "%s%s%s", TEMP_FILE_NAME_PREFIX,
server.aof_filename, MANIFEST_NAME_SUFFIX); server.aof_filename, MANIFEST_NAME_SUFFIX);
} }
...@@ -464,7 +464,7 @@ sds getNewIncrAofName(aofManifest *am) { ...@@ -464,7 +464,7 @@ sds getNewIncrAofName(aofManifest *am) {
} }
/* Get temp INCR type AOF name. */ /* Get temp INCR type AOF name. */
sds getTempIncrAofName() { sds getTempIncrAofName(void) {
return sdscatprintf(sdsempty(), "%s%s%s", TEMP_FILE_NAME_PREFIX, server.aof_filename, return sdscatprintf(sdsempty(), "%s%s%s", TEMP_FILE_NAME_PREFIX, server.aof_filename,
INCR_FILE_SUFFIX); INCR_FILE_SUFFIX);
} }
...@@ -692,7 +692,7 @@ int aofDelHistoryFiles(void) { ...@@ -692,7 +692,7 @@ int aofDelHistoryFiles(void) {
} }
/* Used to clean up temp INCR AOF when AOFRW fails. */ /* Used to clean up temp INCR AOF when AOFRW fails. */
void aofDelTempIncrAofFile() { void aofDelTempIncrAofFile(void) {
sds aof_filename = getTempIncrAofName(); sds aof_filename = getTempIncrAofName();
sds aof_filepath = makePath(server.aof_dirname, aof_filename); sds aof_filepath = makePath(server.aof_dirname, aof_filename);
serverLog(LL_NOTICE, "Removing the temp incr aof file %s in the background", aof_filename); serverLog(LL_NOTICE, "Removing the temp incr aof file %s in the background", aof_filename);
......
...@@ -191,7 +191,7 @@ ssize_t cliWriteConn(redisContext *c, const char *buf, size_t buf_len) ...@@ -191,7 +191,7 @@ ssize_t cliWriteConn(redisContext *c, const char *buf, size_t buf_len)
/* Wrapper around OpenSSL (libssl and libcrypto) initialisation /* Wrapper around OpenSSL (libssl and libcrypto) initialisation
*/ */
int cliSecureInit() int cliSecureInit(void)
{ {
#ifdef USE_OPENSSL #ifdef USE_OPENSSL
ERR_load_crypto_strings(); ERR_load_crypto_strings();
......
...@@ -37,7 +37,7 @@ int cliSecureConnection(redisContext *c, cliSSLconfig config, const char **err); ...@@ -37,7 +37,7 @@ int cliSecureConnection(redisContext *c, cliSSLconfig config, const char **err);
ssize_t cliWriteConn(redisContext *c, const char *buf, size_t buf_len); ssize_t cliWriteConn(redisContext *c, const char *buf, size_t buf_len);
int cliSecureInit(); int cliSecureInit(void);
sds readArgFromStdin(void); sds readArgFromStdin(void);
......
...@@ -126,7 +126,7 @@ dictType clusterNodesBlackListDictType = { ...@@ -126,7 +126,7 @@ dictType clusterNodesBlackListDictType = {
NULL /* allow to expand */ NULL /* allow to expand */
}; };
static ConnectionType *connTypeOfCluster() { static ConnectionType *connTypeOfCluster(void) {
if (server.tls_cluster) { if (server.tls_cluster) {
return connectionTypeTls(); return connectionTypeTls();
} }
...@@ -2321,18 +2321,18 @@ uint32_t getAlignedPingExtSize(uint32_t dataSize) { ...@@ -2321,18 +2321,18 @@ uint32_t getAlignedPingExtSize(uint32_t dataSize) {
return sizeof(clusterMsgPingExt) + EIGHT_BYTE_ALIGN(dataSize); return sizeof(clusterMsgPingExt) + EIGHT_BYTE_ALIGN(dataSize);
} }
uint32_t getHostnamePingExtSize() { uint32_t getHostnamePingExtSize(void) {
if (sdslen(myself->hostname) == 0) { if (sdslen(myself->hostname) == 0) {
return 0; return 0;
} }
return getAlignedPingExtSize(sdslen(myself->hostname) + 1); return getAlignedPingExtSize(sdslen(myself->hostname) + 1);
} }
uint32_t getShardIdPingExtSize() { uint32_t getShardIdPingExtSize(void) {
return getAlignedPingExtSize(sizeof(clusterMsgPingExtShardId)); return getAlignedPingExtSize(sizeof(clusterMsgPingExtShardId));
} }
uint32_t getForgottenNodeExtSize() { uint32_t getForgottenNodeExtSize(void) {
return getAlignedPingExtSize(sizeof(clusterMsgPingExtForgottenNode)); return getAlignedPingExtSize(sizeof(clusterMsgPingExtForgottenNode));
} }
...@@ -5559,7 +5559,7 @@ void clusterReplyMultiBulkSlots(client * c) { ...@@ -5559,7 +5559,7 @@ void clusterReplyMultiBulkSlots(client * c) {
setDeferredArrayLen(c, slot_replylen, num_masters); setDeferredArrayLen(c, slot_replylen, num_masters);
} }
sds genClusterInfoString() { sds genClusterInfoString(void) {
sds info = sdsempty(); sds info = sdsempty();
char *statestr[] = {"ok","fail"}; char *statestr[] = {"ok","fail"};
int slots_assigned = 0, slots_ok = 0, slots_pfail = 0, slots_fail = 0; int slots_assigned = 0, slots_ok = 0, slots_pfail = 0, slots_fail = 0;
......
...@@ -423,7 +423,7 @@ void slotToChannelDel(sds channel); ...@@ -423,7 +423,7 @@ void slotToChannelDel(sds channel);
void clusterUpdateMyselfHostname(void); void clusterUpdateMyselfHostname(void);
void clusterUpdateMyselfAnnouncedPorts(void); void clusterUpdateMyselfAnnouncedPorts(void);
sds clusterGenNodesDescription(int filter, int use_pport); sds clusterGenNodesDescription(int filter, int use_pport);
sds genClusterInfoString(); sds genClusterInfoString(void);
void freeClusterLink(clusterLink *link); void freeClusterLink(clusterLink *link);
#endif /* __CLUSTER_H */ #endif /* __CLUSTER_H */
...@@ -1065,7 +1065,7 @@ void rewriteConfigReleaseState(struct rewriteConfigState *state) { ...@@ -1065,7 +1065,7 @@ void rewriteConfigReleaseState(struct rewriteConfigState *state) {
} }
/* Create the configuration rewrite state */ /* Create the configuration rewrite state */
struct rewriteConfigState *rewriteConfigCreateState() { struct rewriteConfigState *rewriteConfigCreateState(void) {
struct rewriteConfigState *state = zmalloc(sizeof(*state)); struct rewriteConfigState *state = zmalloc(sizeof(*state));
state->option_to_line = dictCreate(&optionToLineDictType); state->option_to_line = dictCreate(&optionToLineDictType);
state->rewritten = dictCreate(&optionSetDictType); state->rewritten = dictCreate(&optionSetDictType);
...@@ -1643,7 +1643,7 @@ void rewriteConfigRemoveOrphaned(struct rewriteConfigState *state) { ...@@ -1643,7 +1643,7 @@ void rewriteConfigRemoveOrphaned(struct rewriteConfigState *state) {
/* This function returns a string representation of all the config options /* This function returns a string representation of all the config options
* marked with DEBUG_CONFIG, which can be used to help with debugging. */ * marked with DEBUG_CONFIG, which can be used to help with debugging. */
sds getConfigDebugInfo() { sds getConfigDebugInfo(void) {
struct rewriteConfigState *state = rewriteConfigCreateState(); struct rewriteConfigState *state = rewriteConfigCreateState();
state->force_write = 1; /* Force the output */ state->force_write = 1; /* Force the output */
state->needs_signature = 0; /* Omit the rewrite signature */ state->needs_signature = 0; /* Omit the rewrite signature */
...@@ -3260,7 +3260,7 @@ int registerConfigValue(const char *name, const standardConfig *config, int alia ...@@ -3260,7 +3260,7 @@ int registerConfigValue(const char *name, const standardConfig *config, int alia
/* Initialize configs to their default values and create and populate the /* Initialize configs to their default values and create and populate the
* runtime configuration dictionary. */ * runtime configuration dictionary. */
void initConfigValues() { void initConfigValues(void) {
configs = dictCreate(&sdsHashDictType); configs = dictCreate(&sdsHashDictType);
dictExpand(configs, sizeof(static_configs) / sizeof(standardConfig)); dictExpand(configs, sizeof(static_configs) / sizeof(standardConfig));
for (standardConfig *config = static_configs; config->name != NULL; config++) { for (standardConfig *config = static_configs; config->name != NULL; config++) {
......
...@@ -57,7 +57,7 @@ int connTypeRegister(ConnectionType *ct) { ...@@ -57,7 +57,7 @@ int connTypeRegister(ConnectionType *ct) {
return C_OK; return C_OK;
} }
int connTypeInitialize() { int connTypeInitialize(void) {
/* currently socket connection type is necessary */ /* currently socket connection type is necessary */
serverAssert(RedisRegisterConnectionTypeSocket() == C_OK); serverAssert(RedisRegisterConnectionTypeSocket() == C_OK);
...@@ -88,7 +88,7 @@ ConnectionType *connectionByType(const char *typename) { ...@@ -88,7 +88,7 @@ ConnectionType *connectionByType(const char *typename) {
} }
/* Cache TCP connection type, query it by string once */ /* Cache TCP connection type, query it by string once */
ConnectionType *connectionTypeTcp() { ConnectionType *connectionTypeTcp(void) {
static ConnectionType *ct_tcp = NULL; static ConnectionType *ct_tcp = NULL;
if (ct_tcp != NULL) if (ct_tcp != NULL)
...@@ -101,7 +101,7 @@ ConnectionType *connectionTypeTcp() { ...@@ -101,7 +101,7 @@ ConnectionType *connectionTypeTcp() {
} }
/* Cache TLS connection type, query it by string once */ /* Cache TLS connection type, query it by string once */
ConnectionType *connectionTypeTls() { ConnectionType *connectionTypeTls(void) {
static ConnectionType *ct_tls = NULL; static ConnectionType *ct_tls = NULL;
static int cached = 0; static int cached = 0;
...@@ -116,7 +116,7 @@ ConnectionType *connectionTypeTls() { ...@@ -116,7 +116,7 @@ ConnectionType *connectionTypeTls() {
} }
/* Cache Unix connection type, query it by string once */ /* Cache Unix connection type, query it by string once */
ConnectionType *connectionTypeUnix() { ConnectionType *connectionTypeUnix(void) {
static ConnectionType *ct_unix = NULL; static ConnectionType *ct_unix = NULL;
if (ct_unix != NULL) if (ct_unix != NULL)
...@@ -141,7 +141,7 @@ int connectionIndexByType(const char *typename) { ...@@ -141,7 +141,7 @@ int connectionIndexByType(const char *typename) {
return -1; return -1;
} }
void connTypeCleanupAll() { void connTypeCleanupAll(void) {
ConnectionType *ct; ConnectionType *ct;
int type; int type;
......
...@@ -379,7 +379,7 @@ static inline sds connGetPeerCert(connection *conn) { ...@@ -379,7 +379,7 @@ static inline sds connGetPeerCert(connection *conn) {
} }
/* Initialize the redis connection framework */ /* Initialize the redis connection framework */
int connTypeInitialize(); int connTypeInitialize(void);
/* Register a connection type into redis connection framework */ /* Register a connection type into redis connection framework */
int connTypeRegister(ConnectionType *ct); int connTypeRegister(ConnectionType *ct);
...@@ -388,13 +388,13 @@ int connTypeRegister(ConnectionType *ct); ...@@ -388,13 +388,13 @@ int connTypeRegister(ConnectionType *ct);
ConnectionType *connectionByType(const char *typename); ConnectionType *connectionByType(const char *typename);
/* Fast path to get TCP connection type */ /* Fast path to get TCP connection type */
ConnectionType *connectionTypeTcp(); ConnectionType *connectionTypeTcp(void);
/* Fast path to get TLS connection type */ /* Fast path to get TLS connection type */
ConnectionType *connectionTypeTls(); ConnectionType *connectionTypeTls(void);
/* Fast path to get Unix connection type */ /* Fast path to get Unix connection type */
ConnectionType *connectionTypeUnix(); ConnectionType *connectionTypeUnix(void);
/* Lookup the index of a connection type by type name, return -1 if not found */ /* Lookup the index of a connection type by type name, return -1 if not found */
int connectionIndexByType(const char *typename); int connectionIndexByType(const char *typename);
...@@ -418,7 +418,7 @@ static inline int connTypeConfigure(ConnectionType *ct, void *priv, int reconfig ...@@ -418,7 +418,7 @@ static inline int connTypeConfigure(ConnectionType *ct, void *priv, int reconfig
} }
/* Walk all the connection types and cleanup them all if possible */ /* Walk all the connection types and cleanup them all if possible */
void connTypeCleanupAll(); void connTypeCleanupAll(void);
/* Test all the connection type has pending data or not. */ /* Test all the connection type has pending data or not. */
int connTypeHasPendingData(void); int connTypeHasPendingData(void);
...@@ -441,8 +441,8 @@ static inline aeFileProc *connAcceptHandler(ConnectionType *ct) { ...@@ -441,8 +441,8 @@ static inline aeFileProc *connAcceptHandler(ConnectionType *ct) {
/* Get Listeners information, note that caller should free the non-empty string */ /* Get Listeners information, note that caller should free the non-empty string */
sds getListensInfoString(sds info); sds getListensInfoString(sds info);
int RedisRegisterConnectionTypeSocket(); int RedisRegisterConnectionTypeSocket(void);
int RedisRegisterConnectionTypeUnix(); int RedisRegisterConnectionTypeUnix(void);
int RedisRegisterConnectionTypeTLS(); int RedisRegisterConnectionTypeTLS(void);
#endif /* __REDIS_CONNECTION_H */ #endif /* __REDIS_CONNECTION_H */
...@@ -562,7 +562,7 @@ int selectDb(client *c, int id) { ...@@ -562,7 +562,7 @@ int selectDb(client *c, int id) {
return C_OK; return C_OK;
} }
long long dbTotalServerKeyCount() { long long dbTotalServerKeyCount(void) {
long long total = 0; long long total = 0;
int j; int j;
for (j = 0; j < server.dbnum; j++) { for (j = 0; j < server.dbnum; j++) {
......
...@@ -2056,9 +2056,9 @@ void dumpCodeAroundEIP(void *eip) { ...@@ -2056,9 +2056,9 @@ void dumpCodeAroundEIP(void *eip) {
} }
} }
void invalidFunctionWasCalled() {} void invalidFunctionWasCalled(void) {}
typedef void (*invalidFunctionWasCalledType)(); typedef void (*invalidFunctionWasCalledType)(void);
void sigsegvHandler(int sig, siginfo_t *info, void *secret) { void sigsegvHandler(int sig, siginfo_t *info, void *secret) {
UNUSED(secret); UNUSED(secret);
...@@ -2227,7 +2227,7 @@ void watchdogScheduleSignal(int period) { ...@@ -2227,7 +2227,7 @@ void watchdogScheduleSignal(int period) {
it.it_interval.tv_usec = 0; it.it_interval.tv_usec = 0;
setitimer(ITIMER_REAL, &it, NULL); setitimer(ITIMER_REAL, &it, NULL);
} }
void applyWatchdogPeriod() { void applyWatchdogPeriod(void) {
struct sigaction act; struct sigaction act;
/* Disable watchdog when period is 0 */ /* Disable watchdog when period is 0 */
......
...@@ -781,7 +781,7 @@ float getAllocatorFragmentation(size_t *out_frag_bytes) { ...@@ -781,7 +781,7 @@ float getAllocatorFragmentation(size_t *out_frag_bytes) {
/* We may need to defrag other globals, one small allocation can hold a full allocator run. /* We may need to defrag other globals, one small allocation can hold a full allocator run.
* so although small, it is still important to defrag these */ * so although small, it is still important to defrag these */
void defragOtherGlobals() { void defragOtherGlobals(void) {
/* there are many more pointers to defrag (e.g. client argv, output / aof buffers, etc. /* there are many more pointers to defrag (e.g. client argv, output / aof buffers, etc.
* but we assume most of these are short lived, we only need to defrag allocations * but we assume most of these are short lived, we only need to defrag allocations
...@@ -887,7 +887,7 @@ int defragLaterStep(redisDb *db, long long endtime) { ...@@ -887,7 +887,7 @@ int defragLaterStep(redisDb *db, long long endtime) {
#define LIMIT(y, min, max) ((y)<(min)? min: ((y)>(max)? max: (y))) #define LIMIT(y, min, max) ((y)<(min)? min: ((y)>(max)? max: (y)))
/* decide if defrag is needed, and at what CPU effort to invest in it */ /* decide if defrag is needed, and at what CPU effort to invest in it */
void computeDefragCycles() { void computeDefragCycles(void) {
size_t frag_bytes; size_t frag_bytes;
float frag_pct = getAllocatorFragmentation(&frag_bytes); float frag_pct = getAllocatorFragmentation(&frag_bytes);
/* If we're not already running, and below the threshold, exit. */ /* If we're not already running, and below the threshold, exit. */
......
...@@ -650,15 +650,15 @@ NULL ...@@ -650,15 +650,15 @@ NULL
} }
} }
unsigned long evalMemory() { unsigned long evalMemory(void) {
return luaMemory(lctx.lua); return luaMemory(lctx.lua);
} }
dict* evalScriptsDict() { dict* evalScriptsDict(void) {
return lctx.lua_scripts; return lctx.lua_scripts;
} }
unsigned long evalScriptsMemory() { unsigned long evalScriptsMemory(void) {
return lctx.lua_scripts_mem + return lctx.lua_scripts_mem +
dictMemUsage(lctx.lua_scripts) + dictMemUsage(lctx.lua_scripts) +
dictSize(lctx.lua_scripts) * sizeof(luaScript); dictSize(lctx.lua_scripts) * sizeof(luaScript);
...@@ -688,7 +688,7 @@ void ldbFlushLog(list *log) { ...@@ -688,7 +688,7 @@ void ldbFlushLog(list *log) {
listDelNode(log,ln); listDelNode(log,ln);
} }
int ldbIsEnabled(){ int ldbIsEnabled(void){
return ldb.active && ldb.step; return ldb.active && ldb.step;
} }
......
...@@ -494,7 +494,7 @@ static int isSafeToPerformEvictions(void) { ...@@ -494,7 +494,7 @@ static int isSafeToPerformEvictions(void) {
} }
/* Algorithm for converting tenacity (0-100) to a time limit. */ /* Algorithm for converting tenacity (0-100) to a time limit. */
static unsigned long evictionTimeLimitUs() { static unsigned long evictionTimeLimitUs(void) {
serverAssert(server.maxmemory_eviction_tenacity >= 0); serverAssert(server.maxmemory_eviction_tenacity >= 0);
serverAssert(server.maxmemory_eviction_tenacity <= 100); serverAssert(server.maxmemory_eviction_tenacity <= 100);
......
...@@ -420,7 +420,7 @@ static int luaRegisterFunction(lua_State *lua) { ...@@ -420,7 +420,7 @@ static int luaRegisterFunction(lua_State *lua) {
} }
/* Initialize Lua engine, should be called once on start. */ /* Initialize Lua engine, should be called once on start. */
int luaEngineInitEngine() { int luaEngineInitEngine(void) {
luaEngineCtx *lua_engine_ctx = zmalloc(sizeof(*lua_engine_ctx)); luaEngineCtx *lua_engine_ctx = zmalloc(sizeof(*lua_engine_ctx));
lua_engine_ctx->lua = lua_open(); lua_engine_ctx->lua = lua_open();
......
...@@ -212,12 +212,12 @@ void functionsLibCtxSwapWithCurrent(functionsLibCtx *new_lib_ctx) { ...@@ -212,12 +212,12 @@ void functionsLibCtxSwapWithCurrent(functionsLibCtx *new_lib_ctx) {
} }
/* return the current functions ctx */ /* return the current functions ctx */
functionsLibCtx* functionsLibCtxGetCurrent() { functionsLibCtx* functionsLibCtxGetCurrent(void) {
return curr_functions_lib_ctx; return curr_functions_lib_ctx;
} }
/* Create a new functions ctx */ /* Create a new functions ctx */
functionsLibCtx* functionsLibCtxCreate() { functionsLibCtx* functionsLibCtxCreate(void) {
functionsLibCtx *ret = zmalloc(sizeof(functionsLibCtx)); functionsLibCtx *ret = zmalloc(sizeof(functionsLibCtx));
ret->libraries = dictCreate(&librariesDictType); ret->libraries = dictCreate(&librariesDictType);
ret->functions = dictCreate(&functionDictType); ret->functions = dictCreate(&functionDictType);
...@@ -1075,7 +1075,7 @@ void functionLoadCommand(client *c) { ...@@ -1075,7 +1075,7 @@ void functionLoadCommand(client *c) {
} }
/* Return memory usage of all the engines combine */ /* Return memory usage of all the engines combine */
unsigned long functionsMemory() { unsigned long functionsMemory(void) {
dictIterator *iter = dictGetIterator(engines); dictIterator *iter = dictGetIterator(engines);
dictEntry *entry = NULL; dictEntry *entry = NULL;
size_t engines_nemory = 0; size_t engines_nemory = 0;
...@@ -1090,7 +1090,7 @@ unsigned long functionsMemory() { ...@@ -1090,7 +1090,7 @@ unsigned long functionsMemory() {
} }
/* Return memory overhead of all the engines combine */ /* Return memory overhead of all the engines combine */
unsigned long functionsMemoryOverhead() { unsigned long functionsMemoryOverhead(void) {
size_t memory_overhead = dictMemUsage(engines); size_t memory_overhead = dictMemUsage(engines);
memory_overhead += dictMemUsage(curr_functions_lib_ctx->functions); memory_overhead += dictMemUsage(curr_functions_lib_ctx->functions);
memory_overhead += sizeof(functionsLibCtx); memory_overhead += sizeof(functionsLibCtx);
...@@ -1101,15 +1101,15 @@ unsigned long functionsMemoryOverhead() { ...@@ -1101,15 +1101,15 @@ unsigned long functionsMemoryOverhead() {
} }
/* Returns the number of functions */ /* Returns the number of functions */
unsigned long functionsNum() { unsigned long functionsNum(void) {
return dictSize(curr_functions_lib_ctx->functions); return dictSize(curr_functions_lib_ctx->functions);
} }
unsigned long functionsLibNum() { unsigned long functionsLibNum(void) {
return dictSize(curr_functions_lib_ctx->libraries); return dictSize(curr_functions_lib_ctx->libraries);
} }
dict* functionsLibGet() { dict* functionsLibGet(void) {
return curr_functions_lib_ctx->libraries; return curr_functions_lib_ctx->libraries;
} }
...@@ -1119,7 +1119,7 @@ size_t functionsLibCtxfunctionsLen(functionsLibCtx *functions_ctx) { ...@@ -1119,7 +1119,7 @@ size_t functionsLibCtxfunctionsLen(functionsLibCtx *functions_ctx) {
/* Initialize engine data structures. /* Initialize engine data structures.
* Should be called once on server initialization */ * Should be called once on server initialization */
int functionsInit() { int functionsInit(void) {
engines = dictCreate(&engineDictType); engines = dictCreate(&engineDictType);
if (luaEngineInitEngine() != C_OK) { if (luaEngineInitEngine() != C_OK) {
......
...@@ -110,14 +110,14 @@ struct functionLibInfo { ...@@ -110,14 +110,14 @@ struct functionLibInfo {
int functionsRegisterEngine(const char *engine_name, engine *engine_ctx); int functionsRegisterEngine(const char *engine_name, engine *engine_ctx);
sds functionsCreateWithLibraryCtx(sds code, int replace, sds* err, functionsLibCtx *lib_ctx); sds functionsCreateWithLibraryCtx(sds code, int replace, sds* err, functionsLibCtx *lib_ctx);
unsigned long functionsMemory(); unsigned long functionsMemory(void);
unsigned long functionsMemoryOverhead(); unsigned long functionsMemoryOverhead(void);
unsigned long functionsNum(); unsigned long functionsNum(void);
unsigned long functionsLibNum(); unsigned long functionsLibNum(void);
dict* functionsLibGet(); dict* functionsLibGet(void);
size_t functionsLibCtxfunctionsLen(functionsLibCtx *functions_ctx); size_t functionsLibCtxfunctionsLen(functionsLibCtx *functions_ctx);
functionsLibCtx* functionsLibCtxGetCurrent(); functionsLibCtx* functionsLibCtxGetCurrent(void);
functionsLibCtx* functionsLibCtxCreate(); functionsLibCtx* functionsLibCtxCreate(void);
void functionsLibCtxClearCurrent(int async); void functionsLibCtxClearCurrent(int async);
void functionsLibCtxFree(functionsLibCtx *lib_ctx); void functionsLibCtxFree(functionsLibCtx *lib_ctx);
void functionsLibCtxClear(functionsLibCtx *lib_ctx); void functionsLibCtxClear(functionsLibCtx *lib_ctx);
...@@ -125,7 +125,7 @@ void functionsLibCtxSwapWithCurrent(functionsLibCtx *lib_ctx); ...@@ -125,7 +125,7 @@ void functionsLibCtxSwapWithCurrent(functionsLibCtx *lib_ctx);
int functionLibCreateFunction(sds name, void *function, functionLibInfo *li, sds desc, uint64_t f_flags, sds *err); int functionLibCreateFunction(sds name, void *function, functionLibInfo *li, sds desc, uint64_t f_flags, sds *err);
int luaEngineInitEngine(); int luaEngineInitEngine(void);
int functionsInit(); int functionsInit(void);
#endif /* __FUNCTIONS_H_ */ #endif /* __FUNCTIONS_H_ */
...@@ -82,7 +82,7 @@ size_t lazyfreeGetFreedObjectsCount(void) { ...@@ -82,7 +82,7 @@ size_t lazyfreeGetFreedObjectsCount(void) {
return aux; return aux;
} }
void lazyfreeResetStats() { void lazyfreeResetStats(void) {
atomicSet(lazyfreed_objects,0); atomicSet(lazyfreed_objects,0);
} }
......
...@@ -1693,7 +1693,7 @@ char *mixlist[] = {"hello", "foo", "quux", "1024"}; ...@@ -1693,7 +1693,7 @@ char *mixlist[] = {"hello", "foo", "quux", "1024"};
char *intlist[] = {"4294967296", "-100", "100", "128000", char *intlist[] = {"4294967296", "-100", "100", "128000",
"non integer", "much much longer non integer"}; "non integer", "much much longer non integer"};
static unsigned char *createList() { static unsigned char *createList(void) {
unsigned char *lp = lpNew(0); unsigned char *lp = lpNew(0);
lp = lpAppend(lp, (unsigned char*)mixlist[1], strlen(mixlist[1])); lp = lpAppend(lp, (unsigned char*)mixlist[1], strlen(mixlist[1]));
lp = lpAppend(lp, (unsigned char*)mixlist[2], strlen(mixlist[2])); lp = lpAppend(lp, (unsigned char*)mixlist[2], strlen(mixlist[2]));
...@@ -1702,7 +1702,7 @@ static unsigned char *createList() { ...@@ -1702,7 +1702,7 @@ static unsigned char *createList() {
return lp; return lp;
} }
static unsigned char *createIntList() { static unsigned char *createIntList(void) {
unsigned char *lp = lpNew(0); unsigned char *lp = lpNew(0);
lp = lpAppend(lp, (unsigned char*)intlist[2], strlen(intlist[2])); lp = lpAppend(lp, (unsigned char*)intlist[2], strlen(intlist[2]));
lp = lpAppend(lp, (unsigned char*)intlist[3], strlen(intlist[3])); lp = lpAppend(lp, (unsigned char*)intlist[3], strlen(intlist[3]));
......
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