diff options
-rw-r--r-- | Zend/zend_alloc.c | 4 | ||||
-rw-r--r-- | ext/standard/array.c | 2 | ||||
-rw-r--r-- | ext/standard/dir.c | 3 | ||||
-rw-r--r-- | ext/standard/dns.c | 2 | ||||
-rw-r--r-- | ext/standard/exec.c | 4 | ||||
-rw-r--r-- | ext/standard/ftp_fopen_wrapper.c | 2 | ||||
-rw-r--r-- | ext/standard/pack.c | 4 | ||||
-rw-r--r-- | ext/xml/compat.c | 2 | ||||
-rw-r--r-- | ext/zlib/zlib.c | 10 | ||||
-rw-r--r-- | main/fopen_wrappers.c | 2 |
10 files changed, 19 insertions, 16 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 13de5cf472..6e153cbedb 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -728,7 +728,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_ 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_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_ 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); diff --git a/ext/standard/array.c b/ext/standard/array.c index 61716fbb8d..3a6d4c74d4 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1890,7 +1890,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) /* 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) { diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 40738b3b8e..25f96064e9 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -361,7 +361,8 @@ PHP_FUNCTION(glob) 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; diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 73a1e30803..eddb67ed43 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -746,7 +746,7 @@ PHP_FUNCTION(dns_get_mx) if (i < 0) { RETURN_FALSE; } - if (i > sizeof(ans)) { + if (i > (int)sizeof(ans)) { i = sizeof(ans); } hp = (HEADER *)&ans; diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 2b3f3b3dd8..adc243f63c 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -61,10 +61,10 @@ int php_exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC) { 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 diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 177bed26ab..8d20a1a3ae 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -586,7 +586,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count 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); diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 5678ecbbf8..72c18ea53b 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -847,7 +847,7 @@ PHP_MINIT_FUNCTION(pack) /* 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 @@ PHP_MINIT_FUNCTION(pack) /* 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); } diff --git a/ext/xml/compat.c b/ext/xml/compat.c index 04d33fdb74..45c47d14d7 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -509,7 +509,7 @@ const XML_Char *error_mapping[] = { 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]; diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index d3ca9dadcb..05e17ee620 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -410,7 +410,8 @@ PHP_FUNCTION(gzcompress) 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 @@ PHP_FUNCTION(gzuncompress) 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 @@ PHP_FUNCTION(gzdeflate) 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 @@ PHP_FUNCTION(gzinflate) 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) { diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index e709327672..5356350917 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -299,7 +299,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC) 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'; |