(empfile, fileinit, lnd_init, lnd_postread, lnd_prewrite, nuk_init)
(nuk_postread, nuk_prewrite, pln_init, pln_postread, pln_prewrite) (sct_postread, sct_prewrite, shp_init, shp_postread, shp_prewrite) (ef_extend): Use void * for generic pointer parameter.
This commit is contained in:
parent
3db4e34ba4
commit
c3900f8424
9 changed files with 49 additions and 56 deletions
|
@ -58,9 +58,9 @@ struct empfile {
|
||||||
int fd; /* file descriptor, -1 if not open */
|
int fd; /* file descriptor, -1 if not open */
|
||||||
/* and flags bit EFF_RDONLY */
|
/* and flags bit EFF_RDONLY */
|
||||||
/* User callbacks */
|
/* User callbacks */
|
||||||
void (*init)(int, char *); /* called after entry creation, unless null */
|
void (*init)(int, void *); /* called after entry creation, unless null */
|
||||||
int (*postread)(int, char *); /* called after read, unless null */
|
int (*postread)(int, void *); /* called after read, unless null */
|
||||||
int (*prewrite)(int, char *); /* called before write, unless null */
|
int (*prewrite)(int, void *); /* called before write, unless null */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -494,9 +494,9 @@ extern void bitinit2(struct nstr_sect *, u_char *, int);
|
||||||
extern int getele(char *, char *);
|
extern int getele(char *, char *);
|
||||||
/* land.c */
|
/* land.c */
|
||||||
extern s_char *prland(struct lndstr *);
|
extern s_char *prland(struct lndstr *);
|
||||||
extern int lnd_postread(int, s_char *);
|
extern int lnd_postread(int, void *);
|
||||||
extern int lnd_prewrite(int, s_char *);
|
extern int lnd_prewrite(int, void *);
|
||||||
extern void lnd_init(int, s_char *);
|
extern void lnd_init(int, void *);
|
||||||
/* landgun.c */
|
/* landgun.c */
|
||||||
extern double seagun(int, int);
|
extern double seagun(int, int);
|
||||||
extern double landgun(int, int);
|
extern double landgun(int, int);
|
||||||
|
@ -553,9 +553,9 @@ extern void delete_old_news(void);
|
||||||
extern void init_nreport(void);
|
extern void init_nreport(void);
|
||||||
extern void nreport(natid, int, natid, int);
|
extern void nreport(natid, int, natid, int);
|
||||||
/* nuke.c */
|
/* nuke.c */
|
||||||
extern int nuk_postread(int, s_char *);
|
extern int nuk_postread(int, void *);
|
||||||
extern int nuk_prewrite(int, s_char *);
|
extern int nuk_prewrite(int, void *);
|
||||||
extern void nuk_init(int, s_char *);
|
extern void nuk_init(int, void *);
|
||||||
extern void nuk_add(coord, coord, int, int);
|
extern void nuk_add(coord, coord, int, int);
|
||||||
extern void nuk_delete(struct nukstr *, int, int);
|
extern void nuk_delete(struct nukstr *, int, int);
|
||||||
/* nxtitem.c */
|
/* nxtitem.c */
|
||||||
|
@ -564,9 +564,9 @@ extern int nxtitem(struct nstr_item *, void *);
|
||||||
extern int nxtsct(struct nstr_sect *, struct sctstr *);
|
extern int nxtsct(struct nstr_sect *, struct sctstr *);
|
||||||
/* plane.c */
|
/* plane.c */
|
||||||
extern s_char *prplane(struct plnstr *);
|
extern s_char *prplane(struct plnstr *);
|
||||||
extern int pln_postread(int, s_char *);
|
extern int pln_postread(int, void *);
|
||||||
extern int pln_prewrite(int, s_char *);
|
extern int pln_prewrite(int, void *);
|
||||||
extern void pln_init(int, s_char *);
|
extern void pln_init(int, void *);
|
||||||
/* plnsub.c */
|
/* plnsub.c */
|
||||||
extern void count_planes(struct shpstr *);
|
extern void count_planes(struct shpstr *);
|
||||||
extern struct sctstr *get_assembly_point(char *, struct sctstr *, char *);
|
extern struct sctstr *get_assembly_point(char *, struct sctstr *, char *);
|
||||||
|
@ -653,15 +653,15 @@ extern void satdisp(struct sctstr *, int, int);
|
||||||
extern void satmap(int, int, int, int, int, int);
|
extern void satmap(int, int, int, int, int, int);
|
||||||
extern void sathead(void);
|
extern void sathead(void);
|
||||||
/* sect.c */
|
/* sect.c */
|
||||||
extern int sct_postread(int, s_char *);
|
extern int sct_postread(int, void *);
|
||||||
extern int sct_prewrite(int, s_char *);
|
extern int sct_prewrite(int, void *);
|
||||||
extern void item_prewrite(short *);
|
extern void item_prewrite(short *);
|
||||||
extern int issector(s_char *);
|
extern int issector(s_char *);
|
||||||
/* ship.c */
|
/* ship.c */
|
||||||
extern s_char *prship(struct shpstr *);
|
extern s_char *prship(struct shpstr *);
|
||||||
extern int shp_postread(int, s_char *);
|
extern int shp_postread(int, void *);
|
||||||
extern int shp_prewrite(int, s_char *);
|
extern int shp_prewrite(int, void *);
|
||||||
extern void shp_init(int, s_char *);
|
extern void shp_init(int, void *);
|
||||||
/* show.c */
|
/* show.c */
|
||||||
extern void show_bridge(int);
|
extern void show_bridge(int);
|
||||||
extern void show_tower(int);
|
extern void show_tower(int);
|
||||||
|
|
|
@ -379,7 +379,7 @@ int
|
||||||
ef_extend(int type, int count)
|
ef_extend(int type, int count)
|
||||||
{
|
{
|
||||||
struct empfile *ep;
|
struct empfile *ep;
|
||||||
char *tmpobj;
|
void *tmpobj;
|
||||||
int id, i, how;
|
int id, i, how;
|
||||||
|
|
||||||
if (ef_check(type) < 0)
|
if (ef_check(type) < 0)
|
||||||
|
|
|
@ -39,9 +39,9 @@
|
||||||
|
|
||||||
struct fileinit {
|
struct fileinit {
|
||||||
int ef_type;
|
int ef_type;
|
||||||
void (*init) (int, char *);
|
void (*init) (int, void *);
|
||||||
int (*postread) (int, char *);
|
int (*postread) (int, void *);
|
||||||
int (*prewrite) (int, char *);
|
int (*prewrite) (int, void *);
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct fileinit fileinit[] = {
|
static struct fileinit fileinit[] = {
|
||||||
|
|
|
@ -44,9 +44,9 @@
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
lnd_postread(int n, s_char *ptr)
|
lnd_postread(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct lndstr *llp = (struct lndstr *)ptr;
|
struct lndstr *llp = ptr;
|
||||||
struct shpstr theship;
|
struct shpstr theship;
|
||||||
struct lndstr theland;
|
struct lndstr theland;
|
||||||
|
|
||||||
|
@ -108,11 +108,10 @@ lnd_postread(int n, s_char *ptr)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
lnd_prewrite(int n, s_char *ptr)
|
lnd_prewrite(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct lndstr *llp = (struct lndstr *)ptr;
|
struct lndstr *llp = ptr;
|
||||||
struct lndstr land;
|
struct lndstr land;
|
||||||
struct lndstr *lp;
|
struct lndstr *lp;
|
||||||
struct plnstr *pp;
|
struct plnstr *pp;
|
||||||
|
@ -163,9 +162,9 @@ lnd_prewrite(int n, s_char *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lnd_init(int n, s_char *ptr)
|
lnd_init(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct lndstr *lp = (struct lndstr *)ptr;
|
struct lndstr *lp = ptr;
|
||||||
|
|
||||||
lp->ef_type = EF_LAND;
|
lp->ef_type = EF_LAND;
|
||||||
lp->lnd_uid = n;
|
lp->lnd_uid = n;
|
||||||
|
|
|
@ -44,11 +44,10 @@
|
||||||
#include "nat.h"
|
#include "nat.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
nuk_postread(int n, s_char *ptr)
|
nuk_postread(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct nukstr *np = (struct nukstr *)ptr;
|
struct nukstr *np = ptr;
|
||||||
|
|
||||||
if (np->nuk_uid != n) {
|
if (np->nuk_uid != n) {
|
||||||
logerror("nuk_postread: Error - %d != %d, zeroing.\n", np->nuk_uid,
|
logerror("nuk_postread: Error - %d != %d, zeroing.\n", np->nuk_uid,
|
||||||
|
@ -59,11 +58,10 @@ nuk_postread(int n, s_char *ptr)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
nuk_prewrite(int n, s_char *ptr)
|
nuk_prewrite(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct nukstr *np = (struct nukstr *)ptr;
|
struct nukstr *np = ptr;
|
||||||
struct nukstr nuke;
|
struct nukstr nuke;
|
||||||
|
|
||||||
np->ef_type = EF_NUKE;
|
np->ef_type = EF_NUKE;
|
||||||
|
@ -77,9 +75,9 @@ nuk_prewrite(int n, s_char *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nuk_init(int n, s_char *ptr)
|
nuk_init(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct nukstr *np = (struct nukstr *)ptr;
|
struct nukstr *np = ptr;
|
||||||
|
|
||||||
np->ef_type = EF_NUKE;
|
np->ef_type = EF_NUKE;
|
||||||
np->nuk_uid = n;
|
np->nuk_uid = n;
|
||||||
|
|
|
@ -44,9 +44,9 @@
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
pln_postread(int n, s_char *ptr)
|
pln_postread(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct plnstr *pp = (struct plnstr *)ptr;
|
struct plnstr *pp = ptr;
|
||||||
struct shpstr theship;
|
struct shpstr theship;
|
||||||
struct lndstr theland;
|
struct lndstr theland;
|
||||||
|
|
||||||
|
@ -106,11 +106,10 @@ pln_postread(int n, s_char *ptr)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
pln_prewrite(int n, s_char *ptr)
|
pln_prewrite(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct plnstr *pp = (struct plnstr *)ptr;
|
struct plnstr *pp = ptr;
|
||||||
struct plnstr plane;
|
struct plnstr plane;
|
||||||
|
|
||||||
if (pp->pln_effic < PLANE_MINEFF) {
|
if (pp->pln_effic < PLANE_MINEFF) {
|
||||||
|
@ -131,9 +130,9 @@ pln_prewrite(int n, s_char *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pln_init(int n, s_char *ptr)
|
pln_init(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct plnstr *pp = (struct plnstr *)ptr;
|
struct plnstr *pp = ptr;
|
||||||
|
|
||||||
pp->ef_type = EF_PLANE;
|
pp->ef_type = EF_PLANE;
|
||||||
pp->pln_uid = n;
|
pp->pln_uid = n;
|
||||||
|
|
|
@ -48,11 +48,10 @@
|
||||||
|
|
||||||
static int checksect(struct sctstr *);
|
static int checksect(struct sctstr *);
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
sct_postread(int id, s_char *ptr)
|
sct_postread(int id, void *ptr)
|
||||||
{
|
{
|
||||||
struct sctstr *sp = (struct sctstr *)ptr;
|
struct sctstr *sp = ptr;
|
||||||
|
|
||||||
checksect(sp);
|
checksect(sp);
|
||||||
player->owner = (player->god || sp->sct_own == player->cnum);
|
player->owner = (player->god || sp->sct_own == player->cnum);
|
||||||
|
@ -61,11 +60,10 @@ sct_postread(int id, s_char *ptr)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
sct_prewrite(int id, s_char *ptr)
|
sct_prewrite(int id, void *ptr)
|
||||||
{
|
{
|
||||||
struct sctstr *sp = (struct sctstr *)ptr;
|
struct sctstr *sp = ptr;
|
||||||
struct sctstr sect;
|
struct sctstr sect;
|
||||||
|
|
||||||
time(&sp->sct_timestamp);
|
time(&sp->sct_timestamp);
|
||||||
|
|
|
@ -44,11 +44,10 @@
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int
|
int
|
||||||
shp_postread(int n, s_char *ptr)
|
shp_postread(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct shpstr *sp = (struct shpstr *)ptr;
|
struct shpstr *sp = ptr;
|
||||||
|
|
||||||
if (sp->shp_uid != n) {
|
if (sp->shp_uid != n) {
|
||||||
logerror("shp_postread: Error - %d != %d, zeroing.\n", sp->shp_uid,
|
logerror("shp_postread: Error - %d != %d, zeroing.\n", sp->shp_uid,
|
||||||
|
@ -63,9 +62,9 @@ shp_postread(int n, s_char *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
shp_prewrite(int n, s_char *ptr)
|
shp_prewrite(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct shpstr *sp = (struct shpstr *)ptr;
|
struct shpstr *sp = ptr;
|
||||||
struct shpstr ship;
|
struct shpstr ship;
|
||||||
struct lndstr *lp;
|
struct lndstr *lp;
|
||||||
struct plnstr *pp;
|
struct plnstr *pp;
|
||||||
|
@ -116,9 +115,9 @@ shp_prewrite(int n, s_char *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
shp_init(int n, s_char *ptr)
|
shp_init(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct shpstr *sp = (struct shpstr *)ptr;
|
struct shpstr *sp = ptr;
|
||||||
|
|
||||||
sp->ef_type = EF_SHIP;
|
sp->ef_type = EF_SHIP;
|
||||||
sp->shp_uid = n;
|
sp->shp_uid = n;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue