[Libosinfo] [PATCH] Drop redundant 'const' keyword from object parameters
Zeeshan Ali
zeeshanak at gnome.org
Sun Nov 12 16:04:19 UTC 2017
Use of 'const' parameter on object parameters is redundant, inconsistent
(both internally and against other GObject libraries) and currently breaks
the low-level Rust binding generator:
https://github.com/gtk-rs/glib/pull/249
---
osinfo/osinfo_install_config_param.c | 10 +++++-----
osinfo/osinfo_install_config_param.h | 10 +++++-----
osinfo/osinfo_install_script.c | 10 +++++-----
osinfo/osinfo_install_script.h | 10 +++++-----
4 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/osinfo/osinfo_install_config_param.c b/osinfo/osinfo_install_config_param.c
index f74a802..4adcd07 100644
--- a/osinfo/osinfo_install_config_param.c
+++ b/osinfo/osinfo_install_config_param.c
@@ -221,7 +221,7 @@ OsinfoInstallConfigParam *osinfo_install_config_param_new(const gchar *name)
*
* Returns: (transfer none): the name of the configuration parameter
*/
-const gchar *osinfo_install_config_param_get_name(const OsinfoInstallConfigParam *config_param)
+const gchar *osinfo_install_config_param_get_name(OsinfoInstallConfigParam *config_param)
{
return osinfo_entity_get_param_value(OSINFO_ENTITY(config_param),
OSINFO_INSTALL_CONFIG_PARAM_PROP_NAME);
@@ -233,7 +233,7 @@ const gchar *osinfo_install_config_param_get_name(const OsinfoInstallConfigParam
*
* Returns: (transfer none): the policy of the configuration parameter
*/
-OsinfoInstallConfigParamPolicy osinfo_install_config_param_get_policy(const OsinfoInstallConfigParam *config_param)
+OsinfoInstallConfigParamPolicy osinfo_install_config_param_get_policy(OsinfoInstallConfigParam *config_param)
{
return osinfo_entity_get_param_value_enum(OSINFO_ENTITY(config_param),
OSINFO_INSTALL_CONFIG_PARAM_PROP_POLICY,
@@ -248,7 +248,7 @@ OsinfoInstallConfigParamPolicy osinfo_install_config_param_get_policy(const Osin
* Returns: (transfer none): TRUE if the config_param is required.
* FALSE otherwise.
*/
-gboolean osinfo_install_config_param_is_required(const OsinfoInstallConfigParam *config_param)
+gboolean osinfo_install_config_param_is_required(OsinfoInstallConfigParam *config_param)
{
return (osinfo_install_config_param_get_policy(config_param) ==
OSINFO_INSTALL_CONFIG_PARAM_POLICY_REQUIRED);
@@ -261,13 +261,13 @@ gboolean osinfo_install_config_param_is_required(const OsinfoInstallConfigParam
* Returns: (transfer none): TRUE if the config_param is optional.
* FALSE otherwise.
*/
-gboolean osinfo_install_config_param_is_optional(const OsinfoInstallConfigParam *config_param)
+gboolean osinfo_install_config_param_is_optional(OsinfoInstallConfigParam *config_param)
{
return (osinfo_install_config_param_get_policy(config_param) ==
OSINFO_INSTALL_CONFIG_PARAM_POLICY_OPTIONAL);
}
-OsinfoDatamap *osinfo_install_config_param_get_value_map(const OsinfoInstallConfigParam *config_param)
+OsinfoDatamap *osinfo_install_config_param_get_value_map(OsinfoInstallConfigParam *config_param)
{
return config_param->priv->value_map;
}
diff --git a/osinfo/osinfo_install_config_param.h b/osinfo/osinfo_install_config_param.h
index 58bb40b..8c083f3 100644
--- a/osinfo/osinfo_install_config_param.h
+++ b/osinfo/osinfo_install_config_param.h
@@ -81,16 +81,16 @@ GType osinfo_install_config_param_get_type(void);
OsinfoInstallConfigParam *osinfo_install_config_param_new(const gchar *name);
-const gchar *osinfo_install_config_param_get_name(const OsinfoInstallConfigParam *config_param);
+const gchar *osinfo_install_config_param_get_name(OsinfoInstallConfigParam *config_param);
-OsinfoInstallConfigParamPolicy osinfo_install_config_param_get_policy(const OsinfoInstallConfigParam *config_param);
+OsinfoInstallConfigParamPolicy osinfo_install_config_param_get_policy(OsinfoInstallConfigParam *config_param);
-gboolean osinfo_install_config_param_is_required(const OsinfoInstallConfigParam *config_param);
+gboolean osinfo_install_config_param_is_required(OsinfoInstallConfigParam *config_param);
-gboolean osinfo_install_config_param_is_optional(const OsinfoInstallConfigParam *config_param);
+gboolean osinfo_install_config_param_is_optional(OsinfoInstallConfigParam *config_param);
void osinfo_install_config_param_set_value_map(OsinfoInstallConfigParam *config_param, OsinfoDatamap *datamap);
-OsinfoDatamap *osinfo_install_config_param_get_value_map(const OsinfoInstallConfigParam *config_param);
+OsinfoDatamap *osinfo_install_config_param_get_value_map(OsinfoInstallConfigParam *config_param);
#endif /* __OSINFO_INSTALL_CONFIG_PARAM_H__ */
diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c
index 4856eae..52b6d75 100644
--- a/osinfo/osinfo_install_script.c
+++ b/osinfo/osinfo_install_script.c
@@ -266,7 +266,7 @@ void osinfo_install_script_add_config_param(OsinfoInstallScript *script, OsinfoI
OSINFO_ENTITY(param));
}
-gboolean osinfo_install_script_has_config_param(const OsinfoInstallScript *script, const OsinfoInstallConfigParam *config_param)
+gboolean osinfo_install_script_has_config_param(OsinfoInstallScript *script, OsinfoInstallConfigParam *config_param)
{
/* NB: this code assumes that the 'id' and 'name' entity properties
* are the same
@@ -275,7 +275,7 @@ gboolean osinfo_install_script_has_config_param(const OsinfoInstallScript *scrip
return osinfo_install_script_has_config_param_name(script, name);
}
-gboolean osinfo_install_script_has_config_param_name(const OsinfoInstallScript *script, const gchar *name)
+gboolean osinfo_install_script_has_config_param_name(OsinfoInstallScript *script, const gchar *name)
{
OsinfoList *l = OSINFO_LIST(script->priv->config_params);
return (osinfo_list_find_by_id(l, name) != NULL);
@@ -291,7 +291,7 @@ gboolean osinfo_install_script_has_config_param_name(const OsinfoInstallScript *
* list of valid #OsinfoInstallConfigParam parameters. Free with
* g_list_free() when done. The elements are owned by libosinfo.
*/
-GList *osinfo_install_script_get_config_param_list(const OsinfoInstallScript *script)
+GList *osinfo_install_script_get_config_param_list(OsinfoInstallScript *script)
{
return osinfo_list_get_elements(OSINFO_LIST(script->priv->config_params));
}
@@ -305,7 +305,7 @@ GList *osinfo_install_script_get_config_param_list(const OsinfoInstallScript *sc
* Returns: (transfer none): the list of valid #OsinfoInstallConfigParam
* parameters.
*/
-OsinfoInstallConfigParamList *osinfo_install_script_get_config_params(const OsinfoInstallScript *script)
+OsinfoInstallConfigParamList *osinfo_install_script_get_config_params(OsinfoInstallScript *script)
{
return script->priv->config_params;
}
@@ -321,7 +321,7 @@ OsinfoInstallConfigParamList *osinfo_install_script_get_config_params(const Osin
* NULL otherwise.
*/
OsinfoInstallConfigParam *
-osinfo_install_script_get_config_param(const OsinfoInstallScript *script,
+osinfo_install_script_get_config_param(OsinfoInstallScript *script,
const gchar *name)
{
/* NB: this code assumes that the 'id' and 'name' entity properties
diff --git a/osinfo/osinfo_install_script.h b/osinfo/osinfo_install_script.h
index 61bf0e4..e07ab5e 100644
--- a/osinfo/osinfo_install_script.h
+++ b/osinfo/osinfo_install_script.h
@@ -235,14 +235,14 @@ gchar *osinfo_install_script_generate_command_line_for_media(OsinfoInstallScript
OsinfoMedia *media,
OsinfoInstallConfig *config);
-gboolean osinfo_install_script_has_config_param(const OsinfoInstallScript *script, const OsinfoInstallConfigParam *config_param);
+gboolean osinfo_install_script_has_config_param(OsinfoInstallScript *script, OsinfoInstallConfigParam *config_param);
-gboolean osinfo_install_script_has_config_param_name(const OsinfoInstallScript *script, const gchar *name);
+gboolean osinfo_install_script_has_config_param_name(OsinfoInstallScript *script, const gchar *name);
-OsinfoInstallConfigParam *osinfo_install_script_get_config_param(const OsinfoInstallScript *script, const gchar *name);
+OsinfoInstallConfigParam *osinfo_install_script_get_config_param(OsinfoInstallScript *script, const gchar *name);
-GList *osinfo_install_script_get_config_param_list(const OsinfoInstallScript *script);
-OsinfoInstallConfigParamList *osinfo_install_script_get_config_params(const OsinfoInstallScript *script);
+GList *osinfo_install_script_get_config_param_list(OsinfoInstallScript *script);
+OsinfoInstallConfigParamList *osinfo_install_script_get_config_params(OsinfoInstallScript *script);
OsinfoPathFormat osinfo_install_script_get_path_format(OsinfoInstallScript *script);
gboolean osinfo_install_script_get_can_pre_install_drivers(OsinfoInstallScript *script);
--
2.13.6
More information about the Libosinfo
mailing list