summaryrefslogtreecommitdiff
path: root/src/script.c
diff options
context:
space:
mode:
authorMadelyn Olson <34459052+madolson@users.noreply.github.com>2023-05-02 17:31:32 -0700
committerGitHub <noreply@github.com>2023-05-02 17:31:32 -0700
commit5e3be1be09c947810732e7be2a4bb1b0ed75de4a (patch)
tree821f53aaa761e676d5d3cb8ec556a61b39a2968c /src/script.c
parent8163e816fe9b1ef7f1a904d862f6e2e24bc19713 (diff)
downloadredis-5e3be1be09c947810732e7be2a4bb1b0ed75de4a.tar.gz
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).
Diffstat (limited to 'src/script.c')
-rw-r--r--src/script.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/script.c b/src/script.c
index dd0bd3a58..70680e3ea 100644
--- a/src/script.c
+++ b/src/script.c
@@ -60,16 +60,16 @@ static void enterScriptTimedoutMode(scriptRunCtx *run_ctx) {
blockingOperationStarts();
}
-int scriptIsTimedout() {
+int scriptIsTimedout(void) {
return scriptIsRunning() && (curr_run_ctx->flags & SCRIPT_TIMEDOUT);
}
-client* scriptGetClient() {
+client* scriptGetClient(void) {
serverAssert(scriptIsRunning());
return curr_run_ctx->c;
}
-client* scriptGetCaller() {
+client* scriptGetCaller(void) {
serverAssert(scriptIsRunning());
return curr_run_ctx->original_client;
}
@@ -269,16 +269,16 @@ void scriptResetRun(scriptRunCtx *run_ctx) {
}
/* return true if a script is currently running */
-int scriptIsRunning() {
+int scriptIsRunning(void) {
return curr_run_ctx != NULL;
}
-const char* scriptCurrFunction() {
+const char* scriptCurrFunction(void) {
serverAssert(scriptIsRunning());
return curr_run_ctx->funcname;
}
-int scriptIsEval() {
+int scriptIsEval(void) {
serverAssert(scriptIsRunning());
return curr_run_ctx->flags & SCRIPT_EVAL_MODE;
}
@@ -571,7 +571,7 @@ error:
incrCommandStatsOnError(cmd, ERROR_COMMAND_REJECTED);
}
-long long scriptRunDuration() {
+long long scriptRunDuration(void) {
serverAssert(scriptIsRunning());
return elapsedMs(curr_run_ctx->start_time);
}