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
hiredis
Commits
fbe756d8
Commit
fbe756d8
authored
Jan 27, 2011
by
Pieter Noordhuis
Browse files
Avoid warnings with -Wstrict-prototypes
parent
3e8cbd53
Changes
5
Show whitespace changes
Inline
Side-by-side
Makefile
View file @
fbe756d8
...
@@ -16,7 +16,7 @@ ifeq ($(uname_S),SunOS)
...
@@ -16,7 +16,7 @@ ifeq ($(uname_S),SunOS)
STLIBNAME
?=
libhiredis.a
STLIBNAME
?=
libhiredis.a
STLIB_MAKE_CMD
?=
ar rcs
${STLIBNAME}
${OBJ}
STLIB_MAKE_CMD
?=
ar rcs
${STLIBNAME}
${OBJ}
else
ifeq
($(uname_S),Darwin)
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
CCLINK
?=
-lm
-pthread
LDFLAGS
?=
-L
.
-Wl
,-rpath,.
LDFLAGS
?=
-L
.
-Wl
,-rpath,.
OBJARCH
?=
-arch
i386
-arch
x86_64
OBJARCH
?=
-arch
i386
-arch
x86_64
...
@@ -25,7 +25,7 @@ else ifeq ($(uname_S),Darwin)
...
@@ -25,7 +25,7 @@ else ifeq ($(uname_S),Darwin)
STLIBNAME
?=
libhiredis.a
STLIBNAME
?=
libhiredis.a
STLIB_MAKE_CMD
?=
libtool
-static
-o
${STLIBNAME}
-
${OBJ}
STLIB_MAKE_CMD
?=
libtool
-static
-o
${STLIBNAME}
-
${OBJ}
else
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
CCLINK
?=
-lm
-pthread
LDFLAGS
?=
-L
.
-Wl
,-rpath,.
LDFLAGS
?=
-L
.
-Wl
,-rpath,.
DYLIBNAME
?=
libhiredis.so
DYLIBNAME
?=
libhiredis.so
...
...
hiredis.c
View file @
fbe756d8
...
@@ -434,7 +434,7 @@ static int processItem(redisReader *r) {
...
@@ -434,7 +434,7 @@ static int processItem(redisReader *r) {
}
}
}
}
void
*
redisReplyReaderCreate
()
{
void *redisReplyReaderCreate(
void
) {
redisReader *r = calloc(sizeof(redisReader),1);
redisReader *r = calloc(sizeof(redisReader),1);
r->error = NULL;
r->error = NULL;
r->fn = &defaultFunctions;
r->fn = &defaultFunctions;
...
@@ -793,7 +793,7 @@ void __redisSetError(redisContext *c, int type, const sds errstr) {
...
@@ -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);
redisContext *c = calloc(sizeof(redisContext),1);
c->err = 0;
c->err = 0;
c->errstr = NULL;
c->errstr = NULL;
...
...
hiredis.h
View file @
fbe756d8
...
@@ -129,7 +129,7 @@ typedef struct redisContext {
...
@@ -129,7 +129,7 @@ typedef struct redisContext {
}
redisContext
;
}
redisContext
;
void
freeReplyObject
(
void
*
reply
);
void
freeReplyObject
(
void
*
reply
);
void
*
redisReplyReaderCreate
();
void
*
redisReplyReaderCreate
(
void
);
int
redisReplyReaderSetReplyObjectFunctions
(
void
*
reader
,
redisReplyObjectFunctions
*
fn
);
int
redisReplyReaderSetReplyObjectFunctions
(
void
*
reader
,
redisReplyObjectFunctions
*
fn
);
int
redisReplyReaderSetPrivdata
(
void
*
reader
,
void
*
privdata
);
int
redisReplyReaderSetPrivdata
(
void
*
reader
,
void
*
privdata
);
void
*
redisReplyReaderGetObject
(
void
*
reader
);
void
*
redisReplyReaderGetObject
(
void
*
reader
);
...
...
sds.h
View file @
fbe756d8
...
@@ -44,7 +44,7 @@ struct sdshdr {
...
@@ -44,7 +44,7 @@ struct sdshdr {
sds
sdsnewlen
(
const
void
*
init
,
size_t
initlen
);
sds
sdsnewlen
(
const
void
*
init
,
size_t
initlen
);
sds
sdsnew
(
const
char
*
init
);
sds
sdsnew
(
const
char
*
init
);
sds
sdsempty
();
sds
sdsempty
(
void
);
size_t
sdslen
(
const
sds
s
);
size_t
sdslen
(
const
sds
s
);
sds
sdsdup
(
const
sds
s
);
sds
sdsdup
(
const
sds
s
);
void
sdsfree
(
sds
s
);
void
sdsfree
(
sds
s
);
...
...
test.c
View file @
fbe756d8
...
@@ -32,7 +32,7 @@ static void __connect(redisContext **target) {
...
@@ -32,7 +32,7 @@ static void __connect(redisContext **target) {
}
}
}
}
static
void
test_format_commands
()
{
static
void
test_format_commands
(
void
)
{
char
*
cmd
;
char
*
cmd
;
int
len
;
int
len
;
...
@@ -116,7 +116,7 @@ static void test_format_commands() {
...
@@ -116,7 +116,7 @@ static void test_format_commands() {
free
(
cmd
);
free
(
cmd
);
}
}
static
void
test_blocking_connection
()
{
static
void
test_blocking_connection
(
void
)
{
redisContext
*
c
;
redisContext
*
c
;
redisReply
*
reply
;
redisReply
*
reply
;
int
major
,
minor
;
int
major
,
minor
;
...
@@ -261,7 +261,7 @@ static void test_blocking_connection() {
...
@@ -261,7 +261,7 @@ static void test_blocking_connection() {
__connect
(
&
c
);
__connect
(
&
c
);
}
}
static
void
test_reply_reader
()
{
static
void
test_reply_reader
(
void
)
{
void
*
reader
;
void
*
reader
;
void
*
reply
;
void
*
reply
;
char
*
err
;
char
*
err
;
...
@@ -320,7 +320,7 @@ static void test_reply_reader() {
...
@@ -320,7 +320,7 @@ static void test_reply_reader() {
redisReplyReaderFree
(
reader
);
redisReplyReaderFree
(
reader
);
}
}
static
void
test_throughput
()
{
static
void
test_throughput
(
void
)
{
int
i
;
int
i
;
long
long
t1
,
t2
;
long
long
t1
,
t2
;
redisContext
*
c
=
blocking_context
;
redisContext
*
c
=
blocking_context
;
...
@@ -354,7 +354,7 @@ static void test_throughput() {
...
@@ -354,7 +354,7 @@ static void test_throughput() {
printf
(
"
\t
(1000x LRANGE with 500 elements: %.2fs)
\n
"
,
(
t2
-
t1
)
/
1000000
.
0
);
printf
(
"
\t
(1000x LRANGE with 500 elements: %.2fs)
\n
"
,
(
t2
-
t1
)
/
1000000
.
0
);
}
}
static
void
cleanup
()
{
static
void
cleanup
(
void
)
{
redisContext
*
c
=
blocking_context
;
redisContext
*
c
=
blocking_context
;
redisReply
*
reply
;
redisReply
*
reply
;
...
...
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