From 0406deb1ca2e012ba551efd6eeec40803e4480b1 Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Tue, 13 Sep 2022 01:54:17 +0300 Subject: [PATCH] Fix private macro png_constcast; delete private type png_ptruint In order to appease the compiler warnings that might affect the uses of png_constcast, it should be sufficient to cast the source pointer type to (const void*), and then to (void*), and then to the destination pointer type. An intermediate cast through an integer type, such as (png_ptruint), should not be needed. --- pngpriv.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pngpriv.h b/pngpriv.h index 1edea74cb..2fa614fda 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -1,7 +1,7 @@ /* pngpriv.h - private declarations for use inside libpng * - * Copyright (c) 2018-2019 Cosmin Truta + * Copyright (c) 2018-2022 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson * Copyright (c) 1996-1997 Andreas Dilger * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. @@ -492,16 +492,7 @@ static_cast(static_cast(value)) #else # define png_voidcast(type, value) (value) -# ifdef _WIN64 -# ifdef __GNUC__ - typedef unsigned long long png_ptruint; -# else - typedef unsigned __int64 png_ptruint; -# endif -# else - typedef unsigned long png_ptruint; -# endif -# define png_constcast(type, value) ((type)(png_ptruint)(const void*)(value)) +# define png_constcast(type, value) ((type)(void*)(const void*)(value)) # define png_aligncast(type, value) ((void*)(value)) # define png_aligncastconst(type, value) ((const void*)(value)) #endif /* __cplusplus */