mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-22 15:19:16 +02:00
GValue – Don't cast G_VALUE_TYPE() argument to GValue*
It's not possible to subclass GValue, and by always explicitly casting here it is easy to write broken code (e.g. passing a GValue**) without the compiler warning about that. By not casting, the compiler will error out if anything but a GValue* is passed here. https://bugzilla.gnome.org/show_bug.cgi?id=793186
This commit is contained in:
parent
e9dd5e1819
commit
a05a21bec2
@ -56,7 +56,7 @@ G_BEGIN_DECLS
|
|||||||
*
|
*
|
||||||
* Returns: the #GType.
|
* Returns: the #GType.
|
||||||
*/
|
*/
|
||||||
#define G_VALUE_TYPE(value) (((GValue*) (value))->g_type)
|
#define G_VALUE_TYPE(value) (((value))->g_type)
|
||||||
/**
|
/**
|
||||||
* G_VALUE_TYPE_NAME:
|
* G_VALUE_TYPE_NAME:
|
||||||
* @value: A #GValue structure.
|
* @value: A #GValue structure.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user