From 8eb78a5a80cb2d1d2cc72ed22686b2cec4c682e5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 14 Aug 2012 18:57:17 +0200 Subject: [PATCH] Move declarations for chance.c to new chance.h --- include/chance.h | 40 +++++++++++++++++++++++++++++++++++++++ include/prototypes.h | 3 --- src/lib/commands/anti.c | 1 + src/lib/commands/assa.c | 1 + src/lib/commands/bomb.c | 1 + src/lib/commands/buil.c | 1 + src/lib/commands/buy.c | 1 + src/lib/commands/conv.c | 1 + src/lib/commands/enli.c | 1 + src/lib/commands/laun.c | 1 + src/lib/commands/look.c | 1 + src/lib/commands/mfir.c | 1 + src/lib/commands/move.c | 1 + src/lib/commands/rea.c | 1 + src/lib/commands/sabo.c | 1 + src/lib/commands/shoo.c | 1 + src/lib/commands/sona.c | 1 + src/lib/commands/spy.c | 1 + src/lib/commands/torp.c | 1 + src/lib/commands/trad.c | 1 + src/lib/commands/work.c | 1 + src/lib/common/btu.c | 2 +- src/lib/gen/chance.c | 3 ++- src/lib/player/player.c | 1 + src/lib/subs/aircombat.c | 1 + src/lib/subs/attsub.c | 1 + src/lib/subs/damage.c | 1 + src/lib/subs/detonate.c | 1 + src/lib/subs/landgun.c | 1 + src/lib/subs/list.c | 1 + src/lib/subs/lndsub.c | 1 + src/lib/subs/mission.c | 1 + src/lib/subs/move.c | 1 + src/lib/subs/mslsub.c | 1 + src/lib/subs/nreport.c | 1 + src/lib/subs/plnsub.c | 1 + src/lib/subs/retreat.c | 1 + src/lib/subs/satmap.c | 1 + src/lib/subs/shpsub.c | 1 + src/lib/subs/supply.c | 1 + src/lib/subs/takeover.c | 1 + src/lib/update/age.c | 1 + src/lib/update/human.c | 1 + src/lib/update/land.c | 1 + src/lib/update/material.c | 1 + src/lib/update/plague.c | 1 + src/lib/update/plane.c | 1 + src/lib/update/populace.c | 1 + src/lib/update/produce.c | 1 + src/lib/update/revolt.c | 1 + src/lib/update/sect.c | 1 + src/lib/update/ship.c | 1 + 52 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 include/chance.h diff --git a/include/chance.h b/include/chance.h new file mode 100644 index 000000000..194dcf02a --- /dev/null +++ b/include/chance.h @@ -0,0 +1,40 @@ +/* + * Empire - A multi-player, client/server Internet based war game. + * Copyright (C) 1986-2012, 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. + * + * --- + * + * chance.h: Roll dice + * + * Known contributors to this file: + * Markus Armbruster, 2012 + */ + +#ifndef CHANCE_H +#define CHANCE_H + +extern int chance(double); +extern int roll(int); +extern int roundavg(double); + +#endif diff --git a/include/prototypes.h b/include/prototypes.h index 7eb82df61..5514d3ab8 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -306,9 +306,6 @@ extern int fsize(int); extern int blksize(int); extern time_t fdate(int); -extern int roll(int); -extern int roundavg(double); -extern int chance(double); extern int disassoc(void); extern char *effadv(int); extern int parse(char *, char *, char **, char **, char **, char **); diff --git a/src/lib/commands/anti.c b/src/lib/commands/anti.c index 0da592093..174b1dd2b 100644 --- a/src/lib/commands/anti.c +++ b/src/lib/commands/anti.c @@ -33,6 +33,7 @@ #include +#include "chance.h" #include "commands.h" #include "item.h" #include "optlist.h" diff --git a/src/lib/commands/assa.c b/src/lib/commands/assa.c index bc794ae7f..1ff036019 100644 --- a/src/lib/commands/assa.c +++ b/src/lib/commands/assa.c @@ -33,6 +33,7 @@ #include +#include "chance.h" #include "combat.h" #include "commands.h" #include "empobj.h" diff --git a/src/lib/commands/bomb.c b/src/lib/commands/bomb.c index 6ae775b95..9ebd780cb 100644 --- a/src/lib/commands/bomb.c +++ b/src/lib/commands/bomb.c @@ -36,6 +36,7 @@ #include #include +#include "chance.h" #include "commands.h" #include "damage.h" #include "item.h" diff --git a/src/lib/commands/buil.c b/src/lib/commands/buil.c index c4c76c1c1..58bafa322 100644 --- a/src/lib/commands/buil.c +++ b/src/lib/commands/buil.c @@ -34,6 +34,7 @@ #include #include +#include "chance.h" #include "commands.h" #include "game.h" #include "land.h" diff --git a/src/lib/commands/buy.c b/src/lib/commands/buy.c index 33ab044e8..e7a8ef705 100644 --- a/src/lib/commands/buy.c +++ b/src/lib/commands/buy.c @@ -34,6 +34,7 @@ #include +#include "chance.h" #include "commands.h" #include "commodity.h" #include "item.h" diff --git a/src/lib/commands/conv.c b/src/lib/commands/conv.c index d442e9abb..e2dfbe812 100644 --- a/src/lib/commands/conv.c +++ b/src/lib/commands/conv.c @@ -36,6 +36,7 @@ #include +#include "chance.h" #include "commands.h" #include "land.h" diff --git a/src/lib/commands/enli.c b/src/lib/commands/enli.c index b60613540..7986ed52b 100644 --- a/src/lib/commands/enli.c +++ b/src/lib/commands/enli.c @@ -32,6 +32,7 @@ #include +#include "chance.h" #include "commands.h" #include "treaty.h" diff --git a/src/lib/commands/laun.c b/src/lib/commands/laun.c index 2cdfb9962..3078782a1 100644 --- a/src/lib/commands/laun.c +++ b/src/lib/commands/laun.c @@ -35,6 +35,7 @@ #include +#include "chance.h" #include "commands.h" #include "damage.h" #include "mission.h" diff --git a/src/lib/commands/look.c b/src/lib/commands/look.c index f3b716a51..d5d2d6683 100644 --- a/src/lib/commands/look.c +++ b/src/lib/commands/look.c @@ -32,6 +32,7 @@ #include +#include "chance.h" #include "commands.h" #include "empobj.h" #include "map.h" diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index 31a22d3ac..b6c7da2f2 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -33,6 +33,7 @@ #include +#include "chance.h" #include "commands.h" #include "empobj.h" #include "news.h" diff --git a/src/lib/commands/move.c b/src/lib/commands/move.c index c83de66ec..95f6c8853 100644 --- a/src/lib/commands/move.c +++ b/src/lib/commands/move.c @@ -32,6 +32,7 @@ #include +#include "chance.h" #include "commands.h" #include "item.h" #include "map.h" diff --git a/src/lib/commands/rea.c b/src/lib/commands/rea.c index 1b927bc10..aaf573506 100644 --- a/src/lib/commands/rea.c +++ b/src/lib/commands/rea.c @@ -39,6 +39,7 @@ #include #include #include +#include "chance.h" #include "commands.h" #include "match.h" #include "misc.h" diff --git a/src/lib/commands/sabo.c b/src/lib/commands/sabo.c index 6af8a1a74..44ff4c769 100644 --- a/src/lib/commands/sabo.c +++ b/src/lib/commands/sabo.c @@ -33,6 +33,7 @@ #include +#include "chance.h" #include "commands.h" #include "land.h" diff --git a/src/lib/commands/shoo.c b/src/lib/commands/shoo.c index 041489532..3261a9827 100644 --- a/src/lib/commands/shoo.c +++ b/src/lib/commands/shoo.c @@ -32,6 +32,7 @@ #include +#include "chance.h" #include "commands.h" #include "item.h" #include "land.h" diff --git a/src/lib/commands/sona.c b/src/lib/commands/sona.c index 6206577eb..0f27f300b 100644 --- a/src/lib/commands/sona.c +++ b/src/lib/commands/sona.c @@ -33,6 +33,7 @@ #include +#include "chance.h" #include "commands.h" #include "map.h" #include "optlist.h" diff --git a/src/lib/commands/spy.c b/src/lib/commands/spy.c index f97830104..60505d502 100644 --- a/src/lib/commands/spy.c +++ b/src/lib/commands/spy.c @@ -34,6 +34,7 @@ #include +#include "chance.h" #include "commands.h" #include "item.h" #include "land.h" diff --git a/src/lib/commands/torp.c b/src/lib/commands/torp.c index 1cdd7ba68..cddf1c463 100644 --- a/src/lib/commands/torp.c +++ b/src/lib/commands/torp.c @@ -36,6 +36,7 @@ #include +#include "chance.h" #include "commands.h" #include "news.h" #include "retreat.h" diff --git a/src/lib/commands/trad.c b/src/lib/commands/trad.c index a524b65f8..ed5879629 100644 --- a/src/lib/commands/trad.c +++ b/src/lib/commands/trad.c @@ -35,6 +35,7 @@ #include #include +#include "chance.h" #include "commands.h" #include "commodity.h" #include "empobj.h" diff --git a/src/lib/commands/work.c b/src/lib/commands/work.c index ddf6c6c02..8675b64a2 100644 --- a/src/lib/commands/work.c +++ b/src/lib/commands/work.c @@ -32,6 +32,7 @@ #include +#include "chance.h" #include "commands.h" #include "land.h" #include "optlist.h" diff --git a/src/lib/common/btu.c b/src/lib/common/btu.c index 4c23c1529..d3796b696 100644 --- a/src/lib/common/btu.c +++ b/src/lib/common/btu.c @@ -32,10 +32,10 @@ #include +#include "chance.h" #include "file.h" #include "nat.h" #include "optlist.h" -#include "prototypes.h" #include "sect.h" /* diff --git a/src/lib/gen/chance.c b/src/lib/gen/chance.c index 535f4f341..284680b1b 100644 --- a/src/lib/gen/chance.c +++ b/src/lib/gen/chance.c @@ -33,7 +33,8 @@ #include #include -#include "prototypes.h" +#include +#include "chance.h" int chance(double d) diff --git a/src/lib/player/player.c b/src/lib/player/player.c index b68622f8c..5f2719ed1 100644 --- a/src/lib/player/player.c +++ b/src/lib/player/player.c @@ -34,6 +34,7 @@ #include +#include "chance.h" #include "empio.h" #include "empthread.h" #include "file.h" diff --git a/src/lib/subs/aircombat.c b/src/lib/subs/aircombat.c index 7d4773190..abc351536 100644 --- a/src/lib/subs/aircombat.c +++ b/src/lib/subs/aircombat.c @@ -35,6 +35,7 @@ #include +#include "chance.h" #include "file.h" #include "land.h" #include "map.h" diff --git a/src/lib/subs/attsub.c b/src/lib/subs/attsub.c index 5f3bbe71b..292c71f75 100644 --- a/src/lib/subs/attsub.c +++ b/src/lib/subs/attsub.c @@ -36,6 +36,7 @@ #include #include +#include "chance.h" #include "combat.h" #include "empobj.h" #include "file.h" diff --git a/src/lib/subs/damage.c b/src/lib/subs/damage.c index 43d424891..4c0f8f9c1 100644 --- a/src/lib/subs/damage.c +++ b/src/lib/subs/damage.c @@ -33,6 +33,7 @@ #include +#include "chance.h" #include "damage.h" #include "land.h" #include "misc.h" diff --git a/src/lib/subs/detonate.c b/src/lib/subs/detonate.c index a60923ad3..4204d2629 100644 --- a/src/lib/subs/detonate.c +++ b/src/lib/subs/detonate.c @@ -33,6 +33,7 @@ #include +#include "chance.h" #include "file.h" #include "land.h" #include "map.h" diff --git a/src/lib/subs/landgun.c b/src/lib/subs/landgun.c index 14ebcdf94..fc6f36079 100644 --- a/src/lib/subs/landgun.c +++ b/src/lib/subs/landgun.c @@ -32,6 +32,7 @@ #include +#include "chance.h" #include "damage.h" #include "file.h" #include "land.h" diff --git a/src/lib/subs/list.c b/src/lib/subs/list.c index fd6366ecf..32f1997e1 100644 --- a/src/lib/subs/list.c +++ b/src/lib/subs/list.c @@ -33,6 +33,7 @@ #include #include +#include "chance.h" #include "file.h" #include "land.h" #include "misc.h" diff --git a/src/lib/subs/lndsub.c b/src/lib/subs/lndsub.c index a4bc04ac2..8c4f6c3f2 100644 --- a/src/lib/subs/lndsub.c +++ b/src/lib/subs/lndsub.c @@ -36,6 +36,7 @@ #include #include +#include "chance.h" #include "combat.h" #include "damage.h" #include "empobj.h" diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index 04685dd04..08debd42a 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -35,6 +35,7 @@ #include #include +#include "chance.h" #include "empobj.h" #include "file.h" #include "item.h" diff --git a/src/lib/subs/move.c b/src/lib/subs/move.c index ac06d7d2c..61fd3a410 100644 --- a/src/lib/subs/move.c +++ b/src/lib/subs/move.c @@ -33,6 +33,7 @@ #include #include +#include "chance.h" #include "damage.h" #include "file.h" #include "map.h" diff --git a/src/lib/subs/mslsub.c b/src/lib/subs/mslsub.c index a8a5ddecb..f2aaf01c7 100644 --- a/src/lib/subs/mslsub.c +++ b/src/lib/subs/mslsub.c @@ -35,6 +35,7 @@ #include #include +#include "chance.h" #include "file.h" #include "misc.h" #include "nat.h" diff --git a/src/lib/subs/nreport.c b/src/lib/subs/nreport.c index c6797b880..b1020b756 100644 --- a/src/lib/subs/nreport.c +++ b/src/lib/subs/nreport.c @@ -35,6 +35,7 @@ #include +#include "chance.h" #include "file.h" #include "nat.h" #include "news.h" diff --git a/src/lib/subs/plnsub.c b/src/lib/subs/plnsub.c index f0ce33349..b0a4bd3b6 100644 --- a/src/lib/subs/plnsub.c +++ b/src/lib/subs/plnsub.c @@ -35,6 +35,7 @@ #include +#include "chance.h" #include "empobj.h" #include "file.h" #include "item.h" diff --git a/src/lib/subs/retreat.c b/src/lib/subs/retreat.c index ce210bc73..c62aca55c 100644 --- a/src/lib/subs/retreat.c +++ b/src/lib/subs/retreat.c @@ -32,6 +32,7 @@ #include +#include "chance.h" #include "damage.h" #include "file.h" #include "land.h" diff --git a/src/lib/subs/satmap.c b/src/lib/subs/satmap.c index 58512a45d..e016e54d3 100644 --- a/src/lib/subs/satmap.c +++ b/src/lib/subs/satmap.c @@ -34,6 +34,7 @@ #include #include +#include "chance.h" #include "file.h" #include "land.h" #include "map.h" diff --git a/src/lib/subs/shpsub.c b/src/lib/subs/shpsub.c index e7963f732..364e54870 100644 --- a/src/lib/subs/shpsub.c +++ b/src/lib/subs/shpsub.c @@ -35,6 +35,7 @@ #include #include +#include "chance.h" #include "damage.h" #include "empobj.h" #include "file.h" diff --git a/src/lib/subs/supply.c b/src/lib/subs/supply.c index 398096ea0..ff084dc2d 100644 --- a/src/lib/subs/supply.c +++ b/src/lib/subs/supply.c @@ -33,6 +33,7 @@ #include #include +#include "chance.h" #include "empobj.h" #include "file.h" #include "land.h" diff --git a/src/lib/subs/takeover.c b/src/lib/subs/takeover.c index e754c40b1..3a2ec8ead 100644 --- a/src/lib/subs/takeover.c +++ b/src/lib/subs/takeover.c @@ -34,6 +34,7 @@ #include +#include "chance.h" #include "file.h" #include "empobj.h" #include "game.h" diff --git a/src/lib/update/age.c b/src/lib/update/age.c index 1ee6f48e2..4f572a73c 100644 --- a/src/lib/update/age.c +++ b/src/lib/update/age.c @@ -32,6 +32,7 @@ #include +#include "chance.h" #include "update.h" int diff --git a/src/lib/update/human.c b/src/lib/update/human.c index f5f4905b9..56d0a8fd6 100644 --- a/src/lib/update/human.c +++ b/src/lib/update/human.c @@ -35,6 +35,7 @@ #include #include +#include "chance.h" #include "item.h" #include "news.h" #include "player.h" diff --git a/src/lib/update/land.c b/src/lib/update/land.c index 27c0ff10c..8b8a783fd 100644 --- a/src/lib/update/land.c +++ b/src/lib/update/land.c @@ -37,6 +37,7 @@ #include #include "budg.h" +#include "chance.h" #include "land.h" #include "lost.h" #include "news.h" diff --git a/src/lib/update/material.c b/src/lib/update/material.c index 024c36fe3..f44879962 100644 --- a/src/lib/update/material.c +++ b/src/lib/update/material.c @@ -34,6 +34,7 @@ #include #include "budg.h" +#include "chance.h" #include "player.h" #include "update.h" diff --git a/src/lib/update/plague.c b/src/lib/update/plague.c index d2c3a6220..0cfbfe371 100644 --- a/src/lib/update/plague.c +++ b/src/lib/update/plague.c @@ -32,6 +32,7 @@ #include +#include "chance.h" #include "item.h" #include "lost.h" #include "news.h" diff --git a/src/lib/update/plane.c b/src/lib/update/plane.c index d6ae28940..e5be2988e 100644 --- a/src/lib/update/plane.c +++ b/src/lib/update/plane.c @@ -35,6 +35,7 @@ #include #include "budg.h" +#include "chance.h" #include "lost.h" #include "plane.h" #include "player.h" diff --git a/src/lib/update/populace.c b/src/lib/update/populace.c index 57a948e7f..e87da3ce8 100644 --- a/src/lib/update/populace.c +++ b/src/lib/update/populace.c @@ -32,6 +32,7 @@ #include +#include "chance.h" #include "lost.h" #include "update.h" diff --git a/src/lib/update/produce.c b/src/lib/update/produce.c index e88bb3f8f..f0dec1ed5 100644 --- a/src/lib/update/produce.c +++ b/src/lib/update/produce.c @@ -33,6 +33,7 @@ #include #include "budg.h" +#include "chance.h" #include "player.h" #include "product.h" #include "update.h" diff --git a/src/lib/update/revolt.c b/src/lib/update/revolt.c index f93c783e5..4818f1d94 100644 --- a/src/lib/update/revolt.c +++ b/src/lib/update/revolt.c @@ -34,6 +34,7 @@ #include +#include "chance.h" #include "land.h" #include "lost.h" #include "news.h" diff --git a/src/lib/update/sect.c b/src/lib/update/sect.c index 2723c8c61..99310647d 100644 --- a/src/lib/update/sect.c +++ b/src/lib/update/sect.c @@ -35,6 +35,7 @@ #include #include "budg.h" +#include "chance.h" #include "item.h" #include "land.h" #include "lost.h" diff --git a/src/lib/update/ship.c b/src/lib/update/ship.c index 876be4f96..e28c8c2f9 100644 --- a/src/lib/update/ship.c +++ b/src/lib/update/ship.c @@ -37,6 +37,7 @@ #include #include "budg.h" +#include "chance.h" #include "land.h" #include "lost.h" #include "news.h" -- 2.43.0