diff options
Diffstat (limited to 'ext/standard/image.c')
-rw-r--r-- | ext/standard/image.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/ext/standard/image.c b/ext/standard/image.c index 27f60c95a7..ce48b961f4 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -105,7 +105,7 @@ static struct gfxinfo *php_handle_gif (php_stream * stream TSRMLS_DC) if (php_stream_seek(stream, 3, SEEK_CUR)) return NULL; - if (php_stream_read(stream, dim, sizeof(dim)) != sizeof(dim)) + if (php_stream_read(stream, (char*)dim, sizeof(dim)) != sizeof(dim)) return NULL; result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo)); @@ -128,7 +128,7 @@ static struct gfxinfo *php_handle_psd (php_stream * stream TSRMLS_DC) if (php_stream_seek(stream, 11, SEEK_CUR)) return NULL; - if (php_stream_read(stream, dim, sizeof(dim)) != sizeof(dim)) + if (php_stream_read(stream, (char*)dim, sizeof(dim)) != sizeof(dim)) return NULL; result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo)); @@ -150,7 +150,7 @@ static struct gfxinfo *php_handle_bmp (php_stream * stream TSRMLS_DC) if (php_stream_seek(stream, 11, SEEK_CUR)) return NULL; - if (php_stream_read(stream, dim, sizeof(dim)) != sizeof(dim)) + if (php_stream_read(stream, (char*)dim, sizeof(dim)) != sizeof(dim)) return NULL; size = (((unsigned int)dim[ 3]) << 24) + (((unsigned int)dim[ 2]) << 16) + (((unsigned int)dim[ 1]) << 8) + ((unsigned int) dim[ 0]); @@ -272,7 +272,7 @@ static struct gfxinfo *php_handle_swf (php_stream * stream TSRMLS_DC) if (php_stream_seek(stream, 5, SEEK_CUR)) return NULL; - if (php_stream_read(stream, a, sizeof(a)) != sizeof(a)) + if (php_stream_read(stream, (char*)a, sizeof(a)) != sizeof(a)) return NULL; result = (struct gfxinfo *) ecalloc (1, sizeof (struct gfxinfo)); @@ -305,7 +305,7 @@ static struct gfxinfo *php_handle_png (php_stream * stream TSRMLS_DC) if (php_stream_seek(stream, 8, SEEK_CUR)) return NULL; - if((php_stream_read(stream, dim, sizeof(dim))) < sizeof(dim)) + if((php_stream_read(stream, (char*)dim, sizeof(dim))) < sizeof(dim)) return NULL; result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo)); @@ -362,7 +362,7 @@ static unsigned short php_read2(php_stream * stream TSRMLS_DC) unsigned char a[2]; /* just return 0 if we hit the end-of-file */ - if((php_stream_read(stream, a, sizeof(a))) <= 0) return 0; + if((php_stream_read(stream, (char*)a, sizeof(a))) <= 0) return 0; return (((unsigned short)a[0]) << 8) + ((unsigned short)a[1]); } @@ -436,8 +436,8 @@ static int php_skip_variable(php_stream * stream TSRMLS_DC) static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSRMLS_DC) { unsigned short length; - unsigned char *buffer; - unsigned char markername[16]; + char *buffer; + char markername[16]; zval *tmp; length = php_read2(stream TSRMLS_CC); @@ -455,7 +455,7 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR snprintf(markername, sizeof(markername), "APP%d", marker - M_APP0); - if (zend_hash_find(Z_ARRVAL_P(info), markername, strlen(markername)+1, (void **) &tmp) == FAILURE) { + if ((tmp = zend_hash_str_find(Z_ARRVAL_P(info), markername, strlen(markername))) == NULL) { /* XXX we onyl catch the 1st tag of it's kind! */ add_assoc_stringl(info, markername, buffer, length, 1); } @@ -561,7 +561,7 @@ static unsigned int php_read4(php_stream * stream TSRMLS_DC) unsigned char a[4]; /* just return 0 if we hit the end-of-file */ - if ((php_stream_read(stream, a, sizeof(a))) != sizeof(a)) return 0; + if ((php_stream_read(stream, (char*)a, sizeof(a))) != sizeof(a)) return 0; return (((unsigned int)a[0]) << 24) + (((unsigned int)a[1]) << 16) @@ -893,7 +893,7 @@ static struct gfxinfo *php_handle_iff(php_stream * stream TSRMLS_DC) /* loop chunks to find BMHD chunk */ do { - if (php_stream_read(stream, a, 8) != 8) { + if (php_stream_read(stream, (char*)a, 8) != 8) { return NULL; } chunkId = php_ifd_get32s(a+0, 1); @@ -905,7 +905,7 @@ static struct gfxinfo *php_handle_iff(php_stream * stream TSRMLS_DC) size++; } if (chunkId == 0x424d4844) { /* BMHD chunk */ - if (size < 9 || php_stream_read(stream, a, 9) != 9) { + if (size < 9 || php_stream_read(stream, (char*)a, 9) != 9) { return NULL; } width = php_ifd_get16s(a+0, 1); @@ -1161,7 +1161,7 @@ PHP_FUNCTION(image_type_to_mime_type) return; } - ZVAL_STRING(return_value, (char*)php_image_type_to_mime_type(p_image_type), 1); + ZVAL_STRING(return_value, (char*)php_image_type_to_mime_type(p_image_type)); } /* }}} */ @@ -1178,36 +1178,36 @@ PHP_FUNCTION(image_type_to_extension) switch (image_type) { case IMAGE_FILETYPE_GIF: - RETURN_STRING(".gif" + !inc_dot, 1); + RETURN_STRING(".gif" + !inc_dot); case IMAGE_FILETYPE_JPEG: - RETURN_STRING(".jpeg" + !inc_dot, 1); + RETURN_STRING(".jpeg" + !inc_dot); case IMAGE_FILETYPE_PNG: - RETURN_STRING(".png" + !inc_dot, 1); + RETURN_STRING(".png" + !inc_dot); case IMAGE_FILETYPE_SWF: case IMAGE_FILETYPE_SWC: - RETURN_STRING(".swf" + !inc_dot, 1); + RETURN_STRING(".swf" + !inc_dot); case IMAGE_FILETYPE_PSD: - RETURN_STRING(".psd" + !inc_dot, 1); + RETURN_STRING(".psd" + !inc_dot); case IMAGE_FILETYPE_BMP: case IMAGE_FILETYPE_WBMP: - RETURN_STRING(".bmp" + !inc_dot, 1); + RETURN_STRING(".bmp" + !inc_dot); case IMAGE_FILETYPE_TIFF_II: case IMAGE_FILETYPE_TIFF_MM: - RETURN_STRING(".tiff" + !inc_dot, 1); + RETURN_STRING(".tiff" + !inc_dot); case IMAGE_FILETYPE_IFF: - RETURN_STRING(".iff" + !inc_dot, 1); + RETURN_STRING(".iff" + !inc_dot); case IMAGE_FILETYPE_JPC: - RETURN_STRING(".jpc" + !inc_dot, 1); + RETURN_STRING(".jpc" + !inc_dot); case IMAGE_FILETYPE_JP2: - RETURN_STRING(".jp2" + !inc_dot, 1); + RETURN_STRING(".jp2" + !inc_dot); case IMAGE_FILETYPE_JPX: - RETURN_STRING(".jpx" + !inc_dot, 1); + RETURN_STRING(".jpx" + !inc_dot); case IMAGE_FILETYPE_JB2: - RETURN_STRING(".jb2" + !inc_dot, 1); + RETURN_STRING(".jb2" + !inc_dot); case IMAGE_FILETYPE_XBM: - RETURN_STRING(".xbm" + !inc_dot, 1); + RETURN_STRING(".xbm" + !inc_dot); case IMAGE_FILETYPE_ICO: - RETURN_STRING(".ico" + !inc_dot, 1); + RETURN_STRING(".ico" + !inc_dot); } RETURN_FALSE; |