[libpng16] Changed png_voidcast(), etc., to voidcast(), etc., in

contrib/tools/pngfix.c to avoid confusion with the libpng private macros.
This commit is contained in:
Glenn Randers-Pehrson 2015-05-30 22:57:33 -05:00
parent e6877671f1
commit b66de48b3b
3 changed files with 21 additions and 17 deletions

View File

@ -1,4 +1,4 @@
Libpng 1.6.18beta05 - May 30, 2015 Libpng 1.6.18beta05 - May 31, 2015
This is not intended to be a public release. It will be replaced This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version. within a few weeks by a public version or by another test version.
@ -54,9 +54,11 @@ Version 1.6.18beta04 [May 20, 2015]
Avoid a harmless potential integer overflow in png_XYZ_from_xy() (Bug Avoid a harmless potential integer overflow in png_XYZ_from_xy() (Bug
report from Christopher Ferris). report from Christopher Ferris).
Version 1.6.18beta05 [May 30, 2015] Version 1.6.18beta05 [May 31, 2015]
Backport filter selection code from libpng-1.7.0beta51, to combine Backport filter selection code from libpng-1.7.0beta51, to combine
sub_row, up_row, avg_row, and paeth_row into try_row and tst_row. sub_row, up_row, avg_row, and paeth_row into try_row and tst_row.
Changed png_voidcast(), etc., to voidcast(), etc., in contrib/tools/pngfix.c
to avoid confusion with the libpng private macros.
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

View File

@ -5239,9 +5239,11 @@ Version 1.6.18beta04 [May 20, 2015]
Avoid a harmless potential integer overflow in png_XYZ_from_xy() (Bug Avoid a harmless potential integer overflow in png_XYZ_from_xy() (Bug
report from Christopher Ferris). report from Christopher Ferris).
Version 1.6.18beta05 [May 30, 2015] Version 1.6.18beta05 [May 31, 2015]
Backport filter selection code from libpng-1.7.0beta51, to combine Backport filter selection code from libpng-1.7.0beta51, to combine
sub_row, up_row, avg_row, and paeth_row into try_row and tst_row. sub_row, up_row, avg_row, and paeth_row into try_row and tst_row.
Changed png_voidcast(), etc., to voidcast(), etc., in contrib/tools/pngfix.c
to avoid confusion with the libpng private macros.
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

View File

@ -71,8 +71,8 @@
* with older builds. * with older builds.
*/ */
#if ZLIB_VERNUM < 0x1260 #if ZLIB_VERNUM < 0x1260
# define PNGZ_MSG_CAST(s) png_constcast(char*,s) # define PNGZ_MSG_CAST(s) constcast(char*,s)
# define PNGZ_INPUT_CAST(b) png_constcast(png_bytep,b) # define PNGZ_INPUT_CAST(b) constcast(png_bytep,b)
#else #else
# define PNGZ_MSG_CAST(s) (s) # define PNGZ_MSG_CAST(s) (s)
# define PNGZ_INPUT_CAST(b) (b) # define PNGZ_INPUT_CAST(b) (b)
@ -86,17 +86,17 @@
/* Copied from pngpriv.h */ /* Copied from pngpriv.h */
#ifdef __cplusplus #ifdef __cplusplus
# define png_voidcast(type, value) static_cast<type>(value) # define voidcast(type, value) static_cast<type>(value)
# define png_constcast(type, value) const_cast<type>(value) # define constcast(type, value) const_cast<type>(value)
# define png_aligncast(type, value) \ # define aligncast(type, value) \
static_cast<type>(static_cast<void*>(value)) static_cast<type>(static_cast<void*>(value))
# define png_aligncastconst(type, value) \ # define aligncastconst(type, value) \
static_cast<type>(static_cast<const void*>(value)) static_cast<type>(static_cast<const void*>(value))
#else #else
# define png_voidcast(type, value) (value) # define voidcast(type, value) (value)
# define png_constcast(type, value) ((type)(value)) # define constcast(type, value) ((type)(value))
# define png_aligncast(type, value) ((void*)(value)) # define aligncast(type, value) ((void*)(value))
# define png_aligncastconst(type, value) ((const void*)(value)) # define aligncastconst(type, value) ((const void*)(value))
#endif /* __cplusplus */ #endif /* __cplusplus */
#if PNG_LIBPNG_VER < 10700 #if PNG_LIBPNG_VER < 10700
@ -446,7 +446,7 @@ static void
make_random_bytes(png_uint_32* seed, void* pv, size_t size) make_random_bytes(png_uint_32* seed, void* pv, size_t size)
{ {
png_uint_32 u0 = seed[0], u1 = seed[1]; png_uint_32 u0 = seed[0], u1 = seed[1];
png_bytep bytes = png_voidcast(png_bytep, pv); png_bytep bytes = voidcast(png_bytep, pv);
/* There are thirty-three bits; the next bit in the sequence is bit-33 XOR /* There are thirty-three bits; the next bit in the sequence is bit-33 XOR
* bit-20. The top 1 bit is in u1, the bottom 32 are in u0. * bit-20. The top 1 bit is in u1, the bottom 32 are in u0.
@ -668,7 +668,7 @@ IDAT_list_extend(struct IDAT_list *tail)
if (length < tail->length) /* arithmetic overflow */ if (length < tail->length) /* arithmetic overflow */
length = tail->length; length = tail->length;
next = png_voidcast(IDAT_list*, malloc(IDAT_list_size(NULL, length))); next = voidcast(IDAT_list*, malloc(IDAT_list_size(NULL, length)));
CLEAR(*next); CLEAR(*next);
/* The caller must handle this: */ /* The caller must handle this: */
@ -3535,7 +3535,7 @@ get_control(png_const_structrp png_ptr)
/* This just returns the (file*). The chunk and idat control structures /* This just returns the (file*). The chunk and idat control structures
* don't always exist. * don't always exist.
*/ */
struct control *control = png_voidcast(struct control*, struct control *control = voidcast(struct control*,
png_get_error_ptr(png_ptr)); png_get_error_ptr(png_ptr));
return &control->file; return &control->file;
} }
@ -3543,7 +3543,7 @@ get_control(png_const_structrp png_ptr)
static void static void
allocate(struct file *file, int allocate_idat) allocate(struct file *file, int allocate_idat)
{ {
struct control *control = png_voidcast(struct control*, file->alloc_ptr); struct control *control = voidcast(struct control*, file->alloc_ptr);
if (allocate_idat) if (allocate_idat)
{ {