summaryrefslogtreecommitdiff
path: root/png.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2014-03-08 12:39:52 -0600
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2014-03-08 12:39:52 -0600
commit05670156f3d7c7d19f16912267ddfaf5e82c43ce (patch)
tree503415261cd8d06f16b3efe5bc3235962f95e0ff /png.c
parentb65b3412b19b481378de69bb4a8da701c3307b41 (diff)
downloadlibpng-05670156f3d7c7d19f16912267ddfaf5e82c43ce.tar.gz
[libpng16] Use "if (value != 0)" instead of "if (value)" consistently.
Diffstat (limited to 'png.c')
-rw-r--r--png.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/png.c b/png.c
index 85b2477a3..c8dc69b98 100644
--- a/png.c
+++ b/png.c
@@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
- * Last changed in libpng 1.6.9 [February 6, 2014]
+ * Last changed in libpng 1.6.11 [(PENDING RELEASE)]
* Copyright (c) 1998-2014 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.)
@@ -165,7 +165,7 @@ png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length)
int
png_user_version_check(png_structrp png_ptr, png_const_charp user_png_ver)
{
- if (user_png_ver)
+ if (user_png_ver != NULL)
{
int i = 0;
@@ -773,13 +773,13 @@ png_get_copyright(png_const_structrp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
- "libpng version 1.6.11beta01 - March 7, 2014" PNG_STRING_NEWLINE \
+ "libpng version 1.6.11beta01 - March 8, 2014" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2014 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.6.11beta01 - March 7, 2014\
+ return "libpng version 1.6.11beta01 - March 8, 2014\
Copyright (c) 1998-2014 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -1558,10 +1558,10 @@ png_colorspace_check_xy(png_XYZ *XYZ, const png_xy *xy)
/* As a side-effect this routine also returns the XYZ endpoints. */
result = png_XYZ_from_xy(XYZ, xy);
- if (result) return result;
+ if (result != 0) return result;
result = png_xy_from_XYZ(&xy_test, XYZ);
- if (result) return result;
+ if (result != 0) return result;
if (png_colorspace_endpoints_match(xy, &xy_test,
5/*actually, the math is pretty accurate*/))
@@ -1581,10 +1581,10 @@ png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ)
png_XYZ XYZtemp;
result = png_XYZ_normalize(XYZ);
- if (result) return result;
+ if (result != 0) return result;
result = png_xy_from_XYZ(xy, XYZ);
- if (result) return result;
+ if (result != 0) return result;
XYZtemp = *XYZ;
return png_colorspace_check_xy(&XYZtemp, xy);
@@ -1625,7 +1625,7 @@ png_colorspace_set_xy_and_XYZ(png_const_structrp png_ptr,
}
/* Only overwrite with preferred values */
- if (!preferred)
+ if (preferred == 0)
return 1; /* ok, but no change */
}
@@ -2738,7 +2738,7 @@ png_pow10(int power)
}
while (power > 0);
- if (recip) d = 1/d;
+ if (recip != 0) d = 1/d;
}
/* else power is 0 and d is 1 */
@@ -3261,7 +3261,7 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
if (s00 >= (D >> 1))
++result;
- if (negative)
+ if (negative != 0)
result = -result;
/* Check for overflow. */
@@ -3788,7 +3788,7 @@ png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable,
double d = floor(65535*pow(ig/(double)max, gamma_val*.00001)+.5);
sub_table[j] = (png_uint_16)d;
# else
- if (shift)
+ if (shift != 0)
ig = (ig * 65535U + max_by_2)/max;
sub_table[j] = png_gamma_16bit_correct(ig, gamma_val);
@@ -3804,7 +3804,7 @@ png_build_16bit_table(png_structrp png_ptr, png_uint_16pp *ptable,
{
png_uint_32 ig = (j << (8-shift)) + i;
- if (shift)
+ if (shift != 0)
ig = (ig * 65535U + max_by_2)/max;
sub_table[j] = (png_uint_16)ig;