(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.
This commit is contained in:
Markus Armbruster 2005-09-30 19:51:32 +00:00
parent 4be9c189cb
commit 09b0b83971
19 changed files with 3 additions and 154 deletions

View 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 *);

View 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;

View 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 */

View 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[]);

View 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);

View 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

View 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 {

View 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);

View 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)

View file

@ -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_ */

View file

@ -32,8 +32,6 @@
*
*/
#define MAXIOV 16
struct ioqueue {
struct qelem queue; /* queue fwd/back */
int bsize; /* basic block size */

View 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)

View 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));
}

View 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;
}

View 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)
{

View file

@ -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)
{

View 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;
}

View 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

View file

@ -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*/
}