gobject: Use G_VALUE_INIT

This commit is contained in:
Javier Jardón 2011-09-30 17:19:50 +01:00
parent 8d3250016d
commit 108480b7ba
12 changed files with 46 additions and 46 deletions

View File

@ -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);

View File

@ -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
*/

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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));

View File

@ -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);

View File

@ -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);

View File

@ -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)); \

View File

@ -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);

View File

@ -14,7 +14,7 @@ test_basic (void)
{
GValueArray *a;
GValueArray *a2;
GValue v = { 0, };
GValue v = G_VALUE_INIT;
GValue *p;
gint i;