helly Sat Nov 8 09:16:15 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/exif exif.c Log: MFH (#26056: Warnings while compiling exif.c)
Index: php-src/ext/exif/exif.c diff -u php-src/ext/exif/exif.c:1.118.2.25 php-src/ext/exif/exif.c:1.118.2.26 --- php-src/ext/exif/exif.c:1.118.2.25 Mon Sep 22 19:28:07 2003 +++ php-src/ext/exif/exif.c Sat Nov 8 09:16:14 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: exif.c,v 1.118.2.25 2003/09/22 23:28:07 iliaa Exp $ */ +/* $Id: exif.c,v 1.118.2.26 2003/11/08 14:16:14 helly Exp $ */ /* ToDos * @@ -99,7 +99,7 @@ }; /* }}} */ -#define EXIF_VERSION "1.4 $Id: exif.c,v 1.118.2.25 2003/09/22 23:28:07 iliaa Exp $" +#define EXIF_VERSION "1.4 $Id: exif.c,v 1.118.2.26 2003/11/08 14:16:14 helly Exp $" /* {{{ PHP_MINFO_FUNCTION */ @@ -1301,7 +1301,7 @@ return ""; } -static const tag_table_type exif_get_tag_table(int section) +static tag_table_type exif_get_tag_table(int section) { switch(section) { case SECTION_FILE: return &tag_table_IFD[0]; @@ -1525,7 +1525,7 @@ /* {{{ exif_iif_add_value Add a value to image_info */ -static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value, int motorola_intel TSRMLS_DC) +static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC) { size_t idex; void *vptr; @@ -1662,7 +1662,7 @@ */ static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value TSRMLS_DC) { - exif_iif_add_value(image_info, section_index, name, tag, format, length, value, image_info->motorola_intel TSRMLS_CC); + exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel TSRMLS_CC); } /* }}} */ @@ -1819,7 +1819,7 @@ static void add_assoc_image_info(pval *value, int sub_array, image_info_type *image_info, int section_index TSRMLS_DC) { char buffer[64], *val, *name, uname[64]; - int i, ap, l, b, idx=0, done, unknown=0; + int i, ap, l, b, idx=0, unknown=0; #ifdef EXIF_DEBUG int info_tag; #endif @@ -1839,7 +1839,6 @@ } for(i=0; i<image_info->info_list[section_index].count; i++) { - done = 0; info_data = &image_info->info_list[section_index].list[i]; #ifdef EXIF_DEBUG info_tag = info_data->tag; /* conversion */ @@ -2218,7 +2217,7 @@ #endif /* }}} */ -/* {{{ proto string|false exif_tagname(index) +/* {{{ proto string exif_tagname(index) Get headername for index or false if not defined */ PHP_FUNCTION(exif_tagname) { @@ -2713,7 +2712,7 @@ // JPEG does not use absolute pointers instead its pointers are relative to the start // of the TIFF header in APP1 section. */ - if (offset_val<0 || offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM)) { + if (offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM)) { if (value_ptr < dir_entry) { /* we can read this if offset_val > 0 */ /* some files have their values in other parts of the file */ @@ -3113,7 +3112,7 @@ { int section, sn; int marker = 0, last_marker = M_PSEUDO, comment_correction=1; - int ll, lh; + unsigned int ll, lh; uchar *Data; size_t fpos, size, got, itemlen; jpeg_sof_info sof_info; @@ -3176,7 +3175,7 @@ Data[0] = (uchar)lh; Data[1] = (uchar)ll; - got = php_stream_read(ImageInfo->infile, Data+2, itemlen-2); /* Read the whole section. */ + got = php_stream_read(ImageInfo->infile, (char*)(Data+2), itemlen-2); /* Read the whole section. */ if (got != itemlen-2) { exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_WARNING, "error reading from file: got=x%04X(=%d) != itemlen-2=x%04X(=%d)", got, got, itemlen-2, itemlen-2); return FALSE; @@ -3194,7 +3193,7 @@ size = ImageInfo->FileSize - fpos; sn = exif_file_sections_add(ImageInfo, M_PSEUDO, size, NULL); Data = ImageInfo->file.list[sn].data; - got = php_stream_read(ImageInfo->infile, Data, size); + got = php_stream_read(ImageInfo->infile, (char*)Data, size); if (got != size) { EXIF_ERRLOG_FILEEOF return FALSE; @@ -3265,7 +3264,7 @@ * scan JPEG in thumbnail (memory) */ static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC) { - uchar c, *data = ImageInfo->Thumbnail.data; + uchar c, *data = (uchar*)ImageInfo->Thumbnail.data; int n, marker; size_t length=2, pos=0; jpeg_sof_info sof_info; @@ -3362,7 +3361,7 @@ exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, 2); #endif php_stream_seek(ImageInfo->infile, dir_offset, SEEK_SET); /* we do not know the order of sections */ - php_stream_read(ImageInfo->infile, ImageInfo->file.list[sn].data, 2); + php_stream_read(ImageInfo->infile, (char*)ImageInfo->file.list[sn].data, 2); num_entries = php_ifd_get16u(ImageInfo->file.list[sn].data, ImageInfo->motorola_intel); dir_size = 2/*num dir entries*/ +12/*length of entry*/*num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/; if (ImageInfo->FileSize >= dir_offset+dir_size) { @@ -3372,8 +3371,8 @@ if (exif_file_sections_realloc(ImageInfo, sn, dir_size TSRMLS_CC)) { return FALSE; } - php_stream_read(ImageInfo->infile, ImageInfo->file.list[sn].data+2, dir_size-2); - /*exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "Dump: %s", exif_char_dump(ImageInfo->file.list[sn].data, dir_size, 0));*/ + php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+2), dir_size-2); + /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Dump: %s", exif_char_dump(ImageInfo->file.list[sn].data, dir_size, 0));*/ next_offset = php_ifd_get32u(ImageInfo->file.list[sn].data + dir_size - 4, ImageInfo->motorola_intel); #ifdef EXIF_DEBUG exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "read from TIFF done, next offset x%04X", next_offset); @@ -3461,7 +3460,7 @@ #ifdef EXIF_DEBUG exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "read from TIFF: filesize(x%04X), IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size); #endif - php_stream_read(ImageInfo->infile, ImageInfo->file.list[sn].data+dir_size, ifd_size-dir_size); + php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+dir_size), ifd_size-dir_size); #ifdef EXIF_DEBUG exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "read from TIFF, done"); #endif @@ -3524,8 +3523,8 @@ exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "next IFD: %s done", exif_get_sectionname(sub_section_index)); #endif } else { - if (!exif_process_IFD_TAG(ImageInfo, dir_entry, - ImageInfo->file.list[sn].data-dir_offset, + if (!exif_process_IFD_TAG(ImageInfo, (char*)dir_entry, + (char*)(ImageInfo->file.list[sn].data-dir_offset), ifd_size, 0, section_index, 0, tag_table TSRMLS_CC)) { return FALSE; } @@ -3582,7 +3581,7 @@ if (ImageInfo->FileSize >= 2) { php_stream_seek(ImageInfo->infile, 0, SEEK_SET); - php_stream_read(ImageInfo->infile, file_header, 2); + php_stream_read(ImageInfo->infile, (char*)file_header, 2); if ((file_header[0]==0xff) && (file_header[1]==M_SOI)) { ImageInfo->FileType = IMAGE_FILETYPE_JPEG; if (exif_scan_JPEG_header(ImageInfo TSRMLS_CC)) { @@ -3722,7 +3721,7 @@ } /* }}} */ -/* {{{ proto array|false exif_read_data(string filename [, sections_needed [, sub_arrays[, read_thumbnail]]]) +/* {{{ proto array exif_read_data(string filename [, sections_needed [, sub_arrays[, read_thumbnail]]]) Reads header data from the JPEG/TIFF image filename and optionally reads the internal thumbnails */ PHP_FUNCTION(exif_read_data) { @@ -3915,7 +3914,7 @@ } /* }}} */ -/* {{{ proto string|false exif_thumbnail(string filename [, &width, &height [, &imagetype]]) +/* {{{ proto string exif_thumbnail(string filename [, &width, &height [, &imagetype]]) Reads the embedded thumbnail */ PHP_FUNCTION(exif_thumbnail) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php