Skip to content

TravisCI: make clang happy with older php versions #1044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ php:
env: CC=gcc
matrix:
include:
- env: CC=clang
php: 5.4
- env: CC=clang
php: 5.5
- env: CC=clang
php: 5.6
- env: CC=clang
Expand Down
19 changes: 10 additions & 9 deletions redis_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ PHP_METHOD(RedisArray, select)
/* MGET will distribute the call to several nodes and regroup the values. */
PHP_METHOD(RedisArray, mget)
{
zval *object, *z_keys, z_fun, z_argarray, *data, z_ret, *z_cur, z_tmp_array, *z_tmp;
zval *object, *z_keys, z_argarray, *data, z_ret, *z_cur, z_tmp_array, *z_tmp;
int i, j, n;
RedisArray *ra;
int *pos, argc, *argc_each;
Expand All @@ -872,8 +872,6 @@ PHP_METHOD(RedisArray, mget)
RETURN_FALSE;
}

/* prepare call */
ZVAL_STRINGL(&z_fun, "MGET", 4);

/* init data structures */
h_keys = Z_ARRVAL_P(z_keys);
Expand Down Expand Up @@ -940,8 +938,12 @@ PHP_METHOD(RedisArray, mget)
add_next_index_zval(&z_argarray, z_tmp);
}

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

/* cleanup args array */
zval_dtor(&z_argarray);
Expand All @@ -951,7 +953,6 @@ PHP_METHOD(RedisArray, mget)
/* cleanup */
zval_dtor(&z_ret);
zval_dtor(&z_tmp_array);
zval_dtor(&z_fun);
efree(argv);
efree(pos);
efree(argc_each);
Expand Down Expand Up @@ -994,7 +995,6 @@ PHP_METHOD(RedisArray, mget)

/* cleanup */
zval_dtor(&z_tmp_array);
zval_dtor(&z_fun);
efree(argv);
efree(pos);
efree(argc_each);
Expand All @@ -1004,7 +1004,7 @@ PHP_METHOD(RedisArray, mget)
/* MSET will distribute the call to several nodes and regroup the values. */
PHP_METHOD(RedisArray, mset)
{
zval *object, *z_keys, z_fun, z_argarray, *data, z_ret, **argv;
zval *object, *z_keys, z_argarray, *data, z_ret, **argv;
int i, n;
RedisArray *ra;
int *pos, argc, *argc_each;
Expand Down Expand Up @@ -1060,8 +1060,6 @@ PHP_METHOD(RedisArray, mset)
} ZEND_HASH_FOREACH_END();


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

zval z_fun;
/* prepare call */
ZVAL_STRINGL(&z_fun, "MSET", 4);
/* call */
call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_argarray);
zval_dtor(&z_fun);
zval_dtor(&z_ret);

if(ra->index) {
Expand All @@ -1102,7 +1104,6 @@ PHP_METHOD(RedisArray, mset)
}
zval_dtor(&z_argarray);
}
zval_dtor(&z_fun);

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