mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02: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:
@@ -952,7 +952,7 @@
|
|||||||
/* Macros by analogy to GINT_TO_POINTER, GPOINTER_TO_INT
|
/* Macros by analogy to GINT_TO_POINTER, GPOINTER_TO_INT
|
||||||
*/
|
*/
|
||||||
#define GPOINTER_TO_SIZE(p) ((gsize) (p))
|
#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
|
/* Provide convenience macros for handling structure
|
||||||
* fields through their offsets.
|
* fields through their offsets.
|
||||||
|
Reference in New Issue
Block a user