Fixed compilation error (gcc-4).
authorDmitry Stogov <dmitry@php.net>
Tue, 4 Oct 2005 06:33:10 +0000 (06:33 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 4 Oct 2005 06:33:10 +0000 (06:33 +0000)
ext/standard/string.c

index 114ec7f86608ab25cd916f6566ca36d540a066a9..ff0a0263171ca8dd5e1e29bdbb8f633699e7d4c2 100644 (file)
@@ -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;
 }
 /* }}} */