From: Dmitry Stogov Date: Tue, 4 Oct 2005 06:33:10 +0000 (+0000) Subject: Fixed compilation error (gcc-4). X-Git-Tag: RELEASE_0_9_0~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8aa7f6088e059b4cb0142faee06b621600a8914;p=php Fixed compilation error (gcc-4). --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 114ec7f866..ff0a026317 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -3469,46 +3469,46 @@ static void php_similar_str(const char *txt1, int len1, const char *txt2, int le } /* }}} */ -/* {{{ php_u_similar_char +/* {{{ php_similar_char */ -static int php_u_similar_char(const UChar *txt1, int32_t len1, const UChar *txt2, int32_t len2) +static int php_similar_char(const char *txt1, int len1, const char *txt2, int len2) { - int sum, max; - int32_t pos1, pos2, end1, end2; + int sum; + int pos1, pos2, max; - php_u_similar_str(txt1, len1, txt2, len2, &pos1, &end1, &pos2, &end2, &max); + php_similar_str(txt1, len1, txt2, len2, &pos1, &pos2, &max); if ((sum = max)) { if (pos1 && pos2) { - sum += php_u_similar_char(txt1, pos1, txt2, pos2); + sum += php_similar_char(txt1, pos1, + txt2, pos2); } - if ((pos1 + end1 < len1) && (pos2 + end2 < len2)) { - sum += php_similar_char((UChar *)txt1+pos1+end1, len1-pos1-end1, - (UChar *)txt2+pos2+end2, len2-pos2-end2); + if ((pos1 + max < len1) && (pos2 + max < len2)) { + sum += php_similar_char(txt1 + pos1 + max, len1 - pos1 - max, + txt2 + pos2 + max, len2 - pos2 - max); } } + return sum; } /* }}} */ -/* {{{ php_similar_char +/* {{{ php_u_similar_char */ -static int php_similar_char(const char *txt1, int len1, const char *txt2, int len2) +static int php_u_similar_char(const UChar *txt1, int32_t len1, const UChar *txt2, int32_t len2) { - int sum; - int pos1, pos2, max; + int sum, max; + int32_t pos1, pos2, end1, end2; - php_similar_str(txt1, len1, txt2, len2, &pos1, &pos2, &max); + php_u_similar_str(txt1, len1, txt2, len2, &pos1, &end1, &pos2, &end2, &max); if ((sum = max)) { if (pos1 && pos2) { - sum += php_similar_char(txt1, pos1, - txt2, pos2); + sum += php_u_similar_char(txt1, pos1, txt2, pos2); } - if ((pos1 + max < len1) && (pos2 + max < len2)) { - sum += php_similar_char(txt1 + pos1 + max, len1 - pos1 - max, - txt2 + pos2 + max, len2 - pos2 - max); + if ((pos1 + end1 < len1) && (pos2 + end2 < len2)) { + sum += php_similar_char((UChar *)txt1+pos1+end1, len1-pos1-end1, + (UChar *)txt2+pos2+end2, len2-pos2-end2); } } - return sum; } /* }}} */