Skip to content

Commit dad6cd9

Browse files
Fix C89 compatibility
Pulled from: 00be281
1 parent 400f11c commit dad6cd9

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

library.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -850,13 +850,12 @@ int redis_cmd_append_sstr_long(smart_str *str, long append) {
850850
*/
851851
int redis_cmd_append_sstr_dbl(smart_str *str, double value) {
852852
char *dbl_str;
853-
int dbl_len;
854-
int retval;
853+
int dbl_len, retval;
855854

856855
/* Convert to double */
857856
REDIS_DOUBLE_TO_STRING(dbl_str, dbl_len, value);
858857

859-
/* Append the string */
858+
// Append the string
860859
retval = redis_cmd_append_sstr(str, dbl_str, dbl_len);
861860

862861
/* Free our double string */
@@ -870,11 +869,11 @@ int redis_cmd_append_sstr_dbl(smart_str *str, double value) {
870869
* Append an integer command to a Redis command
871870
*/
872871
int redis_cmd_append_int(char **cmd, int cmd_len, int append) {
873-
char int_buf[32];
874-
int int_len;
872+
char int_buf[32];
873+
int int_len;
875874

876-
/* Conver to an int, capture length */
877-
int_len = snprintf(int_buf, sizeof(int_buf), "%d", append);
875+
// Conver to an int, capture length
876+
int_len = snprintf(int_buf, sizeof(int_buf), "%d", append);
878877

879878
/* Return the new length */
880879
return redis_cmd_append_str(cmd, cmd_len, int_buf, int_len);
@@ -1051,6 +1050,8 @@ PHP_REDIS_API void redis_client_list_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSo
10511050

10521051
PHPAPI zval* redis_parse_client_list_response(char *response) {
10531052
zval *z_result, *z_sub_result;
1053+
char *p, *lpos, *kpos = NULL, *vpos = NULL, *p2, *key, *value;
1054+
int klen = 0, done = 0, is_numeric;
10541055

10551056
// Allocate memory for our response
10561057
MAKE_STD_ZVAL(z_result);
@@ -1061,8 +1062,8 @@ PHPAPI zval* redis_parse_client_list_response(char *response) {
10611062
array_init(z_sub_result);
10621063

10631064
// Pointers for parsing
1064-
char *p = response, *lpos = response, *p2, *key;
1065-
char *kpos = NULL, *vpos = NULL, *value;
1065+
p = response;
1066+
lpos = response;
10661067

10671068
/* While we've got more to parse */
10681069
while(!done) {

0 commit comments

Comments
 (0)