summaryrefslogtreecommitdiff
path: root/ext/hash
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-06-22 00:40:50 +0300
committerDmitry Stogov <dmitry@zend.com>2016-06-22 00:40:50 +0300
commit323b2733f6b42d00dd86e77ac524d64f6ddc4e22 (patch)
tree49c72ac7d1e6077369f1de6a5d7a6d7847e51bf9 /ext/hash
parent4ccbe03e445800d26aba5424a84e64e235f08ece (diff)
downloadphp-git-323b2733f6b42d00dd86e77ac524d64f6ddc4e22.tar.gz
Fixed compilation warnings
Diffstat (limited to 'ext/hash')
-rw-r--r--ext/hash/hash.c7
-rw-r--r--ext/hash/hash_sha3.c4
2 files changed, 6 insertions, 5 deletions
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 87b11b6dad..dd1293829f 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -208,7 +208,7 @@ static inline void php_hash_string_xor(unsigned char *out, const unsigned char *
static inline void php_hash_hmac_prep_key(unsigned char *K, const php_hash_ops *ops, void *context, const unsigned char *key, const size_t key_len) {
memset(K, 0, ops->block_size);
- if (key_len > ops->block_size) {
+ if (key_len > (size_t)ops->block_size) {
/* Reduce the key first */
ops->hash_init(context);
ops->hash_update(context, key, key_len);
@@ -367,7 +367,7 @@ PHP_FUNCTION(hash_init)
memset(K, 0, ops->block_size);
- if (key_len > ops->block_size) {
+ if (key_len > (size_t)ops->block_size) {
/* Reduce the key first */
ops->hash_update(context, (unsigned char *) key, key_len);
ops->hash_final((unsigned char *) K, context);
@@ -729,7 +729,8 @@ PHP_FUNCTION(hash_equals)
{
zval *known_zval, *user_zval;
char *known_str, *user_str;
- int result = 0, j;
+ int result = 0;
+ size_t j;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &known_zval, &user_zval) == FAILURE) {
return;
diff --git a/ext/hash/hash_sha3.c b/ext/hash/hash_sha3.c
index aab17c1476..8f18fa1c27 100644
--- a/ext/hash/hash_sha3.c
+++ b/ext/hash/hash_sha3.c
@@ -153,9 +153,9 @@ static void PHP_SHA3_Init(PHP_SHA3_CTX* ctx,
static void PHP_SHA3_Update(PHP_SHA3_CTX* ctx,
const unsigned char* buf,
unsigned int count,
- int block_size) {
+ size_t block_size) {
while (count > 0) {
- int len = block_size - ctx->pos;
+ unsigned int len = block_size - ctx->pos;
if (len > count) len = count;
count -= len;
while (len-- > 0) {