mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
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.
This commit is contained in:
parent
5f5f98a1a9
commit
0406deb1ca
13
pngpriv.h
13
pngpriv.h
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngpriv.h - private declarations for use inside libpng
|
/* 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) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||||
* Copyright (c) 1996-1997 Andreas Dilger
|
* Copyright (c) 1996-1997 Andreas Dilger
|
||||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
@ -492,16 +492,7 @@
|
|||||||
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 png_voidcast(type, value) (value)
|
||||||
# ifdef _WIN64
|
# define png_constcast(type, value) ((type)(void*)(const void*)(value))
|
||||||
# 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_aligncast(type, value) ((void*)(value))
|
# define png_aligncast(type, value) ((void*)(value))
|
||||||
# define png_aligncastconst(type, value) ((const void*)(value))
|
# define png_aligncastconst(type, value) ((const void*)(value))
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user