[libpng15] Fixed 64-bit compilation errors (gcc). The errors fixed relate

to conditions where types that are 32 bits in the GCC 32-bit
world (uLong and png_size_t) become 64 bits in the 64-bit
world.  This produces potential truncation errors which the
compiler correctly flags.
This commit is contained in:
John Bowler
2011-09-09 07:32:37 -05:00
committed by Glenn Randers-Pehrson
parent 3c2ae60f46
commit f3f7e14727
9 changed files with 83 additions and 45 deletions

View File

@@ -87,10 +87,10 @@ png_int_32 (PNGAPI
png_get_int_32)(png_const_bytep buf)
{
png_uint_32 uval = png_get_uint_32(buf);
if ((uval & 0x80000000L) == 0) /* non-negative */
if ((uval & 0x80000000) == 0) /* non-negative */
return uval;
uval = (uval ^ 0xffffffffL) + 1; /* 2's complement: -x = ~x+1 */
uval = (uval ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */
return -(png_int_32)uval;
}