[nautilus] tests: Fix build failure caused by C99 use



commit 9b674dc6ec197d419fa2503625598e12f75955c6
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sun Jul 10 13:46:24 2016 +0100

    tests: Fix build failure caused by C99 use
    
    Build failure in Continuous:
    
    ../../test/test-file-utilities-get-common-filename-prefix.c: In function
    'test_many_strings':
    ../../test/test-file-utilities-get-common-filename-prefix.c:366:9:
    error: 'for' loop initial declarations are only allowed in C99 or C11
    mode
             for (int i = 0; i < 500; ++i) {

 ...est-file-utilities-get-common-filename-prefix.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/test/test-file-utilities-get-common-filename-prefix.c 
b/test/test-file-utilities-get-common-filename-prefix.c
index 2eaaa9c..786c7df 100644
--- a/test/test-file-utilities-get-common-filename-prefix.c
+++ b/test/test-file-utilities-get-common-filename-prefix.c
@@ -362,8 +362,9 @@ test_many_strings ()
         GList *list = NULL;
         char *actual;
         char *filename;
+        int i;
 
-        for (int i = 0; i < 500; ++i) {
+        for (i = 0; i < 500; ++i) {
                 filename = g_strdup_printf ("we are no longer the knights who say nii%d", i);
                 list = g_list_append (list, filename);
         }
@@ -381,8 +382,9 @@ test_many_strings_last_differs ()
         GList *list = NULL;
         char *actual;
         char *filename;
+        int i;
 
-        for (int i = 0; i < 500; ++i) {
+        for (i = 0; i < 500; ++i) {
                 filename = g_strdup_printf ("we are no longer the knights who say nii%d", i);
 
                 if (i == 499) {
@@ -405,8 +407,9 @@ test_many_strings_first_differs ()
         GList *list = NULL;
         char *actual;
         char *filename;
+        int i;
 
-        for (int i = 0; i < 500; ++i) {
+        for (i = 0; i < 500; ++i) {
                 filename = g_strdup_printf ("we are no longer the knights who say nii%d", i);
 
                 if (i == 0) {


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