]> granicus.if.org Git - php/commitdiff
Reverted because correct decision has not been made yet.
authorMoriyoshi Koizumi <moriyoshi@php.net>
Sat, 11 Jan 2003 23:05:19 +0000 (23:05 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Sat, 11 Jan 2003 23:05:19 +0000 (23:05 +0000)
ext/ereg/ereg.c
ext/standard/browscap.c
ext/standard/datetime.c
ext/standard/file.c
ext/standard/formatted_print.c
ext/standard/pack.c
ext/standard/reg.c
ext/standard/string.c

index 2f1740e28179e5dffd044f335b0a717f673408c2..791b215d2fc9ea784a2cb94f1eb85d1838c52141 100644 (file)
@@ -605,7 +605,7 @@ PHPAPI PHP_FUNCTION(sql_regcase)
        
        tmp = emalloc((Z_STRLEN_PP(string) * 4) + 1);
        
-       for (i = j = 0; i < (int)Z_STRLEN_PP(string); i++) {
+       for (i = j = 0; i < Z_STRLEN_PP(string); i++) {
                c = (unsigned char) Z_STRVAL_PP(string)[i];
                if(isalpha(c)) {
                        tmp[j++] = '[';
index 8118095b8447727abd1b6d58f4c35f7288e1022a..b2d50d503231d5656bbc3bce1107a9c79950105e 100644 (file)
@@ -49,20 +49,20 @@ static void convert_browscap_pattern(zval *pattern)
        register int i, j;
        char *t;
 
-       for (i = 0; i < (int)Z_STRLEN_P(pattern); i++) {
+       for (i=0; i<Z_STRLEN_P(pattern); i++) {
                if (Z_STRVAL_P(pattern)[i]=='*' || Z_STRVAL_P(pattern)[i]=='?' || Z_STRVAL_P(pattern)[i]=='.') {
                        break;
                }
        }
 
-       if (i == (int)Z_STRLEN_P(pattern)) { /* no wildcards */
+       if (i==Z_STRLEN_P(pattern)) { /* no wildcards */
                Z_STRVAL_P(pattern) = zend_strndup(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern));
                return;
        }
 
        t = (char *) malloc(Z_STRLEN_P(pattern)*2 + 1);
        
-       for (i = 0, j = 0; i < (int)Z_STRLEN_P(pattern); i++, j++) {
+       for (i=0, j=0; i<Z_STRLEN_P(pattern); i++, j++) {
                switch (Z_STRVAL_P(pattern)[i]) {
                        case '?':
                                t[j] = '.';
index 23afd47f1b4e9b2c40d631d3ba7e15bd4f580dc2..260271590be21f70f203a41bdbdcc2e248283d3f 100644 (file)
@@ -313,7 +313,7 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected error");
                RETURN_FALSE;
        }
-       for (i = 0; i < (int)Z_STRLEN_PP(format); i++) {
+       for (i = 0; i < Z_STRLEN_PP(format); i++) {
                switch (Z_STRVAL_PP(format)[i]) {
                        case 'r':               /* rfc822 format */
                                size += 31;
@@ -366,7 +366,7 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
                                size += 2;
                                break;
                        case '\\':
-                               if(i < ((int)Z_STRLEN_PP(format)) - 1) {
+                               if(i < Z_STRLEN_PP(format)-1) {
                                        i++;
                                }
                                size ++;
@@ -383,10 +383,10 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
        Z_STRVAL_P(return_value) = (char *) emalloc(size + 1);
        Z_STRVAL_P(return_value)[0] = '\0';
 
-       for (i = 0; i < (int)Z_STRLEN_PP(format); i++) {
+       for (i = 0; i < Z_STRLEN_PP(format); i++) {
                switch (Z_STRVAL_PP(format)[i]) {
                        case '\\':
-                               if(i < (int)(Z_STRLEN_PP(format)) - 1) {
+                               if(i < Z_STRLEN_PP(format)-1) {
                                        char ch[2];
                                        ch[0]=Z_STRVAL_PP(format)[i+1];
                                        ch[1]='\0';
index 38fdec6413d24da5d2d6e960cc801d752ebe9378..d6fc9d954372d380cd8b19cfa30a6525969c710f 100644 (file)
@@ -1376,7 +1376,7 @@ PHPAPI PHP_FUNCTION(fgets)
                ZVAL_STRINGL(return_value, buf, line_len, 0);
                /* resize buffer if it's much larger than the result.
                 * Only needed if the user requested a buffer size. */
-               if (argc > 1 && (int)Z_STRLEN_P(return_value) < len / 2) {
+               if (argc > 1 && Z_STRLEN_P(return_value) < len / 2) {
                        Z_STRVAL_P(return_value) = erealloc(buf, line_len + 1);
                }
        }
@@ -1559,7 +1559,7 @@ PHPAPI PHP_FUNCTION(fwrite)
                }
                convert_to_string_ex(arg2);
                convert_to_long_ex(arg3);
-               num_bytes = MIN(Z_LVAL_PP(arg3), (int)Z_STRLEN_PP(arg2));
+               num_bytes = MIN(Z_LVAL_PP(arg3), Z_STRLEN_PP(arg2));
                break;
        default:
                WRONG_PARAM_COUNT;
index 47cc4716087ecce5c3ec8ab8edd875c6518fa5b5..d5bd95c4b79d93416b016092d4b1112c35820392 100644 (file)
@@ -504,7 +504,7 @@ php_formatted_print(int ht, int *len, int use_array, int format_offset TSRMLS_DC
 
        currarg = 1;
 
-       while (inpos < (int)Z_STRLEN_PP(args[format_offset])) {
+       while (inpos<Z_STRLEN_PP(args[format_offset])) {
                int expprec = 0;
 
                PRINTF_DEBUG(("sprintf: format[%d]='%c'\n", inpos, format[inpos]));
index 56919f71fe577a1cfd3f11b194076811da843807..0002aaeb377a67b8da1ac711b74394b82526a1bb 100644 (file)
@@ -320,7 +320,7 @@ PHP_FUNCTION(pack)
                                val = argv[currentarg++];
                                convert_to_string_ex(val);
                                memcpy(&output[outputpos], Z_STRVAL_PP(val),
-                                          ((int)Z_STRLEN_PP(val) < arg) ? Z_STRLEN_PP(val) : arg);
+                                          (Z_STRLEN_PP(val) < arg) ? Z_STRLEN_PP(val) : arg);
                                outputpos += arg;
                                break;
 
@@ -334,7 +334,7 @@ PHP_FUNCTION(pack)
                                convert_to_string_ex(val);
                                v = Z_STRVAL_PP(val);
                                outputpos--;
-                               if(arg > (int)Z_STRLEN_PP(val)) {
+                               if(arg > Z_STRLEN_PP(val)) {
                                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough characters in string", code);
                                        arg = Z_STRLEN_PP(val);
                                }
index 2f1740e28179e5dffd044f335b0a717f673408c2..791b215d2fc9ea784a2cb94f1eb85d1838c52141 100644 (file)
@@ -605,7 +605,7 @@ PHPAPI PHP_FUNCTION(sql_regcase)
        
        tmp = emalloc((Z_STRLEN_PP(string) * 4) + 1);
        
-       for (i = j = 0; i < (int)Z_STRLEN_PP(string); i++) {
+       for (i = j = 0; i < Z_STRLEN_PP(string); i++) {
                c = (unsigned char) Z_STRVAL_PP(string)[i];
                if(isalpha(c)) {
                        tmp[j++] = '[';
index 5b87657566e2dd130d9b2cd1ac928a702700b5db..65b995de863dba16de2bf90311e4bb802a26821e 100644 (file)
@@ -1557,7 +1557,7 @@ PHP_FUNCTION(strrpos)
 
        if (argc == 3) {
                convert_to_long_ex(offset);
-               if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) > (int)Z_STRLEN_PP(haystack)) {
+               if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) > Z_STRLEN_PP(haystack)) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string.");
                        RETURN_FALSE;
                }
@@ -1597,7 +1597,7 @@ PHP_FUNCTION(strripos)
 
        if (argc == 3) {
                convert_to_long_ex(offset);
-               if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) > (int)Z_STRLEN_PP(haystack)) {
+               if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) > Z_STRLEN_PP(haystack)) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string.");
                        RETURN_FALSE;
                }
@@ -1786,11 +1786,11 @@ PHP_FUNCTION(substr)
                }
        }
 
-       if (f >= (int)Z_STRLEN_PP(str)) {
+       if (f >= Z_STRLEN_PP(str)) {
                RETURN_FALSE;
        }
 
-       if ((f + l) > (int)Z_STRLEN_PP(str)) {
+       if ((f + l) > Z_STRLEN_PP(str)) {
                l = Z_STRLEN_PP(str) - f;
        }
 
@@ -1833,11 +1833,11 @@ PHP_FUNCTION(substr_replace)
         * of the string
         */
        if (f < 0) {
-               f = (int)Z_STRLEN_PP(str) + f;
+               f = Z_STRLEN_PP(str) + f;
                if (f < 0) {
                        f = 0;
                }
-       } else if (f > (int)Z_STRLEN_PP(str)) {
+       } else if (f > Z_STRLEN_PP(str)) {
                f = Z_STRLEN_PP(str);
        }
 
@@ -1852,7 +1852,7 @@ PHP_FUNCTION(substr_replace)
                }
        }
 
-       if ((f + l) > (int)Z_STRLEN_PP(str)) {
+       if ((f + l) > Z_STRLEN_PP(str)) {
                l = Z_STRLEN_PP(str) - f;
        }
 
@@ -3014,7 +3014,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
        
        do {
                if (block_type == _HEB_BLOCK_TYPE_HEB) {
-                       while ((isheb((int)*(tmp+1)) || _isblank((int)*(tmp+1)) || ispunct((int)*(tmp+1)) || (int)*(tmp+1)=='\n' ) && block_end<((int)Z_STRLEN_PP(str))-1) {
+                       while ((isheb((int)*(tmp+1)) || _isblank((int)*(tmp+1)) || ispunct((int)*(tmp+1)) || (int)*(tmp+1)=='\n' ) && block_end<Z_STRLEN_PP(str)-1) {
                                tmp++;
                                block_end++;
                                block_length++;
@@ -3059,7 +3059,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
                        }
                        block_type = _HEB_BLOCK_TYPE_ENG;
                } else {
-                       while (!isheb(*(tmp+1)) && (int)*(tmp+1)!='\n' && block_end < ((int)Z_STRLEN_PP(str))-1) {
+                       while (!isheb(*(tmp+1)) && (int)*(tmp+1)!='\n' && block_end < Z_STRLEN_PP(str)-1) {
                                tmp++;
                                block_end++;
                                block_length++;
@@ -3075,7 +3075,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
                        block_type = _HEB_BLOCK_TYPE_HEB;
                }
                block_start=block_end+1;
-       } while (block_end < ((int)Z_STRLEN_PP(str))-1);
+       } while (block_end < Z_STRLEN_PP(str)-1);
 
 
        broken_str = (char *) emalloc(Z_STRLEN_PP(str)+1);