(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.
This commit is contained in:
Markus Armbruster 2007-01-14 10:03:19 +00:00
parent be97da327e
commit 502e283ea0
3 changed files with 6 additions and 7 deletions

View file

@ -734,8 +734,7 @@ extern int dodistribute(struct sctstr *, int, char *, double, double);
extern void finish_sects(int); extern void finish_sects(int);
/* human.c */ /* human.c */
extern int new_work(struct sctstr *, int); extern int new_work(struct sctstr *, int);
extern int do_feed(struct sctstr *, struct natstr *, extern int do_feed(struct sctstr *, struct natstr *, short *, int *, int);
short *, int *, struct bp *, int);
extern int feed_people(short *, int); extern int feed_people(short *, int);
extern double food_needed(short *, int); extern double food_needed(short *, int);
extern int famine_victims(short *, int); extern int famine_victims(short *, int);

View file

@ -55,7 +55,7 @@ static int babies(int, int, double, int, int);
*/ */
int int
do_feed(struct sctstr *sp, struct natstr *np, short *vec, 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 work_avail;
int starved, sctwork; 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 */ /* Here is where we truncate extra people, always */
trunc_people(sp, np, vec); 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; *workp = work_avail;
return sctwork; return sctwork;
} }

View file

@ -311,7 +311,10 @@ produce_sect(int natnum, int etu, struct bp *bp, long p_sect[][2])
here */ here */
bp_enable_cachepath(); 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_disable_cachepath();
bp_clear_cachepath(); bp_clear_cachepath();