production: Use update code instead of duplicating it
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 7 Jul 2016 06:03:58 +0000 (08:03 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:08:29 +0000 (20:08 +0200)
commit4a714a37da1423d2ec5e15999ff387c3af2138db
tree58910563c5af8d9b083b417d5e56c56fff840106
parent60137582723140a3f9e35fdca5c3ea1794a75060
production: Use update code instead of duplicating it

prod() duplicates the update's sector production code, except it
computes both output with present materials ("make" output) and output
not limited by lack of materials or production backlog ("max" output).
It also rounds materials consumed up instead of randomly.

Factor prod_output() out of produce() for reuse by prod().  prod()
runs it twice: once for "make" output and once for "max" output.

Test output changes are due to random rounding.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/update.h
info/Sector-types.t
src/lib/commands/prod.c
src/lib/update/produce.c
tests/smoke/journal.log
tests/update/journal.log