[glib: 1/3] g_object_get_property: Clarify meaning of G_TYPE_INVALID
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/3] g_object_get_property: Clarify meaning of G_TYPE_INVALID
- Date: Thu, 1 Aug 2019 09:48:12 +0000 (UTC)
commit bf8b669061295d35b4c4beb24dc2b9beff737ed4
Author: Simon McVittie <smcv collabora com>
Date: Wed Jun 5 10:49:22 2019 +0100
g_object_get_property: Clarify meaning of G_TYPE_INVALID
"Uninitialized value" is partially correct, since it has not been
initialized with a type, but it's more precise to say
"zero-initialized value". It is still a programming error to pass a
pointer to uninitialized memory with arbitrary contents as the value.
Signed-off-by: Simon McVittie <smcv collabora com>
gobject/gobject.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 3a1fbdd87..ea515796f 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -2607,7 +2607,7 @@ g_object_get_property (GObject *object,
if (G_VALUE_TYPE (value) == G_TYPE_INVALID)
{
- /* uninitialized value */
+ /* zero-initialized value */
g_value_init (value, pspec->value_type);
prop_value = value;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]