From 236e10517025b4fb47814682306ccf7e92990509 Mon Sep 17 00:00:00 2001 From: John Bowler Date: Fri, 4 Oct 2013 20:28:33 -0500 Subject: [PATCH] [libpng16] Simplified error message code in pngunknown. The simplification has the useful side effect of avoiding a bogus warning generated by the latest version of the Intel C compiler (it objects to condition ? string-literal : string-literal). --- ANNOUNCE | 4 ++++ CHANGES | 4 ++++ contrib/libtests/pngunknown.c | 10 ++-------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index d860a9b50..f85824a40 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -65,6 +65,10 @@ Version 1.6.7beta02 [October 5, 2013] Cleaned up (char*) casts of zlib messages. The latest version of the Intel C compiler complains about casting a string literal as (char*), so copied the treatment of z_const from the library code into pngfix.c + Simplified error message code in pngunknown. The simplification has the + useful side effect of avoiding a bogus warning generated by the latest + version of the Intel C compiler (it objects to + condition ? string-literal : string-literal). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 1d371c9b1..07449bc19 100644 --- a/CHANGES +++ b/CHANGES @@ -4679,6 +4679,10 @@ Version 1.6.7beta02 [October 5, 2013] Cleaned up (char*) casts of zlib messages. The latest version of the Intel C compiler complains about casting a string literal as (char*), so copied the treatment of z_const from the library code into pngfix.c + Simplified error message code in pngunknown. The simplification has the + useful side effect of avoiding a bogus warning generated by the latest + version of the Intel C compiler (it objects to + condition ? string-literal : string-literal). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/contrib/libtests/pngunknown.c b/contrib/libtests/pngunknown.c index 8a9862ba8..a21c9d75d 100644 --- a/contrib/libtests/pngunknown.c +++ b/contrib/libtests/pngunknown.c @@ -866,13 +866,6 @@ check_handling(display *d, int def, png_uint_32 chunks, png_uint_32 known, const char *type; const char *errorx = NULL; -# ifdef PNG_READ_USER_CHUNKS_SUPPORTED - const char *callback = (set_callback ? ",callback" : ""); -# else -# define callback "" - UNUSED(set_callback) -# endif - if (chunk_info[i].unknown) { if (keep == PNG_HANDLE_CHUNK_AS_DEFAULT) @@ -970,7 +963,8 @@ check_handling(display *d, int def, png_uint_32 chunks, png_uint_32 known, if (errorx != NULL) { ++(d->error_count); - fprintf(stderr, "%s(%s%s): %s %s %s: %s\n", d->file, d->test, callback, + fprintf(stderr, "%s(%s%s): %s %s %s: %s\n", d->file, d->test, + set_callback ? ",callback" : "", type, chunk_info[i].name, position, errorx); }