diff --git a/include/file.h b/include/file.h index da7be336..6df41257 100644 --- a/include/file.h +++ b/include/file.h @@ -58,9 +58,9 @@ struct empfile { int fd; /* file descriptor, -1 if not open */ /* and flags bit EFF_RDONLY */ /* User callbacks */ - void (*init)(int, char *); /* called after entry creation, unless null */ - int (*postread)(int, char *); /* called after read, unless null */ - int (*prewrite)(int, char *); /* called before write, unless null */ + void (*init)(int, void *); /* called after entry creation, unless null */ + int (*postread)(int, void *); /* called after read, unless null */ + int (*prewrite)(int, void *); /* called before write, unless null */ }; /* diff --git a/include/prototypes.h b/include/prototypes.h index d6bfd3c3..31aec208 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -494,9 +494,9 @@ extern void bitinit2(struct nstr_sect *, u_char *, int); extern int getele(char *, char *); /* land.c */ extern s_char *prland(struct lndstr *); -extern int lnd_postread(int, s_char *); -extern int lnd_prewrite(int, s_char *); -extern void lnd_init(int, s_char *); +extern int lnd_postread(int, void *); +extern int lnd_prewrite(int, void *); +extern void lnd_init(int, void *); /* landgun.c */ extern double seagun(int, int); extern double landgun(int, int); @@ -553,9 +553,9 @@ extern void delete_old_news(void); extern void init_nreport(void); extern void nreport(natid, int, natid, int); /* nuke.c */ -extern int nuk_postread(int, s_char *); -extern int nuk_prewrite(int, s_char *); -extern void nuk_init(int, s_char *); +extern int nuk_postread(int, void *); +extern int nuk_prewrite(int, void *); +extern void nuk_init(int, void *); extern void nuk_add(coord, coord, int, int); extern void nuk_delete(struct nukstr *, int, int); /* nxtitem.c */ @@ -564,9 +564,9 @@ extern int nxtitem(struct nstr_item *, void *); extern int nxtsct(struct nstr_sect *, struct sctstr *); /* plane.c */ extern s_char *prplane(struct plnstr *); -extern int pln_postread(int, s_char *); -extern int pln_prewrite(int, s_char *); -extern void pln_init(int, s_char *); +extern int pln_postread(int, void *); +extern int pln_prewrite(int, void *); +extern void pln_init(int, void *); /* plnsub.c */ extern void count_planes(struct shpstr *); 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 sathead(void); /* sect.c */ -extern int sct_postread(int, s_char *); -extern int sct_prewrite(int, s_char *); +extern int sct_postread(int, void *); +extern int sct_prewrite(int, void *); extern void item_prewrite(short *); extern int issector(s_char *); /* ship.c */ extern s_char *prship(struct shpstr *); -extern int shp_postread(int, s_char *); -extern int shp_prewrite(int, s_char *); -extern void shp_init(int, s_char *); +extern int shp_postread(int, void *); +extern int shp_prewrite(int, void *); +extern void shp_init(int, void *); /* show.c */ extern void show_bridge(int); extern void show_tower(int); diff --git a/src/lib/common/file.c b/src/lib/common/file.c index 46ae9e30..3a660939 100644 --- a/src/lib/common/file.c +++ b/src/lib/common/file.c @@ -379,7 +379,7 @@ int ef_extend(int type, int count) { struct empfile *ep; - char *tmpobj; + void *tmpobj; int id, i, how; if (ef_check(type) < 0) diff --git a/src/lib/subs/fileinit.c b/src/lib/subs/fileinit.c index bf213f97..baa6ac9d 100644 --- a/src/lib/subs/fileinit.c +++ b/src/lib/subs/fileinit.c @@ -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[] = { diff --git a/src/lib/subs/land.c b/src/lib/subs/land.c index 5bbaeb88..34813b5d 100644 --- a/src/lib/subs/land.c +++ b/src/lib/subs/land.c @@ -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; diff --git a/src/lib/subs/nuke.c b/src/lib/subs/nuke.c index cf8c0a97..969e36fe 100644 --- a/src/lib/subs/nuke.c +++ b/src/lib/subs/nuke.c @@ -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; diff --git a/src/lib/subs/plane.c b/src/lib/subs/plane.c index e12b0f31..c57dae4d 100644 --- a/src/lib/subs/plane.c +++ b/src/lib/subs/plane.c @@ -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; diff --git a/src/lib/subs/sect.c b/src/lib/subs/sect.c index 16a56a0a..59934a45 100644 --- a/src/lib/subs/sect.c +++ b/src/lib/subs/sect.c @@ -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); diff --git a/src/lib/subs/ship.c b/src/lib/subs/ship.c index 29019dc3..602323dd 100644 --- a/src/lib/subs/ship.c +++ b/src/lib/subs/ship.c @@ -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;