diff options
author | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2016-10-26 12:15:23 +0300 |
---|---|---|
committer | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2016-10-26 13:28:20 +0300 |
commit | e9c992e425d3745d65468a43618b5ee18e258ff0 (patch) | |
tree | 58e4259fa4e64fe6000ea531b0a92a740c92e815 /cluster_library.c | |
parent | 339d62dbc911dbc7aacadc925ced0bcf94857831 (diff) |
WIP: php7 compatibility
Define ZEND_SAME_FAKE_TYPE macro and use it instead of Z_TYPE == IS_BOOL
Redefine add_assoc_stringl_ex as macro
Diffstat (limited to 'cluster_library.c')
-rw-r--r-- | cluster_library.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cluster_library.c b/cluster_library.c index 4c321900..fd987aa0 100644 --- a/cluster_library.c +++ b/cluster_library.c @@ -2382,11 +2382,10 @@ int mbulk_resp_loop_zipstr(RedisSock *redis_sock, zval *z_result, zval *z = NULL; if(redis_unserialize(redis_sock, line, line_len, &z TSRMLS_CC)==1) { add_assoc_zval(z_result, key, z); - efree(line); } else { - add_assoc_stringl_ex(z_result, key, 1+key_len, line, - line_len, 0); + add_assoc_stringl_ex(z_result, key, 1+key_len, line, line_len); } + efree(line); efree(key); } } @@ -2450,13 +2449,13 @@ int mbulk_resp_loop_assoc(RedisSock *redis_sock, zval *z_result, if(line != NULL) { zval *z = NULL; if(redis_unserialize(redis_sock, line, line_len, &z TSRMLS_CC)==1) { - efree(line); add_assoc_zval_ex(z_result,Z_STRVAL_P(z_keys[i]), 1+Z_STRLEN_P(z_keys[i]), z); } else { add_assoc_stringl_ex(z_result, Z_STRVAL_P(z_keys[i]), - 1+Z_STRLEN_P(z_keys[i]), line, line_len, 0); + 1+Z_STRLEN_P(z_keys[i]), line, line_len); } + efree(line); } else { add_assoc_bool_ex(z_result, Z_STRVAL_P(z_keys[i]), 1+Z_STRLEN_P(z_keys[i]), 0); |