kalle                                    Sat, 01 Aug 2009 14:45:42 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=286624

Log:
Kill compiler warnings

Changed paths:
    U   php/php-src/trunk/ext/gd/gd.c
    U   php/php-src/trunk/ext/session/mod_files.c
    U   php/php-src/trunk/ext/standard/crypt_blowfish.c
    U   php/php-src/trunk/ext/standard/dir.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/pack.c
    U   php/php-src/trunk/ext/standard/streamsfuncs.c
    U   php/php-src/trunk/ext/standard/strnatcmp.c
    U   php/php-src/trunk/main/rfc1867.c
    U   php/php-src/trunk/main/snprintf.c
    U   php/php-src/trunk/main/streams/filter.c
    U   php/php-src/trunk/main/streams/glob_wrapper.c
    U   php/php-src/trunk/main/streams/streams.c

Modified: php/php-src/trunk/ext/gd/gd.c
===================================================================
--- php/php-src/trunk/ext/gd/gd.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/ext/gd/gd.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -3956,10 +3956,10 @@
 	bg_al = gdImageAlpha(bg_img, _bg);

 	for (i = 0; i < aa_steps; i++) {
-		rd = bg_rd + (double) (fg_rd - bg_rd) / aa_steps * (i + 1);
-		gr = bg_gr + (double) (fg_gr - bg_gr) / aa_steps * (i + 1);
-		bl = bg_bl + (double) (fg_bl - bg_bl) / aa_steps * (i + 1);
-		al = bg_al + (double) (fg_al - bg_al) / aa_steps * (i + 1);
+		rd = bg_rd + (int) (fg_rd - bg_rd) / aa_steps * (i + 1);
+		gr = bg_gr + (int) (fg_gr - bg_gr) / aa_steps * (i + 1);
+		bl = bg_bl + (int) (fg_bl - bg_bl) / aa_steps * (i + 1);
+		al = bg_al + (int) (fg_al - bg_al) / aa_steps * (i + 1);
 		aa[i] = gdImageColorResolveAlpha(bg_img, rd, gr, bl, al);
 	}

@@ -3997,7 +3997,7 @@
 		for (i = 1; i < str_len; i++) {
 			amount_kern = (int) T1_GetKerning(*f_ind, str[i - 1], str[i]);
 			amount_kern += str[i - 1] == ' ' ? space : 0;
-			add_width = (int) (amount_kern + width) / extend;
+			add_width = (int) ((amount_kern + width) / extend);

 			char_path = T1_GetMoveOutline(*f_ind, add_width, 0, 0, (float) size, transform);
 			str_path = T1_ConcatOutlines(str_path, char_path);
@@ -4699,7 +4699,7 @@
 					zval copyval = **var2;
 					zval_copy_ctor(&copyval);
 					convert_to_double(&copyval);
-					matrix[i][j] = Z_DVAL_PP(var2);
+					matrix[i][j] = (float) Z_DVAL_PP(var2);
 				} else {
 					php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have a 3x3 matrix");
 					RETURN_FALSE;
@@ -4707,7 +4707,7 @@
 			}
 		}
 	}
-	RETURN_BOOL(gdImageConvolution(im_src, matrix, div, offset));
+	RETURN_BOOL(gdImageConvolution(im_src, matrix, (float) div, (float) offset));
 }
 /* }}} */
 /* End section: Filters */

