From ea063712f618fbd0e46fd0e9ab39265c8ccc15d2 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 29 Aug 2023 14:19:51 +0300 Subject: [PATCH 5/5] cityturn.c: Fix dead assignments on non-assert builds See osdn #48555 Signed-off-by: Marko Lindqvist --- server/cityturn.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/cityturn.c b/server/cityturn.c index f7d29dbb71..93e21c1b9b 100644 --- a/server/cityturn.c +++ b/server/cityturn.c @@ -791,7 +791,10 @@ bool city_reduce_size(struct city *pcity, citizens pop_loss, if (loss_remain > 0) { /* Take it out on workers */ - loss_remain -= city_reduce_workers(pcity, loss_remain); +#ifndef FREECIV_NDEBUG + loss_remain -= +#endif /* FREECIV_NDEBUG */ + city_reduce_workers(pcity, loss_remain); } /* Update citizens. */ @@ -846,7 +849,10 @@ void city_repair_size(struct city *pcity, int change) int need = change + city_reduce_specialists(pcity, -change); if (0 > need) { - need += city_reduce_workers(pcity, -need); +#ifndef FREECIV_NDEBUG + need += +#endif /* FREECIV_NDEBUG */ + city_reduce_workers(pcity, -need); } fc_assert_msg(0 == need, -- 2.40.1