[gtk+] gtktestutils.c: Ensure variables are declared at top of block



commit a56f8859eeb916eaae27eb9895412550f211c17d
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Nov 12 20:12:26 2015 +0800

    gtktestutils.c: Ensure variables are declared at top of block
    
    Fixes build on C89 compilers...

 gtk/gtktestutils.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c
index a396df0..72da6c5 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);


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