]> git.pond.sub.org Git - empserver/commitdiff
fairland: Move qprint() and NUMTRIES
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 10 Aug 2020 13:52:02 +0000 (15:52 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 17 Jan 2021 20:24:28 +0000 (21:24 +0100)
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 <armbru@pond.sub.org>
src/util/fairland.c

index 027d1534b2dd3e88e7e8cf6edd7d9878e9da53f9..4623ff2fd84edb6add3cc680413f56c112ea9a52 100644 (file)
 #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);
-    }
-}