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
3aa816e6
Commit
3aa816e6
authored
Oct 07, 2016
by
antirez
Browse files
Modules: introduce warning suppression macro for unused args.
parent
3879923d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/modules/hellotype.c
View file @
3aa816e6
...
...
@@ -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
;
...
...
src/modules/testmodule.c
View file @
3aa816e6
...
...
@@ -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
;
...
...
src/redismodule.h
View file @
3aa816e6
...
...
@@ -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
...
...
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