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

Skip to content

Commit 6915597

Browse files
committed
Merge pull request phpredis#238 from remicollet/master
trying to fix compiler warnings
2 parents 4197a7f + c6e13be commit 6915597

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

library.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ PHPAPI int redis_check_eof(RedisSock *redis_sock TSRMLS_DC)
4141
for (; eof; count++) {
4242
if((MULTI == redis_sock->mode) || redis_sock->watching || count == 10) { /* too many failures */
4343
if(redis_sock->stream) { /* close stream if still here */
44-
redis_stream_close(redis_sock);
44+
redis_stream_close(redis_sock TSRMLS_CC);
4545
redis_sock->stream = NULL;
4646
redis_sock->mode = ATOMIC;
4747
redis_sock->status = REDIS_SOCK_STATUS_FAILED;
@@ -51,7 +51,7 @@ PHPAPI int redis_check_eof(RedisSock *redis_sock TSRMLS_DC)
5151
return -1;
5252
}
5353
if(redis_sock->stream) { /* close existing stream before reconnecting */
54-
redis_stream_close(redis_sock);
54+
redis_stream_close(redis_sock TSRMLS_CC);
5555
redis_sock->stream = NULL;
5656
redis_sock->mode = ATOMIC;
5757
redis_sock->watching = 0;

redis.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3625,15 +3625,13 @@ PHP_METHOD(Redis, brpoplpush)
36253625
*/
36263626
PHP_METHOD(Redis, zAdd) {
36273627

3628-
zval *object;
36293628
RedisSock *redis_sock;
36303629

36313630
char *cmd;
36323631
int cmd_len, key_len, val_len;
36333632
double score;
36343633
char *key, *val;
36353634
int val_free, key_free = 0;
3636-
zval *z_value;
36373635
char *dbl_str;
36383636
int dbl_len;
36393637

redis_array.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ uint32_t rcrc32(const char *s, size_t sz) {
188188
PHP_METHOD(RedisArray, __construct)
189189
{
190190
zval *z0, *z_fun = NULL, *z_dist = NULL, **zpData, *z_opts = NULL;
191-
char *name = NULL;
192191
int id;
193192
RedisArray *ra = NULL;
194193
zend_bool b_index = 0, b_autorehash = 0;
@@ -457,7 +456,6 @@ PHP_METHOD(RedisArray, _instance)
457456
PHP_METHOD(RedisArray, _function)
458457
{
459458
zval *object;
460-
int i;
461459
RedisArray *ra;
462460

463461
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
@@ -480,7 +478,6 @@ PHP_METHOD(RedisArray, _function)
480478
PHP_METHOD(RedisArray, _distributor)
481479
{
482480
zval *object;
483-
int i;
484481
RedisArray *ra;
485482

486483
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
@@ -838,12 +835,11 @@ PHP_METHOD(RedisArray, mget)
838835
/* MSET will distribute the call to several nodes and regroup the values. */
839836
PHP_METHOD(RedisArray, mset)
840837
{
841-
zval *object, *z_keys, z_fun, *z_argarray, **data, z_ret, **z_cur, *z_tmp;
842-
int i, j, n;
838+
zval *object, *z_keys, z_fun, *z_argarray, **data, z_ret;
839+
int i, n;
843840
RedisArray *ra;
844841
int *pos, argc, *argc_each;
845842
HashTable *h_keys;
846-
HashPosition pointer;
847843
zval **redis_instances, *redis_inst, **argv;
848844
char *key, **keys;
849845
unsigned int key_len;
@@ -959,8 +955,8 @@ PHP_METHOD(RedisArray, mset)
959955
/* DEL will distribute the call to several nodes and regroup the values. */
960956
PHP_METHOD(RedisArray, del)
961957
{
962-
zval *object, *z_keys, z_fun, *z_argarray, **data, *z_ret, **z_cur, *z_tmp_array, *z_tmp, **z_args;
963-
int i, j, n;
958+
zval *object, *z_keys, z_fun, *z_argarray, **data, *z_ret, *z_tmp, **z_args;
959+
int i, n;
964960
RedisArray *ra;
965961
int *pos, argc, *argc_each;
966962
HashTable *h_keys;

redis_array_impl.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ra_load_hosts(RedisArray *ra, HashTable *hosts TSRMLS_DC)
3535
int count = zend_hash_num_elements(hosts);
3636
char *host, *p;
3737
short port;
38-
zval **zpData, z_cons, *z_args, z_ret;
38+
zval **zpData, z_cons, z_ret;
3939
RedisSock *redis_sock = NULL;
4040

4141
/* function calls on the Redis object */
@@ -537,7 +537,6 @@ ra_index_keys(zval *z_pairs, zval *z_redis TSRMLS_DC) {
537537
void
538538
ra_index_key(const char *key, int key_len, zval *z_redis TSRMLS_DC) {
539539

540-
int i;
541540
zval z_fun_sadd, z_ret, *z_args[2];
542541
MAKE_STD_ZVAL(z_args[0]);
543542
MAKE_STD_ZVAL(z_args[1]);
@@ -741,8 +740,7 @@ ra_get_key_type(zval *z_redis, const char *key, int key_len, zval *z_from, long
741740
static void
742741
ra_remove_from_index(zval *z_redis, const char *key, int key_len TSRMLS_DC) {
743742

744-
int i;
745-
zval z_fun_get, z_fun_srem, z_ret, *z_args[2];
743+
zval z_fun_srem, z_ret, *z_args[2];
746744

747745
/* run SREM on source index */
748746
ZVAL_STRINGL(&z_fun_srem, "SREM", 4, 0);
@@ -816,7 +814,6 @@ ra_move_zset(const char *key, int key_len, zval *z_from, zval *z_to, long ttl TS
816814
unsigned int val_len;
817815
int i;
818816
unsigned long idx;
819-
int type;
820817

821818
/* run ZRANGE key 0 -1 WITHSCORES on source */
822819
ZVAL_STRINGL(&z_fun_zrange, "ZRANGE", 6, 0);

0 commit comments

Comments
 (0)