From: Markus Armbruster Date: Sun, 26 Jul 2020 05:52:20 +0000 (+0200) Subject: fairland: Tidy up comments X-Git-Tag: v4.4.1~85 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=90bb0f7fa33f906135bd59b62ade30d268516020 fairland: Tidy up comments Don't use ALL CAPS for headings. Reformat them in the style recommended by doc/coding. Drop a few comments that aren't pulling their weight, and fix the odd typo. Signed-off-by: Markus Armbruster --- diff --git a/src/util/fairland.c b/src/util/fairland.c index 8da3c3e66..54e891a17 100644 --- a/src/util/fairland.c +++ b/src/util/fairland.c @@ -214,13 +214,10 @@ static int quiet; #define DEFAULT_OUTFILE_NAME "newcap_script" static const char *outfile = DEFAULT_OUTFILE_NAME; -#define STABLE_CYCLE 4 /* stability required for perterbed capitals */ +#define STABLE_CYCLE 4 /* stability required for perturbed capitals */ #define DRIFT_BEFORE_CHECK ((WORLD_X + WORLD_Y)/2) #define DRIFT_MAX ((WORLD_X + WORLD_Y)*2) -/* handy macros: -*/ - #define new_x(newx) (((newx) + WORLD_X) % WORLD_X) #define new_y(newy) (((newy) + WORLD_Y) % WORLD_Y) @@ -333,9 +330,6 @@ void print_closest_map(void); void print_distance_map(void); void print_elev_map(void); -/**************************************************************************** - MAIN -****************************************************************************/ int main(int argc, char *argv[]) @@ -597,9 +591,10 @@ parse_args(int argc, char *argv[]) } } -/**************************************************************************** - VARIABLE INITIALIZATION -****************************************************************************/ + +/* + * Variable initialization + */ static void allocate_memory(void) @@ -633,9 +628,10 @@ init(void) memset(adj_land, 0, WORLD_SZ() * sizeof(*adj_land)); } -/**************************************************************************** - DRIFT THE CAPITALS UNTIL THEY ARE AS FAR AWAY FROM EACH OTHER AS POSSIBLE -****************************************************************************/ + +/* + * Drift the capitals until they are as far away from each other as possible + */ /* * How isolated is capital @j at @newx,@newy? @@ -723,7 +719,6 @@ stable(int turns) * Drift capital @j. * Move it to an adjacent sector where it is at least as isolated. */ - static void drift_capital(int j) { @@ -744,9 +739,10 @@ drift_capital(int j) } } -/**************************************************************************** - GROW THE CONTINENTS -****************************************************************************/ + +/* + * Grow land + */ static int is_coastal(int x, int y) @@ -1163,10 +1159,6 @@ grow_continents(void) return done; } -/**************************************************************************** - GROW THE ISLANDS -****************************************************************************/ - /* * Place additional island @c's first sector. * Return 1 on success, 0 on error. @@ -1295,9 +1287,11 @@ grow_islands(void) return 1; } -/**************************************************************************** - CREATE ELEVATIONS -****************************************************************************/ + +/* + * Create elevations + */ + static void create_elevations(void) { @@ -1412,9 +1406,10 @@ elev_to_sct_type(int elevation) return SCT_MOUNT; } -/**************************************************************************** - ADD THE RESOURCES -****************************************************************************/ + +/* + * Add resources + */ /* * Map elevation @elev to a resource value according to @conf. @@ -1447,9 +1442,10 @@ add_resources(struct sctstr *sct) sct->sct_uran = elev_to_resource(sct->sct_elev, uran_conf); } -/**************************************************************************** - DESIGNATE THE SECTORS -****************************************************************************/ + +/* + * Designate the sectors + */ static void write_sects(void) @@ -1468,9 +1464,11 @@ write_sects(void) } } -/**************************************************************************** - PRINT A PICTURE OF THE MAP TO YOUR SCREEN -****************************************************************************/ + +/* + * Print a picture of the map + */ + static void output(void) { @@ -1657,9 +1655,10 @@ print_distance_map(void) } -/*************************************************************************** - WRITE A SCRIPT FOR PLACING CAPITALS -****************************************************************************/ +/* + * Write a script for placing capitals + */ + static int write_newcap_script(void) {