From 69beb29e158a5658217a591c64cbb05f96df1d0c Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 27 Oct 2015 10:05:55 +0800 Subject: [PATCH] Fixed Bug #70797 (Error while making PHP7) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit error: ‘for’ loop initial declarations are only allowed in C99 mode --- ext/hash/hash_sha3.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/hash/hash_sha3.c b/ext/hash/hash_sha3.c index 0f01f16d64..0ff73e59c2 100644 --- a/ext/hash/hash_sha3.c +++ b/ext/hash/hash_sha3.c @@ -38,21 +38,24 @@ static inline unsigned char idx(unsigned char x, unsigned char y) { #ifdef WORDS_BIGENDIAN static inline php_hash_uint64 load64(const unsigned char* x) { + unsigned char i; php_hash_uint64 ret = 0; - for (unsigned char i = 7; i >= 0; --i) { + for (i = 7; i >= 0; --i) { ret <<= 8; ret |= x[i]; } return ret; } static inline void store64(const unsigned char* x, php_hash_uint64 val) { - for (unsigned char i = 0; i < 8; ++i) { + unsigned char i; + for (i = 0; i < 8; ++i) { x[i] = val & 0xFF; val >>= 8; } } static inline void xor64(const unsigned char* x, php_hash_uint64 val) { - for (unsigned char i = 0; i < 8; ++i) { + unsigned char i; + for (i = 0; i < 8; ++i) { x[i] ^= val & 0xFF; val >>= 8; } -- 2.40.0