summaryrefslogtreecommitdiff
path: root/gtk/gtktestutils.c
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2015-11-12 20:12:26 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2015-11-12 20:12:26 +0800
commita56f8859eeb916eaae27eb9895412550f211c17d (patch)
tree370bc8fe4eee0255e250095b12d531013b52954e /gtk/gtktestutils.c
parentdbe430f6ec1dbc699c8a5963310226e69db2d266 (diff)
downloadgtk+-a56f8859eeb916eaae27eb9895412550f211c17d.tar.gz
gtktestutils.c: Ensure variables are declared at top of block
Fixes build on C89 compilers...
Diffstat (limited to 'gtk/gtktestutils.c')
-rw-r--r--gtk/gtktestutils.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c
index a396df0ca3..72da6c5304 100644
--- a/gtk/gtktestutils.c
+++ b/gtk/gtktestutils.c
@@ -664,10 +664,11 @@ gtk_test_display_button_window (const gchar *window_title,
...) /* NULL terminated list of (label, &int) pairs */
{
va_list var_args;
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- GtkWidget *window = gtk_test_create_widget (GTK_TYPE_WINDOW, "title", window_title, NULL);
- GtkWidget *vbox = gtk_test_create_widget (GTK_TYPE_BOX, "parent", window, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
+ GtkWidget *window, *vbox;
const char *arg1;
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+ window = gtk_test_create_widget (GTK_TYPE_WINDOW, "title", window_title, NULL);
+ vbox = gtk_test_create_widget (GTK_TYPE_BOX, "parent", window, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
gtk_test_create_widget (GTK_TYPE_LABEL, "label", dialog_text, "parent", vbox, NULL);
G_GNUC_END_IGNORE_DEPRECATIONS;
g_signal_connect (window, "destroy", G_CALLBACK (try_main_quit), NULL);
@@ -676,8 +677,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS;
while (arg1)
{
int *arg2 = va_arg (var_args, int*);
+ GtkWidget *button;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- GtkWidget *button = gtk_test_create_widget (GTK_TYPE_BUTTON, "label", arg1, "parent", vbox, NULL);
+ button = gtk_test_create_widget (GTK_TYPE_BUTTON, "label", arg1, "parent", vbox, NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_signal_connect_swapped (button, "clicked", G_CALLBACK (test_increment_intp), arg2);
arg1 = va_arg (var_args, const char*);
@@ -710,9 +712,10 @@ GtkWidget*
gtk_test_create_simple_window (const gchar *window_title,
const gchar *dialog_text)
{
+ GtkWidget *window, *vbox;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- GtkWidget *window = gtk_test_create_widget (GTK_TYPE_WINDOW, "title", window_title, NULL);
- GtkWidget *vbox = gtk_test_create_widget (GTK_TYPE_BOX, "parent", window, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
+ window = gtk_test_create_widget (GTK_TYPE_WINDOW, "title", window_title, NULL);
+ vbox = gtk_test_create_widget (GTK_TYPE_BOX, "parent", window, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
gtk_test_create_widget (GTK_TYPE_LABEL, "label", dialog_text, "parent", vbox, NULL);
G_GNUC_END_IGNORE_DEPRECATIONS;
g_signal_connect (window, "destroy", G_CALLBACK (try_main_quit), NULL);