]> git.pond.sub.org Git - empserver/commitdiff
(IO_CONN, io_conn, IOQ_BUFSIZE, MAXIOV, LND_NOTANY, plur)
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 30 Sep 2005 19:51:32 +0000 (19:51 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 30 Sep 2005 19:51:32 +0000 (19:51 +0000)
(techfactfire, reltech, P_DISTING, PLN_MAXDEF, filetruncate, sct_init)
(nxtsctp, AN_SAILDIR, UDTIMES_MAX, BLITZTIME): Unused, remove.

19 files changed:
include/empio.h
include/ioqueue.h
include/land.h
include/misc.h
include/nat.h
include/path.h
include/plane.h
include/prototypes.h
include/ship.h
include/wantupd.h
src/client/ioqueue.h
src/lib/commands/orde.c
src/lib/common/fsize.c
src/lib/common/tfact.c
src/lib/gen/io.c
src/lib/gen/plur.c
src/lib/subs/sect.c
src/lib/update/Makefile
src/lib/update/nxtsctp.c [deleted file]

index 7b64ced4673b7283cc581598ec9f5a3aa06083c3..5d0af8232a94f872112a3756e4549d340cbc7d0f 100644 (file)
@@ -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 *);
index ecdc102fe9b576aae62ea2f6fb40027bdb2da29d..aca717d68c2d7f3eca41ec863e72b2ab5afc5d3c 100644 (file)
@@ -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;
index a34b43d83b2289b68f12fc449b4a360d0d054bb0..f5c405c391211f7cd533f3154b288bfeccc9d0e8 100644 (file)
@@ -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 */
index a3de937f02e334e98874bee215d9764cc907255d..4789b0986c4a296e5c88cb933bfbf632fbc23944 100644 (file)
@@ -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[]);
index b65e49f32e5e46078a587025dfcc5c0326cb3886..d1bae7eb65db7e919fe2e2ca1d47aebc5113baa4 100644 (file)
@@ -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);
index 07bf3104c71993f58017eb9b30856574f29a0fe2..b6b339e670b6be9dd3f0559fe45d6f85d1bfd992 100644 (file)
@@ -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
 
index 6bebae2b09001ff6cf2c2b9e7ba2db51ce7fc041..fb0eeabe9067444de29542ddd05e335ae52404b3 100644 (file)
@@ -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 {
index af1af46a0250437445360c45a35b3f12b652545c..200a7194496100ef1af39d544252f5f098c5b77e 100644 (file)
@@ -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);
index f04a6accc07715b4e59a4327c5ca0447e0e92e8f..56a2b9665ca5891718c96e65457ecaa7cfc361a6 100644 (file)
@@ -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)
index 97397f100a6649ff401dc0dc162b9a9bfab0b8ae..b009bfa1877c54f148cd96bdef03436d5610c9a8 100644 (file)
 #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_ */
index 8953b9da4c24568e71f2709b692aa1b35a32009c..da6ae4cbff95feb15038df1e2f3716d5d08253ef 100644 (file)
@@ -32,8 +32,6 @@
  *  
  */
 
-#define MAXIOV         16
-
 struct ioqueue {
     struct qelem queue;                /* queue fwd/back */
     int bsize;                 /* basic block size */
index 114cc27b98851bd6e8be41b62330fa174c01cdae..c21273625f81d03d51f243d2ac5bd7b9066b8b27 100644 (file)
@@ -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)
index 5158ff2211ea4eef53c653de3ddb0be6db4b75fa..e0baea4c1c61fd28b255b6fb265045fd2d0be5e0 100644 (file)
@@ -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));
-}
index 7884dce32d3a32eaa4391adf266db4924492044e..0fc165288fbf132cf1c30a50ec3b3d38c9819327 100644 (file)
@@ -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;
-}
index 6686bb0e8fe44b6b059a212ed0451c8a5c9e9a11..fe790661359955e9327aac521f4645cf64624a7c 100644 (file)
@@ -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)
 {
index 06da17a443372a9cad9627f400f450a645a9572b..ffc8049361f72bbac28981aa15732f4e00f8e612 100644 (file)
 #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)
 {
index b2f82f2957e8d6bff5d0532f2d6828ffd591f85a..b66f4b2df11b16ab9d516b600993eba3d34ebb3d 100644 (file)
@@ -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;
-}
index f1e419550ef40611e675150b3e70e7d3a2737ea6..4acd74911f9406d319019aa9c53759588def538a 100644 (file)
@@ -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 (file)
index c05501a..0000000
+++ /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*/
-}