From c7000117e823ffdb3a05420b7a396f6e12438c5e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 18 Jun 2016 13:08:35 +0200 Subject: [PATCH] include: Drop update.h update.h is a convenience header to include headers commonly needed in update code. The price for the convenience is superfluous recompiles. Include necessary headers directly, and drop update.h Signed-off-by: Markus Armbruster --- include/update.h | 42 ------------------------------------ src/lib/update/age.c | 5 ++++- src/lib/update/anno.c | 3 ++- src/lib/update/bp.c | 4 +++- src/lib/update/deliver.c | 5 ++++- src/lib/update/distribute.c | 4 +++- src/lib/update/finish.c | 6 +++++- src/lib/update/human.c | 5 ++++- src/lib/update/land.c | 6 +++++- src/lib/update/main.c | 4 +++- src/lib/update/material.c | 3 ++- src/lib/update/mobility.c | 5 ++++- src/lib/update/move_sat.c | 6 +++++- src/lib/update/nat.c | 5 ++++- src/lib/update/nxtitemp.c | 3 ++- src/lib/update/plague.c | 6 +++++- src/lib/update/plane.c | 6 +++++- src/lib/update/populace.c | 6 +++++- src/lib/update/prepare.c | 6 +++++- src/lib/update/produce.c | 5 ++++- src/lib/update/removewants.c | 4 +++- src/lib/update/revolt.c | 5 ++++- src/lib/update/sect.c | 6 +++++- src/lib/update/ship.c | 6 +++++- 24 files changed, 91 insertions(+), 65 deletions(-) delete mode 100644 include/update.h diff --git a/include/update.h b/include/update.h deleted file mode 100644 index f19dd905..00000000 --- a/include/update.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Empire - A multi-player, client/server Internet based war game. - * Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak, - * Ken Stevens, Steve McClure, Markus Armbruster - * - * Empire is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --- - * - * See files README, COPYING and CREDITS in the root of the source - * tree for related information and legal notices. It is expected - * that future projects/authors will amend these files as needed. - * - * --- - * - * update.h: Include headers used for updates - * - * Known contributors to this file: - * - */ - -#ifndef UPDATE_H -#define UPDATE_H - -#include "file.h" -#include "nat.h" -#include "optlist.h" -#include "prototypes.h" -#include "sect.h" - -#endif diff --git a/src/lib/update/age.c b/src/lib/update/age.c index 5e19418a..aa7e29f2 100644 --- a/src/lib/update/age.c +++ b/src/lib/update/age.c @@ -33,7 +33,10 @@ #include #include "chance.h" -#include "update.h" +#include "file.h" +#include "nat.h" +#include "optlist.h" +#include "prototypes.h" int age_people(int n, int etu) diff --git a/src/lib/update/anno.c b/src/lib/update/anno.c index 6c5601ed..6c3cfb5e 100644 --- a/src/lib/update/anno.c +++ b/src/lib/update/anno.c @@ -41,8 +41,9 @@ #endif #include #include +#include "optlist.h" +#include "prototypes.h" #include "tel.h" -#include "update.h" static int copy_and_expire(FILE *, FILE *, char *, time_t); static int copy_sink(char *, size_t, void *); diff --git a/src/lib/update/bp.c b/src/lib/update/bp.c index 8418031e..86991129 100644 --- a/src/lib/update/bp.c +++ b/src/lib/update/bp.c @@ -40,8 +40,10 @@ #include +#include #include "budg.h" -#include "update.h" +#include "optlist.h" +#include "sect.h" /* Item types we want to track. */ enum bp_item_idx { diff --git a/src/lib/update/deliver.c b/src/lib/update/deliver.c index 66292375..ecb06508 100644 --- a/src/lib/update/deliver.c +++ b/src/lib/update/deliver.c @@ -32,10 +32,13 @@ #include +#include "file.h" #include "item.h" +#include "optlist.h" #include "path.h" #include "plague.h" -#include "update.h" +#include "sect.h" +#include "prototypes.h" #define DELIVER_BONUS 4.0 diff --git a/src/lib/update/distribute.c b/src/lib/update/distribute.c index d06beeea..803dcf7b 100644 --- a/src/lib/update/distribute.c +++ b/src/lib/update/distribute.c @@ -35,11 +35,13 @@ #include #include "distribute.h" +#include "file.h" #include "item.h" +#include "optlist.h" #include "path.h" #include "plague.h" #include "prototypes.h" -#include "update.h" +#include "sect.h" #ifdef DISTRIBUTE_DEBUG #define DPRINTF(fmt, ...) ((void)printf(fmt , ## __VA_ARGS__)) diff --git a/src/lib/update/finish.c b/src/lib/update/finish.c index 88777aa1..a0bc18aa 100644 --- a/src/lib/update/finish.c +++ b/src/lib/update/finish.c @@ -38,8 +38,12 @@ #include #include #include "distribute.h" +#include "file.h" +#include "nat.h" +#include "optlist.h" #include "path.h" -#include "update.h" +#include "sect.h" +#include "prototypes.h" static void assemble_dist_paths(double *); diff --git a/src/lib/update/human.c b/src/lib/update/human.c index b7b3403a..07b30a79 100644 --- a/src/lib/update/human.c +++ b/src/lib/update/human.c @@ -37,9 +37,12 @@ #include #include "chance.h" #include "item.h" +#include "optlist.h" +#include "nat.h" #include "news.h" #include "player.h" -#include "update.h" +#include "prototypes.h" +#include "sect.h" #include "xy.h" static int new_work(struct sctstr *, int); diff --git a/src/lib/update/land.c b/src/lib/update/land.c index 6f48a68e..0bb5c00e 100644 --- a/src/lib/update/land.c +++ b/src/lib/update/land.c @@ -38,12 +38,16 @@ #include #include "budg.h" #include "chance.h" +#include "file.h" #include "land.h" #include "lost.h" +#include "nat.h" #include "news.h" +#include "optlist.h" #include "plague.h" #include "player.h" -#include "update.h" +#include "prototypes.h" +#include "sect.h" static void landrepair(struct lndstr *, struct natstr *, struct bp *, int); static void upd_land(struct lndstr *, int, struct natstr *, struct bp *, int); diff --git a/src/lib/update/main.c b/src/lib/update/main.c index 63524d36..f6ed8cd5 100644 --- a/src/lib/update/main.c +++ b/src/lib/update/main.c @@ -38,11 +38,13 @@ #include #include "budg.h" #include "empthread.h" +#include "file.h" #include "game.h" #include "journal.h" +#include "optlist.h" +#include "prototypes.h" #include "server.h" #include "unit.h" -#include "update.h" int money[MAXNOC]; int pops[MAXNOC]; diff --git a/src/lib/update/material.c b/src/lib/update/material.c index 5781719c..5860a7e0 100644 --- a/src/lib/update/material.c +++ b/src/lib/update/material.c @@ -34,7 +34,8 @@ #include #include "chance.h" -#include "update.h" +#include "sect.h" +#include "prototypes.h" /* * Get build materials from sector @sp. diff --git a/src/lib/update/mobility.c b/src/lib/update/mobility.c index 73330f6c..5b764187 100644 --- a/src/lib/update/mobility.c +++ b/src/lib/update/mobility.c @@ -34,12 +34,15 @@ #include +#include "file.h" #include "game.h" #include "land.h" +#include "optlist.h" #include "plane.h" +#include "prototypes.h" +#include "sect.h" #include "server.h" #include "ship.h" -#include "update.h" static int do_upd_checking; diff --git a/src/lib/update/move_sat.c b/src/lib/update/move_sat.c index f54f5ebe..95690a06 100644 --- a/src/lib/update/move_sat.c +++ b/src/lib/update/move_sat.c @@ -33,9 +33,13 @@ #include #include +#include "file.h" +#include "nat.h" #include "nsc.h" +#include "optlist.h" #include "plane.h" -#include "update.h" +#include "prototypes.h" +#include "sect.h" #ifndef PI #define PI 3.14159265358979323846 diff --git a/src/lib/update/nat.c b/src/lib/update/nat.c index 5e7df696..ec31dec2 100644 --- a/src/lib/update/nat.c +++ b/src/lib/update/nat.c @@ -36,9 +36,12 @@ #include #include "budg.h" +#include "file.h" #include "game.h" #include "item.h" -#include "update.h" +#include "optlist.h" +#include "prototypes.h" +#include "nat.h" /* * hap and edu avg mean that the weight on current happiness is diff --git a/src/lib/update/nxtitemp.c b/src/lib/update/nxtitemp.c index 83dff29d..dfd20ae7 100644 --- a/src/lib/update/nxtitemp.c +++ b/src/lib/update/nxtitemp.c @@ -33,11 +33,12 @@ #include #include "empobj.h" +#include "file.h" #include "land.h" #include "nsc.h" +#include "prototypes.h" #include "ship.h" #include "unit.h" -#include "update.h" void * nxtitemp(struct nstr_item *np) diff --git a/src/lib/update/plague.c b/src/lib/update/plague.c index 9a272cfa..fcb79a44 100644 --- a/src/lib/update/plague.c +++ b/src/lib/update/plague.c @@ -34,11 +34,15 @@ #include #include "chance.h" +#include "file.h" #include "item.h" #include "lost.h" +#include "optlist.h" +#include "nat.h" #include "news.h" #include "plague.h" -#include "update.h" +#include "prototypes.h" +#include "sect.h" static int infect_people(struct natstr *, struct sctstr *); diff --git a/src/lib/update/plane.c b/src/lib/update/plane.c index d8fe4512..7c80e342 100644 --- a/src/lib/update/plane.c +++ b/src/lib/update/plane.c @@ -36,11 +36,15 @@ #include "budg.h" #include "chance.h" +#include "file.h" #include "lost.h" +#include "nat.h" +#include "optlist.h" #include "plane.h" #include "player.h" +#include "prototypes.h" +#include "sect.h" #include "ship.h" -#include "update.h" static void planerepair(struct plnstr *, struct natstr *, struct bp *, int); static void upd_plane(struct plnstr *, int, struct natstr *, struct bp *, int); diff --git a/src/lib/update/populace.c b/src/lib/update/populace.c index 6c70497d..89f95046 100644 --- a/src/lib/update/populace.c +++ b/src/lib/update/populace.c @@ -34,8 +34,12 @@ #include #include "chance.h" +#include "file.h" #include "lost.h" -#include "update.h" +#include "optlist.h" +#include "prototypes.h" +#include "nat.h" +#include "sect.h" void populace(struct sctstr *sp, int etu) diff --git a/src/lib/update/prepare.c b/src/lib/update/prepare.c index 7146114d..3d6b6e68 100644 --- a/src/lib/update/prepare.c +++ b/src/lib/update/prepare.c @@ -37,11 +37,15 @@ #include "budg.h" #include "chance.h" +#include "file.h" #include "item.h" #include "land.h" +#include "nat.h" +#include "optlist.h" #include "player.h" +#include "prototypes.h" +#include "sect.h" #include "ship.h" -#include "update.h" void prepare_sects(int etu) diff --git a/src/lib/update/produce.c b/src/lib/update/produce.c index 632668f8..a7d7bae9 100644 --- a/src/lib/update/produce.c +++ b/src/lib/update/produce.c @@ -34,9 +34,12 @@ #include "budg.h" #include "chance.h" +#include "nat.h" +#include "optlist.h" #include "player.h" #include "product.h" -#include "update.h" +#include "prototypes.h" +#include "sect.h" static void materials_charge(struct pchrstr *, short *, int); diff --git a/src/lib/update/removewants.c b/src/lib/update/removewants.c index b43581c2..eb04bf47 100644 --- a/src/lib/update/removewants.c +++ b/src/lib/update/removewants.c @@ -32,7 +32,9 @@ #include -#include "update.h" +#include "file.h" +#include "nat.h" +#include "prototypes.h" int update_removewants(void) diff --git a/src/lib/update/revolt.c b/src/lib/update/revolt.c index 75c2e824..bedfc96e 100644 --- a/src/lib/update/revolt.c +++ b/src/lib/update/revolt.c @@ -35,14 +35,17 @@ #include #include "chance.h" +#include "file.h" #include "land.h" #include "lost.h" +#include "nat.h" #include "news.h" #include "nsc.h" #include "nuke.h" #include "path.h" #include "plane.h" -#include "update.h" +#include "prototypes.h" +#include "sect.h" static void take_casualties(struct sctstr *, int); static void lnd_dies_fighting_che(struct lndstr *); diff --git a/src/lib/update/sect.c b/src/lib/update/sect.c index 1f8b3c28..4412831c 100644 --- a/src/lib/update/sect.c +++ b/src/lib/update/sect.c @@ -36,13 +36,17 @@ #include "budg.h" #include "chance.h" +#include "file.h" #include "item.h" #include "land.h" #include "lost.h" +#include "nat.h" +#include "optlist.h" #include "path.h" #include "player.h" +#include "prototypes.h" +#include "sect.h" #include "ship.h" -#include "update.h" double buildeff(struct sctstr *sp) diff --git a/src/lib/update/ship.c b/src/lib/update/ship.c index a54b0fdc..e2d5213b 100644 --- a/src/lib/update/ship.c +++ b/src/lib/update/ship.c @@ -38,14 +38,18 @@ #include #include "budg.h" #include "chance.h" +#include "file.h" #include "land.h" #include "lost.h" +#include "nat.h" #include "news.h" +#include "optlist.h" #include "plague.h" #include "player.h" #include "product.h" +#include "prototypes.h" +#include "sect.h" #include "ship.h" -#include "update.h" static void shiprepair(struct shpstr *, struct natstr *, struct bp *, int); static void upd_ship(struct shpstr *, int, struct natstr *, struct bp *, int);