XRogue: get rid of VOID as an alias for long.

Maybe some compilers in 1986 didn't handle void pointers well, but they
are no longer a concern.
This commit is contained in:
John "Elwin" Edwards 2016-03-07 20:44:01 -05:00
parent 090622896b
commit e9c84b2637
19 changed files with 57 additions and 62 deletions

View file

@ -341,7 +341,7 @@ at_hero: if (!save(VS_BREATH, &player,
rnd(20)+HUHDURATION);
else {
turn_on(player, ISHUH);
fuse(unconfuse, (VOID *)NULL,
fuse(unconfuse, NULL,
rnd(20)+HUHDURATION, AFTER);
msg("The confusion gas has confused you.");
}

View file

@ -693,7 +693,7 @@ quit(int sig)
* Reset the signal in case we got here via an interrupt
*/
if ((VOID(*)())signal(SIGINT, quit) != (VOID(*)())quit)
if (signal(SIGINT, quit) != quit)
mpos = 0;
getyx(cw, oy, ox);

View file

@ -91,7 +91,7 @@ find_slot(void (*func)())
*/
void
start_daemon(void (*dfunc)(), VOID *arg, int type)
start_daemon(void (*dfunc)(), void *arg, int type)
{
reg struct delayed_action *dev;
@ -164,7 +164,7 @@ do_daemons(int flag)
*/
void
fuse(void (*dfunc)(), VOID *arg, int time, int type)
fuse(void (*dfunc)(), void *arg, int time, int type)
{
reg struct delayed_action *wire;

View file

@ -114,7 +114,7 @@ doctor(struct thing *tp)
void
swander(void)
{
start_daemon(rollwand, (VOID *)NULL, BEFORE);
start_daemon(rollwand, NULL, BEFORE);
}
/*
@ -137,7 +137,7 @@ rollwand(void)
if (levtype != POSTLEV)
wanderer();
kill_daemon(rollwand);
fuse(swander, (VOID *)NULL, WANDERTIME, BEFORE);
fuse(swander, NULL, WANDERTIME, BEFORE);
}
between = 0;
}
@ -612,7 +612,7 @@ quill_charge(void)
return;
if (tobj->o_charges < QUILLCHARGES)
tobj->o_charges++;
fuse (quill_charge, (VOID *)NULL, player.t_ctype == C_MAGICIAN ? 4 : 8, AFTER);
fuse (quill_charge, NULL, player.t_ctype == C_MAGICIAN ? 4 : 8, AFTER);
}
/*
@ -719,7 +719,7 @@ spell_recovery(void)
time = SPELLTIME - max(17-pstats.s_intel, 0);
time = max(time, 5);
if (spell_power > 0) spell_power--;
fuse(spell_recovery, (VOID *)NULL, time, AFTER);
fuse(spell_recovery, NULL, time, AFTER);
}
/*
@ -734,7 +734,7 @@ prayer_recovery(void)
time = SPELLTIME - max(17-pstats.s_wisdom, 0);
time = max(time, 5);
if (pray_time > 0) pray_time--;
fuse(prayer_recovery, (VOID *)NULL, time, AFTER);
fuse(prayer_recovery, NULL, time, AFTER);
}
/*
@ -749,6 +749,6 @@ chant_recovery(void)
time = SPELLTIME - max(17-pstats.s_wisdom, 0);
time = max(time, 5);
if (chant_time > 0) chant_time--;
fuse(chant_recovery, (VOID *)NULL, time, AFTER);
fuse(chant_recovery, NULL, time, AFTER);
}

View file

@ -153,7 +153,7 @@ eat(void)
}
else {
turn_on(player, HASDISEASE);
fuse(cure_disease, (VOID *)NULL, roll(HEALTIME,SICKTIME),AFTER);
fuse(cure_disease, NULL, roll(HEALTIME,SICKTIME),AFTER);
msg("You become ill. ");
}
}

View file

@ -309,7 +309,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
if (on(player, HASSTINK)) lengthen(unstink, STINKTIME);
else {
turn_on(player, HASSTINK);
fuse(unstink, (VOID *)NULL, STINKTIME, AFTER);
fuse(unstink, NULL, STINKTIME, AFTER);
}
}
}
@ -324,7 +324,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
prname(attname, FALSE));
chg_str(-1);
if (lost_str++ == 0)
fuse(res_strength, (VOID *)NULL, CHILLTIME, AFTER);
fuse(res_strength, NULL, CHILLTIME, AFTER);
else lengthen(res_strength, CHILLTIME);
}
}
@ -359,7 +359,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
}
else {
turn_on(*def, HASDISEASE);
fuse(cure_disease, (VOID *)NULL, roll(HEALTIME,SICKTIME), AFTER);
fuse(cure_disease, NULL, roll(HEALTIME,SICKTIME), AFTER);
msg(terse ? "You have been diseased!"
: "You have contracted an annoying disease!");
}
@ -491,7 +491,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
turn_off(*att, CANDANCE);
turn_on(*def, ISDANCE);
msg("You begin to dance uncontrollably!");
fuse(undance, (VOID *)NULL, roll(2,4), AFTER);
fuse(undance, NULL, roll(2,4), AFTER);
}
/*
@ -504,7 +504,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
(find_slot(suffocate) == 0)) {
turn_on(*att, DIDSUFFOCATE);
msg("%s is beginning to suffocate you!", prname(attname, TRUE));
fuse(suffocate, (VOID *)NULL, roll(9,3), AFTER);
fuse(suffocate, NULL, roll(9,3), AFTER);
}
/*
@ -552,7 +552,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
msg("You are overcome by a foul odor!");
if (lost_str == 0) {
chg_str(odor_str);
fuse(res_strength, (VOID *)NULL, SMELLTIME, AFTER);
fuse(res_strength, NULL, SMELLTIME, AFTER);
lost_str -= odor_str;
}
else lengthen(res_strength, SMELLTIME);

View file

@ -169,7 +169,7 @@ wghtchk(void)
ch = mvwinch(stdscr, hero.y, hero.x);
if((ch != FLOOR && ch != PASSAGE)) {
extinguish(wghtchk);
fuse(wghtchk, (VOID *)NULL, 1, AFTER);
fuse(wghtchk, NULL, 1, AFTER);
inwhgt = FALSE;
return;
}

View file

@ -564,7 +564,7 @@ roll_em(struct thing *att_er, struct thing *def_er, struct object *weap,
if (find_slot(unconfuse))
lengthen(unconfuse, HUHDURATION);
else
fuse(unconfuse, (VOID *)NULL, HUHDURATION, AFTER);
fuse(unconfuse, NULL, HUHDURATION, AFTER);
turn_on(player, ISHUH);
}
else msg("You feel dizzy, but it quickly passes.");

View file

@ -244,19 +244,19 @@ main(int argc, char *argv[], char *envp[])
* Start up daemons and fuses
*/
start_daemon(doctor, &player, AFTER);
fuse(swander, (VOID *)NULL, WANDERTIME, AFTER);
fuse(swander, NULL, WANDERTIME, AFTER);
/* Give characters their innate abilities */
if (player.t_ctype == C_MAGICIAN || player.t_ctype == C_RANGER)
fuse(spell_recovery, (VOID *)NULL, SPELLTIME, AFTER);
fuse(spell_recovery, NULL, SPELLTIME, AFTER);
if (player.t_ctype == C_DRUID || player.t_ctype == C_MONK)
fuse(chant_recovery, (VOID *)NULL, SPELLTIME, AFTER);
fuse(chant_recovery, NULL, SPELLTIME, AFTER);
if (player.t_ctype == C_CLERIC || player.t_ctype == C_PALADIN)
fuse(prayer_recovery, (VOID *)NULL, SPELLTIME, AFTER);
start_daemon(stomach, (VOID *)NULL, AFTER);
fuse(prayer_recovery, NULL, SPELLTIME, AFTER);
start_daemon(stomach, NULL, AFTER);
if (player.t_ctype == C_THIEF ||
player.t_ctype == C_ASSASSIN ||
player.t_ctype == C_MONK)
start_daemon(trap_look, (VOID *)NULL, AFTER);
start_daemon(trap_look, NULL, AFTER);
/* Does this character have any special knowledge? */
switch (player.t_ctype) {

View file

@ -82,11 +82,11 @@ changeclass(long *newclass)
* if he becomes a spell caster of some kind, give him a fuse
*/
if (*newclass == C_MAGICIAN || *newclass == C_RANGER)
fuse(spell_recovery, (VOID *)NULL, SPELLTIME, AFTER);
fuse(spell_recovery, NULL, SPELLTIME, AFTER);
if (*newclass == C_DRUID || *newclass == C_MONK)
fuse(chant_recovery, (VOID *)NULL, SPELLTIME, AFTER);
fuse(chant_recovery, NULL, SPELLTIME, AFTER);
if ((*newclass==C_CLERIC || *newclass==C_PALADIN) && !cur_misc[HEIL_ANKH])
fuse(prayer_recovery, (VOID *)NULL, SPELLTIME, AFTER);
fuse(prayer_recovery, NULL, SPELLTIME, AFTER);
/*
* if he's changing from a fighter, ranger, or paladin then we
* may have to change his sword since only these types can wield
@ -132,7 +132,7 @@ changeclass(long *newclass)
*/
if (*newclass == C_THIEF || *newclass == C_ASSASSIN ||
*newclass == C_MONK)
start_daemon(trap_look, (VOID *)NULL, AFTER);
start_daemon(trap_look, NULL, AFTER);
/* adjust stats */
char_type = player.t_ctype = *newclass;
@ -1029,7 +1029,7 @@ use_mm(int which)
else msg("Ahh.. Ahh... Choo!! ");
if (!find_slot(dust_appear)) {
turn_on(player, ISINVIS);
fuse(dust_appear, (VOID *)NULL, DUSTTIME, AFTER);
fuse(dust_appear, NULL, DUSTTIME, AFTER);
PLAYER = IPLAYER;
light(&hero);
}
@ -1059,7 +1059,7 @@ use_mm(int which)
if (find_slot(unchoke))
lengthen(unchoke, DUSTTIME);
else
fuse(unchoke, (VOID *)NULL, DUSTTIME, AFTER);
fuse(unchoke, NULL, DUSTTIME, AFTER);
turn_on(player, ISHUH);
turn_on(player, ISBLIND);
light(&hero);

View file

@ -685,7 +685,7 @@ wake_monster(int y, int x)
if (find_slot(unconfuse))
lengthen(unconfuse, HUHDURATION);
else {
fuse(unconfuse, (VOID *)NULL, HUHDURATION, AFTER);
fuse(unconfuse, NULL, HUHDURATION, AFTER);
msg("%s's gaze has confused you.",prname(mname, TRUE));
turn_on(player, ISHUH);
}
@ -727,7 +727,7 @@ wake_monster(int y, int x)
if (!save(VS_WAND, &player, 0)) {
msg("The gaze of %s blinds you! ", prname(mname, FALSE));
turn_on(player, ISBLIND);
fuse(sight, (VOID *)NULL, rnd(30)+20, AFTER);
fuse(sight, NULL, rnd(30)+20, AFTER);
light(&hero);
}
}

View file

@ -259,7 +259,7 @@ picked_up:
case HEIL_ANKH:
msg("The ankh welds itself into your hand. ");
if (player.t_ctype != C_CLERIC && player.t_ctype != C_PALADIN)
fuse(prayer_recovery, (VOID *)NULL, SPELLTIME, AFTER);
fuse(prayer_recovery, NULL, SPELLTIME, AFTER);
/* start a fuse to change player into a paladin */
if (quest_item != HEIL_ANKH) {
msg("You hear a strange, distant hypnotic calling... ");
@ -336,7 +336,7 @@ picked_up:
}
when QUILL_NAGROM:
fuse(quill_charge,(VOID *)NULL, 8, AFTER);
fuse(quill_charge, NULL, 8, AFTER);
/* start a fuse to change player into a druid */
if (quest_item != QUILL_NAGROM) {
msg("You begin to see things differently... ");

View file

@ -172,7 +172,7 @@ add_haste(bool blessed)
else {
msg("You feel yourself moving %sfaster.", blessed ? "much " : "");
turn_on(player, ISHASTE);
fuse(nohaste, (VOID *)NULL, roll(hasttime, hasttime), AFTER);
fuse(nohaste, NULL, roll(hasttime, hasttime), AFTER);
}
}
@ -232,7 +232,7 @@ add_slow(void)
lengthen(noslow, roll(HASTETIME,HASTETIME));
else {
turn_on(player, ISSLOW);
fuse(noslow, (VOID *)NULL, roll(HASTETIME,HASTETIME), AFTER);
fuse(noslow, NULL, roll(HASTETIME,HASTETIME), AFTER);
}
}
}
@ -353,7 +353,7 @@ quaff(int which, int kind, int flags, bool is_potion)
}
else { /* Just light a fuse for how long player is safe */
if (off(player, ISCLEAR)) {
fuse(unclrhead, (VOID *)NULL, CLRDURATION, AFTER);
fuse(unclrhead, NULL, CLRDURATION, AFTER);
msg("A faint blue aura surrounds your head.");
}
else { /* If we have a fuse lengthen it, else we
@ -518,7 +518,7 @@ quaff(int which, int kind, int flags, bool is_potion)
{
msg("A cloak of darkness falls around you.");
turn_on(player, ISBLIND);
fuse(sight, (VOID *)NULL, SEEDURATION, AFTER);
fuse(sight, NULL, SEEDURATION, AFTER);
light(&hero);
}
else
@ -529,7 +529,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (off(player, CANSEE)) {
turn_on(player, CANSEE);
msg("Your eyes begin to tingle.");
fuse(unsee, (VOID *)NULL, blessed ? SEEDURATION*3 :SEEDURATION, AFTER);
fuse(unsee, NULL, blessed ? SEEDURATION*3 :SEEDURATION, AFTER);
light(&hero);
}
else if (find_slot(unsee) != 0) {
@ -553,7 +553,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (on(player, CANINWALL))
lengthen(unphase, duration*PHASEDURATION);
else {
fuse(unphase, (VOID *)NULL, duration*PHASEDURATION, AFTER);
fuse(unphase, NULL, duration*PHASEDURATION, AFTER);
turn_on(player, CANINWALL);
}
msg("You feel %slight-headed!",
@ -577,7 +577,7 @@ quaff(int which, int kind, int flags, bool is_potion)
}
}
else {
fuse(land, (VOID *)NULL, duration*FLYTIME, AFTER);
fuse(land, NULL, duration*FLYTIME, AFTER);
turn_on(player, ISFLY);
}
if (say_message) {
@ -641,7 +641,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (off(player, ISINVIS)) {
turn_on(player, ISINVIS);
msg("You have a tingling feeling all over your body");
fuse(appear, (VOID *)NULL, blessed ? GONETIME*3 : GONETIME, AFTER);
fuse(appear, NULL, blessed ? GONETIME*3 : GONETIME, AFTER);
PLAYER = IPLAYER;
light(&hero);
}
@ -703,7 +703,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (!find_slot(unskill)) { /* No skill */
pstats.s_lvladj = -2;
pstats.s_lvl += pstats.s_lvladj;
fuse(unskill, (VOID *)NULL, SKILLDURATION, AFTER);
fuse(unskill, NULL, SKILLDURATION, AFTER);
}
else { /* Has an artifical skill */
/* Is the skill beneficial? */
@ -759,7 +759,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (!find_slot(unskill)) {
pstats.s_lvladj = adjust;
pstats.s_lvl += pstats.s_lvladj;
fuse(unskill, (VOID *)NULL,
fuse(unskill, NULL,
blessed ? SKILLDURATION*2 : SKILLDURATION, AFTER);
}
else { /* Has an artifical skill */
@ -819,7 +819,7 @@ quaff(int which, int kind, int flags, bool is_potion)
say_message = FALSE;
}
else {
fuse(nofire, (VOID *)NULL, duration*FIRETIME, AFTER);
fuse(nofire, NULL, duration*FIRETIME, AFTER);
turn_on(player, NOFIRE);
}
if (say_message) {
@ -856,7 +856,7 @@ quaff(int which, int kind, int flags, bool is_potion)
say_message = FALSE;
}
else {
fuse(nocold, (VOID *)NULL, duration*COLDTIME, AFTER);
fuse(nocold, NULL, duration*COLDTIME, AFTER);
turn_on(player, NOCOLD);
}
if (say_message) {
@ -890,7 +890,7 @@ quaff(int which, int kind, int flags, bool is_potion)
say_message = FALSE;
}
else {
fuse(nobolt, (VOID *)NULL, duration*BOLTTIME, AFTER);
fuse(nobolt, NULL, duration*BOLTTIME, AFTER);
turn_on(player, NOBOLT);
}
if (say_message) {

View file

@ -100,9 +100,9 @@ ring_on(struct linked_list *item)
}
}
when R_SEARCH:
start_daemon(ring_search, (VOID *)NULL, AFTER);
start_daemon(ring_search, NULL, AFTER);
when R_TELEPORT:
start_daemon(ring_teleport, (VOID *)NULL, AFTER);
start_daemon(ring_teleport, NULL, AFTER);
}
status(FALSE);
if (r_know[obj->o_which] && r_guess[obj->o_which]) {

View file

@ -20,12 +20,8 @@
#include "config.h"
#endif
/*
* some compiler don't handle void pointers well so
*/
#include <assert.h>
#define reg register
#define VOID long
#undef lines
#define ENCREAD encread
#define ENCWRITE encwrite
@ -935,7 +931,7 @@ struct delayed_action {
int d_type;
void (*d_func)();
union {
VOID *vp;
void *vp;
int i;
} d_arg;
int d_time;
@ -1322,7 +1318,7 @@ int findmindex(char *name);
void fix_stick(struct object *cur);
void fright(struct thing *th);
void fumble(void);
void fuse(void (*dfunc)(), VOID *arg, int time, int type);
void fuse(void (*dfunc)(), void *arg, int time, int type);
void genmonsters(int least, bool treas);
coord get_coordinates(void);
bool get_dir(coord *direction);
@ -1452,7 +1448,7 @@ bool skirmish(struct thing *attacker, coord *mp, struct object *weap,
bool thrown);
struct linked_list *spec_item(int type, int which, int hit, int damage);
void spell_recovery(void);
void start_daemon(void (*dfunc)(), VOID *arg, int type);
void start_daemon(void (*dfunc)(), void *arg, int type);
void status(bool display);
void steal(void);
bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr);

View file

@ -57,7 +57,6 @@
#include <Lmcons.h>
#include <shlobj.h>
#include <Shlwapi.h>
#undef VOID
#undef MOUSE_MOVED
#elif defined(__DJGPP__)
#include <process.h>

View file

@ -613,7 +613,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
turn_on(player, HASDISEASE);
turn_on(player, HASINFEST);
turn_on(player, DOROT);
fuse(cure_disease, (VOID *)NULL, roll(HEALTIME,SICKTIME), AFTER);
fuse(cure_disease, NULL, roll(HEALTIME,SICKTIME), AFTER);
infest_dam++;
}
else if (sick == FALSE) msg("You feel momentarily sick");

View file

@ -203,7 +203,7 @@ confus_player(void)
if (find_slot(unconfuse))
lengthen(unconfuse, HUHDURATION);
else
fuse(unconfuse, (VOID *)NULL, HUHDURATION, AFTER);
fuse(unconfuse, NULL, HUHDURATION, AFTER);
turn_on(player, ISHUH);
}
else msg("You feel dizzy for a moment, but it quickly passes.");

View file

@ -328,7 +328,7 @@ wear(void)
msg("Wearing %s", inv_name(obj,TRUE));
cur_misc[WEAR_GAUNTLET] = obj;
if (obj->o_which == MM_FUMBLE)
start_daemon(fumble, (VOID *)NULL, AFTER);
start_daemon(fumble, NULL, AFTER);
/*
* the jewel of attacks does an aggavate monster
*/
@ -358,7 +358,7 @@ wear(void)
msg("Wearing %s",inv_name(obj,TRUE));
cur_misc[WEAR_NECKLACE] = obj;
msg("The necklace is beginning to strangle you!");
start_daemon(strangle, (VOID *)NULL, AFTER);
start_daemon(strangle, NULL, AFTER);
otherwise:
msg("What a strange item you have!");
}