cvs: ZendEngine2 / zend_alloc.c php-src/ext/standard array.c dir.c dns.c exec.c ftp_fopen_wrapper.c pack.c php-src/ext/xml compat.c
php-src/ext/zlib zlib.c php-src/main fopen_wrappers.c
| From: | Hartmut Holzgraefe | Date: | Fri, 26 Sep 2003 08:09:56 +0000 |
| Subject: | cvs: ZendEngine2 / zend_alloc.c php-src/ext/standard array.c dir.c dns.c exec.c ftp_fopen_wrapper.c pack.c php-src/ext/xml compat.c php-src/ext/zlib zlib.c php-src/main fopen_wrappers.c |
||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1861@lists.php.net to get a copy of this message | ||
hholzgra Fri Sep 26 04:09:56 2003 EDT
Modified files:
/php-src/main fopen_wrappers.c
/php-src/ext/zlib zlib.c
/php-src/ext/xml compat.c
/php-src/ext/standard pack.c ftp_fopen_wrapper.c exec.c dns.c dir.c
array.c
/ZendEngine2 zend_alloc.c
Log:
signed/unsigned compiler warning fixes
Index: php-src/main/fopen_wrappers.c diff -u php-src/main/fopen_wrappers.c:1.166 php-src/main/fopen_wrappers.c:1.167 --- php-src/main/fopen_wrappers.c:1.166 Wed Jul 30 13:55:06 2003 +++ php-src/main/fopen_wrappers.c Fri Sep 26 04:09:52 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.c,v 1.166 2003/07/30 17:55:06 iliaa Exp $ */ +/* $Id: fopen_wrappers.c,v 1.167 2003/09/26 08:09:52 hholzgra Exp $ */ /* {{{ includes */ @@ -299,7 +299,7 @@ if (s) { /* if there is no path name after the file, do not bother */ /* to try open the directory */ length = s - (path_info + 2); - if (length > sizeof(user) - 1) + if (length > (int)sizeof(user) - 1) length = sizeof(user) - 1; memcpy(user, path_info + 2, length); user[length] = '\0'; Index: php-src/ext/zlib/zlib.c diff -u php-src/ext/zlib/zlib.c:1.179 php-src/ext/zlib/zlib.c:1.180 --- php-src/ext/zlib/zlib.c:1.179 Sat Sep 6 11:31:34 2003 +++ php-src/ext/zlib/zlib.c Fri Sep 26 04:09:53 2003 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.179 2003/09/06 15:31:34 sr Exp $ */ +/* $Id: zlib.c,v 1.180 2003/09/26 08:09:53 hholzgra Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -410,7 +410,8 @@ Unzip a gzip-compressed string */ PHP_FUNCTION(gzuncompress) { - int data_len, status, factor=1, maxfactor=16; + int data_len, status; + unsigned int factor=1, maxfactor=16; long limit = 0; unsigned long plength=0, length; char *data, *s1=NULL, *s2=NULL; @@ -433,7 +434,7 @@ that should be eneugh for all real life cases */ do { - length = plength ? plength : data_len * (1 << factor++); + length = plength ? plength : (unsigned long)data_len * (1 << factor++); s2 = (char *) erealloc(s1, length); status = uncompress(s2, &length, data, data_len); s1 = s2; @@ -516,7 +517,8 @@ Unzip a gzip-compressed string */ PHP_FUNCTION(gzinflate) { - int data_len, status, factor=1, maxfactor=16; + int data_len, status; + unsigned int factor=1, maxfactor=16; long limit = 0; unsigned long plength=0, length; char *data, *s1=NULL, *s2=NULL; @@ -544,7 +546,7 @@ stream.zfree = (free_func) Z_NULL; do { - length = plength ? plength : data_len * (1 << factor++); + length = plength ? plength : (unsigned long)data_len * (1 << factor++); s2 = (char *) erealloc(s1, length); if (!s2 && s1) { Index: php-src/ext/xml/compat.c diff -u php-src/ext/xml/compat.c:1.17 php-src/ext/xml/compat.c:1.18 --- php-src/ext/xml/compat.c:1.17 Fri Aug 22 11:04:29 2003 +++ php-src/ext/xml/compat.c Fri Sep 26 04:09:54 2003 @@ -509,7 +509,7 @@ const XML_Char * XML_ErrorString(int code) { - if (code < 0 || code >= sizeof(error_mapping)) { + if (code < 0 || code >= (int)sizeof(error_mapping)) { return "Unknown"; } return error_mapping[code]; Index: php-src/ext/standard/pack.c diff -u php-src/ext/standard/pack.c:1.49 php-src/ext/standard/pack.c:1.50 --- php-src/ext/standard/pack.c:1.49 Mon Aug 11 19:16:53 2003 +++ php-src/ext/standard/pack.c Fri Sep 26 04:09:55 2003 @@ -15,7 +15,7 @@ | Author: Chris Schneider <cschneid@relog.ch> | +----------------------------------------------------------------------+ */ -/* $Id: pack.c,v 1.49 2003/08/11 23:16:53 iliaa Exp $ */ +/* $Id: pack.c,v 1.50 2003/09/26 08:09:55 hholzgra Exp $ */ #include "php.h" @@ -847,7 +847,7 @@ /* Where to get lo to hi bytes from */ byte_map[0] = 0; - for (i = 0; i < sizeof(int); i++) { + for (i = 0; i < (int)sizeof(int); i++) { int_map[i] = i; } @@ -879,7 +879,7 @@ /* Where to get hi to lo bytes from */ byte_map[0] = size - 1; - for (i = 0; i < sizeof(int); i++) { + for (i = 0; i < (int)sizeof(int); i++) { int_map[i] = size - (sizeof(int) - i); } Index: php-src/ext/standard/ftp_fopen_wrapper.c diff -u php-src/ext/standard/ftp_fopen_wrapper.c:1.62 php-src/ext/standard/ftp_fopen_wrapper.c:1.63 --- php-src/ext/standard/ftp_fopen_wrapper.c:1.62 Thu Aug 28 12:28:33 2003 +++ php-src/ext/standard/ftp_fopen_wrapper.c Fri Sep 26 04:09:55 2003 @@ -18,7 +18,7 @@ | Sara Golemon <pollita@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: ftp_fopen_wrapper.c,v 1.62 2003/08/28 16:28:33 sas Exp $ */ +/* $Id: ftp_fopen_wrapper.c,v 1.63 2003/09/26 08:09:55 hholzgra Exp $ */ #include "php.h" #include "php_globals.h" @@ -586,7 +586,7 @@ return 0; } - memcpy(ent->d_name, basename, MIN(sizeof(ent->d_name), basename_len)-1); + memcpy(ent->d_name, basename, MIN((int)sizeof(ent->d_name), basename_len)-1); ent->d_name[sizeof(ent->d_name)-1] = '\0'; efree(basename); Index: php-src/ext/standard/exec.c diff -u php-src/ext/standard/exec.c:1.104 php-src/ext/standard/exec.c:1.105 --- php-src/ext/standard/exec.c:1.104 Thu Aug 28 12:28:33 2003 +++ php-src/ext/standard/exec.c Fri Sep 26 04:09:55 2003 @@ -16,7 +16,7 @@ | Ilia Alshanetsky <iliaa@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: exec.c,v 1.104 2003/08/28 16:28:33 sas Exp $ */ +/* $Id: exec.c,v 1.105 2003/09/26 08:09:55 hholzgra Exp $ */ #include <stdio.h> #include "php.h" @@ -61,10 +61,10 @@ { FILE *fp; char *buf, *tmp=NULL; - int buflen, l, pclose_return; + int l, pclose_return; char *cmd_p, *b, *c, *d=NULL; php_stream *stream; - size_t bufl = 0; + size_t buflen, bufl = 0; #if PHP_SIGCHILD void (*sig_handler)(); #endif Index: php-src/ext/standard/dns.c diff -u php-src/ext/standard/dns.c:1.62 php-src/ext/standard/dns.c:1.63 --- php-src/ext/standard/dns.c:1.62 Mon Sep 1 18:38:40 2003 +++ php-src/ext/standard/dns.c Fri Sep 26 04:09:55 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dns.c,v 1.62 2003/09/01 22:38:40 pollita Exp $ */ +/* $Id: dns.c,v 1.63 2003/09/26 08:09:55 hholzgra Exp $ */ /* {{{ includes */ #include "php.h" @@ -746,7 +746,7 @@ if (i < 0) { RETURN_FALSE; } - if (i > sizeof(ans)) { + if (i > (int)sizeof(ans)) { i = sizeof(ans); } hp = (HEADER *)&ans; Index: php-src/ext/standard/dir.c diff -u php-src/ext/standard/dir.c:1.128 php-src/ext/standard/dir.c:1.129 --- php-src/ext/standard/dir.c:1.128 Fri Sep 19 22:51:20 2003 +++ php-src/ext/standard/dir.c Fri Sep 26 04:09:55 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dir.c,v 1.128 2003/09/20 02:51:20 iliaa Exp $ */ +/* $Id: dir.c,v 1.129 2003/09/26 08:09:55 hholzgra Exp $ */ /* {{{ includes/startup/misc */ @@ -361,7 +361,8 @@ int pattern_len; long flags = 0; glob_t globbuf; - int n, ret; + unsigned int n; + int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &pattern, &pattern_len, &flags) == FAILURE) return; Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.248 php-src/ext/standard/array.c:1.249 --- php-src/ext/standard/array.c:1.248 Thu Sep 25 20:40:32 2003 +++ php-src/ext/standard/array.c Fri Sep 26 04:09:55 2003 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.248 2003/09/26 00:40:32 iliaa Exp $ */ +/* $Id: array.c,v 1.249 2003/09/26 08:09:55 hholzgra Exp $ */ #include "php.h" #include "php_ini.h" @@ -1890,7 +1890,7 @@ /* If we did a shift... re-index like it did before */ if (!off_the_end) { - int k = 0; + unsigned int k = 0; int should_rehash = 0; Bucket *p = Z_ARRVAL_PP(stack)->pListHead; while (p != NULL) { Index: ZendEngine2/zend_alloc.c diff -u ZendEngine2/zend_alloc.c:1.126 ZendEngine2/zend_alloc.c:1.127 --- ZendEngine2/zend_alloc.c:1.126 Thu Sep 25 11:54:17 2003 +++ ZendEngine2/zend_alloc.c Fri Sep 26 04:09:56 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_alloc.c,v 1.126 2003/09/25 15:54:17 georg Exp $ */ +/* $Id: zend_alloc.c,v 1.127 2003/09/26 08:09:56 hholzgra Exp $ */ #include "zend.h" #include "zend_alloc.h" @@ -728,7 +728,7 @@ had_problems = 1; overflow_ptr = (char *) &end_magic; - for (i=0; i<sizeof(long); i++) { + for (i=0; i<(int)sizeof(long); i++) { if (overflow_ptr[i]!=magic_ptr[i]) { overflows++; } @@ -737,7 +737,7 @@ zend_debug_alloc_output("%10s\t", "End:"); zend_debug_alloc_output("Overflown (magic=0x%0.8lX instead of 0x%0.8lX)\n", end_magic, MEM_BLOCK_END_MAGIC); zend_debug_alloc_output("%10s\t",""); - if (overflows>=sizeof(long)) { + if (overflows>=(int)sizeof(long)) { zend_debug_alloc_output("At least %d bytes overflown\n", sizeof(long)); } else { zend_debug_alloc_output("%d byte(s) overflown\n", overflows);
Index: php-src/main/fopen_wrappers.c diff -u php-src/main/fopen_wrappers.c:1.166 php-src/main/fopen_wrappers.c:1.167 --- php-src/main/fopen_wrappers.c:1.166 Wed Jul 30 13:55:06 2003 +++ php-src/main/fopen_wrappers.c Fri Sep 26 04:09:52 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.c,v 1.166 2003/07/30 17:55:06 iliaa Exp $ */ +/* $Id: fopen_wrappers.c,v 1.167 2003/09/26 08:09:52 hholzgra Exp $ */ /* {{{ includes */ @@ -299,7 +299,7 @@ if (s) { /* if there is no path name after the file, do not bother */ /* to try open the directory */ length = s - (path_info + 2); - if (length > sizeof(user) - 1) + if (length > (int)sizeof(user) - 1) length = sizeof(user) - 1; memcpy(user, path_info + 2, length); user[length] = '\0'; Index: php-src/ext/zlib/zlib.c diff -u php-src/ext/zlib/zlib.c:1.179 php-src/ext/zlib/zlib.c:1.180 --- php-src/ext/zlib/zlib.c:1.179 Sat Sep 6 11:31:34 2003 +++ php-src/ext/zlib/zlib.c Fri Sep 26 04:09:53 2003 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.179 2003/09/06 15:31:34 sr Exp $ */ +/* $Id: zlib.c,v 1.180 2003/09/26 08:09:53 hholzgra Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -410,7 +410,8 @@ Unzip a gzip-compressed string */ PHP_FUNCTION(gzuncompress) { - int data_len, status, factor=1, maxfactor=16; + int data_len, status; + unsigned int factor=1, maxfactor=16; long limit = 0; unsigned long plength=0, length; char *data, *s1=NULL, *s2=NULL; @@ -433,7 +434,7 @@ that should be eneugh for all real life cases */ do { - length = plength ? plength : data_len * (1 << factor++); + length = plength ? plength : (unsigned long)data_len * (1 << factor++); s2 = (char *) erealloc(s1, length); status = uncompress(s2, &length, data, data_len); s1 = s2; @@ -516,7 +517,8 @@ Unzip a gzip-compressed string */ PHP_FUNCTION(gzinflate) { - int data_len, status, factor=1, maxfactor=16; + int data_len, status; + unsigned int factor=1, maxfactor=16; long limit = 0; unsigned long plength=0, length; char *data, *s1=NULL, *s2=NULL; @@ -544,7 +546,7 @@ stream.zfree = (free_func) Z_NULL; do { - length = plength ? plength : data_len * (1 << factor++); + length = plength ? plength : (unsigned long)data_len * (1 << factor++); s2 = (char *) erealloc(s1, length); if (!s2 && s1) { Index: php-src/ext/xml/compat.c diff -u php-src/ext/xml/compat.c:1.17 php-src/ext/xml/compat.c:1.18 --- php-src/ext/xml/compat.c:1.17 Fri Aug 22 11:04:29 2003 +++ php-src/ext/xml/compat.c Fri Sep 26 04:09:54 2003 @@ -509,7 +509,7 @@ const XML_Char * XML_ErrorString(int code) { - if (code < 0 || code >= sizeof(error_mapping)) { + if (code < 0 || code >= (int)sizeof(error_mapping)) { return "Unknown"; } return error_mapping[code]; Index: php-src/ext/standard/pack.c diff -u php-src/ext/standard/pack.c:1.49 php-src/ext/standard/pack.c:1.50 --- php-src/ext/standard/pack.c:1.49 Mon Aug 11 19:16:53 2003 +++ php-src/ext/standard/pack.c Fri Sep 26 04:09:55 2003 @@ -15,7 +15,7 @@ | Author: Chris Schneider <cschneid@relog.ch> | +----------------------------------------------------------------------+ */ -/* $Id: pack.c,v 1.49 2003/08/11 23:16:53 iliaa Exp $ */ +/* $Id: pack.c,v 1.50 2003/09/26 08:09:55 hholzgra Exp $ */ #include "php.h" @@ -847,7 +847,7 @@ /* Where to get lo to hi bytes from */ byte_map[0] = 0; - for (i = 0; i < sizeof(int); i++) { + for (i = 0; i < (int)sizeof(int); i++) { int_map[i] = i; } @@ -879,7 +879,7 @@ /* Where to get hi to lo bytes from */ byte_map[0] = size - 1; - for (i = 0; i < sizeof(int); i++) { + for (i = 0; i < (int)sizeof(int); i++) { int_map[i] = size - (sizeof(int) - i); } Index: php-src/ext/standard/ftp_fopen_wrapper.c diff -u php-src/ext/standard/ftp_fopen_wrapper.c:1.62 php-src/ext/standard/ftp_fopen_wrapper.c:1.63 --- php-src/ext/standard/ftp_fopen_wrapper.c:1.62 Thu Aug 28 12:28:33 2003 +++ php-src/ext/standard/ftp_fopen_wrapper.c Fri Sep 26 04:09:55 2003 @@ -18,7 +18,7 @@ | Sara Golemon <pollita@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: ftp_fopen_wrapper.c,v 1.62 2003/08/28 16:28:33 sas Exp $ */ +/* $Id: ftp_fopen_wrapper.c,v 1.63 2003/09/26 08:09:55 hholzgra Exp $ */ #include "php.h" #include "php_globals.h" @@ -586,7 +586,7 @@ return 0; } - memcpy(ent->d_name, basename, MIN(sizeof(ent->d_name), basename_len)-1); + memcpy(ent->d_name, basename, MIN((int)sizeof(ent->d_name), basename_len)-1); ent->d_name[sizeof(ent->d_name)-1] = '\0'; efree(basename); Index: php-src/ext/standard/exec.c diff -u php-src/ext/standard/exec.c:1.104 php-src/ext/standard/exec.c:1.105 --- php-src/ext/standard/exec.c:1.104 Thu Aug 28 12:28:33 2003 +++ php-src/ext/standard/exec.c Fri Sep 26 04:09:55 2003 @@ -16,7 +16,7 @@ | Ilia Alshanetsky <iliaa@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: exec.c,v 1.104 2003/08/28 16:28:33 sas Exp $ */ +/* $Id: exec.c,v 1.105 2003/09/26 08:09:55 hholzgra Exp $ */ #include <stdio.h> #include "php.h" @@ -61,10 +61,10 @@ { FILE *fp; char *buf, *tmp=NULL; - int buflen, l, pclose_return; + int l, pclose_return; char *cmd_p, *b, *c, *d=NULL; php_stream *stream; - size_t bufl = 0; + size_t buflen, bufl = 0; #if PHP_SIGCHILD void (*sig_handler)(); #endif Index: php-src/ext/standard/dns.c diff -u php-src/ext/standard/dns.c:1.62 php-src/ext/standard/dns.c:1.63 --- php-src/ext/standard/dns.c:1.62 Mon Sep 1 18:38:40 2003 +++ php-src/ext/standard/dns.c Fri Sep 26 04:09:55 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dns.c,v 1.62 2003/09/01 22:38:40 pollita Exp $ */ +/* $Id: dns.c,v 1.63 2003/09/26 08:09:55 hholzgra Exp $ */ /* {{{ includes */ #include "php.h" @@ -746,7 +746,7 @@ if (i < 0) { RETURN_FALSE; } - if (i > sizeof(ans)) { + if (i > (int)sizeof(ans)) { i = sizeof(ans); } hp = (HEADER *)&ans; Index: php-src/ext/standard/dir.c diff -u php-src/ext/standard/dir.c:1.128 php-src/ext/standard/dir.c:1.129 --- php-src/ext/standard/dir.c:1.128 Fri Sep 19 22:51:20 2003 +++ php-src/ext/standard/dir.c Fri Sep 26 04:09:55 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dir.c,v 1.128 2003/09/20 02:51:20 iliaa Exp $ */ +/* $Id: dir.c,v 1.129 2003/09/26 08:09:55 hholzgra Exp $ */ /* {{{ includes/startup/misc */ @@ -361,7 +361,8 @@ int pattern_len; long flags = 0; glob_t globbuf; - int n, ret; + unsigned int n; + int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &pattern, &pattern_len, &flags) == FAILURE) return; Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.248 php-src/ext/standard/array.c:1.249 --- php-src/ext/standard/array.c:1.248 Thu Sep 25 20:40:32 2003 +++ php-src/ext/standard/array.c Fri Sep 26 04:09:55 2003 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.248 2003/09/26 00:40:32 iliaa Exp $ */ +/* $Id: array.c,v 1.249 2003/09/26 08:09:55 hholzgra Exp $ */ #include "php.h" #include "php_ini.h" @@ -1890,7 +1890,7 @@ /* If we did a shift... re-index like it did before */ if (!off_the_end) { - int k = 0; + unsigned int k = 0; int should_rehash = 0; Bucket *p = Z_ARRVAL_PP(stack)->pListHead; while (p != NULL) { Index: ZendEngine2/zend_alloc.c diff -u ZendEngine2/zend_alloc.c:1.126 ZendEngine2/zend_alloc.c:1.127 --- ZendEngine2/zend_alloc.c:1.126 Thu Sep 25 11:54:17 2003 +++ ZendEngine2/zend_alloc.c Fri Sep 26 04:09:56 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_alloc.c,v 1.126 2003/09/25 15:54:17 georg Exp $ */ +/* $Id: zend_alloc.c,v 1.127 2003/09/26 08:09:56 hholzgra Exp $ */ #include "zend.h" #include "zend_alloc.h" @@ -728,7 +728,7 @@ had_problems = 1; overflow_ptr = (char *) &end_magic; - for (i=0; i<sizeof(long); i++) { + for (i=0; i<(int)sizeof(long); i++) { if (overflow_ptr[i]!=magic_ptr[i]) { overflows++; } @@ -737,7 +737,7 @@ zend_debug_alloc_output("%10s\t", "End:"); zend_debug_alloc_output("Overflown (magic=0x%0.8lX instead of 0x%0.8lX)\n", end_magic, MEM_BLOCK_END_MAGIC); zend_debug_alloc_output("%10s\t",""); - if (overflows>=sizeof(long)) { + if (overflows>=(int)sizeof(long)) { zend_debug_alloc_output("At least %d bytes overflown\n", sizeof(long)); } else { zend_debug_alloc_output("%d byte(s) overflown\n", overflows);