summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-10-07 13:10:29 +0200
committerantirez <antirez@gmail.com>2016-10-07 13:10:31 +0200
commit3aa816e61a1512d5878040c114d074bc662e03f8 (patch)
tree8d4819abae4a4b0b255ab791bd6f8950851ae6f9
parent3879923db822789bbb508c171ed20ab2f5d6312f (diff)
downloadredis-3aa816e61a1512d5878040c114d074bc662e03f8.tar.gz
Modules: introduce warning suppression macro for unused args.
-rw-r--r--src/modules/hellotype.c5
-rw-r--r--src/modules/testmodule.c15
-rw-r--r--src/redismodule.h2
3 files changed, 22 insertions, 0 deletions
diff --git a/src/modules/hellotype.c b/src/modules/hellotype.c
index b33ed81cd..535eb88e1 100644
--- a/src/modules/hellotype.c
+++ b/src/modules/hellotype.c
@@ -227,6 +227,8 @@ void HelloTypeAofRewrite(RedisModuleIO *aof, RedisModuleString *key, void *value
}
void HelloTypeDigest(RedisModuleDigest *digest, void *value) {
+ REDISMODULE_NOT_USED(digest);
+ REDISMODULE_NOT_USED(value);
/* TODO: The DIGEST module interface is yet not implemented. */
}
@@ -237,6 +239,9 @@ void HelloTypeFree(void *value) {
/* This function must be present on each Redis module. It is used in order to
* register the commands into the Redis server. */
int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
+ REDISMODULE_NOT_USED(argv);
+ REDISMODULE_NOT_USED(argc);
+
if (RedisModule_Init(ctx,"hellotype",1,REDISMODULE_APIVER_1)
== REDISMODULE_ERR) return REDISMODULE_ERR;
diff --git a/src/modules/testmodule.c b/src/modules/testmodule.c
index db809a8e6..8da45c0ea 100644
--- a/src/modules/testmodule.c
+++ b/src/modules/testmodule.c
@@ -48,6 +48,9 @@ int TestMatchReply(RedisModuleCallReply *reply, char *str) {
/* TEST.CALL -- Test Call() API. */
int TestCall(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
+ REDISMODULE_NOT_USED(argv);
+ REDISMODULE_NOT_USED(argc);
+
RedisModule_AutoMemory(ctx);
RedisModuleCallReply *reply;
@@ -75,6 +78,9 @@ fail:
/* TEST.STRING.APPEND -- Test appending to an existing string object. */
int TestStringAppend(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
+ REDISMODULE_NOT_USED(argv);
+ REDISMODULE_NOT_USED(argc);
+
RedisModuleString *s = RedisModule_CreateString(ctx,"foo",3);
RedisModule_StringAppendBuffer(ctx,s,"bar",3);
RedisModule_ReplyWithString(ctx,s);
@@ -84,6 +90,9 @@ int TestStringAppend(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
/* TEST.STRING.APPEND.AM -- Test append with retain when auto memory is on. */
int TestStringAppendAM(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
+ REDISMODULE_NOT_USED(argv);
+ REDISMODULE_NOT_USED(argc);
+
RedisModule_AutoMemory(ctx);
RedisModuleString *s = RedisModule_CreateString(ctx,"foo",3);
RedisModule_RetainString(ctx,s);
@@ -163,6 +172,9 @@ int TestAssertIntegerReply(RedisModuleCtx *ctx, RedisModuleCallReply *reply, lon
/* TEST.IT -- Run all the tests. */
int TestIt(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
+ REDISMODULE_NOT_USED(argv);
+ REDISMODULE_NOT_USED(argc);
+
RedisModule_AutoMemory(ctx);
RedisModuleCallReply *reply;
@@ -195,6 +207,9 @@ fail:
}
int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
+ REDISMODULE_NOT_USED(argv);
+ REDISMODULE_NOT_USED(argc);
+
if (RedisModule_Init(ctx,"test",1,REDISMODULE_APIVER_1)
== REDISMODULE_ERR) return REDISMODULE_ERR;
diff --git a/src/redismodule.h b/src/redismodule.h
index eaf5dfab1..4743fa98c 100644
--- a/src/redismodule.h
+++ b/src/redismodule.h
@@ -68,6 +68,8 @@
#define REDISMODULE_POSITIVE_INFINITE (1.0/0.0)
#define REDISMODULE_NEGATIVE_INFINITE (-1.0/0.0)
+#define REDISMODULE_NOT_USED(V) ((void) V)
+
/* ------------------------- End of common defines ------------------------ */
#ifndef REDISMODULE_CORE