[gtk/wip/baedert/for-master: 23/54] gtkbuilder: Remove pointless function prototype




commit 7fd9b0c97f122e0e6ae2a59452e1d484aec65b8c
Author: Timm Bäder <mail baedert org>
Date:   Thu Oct 8 05:56:26 2020 +0200

    gtkbuilder: Remove pointless function prototype

 gtk/gtkbuilder.c        | 93 +++++++++++++++++++++++++------------------------
 gtk/gtkbuilderprivate.h |  3 --
 2 files changed, 47 insertions(+), 49 deletions(-)
---
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index cb2bcf0236..182ccad5f1 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -1997,6 +1997,53 @@ gtk_builder_value_from_string (GtkBuilder   *builder,
                                              string, value, error);
 }
 
+static gboolean
+_gtk_builder_boolean_from_string (const char   *string,
+                                  gboolean     *value,
+                                  GError      **error)
+{
+  if (string[0] == '\0')
+    goto error;
+  else if (string[1] == '\0')
+    {
+      char c;
+
+      c = string[0];
+      if (c == '1' ||
+          c == 'y' || c == 't' ||
+          c == 'Y' || c == 'T')
+        *value = TRUE;
+      else if (c == '0' ||
+               c == 'n' || c == 'f' ||
+               c == 'N' || c == 'F')
+        *value = FALSE;
+      else
+        goto error;
+    }
+  else
+    {
+      if (g_ascii_strcasecmp (string, "true") == 0 ||
+          g_ascii_strcasecmp (string, "yes") == 0)
+        *value = TRUE;
+      else if (g_ascii_strcasecmp (string, "false") == 0 ||
+               g_ascii_strcasecmp (string, "no") == 0)
+        *value = FALSE;
+      else
+        goto error;
+    }
+
+  return TRUE;
+
+error:
+  g_set_error (error,
+               GTK_BUILDER_ERROR,
+               GTK_BUILDER_ERROR_INVALID_VALUE,
+               "Could not parse boolean '%s'",
+               string);
+  return FALSE;
+}
+
+
 /**
  * gtk_builder_value_from_string_type:
  * @builder: a #GtkBuilder
@@ -2568,52 +2615,6 @@ _gtk_builder_flags_from_string (GType         type,
   return ret;
 }
 
-gboolean
-_gtk_builder_boolean_from_string (const char   *string,
-                                  gboolean     *value,
-                                  GError      **error)
-{
-  if (string[0] == '\0')
-    goto error;
-  else if (string[1] == '\0')
-    {
-      char c;
-
-      c = string[0];
-      if (c == '1' ||
-          c == 'y' || c == 't' ||
-          c == 'Y' || c == 'T')
-        *value = TRUE;
-      else if (c == '0' ||
-               c == 'n' || c == 'f' ||
-               c == 'N' || c == 'F')
-        *value = FALSE;
-      else
-        goto error;
-    }
-  else
-    {
-      if (g_ascii_strcasecmp (string, "true") == 0 ||
-          g_ascii_strcasecmp (string, "yes") == 0)
-        *value = TRUE;
-      else if (g_ascii_strcasecmp (string, "false") == 0 ||
-               g_ascii_strcasecmp (string, "no") == 0)
-        *value = FALSE;
-      else
-        goto error;
-    }
-
-  return TRUE;
-
-error:
-  g_set_error (error,
-               GTK_BUILDER_ERROR,
-               GTK_BUILDER_ERROR_INVALID_VALUE,
-               "Could not parse boolean '%s'",
-               string);
-  return FALSE;
-}
-
 /**
  * gtk_builder_get_type_from_name:
  * @builder: a #GtkBuilder
diff --git a/gtk/gtkbuilderprivate.h b/gtk/gtkbuilderprivate.h
index 87287d4e78..5fe910486b 100644
--- a/gtk/gtkbuilderprivate.h
+++ b/gtk/gtkbuilderprivate.h
@@ -233,9 +233,6 @@ GtkExpression * expression_info_construct (GtkBuilder      *builder,
                                            GError         **error);
 
 /* Internal API which might be made public at some point */
-gboolean _gtk_builder_boolean_from_string (const char   *string,
-                                          gboolean     *value,
-                                          GError      **error);
 gboolean _gtk_builder_enum_from_string (GType         type,
                                         const char   *string,
                                         int          *enum_value,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]