From 7627173c0e33905e0fee72542f9232ea0e6b1e9c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 2 Apr 2020 13:39:39 +0200 Subject: [PATCH] cli: make nmc_meta_environment_arg const pointer Of course, we later pass the point on, where we need to cast the constness away again. This is more a reminder that we aren't suppost to change the variable. --- clients/cli/connections.c | 4 ++-- clients/cli/settings.c | 6 +++--- clients/cli/utils.c | 4 ++-- clients/cli/utils.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clients/cli/connections.c b/clients/cli/connections.c index ff3314236b..4537814776 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -3842,7 +3842,7 @@ _meta_abstract_complete (const NMMetaAbstractInfo *abstract_info, const char *te values = nm_meta_abstract_info_complete (abstract_info, nmc_meta_environment, - nmc_meta_environment_arg, + (gpointer) nmc_meta_environment_arg, &ctx, text, NULL, @@ -4642,7 +4642,7 @@ complete_option (NmCli *nmc, const NMMetaAbstractInfo *abstract_info, const char values = nm_meta_abstract_info_complete (abstract_info, nmc_meta_environment, - nmc_meta_environment_arg, + (gpointer) nmc_meta_environment_arg, &ctx, prefix, &complete_filename, diff --git a/clients/cli/settings.c b/clients/cli/settings.c index 698471d7ef..d4cae2b3ad 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -456,7 +456,7 @@ const NMMetaEnvironment *const nmc_meta_environment = &((NMMetaEnvironment) { .get_nm_connections = _env_get_nm_connections, }); -NmCli *const nmc_meta_environment_arg = &nm_cli; +const NmCli *const nmc_meta_environment_arg = &nm_cli; static char * get_property_val (NMSetting *setting, const char *prop, NMMetaAccessorGetType get_type, gboolean show_secrets, GError **error) @@ -475,7 +475,7 @@ get_property_val (NMSetting *setting, const char *prop, NMMetaAccessorGetType ge value = property_info->property_type->get_fcn (property_info, nmc_meta_environment, - nmc_meta_environment_arg, + (gpointer) nmc_meta_environment_arg, setting, get_type, show_secrets ? NM_META_ACCESSOR_GET_FLAGS_SHOW_SECRETS : 0, @@ -568,7 +568,7 @@ nmc_setting_set_property (NMClient *client, g_object_freeze_notify (G_OBJECT (setting)); success = property_info->property_type->set_fcn (property_info, nmc_meta_environment, - nmc_meta_environment_arg, + (gpointer) nmc_meta_environment_arg, setting, modifier, value, diff --git a/clients/cli/utils.c b/clients/cli/utils.c index d8524c55a1..c5a4c38ea0 100644 --- a/clients/cli/utils.c +++ b/clients/cli/utils.c @@ -1067,7 +1067,7 @@ _print_fill (const NmcConfig *nmc_config, value = nm_meta_abstract_info_get (info, nmc_meta_environment, - nmc_meta_environment_arg, + (gpointer) nmc_meta_environment_arg, target, targets_data, text_get_type, @@ -1112,7 +1112,7 @@ _print_fill (const NmcConfig *nmc_config, cell->color = GPOINTER_TO_INT (nm_meta_abstract_info_get (info, nmc_meta_environment, - nmc_meta_environment_arg, + (gpointer) nmc_meta_environment_arg, target, targets_data, NM_META_ACCESSOR_GET_TYPE_COLOR, diff --git a/clients/cli/utils.h b/clients/cli/utils.h index e699a641b6..e770a50b9b 100644 --- a/clients/cli/utils.h +++ b/clients/cli/utils.h @@ -66,7 +66,7 @@ void print_data (const NmcConfig *nmc_config, /*****************************************************************************/ extern const NMMetaEnvironment *const nmc_meta_environment; -extern NmCli *const nmc_meta_environment_arg; +extern const NmCli *const nmc_meta_environment_arg; typedef enum {