mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
GSIZE_TO_POINTER(): appease stricter compilers
Some compilers (e.g. CHERI LLVM) warn when casting a non-intptr_t integer type to a pointer. The GSIZE_TO_POINTER() macro thus triggers warnings which can be silence by casting to guintptr before gpointer. NB: This macro must not be used to create valid pointers from a integer.
This commit is contained in:
parent
8af4f494b1
commit
403f7a10dc
@ -952,7 +952,7 @@
|
||||
/* Macros by analogy to GINT_TO_POINTER, GPOINTER_TO_INT
|
||||
*/
|
||||
#define GPOINTER_TO_SIZE(p) ((gsize) (p))
|
||||
#define GSIZE_TO_POINTER(s) ((gpointer) (gsize) (s))
|
||||
#define GSIZE_TO_POINTER(s) ((gpointer) (guintptr) (gsize) (s))
|
||||
|
||||
/* Provide convenience macros for handling structure
|
||||
* fields through their offsets.
|
||||
|
Loading…
Reference in New Issue
Block a user