cvs: php4 /ext/standard array.c cyr_convert.c exec.c url_scanner_ex.re
| From: | Moriyoshi Koizumi | Date: | Wed, 16 Apr 2003 21:40:48 +0000 |
| Subject: | cvs: php4 /ext/standard array.c cyr_convert.c exec.c url_scanner_ex.re | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20341@lists.php.net to get a copy of this message | ||
moriyoshi Wed Apr 16 17:40:48 2003 EDT
Modified files:
/php4/ext/standard array.c cyr_convert.c exec.c url_scanner_ex.re
Log:
Fixed implicit cast issue with is*() and to*() functions
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.225 php4/ext/standard/array.c:1.226
--- php4/ext/standard/array.c:1.225 Thu Apr 3 13:33:05 2003
+++ php4/ext/standard/array.c Wed Apr 16 17:40:48 2003
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.225 2003/04/03 18:33:05 pollita Exp $ */
+/* $Id: array.c,v 1.226 2003/04/16 21:40:48 moriyoshi Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -1174,12 +1174,12 @@
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: php4/ext/standard/cyr_convert.c
diff -u php4/ext/standard/cyr_convert.c:1.23 php4/ext/standard/cyr_convert.c:1.24
--- php4/ext/standard/cyr_convert.c:1.23 Tue Dec 31 11:07:34 2002
+++ php4/ext/standard/cyr_convert.c Wed Apr 16 17:40:48 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cyr_convert.c,v 1.23 2002/12/31 16:07:34 sebastian Exp $ */
+/* $Id: cyr_convert.c,v 1.24 2003/04/16 21:40:48 moriyoshi Exp $ */
#include <stdlib.h>
@@ -210,7 +210,7 @@
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 @@
break;
}
- switch (toupper(to))
+ switch (toupper((int)(unsigned char)to))
{
case 'W':
to_table = _cyr_win1251;
Index: php4/ext/standard/exec.c
diff -u php4/ext/standard/exec.c:1.98 php4/ext/standard/exec.c:1.99
--- php4/ext/standard/exec.c:1.98 Wed Feb 26 17:11:12 2003
+++ php4/ext/standard/exec.c Wed Apr 16 17:40:48 2003
@@ -16,7 +16,7 @@
| Ilia Alshanetsky <iliaa@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.98 2003/02/26 22:11:12 iliaa Exp $ */
+/* $Id: exec.c,v 1.99 2003/04/16 21:40:48 moriyoshi Exp $ */
#include <stdio.h>
#include "php.h"
@@ -134,7 +134,7 @@
} 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 @@
/* 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: php4/ext/standard/url_scanner_ex.re
diff -u php4/ext/standard/url_scanner_ex.re:1.67 php4/ext/standard/url_scanner_ex.re:1.68
--- php4/ext/standard/url_scanner_ex.re:1.67 Mon Mar 10 21:28:03 2003
+++ php4/ext/standard/url_scanner_ex.re Wed Apr 16 17:40:48 2003
@@ -236,7 +236,7 @@
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;