mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[master] Reverted png_get_uint_16 macro to beta05 and added a
comment about the potential API incompatibility.
This commit is contained in:
parent
ff244b6181
commit
e2d740ae04
2
ANNOUNCE
2
ANNOUNCE
@ -71,6 +71,8 @@ version 1.4.5beta06 [November 21, 2010]
|
||||
compression both fail to declare their input buffers with 'const'.
|
||||
|
||||
version 1.4.5beta07 [November 24, 2010]
|
||||
Reverted png_get_uint_16 macro to beta05 and added comment about the
|
||||
potential API incompatibility.
|
||||
|
||||
Send comments/corrections/commendations to glennrp at users.sourceforge.net
|
||||
or to png-mng-implement at lists.sf.net (subscription required; visit
|
||||
|
||||
2
CHANGES
2
CHANGES
@ -2723,6 +2723,8 @@ version 1.4.5beta06 [November 21, 2010]
|
||||
compression both fail to declare their input buffers with 'const'.
|
||||
|
||||
version 1.4.5beta07 [November 24, 2010]
|
||||
Reverted png_get_uint_16 macro to beta05 and added comment about the
|
||||
potential API incompatibility.
|
||||
|
||||
Send comments/corrections/commendations to glennrp at users.sourceforge.net
|
||||
or to png-mng-implement at lists.sf.net (subscription required; visit
|
||||
|
||||
26
png.h
26
png.h
@ -2649,17 +2649,21 @@ PNG_EXPORT(png_bytep,png_get_io_chunk_name)
|
||||
((png_uint_32)(*((buf) + 1)) << 16) + \
|
||||
((png_uint_32)(*((buf) + 2)) << 8) + \
|
||||
((png_uint_32)(*((buf) + 3))))
|
||||
# ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED /* Undefined in 1.4.x by default. */
|
||||
# define png_get_uint_16(buf) \
|
||||
((png_uint_16) \
|
||||
(((unsigned int)(*(buf)) << 8) + \
|
||||
((unsigned int)(*((buf) + 1)))))
|
||||
# else
|
||||
# define png_get_uint_16(buf) \
|
||||
((png_uint_32) \
|
||||
(((unsigned int)(*(buf)) << 8) + \
|
||||
((unsigned int)(*((buf) + 1)))))
|
||||
# endif
|
||||
|
||||
/* The following definition introduces an API incompatibility (but not
|
||||
* an ABI incompatibility) with libpng-1.4.0 through 1.4.4. Prior to
|
||||
* libpng-1.4.5 the macro, which is used by default, returned (incorrectly)
|
||||
* a (png_uint_32), while the function, if used instead, correctly returned
|
||||
* a (png_uint_16).
|
||||
*
|
||||
* Libpng versions 1.0.x and 1.2.x only used a function so are not affected
|
||||
* by this potential API incompatibility between macros.
|
||||
*/
|
||||
# define png_get_uint_16(buf) \
|
||||
((png_uint_16) \
|
||||
(((unsigned int)(*(buf)) << 8) + \
|
||||
((unsigned int)(*((buf) + 1)))))
|
||||
|
||||
# define png_get_int_32(buf) \
|
||||
((png_int_32)((*(buf) & 0x80) \
|
||||
? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user