mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Removed need for -Wno-cast-align with clang. clang correctly warns
on alignment increasing pointer casts when -Wcast-align is passed. This fixes the cases clang warns about either (pngread.c) by eliminating the casts from png_bytep to png_uint_16p or, for pngrutil.c where the cast is previously verified or pngstest.c where it is OK by introducing new png_aligncast macros to do the cast in a way that clang accepts.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
040575c80b
commit
b45416921b
10
pngrutil.c
10
pngrutil.c
@@ -3261,8 +3261,9 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
|
||||
bytes_to_copy % sizeof (png_uint_32) == 0 &&
|
||||
bytes_to_jump % sizeof (png_uint_32) == 0)
|
||||
{
|
||||
png_uint_32p dp32 = (png_uint_32p)dp;
|
||||
png_const_uint_32p sp32 = (png_const_uint_32p)sp;
|
||||
png_uint_32p dp32 = png_aligncast(png_uint_32p,dp);
|
||||
png_const_uint_32p sp32 = png_aligncastconst(
|
||||
png_const_uint_32p, sp);
|
||||
unsigned int skip = (bytes_to_jump-bytes_to_copy) /
|
||||
sizeof (png_uint_32);
|
||||
|
||||
@@ -3302,8 +3303,9 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
|
||||
*/
|
||||
else
|
||||
{
|
||||
png_uint_16p dp16 = (png_uint_16p)dp;
|
||||
png_const_uint_16p sp16 = (png_const_uint_16p)sp;
|
||||
png_uint_16p dp16 = png_aligncast(png_uint_16p, dp);
|
||||
png_const_uint_16p sp16 = png_aligncastconst(
|
||||
png_const_uint_16p, sp);
|
||||
unsigned int skip = (bytes_to_jump-bytes_to_copy) /
|
||||
sizeof (png_uint_16);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user