com php-src: Removed declaration inside for loops: ext/mbstring/mbstring.c

From: Date: Fri, 29 Mar 2019 13:24:09 +0000
Subject: com php-src: Removed declaration inside for loops: ext/mbstring/mbstring.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-105399@lists.php.net to get a copy of this message
Commit: 4726c35ca33da837406745f21e2320fb18ae7618 Author: Matteo Beccati <mbeccati@php.net> Fri, 29 Mar 2019 14:24:09 +0100 Parents: 16b40a1806e2c6524a0a3ee07e252cb0406be443 Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4726c35ca33da837406745f21e2320fb18ae7618 Log: Removed declaration inside for loops Changed paths: M ext/mbstring/mbstring.c Diff: diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 4843655..cf0b08b 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -2367,7 +2367,9 @@ PHP_FUNCTION(mb_str_split) while (p < last) { /* split cycle work until the cursor has reached the last byte */ char const *chunk_p = p; /* chunk first byte pointer */ chunk_len = 0; /* chunk length in bytes */ - for (zend_long char_count = 0; char_count < split_length && p < last; ++char_count) { + zend_long char_count; + + for (char_count = 0; char_count < split_length && p < last; ++char_count) { char unsigned const m = mbtab[*(const unsigned char *)p]; /* single character length table */ chunk_len += m; p += m; @@ -2435,7 +2437,9 @@ PHP_FUNCTION(mb_str_split) chunks = (mb_len + split_length - 1) / split_length; /* (round up idiom) */ array_init_size(return_value, chunks); if (chunks != 0) { - for (zend_long i = 0; i < chunks - 1; p += chunk_len, ++i) { + zend_long i; + + for (i = 0; i < chunks - 1; p += chunk_len, ++i) { add_next_index_stringl(return_value, p, chunk_len); } add_next_index_stringl(return_value, p, last - p);

« previous php.cvs (#105399) next »