From 200059b65b4690b794b67dd790e5c104bf2c5dbd Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 10 Aug 2020 15:52:02 +0200 Subject: [PATCH] fairland: Move qprint() and NUMTRIES qprint() was carelessly added at the end of the file in Empire 2, where it's under the "Write a script for placing capitals" headline. Move it to a more sensible place. NUMTRIES was added behind the global variables in Empire 2. Move it before them, and reformat its comment. Signed-off-by: Markus Armbruster --- src/util/fairland.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/util/fairland.c b/src/util/fairland.c index 027d1534b..4623ff2fd 100644 --- a/src/util/fairland.c +++ b/src/util/fairland.c @@ -129,6 +129,11 @@ #include "version.h" #include "xy.h" +/* + * Number of retries when growing land fails + */ +#define NUMTRIES 10 + /* do not change these defines */ #define LANDMIN 1 /* plate altitude for normal land */ #define PLATMIN 36 /* plate altitude for plateau */ @@ -300,8 +305,6 @@ static unsigned short *distance; static int *bfs_queue; static int bfs_queue_head, bfs_queue_tail; -#define NUMTRIES 10 /* keep trying to grow this many times */ - static const char *numletter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; @@ -453,6 +456,18 @@ print_vars(void) printf("World dimensions: %dx%d\n", WORLD_X, WORLD_Y); } +static void +qprint(const char *const fmt, ...) +{ + va_list ap; + + if (!quiet) { + va_start(ap, fmt); + vfprintf(stdout, fmt, ap); + va_end(ap); + } +} + static void help(char *complaint) { @@ -1664,15 +1679,3 @@ write_newcap_script(void) fclose(script); return 1; } - -static void -qprint(const char *const fmt, ...) -{ - va_list ap; - - if (!quiet) { - va_start(ap, fmt); - vfprintf(stdout, fmt, ap); - va_end(ap); - } -} -- 2.43.0