kalle Thu, 23 Sep 2010 03:45:36 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=303703
Log:
Fixed compiler warnings in the standard library
Changed paths:
U php/php-src/trunk/ext/standard/array.c
U php/php-src/trunk/ext/standard/crypt_blowfish.c
U php/php-src/trunk/ext/standard/crypt_sha256.c
U php/php-src/trunk/ext/standard/crypt_sha512.c
U php/php-src/trunk/ext/standard/html.c
U php/php-src/trunk/ext/standard/iptc.c
U php/php-src/trunk/ext/standard/url_scanner_ex.c
U php/php-src/trunk/ext/standard/url_scanner_ex.re
Modified: php/php-src/trunk/ext/standard/array.c
===================================================================
--- php/php-src/trunk/ext/standard/array.c 2010-09-23 03:33:36 UTC (rev
303702)
+++ php/php-src/trunk/ext/standard/array.c 2010-09-23 03:45:36 UTC (rev
303703)
@@ -629,7 +629,7 @@
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(uasort)
{
zval *array;
- int refcount;
+ unsigned int refcount;
PHP_ARRAY_CMP_FUNC_VARS;
PHP_ARRAY_CMP_FUNC_BACKUP();
@@ -768,7 +768,7 @@
PHP_FUNCTION(uksort)
{
zval *array;
- int refcount;
+ unsigned int refcount;
PHP_ARRAY_CMP_FUNC_VARS;
PHP_ARRAY_CMP_FUNC_BACKUP();
Modified: php/php-src/trunk/ext/standard/crypt_blowfish.c
===================================================================
--- php/php-src/trunk/ext/standard/crypt_blowfish.c 2010-09-23 03:33:36 UTC
(rev 303702)
+++ php/php-src/trunk/ext/standard/crypt_blowfish.c 2010-09-23 03:45:36 UTC
(rev 303703)
@@ -745,7 +745,7 @@
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] = '$';
Modified: php/php-src/trunk/ext/standard/crypt_sha256.c
===================================================================
--- php/php-src/trunk/ext/standard/crypt_sha256.c 2010-09-23 03:33:36 UTC
(rev 303702)
+++ php/php-src/trunk/ext/standard/crypt_sha256.c 2010-09-23 03:45:36 UTC
(rev 303703)
@@ -470,7 +470,7 @@
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);
}
Modified: php/php-src/trunk/ext/standard/crypt_sha512.c
===================================================================
--- php/php-src/trunk/ext/standard/crypt_sha512.c 2010-09-23 03:33:36 UTC
(rev 303702)
+++ php/php-src/trunk/ext/standard/crypt_sha512.c 2010-09-23 03:45:36 UTC
(rev 303703)
@@ -506,7 +506,7 @@
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);
}
Modified: php/php-src/trunk/ext/standard/html.c
===================================================================
--- php/php-src/trunk/ext/standard/html.c 2010-09-23 03:33:36 UTC (rev
303702)
+++ php/php-src/trunk/ext/standard/html.c 2010-09-23 03:45:36 UTC (rev
303703)
@@ -915,8 +915,8 @@
*/
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 @@
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(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);
Modified: php/php-src/trunk/ext/standard/iptc.c
===================================================================
--- php/php-src/trunk/ext/standard/iptc.c 2010-09-23 03:33:36 UTC (rev
303702)
+++ php/php-src/trunk/ext/standard/iptc.c 2010-09-23 03:45:36 UTC (rev
303703)
@@ -181,7 +181,8 @@
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 @@
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;
Modified: php/php-src/trunk/ext/standard/url_scanner_ex.c
===================================================================
--- php/php-src/trunk/ext/standard/url_scanner_ex.c 2010-09-23 03:33:36 UTC
(rev 303702)
+++ php/php-src/trunk/ext/standard/url_scanner_ex.c 2010-09-23 03:45:36 UTC
(rev 303703)
@@ -309,7 +309,7 @@
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);
Modified: php/php-src/trunk/ext/standard/url_scanner_ex.re
===================================================================
--- php/php-src/trunk/ext/standard/url_scanner_ex.re 2010-09-23 03:33:36 UTC
(rev 303702)
+++ php/php-src/trunk/ext/standard/url_scanner_ex.re 2010-09-23 03:45:36 UTC
(rev 303703)
@@ -245,7 +245,7 @@
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);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php