summaryrefslogtreecommitdiff
path: root/src/rdb.h
diff options
context:
space:
mode:
authorMoti Cohen <moti.cohen@redis.com>2022-08-03 19:38:08 +0300
committerGitHub <noreply@github.com>2022-08-03 19:38:08 +0300
commit1aa6c4ab9294af4eef50fbd82079051f4c06dd42 (patch)
treedf96cdc70b889964ae8d0410b6ee9b2affb5f701 /src/rdb.h
parentdcafee55a580430b17ca237799a4eff245919c3b (diff)
downloadredis-1aa6c4ab9294af4eef50fbd82079051f4c06dd42.tar.gz
Adding parentheses and do-while(0) to macros (#11080)
Fixing few macros that doesn't follows most basic safety conventions which is wrapping any usage of passed variable with parentheses and if written more than one command, then wrap it with do-while(0) (or parentheses).
Diffstat (limited to 'src/rdb.h')
-rw-r--r--src/rdb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rdb.h b/src/rdb.h
index 4f057a252..d85300eab 100644
--- a/src/rdb.h
+++ b/src/rdb.h
@@ -98,7 +98,7 @@
/* NOTE: WHEN ADDING NEW RDB TYPE, UPDATE rdbIsObjectType() BELOW */
/* Test if a type is an object type. */
-#define rdbIsObjectType(t) ((t >= 0 && t <= 7) || (t >= 9 && t <= 19))
+#define rdbIsObjectType(t) (((t) >= 0 && (t) <= 7) || ((t) >= 9 && (t) <= 19))
/* Special RDB opcodes (saved/loaded with rdbSaveType/rdbLoadType). */
#define RDB_OPCODE_FUNCTION2 245 /* function library data */