diff --git a/ANNOUNCE b/ANNOUNCE index 1a78be98a..331a97221 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -358,6 +358,8 @@ version 1.5.0beta43 [August 11, 2010] Made changes to address various issues identified by GCC, mostly signed/unsigned and shortening problems on assignment but also a few difficult to optimize (for GCC) loops. + Fixed non-GCC fixed point builds. In png.c a declaration was misplaced + in an earlier update. Fixed to declare the auto variables at the head. Send comments/corrections/commendations to png-mng-implement at lists.sf.net: (subscription required; visit diff --git a/CHANGES b/CHANGES index 4d03cbca1..6a8fa8239 100644 --- a/CHANGES +++ b/CHANGES @@ -2994,6 +2994,8 @@ Version 1.5.0beta43 [August 11, 2010] Made changes to address various issues identified by GCC, mostly signed/unsigned and shortening problems on assignment but also a few difficult to optimize (for GCC) loops. + Fixed non-GCC fixed point builds. In png.c a declaration was misplaced + in an earlier update. Fixed to declare the auto variables at the head. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/png.c b/png.c index f6623d02b..0776bf966 100644 --- a/png.c +++ b/png.c @@ -1509,6 +1509,7 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times, #else int negative = 0; png_uint_32 A, T, D; + png_uint_32 s16, s32, s00; if (a < 0) negative = 1, A = -a; @@ -1528,13 +1529,13 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times, /* Following can't overflow because the arguments only * have 31 bits each, however the result may be 32 bits. */ - png_uint_32 s16 = (A >> 16) * (T & 0xffff) + + s16 = (A >> 16) * (T & 0xffff) + (A & 0xffff) * (T >> 16); /* Can't overflow because the a*times bit is only 30 * bits at most. */ - png_uint_32 s32 = (A >> 16) * (T >> 16) + (s16 >> 16); - png_uint_32 s00 = (A & 0xffff) * (T & 0xffff); + s32 = (A >> 16) * (T >> 16) + (s16 >> 16); + s00 = (A & 0xffff) * (T & 0xffff); s16 = (s16 & 0xffff) << 16; s00 += s16;