summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2019-03-13 13:06:04 +0800
committerChristoph Reiter <creiter@src.gnome.org>2019-04-11 16:45:36 +0200
commit0e24d35e3b631345e34bca042fc771f17e0a1fce (patch)
treed1caf28cc5e7ddff72631a129347e27c65fc9edd /tests
parent92206fe23b6e47acd6834a2b7a17bd76705db469 (diff)
downloadgtk+-0e24d35e3b631345e34bca042fc771f17e0a1fce.tar.gz
tests/: Declare variables at the top-of-block
This will ensure that the code will build for pre-C99 compilers.
Diffstat (limited to 'tests')
-rw-r--r--tests/testbaseline.c6
-rw-r--r--tests/testspinbutton.c3
-rw-r--r--tests/video-timer.c5
3 files changed, 8 insertions, 6 deletions
diff --git a/tests/testbaseline.c b/tests/testbaseline.c
index 3e6965bfaa..a9581f727a 100644
--- a/tests/testbaseline.c
+++ b/tests/testbaseline.c
@@ -99,12 +99,12 @@ main (int argc,
for (j = 0; j < 2; j++)
{
- hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 5);
-
char *aligns_names[] = { "FILL", "BASELINE" };
GtkAlign aligns[] = { GTK_ALIGN_FILL, GTK_ALIGN_BASELINE};
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 5);
+
label = gtk_label_new (aligns_names[j]);
gtk_container_add (GTK_CONTAINER (hbox), label);
diff --git a/tests/testspinbutton.c b/tests/testspinbutton.c
index 14eafdff47..d0925335d0 100644
--- a/tests/testspinbutton.c
+++ b/tests/testspinbutton.c
@@ -56,12 +56,13 @@ prepare_window_for_orientation (GtkOrientation orientation)
0.0);
GtkWidget *spin = gtk_spin_button_new (adj, 1.0, 0);
+ GtkWidget *hbox;
gtk_orientable_set_orientation (GTK_ORIENTABLE (spin), orientation);
gtk_widget_set_halign (GTK_WIDGET (spin), GTK_ALIGN_CENTER);
g_object_bind_property (wrap_button, "active", spin, "wrap", G_BINDING_SYNC_CREATE);
- GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, FALSE, 2);
gtk_container_add (GTK_CONTAINER (mainbox), hbox);
}
diff --git a/tests/video-timer.c b/tests/video-timer.c
index bc5de1e5fe..cd137eec60 100644
--- a/tests/video-timer.c
+++ b/tests/video-timer.c
@@ -237,11 +237,12 @@ collect_old_frames (void)
for (l = past_frames; l; l = l_next)
{
FrameData *frame_data = l->data;
+ GdkFrameTimings *timings;
gboolean remove = FALSE;
l_next = l->next;
- GdkFrameTimings *timings = gdk_frame_clock_get_timings (frame_clock,
- frame_data->frame_counter);
+ timings = gdk_frame_clock_get_timings (frame_clock,
+ frame_data->frame_counter);
if (timings == NULL)
{
remove = TRUE;