Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
e43597ae
Commit
e43597ae
authored
Jul 12, 2011
by
Pieter Noordhuis
Browse files
Be more UNIXy (0 == success)
parent
21858350
Changes
2
Show whitespace changes
Inline
Side-by-side
parser.c
View file @
e43597ae
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* the caller because "ISO C99 requires rest arguments to be used". */
* the caller because "ISO C99 requires rest arguments to be used". */
#define CALLBACK(X, ...) do { \
#define CALLBACK(X, ...) do { \
if (callbacks && callbacks->on_##X) { \
if (callbacks && callbacks->on_##X) { \
if (callbacks->on_##X(parser, __VA_ARGS__)
=
= 0) { \
if (callbacks->on_##X(parser, __VA_ARGS__)
!
= 0) { \
SET_ERRNO(ERR_CALLBACK); \
SET_ERRNO(ERR_CALLBACK); \
goto error; \
goto error; \
} \
} \
...
...
test/parser.c
View file @
e43597ae
...
@@ -50,7 +50,7 @@ int on_string(redis_parser_t *parser, redis_protocol_t *obj, const char *buf, si
...
@@ -50,7 +50,7 @@ int on_string(redis_parser_t *parser, redis_protocol_t *obj, const char *buf, si
.
string_len
=
len
.
string_len
=
len
};
};
cb_log
[
cb_log_idx
++
]
=
tmp
;
cb_log
[
cb_log_idx
++
]
=
tmp
;
return
1
;
return
0
;
}
}
int
on_array
(
redis_parser_t
*
parser
,
redis_protocol_t
*
obj
,
size_t
len
)
{
int
on_array
(
redis_parser_t
*
parser
,
redis_protocol_t
*
obj
,
size_t
len
)
{
...
@@ -59,7 +59,7 @@ int on_array(redis_parser_t *parser, redis_protocol_t *obj, size_t len) {
...
@@ -59,7 +59,7 @@ int on_array(redis_parser_t *parser, redis_protocol_t *obj, size_t len) {
.
array_len
=
len
.
array_len
=
len
};
};
cb_log
[
cb_log_idx
++
]
=
tmp
;
cb_log
[
cb_log_idx
++
]
=
tmp
;
return
1
;
return
0
;
}
}
int
on_integer
(
redis_parser_t
*
parser
,
redis_protocol_t
*
obj
,
int64_t
value
)
{
int
on_integer
(
redis_parser_t
*
parser
,
redis_protocol_t
*
obj
,
int64_t
value
)
{
...
@@ -68,7 +68,7 @@ int on_integer(redis_parser_t *parser, redis_protocol_t *obj, int64_t value) {
...
@@ -68,7 +68,7 @@ int on_integer(redis_parser_t *parser, redis_protocol_t *obj, int64_t value) {
.
integer_value
=
value
.
integer_value
=
value
};
};
cb_log
[
cb_log_idx
++
]
=
tmp
;
cb_log
[
cb_log_idx
++
]
=
tmp
;
return
1
;
return
0
;
}
}
int
on_nil
(
redis_parser_t
*
parser
,
redis_protocol_t
*
obj
)
{
int
on_nil
(
redis_parser_t
*
parser
,
redis_protocol_t
*
obj
)
{
...
@@ -76,7 +76,7 @@ int on_nil(redis_parser_t *parser, redis_protocol_t *obj) {
...
@@ -76,7 +76,7 @@ int on_nil(redis_parser_t *parser, redis_protocol_t *obj) {
.
obj
=
*
obj
.
obj
=
*
obj
};
};
cb_log
[
cb_log_idx
++
]
=
tmp
;
cb_log
[
cb_log_idx
++
]
=
tmp
;
return
1
;
return
0
;
}
}
static
redis_parser_callbacks_t
callbacks
=
{
static
redis_parser_callbacks_t
callbacks
=
{
...
...
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