From fbe756d8389ea0b6966fbf9bd48d27253eed5a3a Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 27 Jan 2011 12:50:55 +0100 Subject: [PATCH] Avoid warnings with -Wstrict-prototypes --- Makefile | 4 ++-- hiredis.c | 4 ++-- hiredis.h | 2 +- sds.h | 2 +- test.c | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 5282b5d..ee93aba 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ ifeq ($(uname_S),SunOS) STLIBNAME?=libhiredis.a STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ} else ifeq ($(uname_S),Darwin) - CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wwrite-strings $(ARCH) $(PROF) + CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) CCLINK?=-lm -pthread LDFLAGS?=-L. -Wl,-rpath,. OBJARCH?=-arch i386 -arch x86_64 @@ -25,7 +25,7 @@ else ifeq ($(uname_S),Darwin) STLIBNAME?=libhiredis.a STLIB_MAKE_CMD?=libtool -static -o ${STLIBNAME} - ${OBJ} else - CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wwrite-strings $(ARCH) $(PROF) + CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) CCLINK?=-lm -pthread LDFLAGS?=-L. -Wl,-rpath,. DYLIBNAME?=libhiredis.so diff --git a/hiredis.c b/hiredis.c index 9ff0b97..243ea75 100644 --- a/hiredis.c +++ b/hiredis.c @@ -434,7 +434,7 @@ static int processItem(redisReader *r) { } } -void *redisReplyReaderCreate() { +void *redisReplyReaderCreate(void) { redisReader *r = calloc(sizeof(redisReader),1); r->error = NULL; r->fn = &defaultFunctions; @@ -793,7 +793,7 @@ void __redisSetError(redisContext *c, int type, const sds errstr) { } } -static redisContext *redisContextInit() { +static redisContext *redisContextInit(void) { redisContext *c = calloc(sizeof(redisContext),1); c->err = 0; c->errstr = NULL; diff --git a/hiredis.h b/hiredis.h index 8fdca4a..c33606b 100644 --- a/hiredis.h +++ b/hiredis.h @@ -129,7 +129,7 @@ typedef struct redisContext { } redisContext; void freeReplyObject(void *reply); -void *redisReplyReaderCreate(); +void *redisReplyReaderCreate(void); int redisReplyReaderSetReplyObjectFunctions(void *reader, redisReplyObjectFunctions *fn); int redisReplyReaderSetPrivdata(void *reader, void *privdata); void *redisReplyReaderGetObject(void *reader); diff --git a/sds.h b/sds.h index c64e8d5..eb41eb7 100644 --- a/sds.h +++ b/sds.h @@ -44,7 +44,7 @@ struct sdshdr { sds sdsnewlen(const void *init, size_t initlen); sds sdsnew(const char *init); -sds sdsempty(); +sds sdsempty(void); size_t sdslen(const sds s); sds sdsdup(const sds s); void sdsfree(sds s); diff --git a/test.c b/test.c index 9ab0354..8017356 100644 --- a/test.c +++ b/test.c @@ -32,7 +32,7 @@ static void __connect(redisContext **target) { } } -static void test_format_commands() { +static void test_format_commands(void) { char *cmd; int len; @@ -116,7 +116,7 @@ static void test_format_commands() { free(cmd); } -static void test_blocking_connection() { +static void test_blocking_connection(void) { redisContext *c; redisReply *reply; int major, minor; @@ -261,7 +261,7 @@ static void test_blocking_connection() { __connect(&c); } -static void test_reply_reader() { +static void test_reply_reader(void) { void *reader; void *reply; char *err; @@ -320,7 +320,7 @@ static void test_reply_reader() { redisReplyReaderFree(reader); } -static void test_throughput() { +static void test_throughput(void) { int i; long long t1, t2; redisContext *c = blocking_context; @@ -354,7 +354,7 @@ static void test_throughput() { printf("\t(1000x LRANGE with 500 elements: %.2fs)\n", (t2-t1)/1000000.0); } -static void cleanup() { +static void cleanup(void) { redisContext *c = blocking_context; redisReply *reply;