]> git.pond.sub.org Git - empserver/commitdiff
update: Drop do_feed()'s return value
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 17 Jul 2016 09:29:35 +0000 (11:29 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:59 +0000 (19:59 +0200)
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 <armbru@pond.sub.org>
include/prototypes.h
src/lib/commands/newe.c
src/lib/commands/prod.c
src/lib/update/human.c
src/lib/update/sect.c

index 733f5610f71b149156f6298fc8ecedf9bba08f90..17aa5eb3f7cd33c5f63dc5767e7c9cb7975d7ef0 100644 (file)
@@ -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);
index 0ebd816cc48f72acee6beabc4c9e27964ba9ff80..08d8b22c0e0faf6704c2a07527ce5f5ffad096a8 100644 (file)
@@ -55,7 +55,7 @@ newe(void)
            continue;
        if (!sect.sct_off) {
            natp = getnatp(sect.sct_own);
-           sect.sct_avail = do_feed(&sect, natp, etu_per_update, 1);
+           do_feed(&sect, natp, etu_per_update, 1);
            buildeff(&sect);
        }
        if (nsect++ == 0) {
index 6bd35fc9e13f76034d0ea471347d337be7d43b79..21ab4e0d9d50ad49a11806e4f4edbba26664bb46 100644 (file)
@@ -101,7 +101,7 @@ prod(void)
            continue;
 
        natp = getnatp(sect.sct_own);
-       sect.sct_avail = do_feed(&sect, natp, etu_per_update, 1);
+       do_feed(&sect, natp, etu_per_update, 1);
        buildeff(&sect);
        if (sect.sct_effic < 60)
            continue;
index 7fa2e6ebd83dbfc09e571d36b2331bfe6ebf5fc2..b7b3403a5be609bfc34960d791a4b49735841b79 100644 (file)
@@ -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
index a872acb77647968204c227aa30a30203ba8da71f..1f8b3c28e5066409ec87a9c2875cb0176a4a93b3 100644 (file)
@@ -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;