Change empfile members postread() and prewrite() to return void
Callers ignore the value, and callees always return 1. Pointless.
This commit is contained in:
parent
e438f6b4cd
commit
bf436a4498
8 changed files with 35 additions and 38 deletions
|
@ -59,9 +59,19 @@ struct empfile {
|
||||||
int fd; /* file descriptor, -1 if not open */
|
int fd; /* file descriptor, -1 if not open */
|
||||||
/* flags bits EFF_PRIVATE, EFF_CUSTOM also vary */
|
/* flags bits EFF_PRIVATE, EFF_CUSTOM also vary */
|
||||||
|
|
||||||
/* User callbacks */
|
/* User callbacks, may all be null */
|
||||||
int (*postread)(int, void *); /* called after read, unless null */
|
/*
|
||||||
int (*prewrite)(int, void *); /* called before write, unless null */
|
* Called after read, with file type and element as arguments.
|
||||||
|
* May modify the element. Modifications are visible to caller of
|
||||||
|
* ef_read(), but have no effect on the file.
|
||||||
|
*/
|
||||||
|
void (*postread)(int, void *);
|
||||||
|
/*
|
||||||
|
* Called before write, with file type and element as arguments.
|
||||||
|
* May modify the element. Modifications will be visible to
|
||||||
|
* caller of ef_write() and are written to the file.
|
||||||
|
*/
|
||||||
|
void (*prewrite)(int, void *);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct emptypedstr {
|
struct emptypedstr {
|
||||||
|
|
|
@ -450,8 +450,8 @@ extern void bitinit2(struct nstr_sect *, unsigned char *, int);
|
||||||
extern int getele(char *, char *);
|
extern int getele(char *, char *);
|
||||||
/* land.c */
|
/* land.c */
|
||||||
extern char *prland(struct lndstr *);
|
extern char *prland(struct lndstr *);
|
||||||
extern int lnd_postread(int, void *);
|
extern void lnd_postread(int, void *);
|
||||||
extern int lnd_prewrite(int, void *);
|
extern void lnd_prewrite(int, void *);
|
||||||
/* landgun.c */
|
/* landgun.c */
|
||||||
extern double seagun(int, int);
|
extern double seagun(int, int);
|
||||||
extern double fortgun(int, int);
|
extern double fortgun(int, int);
|
||||||
|
@ -517,8 +517,8 @@ extern void init_nreport(void);
|
||||||
extern void nreport(natid, int, natid, int);
|
extern void nreport(natid, int, natid, int);
|
||||||
/* nuke.c */
|
/* nuke.c */
|
||||||
extern char *prnuke(struct nukstr *);
|
extern char *prnuke(struct nukstr *);
|
||||||
extern int nuk_postread(int, void *);
|
extern void nuk_postread(int, void *);
|
||||||
extern int nuk_prewrite(int, void *);
|
extern void nuk_prewrite(int, void *);
|
||||||
extern int nuk_on_plane(struct nukstr *, int);
|
extern int nuk_on_plane(struct nukstr *, int);
|
||||||
/* nxtitem.c */
|
/* nxtitem.c */
|
||||||
extern int nxtitem(struct nstr_item *, void *);
|
extern int nxtitem(struct nstr_item *, void *);
|
||||||
|
@ -528,8 +528,8 @@ extern int nxtsct(struct nstr_sect *, struct sctstr *);
|
||||||
extern int onearg(char *, char *);
|
extern int onearg(char *, char *);
|
||||||
/* plane.c */
|
/* plane.c */
|
||||||
extern char *prplane(struct plnstr *);
|
extern char *prplane(struct plnstr *);
|
||||||
extern int pln_postread(int, void *);
|
extern void pln_postread(int, void *);
|
||||||
extern int pln_prewrite(int, void *);
|
extern void pln_prewrite(int, void *);
|
||||||
/* plnsub.c */
|
/* plnsub.c */
|
||||||
extern void count_planes(struct shpstr *);
|
extern void count_planes(struct shpstr *);
|
||||||
extern int get_planes(struct nstr_item *, struct nstr_item *,
|
extern int get_planes(struct nstr_item *, struct nstr_item *,
|
||||||
|
@ -618,8 +618,8 @@ extern void satdisp_units(coord, coord);
|
||||||
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, void *);
|
extern void sct_postread(int, void *);
|
||||||
extern int sct_prewrite(int, void *);
|
extern void sct_prewrite(int, void *);
|
||||||
extern void item_prewrite(short *);
|
extern void item_prewrite(short *);
|
||||||
extern int issector(char *);
|
extern int issector(char *);
|
||||||
/* sectdamage.c */
|
/* sectdamage.c */
|
||||||
|
@ -627,8 +627,8 @@ extern int sect_damage(struct sctstr *, int);
|
||||||
extern int sectdamage(struct sctstr *, int);
|
extern int sectdamage(struct sctstr *, int);
|
||||||
/* ship.c */
|
/* ship.c */
|
||||||
extern char *prship(struct shpstr *);
|
extern char *prship(struct shpstr *);
|
||||||
extern int shp_postread(int, void *);
|
extern void shp_postread(int, void *);
|
||||||
extern int shp_prewrite(int, void *);
|
extern void shp_prewrite(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);
|
||||||
|
|
|
@ -41,8 +41,8 @@
|
||||||
|
|
||||||
struct fileinit {
|
struct fileinit {
|
||||||
int ef_type;
|
int ef_type;
|
||||||
int (*postread) (int, void *);
|
void (*postread) (int, void *);
|
||||||
int (*prewrite) (int, void *);
|
void (*prewrite) (int, void *);
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct fileinit fileinit[] = {
|
static struct fileinit fileinit[] = {
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "ship.h"
|
#include "ship.h"
|
||||||
|
|
||||||
int
|
void
|
||||||
lnd_postread(int n, void *ptr)
|
lnd_postread(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct lndstr *llp = ptr;
|
struct lndstr *llp = ptr;
|
||||||
|
@ -106,10 +106,9 @@ lnd_postread(int n, void *ptr)
|
||||||
lnd_do_upd_mob(llp);
|
lnd_do_upd_mob(llp);
|
||||||
|
|
||||||
player->owner = (player->god || llp->lnd_own == player->cnum);
|
player->owner = (player->god || llp->lnd_own == player->cnum);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
lnd_prewrite(int n, void *ptr)
|
lnd_prewrite(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct lndstr *llp = ptr;
|
struct lndstr *llp = ptr;
|
||||||
|
@ -154,7 +153,6 @@ lnd_prewrite(int n, void *ptr)
|
||||||
getland(n, &land);
|
getland(n, &land);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
#include "sect.h"
|
#include "sect.h"
|
||||||
#include "xy.h"
|
#include "xy.h"
|
||||||
|
|
||||||
int
|
void
|
||||||
nuk_postread(int n, void *ptr)
|
nuk_postread(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct nukstr *np = ptr;
|
struct nukstr *np = ptr;
|
||||||
|
@ -71,10 +71,9 @@ nuk_postread(int n, void *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
player->owner = (player->god || np->nuk_own == player->cnum);
|
player->owner = (player->god || np->nuk_own == player->cnum);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
nuk_prewrite(int n, void *ptr)
|
nuk_prewrite(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct nukstr *np = ptr;
|
struct nukstr *np = ptr;
|
||||||
|
@ -89,8 +88,6 @@ nuk_prewrite(int n, void *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
getnuke(n, &nuke);
|
getnuke(n, &nuke);
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "ship.h"
|
#include "ship.h"
|
||||||
|
|
||||||
int
|
void
|
||||||
pln_postread(int n, void *ptr)
|
pln_postread(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct plnstr *pp = ptr;
|
struct plnstr *pp = ptr;
|
||||||
|
@ -105,10 +105,9 @@ pln_postread(int n, void *ptr)
|
||||||
player->owner = (player->god || pp->pln_own == player->cnum);
|
player->owner = (player->god || pp->pln_own == player->cnum);
|
||||||
if (opt_MOB_ACCESS)
|
if (opt_MOB_ACCESS)
|
||||||
pln_do_upd_mob(pp);
|
pln_do_upd_mob(pp);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
pln_prewrite(int n, void *ptr)
|
pln_prewrite(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct plnstr *pp = ptr;
|
struct plnstr *pp = ptr;
|
||||||
|
@ -132,8 +131,6 @@ pln_prewrite(int n, void *ptr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getplane(n, &plane);
|
getplane(n, &plane);
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
static int checksect(struct sctstr *);
|
static int checksect(struct sctstr *);
|
||||||
|
|
||||||
int
|
void
|
||||||
sct_postread(int id, void *ptr)
|
sct_postread(int id, void *ptr)
|
||||||
{
|
{
|
||||||
struct sctstr *sp = ptr;
|
struct sctstr *sp = ptr;
|
||||||
|
@ -59,10 +59,9 @@ sct_postread(int id, void *ptr)
|
||||||
player->owner = (player->god || sp->sct_own == player->cnum);
|
player->owner = (player->god || sp->sct_own == player->cnum);
|
||||||
if (opt_MOB_ACCESS)
|
if (opt_MOB_ACCESS)
|
||||||
sct_do_upd_mob(sp);
|
sct_do_upd_mob(sp);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
sct_prewrite(int id, void *ptr)
|
sct_prewrite(int id, void *ptr)
|
||||||
{
|
{
|
||||||
struct sctstr *sp = ptr;
|
struct sctstr *sp = ptr;
|
||||||
|
@ -71,7 +70,6 @@ sct_prewrite(int id, void *ptr)
|
||||||
bridge_damaged(sp);
|
bridge_damaged(sp);
|
||||||
checksect(sp);
|
checksect(sp);
|
||||||
getsect(sp->sct_x, sp->sct_y, §);
|
getsect(sp->sct_x, sp->sct_y, §);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "ship.h"
|
#include "ship.h"
|
||||||
|
|
||||||
int
|
void
|
||||||
shp_postread(int n, void *ptr)
|
shp_postread(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct shpstr *sp = ptr;
|
struct shpstr *sp = ptr;
|
||||||
|
@ -59,10 +59,9 @@ shp_postread(int n, void *ptr)
|
||||||
if (opt_MOB_ACCESS)
|
if (opt_MOB_ACCESS)
|
||||||
shp_do_upd_mob(sp);
|
shp_do_upd_mob(sp);
|
||||||
player->owner = (player->god || sp->shp_own == player->cnum);
|
player->owner = (player->god || sp->shp_own == player->cnum);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
shp_prewrite(int n, void *ptr)
|
shp_prewrite(int n, void *ptr)
|
||||||
{
|
{
|
||||||
struct shpstr *sp = ptr;
|
struct shpstr *sp = ptr;
|
||||||
|
@ -100,8 +99,6 @@ shp_prewrite(int n, void *ptr)
|
||||||
item_prewrite(sp->shp_item);
|
item_prewrite(sp->shp_item);
|
||||||
getship(n, &ship);
|
getship(n, &ship);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue