[gtk/wip/otte/whatever: 4/5] stringlist: Take a const char const * argument
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/whatever: 4/5] stringlist: Take a const char const * argument
- Date: Sat, 27 Jun 2020 04:40:28 +0000 (UTC)
commit e796b38ed94b77bdbda5ff32bed6159688df772c
Author: Benjamin Otte <otte redhat com>
Date: Sat Jun 27 06:31:18 2020 +0200
stringlist: Take a const char const * argument
Sucks that we need to cast a char**, but otherwise we need to cast
{"foo", "bar", "baz" } arrays.
gtk/gtkdropdown.c | 2 +-
gtk/gtkstringlist.c | 2 +-
gtk/gtkstringlist.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkdropdown.c b/gtk/gtkdropdown.c
index 721493dd3f..70e45c2712 100644
--- a/gtk/gtkdropdown.c
+++ b/gtk/gtkdropdown.c
@@ -943,7 +943,7 @@ gtk_drop_down_set_from_strings (GtkDropDown *self,
set_default_factory (self);
- model = G_LIST_MODEL (gtk_string_list_new ((const char **)texts));
+ model = G_LIST_MODEL (gtk_string_list_new (texts));
gtk_drop_down_set_model (self, model);
g_object_unref (model);
}
diff --git a/gtk/gtkstringlist.c b/gtk/gtkstringlist.c
index 753f11bdf8..0a989886de 100644
--- a/gtk/gtkstringlist.c
+++ b/gtk/gtkstringlist.c
@@ -432,7 +432,7 @@ gtk_string_list_init (GtkStringList *self)
* Returns: a new #GtkStringList
*/
GtkStringList *
-gtk_string_list_new (const char **strings)
+gtk_string_list_new (const char * const *strings)
{
GtkStringList *self;
guint i;
diff --git a/gtk/gtkstringlist.h b/gtk/gtkstringlist.h
index 31c788312a..0a29612ef8 100644
--- a/gtk/gtkstringlist.h
+++ b/gtk/gtkstringlist.h
@@ -45,7 +45,7 @@ GDK_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (GtkStringList, gtk_string_list, GTK, STRING_LIST, GObject)
GDK_AVAILABLE_IN_ALL
-GtkStringList * gtk_string_list_new (const char **strings);
+GtkStringList * gtk_string_list_new (const char * const *strings);
GDK_AVAILABLE_IN_ALL
void gtk_string_list_append (GtkStringList *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]