]> granicus.if.org Git - php/commitdiff
Fixed implicit cast issue with is*() and to*() functions
authorMoriyoshi Koizumi <moriyoshi@php.net>
Wed, 16 Apr 2003 21:40:48 +0000 (21:40 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Wed, 16 Apr 2003 21:40:48 +0000 (21:40 +0000)
ext/standard/array.c
ext/standard/cyr_convert.c
ext/standard/exec.c
ext/standard/url_scanner_ex.re

index 32a0edde6e2be2473be0e4dee2620d683b1baff7..17cb9471f51d09d6f214e6c6bbbffc06746425ac 100644 (file)
@@ -1174,12 +1174,12 @@ static int php_valid_var_name(char *var_name)
        
        len = strlen(var_name);
        
-       if (!isalpha((int)var_name[0]) && var_name[0] != '_')
+       if (!isalpha((int)((unsigned char *)var_name)[0]) && var_name[0] != '_')
                return 0;
        
        if (len > 1) {
                for (i=1; i<len; i++) {
-                       if (!isalnum((int)var_name[i]) && var_name[i] != '_') {
+                       if (!isalnum((int)((unsigned char *)var_name)[i]) && var_name[i] != '_') {
                                return 0;
                        }
                }
index 086bbe383b70699a4a57757efef98b8a56bd3609..ed333b42f8526eebb1e4e2d5b75806a6b9311a5d 100644 (file)
@@ -210,7 +210,7 @@ static char * php_convert_cyr_string(unsigned char *str, int length, char from,
        from_table = NULL;
        to_table   = NULL;
        
-       switch (toupper(from))
+       switch (toupper((int)(unsigned char)from))
        {
                case 'W':
                        from_table = _cyr_win1251;
@@ -232,7 +232,7 @@ static char * php_convert_cyr_string(unsigned char *str, int length, char from,
                        break;
        }
 
-       switch (toupper(to))
+       switch (toupper((int)(unsigned char)to))
        {
                case 'W':
                        to_table = _cyr_win1251;
index 7d17c8e00f0247b5a6508e285755307098da85b6..da7a854d294be0bb7bc730ba56e3e8546e623992 100644 (file)
@@ -134,7 +134,7 @@ int php_exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
                        } else if (type == 2) {
                                /* strip trailing whitespaces */        
                                l = bufl;
-                               while (l-- && isspace(buf[l]));
+                               while (l-- && isspace(((unsigned char *)buf)[l]));
                                if (l != (bufl - 1)) {
                                        bufl = l + 1;
                                        buf[bufl] = '\0';
@@ -147,7 +147,7 @@ int php_exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
                        /* strip trailing whitespaces if we have not done so already */ 
                        if (type != 2) {
                                l = bufl;
-                               while (l-- && isspace(buf[l]));
+                               while (l-- && isspace(((unsigned char *)buf)[l]));
                                if (l != (bufl - 1)) {
                                        bufl = l + 1;
                                        buf[bufl] = '\0';
index a22bc7a2bfacba5373911a59c9ce6c5fa2875404..7f85c06b38fc42bc256372b59cdc8c0c1b9ebcbb 100644 (file)
@@ -236,7 +236,7 @@ static inline void handle_tag(STD_PARA)
        ctx->tag.len = 0;
        smart_str_appendl(&ctx->tag, start, YYCURSOR - start);
        for (i = 0; i < ctx->tag.len; i++)
-               ctx->tag.c[i] = tolower(ctx->tag.c[i]);
+               ctx->tag.c[i] = tolower((int)(unsigned char)ctx->tag.c[i]);
        if (zend_hash_find(ctx->tags, ctx->tag.c, ctx->tag.len, (void **) &ctx->lookup_data) == SUCCESS)
                ok = 1;
        STATE = ok ? STATE_NEXT_ARG : STATE_PLAIN;