diff options
author | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2016-09-23 08:51:28 +0300 |
---|---|---|
committer | Pavlo Yatsukhnenko <yatsukhnenko@gmail.com> | 2016-09-23 14:09:50 +0300 |
commit | 377dc5019c97050c90322d42d1215c8d6e7491eb (patch) | |
tree | 3a114ddeabf08c66e61bc2947c6cbf460cf0904e /redis_array_impl.c | |
parent | 5b2220411e807ab0a40712c1384eb8fa8d408933 (diff) |
WIP: php7 compatibility
Redefine zend_hash_next_index_insert and zend_hash_get_current_data_ex macroses.
Fixed redis cluster crush (#954)
Diffstat (limited to 'redis_array_impl.c')
-rw-r--r-- | redis_array_impl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/redis_array_impl.c b/redis_array_impl.c index 0c63262e..3f2d36d5 100644 --- a/redis_array_impl.c +++ b/redis_array_impl.c @@ -581,7 +581,7 @@ void ra_index_keys(zval *z_pairs, zval *z_redis TSRMLS_DC) { /* Initialize key array */ - zval *z_keys, **z_entry_pp; + zval *z_keys; MAKE_STD_ZVAL(z_keys); HashPosition pos; #if PHP_VERSION_ID > 50300 @@ -592,7 +592,7 @@ ra_index_keys(zval *z_pairs, zval *z_redis TSRMLS_DC) { /* Go through input array and add values to the key array */ zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(z_pairs), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(z_pairs), (void **)&z_entry_pp, &pos) == SUCCESS) { + while (zend_hash_get_current_data_ex(Z_ARRVAL_P(z_pairs), &pos) != NULL) { char *key; unsigned int key_len; unsigned long num_key; @@ -602,13 +602,13 @@ ra_index_keys(zval *z_pairs, zval *z_redis TSRMLS_DC) { switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(z_pairs), &key, &key_len, &num_key, 1, &pos)) { case HASH_KEY_IS_STRING: ZVAL_STRINGL(z_new, key, (int)key_len - 1, 0); - zend_hash_next_index_insert(Z_ARRVAL_P(z_keys), &z_new, sizeof(zval *), NULL); + zend_hash_next_index_insert(Z_ARRVAL_P(z_keys), z_new); break; case HASH_KEY_IS_LONG: Z_TYPE_P(z_new) = IS_LONG; Z_LVAL_P(z_new) = (long)num_key; - zend_hash_next_index_insert(Z_ARRVAL_P(z_keys), &z_new, sizeof(zval *), NULL); + zend_hash_next_index_insert(Z_ARRVAL_P(z_keys), z_new); break; } zend_hash_move_forward_ex(Z_ARRVAL_P(z_pairs), &pos); |