From 2d19ba1d6fe8f0f650d7b9bc02c5f1cb10dbb9e0 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 6 May 2020 08:54:43 +0200 Subject: [PATCH] fix [-Wformat=] warning on 32-bit --- cluster_library.c | 2 +- redis_array.c | 4 ++-- redis_cluster.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cluster_library.c b/cluster_library.c index 191947c57..b21a68758 100644 --- a/cluster_library.c +++ b/cluster_library.c @@ -552,7 +552,7 @@ unsigned short cluster_hash_key_zval(zval *z_key) { klen = Z_STRLEN_P(z_key); break; case IS_LONG: - klen = snprintf(buf,sizeof(buf),"%ld",Z_LVAL_P(z_key)); + klen = snprintf(buf,sizeof(buf),ZEND_LONG_FMT,Z_LVAL_P(z_key)); kptr = (const char *)buf; break; case IS_DOUBLE: diff --git a/redis_array.c b/redis_array.c index 7f8fa129d..bdd7120ef 100644 --- a/redis_array.c +++ b/redis_array.c @@ -926,7 +926,7 @@ PHP_METHOD(RedisArray, mget) key_len = Z_STRLEN_P(data); key_lookup = Z_STRVAL_P(data); } else { - key_len = snprintf(kbuf, sizeof(kbuf), "%ld", Z_LVAL_P(data)); + key_len = snprintf(kbuf, sizeof(kbuf), ZEND_LONG_FMT, Z_LVAL_P(data)); key_lookup = (char*)kbuf; } @@ -1052,7 +1052,7 @@ PHP_METHOD(RedisArray, mset) key_len = ZSTR_LEN(zkey); key = ZSTR_VAL(zkey); } else { - key_len = snprintf(kbuf, sizeof(kbuf), "%lu", idx); + key_len = snprintf(kbuf, sizeof(kbuf), ZEND_ULONG_FMT, idx); key = kbuf; } diff --git a/redis_cluster.c b/redis_cluster.c index ee218ba05..7f79b5fe8 100644 --- a/redis_cluster.c +++ b/redis_cluster.c @@ -2245,7 +2245,7 @@ cluster_cmd_get_slot(redisCluster *c, zval *z_arg) /* Inform the caller if they've passed bad data */ if (slot < 0) { - php_error_docref(0, E_WARNING, "Unknown node %s:%ld", + php_error_docref(0, E_WARNING, "Unknown node %s:" ZEND_LONG_FMT, Z_STRVAL_P(z_host), Z_LVAL_P(z_port)); } } else {