From: Markus Armbruster Date: Fri, 30 Sep 2005 19:51:32 +0000 (+0000) Subject: (IO_CONN, io_conn, IOQ_BUFSIZE, MAXIOV, LND_NOTANY, plur) X-Git-Tag: v4.2.22~48 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=09b0b83971dc7096934f6888b54fd27308ce1fb1 (IO_CONN, io_conn, IOQ_BUFSIZE, MAXIOV, LND_NOTANY, plur) (techfactfire, reltech, P_DISTING, PLN_MAXDEF, filetruncate, sct_init) (nxtsctp, AN_SAILDIR, UDTIMES_MAX, BLITZTIME): Unused, remove. --- diff --git a/include/empio.h b/include/empio.h index 7b64ced46..5d0af8232 100644 --- a/include/empio.h +++ b/include/empio.h @@ -41,7 +41,6 @@ #define IO_NEWSOCK 0x4 #define IO_NBLOCK 0x8 #define IO_EOF 0x10 -#define IO_CONN 0x20 #define IO_ERROR 0x40 #define IO_BUFSIZE 4096 @@ -64,7 +63,6 @@ extern int io_output_all(struct iop *); extern int io_gets(struct iop *, s_char *, int); extern int io_puts(struct iop *, s_char *); extern int io_shutdown(struct iop *, int); -extern int io_conn(struct iop *); extern int io_error(struct iop *); extern int io_eof(struct iop *); extern int io_fileno(struct iop *); diff --git a/include/ioqueue.h b/include/ioqueue.h index ecdc102fe..aca717d68 100644 --- a/include/ioqueue.h +++ b/include/ioqueue.h @@ -34,9 +34,6 @@ #ifndef _IOQUEUE_H_ #define _IOQUEUE_H_ -#define IOQ_BUFSIZE 2048 -#define MAXIOV 16 - struct io { struct emp_qelem queue; int size; diff --git a/include/land.h b/include/land.h index a34b43d83..f5c405c39 100644 --- a/include/land.h +++ b/include/land.h @@ -97,8 +97,6 @@ struct lndstr { time_t lnd_timestamp; /* Last time this unit was touched */ }; -#define LND_NOTANY bit(0) /* Just a placeholder, not used */ - struct lchrstr { u_short l_item[I_MAX+1]; /* load limit */ char *l_name; /* full name of type of land unit */ diff --git a/include/misc.h b/include/misc.h index a3de937f0..4789b0986 100644 --- a/include/misc.h +++ b/include/misc.h @@ -141,7 +141,6 @@ extern s_char *numstr(s_char buf[], int n); extern s_char *esplur(int n); extern s_char *splur(int n); extern s_char *iesplur(int n); -extern s_char *plur(int n, s_char *no, s_char *yes); extern char *getstarg(char *input, char *prompt, char buf[]); extern char *getstring(char *prompt, char buf[]); extern char *ugetstring(char *prompt, char buf[]); diff --git a/include/nat.h b/include/nat.h index b65e49f32..d1bae7eb6 100644 --- a/include/nat.h +++ b/include/nat.h @@ -151,8 +151,6 @@ extern s_char *relates[]; extern double tfact(natid cn, double mult); extern double tfactfire(natid cn, double mult); extern double techfact(int level, double mult); -extern double techfactfire(int level, double mult); -extern double reltech(int level1, int level2, double mult); extern s_char *cname(natid n); extern s_char *relatename(struct natstr *np, natid other); diff --git a/include/path.h b/include/path.h index 07bf3104c..b6b339e67 100644 --- a/include/path.h +++ b/include/path.h @@ -73,7 +73,6 @@ extern double sector_mcost(struct sctstr *sp, int do_bonus); #define P_WALKING 1 /* use BestLandPath, only owned */ #define P_FLYING 2 /* use bestpath, any */ #define P_SAILING 3 /* use bestpath, any */ -#define P_DISTING 4 /* use BestDistPath, only owned */ #define MAX_PATH_LEN 1024 diff --git a/include/plane.h b/include/plane.h index 6bebae2b0..fb0eeabe9 100644 --- a/include/plane.h +++ b/include/plane.h @@ -125,8 +125,6 @@ struct plchrstr { #define PM_R bit(0) /* Recon mission */ #define PM_S bit(1) /* Mine-sweeping mission */ -#define PLN_MAXDEF 50 - /* internal to "fly" module -- really shouldn't be here */ struct plist { diff --git a/include/prototypes.h b/include/prototypes.h index af1af46a0..200a71944 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -288,7 +288,6 @@ extern int check_trade_ok(struct trdstr *); extern int fsize(int); extern int blksize(int); extern time_t fdate(int); -extern void filetruncate(s_char *); /* hap_fact.c */ extern double hap_fact(struct natstr *, struct natstr *); /* hours.c */ @@ -648,7 +647,6 @@ extern int sct_postread(int, s_char *); extern int sct_prewrite(int, s_char *); extern void item_prewrite(short *); extern int issector(s_char *); -extern void sct_init(coord, coord, s_char *); /* ship.c */ extern s_char *prship(struct shpstr *); extern int shp_postread(int, s_char *); @@ -764,8 +762,6 @@ extern void unload_it(struct shpstr *); extern void auto_fuel_ship(struct shpstr *); /* nxtitemp.c */ extern s_char *nxtitemp(struct nstr_item *); -/* nxtsctp.c */ -extern struct sctstr *nxtsctp(register struct nstr_sect *); /* plague.c */ extern void do_plague(struct sctstr *, struct natstr *, int); extern int plague_people(struct natstr *, short *, int *, int *, int); diff --git a/include/ship.h b/include/ship.h index f04a6accc..56a2b9665 100644 --- a/include/ship.h +++ b/include/ship.h @@ -46,7 +46,6 @@ /* bit masks for the autonav mode flags */ -#define AN_SAILDIR bit(1) #define AN_AUTONAV bit(2) #define AN_STANDBY bit(3) #define AN_LOADING bit(4) diff --git a/include/wantupd.h b/include/wantupd.h index 97397f100..b009bfa18 100644 --- a/include/wantupd.h +++ b/include/wantupd.h @@ -87,15 +87,10 @@ #define UDP_MAX 3 #define UDP_DEFAULT UDP_NORMAL -/* The maximum number of "update_times" allowed */ -#define UDTIMES_MAX 20 - #define UDDEM_TMCHECK 0 #define UDDEM_COMSET 1 #define UDDEM_DISABLE 2 #define UDDEM_MAX 2 #define UDDEM_DEFAULT UDDEM_TMCHECK -#define BLITZTIME 20 - #endif /* _WANTUPD_H_ */ diff --git a/src/client/ioqueue.h b/src/client/ioqueue.h index 8953b9da4..da6ae4cbf 100644 --- a/src/client/ioqueue.h +++ b/src/client/ioqueue.h @@ -32,8 +32,6 @@ * */ -#define MAXIOV 16 - struct ioqueue { struct qelem queue; /* queue fwd/back */ int bsize; /* basic block size */ diff --git a/src/lib/commands/orde.c b/src/lib/commands/orde.c index 114cc27b9..c21273625 100644 --- a/src/lib/commands/orde.c +++ b/src/lib/commands/orde.c @@ -179,7 +179,7 @@ orde(void) ship.shp_destx[0] = p0x; ship.shp_desty[0] = p0y; - ship.shp_autonav &= ~(AN_STANDBY + AN_SAILDIR + AN_LOADING); + ship.shp_autonav &= ~(AN_STANDBY | AN_LOADING); ship.shp_autonav |= AN_AUTONAV; if (scuttling) diff --git a/src/lib/common/fsize.c b/src/lib/common/fsize.c index 5158ff221..e0baea4c1 100644 --- a/src/lib/common/fsize.c +++ b/src/lib/common/fsize.c @@ -84,9 +84,3 @@ fdate(int fd) return 0; return statb.st_mtime; } - -void -filetruncate(s_char *name) -{ - close(open(name, O_RDWR | O_TRUNC, 0660)); -} diff --git a/src/lib/common/tfact.c b/src/lib/common/tfact.c index 7884dce32..0fc165288 100644 --- a/src/lib/common/tfact.c +++ b/src/lib/common/tfact.c @@ -65,24 +65,3 @@ techfact(int level, double mult) { return mult * ((50.0 + level) / (200.0 + level)); } - -/* - * added so that firing range can be different to other ranges - */ -double -techfactfire(int level, double mult) -{ - return mult * ((50.0 + level) / (200.0 + level)) * fire_range_factor; -} - -/* - * figure out relative difference between two tech levels - */ -double -reltech(int level1, int level2, double mult) -{ - int diff; - - diff = level1 - level2; - return (1.0 + ((diff + 50.0) / (level1 + 50.0))) * mult; -} diff --git a/src/lib/gen/io.c b/src/lib/gen/io.c index 6686bb0e8..fe7906613 100644 --- a/src/lib/gen/io.c +++ b/src/lib/gen/io.c @@ -403,12 +403,6 @@ io_noblocking(struct iop *iop, int value) return 0; } -int -io_conn(struct iop *iop) -{ - return iop->flags & IO_CONN; -} - int io_error(struct iop *iop) { diff --git a/src/lib/gen/plur.c b/src/lib/gen/plur.c index 06da17a44..ffc804936 100644 --- a/src/lib/gen/plur.c +++ b/src/lib/gen/plur.c @@ -34,12 +34,6 @@ #include "misc.h" #include "gen.h" -s_char * -plur(int n, s_char *no, s_char *yes) -{ - return n == 1 ? no : yes; -} - s_char * splur(int n) { diff --git a/src/lib/subs/sect.c b/src/lib/subs/sect.c index b2f82f295..b66f4b2df 100644 --- a/src/lib/subs/sect.c +++ b/src/lib/subs/sect.c @@ -148,15 +148,3 @@ issector(s_char *arg) return 0; } - -void -sct_init(coord x, coord y, s_char *ptr) -{ - struct sctstr *sp = (struct sctstr *)ptr; - - sp->ef_type = EF_SECTOR; - sp->sct_x = x; - sp->sct_y = y; - sp->sct_dist_x = x; - sp->sct_dist_y = y; -} diff --git a/src/lib/update/Makefile b/src/lib/update/Makefile index f1e419550..4acd74911 100644 --- a/src/lib/update/Makefile +++ b/src/lib/update/Makefile @@ -37,12 +37,12 @@ NTLIB = $(SRCDIR)\lib\libupdate.lib OBJS = age.o anno.o bp.o deliver.o distribute.o finish.o human.o land.o \ main.o material.o mobility.o move_sat.o nat.o nav_ship.o nav_util.o \ - nxtitemp.o nxtsctp.o plague.o plane.o populace.o prepare.o produce.o \ + nxtitemp.o plague.o plane.o populace.o prepare.o produce.o \ removewants.o revolt.o sail.o sect.o ship.o NTOBJS = age.obj anno.obj bp.obj deliver.obj distribute.obj finish.obj \ human.obj land.obj main.obj material.obj mobility.obj move_sat.obj \ - nat.obj nav_ship.obj nav_util.obj nxtitemp.obj nxtsctp.obj plague.obj \ + nat.obj nav_ship.obj nav_util.obj nxtitemp.obj plague.obj \ plane.obj populace.obj prepare.obj produce.obj removewants.obj \ revolt.obj sail.obj sect.obj ship.obj diff --git a/src/lib/update/nxtsctp.c b/src/lib/update/nxtsctp.c deleted file mode 100644 index c05501a6d..000000000 --- a/src/lib/update/nxtsctp.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Empire - A multi-player, client/server Internet based war game. - * Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak, - * Ken Stevens, Steve McClure - * - * This program 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * --- - * - * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the - * related information and legal notices. It is expected that any future - * projects/authors will amend these files as needed. - * - * --- - * - * nxtsctp.c: select/get the next sector from a rnage of sectors - * - * Known contributors to this file: - * Dave Pare, 1989 - */ - -#include "misc.h" -#include "xy.h" -#include "sect.h" -#include "nsc.h" -#include "file.h" -#include "update.h" -#include "gen.h" -#include "optlist.h" - -/* - * get the next sector in the range - * that matches the conditions. - */ -struct sctstr * -nxtsctp(struct nstr_sect *np) -{ - while (1) { - np->dx++; - np->x++; - if (np->x >= WORLD_X) - np->x = 0; - if (np->dx >= np->range.width) { - np->dx = 0; - np->x = np->range.lx; - np->dy++; - if (np->dy >= np->range.height) - return (struct sctstr *)0; - np->y++; - if (np->y >= WORLD_Y) - np->y = 0; - } - if ((np->y + np->x) & 01) - continue; - if (np->type == NS_DIST) { - np->curdist = mapdist(np->x, np->y, np->cx, np->cy); - if (np->curdist > np->dist) - continue; - } - return getsectp(np->x, np->y); - } - /*NOTREACHED*/ -}