mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Added a typecast in png_get_int_32() to avoid compiler warning.
This commit is contained in:
parent
1e7d7d3cbf
commit
53c7502663
3
ANNOUNCE
3
ANNOUNCE
@ -307,8 +307,11 @@ version 1.5.0beta36 [July 29, 2010]
|
|||||||
converting the values to the fixed point form used in the PNG file.
|
converting the values to the fixed point form used in the PNG file.
|
||||||
The standard headers no longer include zlib.h, which is currently only
|
The standard headers no longer include zlib.h, which is currently only
|
||||||
required for pngstruct.h and can therefore be internal.
|
required for pngstruct.h and can therefore be internal.
|
||||||
|
Revised png_get_int_32 to undo the PNG two's complement representation of
|
||||||
|
negative numbers.
|
||||||
|
|
||||||
version 1.5.0beta37 [July 30, 2010]
|
version 1.5.0beta37 [July 30, 2010]
|
||||||
|
Added a typecast in png_get_int_32() to avoid compiler warning.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
3
CHANGES
3
CHANGES
@ -2789,8 +2789,11 @@ version 1.5.0beta36 [July 29, 2010]
|
|||||||
converting the values to the fixed point form used in the PNG file.
|
converting the values to the fixed point form used in the PNG file.
|
||||||
The standard headers no longer include zlib.h, which is currently only
|
The standard headers no longer include zlib.h, which is currently only
|
||||||
required for pngstruct.h and can therefore be internal.
|
required for pngstruct.h and can therefore be internal.
|
||||||
|
Revised png_get_int_32 to undo the PNG two's complement representation of
|
||||||
|
negative numbers.
|
||||||
|
|
||||||
version 1.5.0beta37 [July 30, 2010]
|
version 1.5.0beta37 [July 30, 2010]
|
||||||
|
Added a typecast in png_get_int_32() to avoid compiler warning.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
@ -77,11 +77,11 @@ png_int_32 (PNGAPI
|
|||||||
png_get_int_32)(png_bytep buf)
|
png_get_int_32)(png_bytep buf)
|
||||||
{
|
{
|
||||||
png_uint_32 u = png_get_uint_32(buf);
|
png_uint_32 u = png_get_uint_32(buf);
|
||||||
if ((u & 0x80000000) == 0) /* negative */
|
if ((u & 0x80000000) == 0) /* non-negative */
|
||||||
return u;
|
return u;
|
||||||
|
|
||||||
u = (u ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */
|
u = (u ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */
|
||||||
return -u;
|
return -(png_int_32)u;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Grab an unsigned 16-bit integer from a buffer in big-endian format. */
|
/* Grab an unsigned 16-bit integer from a buffer in big-endian format. */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user