Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
4bc14da2
Unverified
Commit
4bc14da2
authored
Dec 22, 2020
by
sundb
Committed by
GitHub
Dec 21, 2020
Browse files
Fix some redundancy use of semicolon in do-while macros (#8221)
* Fix some redundancy use of semicolon in do-while macros
parent
4c13945c
Changes
8
Hide whitespace changes
Inline
Side-by-side
deps/hiredis/async_private.h
View file @
4bc14da2
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
#define _EL_CLEANUP(ctx) do { \
#define _EL_CLEANUP(ctx) do { \
if ((ctx)->ev.cleanup) (ctx)->ev.cleanup((ctx)->ev.data); \
if ((ctx)->ev.cleanup) (ctx)->ev.cleanup((ctx)->ev.data); \
ctx->ev.cleanup = NULL; \
ctx->ev.cleanup = NULL; \
} while(0)
;
} while(0)
static
inline
void
refreshTimeout
(
redisAsyncContext
*
ctx
)
{
static
inline
void
refreshTimeout
(
redisAsyncContext
*
ctx
)
{
#define REDIS_TIMER_ISSET(tvp) \
#define REDIS_TIMER_ISSET(tvp) \
...
...
src/config.c
View file @
4bc14da2
...
@@ -915,7 +915,7 @@ badfmt: /* Bad format errors */
...
@@ -915,7 +915,7 @@ badfmt: /* Bad format errors */
addReplyBulkCString(c,_var ? _var : ""); \
addReplyBulkCString(c,_var ? _var : ""); \
matches++; \
matches++; \
} \
} \
} while(0)
;
} while(0)
#define config_get_bool_field(_name,_var) do { \
#define config_get_bool_field(_name,_var) do { \
if (stringmatch(pattern,_name,1)) { \
if (stringmatch(pattern,_name,1)) { \
...
@@ -923,7 +923,7 @@ badfmt: /* Bad format errors */
...
@@ -923,7 +923,7 @@ badfmt: /* Bad format errors */
addReplyBulkCString(c,_var ? "yes" : "no"); \
addReplyBulkCString(c,_var ? "yes" : "no"); \
matches++; \
matches++; \
} \
} \
} while(0)
;
} while(0)
#define config_get_numerical_field(_name,_var) do { \
#define config_get_numerical_field(_name,_var) do { \
if (stringmatch(pattern,_name,1)) { \
if (stringmatch(pattern,_name,1)) { \
...
@@ -932,8 +932,7 @@ badfmt: /* Bad format errors */
...
@@ -932,8 +932,7 @@ badfmt: /* Bad format errors */
addReplyBulkCString(c,buf); \
addReplyBulkCString(c,buf); \
matches++; \
matches++; \
} \
} \
} while(0);
} while(0)
void
configGetCommand
(
client
*
c
)
{
void
configGetCommand
(
client
*
c
)
{
robj
*
o
=
c
->
argv
[
2
];
robj
*
o
=
c
->
argv
[
2
];
...
...
src/debugmacro.h
View file @
4bc14da2
...
@@ -38,4 +38,4 @@
...
@@ -38,4 +38,4 @@
fprintf(fp,__VA_ARGS__); \
fprintf(fp,__VA_ARGS__); \
fprintf(fp,"\n"); \
fprintf(fp,"\n"); \
fclose(fp); \
fclose(fp); \
} while (0)
;
} while (0)
src/dict.c
View file @
4bc14da2
...
@@ -1215,7 +1215,7 @@ dictType BenchmarkDictType = {
...
@@ -1215,7 +1215,7 @@ dictType BenchmarkDictType = {
#define end_benchmark(msg) do { \
#define end_benchmark(msg) do { \
elapsed = timeInMilliseconds()-start; \
elapsed = timeInMilliseconds()-start; \
printf(msg ": %ld items in %lld ms\n", count, elapsed); \
printf(msg ": %ld items in %lld ms\n", count, elapsed); \
} while(0)
;
} while(0)
/* dict-benchmark [count] */
/* dict-benchmark [count] */
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
...
...
src/modules/testmodule.c
View file @
4bc14da2
...
@@ -364,7 +364,7 @@ int TestAssertIntegerReply(RedisModuleCtx *ctx, RedisModuleCallReply *reply, lon
...
@@ -364,7 +364,7 @@ int TestAssertIntegerReply(RedisModuleCtx *ctx, RedisModuleCallReply *reply, lon
do { \
do { \
RedisModule_Log(ctx,"warning","Testing %s", name); \
RedisModule_Log(ctx,"warning","Testing %s", name); \
reply = RedisModule_Call(ctx,name,__VA_ARGS__); \
reply = RedisModule_Call(ctx,name,__VA_ARGS__); \
} while (0)
;
} while (0)
/* TEST.IT -- Run all the tests. */
/* TEST.IT -- Run all the tests. */
int
TestIt
(
RedisModuleCtx
*
ctx
,
RedisModuleString
**
argv
,
int
argc
)
{
int
TestIt
(
RedisModuleCtx
*
ctx
,
RedisModuleString
**
argv
,
int
argc
)
{
...
...
src/quicklist.c
View file @
4bc14da2
...
@@ -69,7 +69,7 @@ static const size_t optimization_level[] = {4096, 8192, 16384, 32768, 65536};
...
@@ -69,7 +69,7 @@ static const size_t optimization_level[] = {4096, 8192, 16384, 32768, 65536};
printf("%s:%s:%d:\t", __FILE__, __FUNCTION__, __LINE__); \
printf("%s:%s:%d:\t", __FILE__, __FUNCTION__, __LINE__); \
printf(__VA_ARGS__); \
printf(__VA_ARGS__); \
printf("\n"); \
printf("\n"); \
} while (0)
;
} while (0)
#endif
#endif
/* Bookmarks forward declarations */
/* Bookmarks forward declarations */
...
...
src/server.h
View file @
4bc14da2
...
@@ -605,7 +605,7 @@ typedef struct RedisModuleIO {
...
@@ -605,7 +605,7 @@ typedef struct RedisModuleIO {
iovar.ver = 0; \
iovar.ver = 0; \
iovar.key = keyptr; \
iovar.key = keyptr; \
iovar.ctx = NULL; \
iovar.ctx = NULL; \
} while(0)
;
} while(0)
/* This is a structure used to export DEBUG DIGEST capabilities to Redis
/* This is a structure used to export DEBUG DIGEST capabilities to Redis
* modules. We want to capture both the ordered and unordered elements of
* modules. We want to capture both the ordered and unordered elements of
...
@@ -621,7 +621,7 @@ typedef struct RedisModuleDigest {
...
@@ -621,7 +621,7 @@ typedef struct RedisModuleDigest {
#define moduleInitDigestContext(mdvar) do { \
#define moduleInitDigestContext(mdvar) do { \
memset(mdvar.o,0,sizeof(mdvar.o)); \
memset(mdvar.o,0,sizeof(mdvar.o)); \
memset(mdvar.x,0,sizeof(mdvar.x)); \
memset(mdvar.x,0,sizeof(mdvar.x)); \
} while(0)
;
} while(0)
/* Objects encoding. Some kind of objects like Strings and Hashes can be
/* Objects encoding. Some kind of objects like Strings and Hashes can be
* internally represented in multiple ways. The 'encoding' field of the object
* internally represented in multiple ways. The 'encoding' field of the object
...
...
src/testhelp.h
View file @
4bc14da2
...
@@ -44,7 +44,7 @@ int __test_num = 0;
...
@@ -44,7 +44,7 @@ int __test_num = 0;
#define test_cond(descr,_c) do { \
#define test_cond(descr,_c) do { \
__test_num++; printf("%d - %s: ", __test_num, descr); \
__test_num++; printf("%d - %s: ", __test_num, descr); \
if(_c) printf("PASSED\n"); else {printf("FAILED\n"); __failed_tests++;} \
if(_c) printf("PASSED\n"); else {printf("FAILED\n"); __failed_tests++;} \
} while(0)
;
} while(0)
#define test_report() do { \
#define test_report() do { \
printf("%d tests, %d passed, %d failed\n", __test_num, \
printf("%d tests, %d passed, %d failed\n", __test_num, \
__test_num-__failed_tests, __failed_tests); \
__test_num-__failed_tests, __failed_tests); \
...
@@ -52,6 +52,6 @@ int __test_num = 0;
...
@@ -52,6 +52,6 @@ int __test_num = 0;
printf("=== WARNING === We have failed tests here...\n"); \
printf("=== WARNING === We have failed tests here...\n"); \
exit(1); \
exit(1); \
} \
} \
} while(0)
;
} while(0)
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment