diff options
author | Kalle Sommer Nielsen <kalle@php.net> | 2010-09-23 03:45:36 +0000 |
---|---|---|
committer | Kalle Sommer Nielsen <kalle@php.net> | 2010-09-23 03:45:36 +0000 |
commit | cb500110163b59116f37e0e3b48d8402e8132a60 (patch) | |
tree | b3785c87bc38ffc1261a1307fd60263f7f7ff164 /ext/standard | |
parent | 466c0b88d7a459ae2967ed1f72b790075fab4854 (diff) | |
download | php-git-cb500110163b59116f37e0e3b48d8402e8132a60.tar.gz |
Fixed compiler warnings in the standard library
Diffstat (limited to 'ext/standard')
-rw-r--r-- | ext/standard/array.c | 6 | ||||
-rw-r--r-- | ext/standard/crypt_blowfish.c | 2 | ||||
-rw-r--r-- | ext/standard/crypt_sha256.c | 2 | ||||
-rw-r--r-- | ext/standard/crypt_sha512.c | 2 | ||||
-rw-r--r-- | ext/standard/html.c | 9 | ||||
-rw-r--r-- | ext/standard/iptc.c | 6 | ||||
-rw-r--r-- | ext/standard/url_scanner_ex.c | 2 | ||||
-rw-r--r-- | ext/standard/url_scanner_ex.re | 2 |
8 files changed, 17 insertions, 14 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index ee3c5ae75a..f0c20c3121 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -629,7 +629,7 @@ static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{ PHP_FUNCTION(usort) { zval *array; - int refcount; + unsigned int refcount; PHP_ARRAY_CMP_FUNC_VARS; PHP_ARRAY_CMP_FUNC_BACKUP(); @@ -672,7 +672,7 @@ PHP_FUNCTION(usort) PHP_FUNCTION(uasort) { zval *array; - int refcount; + unsigned int refcount; PHP_ARRAY_CMP_FUNC_VARS; PHP_ARRAY_CMP_FUNC_BACKUP(); @@ -768,7 +768,7 @@ static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /* PHP_FUNCTION(uksort) { zval *array; - int refcount; + unsigned int refcount; PHP_ARRAY_CMP_FUNC_VARS; PHP_ARRAY_CMP_FUNC_BACKUP(); diff --git a/ext/standard/crypt_blowfish.c b/ext/standard/crypt_blowfish.c index 6f728ed795..6c99a396d5 100644 --- a/ext/standard/crypt_blowfish.c +++ b/ext/standard/crypt_blowfish.c @@ -745,7 +745,7 @@ char *php_crypt_gensalt_blowfish_rn(unsigned long count, output[1] = '2'; output[2] = 'a'; output[3] = '$'; - output[4] = '0' + count / 10; + output[4] = (char) ('0' + count / 10); output[5] = '0' + count % 10; output[6] = '$'; diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c index f9daed909a..26260992ef 100644 --- a/ext/standard/crypt_sha256.c +++ b/ext/standard/crypt_sha256.c @@ -470,7 +470,7 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b sha256_init_ctx(&alt_ctx); /* For every character in the password add the entire password. */ - for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt) { + for (cnt = 0; cnt < (size_t) (16 + alt_result[0]); ++cnt) { sha256_process_bytes(salt, salt_len, &alt_ctx); } diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c index f78ff03981..a51e11a37c 100644 --- a/ext/standard/crypt_sha512.c +++ b/ext/standard/crypt_sha512.c @@ -506,7 +506,7 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen) sha512_init_ctx(&alt_ctx); /* For every character in the password add the entire password. */ - for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt) { + for (cnt = 0; cnt < (size_t) (16 + alt_result[0]); ++cnt) { sha512_process_bytes(salt, salt_len, &alt_ctx); } diff --git a/ext/standard/html.c b/ext/standard/html.c index d9ccff9dd0..f937e1dd3b 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -915,8 +915,8 @@ size_t php_utf32_utf8(unsigned char *buf, int k) */ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *newlen, int all, int quote_style, char *hint_charset TSRMLS_DC) { - int retlen; - int j, k; + int retlen, j; + unsigned int k; char *replaced, *ret, *p, *q, *lim, *next; enum entity_charset charset = determine_charset(hint_charset TSRMLS_CC); unsigned char replacement[15]; @@ -1355,7 +1355,7 @@ PHP_FUNCTION(htmlspecialchars_decode) if (!memcmp(p, basic_entities_dec[j].entity, basic_entities_dec[j].entitylen)) { int e_len = basic_entities_dec[j].entitylen - 1; - *p++ = basic_entities_dec[j].charcode; + *p++ = (char) basic_entities_dec[j].charcode; memmove(p, p + e_len, (e - p - e_len)); e -= e_len; goto done; @@ -1412,7 +1412,8 @@ PHP_FUNCTION(htmlentities) PHP_FUNCTION(get_html_translation_table) { long which = HTML_SPECIALCHARS, quote_style = ENT_COMPAT; - int i, j; + unsigned int i; + int j; char ind[2]; enum entity_charset charset = determine_charset(NULL TSRMLS_CC); diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index d863e3dd8f..16a1602900 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -181,7 +181,8 @@ PHP_FUNCTION(iptcembed) int iptcdata_len, jpeg_file_len; long spool = 0; FILE *fp; - unsigned int marker, done = 0, inx; + unsigned int marker, done = 0; + int inx; unsigned char *spoolbuf = NULL, *poi = NULL; struct stat sb; zend_bool written = 0; @@ -295,7 +296,8 @@ PHP_FUNCTION(iptcembed) Parse binary IPTC-data into associative array */ PHP_FUNCTION(iptcparse) { - unsigned int inx = 0, len, tagsfound = 0; + int inx = 0, len; + unsigned int tagsfound = 0; unsigned char *buffer, recnum, dataset, key[ 16 ]; char *str; int str_len; diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index e589a6edea..0618138f15 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -309,7 +309,7 @@ static void handle_form(STD_PARA) static inline void handle_tag(STD_PARA) { int ok = 0; - int i; + unsigned int i; ctx->tag.len = 0; smart_str_appendl(&ctx->tag, start, YYCURSOR - start); diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index 44879dab9a..5cc16c7ece 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -245,7 +245,7 @@ static void handle_form(STD_PARA) static inline void handle_tag(STD_PARA) { int ok = 0; - int i; + unsigned int i; ctx->tag.len = 0; smart_str_appendl(&ctx->tag, start, YYCURSOR - start); |