tests/: Declare variables at the top-of-block

This will ensure that the code will build for pre-C99 compilers.
This commit is contained in:
Chun-wei Fan 2019-03-13 13:06:04 +08:00 committed by Christoph Reiter
parent 92206fe23b
commit 0e24d35e3b
3 changed files with 8 additions and 6 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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;