summaryrefslogtreecommitdiff
path: root/plugins/AdvaImg/src/LibPNG/png.c
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-01-03 14:34:48 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-01-03 14:34:48 +0000
commiteb680766d56e815086397361b286fd8055fb5377 (patch)
tree7994cdb0d9077f645ba7fd06bdd2cde32cf599d4 /plugins/AdvaImg/src/LibPNG/png.c
parentec61686c3d96f49eb7f40a4208690a0781d63e29 (diff)
FreeImage updated to 3.15.4
removed not used formats git-svn-id: http://svn.miranda-ng.org/main/trunk@2926 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AdvaImg/src/LibPNG/png.c')
-rw-r--r--plugins/AdvaImg/src/LibPNG/png.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/plugins/AdvaImg/src/LibPNG/png.c b/plugins/AdvaImg/src/LibPNG/png.c
index 0df53a62af..55fbc8fcc1 100644
--- a/plugins/AdvaImg/src/LibPNG/png.c
+++ b/plugins/AdvaImg/src/LibPNG/png.c
@@ -1,8 +1,8 @@
/* png.c - location for general purpose libpng functions
*
- * Last changed in libpng 1.5.7 [December 15, 2011]
- * Copyright (c) 1998-2011 Glenn Randers-Pehrson
+ * Last changed in libpng 1.5.11 [June 14, 2012]
+ * Copyright (c) 1998-2012 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -14,7 +14,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_5_9 Your_png_h_is_not_version_1_5_9;
+typedef png_libpng_version_1_5_13 Your_png_h_is_not_version_1_5_13;
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@@ -655,14 +655,14 @@ png_get_copyright(png_const_structp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
- "libpng version 1.5.9 - February 18, 2012" PNG_STRING_NEWLINE \
- "Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
+ "libpng version 1.5.13 - September 27, 2012" PNG_STRING_NEWLINE \
+ "Copyright (c) 1998-2012 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
- return "libpng version 1.5.9 - February 18, 2012\
- Copyright (c) 1998-2011 Glenn Randers-Pehrson\
+ return "libpng version 1.5.13 - September 27, 2012\
+ Copyright (c) 1998-2012 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
# endif
@@ -969,8 +969,8 @@ int png_XYZ_from_xy(png_XYZ *XYZ, png_xy xy)
* and it is certain that it becomes unstable where the end points are close
* together.
*
- * So this code uses the perhaps slighly less optimal but more understandable
- * and totally obvious approach of calculating color-scale.
+ * So this code uses the perhaps slightly less optimal but more
+ * understandable and totally obvious approach of calculating color-scale.
*
* This algorithm depends on the precision in white-scale and that is
* (1/white-y), so we can immediately see that as white-y approaches 0 the
@@ -1035,13 +1035,13 @@ int png_XYZ_from_xy(png_XYZ *XYZ, png_xy xy)
*
* red-scale =
* ( (green-x - blue-x) * (white-y - blue-y) -
- * (green-y - blue-y) * (white-x - blue-x)) / white-y
+ * (green-y - blue-y) * (white-x - blue-x) ) / white-y
* -------------------------------------------------------------------------
* (green-x - blue-x)*(red-y - blue-y)-(green-y - blue-y)*(red-x - blue-x)
*
* green-scale =
* ( (red-y - blue-y) * (white-x - blue-x) -
- * (red-x - blue-x) * (white-y - blue-y)) / white-y
+ * (red-x - blue-x) * (white-y - blue-y) ) / white-y
* -------------------------------------------------------------------------
* (green-x - blue-x)*(red-y - blue-y)-(green-y - blue-y)*(red-x - blue-x)
*
@@ -1467,7 +1467,7 @@ static double
png_pow10(int power)
{
int recip = 0;
- double d = 1;
+ double d = 1.0;
/* Handle negative exponent with a reciprocal at the end because
* 10 is exact whereas .1 is inexact in base 2
@@ -1481,7 +1481,7 @@ png_pow10(int power)
if (power > 0)
{
/* Decompose power bitwise. */
- double mult = 10;
+ double mult = 10.0;
do
{
if (power & 1) d *= mult;
@@ -1600,7 +1600,8 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
{
double d;
- fp *= 10;
+ fp *= 10.0;
+
/* Use modf here, not floor and subtract, so that
* the separation is done in one step. At the end
* of the loop don't break the number into parts so
@@ -1613,7 +1614,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
{
d = floor(fp + .5);
- if (d > 9)
+ if (d > 9.0)
{
/* Rounding up to 10, handle that here. */
if (czero > 0)
@@ -1621,9 +1622,10 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
--czero, d = 1;
if (cdigits == 0) --clead;
}
+
else
{
- while (cdigits > 0 && d > 9)
+ while (cdigits > 0 && d > 9.0)
{
int ch = *--ascii;
@@ -1648,7 +1650,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
* exponent but take into account the leading
* decimal point.
*/
- if (d > 9) /* cdigits == 0 */
+ if (d > 9.0) /* cdigits == 0 */
{
if (exp_b10 == (-1))
{
@@ -1669,18 +1671,19 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
++exp_b10;
/* In all cases we output a '1' */
- d = 1;
+ d = 1.0;
}
}
}
fp = 0; /* Guarantees termination below. */
}
- if (d == 0)
+ if (d == 0.0)
{
++czero;
if (cdigits == 0) ++clead;
}
+
else
{
/* Included embedded zeros in the digit count. */
@@ -1708,6 +1711,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
above */
--exp_b10;
}
+
*ascii++ = (char)(48 + (int)d), ++cdigits;
}
}
@@ -2040,7 +2044,7 @@ png_muldiv_warn(png_structp png_ptr, png_fixed_point a, png_int_32 times,
}
#endif
-#ifdef PNG_READ_GAMMA_SUPPORTED /* more fixed point functions for gammma */
+#ifdef PNG_READ_GAMMA_SUPPORTED /* more fixed point functions for gamma */
/* Calculate a reciprocal, return 0 on div-by-zero or overflow. */
png_fixed_point
png_reciprocal(png_fixed_point a)