From cc619043549e1b3d03582232fb6ae4fab8a1da0f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 17 Jul 2016 11:29:35 +0200 Subject: [PATCH] update: Drop do_feed()'s return value Call callers assign the return value to sp->sct_avail now. Move the assignment to do_feed() and drop the return value. Signed-off-by: Markus Armbruster --- include/prototypes.h | 2 +- src/lib/commands/newe.c | 2 +- src/lib/commands/prod.c | 2 +- src/lib/update/human.c | 4 ++-- src/lib/update/sect.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/prototypes.h b/include/prototypes.h index 733f5610..17aa5eb3 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -656,7 +656,7 @@ extern int dodistribute(struct sctstr *, int, double); /* finish.c */ extern void finish_sects(int); /* human.c */ -extern int do_feed(struct sctstr *, struct natstr *, int, int); +extern void do_feed(struct sctstr *, struct natstr *, int, int); extern int feed_people(short *, int); extern double food_needed(short *, int); extern int famine_victims(short *, int); diff --git a/src/lib/commands/newe.c b/src/lib/commands/newe.c index 0ebd816c..08d8b22c 100644 --- a/src/lib/commands/newe.c +++ b/src/lib/commands/newe.c @@ -55,7 +55,7 @@ newe(void) continue; if (!sect.sct_off) { natp = getnatp(sect.sct_own); - sect.sct_avail = do_feed(§, natp, etu_per_update, 1); + do_feed(§, natp, etu_per_update, 1); buildeff(§); } if (nsect++ == 0) { diff --git a/src/lib/commands/prod.c b/src/lib/commands/prod.c index 6bd35fc9..21ab4e0d 100644 --- a/src/lib/commands/prod.c +++ b/src/lib/commands/prod.c @@ -101,7 +101,7 @@ prod(void) continue; natp = getnatp(sect.sct_own); - sect.sct_avail = do_feed(§, natp, etu_per_update, 1); + do_feed(§, natp, etu_per_update, 1); buildeff(§); if (sect.sct_effic < 60) continue; diff --git a/src/lib/update/human.c b/src/lib/update/human.c index 7fa2e6eb..b7b3403a 100644 --- a/src/lib/update/human.c +++ b/src/lib/update/human.c @@ -52,7 +52,7 @@ static int babies(int, int, double, int, int, int); /* * feed the individual sector */ -int +void do_feed(struct sctstr *sp, struct natstr *np, int etu, int round_babies_down) { @@ -122,7 +122,7 @@ do_feed(struct sctstr *sp, struct natstr *np, int etu, trunc_people(sp, np); sp->sct_work = sctwork; - return work_avail; + sp->sct_avail = work_avail; } static int diff --git a/src/lib/update/sect.c b/src/lib/update/sect.c index a872acb7..1f8b3c28 100644 --- a/src/lib/update/sect.c +++ b/src/lib/update/sect.c @@ -249,7 +249,7 @@ produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2]) sp = &scratch_sect; } - sp->sct_avail = do_feed(sp, np, etu, 0); + do_feed(sp, np, etu, 0); if (sp->sct_off || np->nat_money < 0) { sp->sct_avail = 0;