Avoid warnings with -Wstrict-prototypes

This commit is contained in:
Pieter Noordhuis 2011-01-27 12:50:55 +01:00
parent 3e8cbd53cf
commit fbe756d838
5 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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;

View File

@ -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);

2
sds.h
View File

@ -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);

10
test.c
View File

@ -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;