[virt-tools-list] [libosinfo 2/3] Add missing 'const' OsinfoList function params

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Thu Jan 19 00:37:06 UTC 2012


From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>

---
 osinfo/osinfo_filter.c |    8 +++++---
 osinfo/osinfo_filter.h |   10 +++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/osinfo/osinfo_filter.c b/osinfo/osinfo_filter.c
index 1e090ea..69dcc19 100644
--- a/osinfo/osinfo_filter.c
+++ b/osinfo/osinfo_filter.c
@@ -126,7 +126,9 @@ osinfo_filter_init (OsinfoFilter *filter)
  * @propName, with different values, the entity have
  * all property values.
  */
-void osinfo_filter_add_constraint(OsinfoFilter *filter, gchar *propName, gchar *propVal)
+void osinfo_filter_add_constraint(OsinfoFilter *filter,
+                                  const gchar *propName,
+                                  const gchar *propVal)
 {
     g_return_if_fail(OSINFO_IS_FILTER(filter));
     g_return_if_fail(propName != NULL);
@@ -157,7 +159,7 @@ void osinfo_filter_add_constraint(OsinfoFilter *filter, gchar *propName, gchar *
  * Remove all filter constraints for the matching property
  * name.
  */
-void osinfo_filter_clear_constraint(OsinfoFilter *filter, gchar *propName)
+void osinfo_filter_clear_constraint(OsinfoFilter *filter, const gchar *propName)
 {
     g_hash_table_remove(filter->priv->propertyConstraints, propName);
 }
@@ -198,7 +200,7 @@ GList *osinfo_filter_get_constraint_keys(OsinfoFilter *filter)
  *
  * Returns: (transfer container)(element-type utf8): List of constraint values
  */
-GList *osinfo_filter_get_constraint_values(OsinfoFilter *filter, gchar *propName)
+GList *osinfo_filter_get_constraint_values(OsinfoFilter *filter, const gchar *propName)
 {
     g_return_val_if_fail(OSINFO_IS_FILTER(filter), NULL);
     g_return_val_if_fail(propName != NULL, NULL);
diff --git a/osinfo/osinfo_filter.h b/osinfo/osinfo_filter.h
index fa271d7..2464c69 100644
--- a/osinfo/osinfo_filter.h
+++ b/osinfo/osinfo_filter.h
@@ -69,13 +69,17 @@ GType osinfo_filter_get_type(void);
 
 OsinfoFilter *osinfo_filter_new(void);
 
-void osinfo_filter_add_constraint(OsinfoFilter *filter, gchar *propName, gchar *propVal);
+void osinfo_filter_add_constraint(OsinfoFilter *filter,
+                                  const gchar *propName,
+                                  const gchar *propVal);
 
-void osinfo_filter_clear_constraint(OsinfoFilter *filter, gchar *propName);
+void osinfo_filter_clear_constraint(OsinfoFilter *filter,
+                                    const gchar *propName);
 void osinfo_filter_clear_constraints(OsinfoFilter *filter);
 
 GList *osinfo_filter_get_constraint_keys(OsinfoFilter *filter);
-GList *osinfo_filter_get_constraint_values(OsinfoFilter *filter, gchar *propName);
+GList *osinfo_filter_get_constraint_values(OsinfoFilter *filter,
+                                           const gchar *propName);
 
 gboolean osinfo_filter_matches(OsinfoFilter *filter,
 			       OsinfoEntity *entity);
-- 
1.7.7.5




More information about the virt-tools-list mailing list