From 502e283ea09a760ef0c5246302063b9bd4fdc9ec Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 14 Jan 2007 10:03:19 +0000 Subject: [PATCH] (do_feed, produce_sect): Move bp_put_item() calls from do_feed() to produce_sect(), for consistency with the other update functions that update sct_item[]. Parameter bp is now unused, remove. --- include/prototypes.h | 3 +-- src/lib/update/human.c | 5 +---- src/lib/update/sect.c | 5 ++++- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/prototypes.h b/include/prototypes.h index bd22a830..dd6d7f75 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -734,8 +734,7 @@ extern int dodistribute(struct sctstr *, int, char *, double, double); extern void finish_sects(int); /* human.c */ extern int new_work(struct sctstr *, int); -extern int do_feed(struct sctstr *, struct natstr *, - short *, int *, struct bp *, int); +extern int do_feed(struct sctstr *, struct natstr *, short *, 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/update/human.c b/src/lib/update/human.c index a7c53928..3bfbd119 100644 --- a/src/lib/update/human.c +++ b/src/lib/update/human.c @@ -55,7 +55,7 @@ static int babies(int, int, double, int, int); */ int do_feed(struct sctstr *sp, struct natstr *np, short *vec, - int *workp, struct bp *bp, int etu) + int *workp, int etu) { int work_avail; int starved, sctwork; @@ -115,9 +115,6 @@ do_feed(struct sctstr *sp, struct natstr *np, short *vec, /* Here is where we truncate extra people, always */ trunc_people(sp, np, vec); - bp_put_item(bp, sp, I_CIVIL, vec[I_CIVIL]); - bp_put_item(bp, sp, I_UW, vec[I_UW]); - bp_put_item(bp, sp, I_MILIT, vec[I_MILIT]); *workp = work_avail; return sctwork; } diff --git a/src/lib/update/sect.c b/src/lib/update/sect.c index 803d93d7..810cd544 100644 --- a/src/lib/update/sect.c +++ b/src/lib/update/sect.c @@ -311,7 +311,10 @@ produce_sect(int natnum, int etu, struct bp *bp, long p_sect[][2]) here */ bp_enable_cachepath(); - sctwork = do_feed(sp, np, vec, &work, bp, etu); + sctwork = do_feed(sp, np, vec, &work, etu); + bp_put_item(bp, sp, I_CIVIL, vec[I_CIVIL]); + bp_put_item(bp, sp, I_UW, vec[I_UW]); + bp_put_item(bp, sp, I_MILIT, vec[I_MILIT]); bp_disable_cachepath(); bp_clear_cachepath();