]> granicus.if.org Git - php/commitdiff
Fixed gcc 4 compatibility
authorDmitry Stogov <dmitry@php.net>
Mon, 29 Aug 2005 06:51:14 +0000 (06:51 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 29 Aug 2005 06:51:14 +0000 (06:51 +0000)
ext/standard/string.c

index fabaa2d14597e3238d683171549e503e7f6132aa..1cea8c204ac03125d742b3ae6d85678d6c2a3497 100644 (file)
@@ -5272,7 +5272,8 @@ PHP_FUNCTION(substr_count)
 
        if (haystack_type == IS_UNICODE) {
                while ((p = zend_u_memnstr((UChar *)p, (UChar *)needle, needle_len, (UChar *)endp)) != NULL) {
-                       (UChar *)p += needle_len;
+                       /*(UChar *)p += needle_len; // GCC 4.0.0 cannot compile this */
+                       p += UBYTES(needle_len);
                        count++;
                }
        } else {
@@ -5284,7 +5285,8 @@ PHP_FUNCTION(substr_count)
                        }
                } else {
                        while ((p = php_memnstr((char *)p, (char *)needle, needle_len, (char *)endp))) {
-                               (char *)p += needle_len;
+                               /*(char *)p += needle_len; // GCC 4.0.0 cannot compile this */
+                               p += needle_len;
                                count++;
                        }
                }