(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
|
@ -39,9 +39,9 @@
|
|||
|
||||
struct fileinit {
|
||||
int ef_type;
|
||||
void (*init) (int, char *);
|
||||
int (*postread) (int, char *);
|
||||
int (*prewrite) (int, char *);
|
||||
void (*init) (int, void *);
|
||||
int (*postread) (int, void *);
|
||||
int (*prewrite) (int, void *);
|
||||
};
|
||||
|
||||
static struct fileinit fileinit[] = {
|
||||
|
|
|
@ -44,9 +44,9 @@
|
|||
#include "optlist.h"
|
||||
|
||||
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 lndstr theland;
|
||||
|
||||
|
@ -108,11 +108,10 @@ lnd_postread(int n, s_char *ptr)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
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 *lp;
|
||||
struct plnstr *pp;
|
||||
|
@ -163,9 +162,9 @@ lnd_prewrite(int n, s_char *ptr)
|
|||
}
|
||||
|
||||
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->lnd_uid = n;
|
||||
|
|
|
@ -44,11 +44,10 @@
|
|||
#include "nat.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
/*ARGSUSED*/
|
||||
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) {
|
||||
logerror("nuk_postread: Error - %d != %d, zeroing.\n", np->nuk_uid,
|
||||
|
@ -59,11 +58,10 @@ nuk_postread(int n, s_char *ptr)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
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;
|
||||
|
||||
np->ef_type = EF_NUKE;
|
||||
|
@ -77,9 +75,9 @@ nuk_prewrite(int n, s_char *ptr)
|
|||
}
|
||||
|
||||
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->nuk_uid = n;
|
||||
|
|
|
@ -44,9 +44,9 @@
|
|||
#include "optlist.h"
|
||||
|
||||
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 lndstr theland;
|
||||
|
||||
|
@ -106,11 +106,10 @@ pln_postread(int n, s_char *ptr)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
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;
|
||||
|
||||
if (pp->pln_effic < PLANE_MINEFF) {
|
||||
|
@ -131,9 +130,9 @@ pln_prewrite(int n, s_char *ptr)
|
|||
}
|
||||
|
||||
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->pln_uid = n;
|
||||
|
|
|
@ -48,11 +48,10 @@
|
|||
|
||||
static int checksect(struct sctstr *);
|
||||
|
||||
/*ARGSUSED*/
|
||||
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);
|
||||
player->owner = (player->god || sp->sct_own == player->cnum);
|
||||
|
@ -61,11 +60,10 @@ sct_postread(int id, s_char *ptr)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
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;
|
||||
|
||||
time(&sp->sct_timestamp);
|
||||
|
|
|
@ -44,11 +44,10 @@
|
|||
#include "prototypes.h"
|
||||
#include "optlist.h"
|
||||
|
||||
/*ARGSUSED*/
|
||||
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) {
|
||||
logerror("shp_postread: Error - %d != %d, zeroing.\n", sp->shp_uid,
|
||||
|
@ -63,9 +62,9 @@ shp_postread(int n, s_char *ptr)
|
|||
}
|
||||
|
||||
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 lndstr *lp;
|
||||
struct plnstr *pp;
|
||||
|
@ -116,9 +115,9 @@ shp_prewrite(int n, s_char *ptr)
|
|||
}
|
||||
|
||||
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->shp_uid = n;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue