From b9a20bb378039289a063cd079bd65f37bb41ba19 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 13 Mar 2021 09:01:40 +0100 Subject: [PATCH] C90 has no inline keyword --- src/laws.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/laws.c b/src/laws.c index a0c1f22e2..d67d90b18 100644 --- a/src/laws.c +++ b/src/laws.c @@ -325,9 +325,7 @@ static double peasant_luck_factor(void) return config_get_flt("rules.peasants.peasantluck.factor", PEASANTLUCK); } -inline int round_births(double growth) { - return (int)growth; -} +#define ROUND_BIRTHS(growth) ((int)growth) int peasant_luck_effect(int peasants, int luck, int maxp, double variance) { @@ -338,7 +336,7 @@ int peasant_luck_effect(int peasants, int luck, int maxp, double variance) mean *= peasant_luck_factor() * peasant_growth_factor(); mean *= ((peasants / (double)maxp < .9) ? 1 : PEASANTFORCE); - births = round_births(normalvariate(mean, variance * mean)); + births = ROUND_BIRTHS(normalvariate(mean, variance * mean)); if (births <= 0) births = 1; if (births > peasants / 2) @@ -357,7 +355,7 @@ static void peasants(region * r, int rule) if (peasants > 0 && rule > 0) { int luck = 0; double fraction = peasants * peasant_growth_factor(); - int births = round_births(fraction); + int births = ROUND_BIRTHS(fraction); attrib *a = a_find(r->attribs, &at_peasantluck); if (a != NULL) {