summaryrefslogtreecommitdiff
path: root/gtk/gtkbuilder.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2020-10-08 05:56:26 +0200
committerMatthias Clasen <mclasen@redhat.com>2020-10-14 15:06:12 -0400
commitc5909d4dc423f60d443f786b408b18729a56ce89 (patch)
treec1daf98f020f3af10b50291c0aad8825d4e385f1 /gtk/gtkbuilder.c
parent9698cd67a1ff01c8f7bf7da76bf3347b9fa0d31b (diff)
downloadgtk+-c5909d4dc423f60d443f786b408b18729a56ce89.tar.gz
gtkbuilder: Remove pointless function prototype
Diffstat (limited to 'gtk/gtkbuilder.c')
-rw-r--r--gtk/gtkbuilder.c93
1 files changed, 47 insertions, 46 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