summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsundb <sundbcn@gmail.com>2020-12-22 14:57:45 +0800
committerGitHub <noreply@github.com>2020-12-21 22:57:45 -0800
commit4bc14da2b3330c7ce8b9366ea3880eba65ba2ff9 (patch)
tree23a9e69ba3f179d6a559dc352b787d39a3a745f9
parent4c13945c370b98b69886c6bcd1e71d4934344cae (diff)
downloadredis-4bc14da2b3330c7ce8b9366ea3880eba65ba2ff9.tar.gz
Fix some redundancy use of semicolon in do-while macros (#8221)
* Fix some redundancy use of semicolon in do-while macros
-rw-r--r--deps/hiredis/async_private.h2
-rw-r--r--src/config.c7
-rw-r--r--src/debugmacro.h2
-rw-r--r--src/dict.c2
-rw-r--r--src/modules/testmodule.c2
-rw-r--r--src/quicklist.c2
-rw-r--r--src/server.h4
-rw-r--r--src/testhelp.h4
8 files changed, 12 insertions, 13 deletions
diff --git a/deps/hiredis/async_private.h b/deps/hiredis/async_private.h
index b9d23fffd..ea0558d42 100644
--- a/deps/hiredis/async_private.h
+++ b/deps/hiredis/async_private.h
@@ -51,7 +51,7 @@
#define _EL_CLEANUP(ctx) do { \
if ((ctx)->ev.cleanup) (ctx)->ev.cleanup((ctx)->ev.data); \
ctx->ev.cleanup = NULL; \
- } while(0);
+ } while(0)
static inline void refreshTimeout(redisAsyncContext *ctx) {
#define REDIS_TIMER_ISSET(tvp) \
diff --git a/src/config.c b/src/config.c
index 4617e8678..a92b41624 100644
--- a/src/config.c
+++ b/src/config.c
@@ -915,7 +915,7 @@ badfmt: /* Bad format errors */
addReplyBulkCString(c,_var ? _var : ""); \
matches++; \
} \
-} while(0);
+} while(0)
#define config_get_bool_field(_name,_var) do { \
if (stringmatch(pattern,_name,1)) { \
@@ -923,7 +923,7 @@ badfmt: /* Bad format errors */
addReplyBulkCString(c,_var ? "yes" : "no"); \
matches++; \
} \
-} while(0);
+} while(0)
#define config_get_numerical_field(_name,_var) do { \
if (stringmatch(pattern,_name,1)) { \
@@ -932,8 +932,7 @@ badfmt: /* Bad format errors */
addReplyBulkCString(c,buf); \
matches++; \
} \
-} while(0);
-
+} while(0)
void configGetCommand(client *c) {
robj *o = c->argv[2];
diff --git a/src/debugmacro.h b/src/debugmacro.h
index ded2d2667..58e6577e5 100644
--- a/src/debugmacro.h
+++ b/src/debugmacro.h
@@ -38,4 +38,4 @@
fprintf(fp,__VA_ARGS__); \
fprintf(fp,"\n"); \
fclose(fp); \
- } while (0);
+ } while (0)
diff --git a/src/dict.c b/src/dict.c
index 2c59dd466..4f0916a27 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -1215,7 +1215,7 @@ dictType BenchmarkDictType = {
#define end_benchmark(msg) do { \
elapsed = timeInMilliseconds()-start; \
printf(msg ": %ld items in %lld ms\n", count, elapsed); \
-} while(0);
+} while(0)
/* dict-benchmark [count] */
int main(int argc, char **argv) {
diff --git a/src/modules/testmodule.c b/src/modules/testmodule.c
index 5634530dd..078c02c5c 100644
--- a/src/modules/testmodule.c
+++ b/src/modules/testmodule.c
@@ -364,7 +364,7 @@ int TestAssertIntegerReply(RedisModuleCtx *ctx, RedisModuleCallReply *reply, lon
do { \
RedisModule_Log(ctx,"warning","Testing %s", name); \
reply = RedisModule_Call(ctx,name,__VA_ARGS__); \
- } while (0);
+ } while (0)
/* TEST.IT -- Run all the tests. */
int TestIt(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
diff --git a/src/quicklist.c b/src/quicklist.c
index 5ed9b6a5d..4dc3576ae 100644
--- a/src/quicklist.c
+++ b/src/quicklist.c
@@ -69,7 +69,7 @@ static const size_t optimization_level[] = {4096, 8192, 16384, 32768, 65536};
printf("%s:%s:%d:\t", __FILE__, __FUNCTION__, __LINE__); \
printf(__VA_ARGS__); \
printf("\n"); \
- } while (0);
+ } while (0)
#endif
/* Bookmarks forward declarations */
diff --git a/src/server.h b/src/server.h
index 5c75aed08..8a1f191f3 100644
--- a/src/server.h
+++ b/src/server.h
@@ -605,7 +605,7 @@ typedef struct RedisModuleIO {
iovar.ver = 0; \
iovar.key = keyptr; \
iovar.ctx = NULL; \
-} while(0);
+} while(0)
/* This is a structure used to export DEBUG DIGEST capabilities to Redis
* modules. We want to capture both the ordered and unordered elements of
@@ -621,7 +621,7 @@ typedef struct RedisModuleDigest {
#define moduleInitDigestContext(mdvar) do { \
memset(mdvar.o,0,sizeof(mdvar.o)); \
memset(mdvar.x,0,sizeof(mdvar.x)); \
-} while(0);
+} while(0)
/* Objects encoding. Some kind of objects like Strings and Hashes can be
* internally represented in multiple ways. The 'encoding' field of the object
diff --git a/src/testhelp.h b/src/testhelp.h
index 450334046..c6c1b55bf 100644
--- a/src/testhelp.h
+++ b/src/testhelp.h
@@ -44,7 +44,7 @@ int __test_num = 0;
#define test_cond(descr,_c) do { \
__test_num++; printf("%d - %s: ", __test_num, descr); \
if(_c) printf("PASSED\n"); else {printf("FAILED\n"); __failed_tests++;} \
-} while(0);
+} while(0)
#define test_report() do { \
printf("%d tests, %d passed, %d failed\n", __test_num, \
__test_num-__failed_tests, __failed_tests); \
@@ -52,6 +52,6 @@ int __test_num = 0;
printf("=== WARNING === We have failed tests here...\n"); \
exit(1); \
} \
-} while(0);
+} while(0)
#endif