]> git.draconx.ca Git - cdecl99.git/blobdiff - t/randomdecl.c
Avoid the use of for loop declarations.
[cdecl99.git] / t / randomdecl.c
index 9e9271e5b0ad12303a44dd3159641a090fc98b6f..1fbd2d913b360114649b310a9e4983449024954c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Generate random C declarations for testing.
- * Copyright © 2012, 2020, 2022 Nick Bowler
+ * Copyright © 2012, 2020, 2022-2023 Nick Bowler
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -85,10 +85,10 @@ static struct cdecl *random_decl(struct test_rng *rng)
 int main(int argc, char **argv)
 {
        const char *seed = "", *count_str = NULL;
+       unsigned long i, count = 0;
+       int opt, mode = MODE_CDECL;
        struct test_rng *rng;
        struct cdecl *decl;
-       unsigned long count = 0;
-       int opt, mode = MODE_CDECL;
 
        if (argc > 0)
                progname = argv[0];
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
        if (!rng)
                return EXIT_FAILURE;
 
-       for (unsigned long i = 0; !count || i < count; i++) {
+       for (i = 0; !count || i < count; i++) {
                decl = random_decl(rng);
 
                if (mode == MODE_ENGLISH) {