From: Dan Fandrich Date: Wed, 13 Jun 2018 19:45:02 +0000 (+0200) Subject: Fixed a number of compile warnings from gcc 7.3 X-Git-Tag: libexif-0_6_22-release~108 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed4baa0954a264d2cf9f95afe7b9b9a08d2ffdd3;p=platform%2Fupstream%2Flibexif.git Fixed a number of compile warnings from gcc 7.3 --- diff --git a/contrib/examples/write-exif.c b/contrib/examples/write-exif.c index 894cdb6..bae2786 100644 --- a/contrib/examples/write-exif.c +++ b/contrib/examples/write-exif.c @@ -193,7 +193,7 @@ static ExifEntry *create_tag(ExifData *exif, ExifIfd ifd, ExifTag tag, size_t le return entry; } -int main(int argc, char **argv) +int main () { int rc = 1; FILE *f; diff --git a/libexif/canon/exif-mnote-data-canon.c b/libexif/canon/exif-mnote-data-canon.c index c523b9d..ccaeb6a 100644 --- a/libexif/canon/exif-mnote-data-canon.c +++ b/libexif/canon/exif-mnote-data-canon.c @@ -350,6 +350,8 @@ int exif_mnote_data_canon_identify (const ExifData *ed, const ExifEntry *e) { char value[8]; + + (void) e; /* unused */ ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE); if (!em) return 0; diff --git a/libexif/exif-entry.c b/libexif/exif-entry.c index 7edd130..2866223 100644 --- a/libexif/exif-entry.c +++ b/libexif/exif-entry.c @@ -985,8 +985,8 @@ exif_entry_get_value (ExifEntry *e, char *val, unsigned int maxlen) if (e->size && e->data) { const unsigned char *tagdata = memchr(e->data, 0, e->size); if (tagdata++) { - int editor_ofs = tagdata - e->data; - int remaining = e->size - editor_ofs; + unsigned int editor_ofs = tagdata - e->data; + unsigned int remaining = e->size - editor_ofs; if (match_repeated_char(tagdata, ' ', remaining)) { strncat (val, (const char*)tagdata, MIN (maxlen-1 - strlen (val), remaining)); ++k; diff --git a/libexif/exif-tag.c b/libexif/exif-tag.c index 0948a80..aab1543 100644 --- a/libexif/exif-tag.c +++ b/libexif/exif-tag.c @@ -36,7 +36,9 @@ #define ESL_NNMM { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY } #define ESL_NNNM { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_MANDATORY } #define ESL_NNNO { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_OPTIONAL } +#define ESL_UUUU { EXIF_SUPPORT_LEVEL_UNKNOWN, EXIF_SUPPORT_LEVEL_UNKNOWN, EXIF_SUPPORT_LEVEL_UNKNOWN, EXIF_SUPPORT_LEVEL_UNKNOWN } #define ESL_GPS { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN } +#define ESL_UNKNOWN { ESL_UUUU, ESL_UUUU, ESL_UUUU, ESL_UUUU, ESL_UUUU } /*! * Table giving information about each EXIF tag. @@ -218,7 +220,8 @@ static const struct TagEntry { /* Not in EXIF 2.2 */ {EXIF_TAG_NEW_SUBFILE_TYPE, "NewSubfileType", N_("New Subfile Type"), N_("A general indication of the kind of data " - "contained in this subfile.")}, + "contained in this subfile."), + ESL_UNKNOWN}, {EXIF_TAG_IMAGE_WIDTH, "ImageWidth", N_("Image Width"), N_("The number of columns of image data, equal to the number of " "pixels per row. In JPEG compressed data a JPEG marker is " @@ -246,9 +249,10 @@ static const struct TagEntry { "marker is used instead of this tag."), { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, /* Not in EXIF 2.2 */ - {EXIF_TAG_FILL_ORDER, "FillOrder", N_("Fill Order"), ""}, + {EXIF_TAG_FILL_ORDER, "FillOrder", N_("Fill Order"), "", ESL_UNKNOWN}, /* Not in EXIF 2.2 */ - {EXIF_TAG_DOCUMENT_NAME, "DocumentName", N_("Document Name"), ""}, + {EXIF_TAG_DOCUMENT_NAME, "DocumentName", N_("Document Name"), "", + ESL_UNKNOWN}, {EXIF_TAG_IMAGE_DESCRIPTION, "ImageDescription", N_("Image Description"), N_("A character string giving the title of the image. It may be " @@ -357,11 +361,12 @@ static const struct TagEntry { { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, /* Not in EXIF 2.2 */ {EXIF_TAG_SUB_IFDS, "SubIFDs", "SubIFD Offsets", N_("Defined by Adobe Corporation " - "to enable TIFF Trees within a TIFF file.")}, + "to enable TIFF Trees within a TIFF file."), ESL_UNKNOWN}, /* Not in EXIF 2.2 */ - {EXIF_TAG_TRANSFER_RANGE, "TransferRange", N_("Transfer Range"), ""}, + {EXIF_TAG_TRANSFER_RANGE, "TransferRange", N_("Transfer Range"), "", + ESL_UNKNOWN}, /* Not in EXIF 2.2 */ - {EXIF_TAG_JPEG_PROC, "JPEGProc", "JPEGProc", ""}, + {EXIF_TAG_JPEG_PROC, "JPEGProc", "JPEGProc", "", ESL_UNKNOWN}, {EXIF_TAG_JPEG_INTERCHANGE_FORMAT, "JPEGInterchangeFormat", N_("JPEG Interchange Format"), N_("The offset to the start byte (SOI) of JPEG compressed " @@ -420,27 +425,29 @@ static const struct TagEntry { "Interoperability these conditions."), { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, /* Not in EXIF 2.2 */ - {EXIF_TAG_XML_PACKET, "XMLPacket", N_("XML Packet"), N_("XMP Metadata")}, + {EXIF_TAG_XML_PACKET, "XMLPacket", N_("XML Packet"), N_("XMP Metadata"), + ESL_UNKNOWN}, /* Not in EXIF 2.2 */ {EXIF_TAG_RELATED_IMAGE_FILE_FORMAT, "RelatedImageFileFormat", - "RelatedImageFileFormat", ""}, + "RelatedImageFileFormat", "", ESL_UNKNOWN}, /* Not in EXIF 2.2 */ {EXIF_TAG_RELATED_IMAGE_WIDTH, "RelatedImageWidth", - "RelatedImageWidth", ""}, + "RelatedImageWidth", "", ESL_UNKNOWN}, /* Not in EXIF 2.2 */ {EXIF_TAG_RELATED_IMAGE_LENGTH, "RelatedImageLength", - "RelatedImageLength", ""}, + "RelatedImageLength", "", ESL_UNKNOWN}, /* Not in EXIF 2.2 */ {EXIF_TAG_CFA_REPEAT_PATTERN_DIM, "CFARepeatPatternDim", - "CFARepeatPatternDim", ""}, + "CFARepeatPatternDim", "", ESL_UNKNOWN}, /* Not in EXIF 2.2 */ {EXIF_TAG_CFA_PATTERN, "CFAPattern", N_("CFA Pattern"), N_("Indicates the color filter array (CFA) geometric pattern of the " "image sensor when a one-chip color area sensor is used. " - "It does not apply to all sensing methods.")}, + "It does not apply to all sensing methods."), ESL_UNKNOWN}, /* Not in EXIF 2.2 */ - {EXIF_TAG_BATTERY_LEVEL, "BatteryLevel", N_("Battery Level"), ""}, + {EXIF_TAG_BATTERY_LEVEL, "BatteryLevel", N_("Battery Level"), "", + ESL_UNKNOWN}, {EXIF_TAG_COPYRIGHT, "Copyright", N_("Copyright"), N_("Copyright information. In this standard the tag is used to " "indicate both the photographer and editor copyrights. It is " @@ -470,9 +477,10 @@ static const struct TagEntry { N_("The F number."), { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, /* Not in EXIF 2.2 */ - {EXIF_TAG_IPTC_NAA, "IPTC/NAA", "IPTC/NAA", ""}, + {EXIF_TAG_IPTC_NAA, "IPTC/NAA", "IPTC/NAA", "", ESL_UNKNOWN}, /* Not in EXIF 2.2 */ - {EXIF_TAG_IMAGE_RESOURCES, "ImageResources", N_("Image Resources Block"), ""}, + {EXIF_TAG_IMAGE_RESOURCES, "ImageResources", N_("Image Resources Block"), "", + ESL_UNKNOWN}, {EXIF_TAG_EXIF_IFD_POINTER, "ExifIfdPointer", "ExifIFDPointer", N_("A pointer to the Exif IFD. Interoperability, Exif IFD has the " "same structure as that of the IFD specified in TIFF. " @@ -481,7 +489,7 @@ static const struct TagEntry { { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, /* Not in EXIF 2.2 */ {EXIF_TAG_INTER_COLOR_PROFILE, "InterColorProfile", - "InterColorProfile", ""}, + "InterColorProfile", "", ESL_UNKNOWN}, {EXIF_TAG_EXPOSURE_PROGRAM, "ExposureProgram", N_("Exposure Program"), N_("The class of the program used by the camera to set exposure " "when the picture is taken."), @@ -511,7 +519,8 @@ static const struct TagEntry { { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, /* Not in EXIF 2.2 */ {EXIF_TAG_TIME_ZONE_OFFSET, "TimeZoneOffset", N_("Time Zone Offset"), - N_("Encodes time zone of camera clock relative to GMT.")}, + N_("Encodes time zone of camera clock relative to GMT."), + ESL_UNKNOWN}, {EXIF_TAG_EXIF_VERSION, "ExifVersion", N_("Exif Version"), N_("The version of this standard supported. Nonexistence of this " "field is taken to mean nonconformance to the standard."), @@ -587,7 +596,8 @@ static const struct TagEntry { "in the overall scene."), { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, /* Not in EXIF 2.2 */ - {EXIF_TAG_TIFF_EP_STANDARD_ID, "TIFF/EPStandardID", N_("TIFF/EP Standard ID"), ""}, + {EXIF_TAG_TIFF_EP_STANDARD_ID, "TIFF/EPStandardID", N_("TIFF/EP Standard ID"), "", + ESL_UNKNOWN}, {EXIF_TAG_MAKER_NOTE, "MakerNote", N_("Maker Note"), N_("A tag for manufacturers of Exif writers to record any desired " "information. The contents are up to the manufacturer."), @@ -855,10 +865,12 @@ static const struct TagEntry { { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, /* Not in EXIF 2.2 */ {EXIF_TAG_GAMMA, "Gamma", N_("Gamma"), - N_("Indicates the value of coefficient gamma.")}, + N_("Indicates the value of coefficient gamma."), + ESL_UNKNOWN}, /* Not in EXIF 2.2 */ {EXIF_TAG_PRINT_IMAGE_MATCHING, "PrintImageMatching", N_("PRINT Image Matching"), - N_("Related to Epson's PRINT Image Matching technology")}, + N_("Related to Epson's PRINT Image Matching technology"), + ESL_UNKNOWN}, /* Not in EXIF 2.2 (from the Microsoft HD Photo specification) */ {EXIF_TAG_PADDING, "Padding", N_("Padding"), N_("This tag reserves space that can be reclaimed later when " @@ -868,7 +880,7 @@ static const struct TagEntry { "metadata tags."), { ESL_OOOO, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, #endif - {0, NULL, NULL, NULL} + {0, NULL, NULL, NULL, ESL_UNKNOWN} }; /* For now, do not use these functions. */ diff --git a/libexif/fuji/exif-mnote-data-fuji.c b/libexif/fuji/exif-mnote-data-fuji.c index 7e37464..726a1d3 100644 --- a/libexif/fuji/exif-mnote-data-fuji.c +++ b/libexif/fuji/exif-mnote-data-fuji.c @@ -319,6 +319,7 @@ exif_mnote_data_fuji_set_offset (ExifMnoteData *n, unsigned int o) int exif_mnote_data_fuji_identify (const ExifData *ed, const ExifEntry *e) { + (void) ed; /* unused */ return ((e->size >= 12) && !memcmp (e->data, "FUJIFILM", 8)); } diff --git a/libexif/pentax/exif-mnote-data-pentax.c b/libexif/pentax/exif-mnote-data-pentax.c index e6d47b0..35e8647 100644 --- a/libexif/pentax/exif-mnote-data-pentax.c +++ b/libexif/pentax/exif-mnote-data-pentax.c @@ -402,6 +402,7 @@ exif_mnote_data_pentax_set_byte_order (ExifMnoteData *d, ExifByteOrder o) int exif_mnote_data_pentax_identify (const ExifData *ed, const ExifEntry *e) { + (void) ed; /* unused */ if ((e->size >= 8) && !memcmp (e->data, "AOC", 4)) { if (((e->data[4] == 'I') && (e->data[5] == 'I')) || ((e->data[4] == 'M') && (e->data[5] == 'M')))