diff options
author | Cosmin Truta <ctruta@gmail.com> | 2022-09-13 01:54:17 +0300 |
---|---|---|
committer | Cosmin Truta <ctruta@gmail.com> | 2022-09-13 01:54:17 +0300 |
commit | 0406deb1ca2e012ba551efd6eeec40803e4480b1 (patch) | |
tree | 1ff2460d155d49e0fc45eeaf1d2ff04d47781830 | |
parent | 5f5f98a1a919e89f0bcea26d73d96dec760f222f (diff) | |
download | libpng-0406deb1ca2e012ba551efd6eeec40803e4480b1.tar.gz |
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.
-rw-r--r-- | pngpriv.h | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -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<type>(static_cast<const void*>(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 */ |