[gtk/wip/otte/whatever: 73/83] stringlist: Take a const char const * argument



commit 8556221429f44f9b4e11045efff826d39bc3122f
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 d4f90c6781..61e8847d6d 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]