~alexlawn/php-redis/alex-redis-hmget

« back to all changes in this revision

Viewing changes to library.c

  • Committer: GitHub
  • Author(s): Pavlo Yatsukhnenko
  • Date: 2016-09-13 19:06:47 UTC
  • mfrom: (532.1.1)
  • Revision ID: git-v1:28184c76b61a853219850e0c7564b2c23fe56299
Merge pull request #945 from yatsukhnenko/develop

WIP: php7 compatibility

Show diffs side-by-side

added added

removed removed

Lines of Context:
1233
1233
        unsigned int tablekey_len;
1234
1234
        int hkey_len;
1235
1235
        unsigned long idx;
1236
 
        zval **z_key_pp, **z_value_pp;
 
1236
        zval *z_key_p, *z_value_p;
1237
1237
 
1238
1238
        zend_hash_get_current_key_ex(keytable, &tablekey, &tablekey_len, &idx, 0, NULL);
1239
 
        if(zend_hash_get_current_data(keytable, (void**)&z_key_pp) == FAILURE) {
 
1239
        if ((z_key_p = zend_hash_get_current_data(keytable)) == NULL) {
1240
1240
            continue;   /* this should never happen, according to the PHP people. */
1241
1241
        }
1242
1242
 
1243
1243
        /* get current value, a key */
1244
 
        convert_to_string(*z_key_pp);
1245
 
        hkey = Z_STRVAL_PP(z_key_pp);
1246
 
        hkey_len = Z_STRLEN_PP(z_key_pp);
 
1244
        convert_to_string(z_key_p);
 
1245
        hkey = Z_STRVAL_P(z_key_p);
 
1246
        hkey_len = Z_STRLEN_P(z_key_p);
1247
1247
 
1248
1248
        /* move forward */
1249
1249
        zend_hash_move_forward(keytable);
1250
1250
 
1251
1251
        /* fetch again */
1252
1252
        zend_hash_get_current_key_ex(keytable, &tablekey, &tablekey_len, &idx, 0, NULL);
1253
 
        if(zend_hash_get_current_data(keytable, (void**)&z_value_pp) == FAILURE) {
 
1253
        if ((z_value_p = zend_hash_get_current_data(keytable)) == NULL) {
1254
1254
            continue;   /* this should never happen, according to the PHP people. */
1255
1255
        }
1256
1256
 
1257
1257
        /* get current value, a hash value now. */
1258
 
        hval = Z_STRVAL_PP(z_value_pp);
 
1258
        hval = Z_STRVAL_P(z_value_p);
1259
1259
 
1260
1260
        /* Decode the score depending on flag */
1261
 
        if (decode == SCORE_DECODE_INT && Z_STRLEN_PP(z_value_pp) > 0) {
 
1261
        if (decode == SCORE_DECODE_INT && Z_STRLEN_P(z_value_p) > 0) {
1262
1262
            add_assoc_long_ex(z_ret, hkey, 1+hkey_len, atoi(hval+1));
1263
1263
        } else if (decode == SCORE_DECODE_DOUBLE) {
1264
1264
            add_assoc_double_ex(z_ret, hkey, 1+hkey_len, atof(hval));
1265
1265
        } else {
1266
1266
            zval *z = NULL;
1267
1267
            MAKE_STD_ZVAL(z);
1268
 
            *z = **z_value_pp;
 
1268
            *z = *z_value_p;
1269
1269
            zval_copy_ctor(z);
1270
1270
            add_assoc_zval_ex(z_ret, hkey, 1+hkey_len, z);
1271
1271
        }