From 3ba50db92c23518fb5c0b713e58a8ca21e7994e0 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Tue, 25 Apr 2023 12:22:41 +0200 Subject: Use const attribute name input in atspi_*_get*_attribute_value() There is no point in having them mutable, and makes the API look more awkward and harder to use than it actually is. --- atspi/atspi-document.c | 4 ++-- atspi/atspi-document.h | 4 ++-- atspi/atspi-text.c | 6 +++--- atspi/atspi-text.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/atspi/atspi-document.c b/atspi/atspi-document.c index de2ad373..dad05595 100644 --- a/atspi/atspi-document.c +++ b/atspi/atspi-document.c @@ -58,7 +58,7 @@ atspi_document_get_locale (AtspiDocument *obj, GError **error) **/ gchar * atspi_document_get_attribute_value (AtspiDocument *obj, - gchar *attribute, + const gchar *attribute, GError **error) { return atspi_document_get_document_attribute_value (obj, attribute, error); @@ -76,7 +76,7 @@ atspi_document_get_attribute_value (AtspiDocument *obj, **/ gchar * atspi_document_get_document_attribute_value (AtspiDocument *obj, - gchar *attribute, + const gchar *attribute, GError **error) { gchar *retval = NULL; diff --git a/atspi/atspi-document.h b/atspi/atspi-document.h index 5dd228c8..653aca3d 100644 --- a/atspi/atspi-document.h +++ b/atspi/atspi-document.h @@ -48,10 +48,10 @@ struct _AtspiDocument gchar *atspi_document_get_locale (AtspiDocument *obj, GError **error); #ifndef ATSPI_DISABLE_DEPRECATED -gchar *atspi_document_get_attribute_value (AtspiDocument *obj, gchar *attribute, GError **error); +gchar *atspi_document_get_attribute_value (AtspiDocument *obj, const gchar *attribute, GError **error); #endif -gchar *atspi_document_get_document_attribute_value (AtspiDocument *obj, gchar *attribute, GError **error); +gchar *atspi_document_get_document_attribute_value (AtspiDocument *obj, const gchar *attribute, GError **error); #ifndef ATSPI_DISABLE_DEPRECATED GHashTable *atspi_document_get_attributes (AtspiDocument *obj, GError **error); diff --git a/atspi/atspi-text.c b/atspi/atspi-text.c index 48e62913..c9161501 100644 --- a/atspi/atspi-text.c +++ b/atspi/atspi-text.c @@ -308,7 +308,7 @@ atspi_text_get_attribute_run (AtspiText *obj, gchar * atspi_text_get_attribute_value (AtspiText *obj, gint offset, - gchar *attribute_name, + const gchar *attribute_name, GError **error) { return atspi_text_get_text_attribute_value (obj, offset, attribute_name, @@ -329,7 +329,7 @@ atspi_text_get_attribute_value (AtspiText *obj, gchar * atspi_text_get_text_attribute_value (AtspiText *obj, gint offset, - gchar *attribute_name, + const gchar *attribute_name, GError **error) { gchar *retval = NULL; @@ -337,7 +337,7 @@ atspi_text_get_text_attribute_value (AtspiText *obj, g_return_val_if_fail (obj != NULL, NULL); - _atspi_dbus_call (obj, atspi_interface_text, "GetAttributeValue", error, "is=>s", d_i, (const gchar *) attribute_name, &retval); + _atspi_dbus_call (obj, atspi_interface_text, "GetAttributeValue", error, "is=>s", d_i, attribute_name, &retval); if (!retval) retval = g_strdup (""); diff --git a/atspi/atspi-text.h b/atspi/atspi-text.h index 61375b18..f8f949bf 100644 --- a/atspi/atspi-text.h +++ b/atspi/atspi-text.h @@ -97,10 +97,10 @@ GHashTable *atspi_text_get_text_attributes (AtspiText *obj, gint offset, gint *s GHashTable *atspi_text_get_attribute_run (AtspiText *obj, gint offset, gboolean include_defaults, gint *start_offset, gint *end_offset, GError **error); #ifndef ATSPI_DISABLE_DEPRECATED -gchar *atspi_text_get_attribute_value (AtspiText *obj, gint offset, gchar *attribute_name, GError **error); +gchar *atspi_text_get_attribute_value (AtspiText *obj, gint offset, const gchar *attribute_name, GError **error); #endif -gchar *atspi_text_get_text_attribute_value (AtspiText *obj, gint offset, gchar *attribute_name, GError **error); +gchar *atspi_text_get_text_attribute_value (AtspiText *obj, gint offset, const gchar *attribute_name, GError **error); GHashTable *atspi_text_get_default_attributes (AtspiText *obj, GError **error); -- cgit v1.2.1