summaryrefslogtreecommitdiff
path: root/gobject
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2011-09-30 17:19:50 +0100
committerJavier Jardón <jjardon@gnome.org>2011-10-18 17:12:33 +0100
commit108480b7baad8d02b7b0f9729146a04ad09219de (patch)
tree26f35166b8bcfac2c56b65313a7b83a4913df90f /gobject
parent8d3250016dac9d43b2a2de6dacb670a9fbc88808 (diff)
gobject: Use G_VALUE_INIT
Diffstat (limited to 'gobject')
-rw-r--r--gobject/gbinding.c16
-rw-r--r--gobject/gobject.c8
-rw-r--r--gobject/gparam.c4
-rw-r--r--gobject/gsignal.c6
-rw-r--r--gobject/gsourceclosure.c6
-rw-r--r--gobject/gvaluetypes.c2
-rw-r--r--gobject/tests/boxed.c26
-rw-r--r--gobject/tests/enums.c4
-rw-r--r--gobject/tests/ifaceproperties.c4
-rw-r--r--gobject/tests/param.c12
-rw-r--r--gobject/tests/reference.c2
-rw-r--r--gobject/tests/valuearray.c2
12 files changed, 46 insertions, 46 deletions
diff --git a/gobject/gbinding.c b/gobject/gbinding.c
index 39de99f44..612ed3b3d 100644
--- a/gobject/gbinding.c
+++ b/gobject/gbinding.c
@@ -350,8 +350,8 @@ on_source_notify (GObject *gobject,
GBinding *binding)
{
const gchar *p_name;
- GValue source_value = { 0, };
- GValue target_value = { 0, };
+ GValue source_value = G_VALUE_INIT;
+ GValue target_value = G_VALUE_INIT;
gboolean res;
if (binding->is_frozen)
@@ -391,8 +391,8 @@ on_target_notify (GObject *gobject,
GBinding *binding)
{
const gchar *p_name;
- GValue source_value = { 0, };
- GValue target_value = { 0, };
+ GValue source_value = G_VALUE_INIT;
+ GValue target_value = G_VALUE_INIT;
gboolean res;
if (binding->is_frozen)
@@ -1026,8 +1026,8 @@ bind_with_closures_transform_to (GBinding *binding,
gpointer data)
{
TransformData *t_data = data;
- GValue params[3] = { { 0, }, { 0, }, { 0, } };
- GValue retval = { 0, };
+ GValue params[3] = { G_VALUE_INIT, G_VALUE_INIT, G_VALUE_INIT };
+ GValue retval = G_VALUE_INIT;
gboolean res;
g_value_init (&params[0], G_TYPE_BINDING);
@@ -1069,8 +1069,8 @@ bind_with_closures_transform_from (GBinding *binding,
gpointer data)
{
TransformData *t_data = data;
- GValue params[3] = { { 0, }, { 0, }, { 0, } };
- GValue retval = { 0, };
+ GValue params[3] = { G_VALUE_INIT, G_VALUE_INIT, G_VALUE_INIT };
+ GValue retval = G_VALUE_INIT;
gboolean res;
g_value_init (&params[0], G_TYPE_BINDING);
diff --git a/gobject/gobject.c b/gobject/gobject.c
index c2bdbf7d4..faf3cef2d 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -1144,7 +1144,7 @@ object_set_property (GObject *object,
const GValue *value,
GObjectNotifyQueue *nqueue)
{
- GValue tmp_value = { 0, };
+ GValue tmp_value = G_VALUE_INIT;
GObjectClass *class = g_type_class_peek (pspec->owner_type);
guint param_id = PARAM_SPEC_PARAM_ID (pspec);
GParamSpec *redirect;
@@ -1683,7 +1683,7 @@ g_object_set_valist (GObject *object,
name = first_property_name;
while (name)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
GParamSpec *pspec;
gchar *error = NULL;
@@ -1764,7 +1764,7 @@ g_object_get_valist (GObject *object,
while (name)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
GParamSpec *pspec;
gchar *error;
@@ -1977,7 +1977,7 @@ g_object_get_property (GObject *object,
G_OBJECT_TYPE_NAME (object));
else
{
- GValue *prop_value, tmp_value = { 0, };
+ GValue *prop_value, tmp_value = G_VALUE_INIT;
/* auto-conversion of the callers value type
*/
diff --git a/gobject/gparam.c b/gobject/gparam.c
index 8b4e4550e..6d136f3fc 100644
--- a/gobject/gparam.c
+++ b/gobject/gparam.c
@@ -605,7 +605,7 @@ gboolean
g_param_value_defaults (GParamSpec *pspec,
GValue *value)
{
- GValue dflt_value = { 0, };
+ GValue dflt_value = G_VALUE_INIT;
gboolean defaults;
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE);
@@ -679,7 +679,7 @@ g_param_value_convert (GParamSpec *pspec,
GValue *dest_value,
gboolean strict_validation)
{
- GValue tmp_value = { 0, };
+ GValue tmp_value = G_VALUE_INIT;
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE);
g_return_val_if_fail (G_IS_VALUE (src_value), FALSE);
diff --git a/gobject/gsignal.c b/gobject/gsignal.c
index 98534be05..4ea57c537 100644
--- a/gobject/gsignal.c
+++ b/gobject/gsignal.c
@@ -2049,7 +2049,7 @@ g_signal_chain_from_overridden_handler (gpointer instance,
}
else
{
- GValue return_value = { 0, };
+ GValue return_value = G_VALUE_INIT;
gchar *error = NULL;
GType rtype = signal_return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE;
gboolean static_scope = signal_return_type & G_SIGNAL_TYPE_STATIC_SCOPE;
@@ -3003,7 +3003,7 @@ g_signal_emit_valist (gpointer instance,
signal_emit_unlocked_R (node, detail, instance, NULL, instance_and_params);
else
{
- GValue return_value = { 0, };
+ GValue return_value = G_VALUE_INIT;
gchar *error = NULL;
GType rtype = signal_return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE;
gboolean static_scope = signal_return_type & G_SIGNAL_TYPE_STATIC_SCOPE;
@@ -3130,7 +3130,7 @@ signal_emit_unlocked_R (SignalNode *node,
GClosure *class_closure;
HandlerList *hlist;
Handler *handler_list = NULL;
- GValue *return_accu, accu = { 0, };
+ GValue *return_accu, accu = G_VALUE_INIT;
guint signal_id;
gulong max_sequential_handler_number;
gboolean return_value_altered = FALSE;
diff --git a/gobject/gsourceclosure.c b/gobject/gsourceclosure.c
index e3e6b8dc8..644a1e028 100644
--- a/gobject/gsourceclosure.c
+++ b/gobject/gsourceclosure.c
@@ -80,8 +80,8 @@ io_watch_closure_callback (GIOChannel *channel,
{
GClosure *closure = data;
- GValue params[2] = { { 0, }, { 0, } };
- GValue result_value = { 0, };
+ GValue params[2] = { G_VALUE_INIT, G_VALUE_INIT };
+ GValue result_value = G_VALUE_INIT;
gboolean result;
g_value_init (&result_value, G_TYPE_BOOLEAN);
@@ -105,7 +105,7 @@ static gboolean
source_closure_callback (gpointer data)
{
GClosure *closure = data;
- GValue result_value = { 0, };
+ GValue result_value = G_VALUE_INIT;
gboolean result;
g_value_init (&result_value, G_TYPE_BOOLEAN);
diff --git a/gobject/gvaluetypes.c b/gobject/gvaluetypes.c
index c2850d13a..3afb30035 100644
--- a/gobject/gvaluetypes.c
+++ b/gobject/gvaluetypes.c
@@ -1355,7 +1355,7 @@ g_strdup_value_contents (const GValue *value)
}
else if (g_value_type_transformable (G_VALUE_TYPE (value), G_TYPE_STRING))
{
- GValue tmp_value = { 0, };
+ GValue tmp_value = G_VALUE_INIT;
gchar *s;
g_value_init (&tmp_value, G_TYPE_STRING);
diff --git a/gobject/tests/boxed.c b/gobject/tests/boxed.c
index 59fe4ba4f..7b1e7d4c3 100644
--- a/gobject/tests/boxed.c
+++ b/gobject/tests/boxed.c
@@ -61,7 +61,7 @@ test_define_boxed (void)
static void
test_boxed_ownership (void)
{
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
static MyBoxed boxed = { 10, "bla" };
g_value_init (&value, MY_TYPE_BOXED);
@@ -104,7 +104,7 @@ test_boxed_closure (void)
{
GClosure *closure;
GClosure *closure2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_CLOSURE);
g_assert (G_VALUE_HOLDS_BOXED (&value));
@@ -128,7 +128,7 @@ test_boxed_date (void)
{
GDate *date;
GDate *date2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_DATE);
g_assert (G_VALUE_HOLDS_BOXED (&value));
@@ -150,9 +150,9 @@ test_boxed_date (void)
static void
test_boxed_value (void)
{
- GValue value1 = { 0, };
+ GValue value1 = G_VALUE_INIT;
GValue *value2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_VALUE);
g_assert (G_VALUE_HOLDS_BOXED (&value));
@@ -179,7 +179,7 @@ test_boxed_string (void)
{
GString *v;
GString *v2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_GSTRING);
g_assert (G_VALUE_HOLDS_BOXED (&value));
@@ -203,7 +203,7 @@ test_boxed_hashtable (void)
{
GHashTable *v;
GHashTable *v2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_HASH_TABLE);
g_assert (G_VALUE_HOLDS_BOXED (&value));
@@ -226,7 +226,7 @@ test_boxed_array (void)
{
GArray *v;
GArray *v2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_ARRAY);
g_assert (G_VALUE_HOLDS_BOXED (&value));
@@ -249,7 +249,7 @@ test_boxed_ptrarray (void)
{
GPtrArray *v;
GPtrArray *v2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_PTR_ARRAY);
g_assert (G_VALUE_HOLDS_BOXED (&value));
@@ -272,7 +272,7 @@ test_boxed_regex (void)
{
GRegex *v;
GRegex *v2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_REGEX);
g_assert (G_VALUE_HOLDS_BOXED (&value));
@@ -295,7 +295,7 @@ test_boxed_varianttype (void)
{
GVariantType *v;
GVariantType *v2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_VARIANT_TYPE);
g_assert (G_VALUE_HOLDS_BOXED (&value));
@@ -319,7 +319,7 @@ test_boxed_datetime (void)
{
GDateTime *v;
GDateTime *v2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_DATE_TIME);
g_assert (G_VALUE_HOLDS_BOXED (&value));
@@ -342,7 +342,7 @@ test_boxed_error (void)
{
GError *v;
GError *v2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_ERROR);
g_assert (G_VALUE_HOLDS_BOXED (&value));
diff --git a/gobject/tests/enums.c b/gobject/tests/enums.c
index f4076f2ad..e744bedbe 100644
--- a/gobject/tests/enums.c
+++ b/gobject/tests/enums.c
@@ -14,7 +14,7 @@ test_enum_basic (void)
GType type;
GEnumClass *class;
GEnumValue *val;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
type = g_enum_register_static ("MyEnum", my_enum_values);
@@ -65,7 +65,7 @@ test_flags_basic (void)
GType type;
GFlagsClass *class;
GFlagsValue *val;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
type = g_flags_register_static ("MyFlags", my_flag_values);
diff --git a/gobject/tests/ifaceproperties.c b/gobject/tests/ifaceproperties.c
index 22fc747c5..5e3d22044 100644
--- a/gobject/tests/ifaceproperties.c
+++ b/gobject/tests/ifaceproperties.c
@@ -154,8 +154,8 @@ base_object_constructor (GType type,
/* The constructor is the one place where a GParamSpecOverride is visible
* to the outside world, so we do a bunch of checks here
*/
- GValue value1 = { 0, };
- GValue value2 = { 0, };
+ GValue value1 = G_VALUE_INIT;
+ GValue value2 = G_VALUE_INIT;
GParamSpec *pspec;
g_assert (n_construct_properties == 1);
diff --git a/gobject/tests/param.c b/gobject/tests/param.c
index 5c3dab17e..d482e7b68 100644
--- a/gobject/tests/param.c
+++ b/gobject/tests/param.c
@@ -6,7 +6,7 @@ test_param_value (void)
{
GParamSpec *p, *p2;
GParamSpec *pp;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_PARAM);
g_assert (G_VALUE_HOLDS_PARAM (&value));
@@ -66,7 +66,7 @@ static void
test_param_validate (void)
{
GParamSpec *p;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
p = g_param_spec_int ("my-int", "My Int", "Blurb", 0, 20, 10, G_PARAM_READWRITE);
@@ -111,8 +111,8 @@ static void
test_param_convert (void)
{
GParamSpec *p;
- GValue v1 = { 0, };
- GValue v2 = { 0, };
+ GValue v1 = G_VALUE_INIT;
+ GValue v2 = G_VALUE_INIT;
p = g_param_spec_int ("my-int", "My Int", "Blurb", 0, 20, 10, G_PARAM_READWRITE);
g_value_init (&v1, G_TYPE_UINT);
@@ -133,8 +133,8 @@ test_param_convert (void)
static void
test_value_transform (void)
{
- GValue src = { 0, };
- GValue dest = { 0, };
+ GValue src = G_VALUE_INIT;
+ GValue dest = G_VALUE_INIT;
#define CHECK_INT_CONVERSION(type, getter, value) \
g_assert (g_value_type_transformable (G_TYPE_INT, type)); \
diff --git a/gobject/tests/reference.c b/gobject/tests/reference.c
index 1106591f3..5a396be95 100644
--- a/gobject/tests/reference.c
+++ b/gobject/tests/reference.c
@@ -157,7 +157,7 @@ test_object_value (void)
{
GObject *v;
GObject *v2;
- GValue value = { 0, };
+ GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_OBJECT);
diff --git a/gobject/tests/valuearray.c b/gobject/tests/valuearray.c
index 0868caeb9..47bd26d54 100644
--- a/gobject/tests/valuearray.c
+++ b/gobject/tests/valuearray.c
@@ -14,7 +14,7 @@ test_basic (void)
{
GValueArray *a;
GValueArray *a2;
- GValue v = { 0, };
+ GValue v = G_VALUE_INIT;
GValue *p;
gint i;