Modified: php/php-src/trunk/ext/session/mod_files.c
===================================================================
--- php/php-src/trunk/ext/session/mod_files.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/ext/session/mod_files.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -132,7 +132,7 @@
 		if (status != U_ZERO_ERROR) {
 			php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failure converting savepath to local filesystem encoding, attempting to use utf8");
 		} else {
-			if (newlen >= buflen) {
+			if ((unsigned int)newlen >= buflen) {
 				newlen = buflen - 1;
 				newbuf[newlen] = 0;
 			}

Modified: php/php-src/trunk/ext/standard/crypt_blowfish.c
===================================================================
--- php/php-src/trunk/ext/standard/crypt_blowfish.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/ext/standard/crypt_blowfish.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -744,7 +744,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/dir.c
===================================================================
--- php/php-src/trunk/ext/standard/dir.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/ext/standard/dir.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -449,8 +449,7 @@
 	int pattern_len;
 	long flags = 0;
 	glob_t globbuf;
-	unsigned int n;
-	int ret;
+	int ret, n;
 	zend_bool basedir_limit = 0;

 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|l", &pppattern, &flags) == FAILURE ||

Modified: php/php-src/trunk/ext/standard/html.c
===================================================================
--- php/php-src/trunk/ext/standard/html.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/ext/standard/html.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -1397,7 +1397,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;

Modified: php/php-src/trunk/ext/standard/iptc.c
===================================================================
--- php/php-src/trunk/ext/standard/iptc.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/ext/standard/iptc.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -183,7 +183,8 @@
 	int jpeg_file_len, iptcdata_len;
     FILE *fp;
 	unsigned int marker;
-	unsigned int done = 0, inx;
+	unsigned int done = 0;
+	int inx;
 	long spool = 0;
 	unsigned char *spoolbuf=0, *poi=0;
 	struct stat sb;

Modified: php/php-src/trunk/ext/standard/pack.c
===================================================================
--- php/php-src/trunk/ext/standard/pack.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/ext/standard/pack.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -255,7 +255,7 @@

 			case 'i':
 			case 'I':
-				INC_OUTPUTPOS(arg,sizeof(int))
+				INC_OUTPUTPOS((unsigned int) arg, sizeof(int))
 				break;

 			case 'l':
@@ -266,11 +266,11 @@
 				break;

 			case 'f':
-				INC_OUTPUTPOS(arg,sizeof(float))
+				INC_OUTPUTPOS((unsigned int) arg, sizeof(float))
 				break;

 			case 'd':
-				INC_OUTPUTPOS(arg,sizeof(double))
+				INC_OUTPUTPOS((unsigned int) arg, sizeof(double))
 				break;

 			case 'X':

Modified: php/php-src/trunk/ext/standard/streamsfuncs.c
===================================================================
--- php/php-src/trunk/ext/standard/streamsfuncs.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/ext/standard/streamsfuncs.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -116,10 +116,10 @@

 	/* prepare the timeout value for use */
 	conv = (php_timeout_ull) (timeout * 1000000.0);
-	tv.tv_sec = conv / 1000000;
+	tv.tv_sec = (long) (conv / 1000000);
 	tv.tv_usec = conv % 1000000;

-	if (zerrno)	{
+	if (zerrno) {
 		zval_dtor(zerrno);
 		ZVAL_LONG(zerrno, 0);
 	}
@@ -260,7 +260,7 @@

 	/* prepare the timeout value for use */
 	conv = (php_timeout_ull) (timeout * 1000000.0);
-	tv.tv_sec = conv / 1000000;
+	tv.tv_sec = (long) (conv / 1000000);
 	tv.tv_usec = conv % 1000000;

 	if (zpeername) {

Modified: php/php-src/trunk/ext/standard/strnatcmp.c
===================================================================
--- php/php-src/trunk/ext/standard/strnatcmp.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/ext/standard/strnatcmp.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -104,7 +104,7 @@
 PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, int fold_case)
 {
 	unsigned char ca, cb;
-	int ai, bi;
+	unsigned int ai, bi;
 	int fractional, result;

 	ai = bi = 0;
@@ -239,7 +239,7 @@
 	UChar const *ap, *bp;
 	int fractional, result;
 	int a_off, b_off;
-	int a_curr, b_curr;
+	unsigned int a_curr, b_curr;

 	if (a_len == 0 || b_len == 0)
 		return a_len - b_len;

Modified: php/php-src/trunk/main/rfc1867.c
===================================================================
--- php/php-src/trunk/main/rfc1867.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/main/rfc1867.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -842,12 +842,12 @@
 					}
 				}

-				if (PG(upload_max_filesize) > 0 && (total_bytes+blen) > PG(upload_max_filesize)) {
+				if (PG(upload_max_filesize) > 0 && (int)(total_bytes+blen) > PG(upload_max_filesize)) {
 #if DEBUG_FILE_UPLOAD
 					sapi_module.sapi_error(E_NOTICE, "upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", PG(upload_max_filesize), param, filename);
 #endif
 					cancel_upload = UPLOAD_ERROR_A;
-				} else if (max_file_size && ((total_bytes+blen) > max_file_size)) {
+				} else if (max_file_size && ((int)(total_bytes+blen) > max_file_size)) {
 #if DEBUG_FILE_UPLOAD
 					sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename);
 #endif

Modified: php/php-src/trunk/main/snprintf.c
===================================================================
--- php/php-src/trunk/main/snprintf.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/main/snprintf.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -1263,7 +1263,7 @@

 PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{ */
 {
-	int cc;
+	unsigned int cc;
 	va_list ap;

 	va_start(ap, format);
@@ -1279,7 +1279,7 @@

 PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */
 {
-	int cc;
+	unsigned int cc;

 	strx_printv(&cc, buf, len, format, ap);
 	if (cc >= len) {

Modified: php/php-src/trunk/main/streams/filter.c
===================================================================
--- php/php-src/trunk/main/streams/filter.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/main/streams/filter.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -428,7 +428,7 @@
 			php_stream_bucket_append(brig_inp, bucket TSRMLS_CC);
 			status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL TSRMLS_CC);

-			if (stream->readpos + consumed > stream->writepos || consumed < 0) {
+			if ((int) (stream->readpos + consumed) > stream->writepos || consumed < 0) {
 				/* No behaving filter should cause this. */
 				status = PSFS_ERR_FATAL;
 			}
@@ -484,9 +484,8 @@
 						php_stream_bucket_convert_notranscode(bucket, stream->readbuf_type);
 					}

-					/* Grow buffer to hold this bucket if need be.
-					   TODO: See warning in main/stream/streams.c::php_stream_fill_read_buffer */
-					if (stream->readbuflen - stream->writepos < bucket->buflen) {
+					/* Grow buffer to hold this bucket if need be */
+					if (stream->readbuflen - stream->writepos < (unsigned int)bucket->buflen) {
 						stream->readbuflen += bucket->buflen;
 						stream->readbuf.v = perealloc(stream->readbuf.v, PS_ULEN(stream->readbuf_type == IS_UNICODE, stream->readbuflen), stream->is_persistent);
 					}
@@ -660,7 +659,7 @@

 	if (chain == &(stream->readfilters)) {
 		/* Dump any newly flushed data to the read buffer */
-		if (stream->readpos > stream->chunk_size) {
+		if ((unsigned int)stream->readpos > stream->chunk_size) {
 			/* Back the buffer up */
 			memcpy(stream->readbuf.s, stream->readbuf.s + PS_ULEN(stream->readbuf_type == IS_UNICODE, stream->readpos), PS_ULEN(stream->readbuf_type == IS_UNICODE, stream->writepos - stream->readpos));
 			stream->writepos -= stream->readpos;

Modified: php/php-src/trunk/main/streams/glob_wrapper.c
===================================================================
--- php/php-src/trunk/main/streams/glob_wrapper.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/main/streams/glob_wrapper.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -144,7 +144,7 @@

 	/* avoid problems if someone mis-uses the stream */
 	if (count == sizeof(php_stream_dirent) && pglob) {
-		if (pglob->index < pglob->glob.gl_pathc) {
+		if (pglob->index < (unsigned int) pglob->glob.gl_pathc) {
 			php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[pglob->index++], pglob->flags & GLOB_APPEND, &path TSRMLS_CC);
 			PHP_STRLCPY(ent->d_name, path, sizeof(ent->d_name), strlen(path));
 			return sizeof(php_stream_dirent);

Modified: php/php-src/trunk/main/streams/streams.c
===================================================================
--- php/php-src/trunk/main/streams/streams.c	2009-08-01 13:34:37 UTC (rev 286623)
+++ php/php-src/trunk/main/streams/streams.c	2009-08-01 14:45:42 UTC (rev 286624)
@@ -514,7 +514,7 @@

 						/* grow buffer to hold this bucket
 						 * TODO: this can fail for persistent streams */
-						if (stream->readbuflen - stream->writepos < bucket->buflen) {
+						if (stream->readbuflen - stream->writepos < (unsigned int)bucket->buflen) {
 							stream->readbuflen += bucket->buflen;
 							stream->readbuf.v = perealloc(stream->readbuf.v, PS_ULEN(stream->readbuf_type == IS_UNICODE, stream->readbuflen), stream->is_persistent);
 						}
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to