Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0a886fe

Browse files
committed
TravisCI: make clang happy with older php versions
1 parent b5098b1 commit 0a886fe

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ php:
1111
env: CC=gcc
1212
matrix:
1313
include:
14+
- env: CC=clang
15+
php: 5.4
16+
- env: CC=clang
17+
php: 5.5
1418
- env: CC=clang
1519
php: 5.6
1620
- env: CC=clang

redis_array.c

+10-9
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ PHP_METHOD(RedisArray, select)
853853
/* MGET will distribute the call to several nodes and regroup the values. */
854854
PHP_METHOD(RedisArray, mget)
855855
{
856-
zval *object, *z_keys, z_fun, z_argarray, *data, z_ret, *z_cur, z_tmp_array, *z_tmp;
856+
zval *object, *z_keys, z_argarray, *data, z_ret, *z_cur, z_tmp_array, *z_tmp;
857857
int i, j, n;
858858
RedisArray *ra;
859859
int *pos, argc, *argc_each;
@@ -872,8 +872,6 @@ PHP_METHOD(RedisArray, mget)
872872
RETURN_FALSE;
873873
}
874874

875-
/* prepare call */
876-
ZVAL_STRINGL(&z_fun, "MGET", 4);
877875

878876
/* init data structures */
879877
h_keys = Z_ARRVAL_P(z_keys);
@@ -940,8 +938,12 @@ PHP_METHOD(RedisArray, mget)
940938
add_next_index_zval(&z_argarray, z_tmp);
941939
}
942940

941+
zval z_fun;
942+
/* prepare call */
943+
ZVAL_STRINGL(&z_fun, "MGET", 4);
943944
/* call MGET on the node */
944945
call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_argarray);
946+
zval_dtor(&z_fun);
945947

946948
/* cleanup args array */
947949
zval_dtor(&z_argarray);
@@ -951,7 +953,6 @@ PHP_METHOD(RedisArray, mget)
951953
/* cleanup */
952954
zval_dtor(&z_ret);
953955
zval_dtor(&z_tmp_array);
954-
zval_dtor(&z_fun);
955956
efree(argv);
956957
efree(pos);
957958
efree(argc_each);
@@ -994,7 +995,6 @@ PHP_METHOD(RedisArray, mget)
994995

995996
/* cleanup */
996997
zval_dtor(&z_tmp_array);
997-
zval_dtor(&z_fun);
998998
efree(argv);
999999
efree(pos);
10001000
efree(argc_each);
@@ -1004,7 +1004,7 @@ PHP_METHOD(RedisArray, mget)
10041004
/* MSET will distribute the call to several nodes and regroup the values. */
10051005
PHP_METHOD(RedisArray, mset)
10061006
{
1007-
zval *object, *z_keys, z_fun, z_argarray, *data, z_ret, **argv;
1007+
zval *object, *z_keys, z_argarray, *data, z_ret, **argv;
10081008
int i, n;
10091009
RedisArray *ra;
10101010
int *pos, argc, *argc_each;
@@ -1060,8 +1060,6 @@ PHP_METHOD(RedisArray, mset)
10601060
} ZEND_HASH_FOREACH_END();
10611061

10621062

1063-
/* prepare call */
1064-
ZVAL_STRINGL(&z_fun, "MSET", 4);
10651063
/* calls */
10661064
for(n = 0; n < ra->count; ++n) { /* for each node */
10671065
/* We don't even need to make a call to this node if no keys go there */
@@ -1092,8 +1090,12 @@ PHP_METHOD(RedisArray, mset)
10921090
ra_index_multi(&ra->redis[n], MULTI TSRMLS_CC);
10931091
}
10941092

1093+
zval z_fun;
1094+
/* prepare call */
1095+
ZVAL_STRINGL(&z_fun, "MSET", 4);
10951096
/* call */
10961097
call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_argarray);
1098+
zval_dtor(&z_fun);
10971099
zval_dtor(&z_ret);
10981100

10991101
if(ra->index) {
@@ -1102,7 +1104,6 @@ PHP_METHOD(RedisArray, mset)
11021104
}
11031105
zval_dtor(&z_argarray);
11041106
}
1105-
zval_dtor(&z_fun);
11061107

11071108
/* Free any keys that we needed to allocate memory for, because they weren't strings */
11081109
for(i = 0; i < argc; i++) {

0 commit comments

Comments
 (0)