Commit e1c7a2b5 authored by Thomas Haller's avatar Thomas Haller

all: don't use gchar/gshort/gint/glong but C types

We commonly don't use the glib typedefs for char/short/int/long,
but their C types directly.

    $ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l
    587
    $ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l
    21114

One could argue that using the glib typedefs is preferable in
public API (of our glib based libnm library) or where it clearly
is related to glib, like during

  g_object_set (obj, PROPERTY, (gint) value, NULL);

However, that argument does not seem strong, because in practice we don't
follow that argument today, and seldomly use the glib typedefs.
Also, the style guide for this would be hard to formalize, because
"using them where clearly related to a glib" is a very loose suggestion.

Also note that glib typedefs will always just be typedefs of the
underlying C types. There is no danger of glib changing the meaning
of these typedefs (because that would be a major API break of glib).

A simple style guide is instead: don't use these typedefs.

No manual actions, I only ran the bash script:

  FILES=($(git ls-files '*.[hc]'))
  sed -i \
      -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \
      -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>  /\1   /g' \
      -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \
      "${FILES[@]}"
parent 7e98b4ca
......@@ -249,7 +249,7 @@ enum VpnDataItem {
VPN_DATA_ITEM_USERNAME
};
static const gchar *
static const char *
get_vpn_data_item (NMConnection *connection, enum VpnDataItem vpn_data_item)
{
const char *type;
......@@ -3218,7 +3218,7 @@ get_valid_properties_string (const NMMetaSettingValidPartItem *const*array,
/* Search the array with the arguments of the current property */
for (j = 0; j < setting_info->properties_num; j++) {
gchar *new;
char *new;
const char *arg_name;
arg_name = setting_info->properties[j]->property_name;
......@@ -3702,7 +3702,7 @@ static const OptionInfo *_meta_abstract_get_option_info (const NMMetaAbstractInf
* The questionnaire (for --ask) will ask for them.
*/
static void
enable_options (const gchar *setting_name, const gchar *property, const gchar * const *opts)
enable_options (const char *setting_name, const char *property, const char * const *opts)
{
const NMMetaPropertyInfo *property_info;
......@@ -3740,7 +3740,7 @@ enable_options (const gchar *setting_name, const gchar *property, const gchar *
* The questionnaire (for --ask) will not ask for them.
*/
static void
disable_options (const gchar *setting_name, const gchar *property)
disable_options (const char *setting_name, const char *property)
{
const NMMetaPropertyInfo *property_infos_local[2];
const NMMetaPropertyInfo *const*property_infos;
......@@ -3898,7 +3898,7 @@ set_property (NMConnection *connection,
}
static gboolean
set_option (NmCli *nmc, NMConnection *connection, const NMMetaAbstractInfo *abstract_info, const gchar *value, GError **error)
set_option (NmCli *nmc, NMConnection *connection, const NMMetaAbstractInfo *abstract_info, const char *value, GError **error)
{
const char *setting_name, *property_name, *option_name;
NMMetaPropertyInfFlags inf_flags;
......@@ -4022,7 +4022,7 @@ set_connection_type (NmCli *nmc, NMConnection *con, const OptionInfo *option, co
const NMMetaSettingValidPartItem *const*type_settings;
const NMMetaSettingValidPartItem *const*slv_settings;
GError *local = NULL;
const gchar *master[] = { "master", NULL };
const char *master[] = { "master", NULL };
const char *slave_type = NULL;
value = check_valid_name_toplevel (value, &slave_type, &local);
......@@ -4130,7 +4130,7 @@ set_bond_option (NmCli *nmc, NMConnection *con, const OptionInfo *option, const
return FALSE;
if (g_strcmp0 (value, "active-backup") == 0) {
const gchar *primary[] = { "primary", NULL };
const char *primary[] = { "primary", NULL };
enable_options (NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS, primary);
}
......@@ -4165,9 +4165,9 @@ static gboolean
set_bond_monitoring_mode (NmCli *nmc, NMConnection *con, const OptionInfo *option, const char *value, GError **error)
{
NMSettingBond *s_bond;
gs_free gchar *monitor_mode = NULL;
const gchar *miimon_opts[] = { "miimon", "downdelay", "updelay", NULL };
const gchar *arp_opts[] = { "arp-interval", "arp-ip-target", NULL };
gs_free char *monitor_mode = NULL;
const char *miimon_opts[] = { "miimon", "downdelay", "updelay", NULL };
const char *arp_opts[] = { "arp-interval", "arp-ip-target", NULL };
s_bond = nm_connection_get_setting_bond (con);
g_return_val_if_fail (s_bond, FALSE);
......@@ -4336,8 +4336,8 @@ option_relevant (NMConnection *connection, const NMMetaAbstractInfo *abstract_in
static void
complete_property_name (NmCli *nmc, NMConnection *connection,
char modifier,
const gchar *prefix,
const gchar *postfix)
const char *prefix,
const char *postfix)
{
NMSettingConnection *s_con;
const NMMetaSettingValidPartItem *const*valid_settings_main;
......@@ -4412,7 +4412,7 @@ run_rl_generator (rl_compentry_func_t *generator_func, const char *prefix)
}
static gboolean
complete_option (const NMMetaAbstractInfo *abstract_info, const gchar *prefix, NMConnection *context_connection)
complete_option (const NMMetaAbstractInfo *abstract_info, const char *prefix, NMConnection *context_connection)
{
const OptionInfo *candidate;
const char *const*values;
......@@ -4443,7 +4443,7 @@ complete_option (const NMMetaAbstractInfo *abstract_info, const gchar *prefix, N
}
static void
complete_property (const gchar *setting_name, const gchar *property, const gchar *prefix, NMConnection *connection)
complete_property (const char *setting_name, const char *property, const char *prefix, NMConnection *connection)
{
const NMMetaPropertyInfo *property_info;
......@@ -4497,7 +4497,7 @@ nmc_read_connection_properties (NmCli *nmc,
/* Go through arguments and set properties */
do {
const NMMetaAbstractInfo *chosen = NULL;
gs_strfreev gchar **strv = NULL;
gs_strfreev char **strv = NULL;
const NMMetaSettingValidPartItem *const*type_settings;
const NMMetaSettingValidPartItem *const*slv_settings;
char modifier = '\0';
......@@ -4805,9 +4805,9 @@ next:
static void
ask_option (NmCli *nmc, NMConnection *connection, const NMMetaAbstractInfo *abstract_info)
{
gchar *value;
char *value;
GError *error = NULL;
gs_free gchar *prompt = NULL;
gs_free char *prompt = NULL;
gboolean multi;
const char *opt_prompt, *opt_def_hint;
NMMetaPropertyInfFlags inf_flags;
......
......@@ -3539,7 +3539,7 @@ generate_wpa_key (char *key, size_t len)
while (!g_ascii_isalnum (c))
c = g_random_int_range (33, 126);
key[i] = (gchar) c;
key[i] = (char) c;
}
key[WPA_PASSKEY_SIZE] = '\0';
}
......
......@@ -1324,7 +1324,7 @@ fail:
if (!has_minmax && is_flags) {
min = 0;
max = (gint) G_MAXUINT;
max = (int) G_MAXUINT;
}
valid_all = nm_utils_enum_get_values (gtype, min, max);
......@@ -1381,7 +1381,7 @@ _values_fcn_gobject_enum (ARGS_VALUES_FCN)
class = g_type_class_ref (gtype);
if (G_IS_FLAGS_CLASS (class)) {
min = 0;
max = (gint) G_MAXUINT;
max = (int) G_MAXUINT;
}
}
......
......@@ -175,7 +175,7 @@ on_cancelled (GCancellable *cancellable, gpointer user_data)
polkit_agent_session_cancel (priv->active_session);
}
static gint
static int
compare_users (gconstpointer a, gconstpointer b)
{
char *user;
......
......@@ -53,9 +53,9 @@ static guint signals[LAST_SIGNAL] = { 0 };
typedef struct {
NMSecretAgentSimple *self;
gchar *request_id;
char *request_id;
NMConnection *connection;
gchar **hints;
char **hints;
NMSecretAgentOldGetSecretsFunc callback;
gpointer callback_data;
} NMSecretAgentSimpleRequest;
......@@ -121,10 +121,10 @@ nm_secret_agent_simple_finalize (GObject *object)
}
static gboolean
strv_has (gchar **haystack,
gchar *needle)
strv_has (char **haystack,
char *needle)
{
gchar **iter;
char **iter;
for (iter = haystack; iter && *iter; iter++) {
if (g_strcmp0 (*iter, needle) == 0)
......@@ -609,9 +609,9 @@ request_secrets_from_ui (NMSecretAgentSimpleRequest *request)
static void
nm_secret_agent_simple_get_secrets (NMSecretAgentOld *agent,
NMConnection *connection,
const gchar *connection_path,
const gchar *setting_name,
const gchar **hints,
const char *connection_path,
const char *setting_name,
const char **hints,
NMSecretAgentGetSecretsFlags flags,
NMSecretAgentOldGetSecretsFunc callback,
gpointer callback_data)
......@@ -644,7 +644,7 @@ nm_secret_agent_simple_get_secrets (NMSecretAgentOld *agent,
request = g_slice_new (NMSecretAgentSimpleRequest);
request->self = g_object_ref (self);
request->connection = g_object_ref (connection);
request->hints = g_strdupv ((gchar **)hints);
request->hints = g_strdupv ((char **)hints);
request->callback = callback;
request->callback_data = callback_data;
request->request_id = request_id;
......@@ -747,8 +747,8 @@ nm_secret_agent_simple_response (NMSecretAgentSimple *self,
static void
nm_secret_agent_simple_cancel_get_secrets (NMSecretAgentOld *agent,
const gchar *connection_path,
const gchar *setting_name)
const char *connection_path,
const char *setting_name)
{
NMSecretAgentSimple *self = NM_SECRET_AGENT_SIMPLE (agent);
NMSecretAgentSimplePrivate *priv = NM_SECRET_AGENT_SIMPLE_GET_PRIVATE (self);
......@@ -761,7 +761,7 @@ nm_secret_agent_simple_cancel_get_secrets (NMSecretAgentOld *agent,
static void
nm_secret_agent_simple_save_secrets (NMSecretAgentOld *agent,
NMConnection *connection,
const gchar *connection_path,
const char *connection_path,
NMSecretAgentOldSaveSecretsFunc callback,
gpointer callback_data)
{
......@@ -772,7 +772,7 @@ nm_secret_agent_simple_save_secrets (NMSecretAgentOld *agent,
static void
nm_secret_agent_simple_delete_secrets (NMSecretAgentOld *agent,
NMConnection *connection,
const gchar *connection_path,
const char *connection_path,
NMSecretAgentOldDeleteSecretsFunc callback,
gpointer callback_data)
{
......
......@@ -59,7 +59,7 @@ value_transform_string_uint (const GValue *src_value,
if (val < 0 || val > G_MAXUINT || *end)
return;
g_value_set_uint (dest_value, (gint) val);
g_value_set_uint (dest_value, (int) val);
}
void
......@@ -180,9 +180,9 @@ ip_addresses_with_prefix_from_strv (GBinding *binding,
void
nm_editor_bind_ip_addresses_with_prefix_to_strv (int addr_family,
gpointer source,
const gchar *source_property,
const char *source_property,
gpointer target,
const gchar *target_property,
const char *target_property,
GBindingFlags flags)
{
g_object_bind_property_full (source, source_property,
......@@ -232,9 +232,9 @@ ip_addresses_check_and_copy (GBinding *binding,
void
nm_editor_bind_ip_addresses_to_strv (int addr_family,
gpointer source,
const gchar *source_property,
const char *source_property,
gpointer target,
const gchar *target_property,
const char *target_property,
GBindingFlags flags)
{
g_object_bind_property_full (source, source_property,
......@@ -328,8 +328,8 @@ void
nm_editor_bind_ip_gateway_to_string (int addr_family,
NMSettingIPConfig *source,
gpointer target,
const gchar *target_property,
const gchar *target_sensitive_property,
const char *target_property,
const char *target_sensitive_property,
GBindingFlags flags)
{
g_object_bind_property_full (source, "gateway",
......@@ -535,13 +535,13 @@ ip_route_transform_from_metric_string (GBinding *binding,
void
nm_editor_bind_ip_route_to_strings (int addr_family,
gpointer source,
const gchar *source_property,
const char *source_property,
gpointer dest_target,
const gchar *dest_target_property,
const char *dest_target_property,
gpointer next_hop_target,
const gchar *next_hop_target_property,
const char *next_hop_target_property,
gpointer metric_target,
const gchar *metric_target_property,
const char *metric_target_property,
GBindingFlags flags)
{
g_object_bind_property_full (source, source_property,
......
......@@ -23,33 +23,33 @@ void nm_editor_bindings_init (void);
void nm_editor_bind_ip_addresses_with_prefix_to_strv (int family,
gpointer source,
const gchar *source_property,
const char *source_property,
gpointer target,
const gchar *target_property,
const char *target_property,
GBindingFlags flags);
void nm_editor_bind_ip_addresses_to_strv (int family,
gpointer source,
const gchar *source_property,
const char *source_property,
gpointer target,
const gchar *target_property,
const char *target_property,
GBindingFlags flags);
void nm_editor_bind_ip_gateway_to_string (int family,
NMSettingIPConfig *source,
gpointer target,
const gchar *target_property,
const gchar *target_sensitive_property,
const char *target_property,
const char *target_sensitive_property,
GBindingFlags flags);
void nm_editor_bind_ip_route_to_strings (int family,
gpointer source,
const gchar *source_property,
const char *source_property,
gpointer dest_target,
const gchar *dest_target_property,
const char *dest_target_property,
gpointer next_hop_target,
const gchar *next_hop_target_property,
const char *next_hop_target_property,
gpointer metric_target,
const gchar *metric_target_property,
const char *metric_target_property,
GBindingFlags flags);
void nm_editor_bind_wireless_security_method (NMConnection *connection,
......
......@@ -33,7 +33,7 @@
static GSList *vpn_plugins;
static gint
static int
sort_vpn_plugins (gconstpointer a, gconstpointer b)
{
NMVpnEditorPlugin *aa = NM_VPN_EDITOR_PLUGIN (a);
......@@ -93,7 +93,7 @@ typedef struct {
gboolean no_autoconnect;
} NMEditorConnectionTypeDataReal;
static gint
static int
sort_types (gconstpointer a, gconstpointer b)
{
NMEditorConnectionTypeData *typea = *(NMEditorConnectionTypeData **)a;
......
......@@ -94,7 +94,7 @@ add_offset (GBinding *binding,
gpointer user_data)
{
guint v;
gint offset = GPOINTER_TO_INT (user_data);
int offset = GPOINTER_TO_INT (user_data);
g_return_val_if_fail (G_VALUE_HOLDS (from_value, G_TYPE_UINT), FALSE);
g_return_val_if_fail (G_VALUE_HOLDS (to_value, G_TYPE_UINT), FALSE);
......
......@@ -54,7 +54,7 @@ typedef struct {
Request *current_request;
GQueue *requests_waiting;
gint num_requests_pending;
int num_requests_pending;
} Handler;
typedef struct {
......@@ -131,8 +131,8 @@ struct Request {
GPtrArray *scripts; /* list of ScriptInfo */
guint idx;
gint num_scripts_done;
gint num_scripts_nowait;
int num_scripts_done;
int num_scripts_nowait;
};
/*****************************************************************************/
......@@ -387,7 +387,7 @@ complete_script (ScriptInfo *script)
}
static void
script_watch_cb (GPid pid, gint status, gpointer user_data)
script_watch_cb (GPid pid, int status, gpointer user_data)
{
ScriptInfo *script = user_data;
guint err;
......@@ -528,7 +528,7 @@ static gboolean
script_dispatch (ScriptInfo *script)
{
GError *error = NULL;
gchar *argv[4];
char *argv[4];
Request *request = script->request;
if (script->dispatched)
......@@ -828,9 +828,9 @@ on_name_lost (GDBusConnection *connection,
}
static void
log_handler (const gchar *log_domain,
log_handler (const char *log_domain,
GLogLevelFlags log_level,
const gchar *message,
const char *message,
gpointer ignored)
{
int syslog_priority;
......
......@@ -124,7 +124,7 @@ parse_device (GKeyFile *kf, GVariant **out_device_props, GError **error)
{
GVariantBuilder props;
char *tmp;
gint i;
int i;
g_variant_builder_init (&props, G_VARIANT_TYPE ("a{sv}"));
......
......@@ -32,8 +32,8 @@
static void
on_name_appeared (GDBusConnection *connection,
const gchar *name,
const gchar *name_owner,
const char *name,
const char *name_owner,
gpointer user_data)
{
g_print ("Name '%s' on the system bus is owned by %s => NM is running\n",
......@@ -42,7 +42,7 @@ on_name_appeared (GDBusConnection *connection,
static void
on_name_vanished (GDBusConnection *connection,
const gchar *name,
const char *name,
gpointer user_data)
{
g_print ("Name '%s' does not exist on the system bus => NM is not running\n", name);
......
......@@ -59,15 +59,15 @@ nm_state_to_string (NMState state)
static void
on_signal (GDBusProxy *proxy,
gchar *sender_name,
gchar *signal_name,
char *sender_name,
char *signal_name,
GVariant *parameters,
gpointer user_data)
{
guint32 new_state;
/* Print all signals */
//gchar *parameters_str;
//char *parameters_str;
//parameters_str = g_variant_print (parameters, TRUE);
//g_print (" *** Received Signal: %s: %s\n", signal_name, parameters_str);
//g_free (parameters_str);
......
......@@ -399,7 +399,7 @@ crypto_verify_pkcs12 (const guint8 *data,
PK11SlotInfo *slot = NULL;
SECStatus s;
gunichar2 *ucs2_password;
glong ucs2_chars = 0;
long ucs2_chars = 0;
#ifndef WORDS_BIGENDIAN
guint16 *p;
#endif /* WORDS_BIGENDIAN */
......
......@@ -320,11 +320,11 @@ GVariant *_nm_dbus_proxy_call_finish (GDBusProxy *proxy,
GError **error);
GVariant *_nm_dbus_proxy_call_sync (GDBusProxy *proxy,
const gchar *method_name,
const char *method_name,
GVariant *parameters,
const GVariantType *reply_type,
GDBusCallFlags flags,
gint timeout_msec,
int timeout_msec,
GCancellable *cancellable,
GError **error);
......
......@@ -117,7 +117,7 @@ dbus_signal_meta_marshal (GClosure *closure,
*
* The argument types in @c_handler correspond to the types output by
* g_dbus_gvariant_to_gvalue(), except for 'ay' and 'aay'. In particular:
* - both 16-bit and 32-bit integers are passed as #gint/#guint
* - both 16-bit and 32-bit integers are passed as #int/#guint
* - 'as' values are passed as #GStrv (char **)
* - all other array, tuple, and dict types are passed as #GVariant
*
......@@ -245,11 +245,11 @@ _nm_dbus_proxy_call_finish (GDBusProxy *proxy,
*/
GVariant *
_nm_dbus_proxy_call_sync (GDBusProxy *proxy,
const gchar *method_name,
const char *method_name,
GVariant *parameters,
const GVariantType *reply_type,
GDBusCallFlags flags,
gint timeout_msec,
int timeout_msec,
GCancellable *cancellable,
GError **error)
{
......
......@@ -109,8 +109,8 @@ nm_keyfile_plugin_kf_set_##stype##_list (GKeyFile *kf, \
g_key_file_set_##stype##_list (kf, alias ?: group, key, list, length); \
}
DEFINE_KF_LIST_WRAPPER(integer, gint*, gint);
DEFINE_KF_LIST_WRAPPER(string, gchar **, const gchar* const);
DEFINE_KF_LIST_WRAPPER(integer, int*, int);
DEFINE_KF_LIST_WRAPPER(string, char **, const char* const);
void
nm_keyfile_plugin_kf_set_integer_list_uint8 (GKeyFile *kf,
......@@ -173,19 +173,19 @@ nm_keyfile_plugin_kf_set_##stype (GKeyFile *kf, \
g_key_file_set_##stype (kf, alias ?: group, key, value); \
}
DEFINE_KF_WRAPPER(string, gchar*, const gchar*);
DEFINE_KF_WRAPPER(integer, gint, gint);
DEFINE_KF_WRAPPER(string, char*, const char*);
DEFINE_KF_WRAPPER(integer, int, int);
DEFINE_KF_WRAPPER(uint64, guint64, guint64);
DEFINE_KF_WRAPPER(boolean, gboolean, gboolean);
DEFINE_KF_WRAPPER(value, gchar*, const gchar*);
DEFINE_KF_WRAPPER(value, char*, const char*);
gchar **
char **
nm_keyfile_plugin_kf_get_keys (GKeyFile *kf,
const char *group,
gsize *out_length,
GError **error)
{
gchar **keys;
char **keys;
const char *alias;
GError *local = NULL;
......
......@@ -46,8 +46,8 @@ void nm_keyfile_plugin_kf_set_##stype##_list (GKeyFile *kf, \
const char *key, \
set_ctype list[], \
gsize length);
DEFINE_KF_LIST_WRAPPER_PROTO(integer, gint*, gint)
DEFINE_KF_LIST_WRAPPER_PROTO(string, gchar**, const gchar* const)
DEFINE_KF_LIST_WRAPPER_PROTO(integer, int*, int)
DEFINE_KF_LIST_WRAPPER_PROTO(string, char**, const char* const)
void nm_keyfile_plugin_kf_set_integer_list_uint8 (GKeyFile *kf,
const char *group,
......@@ -66,14 +66,14 @@ void nm_keyfile_plugin_kf_set_##stype (GKeyFile *kf, \
const char *group, \
const char *key, \
set_ctype value);
DEFINE_KF_WRAPPER_PROTO(string, gchar*, const gchar*)
DEFINE_KF_WRAPPER_PROTO(integer, gint, gint)
DEFINE_KF_WRAPPER_PROTO(string, char*, const char*)
DEFINE_KF_WRAPPER_PROTO(integer, int, int)
DEFINE_KF_WRAPPER_PROTO(uint64, guint64, guint64)
DEFINE_KF_WRAPPER_PROTO(boolean, gboolean, gboolean)
DEFINE_KF_WRAPPER_PROTO(value, gchar*, const gchar*)
DEFINE_KF_WRAPPER_PROTO(value, char*, const char*)
/* Misc */
gchar ** nm_keyfile_plugin_kf_get_keys (GKeyFile *kf,
char ** nm_keyfile_plugin_kf_get_keys (GKeyFile *kf,
const char *group,
gsize *out_length,
GError **error);
......
......@@ -731,7 +731,7 @@ ip6_addr_gen_mode_parser (KeyfileReaderInfo *info, NMSetting *setting, const cha
} else
addr_gen_mode = NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64;
g_object_set (G_OBJECT (setting), key, (gint) addr_gen_mode, NULL);
g_object_set (G_OBJECT (setting), key, (int) addr_gen_mode, NULL);
}
static void
......@@ -1393,7 +1393,7 @@ qdisc_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
{
const char *setting_name = nm_setting_get_name (setting);
GPtrArray *qdiscs;
gs_strfreev gchar **keys = NULL;
gs_strfreev char **keys = NULL;
gsize n_keys = 0;
int i;
......@@ -1441,7 +1441,7 @@ tfilter_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
{
const char *setting_name = nm_setting_get_name (setting);
GPtrArray *tfilters;
gs_strfreev gchar **keys = NULL;
gs_strfreev char **keys = NULL;
gsize n_keys = 0;
int i;
......@@ -1525,7 +1525,7 @@ write_array_of_uint (GKeyFile *file,
g_return_if_fail (g_array_get_element_size (array) == sizeof (guint));
tmp_array = g_new (gint, array->len);
tmp_array = g_new (int, array->len);
for (i = 0; i < array->len; i++) {
guint v = g_array_index (array, guint, i);
......@@ -2522,7 +2522,7 @@ read_one_setting_value (NMSetting *setting,
} else
g_object_set (setting, key, int_val, NULL);
} else if (type == G_TYPE_BYTES) {
gint *tmp;
int *tmp;
GByteArray *array;
GBytes *bytes;
gsize length;
......@@ -2555,7 +2555,7 @@ read_one_setting_value (NMSetting *setting,
g_bytes_unref (bytes);
g_free (tmp);
} else if (type == G_TYPE_STRV) {
gchar **sa;
char **sa;
gsize length;
sa = nm_keyfile_plugin_kf_get_string_list (keyfile, setting_name, key, &length, NULL);
......@@ -2581,11 +2581,11 @@ read_one_setting_value (NMSetting *setting,
}
}
} else if (G_VALUE_HOLDS_ENUM (value)) {
gint int_val;
int int_val;
int_val = nm_keyfile_plugin_kf_get_integer (keyfile, setting_name, key, &err);
if (!err)
g_object_set (setting, key, (gint) int_val, NULL);
g_object_set (setting, key, (int) int_val, NULL);
} else {
if (!handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN,
_("unhandled setting property type '%s'"),
......@@ -2675,7 +2675,7 @@ nm_keyfile_read (GKeyFile *keyfile,
gs_unref_object NMConnection *connection = NULL;
NMSettingConnection *s_con;
NMSetting *setting;
gchar **groups;
char **groups;
gsize length;
int i;
gboolean vpn_secrets = FALSE;
......@@ -2880,7 +2880,7 @@ write_setting_value (NMSetting *setting,
char **array;
array = (char **) g_value_get_boxed (value);
nm_keyfile_plugin_kf_set_string_list (info->keyfile, setting_name, key, (const gchar **const) array, g_strv_length (array));
nm_keyfile_plugin_kf_set_string_list (info->keyfile, setting_name, key, (const char **const) array, g_strv_length (array));
} else if (type == G_TYPE_HASH_TABLE) {
write_hash_of_string (info->keyfile, setting, key, value);
} else if (type == G_TYPE_ARRAY) {
......@@ -2889,7 +2889,7 @@ write_setting_value (NMSetting *setting,
/* Flags are guint but GKeyFile has no uint reader, just uint64 */
nm_keyfile_plugin_kf_set_uint64 (info->keyfile, setting_name, key, (guint64) g_value_get_flags (value));