Commit 82fb1978 authored by Jiří Klimeš's avatar Jiří Klimeš

all: use G_VALUE_INIT to initialize GValue variables

It makes the initializations more explicit.
G_VALUE_INIT is available since glib 2.30, and NM now require glib >= 2.32
parent a78a1847
...@@ -175,7 +175,7 @@ next_script (gpointer user_data) ...@@ -175,7 +175,7 @@ next_script (gpointer user_data)
results = g_ptr_array_sized_new (request->scripts->len); results = g_ptr_array_sized_new (request->scripts->len);
for (i = 0; i < request->scripts->len; i++) { for (i = 0; i < request->scripts->len; i++) {
ScriptInfo *script = g_ptr_array_index (request->scripts, i); ScriptInfo *script = g_ptr_array_index (request->scripts, i);
GValue elt = {0, }; GValue elt = G_VALUE_INIT;
item = g_value_array_new (3); item = g_value_array_new (3);
......
...@@ -1257,7 +1257,7 @@ dbus_get_vpn_state (const char *path) ...@@ -1257,7 +1257,7 @@ dbus_get_vpn_state (const char *path)
DBusGConnection *connection; DBusGConnection *connection;
DBusGProxy *proxy; DBusGProxy *proxy;
GError *error = NULL; GError *error = NULL;
GValue value = {0,}; GValue value = G_VALUE_INIT;
NMVPNConnectionState state = NM_VPN_CONNECTION_STATE_UNKNOWN; NMVPNConnectionState state = NM_VPN_CONNECTION_STATE_UNKNOWN;
connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL); connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
......
...@@ -98,8 +98,8 @@ static void ...@@ -98,8 +98,8 @@ static void
get_active_connection_details (DBusGConnection *bus, const char *obj_path) get_active_connection_details (DBusGConnection *bus, const char *obj_path)
{ {
DBusGProxy *props_proxy; DBusGProxy *props_proxy;
GValue path_value = { 0 }; GValue path_value = G_VALUE_INIT;
GValue serv_value = { 0 }; GValue serv_value = G_VALUE_INIT;
GError *error = NULL; GError *error = NULL;
const char *path = NULL, *service = NULL; const char *path = NULL, *service = NULL;
...@@ -179,7 +179,7 @@ static void ...@@ -179,7 +179,7 @@ static void
get_active_connections (DBusGConnection *bus, DBusGProxy *proxy) get_active_connections (DBusGConnection *bus, DBusGProxy *proxy)
{ {
GError *error = NULL; GError *error = NULL;
GValue value = { 0 }; GValue value = G_VALUE_INIT;
GPtrArray *paths = NULL; GPtrArray *paths = NULL;
int i; int i;
......
...@@ -111,7 +111,7 @@ _nm_active_connection_type_for_path (DBusGConnection *connection, ...@@ -111,7 +111,7 @@ _nm_active_connection_type_for_path (DBusGConnection *connection,
{ {
DBusGProxy *proxy; DBusGProxy *proxy;
GError *error = NULL; GError *error = NULL;
GValue value = {0,}; GValue value = G_VALUE_INIT;
GType type; GType type;
proxy = dbus_g_proxy_new_for_name (connection, proxy = dbus_g_proxy_new_for_name (connection,
......
...@@ -768,7 +768,7 @@ nm_client_wireless_get_enabled (NMClient *client) ...@@ -768,7 +768,7 @@ nm_client_wireless_get_enabled (NMClient *client)
void void
nm_client_wireless_set_enabled (NMClient *client, gboolean enabled) nm_client_wireless_set_enabled (NMClient *client, gboolean enabled)
{ {
GValue value = {0,}; GValue value = G_VALUE_INIT;
g_return_if_fail (NM_IS_CLIENT (client)); g_return_if_fail (NM_IS_CLIENT (client));
...@@ -825,7 +825,7 @@ nm_client_wwan_get_enabled (NMClient *client) ...@@ -825,7 +825,7 @@ nm_client_wwan_get_enabled (NMClient *client)
void void
nm_client_wwan_set_enabled (NMClient *client, gboolean enabled) nm_client_wwan_set_enabled (NMClient *client, gboolean enabled)
{ {
GValue value = {0,}; GValue value = G_VALUE_INIT;
g_return_if_fail (NM_IS_CLIENT (client)); g_return_if_fail (NM_IS_CLIENT (client));
...@@ -882,7 +882,7 @@ nm_client_wimax_get_enabled (NMClient *client) ...@@ -882,7 +882,7 @@ nm_client_wimax_get_enabled (NMClient *client)
void void
nm_client_wimax_set_enabled (NMClient *client, gboolean enabled) nm_client_wimax_set_enabled (NMClient *client, gboolean enabled)
{ {
GValue value = {0,}; GValue value = G_VALUE_INIT;
g_return_if_fail (NM_IS_CLIENT (client)); g_return_if_fail (NM_IS_CLIENT (client));
......
...@@ -845,7 +845,7 @@ _nm_device_type_for_path (DBusGConnection *connection, ...@@ -845,7 +845,7 @@ _nm_device_type_for_path (DBusGConnection *connection,
{ {
DBusGProxy *proxy; DBusGProxy *proxy;
GError *err = NULL; GError *err = NULL;
GValue value = {0,}; GValue value = G_VALUE_INIT;
NMDeviceType nm_dtype; NMDeviceType nm_dtype;
proxy = dbus_g_proxy_new_for_name (connection, proxy = dbus_g_proxy_new_for_name (connection,
...@@ -1146,7 +1146,7 @@ nm_device_get_autoconnect (NMDevice *device) ...@@ -1146,7 +1146,7 @@ nm_device_get_autoconnect (NMDevice *device)
void void
nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect) nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect)
{ {
GValue value = {0,}; GValue value = G_VALUE_INIT;
g_return_if_fail (NM_IS_DEVICE (device)); g_return_if_fail (NM_IS_DEVICE (device));
......
...@@ -1090,7 +1090,7 @@ _nm_object_reload_property (NMObject *object, ...@@ -1090,7 +1090,7 @@ _nm_object_reload_property (NMObject *object,
const char *interface, const char *interface,
const char *prop_name) const char *prop_name)
{ {
GValue value = { 0, }; GValue value = G_VALUE_INIT;
GError *err = NULL; GError *err = NULL;
g_return_if_fail (NM_IS_OBJECT (object)); g_return_if_fail (NM_IS_OBJECT (object));
...@@ -1281,7 +1281,7 @@ _nm_object_reload_pseudo_property (NMObject *object, ...@@ -1281,7 +1281,7 @@ _nm_object_reload_pseudo_property (NMObject *object,
PseudoPropertyInfo *ppi; PseudoPropertyInfo *ppi;
GPtrArray *temp; GPtrArray *temp;
GError *error = NULL; GError *error = NULL;
GValue value = { 0, }; GValue value = G_VALUE_INIT;
g_return_if_fail (NM_IS_OBJECT (object)); g_return_if_fail (NM_IS_OBJECT (object));
g_return_if_fail (name != NULL); g_return_if_fail (name != NULL);
...@@ -1365,7 +1365,7 @@ reload_got_pseudo_property (DBusGProxy *proxy, DBusGProxyCall *call, ...@@ -1365,7 +1365,7 @@ reload_got_pseudo_property (DBusGProxy *proxy, DBusGProxyCall *call,
NMObject *object = ppi->self; NMObject *object = ppi->self;
NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object);
GPtrArray *temp; GPtrArray *temp;
GValue value = { 0, }; GValue value = G_VALUE_INIT;
GError *error = NULL; GError *error = NULL;
if (dbus_g_proxy_end_call (proxy, call, &error, if (dbus_g_proxy_end_call (proxy, call, &error,
......
...@@ -649,8 +649,8 @@ _nm_param_spec_specialized (const char *name, ...@@ -649,8 +649,8 @@ _nm_param_spec_specialized (const char *name,
static void static void
compare_ints (void) compare_ints (void)
{ {
GValue value1 = { 0 }; GValue value1 = G_VALUE_INIT;
GValue value2 = { 0 }; GValue value2 = G_VALUE_INIT;
g_value_init (&value1, G_TYPE_INT); g_value_init (&value1, G_TYPE_INT);
g_value_init (&value2, G_TYPE_INT); g_value_init (&value2, G_TYPE_INT);
...@@ -669,8 +669,8 @@ compare_ints (void) ...@@ -669,8 +669,8 @@ compare_ints (void)
static void static void
compare_strings (void) compare_strings (void)
{ {
GValue value1 = { 0 }; GValue value1 = G_VALUE_INIT;
GValue value2 = { 0 }; GValue value2 = G_VALUE_INIT;
const char *str1 = "hello"; const char *str1 = "hello";
const char *str2 = "world"; const char *str2 = "world";
...@@ -688,8 +688,8 @@ compare_strings (void) ...@@ -688,8 +688,8 @@ compare_strings (void)
static void static void
compare_strv (void) compare_strv (void)
{ {
GValue value1 = { 0 }; GValue value1 = G_VALUE_INIT;
GValue value2 = { 0 }; GValue value2 = G_VALUE_INIT;
char *strv1[] = { "foo", "bar", "baz", NULL }; char *strv1[] = { "foo", "bar", "baz", NULL };
char *strv2[] = { "foo", "bar", "bar", NULL }; char *strv2[] = { "foo", "bar", "bar", NULL };
char *strv3[] = { "foo", "bar", NULL }; char *strv3[] = { "foo", "bar", NULL };
...@@ -717,8 +717,8 @@ compare_garrays (void) ...@@ -717,8 +717,8 @@ compare_garrays (void)
{ {
GArray *array1; GArray *array1;
GArray *array2; GArray *array2;
GValue value1 = { 0 }; GValue value1 = G_VALUE_INIT;
GValue value2 = { 0 }; GValue value2 = G_VALUE_INIT;
int i; int i;
g_value_init (&value1, DBUS_TYPE_G_UINT_ARRAY); g_value_init (&value1, DBUS_TYPE_G_UINT_ARRAY);
...@@ -752,8 +752,8 @@ compare_ptrarrays (void) ...@@ -752,8 +752,8 @@ compare_ptrarrays (void)
{ {
GPtrArray *array1; GPtrArray *array1;
GPtrArray *array2; GPtrArray *array2;
GValue value1 = { 0 }; GValue value1 = G_VALUE_INIT;
GValue value2 = { 0 }; GValue value2 = G_VALUE_INIT;
g_value_init (&value1, dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING)); g_value_init (&value1, dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING));
array1 = g_ptr_array_new (); array1 = g_ptr_array_new ();
...@@ -785,8 +785,8 @@ compare_str_hash (void) ...@@ -785,8 +785,8 @@ compare_str_hash (void)
{ {
GHashTable *hash1; GHashTable *hash1;
GHashTable *hash2; GHashTable *hash2;
GValue value1 = { 0 }; GValue value1 = G_VALUE_INIT;
GValue value2 = { 0 }; GValue value2 = G_VALUE_INIT;
g_value_init (&value1, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)); g_value_init (&value1, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING));
g_value_init (&value2, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)); g_value_init (&value2, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING));
...@@ -842,8 +842,8 @@ compare_gvalue_hash (void) ...@@ -842,8 +842,8 @@ compare_gvalue_hash (void)
{ {
GHashTable *hash1; GHashTable *hash1;
GHashTable *hash2; GHashTable *hash2;
GValue value1 = { 0 }; GValue value1 = G_VALUE_INIT;
GValue value2 = { 0 }; GValue value2 = G_VALUE_INIT;
g_value_init (&value1, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)); g_value_init (&value1, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE));
g_value_init (&value2, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)); g_value_init (&value2, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE));
...@@ -879,9 +879,9 @@ compare_ip6_addresses (void) ...@@ -879,9 +879,9 @@ compare_ip6_addresses (void)
GByteArray *ba1; GByteArray *ba1;
GByteArray *ba2; GByteArray *ba2;
GByteArray *ba3; GByteArray *ba3;
GValue element = { 0 }; GValue element = G_VALUE_INIT;
GValue value1 = { 0 }; GValue value1 = G_VALUE_INIT;
GValue value2 = { 0 }; GValue value2 = G_VALUE_INIT;
struct in6_addr addr1; struct in6_addr addr1;
struct in6_addr addr2; struct in6_addr addr2;
struct in6_addr addr3; struct in6_addr addr3;
......
...@@ -316,8 +316,8 @@ compare_property (NMSetting *setting, ...@@ -316,8 +316,8 @@ compare_property (NMSetting *setting,
const GParamSpec *prop_spec, const GParamSpec *prop_spec,
NMSettingCompareFlags flags) NMSettingCompareFlags flags)
{ {
GValue value1 = { 0 }; GValue value1 = G_VALUE_INIT;
GValue value2 = { 0 }; GValue value2 = G_VALUE_INIT;
gboolean different; gboolean different;
/* Handle compare flags */ /* Handle compare flags */
...@@ -510,7 +510,7 @@ nm_setting_diff (NMSetting *a, ...@@ -510,7 +510,7 @@ nm_setting_diff (NMSetting *a,
for (i = 0; i < n_property_specs; i++) { for (i = 0; i < n_property_specs; i++) {
GParamSpec *prop_spec = property_specs[i]; GParamSpec *prop_spec = property_specs[i];
GValue a_value = { 0 }, b_value = { 0 }; GValue a_value = G_VALUE_INIT, b_value = G_VALUE_INIT;
NMSettingDiffResult r = NM_SETTING_DIFF_RESULT_UNKNOWN, tmp; NMSettingDiffResult r = NM_SETTING_DIFF_RESULT_UNKNOWN, tmp;
gboolean different = TRUE; gboolean different = TRUE;
...@@ -580,7 +580,7 @@ nm_setting_enumerate_values (NMSetting *setting, ...@@ -580,7 +580,7 @@ nm_setting_enumerate_values (NMSetting *setting,
property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs); property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs);
for (i = 0; i < n_property_specs; i++) { for (i = 0; i < n_property_specs; i++) {
GParamSpec *prop_spec = property_specs[i]; GParamSpec *prop_spec = property_specs[i];
GValue value = { 0 }; GValue value = G_VALUE_INIT;
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (prop_spec)); g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (prop_spec));
g_object_get_property (G_OBJECT (setting), prop_spec->name, &value); g_object_get_property (G_OBJECT (setting), prop_spec->name, &value);
...@@ -612,7 +612,7 @@ nm_setting_clear_secrets (NMSetting *setting) ...@@ -612,7 +612,7 @@ nm_setting_clear_secrets (NMSetting *setting)
for (i = 0; i < n_property_specs; i++) { for (i = 0; i < n_property_specs; i++) {
GParamSpec *prop_spec = property_specs[i]; GParamSpec *prop_spec = property_specs[i];
GValue value = { 0 }; GValue value = G_VALUE_INIT;
if (prop_spec->flags & NM_SETTING_PARAM_SECRET) { if (prop_spec->flags & NM_SETTING_PARAM_SECRET) {
g_value_init (&value, prop_spec->value_type); g_value_init (&value, prop_spec->value_type);
...@@ -631,7 +631,7 @@ clear_secrets_with_flags (NMSetting *setting, ...@@ -631,7 +631,7 @@ clear_secrets_with_flags (NMSetting *setting,
NMSettingClearSecretsWithFlagsFn func, NMSettingClearSecretsWithFlagsFn func,
gpointer user_data) gpointer user_data)
{ {
GValue value = { 0 }; GValue value = G_VALUE_INIT;
NMSettingSecretFlags flags = NM_SETTING_SECRET_FLAG_NONE; NMSettingSecretFlags flags = NM_SETTING_SECRET_FLAG_NONE;
/* Clear the secret if the user function says to do so */ /* Clear the secret if the user function says to do so */
...@@ -710,7 +710,7 @@ static gboolean ...@@ -710,7 +710,7 @@ static gboolean
update_one_secret (NMSetting *setting, const char *key, GValue *value, GError **error) update_one_secret (NMSetting *setting, const char *key, GValue *value, GError **error)
{ {
GParamSpec *prop_spec; GParamSpec *prop_spec;
GValue transformed_value = { 0 }; GValue transformed_value = G_VALUE_INIT;
gboolean success = FALSE; gboolean success = FALSE;
prop_spec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), key); prop_spec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), key);
...@@ -929,7 +929,7 @@ nm_setting_to_string (NMSetting *setting) ...@@ -929,7 +929,7 @@ nm_setting_to_string (NMSetting *setting)
for (i = 0; i < n_property_specs; i++) { for (i = 0; i < n_property_specs; i++) {
GParamSpec *prop_spec = property_specs[i]; GParamSpec *prop_spec = property_specs[i];
GValue value = { 0 }; GValue value = G_VALUE_INIT;
char *value_str; char *value_str;
gboolean is_serializable; gboolean is_serializable;
gboolean is_default; gboolean is_default;
......
...@@ -1091,7 +1091,7 @@ _nm_utils_convert_old_ip6_addr_array (const GValue *src_value, GValue *dst_value ...@@ -1091,7 +1091,7 @@ _nm_utils_convert_old_ip6_addr_array (const GValue *src_value, GValue *dst_value
for (i = 0; src_outer_array && (i < src_outer_array->len); i++) { for (i = 0; src_outer_array && (i < src_outer_array->len); i++) {
GValueArray *src_addr_array; GValueArray *src_addr_array;
GValueArray *dst_addr_array; GValueArray *dst_addr_array;
GValue element = {0, }; GValue element = G_VALUE_INIT;
GValue *src_addr, *src_prefix; GValue *src_addr, *src_prefix;
GByteArray *ba; GByteArray *ba;
...@@ -1867,7 +1867,7 @@ nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value) ...@@ -1867,7 +1867,7 @@ nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value)
for (iter = list; iter; iter = iter->next) { for (iter = list; iter; iter = iter->next) {
NMIP6Address *addr = (NMIP6Address *) iter->data; NMIP6Address *addr = (NMIP6Address *) iter->data;
GValueArray *array; GValueArray *array;
GValue element = {0, }; GValue element = G_VALUE_INIT;
GByteArray *ba; GByteArray *ba;
array = g_value_array_new (3); array = g_value_array_new (3);
...@@ -1991,7 +1991,7 @@ nm_utils_ip6_routes_to_gvalue (GSList *list, GValue *value) ...@@ -1991,7 +1991,7 @@ nm_utils_ip6_routes_to_gvalue (GSList *list, GValue *value)
GValueArray *array; GValueArray *array;
const struct in6_addr *addr; const struct in6_addr *addr;
GByteArray *ba; GByteArray *ba;
GValue element = {0, }; GValue element = G_VALUE_INIT;
array = g_value_array_new (4); array = g_value_array_new (4);
......
...@@ -145,7 +145,7 @@ test_setting_vpn_update_secrets (void) ...@@ -145,7 +145,7 @@ test_setting_vpn_update_secrets (void)
NMConnection *connection; NMConnection *connection;
NMSettingVPN *s_vpn; NMSettingVPN *s_vpn;
GHashTable *settings, *vpn, *secrets; GHashTable *settings, *vpn, *secrets;
GValue val = { 0 }; GValue val = G_VALUE_INIT;
gboolean success; gboolean success;
GError *error = NULL; GError *error = NULL;
const char *tmp; const char *tmp;
...@@ -280,7 +280,7 @@ test_setting_ip6_config_old_address_array (void) ...@@ -280,7 +280,7 @@ test_setting_ip6_config_old_address_array (void)
NMSettingIP6Config *s_ip6; NMSettingIP6Config *s_ip6;
GPtrArray *addresses, *read_addresses; GPtrArray *addresses, *read_addresses;
GValueArray *array, *read_array; GValueArray *array, *read_array;
GValue element = {0, }, written_value = {0, }, read_value = {0, }; GValue element = G_VALUE_INIT, written_value = G_VALUE_INIT, read_value = G_VALUE_INIT;
GByteArray *ba; GByteArray *ba;
const guint8 addr[16] = { 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, const guint8 addr[16] = { 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11,
0x11, 0x22, 0x33, 0x44, 0x66, 0x77, 0x88, 0x99 }; 0x11, 0x22, 0x33, 0x44, 0x66, 0x77, 0x88, 0x99 };
......
...@@ -57,8 +57,8 @@ test_defaults (GType type, const char *name) ...@@ -57,8 +57,8 @@ test_defaults (GType type, const char *name)
for (i = 0; i < n_property_specs; i++) { for (i = 0; i < n_property_specs; i++) {
GParamSpec *prop_spec = property_specs[i]; GParamSpec *prop_spec = property_specs[i];
GValue value = { 0, }; GValue value = G_VALUE_INIT;
GValue defvalue = { 0, }; GValue defvalue = G_VALUE_INIT;
char *actual, *expected; char *actual, *expected;
gboolean ok = FALSE; gboolean ok = FALSE;
......
...@@ -92,7 +92,7 @@ get_mm_enabled_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d ...@@ -92,7 +92,7 @@ get_mm_enabled_done (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_d
{ {
NMModem *self = NM_MODEM (user_data); NMModem *self = NM_MODEM (user_data);
GError *error = NULL; GError *error = NULL;
GValue value = { 0, }; GValue value = G_VALUE_INIT;
if (!dbus_g_proxy_end_call (proxy, call_id, &error, if (!dbus_g_proxy_end_call (proxy, call_id, &error,
G_TYPE_VALUE, &value, G_TYPE_VALUE, &value,
......
...@@ -222,7 +222,7 @@ set_sysfs_uint (const char *iface, ...@@ -222,7 +222,7 @@ set_sysfs_uint (const char *iface,
{ {
char *path, *s; char *path, *s;
GParamSpec *pspec; GParamSpec *pspec;
GValue val = { 0 }; GValue val = G_VALUE_INIT;
guint32 uval = 0; guint32 uval = 0;
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (obj), obj_prop); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (obj), obj_prop);
......
...@@ -1636,8 +1636,8 @@ scanning_allowed_accumulator (GSignalInvocationHint *ihint, ...@@ -1636,8 +1636,8 @@ scanning_allowed_accumulator (GSignalInvocationHint *ihint,
static gboolean static gboolean
check_scanning_allowed (NMDeviceWifi *self) check_scanning_allowed (NMDeviceWifi *self)
{ {
GValue instance = { 0, }; GValue instance = G_VALUE_INIT;
GValue retval = { 0, }; GValue retval = G_VALUE_INIT;
g_value_init (&instance, G_TYPE_OBJECT); g_value_init (&instance, G_TYPE_OBJECT);
g_value_take_object (&instance, self); g_value_take_object (&instance, self);
......
...@@ -1357,8 +1357,8 @@ gboolean ...@@ -1357,8 +1357,8 @@ gboolean
nm_device_autoconnect_allowed (NMDevice *self) nm_device_autoconnect_allowed (NMDevice *self)
{ {
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
GValue instance = { 0, }; GValue instance = G_VALUE_INIT;
GValue retval = { 0, }; GValue retval = G_VALUE_INIT;
g_value_init (&instance, G_TYPE_OBJECT); g_value_init (&instance, G_TYPE_OBJECT);
g_value_take_object (&instance, self); g_value_take_object (&instance, self);
......
...@@ -75,7 +75,7 @@ static void ...@@ -75,7 +75,7 @@ static void
add_to_string (gpointer key, gpointer value, gpointer user_data) add_to_string (gpointer key, gpointer value, gpointer user_data)
{ {
char *buf = (char *) user_data; char *buf = (char *) user_data;
GValue str_val = { 0, }; GValue str_val = G_VALUE_INIT;
g_value_init (&str_val, G_TYPE_STRING); g_value_init (&str_val, G_TYPE_STRING);
if (!g_value_transform ((GValue *) value, &str_val)) { if (!g_value_transform ((GValue *) value, &str_val)) {
......
...@@ -1291,7 +1291,7 @@ static guint32 ...@@ -1291,7 +1291,7 @@ static guint32
get_setting_default (NMSetting *setting, const char *prop) get_setting_default (NMSetting *setting, const char *prop)
{ {
GParamSpec *pspec; GParamSpec *pspec;
GValue val = { 0 }; GValue val = G_VALUE_INIT;
guint32 ret = 0; guint32 ret = 0;
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), prop); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), prop);
......
...@@ -132,7 +132,7 @@ build_ip6_address_or_route (const char *address_str, guint32 plen, const char *g ...@@ -132,7 +132,7 @@ build_ip6_address_or_route (const char *address_str, guint32 plen, const char *g
struct in6_addr addr; struct in6_addr addr;
GByteArray *address; GByteArray *address;
GByteArray *gateway; GByteArray *gateway;
GValue value = { 0, }; GValue value = G_VALUE_INIT;
int err; int err;
g_return_val_if_fail (address_str, NULL); g_return_val_if_fail (address_str, NULL);
......
...@@ -1276,7 +1276,7 @@ nm_supplicant_interface_set_config (NMSupplicantInterface * self, ...@@ -1276,7 +1276,7 @@ nm_supplicant_interface_set_config (NMSupplicantInterface * self,
NMSupplicantInterfacePrivate *priv; NMSupplicantInterfacePrivate *priv;
NMSupplicantInfo *info; NMSupplicantInfo *info;
DBusGProxyCall *call; DBusGProxyCall *call;
GValue value = { 0, }; GValue value = G_VALUE_INIT;