From a518abd5826980ed79390f8af5d74747cad332da Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Mon, 17 Mar 2014 15:29:25 -0500 Subject: [PATCH] [libpng16] Removed #if/#else/#endif from inside two pow() calls in pngvalid.c because they were handled improperly by Portland Group's PGI-14.1 - PGI-14.3 when using its "__builtin_pow()" function. --- ANNOUNCE | 3 +++ CHANGES | 3 +++ contrib/libtests/pngvalid.c | 15 ++++++--------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index c306a317d..5243ea5f8 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -32,6 +32,9 @@ Version 1.6.11beta01 [March 17, 2014] Moved configuration information from the manual to the INSTALL file. Version 1.6.11beta02 [March 17, 2014] + Removed #if/#else/#endif from inside two pow() calls in pngvalid.c because + they were handled improperly by Portland Group's PGI-14.1 - PGI-14.3 + when using its "__builtin_pow()" function. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 6895f2758..44a5da15d 100644 --- a/CHANGES +++ b/CHANGES @@ -4881,6 +4881,9 @@ Version 1.6.11beta01 [March 17, 2014] Moved configuration information from the manual to the INSTALL file. Version 1.6.11beta02 [March 17, 2014] + Removed #if/#else/#endif from inside two pow() calls in pngvalid.c because + they were handled improperly by Portland Group's PGI-14.1 - PGI-14.3 + when using its "__builtin_pow()" function. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index 788b69327..622bdeb7a 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -6776,14 +6776,13 @@ image_transform_png_set_rgb_to_gray_ini(PNG_CONST image_transform *this, * conversion adds another +/-2 in the 16-bit case and * +/-(1<<(15-PNG_MAX_GAMMA_8)) in the 8-bit case. */ - that->pm->limit += pow( # if PNG_MAX_GAMMA_8 < 14 - (that->this.bit_depth == 16 ? 8. : - 6. + (1<<(15-PNG_MAX_GAMMA_8))) + that->pm->limit += pow((that->this.bit_depth == 16 ? 8. : + 6. + (1<<(15-PNG_MAX_GAMMA_8)))/65535, data.gamma); # else - 8. + that->pm->limit += pow((that->this.bit_depth == 16 ? 8. : + 8. + (1<<(15-PNG_MAX_GAMMA_8)))/65535, data.gamma); # endif - /65535, data.gamma); } else @@ -6801,13 +6800,11 @@ image_transform_png_set_rgb_to_gray_ini(PNG_CONST image_transform *this, * internal calculation errors, not the actual limit imposed by * pngvalid on the output errors. */ - that->pm->limit += pow( # if DIGITIZE - 1.1 + that->pm->limit += pow(1.1 /255, data.gamma); # else - 1. + that->pm->limit += pow(1.0 /255, data.gamma); # endif - /255, data.gamma); } }