From 0d5a2f2ee270c57b5c880ea40887d996f1cc7351 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 23 Dec 2021 04:36:52 +0100 Subject: [PATCH 1/7] Sickness countdown Give messages when sickness countdown has nearly expired to warn player that hero is dying and also so that death at the end doesn't seem so abrupt after an arbitrary period with just "TermIll" and/or "FoodPois" on the status line. Also, abuse constitution each turn when Sick (either variation, but not a double amount if both). Cherry picked from nethack/nethack@4eb0592959 --- src/timeout.c | 67 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 8 deletions(-) diff --git a/src/timeout.c b/src/timeout.c index 27fe3288f..9480cdd8f 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -10,6 +10,7 @@ STATIC_DCL void NDECL(vomiting_dialogue); STATIC_DCL void NDECL(choke_dialogue); STATIC_DCL void NDECL(slime_dialogue); STATIC_DCL void FDECL(slimed_to_death, (struct kinfo *)); +STATIC_DCL void NDECL(sickness_dialogue); STATIC_DCL void NDECL(phaze_dialogue); STATIC_DCL void FDECL(done_timeout, (int, int)); STATIC_DCL void NDECL(slip_or_trip); @@ -306,6 +307,38 @@ choke_dialogue() exercise(A_STR, FALSE); } +static const char *const sickness_texts[] = { + "Your illness feels worse.", + "Your illness is severe.", + "You are at Death's door.", +}; + +static void +sickness_dialogue(void) +{ + long j = (Sick & TIMEOUT), i = j / 2L; + + if (i > 0L && i <= SIZE(sickness_texts) && (j % 2) != 0) { + char buf[BUFSZ], pronounbuf[40]; + + Strcpy(buf, sickness_texts[SIZE(sickness_texts) - i]); + /* change the message slightly for food poisoning */ + if ((u.usick_type & SICK_NONVOMITABLE) == 0) { + (void) strsubst(buf, "illness", "sickness"); + } + if (Hallucination && strstri(buf, "Death's door")) { + /* youmonst: for Hallucination, mhe()'s mon argument isn't used */ + Strcpy(pronounbuf, mhe(&youmonst)); + Sprintf(eos(buf), " %s %s inviting you in.", + /* upstart() modifies its argument but vtense() doesn't + care whether or not that has already happened */ + upstart(pronounbuf), vtense(pronounbuf, "are")); + } + pline("%s", buf); + } + exercise(A_CON, FALSE); +} + static NEARDATA const char *const levi_texts[] = { "You float slightly lower.", "You wobble unsteadily %s the %s." @@ -524,19 +557,35 @@ nh_timeout() u.luckturn = moves; } } - if(Phasing) phasing_dialogue(); - if(u.uinvulnerable) return; /* things past this point could kill you */ - if(Stoned) stoned_dialogue(); - if(Slimed) slime_dialogue(); - if(Vomiting) vomiting_dialogue(); - if(Strangled) choke_dialogue(); + + if (Phasing) { + phasing_dialogue(); + } + if (u.uinvulnerable) { + return; /* things past this point could kill you */ + } + if (Stoned) { + stoned_dialogue(); + } + if (Slimed) { + slime_dialogue(); + } + if (Vomiting) { + vomiting_dialogue(); + } + if (Strangled) { + choke_dialogue(); + } + if (Sick) { + sickness_dialogue(); + } if (HLevitation & TIMEOUT) { levitation_dialogue(); } if (HPasses_walls & TIMEOUT) { phaze_dialogue(); } - if(u.mtimedone && !--u.mtimedone) { + if (u.mtimedone && !--u.mtimedone) { if (Unchanging) { u.mtimedone = rnd(100*youmonst.data->mlevel + 1); } else if (is_were(youmonst.data)) { @@ -545,7 +594,9 @@ nh_timeout() rehumanize(); } } - if(u.ucreamed) u.ucreamed--; + if (u.ucreamed) { + u.ucreamed--; + } /* Dissipate spell-based protection. */ if (u.usptime) { From 3fde38aa447fcb8f57cef5bc94e5f6a3548ec3f1 Mon Sep 17 00:00:00 2001 From: Patric Mueller Date: Tue, 2 Aug 2022 11:01:56 +0200 Subject: [PATCH 2/7] Remove NetHack code specific function declaration Replaces all STATIC_ defines with static. Removes all instances of NDECL and FDECL. Drops last remains of OVL and USE_TRAMPOLI. --- include/amiconf.h | 44 +- include/decl.h | 4 +- include/dlb.h | 20 +- include/extern.h | 4565 +++++++++++++++--------------- include/func_tab.h | 2 +- include/global.h | 10 +- include/hack.h | 35 - include/macwin.h | 72 +- include/mextra.h | 4 +- include/ntconf.h | 16 +- include/obj.h | 4 +- include/pcconf.h | 9 - include/region.h | 2 +- include/system.h | 286 +- include/timeout.h | 2 +- include/tosconf.h | 4 +- include/tradstdc.h | 16 +- include/trampoli.h | 332 --- include/vmsconf.h | 4 +- include/wceconf.h | 8 +- include/winX.h | 214 +- include/wingem.h | 138 +- include/winlisp.h | 84 +- include/winprocs.h | 92 +- include/wintty.h | 174 +- include/wintype.h | 2 +- src/allmain.c | 9 +- src/alloc.c | 8 +- src/apply.c | 116 +- src/artifact.c | 28 +- src/attrib.c | 9 +- src/ball.c | 14 +- src/bones.c | 16 +- src/botl.c | 16 +- src/cmd.c | 360 +-- src/dbridge.c | 53 +- src/decl.c | 4 +- src/detect.c | 30 +- src/dig.c | 12 +- src/display.c | 70 +- src/dlb.c | 53 +- src/do.c | 36 +- src/do_name.c | 20 +- src/do_wear.c | 71 +- src/dog.c | 4 +- src/dogmove.c | 37 +- src/dokick.c | 30 +- src/dothrow.c | 52 +- src/drawing.c | 8 +- src/dump.c | 2 +- src/dungeon.c | 94 +- src/eat.c | 114 +- src/end.c | 42 +- src/engrave.c | 2 +- src/exper.c | 4 +- src/extralev.c | 15 +- src/files.c | 42 +- src/fountain.c | 18 +- src/hack.c | 24 +- src/hacklib.c | 7 +- src/invent.c | 98 +- src/light.c | 8 +- src/lock.c | 16 +- src/mail.c | 22 +- src/makemon.c | 37 +- src/mcastu.c | 49 +- src/mhitm.c | 41 +- src/mhitu.c | 54 +- src/mklev.c | 89 +- src/mkmap.c | 46 +- src/mkmaze.c | 60 +- src/mkobj.c | 49 +- src/mkroom.c | 46 +- src/mon.c | 64 +- src/monmove.c | 18 +- src/monst.c | 2 +- src/mplayer.c | 8 +- src/mthrowu.c | 24 +- src/muse.c | 53 +- src/music.c | 40 +- src/o_init.c | 22 +- src/objects.c | 2 +- src/objnam.c | 42 +- src/options.c | 112 +- src/pager.c | 20 +- src/pickup.c | 105 +- src/pline.c | 6 +- src/polyself.c | 22 +- src/potion.c | 24 +- src/pray.c | 58 +- src/priest.c | 8 +- src/quest.c | 44 +- src/questpgr.c | 50 +- src/read.c | 30 +- src/rect.c | 4 +- src/region.c | 41 +- src/restore.c | 71 +- src/rip.c | 4 +- src/role.c | 16 +- src/rumors.c | 8 +- src/save.c | 52 +- src/shk.c | 151 +- src/shknam.c | 17 +- src/sit.c | 2 +- src/sounds.c | 8 +- src/sp_lev.c | 121 +- src/spell.c | 44 +- src/steal.c | 8 +- src/steed.c | 6 +- src/teleport.c | 20 +- src/timeout.c | 81 +- src/topten.c | 73 +- src/track.c | 4 +- src/trap.c | 104 +- src/u_init.c | 12 +- src/uhitm.c | 56 +- src/vault.c | 40 +- src/vision.c | 87 +- src/weapon.c | 44 +- src/wield.c | 6 +- src/windows.c | 13 +- src/wizard.c | 24 +- src/worm.c | 20 +- src/worn.c | 10 +- src/write.c | 4 +- src/zap.c | 54 +- sys/autoconf/Makefile.src | 4 +- sys/autoconf/Makefile.utl | 4 +- sys/share/dgn_lex.c | 68 +- sys/share/dgn_yacc.c | 24 +- sys/share/ioctl.c | 8 +- sys/share/lev_lex.c | 68 +- sys/share/lev_yacc.c | 66 +- sys/share/nhlan.c | 10 +- sys/share/pcmain.c | 45 +- sys/share/pcsys.c | 12 +- sys/share/pcunix.c | 22 +- sys/share/tclib.c | 22 +- sys/share/unixtty.c | 16 +- sys/unix/unixmain.c | 22 +- sys/unix/unixunix.c | 22 +- sys/unsupported/amiga/amidos.p | 44 +- sys/unsupported/amiga/amitty.c | 4 +- sys/unsupported/amiga/amiwind.c | 6 +- sys/unsupported/amiga/amiwind.p | 52 +- sys/unsupported/amiga/winami.c | 2 +- sys/unsupported/amiga/winami.p | 106 +- sys/unsupported/amiga/winproto.h | 8 +- sys/unsupported/atari/tos.c | 6 +- sys/unsupported/mac/macfile.c | 44 +- sys/unsupported/mac/macwin.c | 100 +- sys/unsupported/mac/mgetline.c | 4 +- sys/unsupported/os2/os2.c | 4 +- sys/unsupported/vms/vmsfiles.c | 14 +- sys/unsupported/vms/vmsmail.c | 24 +- sys/unsupported/vms/vmsmain.c | 14 +- sys/unsupported/vms/vmstty.c | 8 +- sys/unsupported/vms/vmsunix.c | 8 +- sys/unsupported/wince/winhack.c | 38 +- sys/unsupported/wince/winmain.c | 2 +- sys/winnt/nh340key.c | 12 +- sys/winnt/nhdefkey.c | 12 +- sys/winnt/nhraykey.c | 98 +- sys/winnt/nttty.c | 16 +- sys/winnt/winnt.c | 2 +- unnethack.doxygen | 6 +- util/dgn_comp.l | 26 +- util/dgn_comp.y | 24 +- util/dgn_main.c | 16 +- util/dlb_main.c | 22 +- util/lev_comp.l | 54 +- util/lev_comp.y | 88 +- util/lev_main.c | 78 +- util/makedefs.c | 100 +- util/panic.c | 2 +- util/recover.c | 16 +- win/X11/winX.c | 22 +- win/X11/winmap.c | 22 +- win/X11/winmenu.c | 40 +- win/X11/winmesg.c | 18 +- win/X11/winmisc.c | 16 +- win/X11/winstat.c | 22 +- win/X11/wintext.c | 4 +- win/share/gifread.c | 24 +- win/share/ppmwrite.c | 6 +- win/share/tile.h | 14 +- win/share/tile2bmp.c | 8 +- win/share/tilemap.c | 10 +- win/share/tiletext.c | 12 +- win/tty/getline.c | 21 +- win/tty/termcap.c | 97 +- win/tty/topl.c | 23 +- win/tty/wintty.c | 80 +- win/unsupported/Qt/tileedit.cpp | 2 +- win/unsupported/gem/tile2img.c | 4 +- win/unsupported/gem/wingem.c | 4 +- win/unsupported/gem/wingem1.c | 5 +- win/win32/mhmenu.c | 2 +- win/win32/winhack.c | 14 +- 199 files changed, 5760 insertions(+), 6320 deletions(-) delete mode 100644 include/trampoli.h diff --git a/include/amiconf.h b/include/amiconf.h index 193edc18a..ecd1997f4 100644 --- a/include/amiconf.h +++ b/include/amiconf.h @@ -69,33 +69,33 @@ typedef long off_t; /* ### amidos.c ### */ -extern void FDECL(nethack_exit, (int)); +extern void nethack_exit(int); /* ### amiwbench.c ### */ -extern void NDECL(ami_wbench_init); -extern void NDECL(ami_wbench_args); -extern int FDECL(ami_wbench_getsave, (int)); -extern void FDECL(ami_wbench_unlink, (char *)); -extern int FDECL(ami_wbench_iconsize, (char *)); -extern void FDECL(ami_wbench_iconwrite, (char *)); -extern int FDECL(ami_wbench_badopt, (const char *)); -extern void NDECL(ami_wbench_cleanup); -extern void FDECL(getlind, (const char *, char *, const char *)); +extern void ami_wbench_init(); +extern void ami_wbench_args(); +extern int ami_wbench_getsave(int); +extern void ami_wbench_unlink(char *); +extern int ami_wbench_iconsize(char *); +extern void ami_wbench_iconwrite(char *); +extern int ami_wbench_badopt(const char *); +extern void ami_wbench_cleanup(); +extern void getlind(const char *, char *, const char *); /* ### winreq.c ### */ extern void amii_setpens(int); -extern void FDECL(exit, (int)); -extern void NDECL(CleanUp); -extern void FDECL(Abort, (long)); -extern int NDECL(getpid); -extern char *FDECL(CopyFile, (const char *, const char *)); -extern int NDECL(kbhit); -extern int NDECL(WindowGetchar); -extern void FDECL(ami_argset, (int *, char *[])); -extern void FDECL(ami_mkargline, (int *, char **[])); +extern void exit(int); +extern void CleanUp(); +extern void Abort(long); +extern int getpid(); +extern char *CopyFile(const char *, const char *); +extern int kbhit(); +extern int WindowGetchar(); +extern void ami_argset(int *, char *[]); +extern void ami_mkargline(int *, char **[]); extern void ami_wininit_data(void); #define FromWBench 0 /* A hint for compiler ... */ @@ -119,8 +119,8 @@ extern char **ami_argv; #endif #ifdef AZTEC_C -extern FILE *FDECL(freopen, (const char *, const char *, FILE *)); -extern char *FDECL(gets, (char *)); +extern FILE *freopen(const char *, const char *, FILE *); +extern char *gets(char *); #endif #define msmsg printf @@ -178,7 +178,7 @@ extern int amibbs; /* BBS mode? */ #ifdef AMII_GRAPHICS extern int amii_numcolors; -void FDECL( amii_setpens, (int) ); +void amii_setpens(int) ; #endif /* for cmd.c: override version in micro.h */ diff --git a/include/decl.h b/include/decl.h index 75b1e2652..1ee6a6810 100644 --- a/include/decl.h +++ b/include/decl.h @@ -7,8 +7,8 @@ #define E extern -E int NDECL((*occupation)); -E int NDECL((*afternmv)); +E int (*occupation)(void); +E int (*afternmv)(void); E const char *hname; E int hackpid; diff --git a/include/dlb.h b/include/dlb.h index c90ff0ca1..9081b74e1 100644 --- a/include/dlb.h +++ b/include/dlb.h @@ -72,20 +72,20 @@ typedef struct dlb_handle { #define DLB_P dlb * #endif -boolean NDECL(dlb_init); -void NDECL(dlb_cleanup); +boolean dlb_init(); +void dlb_cleanup(); #ifndef FILE_AREAS -dlb *FDECL(dlb_fopen, (const char *, const char *)); +dlb *dlb_fopen(const char *, const char *); #else -dlb *FDECL(dlb_fopen_area, (const char *, const char *, const char *)); +dlb *dlb_fopen_area(const char *, const char *, const char *); #endif -int FDECL(dlb_fclose, (DLB_P)); -int FDECL(dlb_fread, (char *, int, int, DLB_P)); -int FDECL(dlb_fseek, (DLB_P, long, int)); -char *FDECL(dlb_fgets, (char *, int, DLB_P)); -int FDECL(dlb_fgetc, (DLB_P)); -long FDECL(dlb_ftell, (DLB_P)); +int dlb_fclose(DLB_P); +int dlb_fread(char *, int, int, DLB_P); +int dlb_fseek(DLB_P, long, int); +char *dlb_fgets(char *, int, DLB_P); +int dlb_fgetc(DLB_P); +long dlb_ftell(DLB_P); /* Resource DLB entry points */ diff --git a/include/extern.h b/include/extern.h index 5e5ccc121..188d369ab 100644 --- a/include/extern.h +++ b/include/extern.h @@ -9,9 +9,9 @@ /* ### alloc.c ### */ #if 0 -E long *FDECL(alloc, (unsigned int)); +E long *alloc(unsigned int); #endif -E char *FDECL(fmt_ptr, (const genericptr)); +E char *fmt_ptr(const genericptr); /* This next pre-processor directive covers almost the entire file, * interrupted only occasionally to pick up specific functions as needed. */ @@ -20,216 +20,214 @@ E char *FDECL(fmt_ptr, (const genericptr)); /* ### allmain.c ### */ extern void early_init(); -E void FDECL(moveloop, (BOOLEAN_P)); -E void NDECL(stop_occupation); -E void NDECL(display_gamewindows); -E void NDECL(newgame); -E void FDECL(welcome, (BOOLEAN_P)); -E boolean NDECL(can_regenerate); +E void moveloop(BOOLEAN_P); +E void stop_occupation(); +E void display_gamewindows(); +E void newgame(); +E void welcome(BOOLEAN_P); +E boolean can_regenerate(); #if defined(RECORD_REALTIME) || defined(REALTIME_ON_BOTL) -E time_t NDECL(get_realtime); +E time_t get_realtime(); #endif /* ### apply.c ### */ -E int NDECL(doapply); -E int NDECL(dorub); -E int NDECL(dojump); -E int FDECL(jump, (int)); -E int NDECL(number_leashed); -E void FDECL(o_unleash, (struct obj *)); -E void FDECL(m_unleash, (struct monst *, BOOLEAN_P)); -E void NDECL(unleash_all); -E boolean FDECL(leashable, (struct monst *)); -E boolean NDECL(next_to_u); -E struct obj *FDECL(get_mleash, (struct monst *)); -E void FDECL(check_leash, (XCHAR_P, XCHAR_P)); -E boolean FDECL(um_dist, (XCHAR_P, XCHAR_P, XCHAR_P)); -E boolean FDECL(snuff_candle, (struct obj *)); -E boolean FDECL(snuff_lit, (struct obj *)); -E boolean FDECL(catch_lit, (struct obj *)); -E void FDECL(fix_attributes_and_properties, (struct obj *, int)); -E boolean FDECL(tinnable, (struct obj *)); -E void NDECL(reset_trapset); -E void FDECL(fig_transform, (ANY_P *, long)); -E int FDECL(unfixable_trouble_count, (BOOLEAN_P)); +E int doapply(); +E int dorub(); +E int dojump(); +E int jump(int); +E int number_leashed(); +E void o_unleash(struct obj *); +E void m_unleash(struct monst *, BOOLEAN_P); +E void unleash_all(); +E boolean leashable(struct monst *); +E boolean next_to_u(); +E struct obj *get_mleash(struct monst *); +E void check_leash(XCHAR_P, XCHAR_P); +E boolean um_dist(XCHAR_P, XCHAR_P, XCHAR_P); +E boolean snuff_candle(struct obj *); +E boolean snuff_lit(struct obj *); +E boolean catch_lit(struct obj *); +E void fix_attributes_and_properties(struct obj *, int); +E boolean tinnable(struct obj *); +E void reset_trapset(); +E void fig_transform(ANY_P *, long); +E int unfixable_trouble_count(BOOLEAN_P); /* ### artifact.c ### */ -E void NDECL(init_artifacts); -E void FDECL(save_artifacts, (int)); -E void FDECL(restore_artifacts, (int)); -E const char *FDECL(artiname, (int)); -E struct obj *FDECL(mk_artifact, (struct obj *, ALIGNTYP_P)); -E const char *FDECL(artifact_name, (const char *, short *)); -E boolean FDECL(exist_artifact, (int, const char *)); -E void FDECL(artifact_exists, (struct obj *, const char *, BOOLEAN_P)); -E int NDECL(nartifact_exist); -E boolean FDECL(spec_ability, (struct obj *, unsigned long)); -E boolean FDECL(confers_luck, (struct obj *)); -E boolean FDECL(arti_reflects, (struct obj *)); -E boolean FDECL(shade_glare, (struct obj *)); -E boolean FDECL(restrict_name, (struct obj *, const char *, BOOLEAN_P)); -E boolean FDECL(defends, (int, struct obj *)); -E boolean FDECL(defends_when_carried, (int, struct obj *)); -E boolean FDECL(protects, (struct obj *, BOOLEAN_P)); -E void FDECL(set_artifact_intrinsic, (struct obj *, BOOLEAN_P, long)); -E int FDECL(touch_artifact, (struct obj *, struct monst *)); -E int FDECL(spec_abon, (struct obj *, struct monst *)); -E int FDECL(spec_dbon, (struct obj *, struct monst *, int)); -E void FDECL(discover_artifact, (XCHAR_P)); -E boolean FDECL(undiscovered_artifact, (XCHAR_P)); -E int FDECL(disp_artifact_discoveries, (winid)); -E boolean FDECL(artifact_hit, (struct monst *, struct monst *, - struct obj *, int *, int)); -E int NDECL(doinvoke); -E void FDECL(arti_speak, (struct obj *)); -E boolean FDECL(artifact_light, (struct obj *)); -E long FDECL(spec_m2, (struct obj *)); -E boolean FDECL(artifact_has_invprop, (struct obj *, UCHAR_P)); -E long FDECL(arti_cost, (struct obj *)); -E boolean FDECL(MATCH_WARN_OF_MON, (struct monst *)); -E struct obj *FDECL(what_gives, (long *)); -E const char *FDECL(get_warned_of_monster, (struct obj *)); -E const char *FDECL(glow_color, (int)); -E const char *FDECL(glow_verb, (int, BOOLEAN_P)); -E void FDECL(Sting_effects, (int)); -E int FDECL(retouch_object, (struct obj **, BOOLEAN_P)); -E void FDECL(retouch_equipment, (int)); -E void NDECL(mkot_trap_warn); -E boolean FDECL(is_magic_key, (struct monst *, struct obj *)); -E struct obj *FDECL(has_magic_key, (struct monst *)); +E void init_artifacts(); +E void save_artifacts(int); +E void restore_artifacts(int); +E const char *artiname(int); +E struct obj *mk_artifact(struct obj *, ALIGNTYP_P); +E const char *artifact_name(const char *, short *); +E boolean exist_artifact(int, const char *); +E void artifact_exists(struct obj *, const char *, BOOLEAN_P); +E int nartifact_exist(); +E boolean spec_ability(struct obj *, unsigned long); +E boolean confers_luck(struct obj *); +E boolean arti_reflects(struct obj *); +E boolean shade_glare(struct obj *); +E boolean restrict_name(struct obj *, const char *, BOOLEAN_P); +E boolean defends(int, struct obj *); +E boolean defends_when_carried(int, struct obj *); +E boolean protects(struct obj *, BOOLEAN_P); +E void set_artifact_intrinsic(struct obj *, BOOLEAN_P, long); +E int touch_artifact(struct obj *, struct monst *); +E int spec_abon(struct obj *, struct monst *); +E int spec_dbon(struct obj *, struct monst *, int); +E void discover_artifact(XCHAR_P); +E boolean undiscovered_artifact(XCHAR_P); +E int disp_artifact_discoveries(winid); +E boolean artifact_hit(struct monst *, struct monst *, struct obj *, int *, int); +E int doinvoke(); +E void arti_speak(struct obj *); +E boolean artifact_light(struct obj *); +E long spec_m2(struct obj *); +E boolean artifact_has_invprop(struct obj *, UCHAR_P); +E long arti_cost(struct obj *); +E boolean MATCH_WARN_OF_MON(struct monst *); +E struct obj *what_gives(long *); +E const char *get_warned_of_monster(struct obj *); +E const char *glow_color(int); +E const char *glow_verb(int, BOOLEAN_P); +E void Sting_effects(int); +E int retouch_object(struct obj **, BOOLEAN_P); +E void retouch_equipment(int); +E void mkot_trap_warn(); +E boolean is_magic_key(struct monst *, struct obj *); +E struct obj *has_magic_key(struct monst *); /* ### attrib.c ### */ -E boolean FDECL(adjattrib, (int, int, int)); -E void FDECL(change_luck, (SCHAR_P)); -E int FDECL(stone_luck, (BOOLEAN_P)); -E boolean NDECL(has_luckitem); -E void NDECL(set_moreluck); -E void FDECL(gainstr, (struct obj *, int)); -E void FDECL(losestr, (int)); -E void NDECL(restore_attrib); -E void FDECL(exercise, (int, BOOLEAN_P)); -E void NDECL(exerchk); -E void NDECL(reset_attribute_clock); -E void FDECL(init_attr, (int)); -E void NDECL(redist_attr); -E void FDECL(adjabil, (int, int)); -E int NDECL(newhp); -E schar FDECL(acurr, (int)); -E schar NDECL(acurrstr); -E void FDECL(adjalign, (int)); -E const char * NDECL(beautiful); -E int NDECL(uhp); -E int NDECL(uhpmax); -E boolean FDECL(extremeattr, (int)); -E void FDECL(uchangealign, (int, int)); +E boolean adjattrib(int, int, int); +E void change_luck(SCHAR_P); +E int stone_luck(BOOLEAN_P); +E boolean has_luckitem(); +E void set_moreluck(); +E void gainstr(struct obj *, int); +E void losestr(int); +E void restore_attrib(); +E void exercise(int, BOOLEAN_P); +E void exerchk(); +E void reset_attribute_clock(); +E void init_attr(int); +E void redist_attr(); +E void adjabil(int, int); +E int newhp(); +E schar acurr(int); +E schar acurrstr(); +E void adjalign(int); +E const char * beautiful(); +E int uhp(); +E int uhpmax(); +E boolean extremeattr(int); +E void uchangealign(int, int); /* ### ball.c ### */ -E void FDECL(ballrelease, (BOOLEAN_P)); -E void NDECL(ballfall); -E void NDECL(placebc); -E void NDECL(unplacebc); -E void FDECL(set_bc, (int)); -E void FDECL(move_bc, (int, int, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); -E boolean FDECL(drag_ball, (XCHAR_P, XCHAR_P, - int *, xchar *, xchar *, xchar *, xchar *, boolean *, BOOLEAN_P)); -E void FDECL(drop_ball, (XCHAR_P, XCHAR_P)); -E void NDECL(drag_down); -E void NDECL(bc_sanity_check); +E void ballrelease(BOOLEAN_P); +E void ballfall(); +E void placebc(); +E void unplacebc(); +E void set_bc(int); +E void move_bc(int, int, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); +E boolean drag_ball(XCHAR_P, XCHAR_P, int *, xchar *, xchar *, xchar *, xchar *, boolean *, BOOLEAN_P); +E void drop_ball(XCHAR_P, XCHAR_P); +E void drag_down(); +E void bc_sanity_check(); /* ### bones.c ### */ -E void FDECL(sanitize_name, (char *)); -E void FDECL(drop_upon_death, (struct monst *, struct obj *, int, int)); -E boolean NDECL(can_make_bones); -E void FDECL(savebones, (struct obj *)); -E int NDECL(getbones); +E void sanitize_name(char *); +E void drop_upon_death(struct monst *, struct obj *, int, int); +E boolean can_make_bones(); +E void savebones(struct obj *); +E int getbones(); /* ### botl.c ### */ -E int FDECL(xlev_to_rank, (int)); -E int FDECL(title_to_mon, (const char *, int *, int *)); -E void NDECL(max_rank_sz); +E int xlev_to_rank(int); +E int title_to_mon(const char *, int *, int *); +E void max_rank_sz(); #ifdef SCORE_ON_BOTL -E long NDECL(botl_score); +E long botl_score(); #endif -E int FDECL(describe_level, (char *)); -E const char *NDECL(rank); -E const char *FDECL(rank_of, (int, SHORT_P, BOOLEAN_P)); +E int describe_level(char *); +E const char *rank(); +E const char *rank_of(int, SHORT_P, BOOLEAN_P); extern const char* botl_realtime(); -E void NDECL(bot); +E void bot(); #ifdef DUMP_LOG -E void FDECL(bot1str, (char *)); -E void FDECL(bot2str, (char *)); -E void FDECL(bot3str, (char *)); +E void bot1str(char *); +E void bot2str(char *); +E void bot3str(char *); #endif /* ### cmd.c ### */ -E char NDECL(randomkey); +E char randomkey(); extern boolean redraw_cmd(char); -E char FDECL(cmd_from_func, (int NDECL((*)))); +extern char cmd_from_func(int(*)(void)); #ifdef USE_TRAMPOLI -E int NDECL(doextcmd); -E int NDECL(domonability); -E int NDECL(doprev_message); -E int NDECL(timed_occupation); -E int NDECL(wiz_attributes); -E int NDECL(enter_explore_mode); +E int doextcmd(); +E int domonability(); +E int doprev_message(); +E int timed_occupation(); +E int wiz_attributes(); +E int enter_explore_mode(); # ifdef WIZARD -E int NDECL(wiz_detect); -E int NDECL(wiz_genesis); -E int NDECL(wiz_identify); -E int NDECL(wiz_level_tele); -E int NDECL(wiz_map); -E int NDECL(wiz_where); -E int NDECL(wiz_wish); +E int wiz_detect(); +E int wiz_genesis(); +E int wiz_identify(); +E int wiz_level_tele(); +E int wiz_map(); +E int wiz_where(); +E int wiz_wish(); # endif /* WIZARD */ #endif /* USE_TRAMPOLI */ -E void NDECL(reset_occupations); -E void FDECL(set_occupation, (int (*)(void), const char *, int)); +E void reset_occupations(); +E void set_occupation(int (*)(void), const char *, int); #ifdef REDO -E char NDECL(pgetchar); -E void FDECL(pushch, (CHAR_P)); -E void FDECL(savech, (CHAR_P)); +E char pgetchar(); +E void pushch(CHAR_P); +E void savech(CHAR_P); #endif #ifdef WIZARD -E void NDECL(add_debug_extended_commands); +E void add_debug_extended_commands(); #endif /* WIZARD */ extern boolean bind_specialkey(UCHAR_P, const char *); extern char txt2key(char *); -E void FDECL(parseautocomplete, (char *, BOOLEAN_P)); -E void FDECL(reset_commands, (BOOLEAN_P)); -E void FDECL(rhack, (char *)); -E int NDECL(doextlist); -E int NDECL(extcmd_via_menu); +E void parseautocomplete(char *, BOOLEAN_P); +E void reset_commands(BOOLEAN_P); +E void rhack(char *); +E int doextlist(); +E int extcmd_via_menu(); extern boolean bind_key(UCHAR_P, const char *); -E void FDECL(enlightenment, (int, BOOLEAN_P)); -E void FDECL(show_conduct, (int, BOOLEAN_P)); -E int FDECL(xytod, (SCHAR_P, SCHAR_P)); -E void FDECL(dtoxy, (coord *, int)); -E int FDECL(movecmd, (CHAR_P)); -E int NDECL(dxdy_moveok); -E int FDECL(getdir, (const char *)); -E void NDECL(confdir); -E const char *FDECL(directionname, (int)); -E int FDECL(isok, (int, int)); -E int FDECL(get_adjacent_loc, (const char *, const char *, XCHAR_P, XCHAR_P, coord *)); -E const char *FDECL(click_to_cmd, (int, int, int)); -E char NDECL(readchar); +E void enlightenment(int, BOOLEAN_P); +E void show_conduct(int, BOOLEAN_P); +E int xytod(SCHAR_P, SCHAR_P); +E void dtoxy(coord *, int); +E int movecmd(CHAR_P); +E int dxdy_moveok(); +E int getdir(const char *); +E void confdir(); +E const char *directionname(int); +E int isok(int, int); +E int get_adjacent_loc(const char *, const char *, XCHAR_P, XCHAR_P, coord *); +E const char *click_to_cmd(int, int, int); +E char readchar(); E int do_stair_travel(char); #ifdef WIZARD -E void NDECL(sanity_check); -#endif -E char* FDECL(key2txt, (UCHAR_P, char *)); -E char FDECL(yn_function, (const char *, const char *, CHAR_P)); -E char FDECL(paranoid_yn, (const char *, BOOLEAN_P)); -E void NDECL(sokoban_trickster); -E void FDECL(list_vanquished, (int, BOOLEAN_P)); -E void NDECL(list_vanquishedonly); +E void sanity_check(); +#endif +E char* key2txt(UCHAR_P, char *); +E char yn_function(const char *, const char *, CHAR_P); +E char paranoid_yn(const char *, BOOLEAN_P); +E void sokoban_trickster(); +E void list_vanquished(int, BOOLEAN_P); +E void list_vanquishedonly(); #ifdef TTY_GRAPHICS E int tty_debug_show_colors(); #endif @@ -239,786 +237,782 @@ E int curses_debug_show_colors(); /* ### dbridge.c ### */ -E boolean FDECL(is_pool, (int, int)); -E boolean FDECL(is_lava, (int, int)); -E boolean FDECL(is_pool_or_lava, (int, int)); -E boolean FDECL(is_ice, (int, int)); -E boolean FDECL(is_moat, (int, int)); -E boolean FDECL(is_swamp, (int, int)); -E boolean FDECL(is_icewall, (int, int)); -E boolean FDECL(is_any_icewall, (int, int)); -E schar FDECL(db_under_typ, (struct rm *lev)); -E int FDECL(is_drawbridge_wall, (int, int)); -E boolean FDECL(is_db_wall, (int, int)); -E boolean FDECL(find_drawbridge, (int *, int*)); -E boolean FDECL(create_drawbridge, (int, int, int, int)); -E void FDECL(open_drawbridge, (int, int)); -E boolean FDECL(close_drawbridge, (int, int)); -E void FDECL(destroy_drawbridge, (int, int)); +E boolean is_pool(int, int); +E boolean is_lava(int, int); +E boolean is_pool_or_lava(int, int); +E boolean is_ice(int, int); +E boolean is_moat(int, int); +E boolean is_swamp(int, int); +E boolean is_icewall(int, int); +E boolean is_any_icewall(int, int); +E schar db_under_typ(struct rm *lev); +E int is_drawbridge_wall(int, int); +E boolean is_db_wall(int, int); +E boolean find_drawbridge(int *, int*); +E boolean create_drawbridge(int, int, int, int); +E void open_drawbridge(int, int); +E boolean close_drawbridge(int, int); +E void destroy_drawbridge(int, int); /* ### decl.c ### */ -E void NDECL(decl_init); +E void decl_init(); /* ### detect.c ### */ -E boolean FDECL(trapped_chest_at, (int, int, int)); -E boolean FDECL(trapped_door_at, (int, int, int)); -E struct obj *FDECL(o_in, (struct obj*, CHAR_P)); -E struct obj *FDECL(o_material, (struct obj*, unsigned)); -E int FDECL(gold_detect, (struct obj *)); -E int FDECL(food_detect, (struct obj *)); -E int FDECL(object_detect, (struct obj *, int, BOOLEAN_P)); -E int FDECL(monster_detect, (struct obj *, int)); -E int FDECL(trap_detect, (struct obj *)); -E const char *FDECL(level_distance, (d_level *)); -E void FDECL(use_crystal_ball, (struct obj **)); -E void NDECL(do_mapping); -E void NDECL(do_vicinity_map); -E void FDECL(cvt_sdoor_to_door, (struct rm *)); +E boolean trapped_chest_at(int, int, int); +E boolean trapped_door_at(int, int, int); +E struct obj *o_in(struct obj*, CHAR_P); +E struct obj *o_material(struct obj*, unsigned); +E int gold_detect(struct obj *); +E int food_detect(struct obj *); +E int object_detect(struct obj *, int, BOOLEAN_P); +E int monster_detect(struct obj *, int); +E int trap_detect(struct obj *); +E const char *level_distance(d_level *); +E void use_crystal_ball(struct obj **); +E void do_mapping(); +E void do_vicinity_map(); +E void cvt_sdoor_to_door(struct rm *); #ifdef USE_TRAMPOLI -E void FDECL(findone, (int, int, genericptr_t)); -E void FDECL(openone, (int, int, genericptr_t)); -#endif -E int NDECL(findit); -E int NDECL(openit); -E boolean FDECL(detecting, (void (*)(int, int, void *))); -E void FDECL(find_trap, (struct trap *)); -E int FDECL(dosearch0, (int)); -E int NDECL(dosearch); -E void NDECL(sokoban_detect); +E void findone(int, int, genericptr_t); +E void openone(int, int, genericptr_t); +#endif +E int findit(); +E int openit(); +E boolean detecting(void (*)(int, int, void *)); +E void find_trap(struct trap *); +E int dosearch0(int); +E int dosearch(); +E void sokoban_detect(); extern void reveal_terrain(int, int); /* ### dig.c ### */ -E int FDECL(dig_typ, (struct obj *, XCHAR_P, XCHAR_P)); -E boolean NDECL(is_digging); +E int dig_typ(struct obj *, XCHAR_P, XCHAR_P); +E boolean is_digging(); #ifdef USE_TRAMPOLI -E int NDECL(dig); -#endif -E int NDECL(holetime); -E boolean FDECL(dig_check, (struct monst *, BOOLEAN_P, int, int)); -E void FDECL(digactualhole, (int, int, struct monst *, int)); -E boolean FDECL(dighole, (BOOLEAN_P, BOOLEAN_P, coord *)); -E int FDECL(use_pick_axe, (struct obj *)); -E int FDECL(use_pick_axe2, (struct obj *)); -E boolean FDECL(mdig_tunnel, (struct monst *)); -E void FDECL(draft_message, (BOOLEAN_P)); -E void FDECL(watch_dig, (struct monst *, XCHAR_P, XCHAR_P, BOOLEAN_P)); -E void NDECL(zap_dig); -E struct obj *FDECL(bury_an_obj, (struct obj *, boolean *)); -E void FDECL(bury_objs, (int, int)); -E void FDECL(unearth_objs, (int, int)); -E void FDECL(rot_organic, (ANY_P *, long)); -E void FDECL(rot_corpse, (ANY_P *, long)); -E struct obj *FDECL(buried_ball, (coord *)); -E void NDECL(buried_ball_to_punishment); -E void NDECL(buried_ball_to_freedom); -E schar FDECL(fillholetyp, (int, int, BOOLEAN_P)); -E void FDECL(liquid_flow, - (XCHAR_P, XCHAR_P, SCHAR_P, struct trap *, const char *)); -E boolean FDECL(conjoined_pits, (struct trap *, struct trap *, BOOLEAN_P)); +E int dig(); +#endif +E int holetime(); +E boolean dig_check(struct monst *, BOOLEAN_P, int, int); +E void digactualhole(int, int, struct monst *, int); +E boolean dighole(BOOLEAN_P, BOOLEAN_P, coord *); +E int use_pick_axe(struct obj *); +E int use_pick_axe2(struct obj *); +E boolean mdig_tunnel(struct monst *); +E void draft_message(BOOLEAN_P); +E void watch_dig(struct monst *, XCHAR_P, XCHAR_P, BOOLEAN_P); +E void zap_dig(); +E struct obj *bury_an_obj(struct obj *, boolean *); +E void bury_objs(int, int); +E void unearth_objs(int, int); +E void rot_organic(ANY_P *, long); +E void rot_corpse(ANY_P *, long); +E struct obj *buried_ball(coord *); +E void buried_ball_to_punishment(); +E void buried_ball_to_freedom(); +E schar fillholetyp(int, int, BOOLEAN_P); +E void liquid_flow(XCHAR_P, XCHAR_P, SCHAR_P, struct trap *, const char *); +E boolean conjoined_pits(struct trap *, struct trap *, BOOLEAN_P); #if 0 -E void FDECL(bury_monst, (struct monst *)); -E void NDECL(bury_you); -E void NDECL(unearth_you); -E void NDECL(escape_tomb); -E void FDECL(bury_obj, (struct obj *)); +E void bury_monst(struct monst *); +E void bury_you(); +E void unearth_you(); +E void escape_tomb(); +E void bury_obj(struct obj *); #endif /* ### display.c ### */ #ifdef INVISIBLE_OBJECTS -E struct obj * FDECL(vobj_at, (XCHAR_P, XCHAR_P)); +E struct obj * vobj_at(XCHAR_P, XCHAR_P); #endif /* INVISIBLE_OBJECTS */ extern int is_safemon(struct monst *); -E void FDECL(magic_map_background, (XCHAR_P, XCHAR_P, int)); -E void FDECL(map_background, (XCHAR_P, XCHAR_P, int)); -E void FDECL(map_trap, (struct trap *, int)); -E void FDECL(map_object, (struct obj *, int)); -E void FDECL(map_invisible, (XCHAR_P, XCHAR_P)); -E boolean FDECL(unmap_invisible, (int, int)); -E void FDECL(unmap_object, (int, int)); +E void magic_map_background(XCHAR_P, XCHAR_P, int); +E void map_background(XCHAR_P, XCHAR_P, int); +E void map_trap(struct trap *, int); +E void map_object(struct obj *, int); +E void map_invisible(XCHAR_P, XCHAR_P); +E boolean unmap_invisible(int, int); +E void unmap_object(int, int); extern struct obj *vobj_at(int, int); -E void FDECL(map_location, (int, int, int)); -E void FDECL(feel_newsym, (XCHAR_P, XCHAR_P)); -E void FDECL(feel_location, (XCHAR_P, XCHAR_P)); -E void FDECL(newsym, (int, int)); -E void FDECL(newsym_force, (int, int)); -E void FDECL(shieldeff, (XCHAR_P, XCHAR_P)); -E void FDECL(tmp_at, (int, int)); +E void map_location(int, int, int); +E void feel_newsym(XCHAR_P, XCHAR_P); +E void feel_location(XCHAR_P, XCHAR_P); +E void newsym(int, int); +E void newsym_force(int, int); +E void shieldeff(XCHAR_P, XCHAR_P); +E void tmp_at(int, int); extern void flash_glyph_at(int, int, int, int); -E void FDECL(swallowed, (int)); -E void FDECL(under_ground, (int)); -E void FDECL(under_water, (int)); -E void NDECL(see_monsters); -E void NDECL(set_mimic_blocking); -E void NDECL(see_objects); -E void NDECL(see_traps); -E void NDECL(curs_on_u); -E int NDECL(doredraw); -E void NDECL(docrt); -E void FDECL(show_glyph, (int, int, int)); -E void NDECL(clear_glyph_buffer); -E void FDECL(row_refresh, (int, int, int)); -E void NDECL(cls); -E void FDECL(flush_screen, (int)); +E void swallowed(int); +E void under_ground(int); +E void under_water(int); +E void see_monsters(); +E void set_mimic_blocking(); +E void see_objects(); +E void see_traps(); +E void curs_on_u(); +E int doredraw(); +E void docrt(); +E void show_glyph(int, int, int); +E void clear_glyph_buffer(); +E void row_refresh(int, int, int); +E void cls(); +E void flush_screen(int); #ifdef DUMP_LOG -E void NDECL(dump_screen); +E void dump_screen(); #endif -E int FDECL(back_to_glyph, (XCHAR_P, XCHAR_P)); -E int FDECL(zapdir_to_glyph, (int, int, int)); -E int FDECL(glyph_at, (XCHAR_P, XCHAR_P)); -E void NDECL(set_wall_state); -E void FDECL(unset_seenv, (struct rm *, int, int, int, int)); -E int FDECL(warning_of, (struct monst *)); +E int back_to_glyph(XCHAR_P, XCHAR_P); +E int zapdir_to_glyph(int, int, int); +E int glyph_at(XCHAR_P, XCHAR_P); +E void set_wall_state(); +E void unset_seenv(struct rm *, int, int, int, int); +E int warning_of(struct monst *); /* ### do.c ### */ #ifdef USE_TRAMPOLI -E int FDECL(drop, (struct obj *)); -E int NDECL(wipeoff); -#endif -E int NDECL(dodrop); -E boolean FDECL(boulder_hits_pool, (struct obj *, int, int, BOOLEAN_P)); -E boolean FDECL(flooreffects, (struct obj *, int, int, const char *)); -E void FDECL(doaltarobj, (struct obj *)); -E boolean FDECL(canletgo, (struct obj *, const char *)); -E void FDECL(dropx, (struct obj *)); -E void FDECL(dropy, (struct obj *)); -E void FDECL(dropz, (struct obj *, BOOLEAN_P)); -E void FDECL(obj_no_longer_held, (struct obj *)); -E int NDECL(doddrop); -E int NDECL(dodown); -E int NDECL(doup); +E int drop(struct obj *); +E int wipeoff(); +#endif +E int dodrop(); +E boolean boulder_hits_pool(struct obj *, int, int, BOOLEAN_P); +E boolean flooreffects(struct obj *, int, int, const char *); +E void doaltarobj(struct obj *); +E boolean canletgo(struct obj *, const char *); +E void dropx(struct obj *); +E void dropy(struct obj *); +E void dropz(struct obj *, BOOLEAN_P); +E void obj_no_longer_held(struct obj *); +E int doddrop(); +E int dodown(); +E int doup(); #ifdef INSURANCE -E void NDECL(save_currentstate); -#endif -E void FDECL(goto_level, (d_level *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(schedule_goto, (d_level *, BOOLEAN_P, BOOLEAN_P, int, - const char *, const char *)); -E void NDECL(deferred_goto); -E boolean FDECL(revive_corpse, (struct obj *)); -E void FDECL(revive_mon, (ANY_P *, long)); +E void save_currentstate(); +#endif +E void goto_level(d_level *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +E void schedule_goto(d_level *, BOOLEAN_P, BOOLEAN_P, int, const char *, const char *); +E void deferred_goto(); +E boolean revive_corpse(struct obj *); +E void revive_mon(ANY_P *, long); extern void zombify_mon(union any *, long); -E int NDECL(donull); -E int NDECL(dowipe); -E void FDECL(set_wounded_legs, (long, int)); -E void FDECL(heal_legs, (int)); +E int donull(); +E int dowipe(); +E void set_wounded_legs(long, int); +E void heal_legs(int); /* ### do_name.c ### */ -E void FDECL(do_oname, (struct obj *)); -E char *FDECL(coord_desc, (int, int, char *, CHAR_P)); -E boolean FDECL(getpos_menu, (coord *, int)); +E void do_oname(struct obj *); +E char *coord_desc(int, int, char *, CHAR_P); +E boolean getpos_menu(coord *, int); extern int getpos(coord *, boolean, const char *); -E void FDECL(getpos_sethilite, (void (*f)(int), boolean (*d)(int,int))); +E void getpos_sethilite(void (*f)(int), boolean (*d)(int,int)); extern void new_mgivenname(struct monst *, int); extern void free_mgivenname(struct monst *); -E void FDECL(new_oname, (struct obj *, int)); -E void FDECL(free_oname, (struct obj *)); -E const char *FDECL(safe_oname, (struct obj *)); -E struct monst *FDECL(christen_monst, (struct monst *, const char *)); -E int NDECL(do_mname); -E struct obj *FDECL(oname, (struct obj *, const char *)); -E boolean FDECL(objtyp_is_callable, (int)); -E int NDECL(ddocall); -E void FDECL(docall, (struct obj *)); -E void FDECL(docall_input, (int)); +E void new_oname(struct obj *, int); +E void free_oname(struct obj *); +E const char *safe_oname(struct obj *); +E struct monst *christen_monst(struct monst *, const char *); +E int do_mname(); +E struct obj *oname(struct obj *, const char *); +E boolean objtyp_is_callable(int); +E int ddocall(); +E void docall(struct obj *); +E void docall_input(int); void namefloorobj(void); -E const char *NDECL(rndghostname); -E char *FDECL(x_monnam, (struct monst *, int, const char *, int, BOOLEAN_P)); -E char *FDECL(l_monnam, (struct monst *)); -E char *FDECL(mon_nam, (struct monst *)); -E char *FDECL(noit_mon_nam, (struct monst *)); -E char *FDECL(Monnam, (struct monst *)); -E char *FDECL(noit_Monnam, (struct monst *)); -E char *FDECL(noname_monnam, (struct monst *, int)); -E char *FDECL(m_monnam, (struct monst *)); -E char *FDECL(y_monnam, (struct monst *)); -E char *FDECL(Adjmonnam, (struct monst *, const char *)); -E char *FDECL(Amonnam, (struct monst *)); -E char *FDECL(a_monnam, (struct monst *)); -E char *FDECL(distant_monnam, (struct monst *, int, char *)); -E char *FDECL(mon_nam_too, (struct monst *, struct monst *)); -E char *FDECL(minimal_monnam, (struct monst *, BOOLEAN_P)); -E const char *NDECL(rndmonnam); -E const char *FDECL(hcolor, (const char *)); -E const char *NDECL(rndcolor); -E const char *FDECL(hliquid, (const char *)); +E const char *rndghostname(); +E char *x_monnam(struct monst *, int, const char *, int, BOOLEAN_P); +E char *l_monnam(struct monst *); +E char *mon_nam(struct monst *); +E char *noit_mon_nam(struct monst *); +E char *Monnam(struct monst *); +E char *noit_Monnam(struct monst *); +E char *noname_monnam(struct monst *, int); +E char *m_monnam(struct monst *); +E char *y_monnam(struct monst *); +E char *Adjmonnam(struct monst *, const char *); +E char *Amonnam(struct monst *); +E char *a_monnam(struct monst *); +E char *distant_monnam(struct monst *, int, char *); +E char *mon_nam_too(struct monst *, struct monst *); +E char *minimal_monnam(struct monst *, BOOLEAN_P); +E const char *rndmonnam(); +E const char *hcolor(const char *); +E const char *rndcolor(); +E const char *hliquid(const char *); #ifdef REINCARNATION -E const char *NDECL(roguename); -#endif -E struct obj *FDECL(realloc_obj, - (struct obj *, int, genericptr_t, int, const char *)); -E char *FDECL(coyotename, (struct monst *, char *)); -E char *FDECL(rndorcname, (char *)); -E struct monst *FDECL(christen_orc, (struct monst *, const char *, - const char *)); -E const char *FDECL(noveltitle, (int *)); -E const char *FDECL(lookup_novel, (const char *, int *)); +E const char *roguename(); +#endif +E struct obj *realloc_obj(struct obj *, int, genericptr_t, int, const char *); +E char *coyotename(struct monst *, char *); +E char *rndorcname(char *); +E struct monst *christen_orc(struct monst *, const char *, const char *); +E const char *noveltitle(int *); +E const char *lookup_novel(const char *, int *); extern char *mon_wounds(struct monst *); extern void print_mon_wounded(struct monst *, int); /* ### do_wear.c ### */ -E int NDECL(lucky_fedora); +E int lucky_fedora(); #ifdef USE_TRAMPOLI -E int NDECL(Armor_on); -E int NDECL(Boots_on); -E int NDECL(Gloves_on); -E int NDECL(Helmet_on); -E int FDECL(select_off, (struct obj *)); -E int NDECL(take_off); -#endif -E const char *FDECL(fingers_or_gloves, (BOOLEAN_P)); -E void FDECL(off_msg, (struct obj *)); -E void NDECL(set_wear); -E boolean FDECL(donning, (struct obj *)); -E boolean FDECL(doffing, (struct obj *)); -E void FDECL(cancel_doff, (struct obj *, long)); -E void NDECL(cancel_don); -E int FDECL(stop_donning, (struct obj *)); -E int NDECL(Armor_off); -E int NDECL(Armor_gone); -E int NDECL(Helmet_off); -E int NDECL(Gloves_off); -E int NDECL(Boots_on); -E int NDECL(Boots_off); -E int NDECL(Cloak_off); -E int NDECL(Shield_off); -E int NDECL(Shirt_off); -E void NDECL(Amulet_off); -E void FDECL(Ring_on, (struct obj *)); -E void FDECL(Ring_off, (struct obj *)); -E void FDECL(Ring_gone, (struct obj *)); -E void FDECL(Blindf_on, (struct obj *)); -E void FDECL(Blindf_off, (struct obj *)); -E int NDECL(dotakeoff); -E int NDECL(doremring); -E int FDECL(cursed, (struct obj *)); -E int FDECL(armoroff, (struct obj *)); -E int FDECL(canwearobj, (struct obj *, long *, BOOLEAN_P)); -E int NDECL(dowear); -E int NDECL(doputon); -E void NDECL(find_ac); -E void NDECL(glibr); -E struct obj *FDECL(some_armor, (struct monst *)); -E void FDECL(erode_armor, (struct monst *, int)); -E struct obj *FDECL(stuck_ring, (struct obj *, int)); -E struct obj *NDECL(unchanger); -E void NDECL(reset_remarm); -E int NDECL(doddoremarm); -E int FDECL(destroy_arm, (struct obj *)); -E void FDECL(adj_abon, (struct obj *, SCHAR_P)); -E boolean FDECL(inaccessible_equipment, (struct obj *, const char *, BOOLEAN_P)); +E int Armor_on(); +E int Boots_on(); +E int Gloves_on(); +E int Helmet_on(); +E int select_off(struct obj *); +E int take_off(); +#endif +E const char *fingers_or_gloves(BOOLEAN_P); +E void off_msg(struct obj *); +E void set_wear(); +E boolean donning(struct obj *); +E boolean doffing(struct obj *); +E void cancel_doff(struct obj *, long); +E void cancel_don(); +E int stop_donning(struct obj *); +E int Armor_off(); +E int Armor_gone(); +E int Helmet_off(); +E int Gloves_off(); +E int Boots_on(); +E int Boots_off(); +E int Cloak_off(); +E int Shield_off(); +E int Shirt_off(); +E void Amulet_off(); +E void Ring_on(struct obj *); +E void Ring_off(struct obj *); +E void Ring_gone(struct obj *); +E void Blindf_on(struct obj *); +E void Blindf_off(struct obj *); +E int dotakeoff(); +E int doremring(); +E int cursed(struct obj *); +E int armoroff(struct obj *); +E int canwearobj(struct obj *, long *, BOOLEAN_P); +E int dowear(); +E int doputon(); +E void find_ac(); +E void glibr(); +E struct obj *some_armor(struct monst *); +E void erode_armor(struct monst *, int); +E struct obj *stuck_ring(struct obj *, int); +E struct obj *unchanger(); +E void reset_remarm(); +E int doddoremarm(); +E int destroy_arm(struct obj *); +E void adj_abon(struct obj *, SCHAR_P); +E boolean inaccessible_equipment(struct obj *, const char *, BOOLEAN_P); /* ### dog.c ### */ -E void FDECL(newedog, (struct monst *)); -E void FDECL(free_edog, (struct monst *)); -E void FDECL(initedog, (struct monst *)); -E struct monst *FDECL(make_familiar, (struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P)); -E struct monst *NDECL(makedog); -E void NDECL(update_mlstmv); -E void NDECL(losedogs); -E void FDECL(mon_arrive, (struct monst *, BOOLEAN_P)); -E void FDECL(mon_catchup_elapsed_time, (struct monst *, long)); -E void FDECL(keepdogs, (BOOLEAN_P)); -E void FDECL(migrate_to_level, (struct monst *, XCHAR_P, XCHAR_P, coord *)); -E int FDECL(dogfood, (struct monst *, struct obj *)); -E boolean FDECL(tamedog, (struct monst *, struct obj *)); -E void FDECL(abuse_dog, (struct monst *)); -E void FDECL(wary_dog, (struct monst *, BOOLEAN_P)); +E void newedog(struct monst *); +E void free_edog(struct monst *); +E void initedog(struct monst *); +E struct monst *make_familiar(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P); +E struct monst *makedog(); +E void update_mlstmv(); +E void losedogs(); +E void mon_arrive(struct monst *, BOOLEAN_P); +E void mon_catchup_elapsed_time(struct monst *, long); +E void keepdogs(BOOLEAN_P); +E void migrate_to_level(struct monst *, XCHAR_P, XCHAR_P, coord *); +E int dogfood(struct monst *, struct obj *); +E boolean tamedog(struct monst *, struct obj *); +E void abuse_dog(struct monst *); +E void wary_dog(struct monst *, BOOLEAN_P); /* ### dogmove.c ### */ -E struct obj *FDECL(droppables, (struct monst *)); -E int FDECL(dog_nutrition, (struct monst *, struct obj *)); -E int FDECL(dog_eat, (struct monst *, struct obj *, int, int, BOOLEAN_P)); -E int FDECL(dog_move, (struct monst *, int)); +E struct obj *droppables(struct monst *); +E int dog_nutrition(struct monst *, struct obj *); +E int dog_eat(struct monst *, struct obj *, int, int, BOOLEAN_P); +E int dog_move(struct monst *, int); #ifdef USE_TRAMPOLI -E void FDECL(wantdoor, (int, int, genericptr_t)); +E void wantdoor(int, int, genericptr_t); #endif -E void FDECL(finish_meating, (struct monst *)); -E boolean FDECL(cursed_object_at, (int, int)); +E void finish_meating(struct monst *); +E boolean cursed_object_at(int, int); /* ### dokick.c ### */ -E boolean FDECL(ghitm, (struct monst *, struct obj *)); -E void FDECL(container_impact_dmg, (struct obj *, XCHAR_P, XCHAR_P)); -E int NDECL(dokick); -E boolean FDECL(ship_object, (struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P)); -E void FDECL(obj_delivery, (BOOLEAN_P)); -E void FDECL(deliver_obj_to_mon, (struct monst *mtmp, int, unsigned long)); -E schar FDECL(down_gate, (XCHAR_P, XCHAR_P)); -E void FDECL(impact_drop, (struct obj *, XCHAR_P, XCHAR_P, XCHAR_P)); +E boolean ghitm(struct monst *, struct obj *); +E void container_impact_dmg(struct obj *, XCHAR_P, XCHAR_P); +E int dokick(); +E boolean ship_object(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P); +E void obj_delivery(BOOLEAN_P); +E void deliver_obj_to_mon(struct monst *mtmp, int, unsigned long); +E schar down_gate(XCHAR_P, XCHAR_P); +E void impact_drop(struct obj *, XCHAR_P, XCHAR_P, XCHAR_P); /* ### dothrow.c ### */ -E int NDECL(dothrow); -E int NDECL(dofire); -E void FDECL(endmultishot, (BOOLEAN_P)); -E void FDECL(hitfloor, (struct obj *, BOOLEAN_P)); -E void FDECL(hurtle, (int, int, int, BOOLEAN_P)); -E void FDECL(mhurtle, (struct monst *, int, int, int)); -E boolean FDECL(throwing_weapon, (struct obj *)); -E void FDECL(throwit, (struct obj *, long, BOOLEAN_P)); -E int FDECL(omon_adj, (struct monst *, struct obj *, BOOLEAN_P)); -E int FDECL(thitmonst, (struct monst *, struct obj *)); -E int FDECL(hero_breaks, (struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P)); -E int FDECL(breaks, (struct obj *, XCHAR_P, XCHAR_P)); -E void FDECL(breakobj, (struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P, BOOLEAN_P)); -E boolean FDECL(breaktest, (struct obj *)); -E boolean FDECL(walk_path, (coord *, coord *, boolean (*)(genericptr_t, int, int), genericptr_t)); -E boolean FDECL(hurtle_jump, (void *, int, int)); -E boolean FDECL(hurtle_step, (void *, int, int)); +E int dothrow(); +E int dofire(); +E void endmultishot(BOOLEAN_P); +E void hitfloor(struct obj *, BOOLEAN_P); +E void hurtle(int, int, int, BOOLEAN_P); +E void mhurtle(struct monst *, int, int, int); +E boolean throwing_weapon(struct obj *); +E void throwit(struct obj *, long, BOOLEAN_P); +E int omon_adj(struct monst *, struct obj *, BOOLEAN_P); +E int thitmonst(struct monst *, struct obj *); +E int hero_breaks(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P); +E int breaks(struct obj *, XCHAR_P, XCHAR_P); +E void breakobj(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P, BOOLEAN_P); +E boolean breaktest(struct obj *); +E boolean walk_path(coord *, coord *, boolean (*)(genericptr_t, int, int), genericptr_t); +E boolean hurtle_jump(void *, int, int); +E boolean hurtle_step(void *, int, int); /* ### drawing.c ### */ #endif /* !MAKEDEFS_C && !LEV_LEX_C */ -E int FDECL(def_char_to_objclass, (CHAR_P)); -E int FDECL(def_char_to_monclass, (CHAR_P)); +E int def_char_to_objclass(CHAR_P); +E int def_char_to_monclass(CHAR_P); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) -E void FDECL(assign_graphics, (glyph_t *, int, int, int)); -E void FDECL(switch_graphics, (int)); +E void assign_graphics(glyph_t *, int, int, int); +E void switch_graphics(int); #ifdef REINCARNATION -E void FDECL(assign_rogue_graphics, (BOOLEAN_P)); +E void assign_rogue_graphics(BOOLEAN_P); #endif -E void FDECL(assign_utf8graphics_symbol, (int, glyph_t)); -E void FDECL(assign_moria_graphics, (BOOLEAN_P)); +E void assign_utf8graphics_symbol(int, glyph_t); +E void assign_moria_graphics(BOOLEAN_P); /* ### dump.c ### */ -E void FDECL(dump, (const char *, const char *)); -E void NDECL(dump_blockquote_start); -E void NDECL(dump_blockquote_end); -E void FDECL(dump_text, (const char *, const char *)); -E void FDECL(dump_header_html, (const char *)); -E void FDECL(dump_html, (const char *, const char *)); -E void NDECL(dump_init); -E void NDECL(dump_exit); -E void FDECL(dump_object, (const char, const struct obj *, const char *)); -E void FDECL(dump_title, (char *)); -E void FDECL(dump_subtitle, (const char *)); -E void FDECL(dump_line, (const char *, const char *)); -E void NDECL(dump_list_start); -E void FDECL(dump_list_item, (const char *)); -E void FDECL(dump_list_item_object, (struct obj *)); -E void FDECL(dump_list_item_link, (const char *, const char *)); -E void NDECL(dump_list_end); -E void NDECL(dump_definition_list_start); -E void FDECL(dump_definition_list_dd, (const char *)); -E void FDECL(dump_definition_list_dt, (const char *)); -E void NDECL(dump_definition_list_end); -E void FDECL(dump_containerconts, (struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); +E void dump(const char *, const char *); +E void dump_blockquote_start(); +E void dump_blockquote_end(); +E void dump_text(const char *, const char *); +E void dump_header_html(const char *); +E void dump_html(const char *, const char *); +E void dump_init(); +E void dump_exit(); +E void dump_object(const char, const struct obj *, const char *); +E void dump_title(char *); +E void dump_subtitle(const char *); +E void dump_line(const char *, const char *); +E void dump_list_start(); +E void dump_list_item(const char *); +E void dump_list_item_object(struct obj *); +E void dump_list_item_link(const char *, const char *); +E void dump_list_end(); +E void dump_definition_list_start(); +E void dump_definition_list_dd(const char *); +E void dump_definition_list_dt(const char *); +E void dump_definition_list_end(); +E void dump_containerconts(struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); extern const char* html_escape_character(const char); -E char* FDECL(html_link, (const char *, const char *)); +E char* html_link(const char *, const char *); #ifdef DUMP_LOG -E int NDECL(dump_screenshot); -E int NDECL(dumpoverview); +E int dump_screenshot(); +E int dumpoverview(); #endif /* ### dungeon.c ### */ -E void FDECL(save_dungeon, (int, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(restore_dungeon, (int)); -E void FDECL(insert_branch, (branch *, BOOLEAN_P)); -E void NDECL(init_dungeons); -E s_level *FDECL(find_level, (const char *)); -E s_level *FDECL(Is_special, (d_level *)); +E void save_dungeon(int, BOOLEAN_P, BOOLEAN_P); +E void restore_dungeon(int); +E void insert_branch(branch *, BOOLEAN_P); +E void init_dungeons(); +E s_level *find_level(const char *); +E s_level *Is_special(d_level *); #ifdef RANDOMIZED_PLANES -E s_level *FDECL(get_next_elemental_plane, (d_level *)); -E d_level *NDECL(get_first_elemental_plane); -#endif -E branch *FDECL(Is_branchlev, (d_level *)); -E boolean FDECL(builds_up, (d_level *)); -E xchar FDECL(ledger_no, (d_level *)); -E xchar NDECL(maxledgerno); -E schar FDECL(depth, (d_level *)); -E xchar FDECL(dunlev, (d_level *)); -E xchar FDECL(dunlevs_in_dungeon, (d_level *)); -E xchar FDECL(ledger_to_dnum, (XCHAR_P)); -E xchar FDECL(ledger_to_dlev, (XCHAR_P)); -E xchar FDECL(deepest_lev_reached, (BOOLEAN_P)); -E boolean FDECL(on_level, (d_level *, d_level *)); -E void FDECL(next_level, (BOOLEAN_P)); -E void FDECL(prev_level, (BOOLEAN_P)); -E void FDECL(u_on_newpos, (int, int)); -E void FDECL(u_on_rndspot, (int)); -E void FDECL(u_on_sstairs, (int)); -E void NDECL(u_on_upstairs); -E void NDECL(u_on_dnstairs); -E boolean FDECL(On_stairs, (XCHAR_P, XCHAR_P)); -E void FDECL(get_level, (d_level *, int)); -E boolean FDECL(Is_botlevel, (d_level *)); -E boolean FDECL(Can_fall_thru, (d_level *)); -E boolean FDECL(Can_dig_down, (d_level *)); -E boolean FDECL(Can_rise_up, (int, int, d_level *)); -E boolean FDECL(has_ceiling, (d_level *)); -E boolean FDECL(In_quest, (d_level *)); -E boolean FDECL(In_mines, (d_level *)); -E boolean FDECL(In_sheol, (d_level *)); -E branch *FDECL(dungeon_branch, (const char *)); -E boolean FDECL(at_dgn_entrance, (const char *)); -E boolean FDECL(In_hell, (d_level *)); -E boolean FDECL(In_V_tower, (d_level *)); -E boolean FDECL(On_W_tower_level, (d_level *)); -E boolean FDECL(In_W_tower, (int, int, d_level *)); -E void FDECL(find_hell, (d_level *)); -E void FDECL(goto_hell, (BOOLEAN_P, BOOLEAN_P)); -E void FDECL(assign_level, (d_level *, d_level *)); -E void FDECL(assign_rnd_level, (d_level *, d_level *, int)); -E int FDECL(induced_align, (int)); -E boolean FDECL(Invocation_lev, (d_level *)); -E xchar NDECL(level_difficulty); -E schar FDECL(lev_by_name, (const char *)); +E s_level *get_next_elemental_plane(d_level *); +E d_level *get_first_elemental_plane(); +#endif +E branch *Is_branchlev(d_level *); +E boolean builds_up(d_level *); +E xchar ledger_no(d_level *); +E xchar maxledgerno(); +E schar depth(d_level *); +E xchar dunlev(d_level *); +E xchar dunlevs_in_dungeon(d_level *); +E xchar ledger_to_dnum(XCHAR_P); +E xchar ledger_to_dlev(XCHAR_P); +E xchar deepest_lev_reached(BOOLEAN_P); +E boolean on_level(d_level *, d_level *); +E void next_level(BOOLEAN_P); +E void prev_level(BOOLEAN_P); +E void u_on_newpos(int, int); +E void u_on_rndspot(int); +E void u_on_sstairs(int); +E void u_on_upstairs(); +E void u_on_dnstairs(); +E boolean On_stairs(XCHAR_P, XCHAR_P); +E void get_level(d_level *, int); +E boolean Is_botlevel(d_level *); +E boolean Can_fall_thru(d_level *); +E boolean Can_dig_down(d_level *); +E boolean Can_rise_up(int, int, d_level *); +E boolean has_ceiling(d_level *); +E boolean In_quest(d_level *); +E boolean In_mines(d_level *); +E boolean In_sheol(d_level *); +E branch *dungeon_branch(const char *); +E boolean at_dgn_entrance(const char *); +E boolean In_hell(d_level *); +E boolean In_V_tower(d_level *); +E boolean On_W_tower_level(d_level *); +E boolean In_W_tower(int, int, d_level *); +E void find_hell(d_level *); +E void goto_hell(BOOLEAN_P, BOOLEAN_P); +E void assign_level(d_level *, d_level *); +E void assign_rnd_level(d_level *, d_level *, int); +E int induced_align(int); +E boolean Invocation_lev(d_level *); +E xchar level_difficulty(); +E schar lev_by_name(const char *); #ifdef WIZARD -E schar FDECL(print_dungeon, (BOOLEAN_P, schar *, xchar *)); -#endif -E int NDECL(donamelevel); -E int NDECL(dooverview); -E void FDECL(show_overview, (int, int)); -E void FDECL(forget_mapseen, (int)); -E void FDECL(init_mapseen, (d_level *)); -E void NDECL(recalc_mapseen); -E void FDECL(mapseen_temple, (struct monst *)); -E void FDECL(recbranch_mapseen, (d_level *, d_level *)); -E void FDECL(room_discovered, (int)); -E void FDECL(overview_stats, (winid, const char *, long *, long *)); -E void FDECL(remdun_mapseen, (int)); -E char *FDECL(get_annotation, (d_level *)); -E const char *FDECL(get_generic_level_description, (d_level *)); -E const char *FDECL(endgame_level_name, (char *, int)); +E schar print_dungeon(BOOLEAN_P, schar *, xchar *); +#endif +E int donamelevel(); +E int dooverview(); +E void show_overview(int, int); +E void forget_mapseen(int); +E void init_mapseen(d_level *); +E void recalc_mapseen(); +E void mapseen_temple(struct monst *); +E void recbranch_mapseen(d_level *, d_level *); +E void room_discovered(int); +E void overview_stats(winid, const char *, long *, long *); +E void remdun_mapseen(int); +E char *get_annotation(d_level *); +E const char *get_generic_level_description(d_level *); +E const char *endgame_level_name(char *, int); /* ### eat.c ### */ #ifdef USE_TRAMPOLI -E int NDECL(eatmdone); -E int NDECL(eatfood); -E int NDECL(opentin); -E int NDECL(unfaint); -#endif -E boolean FDECL(is_edible, (struct obj *)); -E void NDECL(init_uhunger); -E int NDECL(Hear_again); -E void NDECL(reset_eat); -E int NDECL(doeat); -E void NDECL(gethungry); -E void FDECL(morehungry, (int)); -E void FDECL(lesshungry, (int)); -E boolean NDECL(is_fainted); -E void NDECL(reset_faint); -E void NDECL(violated_vegetarian); +E int eatmdone(); +E int eatfood(); +E int opentin(); +E int unfaint(); +#endif +E boolean is_edible(struct obj *); +E void init_uhunger(); +E int Hear_again(); +E void reset_eat(); +E int doeat(); +E void gethungry(); +E void morehungry(int); +E void lesshungry(int); +E boolean is_fainted(); +E void reset_faint(); +E void violated_vegetarian(); #if 0 -E void NDECL(sync_hunger); -#endif -E void FDECL(newuhs, (BOOLEAN_P)); -E struct obj *FDECL(floorfood, (const char *, int)); -E void NDECL(vomit); -E int FDECL(eaten_stat, (int, struct obj *)); -E void FDECL(food_disappears, (struct obj *)); -E void FDECL(food_substitution, (struct obj *, struct obj *)); -E boolean FDECL(bite_monster, (struct monst *mon)); -E void NDECL(fix_petrification); +E void sync_hunger(); +#endif +E void newuhs(BOOLEAN_P); +E struct obj *floorfood(const char *, int); +E void vomit(); +E int eaten_stat(int, struct obj *); +E void food_disappears(struct obj *); +E void food_substitution(struct obj *, struct obj *); +E boolean bite_monster(struct monst *mon); +E void fix_petrification(); extern int intrinsic_possible(int, struct permonst *); -E void FDECL(consume_oeaten, (struct obj *, int)); -E boolean FDECL(maybe_finished_meal, (BOOLEAN_P)); -E void FDECL(set_tin_variety, (struct obj *, int)); -E int FDECL(tin_variety_txt, (char *, int *)); -E void FDECL(tin_details, (struct obj *, int, char *)); -E boolean FDECL(Popeye, (int)); +E void consume_oeaten(struct obj *, int); +E boolean maybe_finished_meal(BOOLEAN_P); +E void set_tin_variety(struct obj *, int); +E int tin_variety_txt(char *, int *); +E void tin_details(struct obj *, int, char *); +E boolean Popeye(int); /* ### end.c ### */ -E void FDECL(done1, (int)); -E int NDECL(done2); +E void done1(int); +E int done2(); #ifdef USE_TRAMPOLI -E void FDECL(done_intr, (int)); +E void done_intr(int); #endif -E void FDECL(done_in_by, (struct monst *)); +E void done_in_by(struct monst *); #endif /* !MAKEDEFS_C && !LEV_LEX_C */ E void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) -E void FDECL(done, (int)); -E void FDECL(container_contents, (struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(nh_terminate, (int)) NORETURN; -E int NDECL(num_genocides); -E void FDECL(delayed_killer, (int, int, const char *)); -E struct kinfo *FDECL(find_delayed_killer, (int)); -E void FDECL(dealloc_killer, (struct kinfo *)); -E void FDECL(save_killers, (int, int)); -E void FDECL(restore_killers, (int)); -E char *FDECL(build_english_list, (char *)); +E void done(int); +E void container_contents(struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +E void nh_terminate(int) NORETURN; +E int num_genocides(); +E void delayed_killer(int, int, const char *); +E struct kinfo *find_delayed_killer(int); +E void dealloc_killer(struct kinfo *); +E void save_killers(int, int); +E void restore_killers(int); +E char *build_english_list(char *); /* ### engrave.c ### */ -E char *FDECL(random_engraving, (char *)); -E void FDECL(wipeout_text, (char *, int, unsigned)); -E boolean FDECL(can_reach_floor, (BOOLEAN_P)); -E void FDECL(You_cant_reach_the_floor, (int, int, BOOLEAN_P)); -E void FDECL(You_cant_reach_the_ceiling, (int, int)); -E void FDECL(cant_reach_floor, (int, int, BOOLEAN_P, BOOLEAN_P)); -E const char *FDECL(surface, (int, int)); -E const char *FDECL(ceiling, (int, int)); -E struct engr *FDECL(engr_at, (XCHAR_P, XCHAR_P)); -E int FDECL(sengr_at, (const char *, XCHAR_P, XCHAR_P)); -E void FDECL(u_wipe_engr, (int)); -E void FDECL(wipe_engr_at, (XCHAR_P, XCHAR_P, XCHAR_P)); -E void FDECL(read_engr_at, (int, int)); -E void FDECL(make_engr_at, (int, int, const char *, long, XCHAR_P)); -E void FDECL(del_engr_at, (int, int)); -E int NDECL(freehand); -E int NDECL(doengrave); -E int NDECL(doengrave_elbereth); -E void NDECL(sanitize_engravings); -E void FDECL(save_engravings, (int, int)); -E void FDECL(rest_engravings, (int)); -E void FDECL(engr_stats, (const char *, char *, long *, long *)); -E void FDECL(del_engr, (struct engr *)); -E void FDECL(rloc_engr, (struct engr *)); -E void FDECL(make_grave, (int, int, const char *)); +E char *random_engraving(char *); +E void wipeout_text(char *, int, unsigned); +E boolean can_reach_floor(BOOLEAN_P); +E void You_cant_reach_the_floor(int, int, BOOLEAN_P); +E void You_cant_reach_the_ceiling(int, int); +E void cant_reach_floor(int, int, BOOLEAN_P, BOOLEAN_P); +E const char *surface(int, int); +E const char *ceiling(int, int); +E struct engr *engr_at(XCHAR_P, XCHAR_P); +E int sengr_at(const char *, XCHAR_P, XCHAR_P); +E void u_wipe_engr(int); +E void wipe_engr_at(XCHAR_P, XCHAR_P, XCHAR_P); +E void read_engr_at(int, int); +E void make_engr_at(int, int, const char *, long, XCHAR_P); +E void del_engr_at(int, int); +E int freehand(); +E int doengrave(); +E int doengrave_elbereth(); +E void sanitize_engravings(); +E void save_engravings(int, int); +E void rest_engravings(int); +E void engr_stats(const char *, char *, long *, long *); +E void del_engr(struct engr *); +E void rloc_engr(struct engr *); +E void make_grave(int, int, const char *); /* ### exper.c ### */ -E long FDECL(newuexp, (int)); -E int NDECL(newpw); -E int FDECL(experience, (struct monst *, int)); -E void FDECL(more_experienced, (int, int, int)); -E void FDECL(losexp, (const char *)); -E void NDECL(newexplevel); -E void FDECL(pluslvl, (BOOLEAN_P)); -E long FDECL(rndexp, (BOOLEAN_P)); +E long newuexp(int); +E int newpw(); +E int experience(struct monst *, int); +E void more_experienced(int, int, int); +E void losexp(const char *); +E void newexplevel(); +E void pluslvl(BOOLEAN_P); +E long rndexp(BOOLEAN_P); /* ### explode.c ### */ -E void FDECL(explode, (int, int, int, int, CHAR_P, int)); -E long FDECL(scatter, (int, int, int, unsigned int, struct obj *)); -E void FDECL(splatter_burning_oil, (int, int, BOOLEAN_P)); -E void FDECL(explode_oil, (struct obj *, int, int)); +E void explode(int, int, int, int, CHAR_P, int); +E long scatter(int, int, int, unsigned int, struct obj *); +E void splatter_burning_oil(int, int, BOOLEAN_P); +E void explode_oil(struct obj *, int, int); /* ### extralev.c ### */ #ifdef REINCARNATION -E void NDECL(makeroguerooms); -E void FDECL(corr, (int, int)); -E void NDECL(makerogueghost); +E void makeroguerooms(); +E void corr(int, int); +E void makerogueghost(); #endif /* ### files.c ### */ -E char *FDECL(fname_encode, (const char *, CHAR_P, char *, char *, int)); -E char *FDECL(fname_decode, (CHAR_P, char *, char *, int)); -E const char *FDECL(fqname, (const char *, int, int)); +E char *fname_encode(const char *, CHAR_P, char *, char *, int); +E char *fname_decode(CHAR_P, char *, char *, int); +E const char *fqname(const char *, int, int); #ifndef FILE_AREAS -E FILE *FDECL(fopen_datafile, (const char *, const char *, int)); +E FILE *fopen_datafile(const char *, const char *, int); #endif -E boolean FDECL(uptodate, (int, const char *)); -E void FDECL(store_version, (int)); +E boolean uptodate(int, const char *); +E void store_version(int); #ifdef MFLOPPY -E void NDECL(set_lock_and_bones); -#endif -E void FDECL(set_levelfile_name, (char *, int)); -E int FDECL(create_levelfile, (int, char *)); -E int FDECL(open_levelfile, (int, char *)); -E void FDECL(delete_levelfile, (int)); -E void NDECL(clearlocks); -E int FDECL(create_bonesfile, (d_level*, char **, char *)); +E void set_lock_and_bones(); +#endif +E void set_levelfile_name(char *, int); +E int create_levelfile(int, char *); +E int open_levelfile(int, char *); +E void delete_levelfile(int); +E void clearlocks(); +E int create_bonesfile(d_level*, char **, char *); #ifdef MFLOPPY -E void NDECL(cancel_bonesfile); +E void cancel_bonesfile(); #endif -E void FDECL(commit_bonesfile, (d_level *)); -E int FDECL(open_bonesfile, (d_level*, char **)); -E int FDECL(delete_bonesfile, (d_level*)); -E void NDECL(compress_bonesfile); -E void NDECL(set_savefile_name); +E void commit_bonesfile(d_level *); +E int open_bonesfile(d_level*, char **); +E int delete_bonesfile(d_level*); +E void compress_bonesfile(); +E void set_savefile_name(); #ifdef INSURANCE -E void FDECL(save_savefile_name, (int)); +E void save_savefile_name(int); #endif #if defined(WIZARD) && !defined(MICRO) -E void NDECL(set_error_savefile); -#endif -E int NDECL(create_savefile); -E int NDECL(open_savefile); -E int NDECL(delete_savefile); -E int NDECL(restore_saved_game); -E void FDECL(compress, (const char *)); -E void FDECL(uncompress, (const char *)); -E void FDECL(compress_area, (const char *, const char *)); -E void FDECL(uncompress_area, (const char *, const char *)); +E void set_error_savefile(); +#endif +E int create_savefile(); +E int open_savefile(); +E int delete_savefile(); +E int restore_saved_game(); +E void compress(const char *); +E void uncompress(const char *); +E void compress_area(const char *, const char *); +E void uncompress_area(const char *, const char *); #ifndef FILE_AREAS -E boolean FDECL(lock_file, (const char *, int, int)); -E void FDECL(unlock_file, (const char *)); +E boolean lock_file(const char *, int, int); +E void unlock_file(const char *); #endif #ifdef USER_SOUNDS -E boolean FDECL(can_read_file, (const char *)); +E boolean can_read_file(const char *); #endif extern boolean read_config_file(const char *, int); -E void FDECL(check_recordfile, (const char *)); +E void check_recordfile(const char *); #if defined(WIZARD) -E void NDECL(read_wizkit); +E void read_wizkit(); #endif -E void FDECL(paniclog, (const char *, const char *)); -E int FDECL(validate_prefix_locations, (char *)); -E char** NDECL(get_saved_games); -E void FDECL(free_saved_games, (char**)); +E void paniclog(const char *, const char *); +E int validate_prefix_locations(char *); +E char** get_saved_games(); +E void free_saved_games(char**); #ifdef SELF_RECOVER -E boolean NDECL(recover_savefile); +E boolean recover_savefile(); #endif #ifdef SYSCF_FILE extern void assure_syscf_file(void); #endif -E int FDECL(nhclose, (int)); +E int nhclose(int); #ifdef HOLD_LOCKFILE_OPEN -E void NDECL(really_close); +E void really_close(); #endif #ifdef WHEREIS_FILE -E void NDECL(touch_whereis); -E void NDECL(delete_whereis); -E void FDECL(signal_whereis, (int)); +E void touch_whereis(); +E void delete_whereis(); +E void signal_whereis(int); #endif /* ### fountain.c ### */ -E void FDECL(floating_above, (const char *)); -E void FDECL(dogushforth, (int)); +E void floating_above(const char *); +E void dogushforth(int); # ifdef USE_TRAMPOLI -E void FDECL(gush, (int, int, genericptr_t)); +E void gush(int, int, genericptr_t); # endif -E void FDECL(dryup, (XCHAR_P, XCHAR_P, BOOLEAN_P)); -E void NDECL(drinkfountain); -E void FDECL(dipfountain, (struct obj *)); +E void dryup(XCHAR_P, XCHAR_P, BOOLEAN_P); +E void drinkfountain(); +E void dipfountain(struct obj *); #ifdef SINKS -E void FDECL(breaksink, (int, int)); -E void NDECL(drinksink); +E void breaksink(int, int); +E void drinksink(); #endif /* ### hack.c ### */ #ifdef DUNGEON_GROWTH -E void FDECL(catchup_dgn_growths, (int)); -E void FDECL(dgn_growths, (BOOLEAN_P, BOOLEAN_P)); +E void catchup_dgn_growths(int); +E void dgn_growths(BOOLEAN_P, BOOLEAN_P); #endif extern boolean is_valid_travelpt(int,int); -E anything *FDECL(uint_to_any, (unsigned)); -E anything *FDECL(long_to_any, (long)); -E anything *FDECL(monst_to_any, (struct monst *)); -E anything *FDECL(obj_to_any, (struct obj *)); -E boolean FDECL(revive_nasty, (int, int, const char*)); -E void FDECL(movobj, (struct obj *, XCHAR_P, XCHAR_P)); -E boolean FDECL(may_dig, (XCHAR_P, XCHAR_P)); -E boolean FDECL(may_passwall, (XCHAR_P, XCHAR_P)); -E boolean FDECL(bad_rock, (struct permonst *, XCHAR_P, XCHAR_P)); -E int FDECL(cant_squeeze_thru, (struct monst *)); -E boolean FDECL(invocation_pos, (XCHAR_P, XCHAR_P)); -E boolean FDECL(test_move, (int, int, int, int, int)); -E boolean NDECL(u_rooted); -E void NDECL(domove); +E anything *uint_to_any(unsigned); +E anything *long_to_any(long); +E anything *monst_to_any(struct monst *); +E anything *obj_to_any(struct obj *); +E boolean revive_nasty(int, int, const char*); +E void movobj(struct obj *, XCHAR_P, XCHAR_P); +E boolean may_dig(XCHAR_P, XCHAR_P); +E boolean may_passwall(XCHAR_P, XCHAR_P); +E boolean bad_rock(struct permonst *, XCHAR_P, XCHAR_P); +E int cant_squeeze_thru(struct monst *); +E boolean invocation_pos(XCHAR_P, XCHAR_P); +E boolean test_move(int, int, int, int, int); +E boolean u_rooted(); +E void domove(); extern void runmode_delay_output(void); -E boolean NDECL(overexertion); -E void NDECL(invocation_message); -E void NDECL(switch_terrain); -E boolean FDECL(pooleffects, (BOOLEAN_P)); -E void FDECL(wounds_message, (struct monst *)); -E char *FDECL(mon_wounds, (struct monst *)); -E void FDECL(spoteffects, (BOOLEAN_P)); -E char *FDECL(in_rooms, (XCHAR_P, XCHAR_P, int)); -E boolean FDECL(in_town, (int, int)); -E void FDECL(check_special_room, (BOOLEAN_P)); -E int NDECL(dopickup); -E void NDECL(lookaround); -E boolean FDECL(crawl_destination, (int, int)); -E int NDECL(monster_nearby); -E void FDECL(nomul, (int, const char *)); -E void FDECL(unmul, (const char *)); -E void FDECL(showdmg, (int, BOOLEAN_P)); -E void FDECL(losehp, (int, const char *, BOOLEAN_P)); -E void FDECL(losehp_how, (int, const char *, BOOLEAN_P, int)); -E void FDECL(set_uhpmax, (int, BOOLEAN_P)); -E void NDECL(check_uhpmax); -E int NDECL(weight_cap); -E int NDECL(inv_weight); -E int NDECL(near_capacity); -E int FDECL(calc_capacity, (int)); -E int NDECL(max_capacity); -E boolean FDECL(check_capacity, (const char *)); -E int FDECL(inv_cnt, (BOOLEAN_P)); -E long FDECL(money_cnt, (struct obj *)); +E boolean overexertion(); +E void invocation_message(); +E void switch_terrain(); +E boolean pooleffects(BOOLEAN_P); +E void wounds_message(struct monst *); +E char *mon_wounds(struct monst *); +E void spoteffects(BOOLEAN_P); +E char *in_rooms(XCHAR_P, XCHAR_P, int); +E boolean in_town(int, int); +E void check_special_room(BOOLEAN_P); +E int dopickup(); +E void lookaround(); +E boolean crawl_destination(int, int); +E int monster_nearby(); +E void nomul(int, const char *); +E void unmul(const char *); +E void showdmg(int, BOOLEAN_P); +E void losehp(int, const char *, BOOLEAN_P); +E void losehp_how(int, const char *, BOOLEAN_P, int); +E void set_uhpmax(int, BOOLEAN_P); +E void check_uhpmax(); +E int weight_cap(); +E int inv_weight(); +E int near_capacity(); +E int calc_capacity(int); +E int max_capacity(); +E boolean check_capacity(const char *); +E int inv_cnt(BOOLEAN_P); +E long money_cnt(struct obj *); extern boolean MON_AT(int, int); extern boolean OBJ_AT(int, int); /* ### hacklib.c ### */ -E boolean FDECL(digit, (CHAR_P)); -E boolean FDECL(letter, (CHAR_P)); -E char FDECL(highc, (CHAR_P)); -E char FDECL(lowc, (CHAR_P)); -E char *FDECL(lcase, (char *)); -E char *FDECL(ucase, (char *)); -E char *FDECL(upstart, (char *)); -E char *FDECL(mungspaces, (char *)); -E char *FDECL(trimspaces, (char *)); -E char *FDECL(strip_newline, (char *)); -E char *FDECL(eos, (char *)); -E void FDECL(sanitizestr, (char *)); -E boolean FDECL(str_end_is, (const char *, const char *)); -E char *FDECL(strkitten, (char *, CHAR_P)); -E void FDECL(copynchars, (char *, const char *, int)); -E char *FDECL(strcasecpy, (char *, const char *)); -E char *FDECL(s_suffix, (const char *)); -E char *FDECL(xcrypt, (const char *, char *)); -E boolean FDECL(onlyspace, (const char *)); -E char *FDECL(tabexpand, (char *)); -E char *FDECL(visctrl, (CHAR_P)); -E char *FDECL(strsubst, (char *, const char *, const char *)); -E int FDECL(strNsubst, (char *, const char *, const char *, int)); -E const char *FDECL(ordin, (int)); -E char *FDECL(sitoa, (int)); -E int FDECL(sgn, (int)); -E int FDECL(rounddiv, (long, int)); -E int FDECL(dist2, (int, int, int, int)); -E int FDECL(isqrt, (int)); -E int FDECL(ilog2, (int)); -E int FDECL(distmin, (int, int, int, int)); -E boolean FDECL(online2, (int, int, int, int)); -E boolean FDECL(pmatch, (const char *, const char *)); -E boolean FDECL(pmatchi, (const char *, const char *)); +E boolean digit(CHAR_P); +E boolean letter(CHAR_P); +E char highc(CHAR_P); +E char lowc(CHAR_P); +E char *lcase(char *); +E char *ucase(char *); +E char *upstart(char *); +E char *mungspaces(char *); +E char *trimspaces(char *); +E char *strip_newline(char *); +E char *eos(char *); +E void sanitizestr(char *); +E boolean str_end_is(const char *, const char *); +E char *strkitten(char *, CHAR_P); +E void copynchars(char *, const char *, int); +E char *strcasecpy(char *, const char *); +E char *s_suffix(const char *); +E char *xcrypt(const char *, char *); +E boolean onlyspace(const char *); +E char *tabexpand(char *); +E char *visctrl(CHAR_P); +E char *strsubst(char *, const char *, const char *); +E int strNsubst(char *, const char *, const char *, int); +E const char *ordin(int); +E char *sitoa(int); +E int sgn(int); +E int rounddiv(long, int); +E int dist2(int, int, int, int); +E int isqrt(int); +E int ilog2(int); +E int distmin(int, int, int, int); +E boolean online2(int, int, int, int); +E boolean pmatch(const char *, const char *); +E boolean pmatchi(const char *, const char *); #ifndef STRNCMPI -E int FDECL(strncmpi, (const char *, const char *, int)); +E int strncmpi(const char *, const char *, int); #endif #ifndef STRSTRI -E char *FDECL(strstri, (const char *, const char *)); -#endif -E boolean FDECL(fuzzymatch, (const char *, const char *, const char *, BOOLEAN_P)); -E void FDECL(init_random, (unsigned int)); -E void NDECL(reseed_random); -E void FDECL(set_random_state, (unsigned int)); -E int NDECL(getyear); -E int NDECL(getmonth); -E int NDECL(getmday); +E char *strstri(const char *, const char *); +#endif +E boolean fuzzymatch(const char *, const char *, const char *, BOOLEAN_P); +E void init_random(unsigned int); +E void reseed_random(); +E void set_random_state(unsigned int); +E int getyear(); +E int getmonth(); +E int getmday(); #if 0 -E char *FDECL(yymmdd, (time_t)); -#endif -E long FDECL(yyyymmdd, (time_t)); -E int NDECL(phase_of_the_moon); -E boolean NDECL(friday_13th); -E boolean NDECL(towelday); -E boolean NDECL(pirateday); -E int NDECL(night); -E int NDECL(midnight); -E boolean NDECL(piday); -E boolean NDECL(aprilfoolsday); -E boolean NDECL(discordian_holiday); +E char *yymmdd(time_t); +#endif +E long yyyymmdd(time_t); +E int phase_of_the_moon(); +E boolean friday_13th(); +E boolean towelday(); +E boolean pirateday(); +E int night(); +E int midnight(); +E boolean piday(); +E boolean aprilfoolsday(); +E boolean discordian_holiday(); extern boolean is_june(); -E char *FDECL(iso8601, (time_t)); -E char *FDECL(iso8601_duration, (long)); +E char *iso8601(time_t); +E char *iso8601_duration(long); extern char* format_duration(long); -E char *FDECL(get_formatted_time, (time_t, const char *)); -E time_t NDECL(current_epoch); -E void FDECL(strbuf_init, (strbuf_t *)); -E void FDECL(strbuf_append, (strbuf_t *, const char *)); -E void FDECL(strbuf_reserve, (strbuf_t *, int)); -E void FDECL(strbuf_empty, (strbuf_t *)); -E void FDECL(strbuf_nl_to_crlf, (strbuf_t *)); +E char *get_formatted_time(time_t, const char *); +E time_t current_epoch(); +E void strbuf_init(strbuf_t *); +E void strbuf_append(strbuf_t *, const char *); +E void strbuf_reserve(strbuf_t *, int); +E void strbuf_empty(strbuf_t *); +E void strbuf_nl_to_crlf(strbuf_t *); extern int swapbits(int, int, int); extern void strip_brackets(char *); /* note: the snprintf CPP wrapper includes the "fmt" argument in "..." @@ -1030,149 +1024,147 @@ extern void nh_snprintf(const char *func, int line, char *str, size_t size, /* ### invent.c ### */ -E void FDECL(assigninvlet, (struct obj *)); -E struct obj *FDECL(merge_choice, (struct obj *, struct obj *)); -E int FDECL(merged, (struct obj **, struct obj **)); +E void assigninvlet(struct obj *); +E struct obj *merge_choice(struct obj *, struct obj *); +E int merged(struct obj **, struct obj **); #ifdef USE_TRAMPOLI -E int FDECL(ckunpaid, (struct obj *)); -#endif -E void FDECL(addinv_core1, (struct obj *)); -E void FDECL(addinv_core2, (struct obj *)); -E struct obj *FDECL(addinv, (struct obj *)); -E struct obj *FDECL(hold_another_object, - (struct obj *, const char *, const char *, const char *)); -E void FDECL(useupall, (struct obj *)); -E void FDECL(useup, (struct obj *)); -E void FDECL(consume_obj_charge, (struct obj *, BOOLEAN_P)); -E void FDECL(freeinv_core, (struct obj *)); -E void FDECL(freeinv, (struct obj *)); -E void FDECL(delallobj, (int, int)); -E void FDECL(delobj, (struct obj *)); -E struct obj *FDECL(sobj_at, (int, int, int)); -E struct obj *FDECL(nxtobj, (struct obj *, int, BOOLEAN_P)); -E struct obj *FDECL(carrying, (int)); -E boolean NDECL(have_lizard); -E struct obj *FDECL(o_on, (unsigned int, struct obj *)); -E boolean FDECL(obj_here, (struct obj *, int, int)); -E boolean NDECL(wearing_armor); -E boolean FDECL(is_worn, (struct obj *)); -E struct obj *FDECL(g_at, (int, int)); -E struct obj *FDECL(mkgoldobj, (long)); -E struct obj *FDECL(getobj, (const char *, const char *)); -E int FDECL(ggetobj, (const char *, int (*)(OBJ_P), int, BOOLEAN_P, unsigned *)); -E void FDECL(fully_identify_obj, (struct obj *)); -E int FDECL(identify, (struct obj *)); -E void FDECL(identify_pack, (int, BOOLEAN_P)); -E int FDECL(askchain, (struct obj **, const char *, int, int (*)(OBJ_P), - int (*)(OBJ_P), int, const char *)); -E void FDECL(prinv, (const char *, struct obj *, long)); -E char *FDECL(xprname, (struct obj *, const char *, CHAR_P, BOOLEAN_P, long, long)); -E int NDECL(ddoinv); -E char FDECL(display_inventory, (const char *, BOOLEAN_P)); -E char FDECL(dump_inventory, (const char *, BOOLEAN_P, BOOLEAN_P)); -E int FDECL(display_binventory, (int, int, BOOLEAN_P)); -E struct obj *FDECL(display_cinventory, (struct obj *)); -E struct obj *FDECL(display_minventory, (struct monst *, int, char *)); -E int NDECL(dotypeinv); -E const char *FDECL(dfeature_at, (int, int, char *)); -E int FDECL(look_here, (int, BOOLEAN_P)); -E int NDECL(dolook); -E boolean FDECL(will_feel_cockatrice, (struct obj *, BOOLEAN_P)); -E void FDECL(feel_cockatrice, (struct obj *, BOOLEAN_P)); -E void FDECL(stackobj, (struct obj *)); -E boolean FDECL(mergable, (struct obj *, struct obj *)); -E int NDECL(doprgold); -E int NDECL(doprwep); -E int NDECL(doprarm); -E int NDECL(doprring); -E int NDECL(dopramulet); -E int NDECL(doprtool); -E int NDECL(doprinuse); -E void FDECL(useupf, (struct obj *, long)); -E char *FDECL(let_to_name, (CHAR_P, BOOLEAN_P)); -E void NDECL(free_invbuf); -E void NDECL(reassign); -E int NDECL(doorganize); -E int FDECL(count_objects, (struct obj *)); -E int FDECL(count_unidentified, (struct obj *)); -E void NDECL(learn_unseen_invent); -E void NDECL(update_inventory); -E int FDECL(count_unpaid, (struct obj *)); -E int FDECL(count_buc, (struct obj *, int, boolean (*)(OBJ_P))); -E void FDECL(tally_BUCX, (struct obj *, BOOLEAN_P, int *, int *, int *, int *, int *)); -E long FDECL(count_contents, (struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(carry_obj_effects, (struct obj *)); -E const char *FDECL(currency, (long)); -E void FDECL(silly_thing, (const char *, struct obj *)); -E struct obj *NDECL(getnextgetobj); +E int ckunpaid(struct obj *); +#endif +E void addinv_core1(struct obj *); +E void addinv_core2(struct obj *); +E struct obj *addinv(struct obj *); +E struct obj *hold_another_object(struct obj *, const char *, const char *, const char *); +E void useupall(struct obj *); +E void useup(struct obj *); +E void consume_obj_charge(struct obj *, BOOLEAN_P); +E void freeinv_core(struct obj *); +E void freeinv(struct obj *); +E void delallobj(int, int); +E void delobj(struct obj *); +E struct obj *sobj_at(int, int, int); +E struct obj *nxtobj(struct obj *, int, BOOLEAN_P); +E struct obj *carrying(int); +E boolean have_lizard(); +E struct obj *o_on(unsigned int, struct obj *); +E boolean obj_here(struct obj *, int, int); +E boolean wearing_armor(); +E boolean is_worn(struct obj *); +E struct obj *g_at(int, int); +E struct obj *mkgoldobj(long); +E struct obj *getobj(const char *, const char *); +E int ggetobj(const char *, int (*)(OBJ_P), int, BOOLEAN_P, unsigned *); +E void fully_identify_obj(struct obj *); +E int identify(struct obj *); +E void identify_pack(int, BOOLEAN_P); +E int askchain(struct obj **, const char *, int, int (*)(OBJ_P), int (*)(OBJ_P), int, const char *); +E void prinv(const char *, struct obj *, long); +E char *xprname(struct obj *, const char *, CHAR_P, BOOLEAN_P, long, long); +E int ddoinv(); +E char display_inventory(const char *, BOOLEAN_P); +E char dump_inventory(const char *, BOOLEAN_P, BOOLEAN_P); +E int display_binventory(int, int, BOOLEAN_P); +E struct obj *display_cinventory(struct obj *); +E struct obj *display_minventory(struct monst *, int, char *); +E int dotypeinv(); +E const char *dfeature_at(int, int, char *); +E int look_here(int, BOOLEAN_P); +E int dolook(); +E boolean will_feel_cockatrice(struct obj *, BOOLEAN_P); +E void feel_cockatrice(struct obj *, BOOLEAN_P); +E void stackobj(struct obj *); +E boolean mergable(struct obj *, struct obj *); +E int doprgold(); +E int doprwep(); +E int doprarm(); +E int doprring(); +E int dopramulet(); +E int doprtool(); +E int doprinuse(); +E void useupf(struct obj *, long); +E char *let_to_name(CHAR_P, BOOLEAN_P); +E void free_invbuf(); +E void reassign(); +E int doorganize(); +E int count_objects(struct obj *); +E int count_unidentified(struct obj *); +E void learn_unseen_invent(); +E void update_inventory(); +E int count_unpaid(struct obj *); +E int count_buc(struct obj *, int, boolean (*)(OBJ_P)); +E void tally_BUCX(struct obj *, BOOLEAN_P, int *, int *, int *, int *, int *); +E long count_contents(struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +E void carry_obj_effects(struct obj *); +E const char *currency(long); +E void silly_thing(const char *, struct obj *); +E struct obj *getnextgetobj(); #ifdef SORTLOOT -E int FDECL(sortloot_cmp, (struct obj *, struct obj *)); +E int sortloot_cmp(struct obj *, struct obj *); #endif -E boolean FDECL(is_racial_armor, (struct obj *)); -E boolean FDECL(is_racial_weapon, (struct obj *)); +E boolean is_racial_armor(struct obj *); +E boolean is_racial_weapon(struct obj *); extern boolean is_dragon_identified(struct permonst *); -E void FDECL(identify_dragon, (int)); +E void identify_dragon(int); /* ### ioctl.c ### */ #if defined(UNIX) || defined(__BEOS__) -E void NDECL(getwindowsz); -E void NDECL(getioctls); -E void NDECL(setioctls); +E void getwindowsz(); +E void getioctls(); +E void setioctls(); # ifdef SUSPEND -E int NDECL(dosuspend); +E int dosuspend(); # endif /* SUSPEND */ #endif /* UNIX || __BEOS__ */ /* ### light.c ### */ -E void FDECL(new_light_source, (XCHAR_P, XCHAR_P, int, int, ANY_P *)); -E void FDECL(del_light_source, (int, ANY_P *)); -E void FDECL(do_light_sources, (char **)); -E void FDECL(show_transient_light, (struct obj *, int, int)); -E void NDECL(transient_light_cleanup); -E struct monst *FDECL(find_mid, (unsigned, unsigned)); -E void FDECL(save_light_sources, (int, int, int)); -E void FDECL(restore_light_sources, (int)); -E void FDECL(light_stats, (const char *, char *, long *, long *)); -E void FDECL(relink_light_sources, (BOOLEAN_P)); -E void NDECL(light_sources_sanity_check); -E void FDECL(obj_move_light_source, (struct obj *, struct obj *)); -E boolean NDECL(any_light_source); -E void FDECL(snuff_light_source, (int, int)); -E boolean FDECL(obj_sheds_light, (struct obj *)); -E boolean FDECL(obj_is_burning, (struct obj *)); -E void FDECL(obj_split_light_source, (struct obj *, struct obj *)); -E void FDECL(obj_merge_light_sources, (struct obj *, struct obj *)); -E void FDECL(obj_adjust_light_radius, (struct obj *, int)); -E int FDECL(candle_light_range, (struct obj *)); -E int FDECL(arti_light_radius, (struct obj *)); -E const char *FDECL(arti_light_description, (struct obj *)); +E void new_light_source(XCHAR_P, XCHAR_P, int, int, ANY_P *); +E void del_light_source(int, ANY_P *); +E void do_light_sources(char **); +E void show_transient_light(struct obj *, int, int); +E void transient_light_cleanup(); +E struct monst *find_mid(unsigned, unsigned); +E void save_light_sources(int, int, int); +E void restore_light_sources(int); +E void light_stats(const char *, char *, long *, long *); +E void relink_light_sources(BOOLEAN_P); +E void light_sources_sanity_check(); +E void obj_move_light_source(struct obj *, struct obj *); +E boolean any_light_source(); +E void snuff_light_source(int, int); +E boolean obj_sheds_light(struct obj *); +E boolean obj_is_burning(struct obj *); +E void obj_split_light_source(struct obj *, struct obj *); +E void obj_merge_light_sources(struct obj *, struct obj *); +E void obj_adjust_light_radius(struct obj *, int); +E int candle_light_range(struct obj *); +E int arti_light_radius(struct obj *); +E const char *arti_light_description(struct obj *); #ifdef WIZARD -E int NDECL(wiz_light_sources); +E int wiz_light_sources(); #endif /* ### lock.c ### */ #ifdef USE_TRAMPOLI -E int NDECL(forcelock); -E int NDECL(picklock); -#endif -E boolean FDECL(picking_lock, (int *, int *)); -E boolean FDECL(picking_at, (int, int)); -E void FDECL(breakchestlock, (struct obj *, BOOLEAN_P)); -E void NDECL(reset_pick); -E void FDECL(maybe_reset_pick, (struct obj *)); -E int FDECL(pick_lock, (struct obj *, int, int, BOOLEAN_P)); -E int NDECL(doforce); -E boolean FDECL(boxlock, (struct obj *, struct obj *)); -E boolean FDECL(doorlock, (struct obj *, int, int)); -E int NDECL(doopen); -E int NDECL(doclose); -E int FDECL(artifact_door, (int, int)); -E boolean FDECL(stumble_on_door_mimic, (int, int)); +E int forcelock(); +E int picklock(); +#endif +E boolean picking_lock(int *, int *); +E boolean picking_at(int, int); +E void breakchestlock(struct obj *, BOOLEAN_P); +E void reset_pick(); +E void maybe_reset_pick(struct obj *); +E int pick_lock(struct obj *, int, int, BOOLEAN_P); +E int doforce(); +E boolean boxlock(struct obj *, struct obj *); +E boolean doorlock(struct obj *, int, int); +E int doopen(); +E int doclose(); +E int artifact_door(int, int); +E boolean stumble_on_door_mimic(int, int); #ifdef AUTO_OPEN -E int FDECL(doopen_indir, (int, int)); +E int doopen_indir(int, int); #endif #ifdef MAC @@ -1180,38 +1172,38 @@ E int FDECL(doopen_indir, (int, int)); /* ### macfile.c ### */ -E int FDECL(maccreat, (const char *, long)); -E int FDECL(macopen, (const char *, int, long)); -E int FDECL(macclose, (int)); -E int FDECL(macread, (int, void *, unsigned)); -E int FDECL(macwrite, (int, void *, unsigned)); -E long FDECL(macseek, (int, long, short)); -E int FDECL(macunlink, (const char *)); +E int maccreat(const char *, long); +E int macopen(const char *, int, long); +E int macclose(int); +E int macread(int, void *, unsigned); +E int macwrite(int, void *, unsigned); +E long macseek(int, long, short); +E int macunlink(const char *); /* ### macsnd.c ### */ -E void FDECL(mac_speaker, (struct obj *, char *)); +E void mac_speaker(struct obj *, char *); /* ### macunix.c ### */ -E void FDECL(regularize, (char *)); -E void NDECL(getlock); +E void regularize(char *); +E void getlock(); /* ### macwin.c ### */ -E void FDECL(lock_mouse_cursor, (Boolean)); -E int NDECL(SanePositions); +E void lock_mouse_cursor(Boolean); +E int SanePositions(); /* ### mttymain.c ### */ -E void FDECL(getreturn, (char *)); +E void getreturn(char *); E void VDECL(msmsg, (const char *, ...)); -E void NDECL(gettty); -E void NDECL(setftty); -E void FDECL(settty, (const char *)); -E int NDECL(tgetch); -E void FDECL(cmov, (int x, int y)); -E void FDECL(nocmov, (int x, int y)); +E void gettty(); +E void setftty(); +E void settty(const char *); +E int tgetch(); +E void cmov(int x, int y); +E void nocmov(int x, int y); #endif /* MAC */ @@ -1219,426 +1211,422 @@ E void FDECL(nocmov, (int x, int y)); #ifdef MAIL # ifdef UNIX -E void NDECL(getmailstatus); +E void getmailstatus(); # endif -E void NDECL(ckmailstatus); -E void FDECL(read_hint, (struct obj *)); -E void FDECL(readmail, (struct obj *)); -E void NDECL(maybe_hint); +E void ckmailstatus(); +E void read_hint(struct obj *); +E void readmail(struct obj *); +E void maybe_hint(); #endif /* MAIL */ /* ### makemon.c ### */ -E void NDECL(mon_sanity_check); -E void FDECL(dealloc_monst, (struct monst *)); -E boolean FDECL(is_home_elemental, (struct permonst *)); -E struct monst *FDECL(clone_mon, (struct monst *, XCHAR_P, XCHAR_P)); -E int FDECL(monhp_per_lvl, (struct monst *)); -E void FDECL(newmonhp, (struct monst *, int)); -E struct mextra *NDECL(newmextra); -E void FDECL(copy_mextra, (struct monst *, struct monst *)); -E void FDECL(dealloc_mextra, (struct monst *)); -E struct monst *FDECL(makemon, (struct permonst *, int, int, int)); -E boolean FDECL(create_critters, (int, struct permonst *)); -E struct permonst *NDECL(rndmonst); -E void FDECL(reset_rndmonst, (int)); -E struct permonst *FDECL(mkclass, (CHAR_P, int)); -E struct permonst *FDECL(mkclass_aligned, (CHAR_P, int, ALIGNTYP_P)); -E int FDECL(mkclass_poly, (int)); -E int FDECL(adj_lev, (struct permonst *)); -E struct permonst *FDECL(grow_up, (struct monst *, struct monst *)); -E int FDECL(mongets, (struct monst *, int)); -E int FDECL(golemhp, (int)); -E boolean FDECL(peace_minded, (struct permonst *)); -E void FDECL(set_malign, (struct monst *)); -E void FDECL(newmcorpsenm, (struct monst *)); -E void FDECL(freemcorpsenm, (struct monst *)); -E void FDECL(set_mimic_sym, (struct monst *)); -E int FDECL(mbirth_limit, (int)); -E void FDECL(mimic_hit_msg, (struct monst *, SHORT_P)); -E void FDECL(mkmonmoney, (struct monst *, long)); -E int FDECL(bagotricks, (struct obj *)); -E boolean FDECL(propagate, (int, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(create_camera_demon, (struct obj *, int, int)); -E int NDECL(min_monster_difficulty); -E int NDECL(max_monster_difficulty); -E boolean FDECL(prohibited_by_generation_flags, (struct permonst *)); -E boolean FDECL(usmellmon, (struct permonst *)); +E void mon_sanity_check(); +E void dealloc_monst(struct monst *); +E boolean is_home_elemental(struct permonst *); +E struct monst *clone_mon(struct monst *, XCHAR_P, XCHAR_P); +E int monhp_per_lvl(struct monst *); +E void newmonhp(struct monst *, int); +E struct mextra *newmextra(); +E void copy_mextra(struct monst *, struct monst *); +E void dealloc_mextra(struct monst *); +E struct monst *makemon(struct permonst *, int, int, int); +E boolean create_critters(int, struct permonst *); +E struct permonst *rndmonst(); +E void reset_rndmonst(int); +E struct permonst *mkclass(CHAR_P, int); +E struct permonst *mkclass_aligned(CHAR_P, int, ALIGNTYP_P); +E int mkclass_poly(int); +E int adj_lev(struct permonst *); +E struct permonst *grow_up(struct monst *, struct monst *); +E int mongets(struct monst *, int); +E int golemhp(int); +E boolean peace_minded(struct permonst *); +E void set_malign(struct monst *); +E void newmcorpsenm(struct monst *); +E void freemcorpsenm(struct monst *); +E void set_mimic_sym(struct monst *); +E int mbirth_limit(int); +E void mimic_hit_msg(struct monst *, SHORT_P); +E void mkmonmoney(struct monst *, long); +E int bagotricks(struct obj *); +E boolean propagate(int, BOOLEAN_P, BOOLEAN_P); +E void create_camera_demon(struct obj *, int, int); +E int min_monster_difficulty(); +E int max_monster_difficulty(); +E boolean prohibited_by_generation_flags(struct permonst *); +E boolean usmellmon(struct permonst *); /* ### mapglyph.c ### */ -E void FDECL(mapglyph, (int, glyph_t *, int *, unsigned *, int, int, unsigned)); -E char *FDECL(encglyph, (int)); +E void mapglyph(int, glyph_t *, int *, unsigned *, int, int, unsigned); +E char *encglyph(int); extern glyph_t get_monsym(int glyph); /* ### mcastu.c ### */ -E int FDECL(castmu, (struct monst *, struct attack *, BOOLEAN_P, BOOLEAN_P)); -E int FDECL(buzzmu, (struct monst *, struct attack *)); +E int castmu(struct monst *, struct attack *, BOOLEAN_P, BOOLEAN_P); +E int buzzmu(struct monst *, struct attack *); /* ### mhitm.c ### */ -E int FDECL(fightm, (struct monst *)); -E int FDECL(mattackm, (struct monst *, struct monst *)); -E boolean FDECL(engulf_target, (struct monst *, struct monst *)); -E int FDECL(mdisplacem, (struct monst *, struct monst *, BOOLEAN_P)); -E void FDECL(paralyze_monst, (struct monst *, int)); -E int FDECL(sleep_monst, (struct monst *, int, int)); -E void FDECL(slept_monst, (struct monst *)); -E long FDECL(attk_protection, (int)); -E void FDECL(rustm, (struct monst *, struct obj *)); -E void FDECL(maybe_freeze_m, (struct monst *, int, int*)); +E int fightm(struct monst *); +E int mattackm(struct monst *, struct monst *); +E boolean engulf_target(struct monst *, struct monst *); +E int mdisplacem(struct monst *, struct monst *, BOOLEAN_P); +E void paralyze_monst(struct monst *, int); +E int sleep_monst(struct monst *, int, int); +E void slept_monst(struct monst *); +E long attk_protection(int); +E void rustm(struct monst *, struct obj *); +E void maybe_freeze_m(struct monst *, int, int*); /* ### mhitu.c ### */ -E const char *FDECL(mpoisons_subj, (struct monst *, struct attack *)); -E void NDECL(u_slow_down); -E struct monst *NDECL(cloneu); -E void FDECL(expels, (struct monst *, struct permonst *, BOOLEAN_P)); -E struct attack *FDECL(getmattk, (struct monst *, struct monst *, int, int *, struct attack *)); -E int FDECL(mattacku, (struct monst *)); -E int FDECL(magic_negation, (struct monst *)); -E boolean NDECL(gulp_blnd_check); -E int FDECL(gazemu, (struct monst *, struct attack *)); -E void FDECL(mdamageu, (struct monst *, int)); -E int FDECL(could_seduce, (struct monst *, struct monst *, struct attack *)); +E const char *mpoisons_subj(struct monst *, struct attack *); +E void u_slow_down(); +E struct monst *cloneu(); +E void expels(struct monst *, struct permonst *, BOOLEAN_P); +E struct attack *getmattk(struct monst *, struct monst *, int, int *, struct attack *); +E int mattacku(struct monst *); +E int magic_negation(struct monst *); +E boolean gulp_blnd_check(); +E int gazemu(struct monst *, struct attack *); +E void mdamageu(struct monst *, int); +E int could_seduce(struct monst *, struct monst *, struct attack *); #ifdef SEDUCE -E int FDECL(doseduce, (struct monst *)); +E int doseduce(struct monst *); #endif -E void FDECL(maybe_freeze_u, (int*)); -E void FDECL(spore_dies, (struct monst *)); +E void maybe_freeze_u(int*); +E void spore_dies(struct monst *); /* ### minion.c ### */ -E void FDECL(newemin, (struct monst *)); -E void FDECL(free_emin, (struct monst *)); -E int FDECL(monster_census, (BOOLEAN_P)); -E int FDECL(msummon, (struct monst *)); -E void FDECL(summon_minion, (ALIGNTYP_P, BOOLEAN_P)); -E int FDECL(demon_talk, (struct monst *)); -E long FDECL(bribe, (struct monst *)); -E int FDECL(dprince, (ALIGNTYP_P)); -E int FDECL(dlord, (ALIGNTYP_P)); -E int NDECL(llord); -E int FDECL(ndemon, (ALIGNTYP_P)); -E int NDECL(lminion); -E void FDECL(lose_guardian_angel, (struct monst *)); -E void NDECL(gain_guardian_angel); +E void newemin(struct monst *); +E void free_emin(struct monst *); +E int monster_census(BOOLEAN_P); +E int msummon(struct monst *); +E void summon_minion(ALIGNTYP_P, BOOLEAN_P); +E int demon_talk(struct monst *); +E long bribe(struct monst *); +E int dprince(ALIGNTYP_P); +E int dlord(ALIGNTYP_P); +E int llord(); +E int ndemon(ALIGNTYP_P); +E int lminion(); +E void lose_guardian_angel(struct monst *); +E void gain_guardian_angel(); /* ### mklev.c ### */ -E void FDECL(mineralize, (int, int, int, int, boolean)); +E void mineralize(int, int, int, int, boolean); #ifdef USE_TRAMPOLI -E int FDECL(do_comp, (genericptr_t, genericptr_t)); -#endif -E void NDECL(sort_rooms); -E void FDECL(add_room, (int, int, int, int, BOOLEAN_P, SCHAR_P, BOOLEAN_P)); -E void FDECL(add_subroom, (struct mkroom *, int, int, int, int, - BOOLEAN_P, SCHAR_P, BOOLEAN_P)); -E void FDECL(makecorridors, (int)); -E void FDECL(add_door, (int, int, struct mkroom *)); -E void NDECL(mkpoolroom); -E void NDECL(mklev); +E int do_comp(genericptr_t, genericptr_t); +#endif +E void sort_rooms(); +E void add_room(int, int, int, int, BOOLEAN_P, SCHAR_P, BOOLEAN_P); +E void add_subroom(struct mkroom *, int, int, int, int, BOOLEAN_P, SCHAR_P, BOOLEAN_P); +E void makecorridors(int); +E void add_door(int, int, struct mkroom *); +E void mkpoolroom(); +E void mklev(); #ifdef SPECIALIZATION -E void FDECL(topologize, (struct mkroom *, BOOLEAN_P)); +E void topologize(struct mkroom *, BOOLEAN_P); #else -E void FDECL(topologize, (struct mkroom *)); -#endif -E void FDECL(place_branch, (branch *, XCHAR_P, XCHAR_P)); -E boolean FDECL(occupied, (XCHAR_P, XCHAR_P)); -E int FDECL(okdoor, (XCHAR_P, XCHAR_P)); -E void FDECL(dodoor, (int, int, struct mkroom *)); -E void FDECL(mktrap, (int, int, struct mkroom *, coord*)); -E void FDECL(mkstairs, (XCHAR_P, XCHAR_P, CHAR_P, struct mkroom *)); -E void NDECL(mkinvokearea); -E void FDECL(wallwalk_right, (XCHAR_P, XCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, int)); +E void topologize(struct mkroom *); +#endif +E void place_branch(branch *, XCHAR_P, XCHAR_P); +E boolean occupied(XCHAR_P, XCHAR_P); +E int okdoor(XCHAR_P, XCHAR_P); +E void dodoor(int, int, struct mkroom *); +E void mktrap(int, int, struct mkroom *, coord*); +E void mkstairs(XCHAR_P, XCHAR_P, CHAR_P, struct mkroom *); +E void mkinvokearea(); +E void wallwalk_right(XCHAR_P, XCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, int); #ifdef ADVENT_CALENDAR -E boolean NDECL(mk_advcal_portal); +E boolean mk_advcal_portal(); #endif extern void mk_knox_vault(int, int, int, int); extern d_level * get_floating_branch(d_level *, branch *); /* ### mkmap.c ### */ -void FDECL(flood_fill_rm, (int, int, int, BOOLEAN_P, BOOLEAN_P)); -void FDECL(remove_rooms, (int, int, int, int)); +void flood_fill_rm(int, int, int, BOOLEAN_P, BOOLEAN_P); +void remove_rooms(int, int, int, int); /* ### mkmaze.c ### */ -E void FDECL(wallification, (int, int, int, int)); -E void FDECL(wall_extends, (int, int, int, int)); -E void FDECL(walkfrom, (int, int, SCHAR_P)); -E void FDECL(makemaz, (const char *)); -E void FDECL(mazexy, (coord *)); +E void wallification(int, int, int, int); +E void wall_extends(int, int, int, int); +E void walkfrom(int, int, SCHAR_P); +E void makemaz(const char *); +E void mazexy(coord *); extern void get_level_extends(int *, int *, int *, int *); -E void NDECL(bound_digging); -E void FDECL(mkportal, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); -E boolean FDECL(bad_location, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); -E int FDECL(place_lregion, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, - XCHAR_P, d_level *)); -E void NDECL(fixup_special); -E void NDECL(movebubbles); -E void NDECL(water_friction); -E void FDECL(save_waterlevel, (int, int)); -E void FDECL(restore_waterlevel, (int)); -E const char *FDECL(waterbody_name, (XCHAR_P, XCHAR_P)); +E void bound_digging(); +E void mkportal(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); +E boolean bad_location(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); +E int place_lregion(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, + XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, + XCHAR_P, d_level *); +E void fixup_special(); +E void movebubbles(); +E void water_friction(); +E void save_waterlevel(int, int); +E void restore_waterlevel(int); +E const char *waterbody_name(XCHAR_P, XCHAR_P); #ifdef ADVENT_CALENDAR -E void FDECL(fill_advent_calendar, (boolean)); +E void fill_advent_calendar(boolean); #endif /* ### mkobj.c ### */ -E struct oextra *NDECL(newoextra); -E void FDECL(copy_oextra, (struct obj *, struct obj *)); -E void FDECL(dealloc_oextra, (struct obj *)); -E void FDECL(newomonst, (struct obj *)); -E void FDECL(free_omonst, (struct obj *)); -E void FDECL(newomid, (struct obj *)); -E void FDECL(free_omid, (struct obj *)); -E void FDECL(newolong, (struct obj *)); -E void FDECL(free_olong, (struct obj *)); -E void FDECL(new_omailcmd, (struct obj *, const char *)); -E void FDECL(free_omailcmd, (struct obj *)); -E struct obj *FDECL(mkobj_at, (CHAR_P, int, int, BOOLEAN_P)); -E void FDECL(costly_alteration, (struct obj *, int)); -E struct obj *FDECL(mksobj_at, (int, int, int, BOOLEAN_P, BOOLEAN_P)); -E struct obj *FDECL(mksobj_migr_to_species, (int, unsigned, BOOLEAN_P, BOOLEAN_P)); -E struct obj *FDECL(mkobj, (CHAR_P, BOOLEAN_P)); -E int NDECL(rndmonnum); -E boolean FDECL(bogon_is_pname, (CHAR_P)); -E struct obj *FDECL(splitobj, (struct obj *, long)); -E struct obj *FDECL(unsplitobj, (struct obj *)); -E void NDECL(clear_splitobjs); -E void FDECL(replace_object, (struct obj *, struct obj *)); -E void FDECL(bill_dummy_object, (struct obj *)); -E struct obj *FDECL(mksobj, (int, BOOLEAN_P, BOOLEAN_P)); -E int FDECL(bcsign, (struct obj *)); -E int FDECL(weight, (struct obj *)); -E struct obj *FDECL(mkgold, (long, int, int)); -E struct obj *FDECL(mkcorpstat, - (int, struct monst *, struct permonst *, int, int, BOOLEAN_P)); -E struct obj *FDECL(obj_attach_mid, (struct obj *, unsigned)); -E struct monst *FDECL(get_mtraits, (struct obj *, BOOLEAN_P)); -E struct obj *FDECL(mk_tt_object, (int, int, int)); -E struct obj *FDECL(mk_named_object, - (int, struct permonst *, int, int, const char *)); -E struct obj *FDECL(rnd_treefruit_at, (int, int)); -E void FDECL(rnd_treesticks_at, (int, int)); -E void FDECL(set_corpsenm, (struct obj *, int)); -E void FDECL(start_corpse_timeout, (struct obj *)); -E void FDECL(bless, (struct obj *)); -E void FDECL(unbless, (struct obj *)); -E void FDECL(curse, (struct obj *)); -E void FDECL(uncurse, (struct obj *)); -E void FDECL(blessorcurse, (struct obj *, int)); -E void FDECL(set_bknown, (struct obj *, unsigned)); -E boolean FDECL(is_flammable, (struct obj *)); -E boolean FDECL(is_rottable, (struct obj *)); -E void FDECL(place_object, (struct obj *, int, int)); -E void FDECL(remove_object, (struct obj *)); -E void FDECL(discard_minvent, (struct monst *)); -E void FDECL(obj_extract_self, (struct obj *)); -E void FDECL(extract_nobj, (struct obj *, struct obj **)); -E void FDECL(extract_nexthere, (struct obj *, struct obj **)); -E int FDECL(add_to_minv, (struct monst *, struct obj *)); -E struct obj *FDECL(add_to_container, (struct obj *, struct obj *)); -E void FDECL(add_to_migration, (struct obj *)); -E void FDECL(add_to_buried, (struct obj *)); -E void FDECL(dealloc_obj, (struct obj *)); -E void FDECL(obj_ice_effects, (int, int, BOOLEAN_P)); -E long FDECL(peek_at_iced_corpse_age, (struct obj *)); -E int FDECL(hornoplenty, (struct obj *, BOOLEAN_P)); +E struct oextra *newoextra(); +E void copy_oextra(struct obj *, struct obj *); +E void dealloc_oextra(struct obj *); +E void newomonst(struct obj *); +E void free_omonst(struct obj *); +E void newomid(struct obj *); +E void free_omid(struct obj *); +E void newolong(struct obj *); +E void free_olong(struct obj *); +E void new_omailcmd(struct obj *, const char *); +E void free_omailcmd(struct obj *); +E struct obj *mkobj_at(CHAR_P, int, int, BOOLEAN_P); +E void costly_alteration(struct obj *, int); +E struct obj *mksobj_at(int, int, int, BOOLEAN_P, BOOLEAN_P); +E struct obj *mksobj_migr_to_species(int, unsigned, BOOLEAN_P, BOOLEAN_P); +E struct obj *mkobj(CHAR_P, BOOLEAN_P); +E int rndmonnum(); +E boolean bogon_is_pname(CHAR_P); +E struct obj *splitobj(struct obj *, long); +E struct obj *unsplitobj(struct obj *); +E void clear_splitobjs(); +E void replace_object(struct obj *, struct obj *); +E void bill_dummy_object(struct obj *); +E struct obj *mksobj(int, BOOLEAN_P, BOOLEAN_P); +E int bcsign(struct obj *); +E int weight(struct obj *); +E struct obj *mkgold(long, int, int); +E struct obj *mkcorpstat(int, struct monst *, struct permonst *, int, int, BOOLEAN_P); +E struct obj *obj_attach_mid(struct obj *, unsigned); +E struct monst *get_mtraits(struct obj *, BOOLEAN_P); +E struct obj *mk_tt_object(int, int, int); +E struct obj *mk_named_object(int, struct permonst *, int, int, const char *); +E struct obj *rnd_treefruit_at(int, int); +E void rnd_treesticks_at(int, int); +E void set_corpsenm(struct obj *, int); +E void start_corpse_timeout(struct obj *); +E void bless(struct obj *); +E void unbless(struct obj *); +E void curse(struct obj *); +E void uncurse(struct obj *); +E void blessorcurse(struct obj *, int); +E void set_bknown(struct obj *, unsigned); +E boolean is_flammable(struct obj *); +E boolean is_rottable(struct obj *); +E void place_object(struct obj *, int, int); +E void remove_object(struct obj *); +E void discard_minvent(struct monst *); +E void obj_extract_self(struct obj *); +E void extract_nobj(struct obj *, struct obj **); +E void extract_nexthere(struct obj *, struct obj **); +E int add_to_minv(struct monst *, struct obj *); +E struct obj *add_to_container(struct obj *, struct obj *); +E void add_to_migration(struct obj *); +E void add_to_buried(struct obj *); +E void dealloc_obj(struct obj *); +E void obj_ice_effects(int, int, BOOLEAN_P); +E long peek_at_iced_corpse_age(struct obj *); +E int hornoplenty(struct obj *, BOOLEAN_P); E int do_stair_travel(char); #ifdef WIZARD -E void NDECL(obj_sanity_check); +E void obj_sanity_check(); #endif -E struct obj *FDECL(obj_nexto, (struct obj *)); -E struct obj *FDECL(obj_nexto_xy, (struct obj *, int, int, BOOLEAN_P)); -E struct obj *FDECL(obj_absorb, (struct obj **, struct obj **)); -E struct obj *FDECL(obj_meld, (struct obj **, struct obj **)); -E void FDECL(pudding_merge_message, (struct obj *, struct obj *)); -E struct obj *FDECL(init_dummyobj, (struct obj *, SHORT_P, long)); +E struct obj *obj_nexto(struct obj *); +E struct obj *obj_nexto_xy(struct obj *, int, int, BOOLEAN_P); +E struct obj *obj_absorb(struct obj **, struct obj **); +E struct obj *obj_meld(struct obj **, struct obj **); +E void pudding_merge_message(struct obj *, struct obj *); +E struct obj *init_dummyobj(struct obj *, SHORT_P, long); /* ### mkroom.c ### */ -E struct mkroom * FDECL(pick_room, (BOOLEAN_P)); -E void FDECL(mkroom, (int)); -E void FDECL(fill_zoo, (struct mkroom *)); -E boolean FDECL(nexttodoor, (int, int)); -E boolean FDECL(bydoor, (int, int)); -E boolean FDECL(somexyspace, (struct mkroom *, coord *, int)); -E boolean FDECL(has_dnstairs, (struct mkroom *)); -E boolean FDECL(has_upstairs, (struct mkroom *)); -E int FDECL(somex, (struct mkroom *)); -E int FDECL(somey, (struct mkroom *)); -E boolean FDECL(inside_room, (struct mkroom *, XCHAR_P, XCHAR_P)); -E boolean FDECL(somexy, (struct mkroom *, coord *)); -E void FDECL(mkundead, (coord *, BOOLEAN_P, int)); -E struct permonst *NDECL(courtmon); -E void FDECL(save_rooms, (int)); -E void FDECL(rest_rooms, (int)); -E struct mkroom *FDECL(search_special, (SCHAR_P)); -E int FDECL(cmap_to_type, (int)); +E struct mkroom * pick_room(BOOLEAN_P); +E void mkroom(int); +E void fill_zoo(struct mkroom *); +E boolean nexttodoor(int, int); +E boolean bydoor(int, int); +E boolean somexyspace(struct mkroom *, coord *, int); +E boolean has_dnstairs(struct mkroom *); +E boolean has_upstairs(struct mkroom *); +E int somex(struct mkroom *); +E int somey(struct mkroom *); +E boolean inside_room(struct mkroom *, XCHAR_P, XCHAR_P); +E boolean somexy(struct mkroom *, coord *); +E void mkundead(coord *, BOOLEAN_P, int); +E struct permonst *courtmon(); +E void save_rooms(int); +E void rest_rooms(int); +E struct mkroom *search_special(SCHAR_P); +E int cmap_to_type(int); extern boolean is_rainbow_shop(struct mkroom *); /* #### mksheol.c ### */ -E void FDECL(mksheol, (void*)); +E void mksheol(void*); /* ### mon.c ### */ extern boolean zombie_maker(struct monst *); extern int zombie_form(struct permonst *); -E int FDECL(select_newcham_form, (struct monst *)); -E void FDECL(remove_monster, (int, int)); -E int FDECL(m_poisongas_ok, (struct monst *)); -E int FDECL(undead_to_corpse, (int)); -E int FDECL(genus, (int, int)); -E int FDECL(pm_to_cham, (int)); -E int FDECL(minliquid, (struct monst *)); -E int NDECL(movemon); -E int FDECL(meatmetal, (struct monst *)); -E int FDECL(meatobj, (struct monst *)); -E void FDECL(mpickgold, (struct monst *)); -E boolean FDECL(mpickstuff, (struct monst *, const char *)); -E void FDECL(mpickup_obj, (struct monst *, struct obj *)); -E int FDECL(curr_mon_load, (struct monst *)); -E int FDECL(max_mon_load, (struct monst *)); -E int FDECL(can_carry, (struct monst *, struct obj *)); -E int FDECL(mfndpos, (struct monst *, coord *, long *, long)); -E boolean FDECL(monnear, (struct monst *, int, int)); -E void NDECL(dmonsfree); -E void FDECL(elemental_clog, (struct monst *)); -E int FDECL(mcalcmove, (struct monst*)); -E void NDECL(mcalcdistress); -E void FDECL(replmon, (struct monst *, struct monst *)); -E void FDECL(relmon, (struct monst *, struct monst **)); -E struct obj *FDECL(mlifesaver, (struct monst *)); -E boolean FDECL(corpse_chance, (struct monst *, struct monst *, BOOLEAN_P)); +E int select_newcham_form(struct monst *); +E void remove_monster(int, int); +E int m_poisongas_ok(struct monst *); +E int undead_to_corpse(int); +E int genus(int, int); +E int pm_to_cham(int); +E int minliquid(struct monst *); +E int movemon(); +E int meatmetal(struct monst *); +E int meatobj(struct monst *); +E void mpickgold(struct monst *); +E boolean mpickstuff(struct monst *, const char *); +E void mpickup_obj(struct monst *, struct obj *); +E int curr_mon_load(struct monst *); +E int max_mon_load(struct monst *); +E int can_carry(struct monst *, struct obj *); +E int mfndpos(struct monst *, coord *, long *, long); +E boolean monnear(struct monst *, int, int); +E void dmonsfree(); +E void elemental_clog(struct monst *); +E int mcalcmove(struct monst*); +E void mcalcdistress(); +E void replmon(struct monst *, struct monst *); +E void relmon(struct monst *, struct monst **); +E struct obj *mlifesaver(struct monst *); +E boolean corpse_chance(struct monst *, struct monst *, BOOLEAN_P); #ifdef WEBB_DISINT -E void FDECL(mondead_helper, (struct monst *, uchar)); -#endif -E void FDECL(mondead, (struct monst *)); -E void FDECL(mondied, (struct monst *)); -E void FDECL(mongone, (struct monst *)); -E void FDECL(monstone, (struct monst *)); -E void FDECL(monkilled, (struct monst *, const char *, int)); -E void FDECL(unstuck, (struct monst *)); -E void FDECL(killed, (struct monst *)); -E void FDECL(xkilled, (struct monst *, int)); -E void FDECL(mon_to_stone, (struct monst*)); -E void FDECL(m_into_limbo, (struct monst *)); -E void FDECL(mnexto, (struct monst *)); -E void FDECL(maybe_mnexto, (struct monst *)); -E int FDECL(mnearto, (struct monst *, XCHAR_P, XCHAR_P, BOOLEAN_P)); -E void FDECL(poisontell, (int)); -E void FDECL(poisoned, (const char *, int, const char *, int)); -E void FDECL(m_respond, (struct monst *)); -E void FDECL(setmangry, (struct monst *, BOOLEAN_P)); -E void FDECL(wakeup, (struct monst *, BOOLEAN_P)); -E void NDECL(wake_nearby); -E void FDECL(wake_nearto, (int, int, int)); -E void FDECL(seemimic, (struct monst *)); -E void NDECL(rescham); -E void NDECL(restartcham); -E void FDECL(restore_cham, (struct monst *)); -E boolean FDECL(hideunder, (struct monst *)); -E void FDECL(mon_animal_list, (BOOLEAN_P)); -E boolean FDECL(validvamp, (struct monst *, int *, int)); -E void FDECL(mgender_from_permonst, (struct monst *, struct permonst *)); -E int FDECL(newcham, (struct monst *, struct permonst *, BOOLEAN_P, BOOLEAN_P)); -E int FDECL(can_be_hatched, (int)); -E int FDECL(egg_type_from_parent, (int, BOOLEAN_P)); -E boolean FDECL(dead_species, (int, BOOLEAN_P)); -E void NDECL(kill_genocided_monsters); -E void FDECL(kill_monster_on_level, (int)); -E void FDECL(golemeffects, (struct monst *, int, int)); -E boolean FDECL(angry_guards, (BOOLEAN_P)); -E void NDECL(pacify_guards); -E void FDECL(decide_to_shapeshift, (struct monst *, int)); +E void mondead_helper(struct monst *, uchar); +#endif +E void mondead(struct monst *); +E void mondied(struct monst *); +E void mongone(struct monst *); +E void monstone(struct monst *); +E void monkilled(struct monst *, const char *, int); +E void unstuck(struct monst *); +E void killed(struct monst *); +E void xkilled(struct monst *, int); +E void mon_to_stone(struct monst*); +E void m_into_limbo(struct monst *); +E void mnexto(struct monst *); +E void maybe_mnexto(struct monst *); +E int mnearto(struct monst *, XCHAR_P, XCHAR_P, BOOLEAN_P); +E void poisontell(int); +E void poisoned(const char *, int, const char *, int); +E void m_respond(struct monst *); +E void setmangry(struct monst *, BOOLEAN_P); +E void wakeup(struct monst *, BOOLEAN_P); +E void wake_nearby(); +E void wake_nearto(int, int, int); +E void seemimic(struct monst *); +E void rescham(); +E void restartcham(); +E void restore_cham(struct monst *); +E boolean hideunder(struct monst *); +E void mon_animal_list(BOOLEAN_P); +E boolean validvamp(struct monst *, int *, int); +E void mgender_from_permonst(struct monst *, struct permonst *); +E int newcham(struct monst *, struct permonst *, BOOLEAN_P, BOOLEAN_P); +E int can_be_hatched(int); +E int egg_type_from_parent(int, BOOLEAN_P); +E boolean dead_species(int, BOOLEAN_P); +E void kill_genocided_monsters(); +E void kill_monster_on_level(int); +E void golemeffects(struct monst *, int, int); +E boolean angry_guards(BOOLEAN_P); +E void pacify_guards(); +E void decide_to_shapeshift(struct monst *, int); /* ### mondata.c ### */ -E void FDECL(set_mon_data, (struct monst *, struct permonst *)); -E struct attack *FDECL(attacktype_fordmg, (struct permonst *, int, int)); -E boolean FDECL(attacktype, (struct permonst *, int)); -E boolean FDECL(noattacks, (struct permonst *)); -E boolean FDECL(poly_when_stoned, (struct permonst *)); -E boolean FDECL(resists_drli, (struct monst *)); -E boolean FDECL(resists_magm, (struct monst *)); -E boolean FDECL(resists_blnd, (struct monst *)); -E boolean FDECL(can_blnd, (struct monst *, struct monst *, UCHAR_P, struct obj *)); -E boolean FDECL(ranged_attk, (struct permonst *)); -E boolean FDECL(hates_silver, (struct permonst *)); -E boolean FDECL(mon_hates_silver, (struct monst *)); -E boolean FDECL(mon_hates_light, (struct monst *)); -E boolean FDECL(passes_bars, (struct permonst *)); -E boolean FDECL(can_blow, (struct monst *)); -E boolean FDECL(can_chant, (struct monst *)); -E boolean FDECL(can_be_strangled, (struct monst *)); -E boolean FDECL(can_track, (struct permonst *)); -E boolean FDECL(breakarm, (struct permonst *)); -E boolean FDECL(sliparm, (struct permonst *)); -E boolean FDECL(sticks, (struct permonst *)); -E boolean FDECL(cantvomit, (struct permonst *)); -E int FDECL(num_horns, (struct permonst *)); -/* E boolean FDECL(canseemon, (struct monst *)); */ -E struct attack *FDECL(dmgtype_fromattack, (struct permonst *, int, int)); -E boolean FDECL(dmgtype, (struct permonst *, int)); -E int FDECL(max_passive_dmg, (struct monst *, struct monst *)); -E boolean FDECL(same_race, (struct permonst *, struct permonst *)); -E int FDECL(monsndx, (struct permonst *)); -E int FDECL(name_to_mon, (const char *)); -E int FDECL(name_to_monclass, (const char *, int *)); -E int FDECL(gender, (struct monst *)); -E int FDECL(pronoun_gender, (struct monst *, BOOLEAN_P)); -E boolean FDECL(levl_follower, (struct monst *)); -E int FDECL(little_to_big, (int)); -E int FDECL(big_to_little, (int)); -E const char *FDECL(locomotion, (const struct permonst *, const char *)); -E const char *FDECL(stagger, (const struct permonst *, const char *)); -E const char *FDECL(on_fire, (struct permonst *, struct attack *)); -E const struct permonst *FDECL(raceptr, (struct monst *)); -E boolean FDECL(olfaction, (struct permonst *)); +E void set_mon_data(struct monst *, struct permonst *); +E struct attack *attacktype_fordmg(struct permonst *, int, int); +E boolean attacktype(struct permonst *, int); +E boolean noattacks(struct permonst *); +E boolean poly_when_stoned(struct permonst *); +E boolean resists_drli(struct monst *); +E boolean resists_magm(struct monst *); +E boolean resists_blnd(struct monst *); +E boolean can_blnd(struct monst *, struct monst *, UCHAR_P, struct obj *); +E boolean ranged_attk(struct permonst *); +E boolean hates_silver(struct permonst *); +E boolean mon_hates_silver(struct monst *); +E boolean mon_hates_light(struct monst *); +E boolean passes_bars(struct permonst *); +E boolean can_blow(struct monst *); +E boolean can_chant(struct monst *); +E boolean can_be_strangled(struct monst *); +E boolean can_track(struct permonst *); +E boolean breakarm(struct permonst *); +E boolean sliparm(struct permonst *); +E boolean sticks(struct permonst *); +E boolean cantvomit(struct permonst *); +E int num_horns(struct permonst *); +/* E boolean canseemon(struct monst *); */ +E struct attack *dmgtype_fromattack(struct permonst *, int, int); +E boolean dmgtype(struct permonst *, int); +E int max_passive_dmg(struct monst *, struct monst *); +E boolean same_race(struct permonst *, struct permonst *); +E int monsndx(struct permonst *); +E int name_to_mon(const char *); +E int name_to_monclass(const char *, int *); +E int gender(struct monst *); +E int pronoun_gender(struct monst *, BOOLEAN_P); +E boolean levl_follower(struct monst *); +E int little_to_big(int); +E int big_to_little(int); +E const char *locomotion(const struct permonst *, const char *); +E const char *stagger(const struct permonst *, const char *); +E const char *on_fire(struct permonst *, struct attack *); +E const struct permonst *raceptr(struct monst *); +E boolean olfaction(struct permonst *); extern boolean is_fleshy(const struct permonst *); /* ### monmove.c ### */ -E boolean FDECL(itsstuck, (struct monst *)); -E boolean FDECL(mb_trapped, (struct monst *)); -E boolean FDECL(mon_has_key, (struct monst *, BOOLEAN_P)); -E void FDECL(mon_regen, (struct monst *, BOOLEAN_P)); -E int FDECL(dochugw, (struct monst *)); -E boolean FDECL(onscary, (int, int, struct monst *)); -E void FDECL(monflee, (struct monst *, int, BOOLEAN_P, BOOLEAN_P)); -E int FDECL(dochug, (struct monst *)); -E boolean FDECL(m_digweapon_check, (struct monst *, XCHAR_P, XCHAR_P)); -E int FDECL(m_move, (struct monst *, int)); +E boolean itsstuck(struct monst *); +E boolean mb_trapped(struct monst *); +E boolean mon_has_key(struct monst *, BOOLEAN_P); +E void mon_regen(struct monst *, BOOLEAN_P); +E int dochugw(struct monst *); +E boolean onscary(int, int, struct monst *); +E void monflee(struct monst *, int, BOOLEAN_P, BOOLEAN_P); +E int dochug(struct monst *); +E boolean m_digweapon_check(struct monst *, XCHAR_P, XCHAR_P); +E int m_move(struct monst *, int); extern int m_move_aggress(struct monst *, xchar, xchar); -E boolean FDECL(closed_door, (int, int)); -E boolean FDECL(accessible, (int, int)); -E void FDECL(set_apparxy, (struct monst *)); -E boolean FDECL(can_ooze, (struct monst *)); -E boolean FDECL(can_fog, (struct monst *)); -E boolean FDECL(should_displace, (struct monst *, coord *, long *, int, XCHAR_P, XCHAR_P)); -E boolean FDECL(undesirable_disp, (struct monst *, XCHAR_P, XCHAR_P)); +E boolean closed_door(int, int); +E boolean accessible(int, int); +E void set_apparxy(struct monst *); +E boolean can_ooze(struct monst *); +E boolean can_fog(struct monst *); +E boolean should_displace(struct monst *, coord *, long *, int, XCHAR_P, XCHAR_P); +E boolean undesirable_disp(struct monst *, XCHAR_P, XCHAR_P); /* ### monst.c ### */ -E void NDECL(monst_init); +E void monst_init(); /* ### monstr.c ### */ -E void NDECL(monstr_init); +E void monstr_init(); /* ### mplayer.c ### */ -E struct monst *FDECL(mk_mplayer, (struct permonst *, XCHAR_P, - XCHAR_P, BOOLEAN_P)); -E void FDECL(create_mplayers, (int, BOOLEAN_P)); -E void FDECL(mplayer_talk, (struct monst *)); +E struct monst *mk_mplayer(struct permonst *, XCHAR_P, XCHAR_P, BOOLEAN_P); +E void create_mplayers(int, BOOLEAN_P); +E void mplayer_talk(struct monst *); extern const char* dev_name(); #if defined(MICRO) || defined(WIN32) @@ -1646,249 +1634,249 @@ extern const char* dev_name(); /* ### msdos.c,os2.c,tos.c,winnt.c ### */ # ifndef WIN32 -E int NDECL(tgetch); +E int tgetch(); # endif # ifndef TOS -E char NDECL(switchar); +E char switchar(); # endif # ifndef __GO32__ -E long FDECL(freediskspace, (char *)); +E long freediskspace(char *); # ifdef MSDOS -E int FDECL(findfirst_file, (char *)); -E int NDECL(findnext_file); -E long FDECL(filesize_nh, (char *)); +E int findfirst_file(char *); +E int findnext_file(); +E long filesize_nh(char *); # else -E int FDECL(findfirst, (char *)); -E int NDECL(findnext); -E long FDECL(filesize, (char *)); +E int findfirst(char *); +E int findnext(); +E long filesize(char *); # endif /* MSDOS */ -E char *NDECL(foundfile_buffer); +E char *foundfile_buffer(); # endif /* __GO32__ */ -E void FDECL(chdrive, (char *)); +E void chdrive(char *); # ifndef TOS -E void NDECL(disable_ctrlP); -E void NDECL(enable_ctrlP); +E void disable_ctrlP(); +E void enable_ctrlP(); # endif # if defined(MICRO) && !defined(WINNT) -E void NDECL(get_scr_size); +E void get_scr_size(); # ifndef TOS -E void FDECL(gotoxy, (int, int)); +E void gotoxy(int, int); # endif # endif # ifdef TOS -E int FDECL(_copyfile, (char *, char *)); -E int NDECL(kbhit); -E void NDECL(set_colors); -E void NDECL(restore_colors); +E int _copyfile(char *, char *); +E int kbhit(); +E void set_colors(); +E void restore_colors(); # ifdef SUSPEND -E int NDECL(dosuspend); +E int dosuspend(); # endif # endif /* TOS */ # ifdef WIN32 -E char *FDECL(get_username, (int *)); -E void FDECL(nt_regularize, (char *)); -E int NDECL((*nt_kbhit)); -E void FDECL(Delay, (int)); +E char *get_username(int *); +E void nt_regularize(char *); +E int (*nt_kbhit)(); +E void Delay(int); # endif /* WIN32 */ #endif /* MICRO || WIN32 */ /* ### mthrowu.c ### */ -E int FDECL(thitu, (int, int, struct obj **, const char *)); -E int FDECL(ohitmon, (struct monst *, struct obj *, int, BOOLEAN_P)); -E void FDECL(thrwmu, (struct monst *)); -E int FDECL(spitmu, (struct monst *, struct attack *)); -E int FDECL(breamu, (struct monst *, struct attack *)); -E boolean FDECL(linedup, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, int)); -E boolean FDECL(lined_up, (struct monst *)); -E struct obj *FDECL(m_carrying, (struct monst *, int)); -E int FDECL(thrwmm, (struct monst *, struct monst *)); -E int FDECL(spitmm, (struct monst *, struct attack *, struct monst *)); -E int FDECL(breamm, (struct monst *, struct attack *, struct monst *)); -E void FDECL(m_useupall, (struct monst *, struct obj *)); -E void FDECL(m_useup, (struct monst *, struct obj *)); -E void FDECL(m_throw, (struct monst *, int, int, int, int, int, struct obj *)); -E boolean FDECL(hits_bars, (struct obj **, int, int, int, int, int, int)); -E void FDECL(hit_bars, (struct obj **, int, int, int, int, boolean, boolean)); -E void FDECL(dissolve_bars, (int, int)); +E int thitu(int, int, struct obj **, const char *); +E int ohitmon(struct monst *, struct obj *, int, BOOLEAN_P); +E void thrwmu(struct monst *); +E int spitmu(struct monst *, struct attack *); +E int breamu(struct monst *, struct attack *); +E boolean linedup(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, int); +E boolean lined_up(struct monst *); +E struct obj *m_carrying(struct monst *, int); +E int thrwmm(struct monst *, struct monst *); +E int spitmm(struct monst *, struct attack *, struct monst *); +E int breamm(struct monst *, struct attack *, struct monst *); +E void m_useupall(struct monst *, struct obj *); +E void m_useup(struct monst *, struct obj *); +E void m_throw(struct monst *, int, int, int, int, int, struct obj *); +E boolean hits_bars(struct obj **, int, int, int, int, int, int); +E void hit_bars(struct obj **, int, int, int, int, boolean, boolean); +E void dissolve_bars(int, int); /* ### muse.c ### */ -E boolean FDECL(find_defensive, (struct monst *)); -E int FDECL(use_defensive, (struct monst *)); -E int FDECL(rnd_defensive_item, (struct monst *)); -E boolean FDECL(find_offensive, (struct monst *)); +E boolean find_defensive(struct monst *); +E int use_defensive(struct monst *); +E int rnd_defensive_item(struct monst *); +E boolean find_offensive(struct monst *); #ifdef USE_TRAMPOLI -E int FDECL(mbhitm, (struct monst *, struct obj *)); -#endif -E int FDECL(use_offensive, (struct monst *)); -E int FDECL(rnd_offensive_item, (struct monst *)); -E boolean FDECL(find_misc, (struct monst *)); -E int FDECL(use_misc, (struct monst *)); -E int FDECL(rnd_misc_item, (struct monst *)); -E boolean FDECL(searches_for_item, (struct monst *, struct obj *)); -E boolean FDECL(mon_reflects, (struct monst *, const char *)); -E boolean FDECL(ureflects, (const char *, const char *)); -E void FDECL(mcureblindness, (struct monst *, BOOLEAN_P)); -E boolean FDECL(munstone, (struct monst *, BOOLEAN_P)); -E boolean FDECL(munslime, (struct monst *, BOOLEAN_P)); +E int mbhitm(struct monst *, struct obj *); +#endif +E int use_offensive(struct monst *); +E int rnd_offensive_item(struct monst *); +E boolean find_misc(struct monst *); +E int use_misc(struct monst *); +E int rnd_misc_item(struct monst *); +E boolean searches_for_item(struct monst *, struct obj *); +E boolean mon_reflects(struct monst *, const char *); +E boolean ureflects(const char *, const char *); +E void mcureblindness(struct monst *, BOOLEAN_P); +E boolean munstone(struct monst *, BOOLEAN_P); +E boolean munslime(struct monst *, BOOLEAN_P); /* ### music.c ### */ -E void FDECL(awaken_monsters, (int)); -E void FDECL(do_earthquake, (int)); -E void FDECL(awaken_soldiers, (struct monst *)); -E int FDECL(do_play_instrument, (struct obj *)); +E void awaken_monsters(int); +E void do_earthquake(int); +E void awaken_soldiers(struct monst *); +E int do_play_instrument(struct obj *); /* ### nhlan.c ### */ #ifdef LAN_FEATURES -E void NDECL(init_lan_features); -E char *NDECL(lan_username); +E void init_lan_features(); +E char *lan_username(); # ifdef LAN_MAIL -E boolean NDECL(lan_mail_check); -E void FDECL(lan_mail_read, (struct obj *)); -E void NDECL(lan_mail_init); -E void NDECL(lan_mail_finish); -E void NDECL(lan_mail_terminate); +E boolean lan_mail_check(); +E void lan_mail_read(struct obj *); +E void lan_mail_init(); +E void lan_mail_finish(); +E void lan_mail_terminate(); # endif #endif /* ### nhregex.c ### */ -E struct nhregex *NDECL(regex_init); -E boolean FDECL(regex_compile, (const char *, struct nhregex *)); -E const char *FDECL(regex_error_desc, (struct nhregex *)); -E boolean FDECL(regex_match, (const char *, struct nhregex *)); -E void FDECL(regex_free, (struct nhregex *)); +E struct nhregex *regex_init(); +E boolean regex_compile(const char *, struct nhregex *); +E const char *regex_error_desc(struct nhregex *); +E boolean regex_match(const char *, struct nhregex *); +E void regex_free(struct nhregex *); /* ### nttty.c ### */ #ifdef WIN32CON -E void NDECL(get_scr_size); -E int NDECL(nttty_kbhit); -E void NDECL(nttty_open); -E void NDECL(nttty_rubout); -E int NDECL(tgetch); -E int FDECL(ntposkey, (int *, int *, int *)); -E void FDECL(set_output_mode, (int)); -E void NDECL(synch_cursor); +E void get_scr_size(); +E int nttty_kbhit(); +E void nttty_open(); +E void nttty_rubout(); +E int tgetch(); +E int ntposkey(int *, int *, int *); +E void set_output_mode(int); +E void synch_cursor(); #endif /* ### o_init.c ### */ -E void NDECL(init_objects); -E int NDECL(find_skates); -E void NDECL(oinit); -E void FDECL(savenames, (int, int)); -E void FDECL(restnames, (int)); -E void FDECL(discover_object, (int, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(undiscover_object, (int)); -E int NDECL(dodiscovered); -E void NDECL(dragons_init); -E void FDECL(makeknown_msg, (int)); -E int NDECL(doclassdisco); -E void NDECL(rename_disco); +E void init_objects(); +E int find_skates(); +E void oinit(); +E void savenames(int, int); +E void restnames(int); +E void discover_object(int, BOOLEAN_P, BOOLEAN_P); +E void undiscover_object(int); +E int dodiscovered(); +E void dragons_init(); +E void makeknown_msg(int); +E int doclassdisco(); +E void rename_disco(); /* ### objects.c ### */ -E void NDECL(objects_init); +E void objects_init(); /* ### objnam.c ### */ -E char *FDECL(obj_typename, (int)); -E char *FDECL(simple_typename, (int)); -E char *FDECL(dump_typename, (int)); -E char *FDECL(safe_typename, (int)); -E boolean FDECL(obj_is_pname, (struct obj *)); -E char *FDECL(distant_name, (struct obj *, char *(*)(OBJ_P))); -E char *FDECL(fruitname, (BOOLEAN_P)); -E struct fruit *FDECL(fruit_from_indx, (int)); -E char *FDECL(xname, (struct obj *)); -E char *FDECL(mshot_xname, (struct obj *)); -E boolean FDECL(the_unique_obj, (struct obj *obj)); -E boolean FDECL(the_unique_pm, (struct permonst *)); -E boolean FDECL(erosion_matters, (struct obj *)); +E char *obj_typename(int); +E char *simple_typename(int); +E char *dump_typename(int); +E char *safe_typename(int); +E boolean obj_is_pname(struct obj *); +E char *distant_name(struct obj *, char *(*)(OBJ_P)); +E char *fruitname(BOOLEAN_P); +E struct fruit *fruit_from_indx(int); +E char *xname(struct obj *); +E char *mshot_xname(struct obj *); +E boolean the_unique_obj(struct obj *obj); +E boolean the_unique_pm(struct permonst *); +E boolean erosion_matters(struct obj *); extern long display_weight(struct obj *); -E char *FDECL(doname, (struct obj *)); -E char *FDECL(doname_with_price, (struct obj *)); -E boolean FDECL(not_fully_identified, (struct obj *)); -E char *FDECL(corpse_xname, (struct obj *, const char *, unsigned)); -E char *FDECL(cxname, (struct obj *)); +E char *doname(struct obj *); +E char *doname_with_price(struct obj *); +E boolean not_fully_identified(struct obj *); +E char *corpse_xname(struct obj *, const char *, unsigned); +E char *cxname(struct obj *); #ifdef SORTLOOT -E char *FDECL(cxname_singular, (struct obj *)); +E char *cxname_singular(struct obj *); #endif extern char *cxname_unidentified(struct obj *); -E char *FDECL(killer_xname, (struct obj *)); -E char *FDECL(short_oname, (struct obj *, char *(*)(OBJ_P), char *(*)(OBJ_P), unsigned)); -E const char *FDECL(singular, (struct obj *, char *(*)(OBJ_P))); -E char *FDECL(an, (const char *)); -E char *FDECL(An, (const char *)); -E char *FDECL(The, (const char *)); -E char *FDECL(the, (const char *)); -E char *FDECL(aobjnam, (struct obj *, const char *)); -E char *FDECL(yobjnam, (struct obj *, const char *)); -E char *FDECL(Yobjnam2, (struct obj *, const char *)); -E char *FDECL(Tobjnam, (struct obj *, const char *)); -E char *FDECL(otense, (struct obj *, const char *)); -E char *FDECL(vtense, (const char *, const char *)); -E char *FDECL(Doname2, (struct obj *)); -E char *FDECL(yname, (struct obj *)); -E char *FDECL(Yname2, (struct obj *)); -E char *FDECL(ysimple_name, (struct obj *)); -E char *FDECL(Ysimple_name2, (struct obj *)); -E char *FDECL(simpleonames, (struct obj *)); -E char *FDECL(ansimpleoname, (struct obj *)); -E char *FDECL(thesimpleoname, (struct obj *)); -E char *FDECL(bare_artifactname, (struct obj *)); -E char *FDECL(makeplural, (const char *)); -E char *FDECL(makesingular, (const char *)); +E char *killer_xname(struct obj *); +E char *short_oname(struct obj *, char *(*)(OBJ_P), char *(*)(OBJ_P), unsigned); +E const char *singular(struct obj *, char *(*)(OBJ_P)); +E char *an(const char *); +E char *An(const char *); +E char *The(const char *); +E char *the(const char *); +E char *aobjnam(struct obj *, const char *); +E char *yobjnam(struct obj *, const char *); +E char *Yobjnam2(struct obj *, const char *); +E char *Tobjnam(struct obj *, const char *); +E char *otense(struct obj *, const char *); +E char *vtense(const char *, const char *); +E char *Doname2(struct obj *); +E char *yname(struct obj *); +E char *Yname2(struct obj *); +E char *ysimple_name(struct obj *); +E char *Ysimple_name2(struct obj *); +E char *simpleonames(struct obj *); +E char *ansimpleoname(struct obj *); +E char *thesimpleoname(struct obj *); +E char *bare_artifactname(struct obj *); +E char *makeplural(const char *); +E char *makesingular(const char *); extern short name_to_otyp(const char *); -E struct obj *FDECL(readobjnam, (char *, struct obj *)); -E int FDECL(rnd_class, (int, int)); -E const char *FDECL(suit_simple_name, (struct obj *)); -E const char *FDECL(cloak_simple_name, (struct obj *)); -E const char *FDECL(helm_simple_name, (struct obj *)); -E const char *FDECL(gloves_simple_name, (struct obj *)); -E const char *FDECL(mimic_obj_name, (struct monst *)); -E char *FDECL(safe_qbuf, (char *, const char *, const char *, struct obj *, - char *(*)(OBJ_P), char *(*)(OBJ_P), const char *)); -E int FDECL(shiny_obj, (CHAR_P)); +E struct obj *readobjnam(char *, struct obj *); +E int rnd_class(int, int); +E const char *suit_simple_name(struct obj *); +E const char *cloak_simple_name(struct obj *); +E const char *helm_simple_name(struct obj *); +E const char *gloves_simple_name(struct obj *); +E const char *mimic_obj_name(struct monst *); +E char *safe_qbuf(char *, const char *, const char *, struct obj *, + char *(*)(OBJ_P), char *(*)(OBJ_P), const char *); +E int shiny_obj(CHAR_P); /* ### options.c ### */ -E boolean FDECL(match_optname, (const char *, const char *, int, BOOLEAN_P)); -E void NDECL(initoptions); +E boolean match_optname(const char *, const char *, int, BOOLEAN_P); +E void initoptions(); extern boolean parseoptions(char *, boolean, boolean); -E boolean FDECL(parse_monster_color, (char *)); -E boolean FDECL(parse_symbol, (const char *)); -E boolean FDECL(parse_monster_symbol, (const char *)); -E boolean FDECL(parse_object_symbol, (const char *)); +E boolean parse_monster_color(char *); +E boolean parse_symbol(const char *); +E boolean parse_monster_symbol(const char *); +E boolean parse_object_symbol(const char *); E boolean parse_color_definition(const char *); -E int NDECL(doset); -E int NDECL(dotogglepickup); -E void NDECL(option_help); -E void FDECL(next_opt, (winid, const char *)); -E int FDECL(fruitadd, (char *)); -E int FDECL(choose_classes_menu, (const char *, int, BOOLEAN_P, char *, char *)); +E int doset(); +E int dotogglepickup(); +E void option_help(); +E void next_opt(winid, const char *); +E int fruitadd(char *); +E int choose_classes_menu(const char *, int, BOOLEAN_P, char *, char *); extern boolean parsebindings(char *); -E void FDECL(add_menu_cmd_alias, (CHAR_P, CHAR_P)); -E char FDECL(map_menu_cmd, (CHAR_P)); -E void FDECL(assign_warnings, (uchar *)); -E char *FDECL(nh_getenv, (const char *)); -E void FDECL(set_duplicate_opt_detection, (int)); -E void FDECL(set_wc_option_mod_status, (unsigned long, int)); -E void FDECL(set_wc2_option_mod_status, (unsigned long, int)); -E void FDECL(set_option_mod_status, (const char *, int)); +E void add_menu_cmd_alias(CHAR_P, CHAR_P); +E char map_menu_cmd(CHAR_P); +E void assign_warnings(uchar *); +E char *nh_getenv(const char *); +E void set_duplicate_opt_detection(int); +E void set_wc_option_mod_status(unsigned long, int); +E void set_wc2_option_mod_status(unsigned long, int); +E void set_option_mod_status(const char *, int); #ifdef AUTOPICKUP_EXCEPTIONS -E int FDECL(add_autopickup_exception, (const char *)); -E void NDECL(free_autopickup_exceptions); +E int add_autopickup_exception(const char *); +E void free_autopickup_exceptions(); #endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef MENU_COLOR -E boolean FDECL(add_menu_coloring, (char *)); +E boolean add_menu_coloring(char *); #endif /* MENU_COLOR */ -E void NDECL(free_menu_coloring); -E const char * FDECL(clr2colorname, (int)); -E int FDECL(query_color, (const char *)); -E int FDECL(query_attr, (const char *)); +E void free_menu_coloring(); +E const char * clr2colorname(int); +E int query_color(const char *); +E int query_attr(const char *); #if defined(STATUS_COLORS) && defined(TEXTCOLOR) extern boolean parse_status_color_options(char *); extern void free_status_colors(); @@ -1896,66 +1884,66 @@ extern void free_status_colors(); /* ### pager.c ### */ -E void FDECL(mhidden_description, (struct monst *, BOOLEAN_P, char *)); -E boolean FDECL(object_from_map, (int,int,int,struct obj **)); -E int FDECL(do_screen_description, (coord, BOOLEAN_P, glyph_t, char *, const char **, struct permonst **)); +E void mhidden_description(struct monst *, BOOLEAN_P, char *); +E boolean object_from_map(int,int,int,struct obj **); +E int do_screen_description(coord, BOOLEAN_P, glyph_t, char *, const char **, struct permonst **); extern int do_look(int, coord *); -E int NDECL(dowhatis); -E int NDECL(doquickwhatis); -E int NDECL(doidtrap); -E int NDECL(dowhatdoes); -E char *FDECL(dowhatdoes_core, (CHAR_P, char *)); -E int NDECL(dohelp); -E int NDECL(dohistory); -E void FDECL(checkfile, (struct obj *, char *, struct permonst *, BOOLEAN_P, BOOLEAN_P, char *)); +E int dowhatis(); +E int doquickwhatis(); +E int doidtrap(); +E int dowhatdoes(); +E char *dowhatdoes_core(CHAR_P, char *); +E int dohelp(); +E int dohistory(); +E void checkfile(struct obj *, char *, struct permonst *, BOOLEAN_P, BOOLEAN_P, char *); /* ### pcmain.c ### */ #if defined(MICRO) || defined(WIN32) # ifdef CHDIR -E void FDECL(chdirx, (char *, BOOLEAN_P)); +E void chdirx(char *, BOOLEAN_P); # endif /* CHDIR */ #endif /* MICRO || WIN32 */ /* ### pcsys.c ### */ #if defined(MICRO) || defined(WIN32) -E void NDECL(flushout); -E int NDECL(dosh); +E void flushout(); +E int dosh(); # ifdef MFLOPPY -E void FDECL(eraseall, (const char *, const char *)); -E void FDECL(copybones, (int)); -E void NDECL(playwoRAMdisk); -E int FDECL(saveDiskPrompt, (int)); -E void NDECL(gameDiskPrompt); +E void eraseall(const char *, const char *); +E void copybones(int); +E void playwoRAMdisk(); +E int saveDiskPrompt(int); +E void gameDiskPrompt(); # endif -E void FDECL(append_slash, (char *)); -E void FDECL(getreturn, (const char *)); +E void append_slash(char *); +E void getreturn(const char *); # ifndef AMIGA E void VDECL(msmsg, (const char *, ...)); # endif -E FILE *FDECL(fopenp, (const char *, const char *)); +E FILE *fopenp(const char *, const char *); #endif /* MICRO || WIN32 */ /* ### pctty.c ### */ #if defined(MICRO) || defined(WIN32) -E void NDECL(gettty); -E void FDECL(settty, (const char *)); -E void NDECL(setftty); +E void gettty(); +E void settty(const char *); +E void setftty(); E void VDECL(error, (const char *, ...)); #if defined(TIMED_DELAY) && defined(_MSC_VER) -E void FDECL(msleep, (unsigned)); +E void msleep(unsigned); #endif #endif /* MICRO || WIN32 */ /* ### pcunix.c ### */ #if defined(MICRO) -E void FDECL(regularize, (char *)); +E void regularize(char *); #endif /* MICRO */ #if defined(PC_LOCKING) -E void NDECL(getlock); +E void getlock(); #endif /* ### pickup.c ### */ @@ -1963,47 +1951,44 @@ E void NDECL(getlock); extern int get_most_recently_picked_up_turn(); extern int count_most_recently_picked_up(struct obj *); extern struct obj *find_most_recently_picked_up_obj(struct obj *); -E void FDECL(observe_quantum_cat, (struct obj *, boolean)); -E boolean FDECL(container_gone, (int (*)(OBJ_P))); -E boolean NDECL(u_handsy); -E void FDECL(open_coffin, (struct obj *, boolean)); -E int FDECL(collect_obj_classes, - (char *, struct obj *, BOOLEAN_P, boolean FDECL((*), (OBJ_P)), int *)); -E boolean FDECL(rider_corpse_revival, (struct obj *, BOOLEAN_P)); -E boolean FDECL(menu_class_present, (int)); -E void FDECL(add_valid_menu_class, (int)); -E boolean FDECL(allow_all, (struct obj *)); -E boolean FDECL(allow_category, (struct obj *)); -E boolean FDECL(is_worn_by_type, (struct obj *)); +E void observe_quantum_cat(struct obj *, boolean); +E boolean container_gone(int (*)(OBJ_P)); +E boolean u_handsy(); +E void open_coffin(struct obj *, boolean); +extern int collect_obj_classes(char *, struct obj *, boolean, boolean(*)(struct obj *), int *); +E boolean rider_corpse_revival(struct obj *, BOOLEAN_P); +E boolean menu_class_present(int); +E void add_valid_menu_class(int); +E boolean allow_all(struct obj *); +E boolean allow_category(struct obj *); +E boolean is_worn_by_type(struct obj *); #ifdef USE_TRAMPOLI -E int FDECL(ck_bag, (struct obj *)); -E int FDECL(in_container, (struct obj *)); -E int FDECL(out_container, (struct obj *)); -#endif -E int FDECL(pickup, (int)); -E int FDECL(pickup_object, (struct obj *, long, BOOLEAN_P)); -E int FDECL(query_category, (const char *, struct obj *, int, - menu_item **, int)); -E int FDECL(query_objlist, (const char *, struct obj *, int, - menu_item **, int, boolean (*)(OBJ_P))); -E struct obj *FDECL(pick_obj, (struct obj *)); -E int NDECL(encumber_msg); -E int FDECL(container_at, (int, int, BOOLEAN_P)); -E int NDECL(doloot); -E int NDECL(dotip); -E int FDECL(use_container, (struct obj **, int, BOOLEAN_P)); -E int FDECL(loot_mon, (struct monst *, int *, boolean *)); -E boolean FDECL(is_autopickup_exception, (struct obj *, BOOLEAN_P)); -E boolean FDECL(autopick_testobj, (struct obj *, BOOLEAN_P)); +E int ck_bag(struct obj *); +E int in_container(struct obj *); +E int out_container(struct obj *); +#endif +E int pickup(int); +E int pickup_object(struct obj *, long, BOOLEAN_P); +extern int query_category(const char *, struct obj *, int, menu_item **, int); +extern int query_objlist(const char *, struct obj *, int, menu_item **, int, boolean (*)(OBJ_P)); +E struct obj *pick_obj(struct obj *); +E int encumber_msg(); +E int container_at(int, int, BOOLEAN_P); +E int doloot(); +E int dotip(); +E int use_container(struct obj **, int, BOOLEAN_P); +E int loot_mon(struct monst *, int *, boolean *); +E boolean is_autopickup_exception(struct obj *, BOOLEAN_P); +E boolean autopick_testobj(struct obj *, BOOLEAN_P); /* ### pline.c ### */ -E void FDECL(msgpline_add, (int, char *)); -E void NDECL(msgpline_free); +E void msgpline_add(int, char *); +E void msgpline_free(); E void VDECL(pline, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(custompline, (unsigned, const char *, ...)) PRINTF_F(2, 3); E void VDECL(Norep, (const char *, ...)) PRINTF_F(1, 2); -E void NDECL(free_youbuf); +E void free_youbuf(); E void VDECL(You, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(Your, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(You_feel, (const char *, ...)) PRINTF_F(1, 2); @@ -2016,65 +2001,65 @@ E void VDECL(verbalize, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(raw_printf, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(impossible, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(warning, (const char *, ...)) PRINTF_F(1, 2); -E const char *FDECL(align_str, (ALIGNTYP_P)); -E void FDECL(mstatusline, (struct monst *)); -E void NDECL(ustatusline); -E void NDECL(self_invis_message); +E const char *align_str(ALIGNTYP_P); +E void mstatusline(struct monst *); +E void ustatusline(); +E void self_invis_message(); /* ### polyself.c ### */ -E void NDECL(init_uasmon); -E void NDECL(set_uasmon); -E void NDECL(float_vs_flight); -E void NDECL(change_sex); -E void FDECL(polyself, (BOOLEAN_P)); -E int FDECL(polymon, (int)); -E void NDECL(rehumanize); -E int NDECL(dobreathe); -E int NDECL(dospit); -E int NDECL(doremove); -E int NDECL(dospinweb); -E int NDECL(dosummon); -E int NDECL(dogaze); -E int NDECL(dohide); -E int NDECL(domindblast); -E void NDECL(uunstick); -E void FDECL(skinback, (BOOLEAN_P)); -E const char *FDECL(mbodypart, (struct monst *, int)); -E const char *FDECL(body_part, (int)); -E int NDECL(poly_gender); -E void FDECL(ugolemeffects, (int, int)); -E boolean NDECL(is_playermon_genocided); -E boolean NDECL(ugenocided); -E const char *NDECL(udeadinside); +E void init_uasmon(); +E void set_uasmon(); +E void float_vs_flight(); +E void change_sex(); +E void polyself(BOOLEAN_P); +E int polymon(int); +E void rehumanize(); +E int dobreathe(); +E int dospit(); +E int doremove(); +E int dospinweb(); +E int dosummon(); +E int dogaze(); +E int dohide(); +E int domindblast(); +E void uunstick(); +E void skinback(BOOLEAN_P); +E const char *mbodypart(struct monst *, int); +E const char *body_part(int); +E int poly_gender(); +E void ugolemeffects(int, int); +E boolean is_playermon_genocided(); +E boolean ugenocided(); +E const char *udeadinside(); /* ### potion.c ### */ -E void FDECL(set_itimeout, (long *, long)); -E void FDECL(incr_itimeout, (long *, int)); -E void FDECL(make_confused, (long, BOOLEAN_P)); -E void FDECL(make_stunned, (long, BOOLEAN_P)); -E void FDECL(make_blinded, (long, BOOLEAN_P)); -E void FDECL(make_sick, (long, const char *, BOOLEAN_P, int)); -E void FDECL(make_slimed, (long, const char *)); -E void FDECL(make_stoned, (long, const char *, int, const char *)); -E void FDECL(make_vomiting, (long, BOOLEAN_P)); -E void NDECL(toggle_blindness); -E boolean FDECL(make_hallucinated, (long, BOOLEAN_P, long)); -E void FDECL(make_glib, (int)); -E int NDECL(dodrink); -E int FDECL(dopotion, (struct obj *)); -E int FDECL(peffects, (struct obj *)); -E void FDECL(healup, (int, int, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(strange_feeling, (struct obj *, const char *)); -E void FDECL(potionhit, (struct monst *, struct obj *, int)); -E void FDECL(potionbreathe, (struct obj *)); -E boolean FDECL(get_wet, (struct obj *)); -E int NDECL(dodip); -E void FDECL(mongrantswish, (struct monst **)); -E void FDECL(djinni_from_bottle, (struct obj *)); -E struct monst *FDECL(split_mon, (struct monst *, struct monst *)); -E const char *NDECL(bottlename); +E void set_itimeout(long *, long); +E void incr_itimeout(long *, int); +E void make_confused(long, BOOLEAN_P); +E void make_stunned(long, BOOLEAN_P); +E void make_blinded(long, BOOLEAN_P); +E void make_sick(long, const char *, BOOLEAN_P, int); +E void make_slimed(long, const char *); +E void make_stoned(long, const char *, int, const char *); +E void make_vomiting(long, BOOLEAN_P); +E void toggle_blindness(); +E boolean make_hallucinated(long, BOOLEAN_P, long); +E void make_glib(int); +E int dodrink(); +E int dopotion(struct obj *); +E int peffects(struct obj *); +E void healup(int, int, BOOLEAN_P, BOOLEAN_P); +E void strange_feeling(struct obj *, const char *); +E void potionhit(struct monst *, struct obj *, int); +E void potionbreathe(struct obj *); +E boolean get_wet(struct obj *); +E int dodip(); +E void mongrantswish(struct monst **); +E void djinni_from_bottle(struct obj *); +E struct monst *split_mon(struct monst *, struct monst *); +E const char *bottlename(); extern boolean is_dark_mix_color(struct obj *); extern boolean is_colorless_mix_potion(struct obj *); extern const char* get_base_mix_color(struct obj *); @@ -2083,428 +2068,428 @@ extern short mixtype(struct obj *, struct obj *); /* ### pray.c ### */ #ifdef USE_TRAMPOLI -E int NDECL(prayer_done); -#endif -E int NDECL(dosacrifice); -E boolean FDECL(can_pray, (BOOLEAN_P)); -E int NDECL(dopray); -E const char *NDECL(u_gname); -E int NDECL(doturn); -E int FDECL(altarmask_at, (int, int)); -E const char *NDECL(a_gname); -E const char *FDECL(a_gname_at, (XCHAR_P x, XCHAR_P y)); -E const char *FDECL(align_gname, (ALIGNTYP_P)); -E const char *FDECL(halu_gname, (ALIGNTYP_P)); -E const char *FDECL(rnd_gname, (int)); -E const char *FDECL(align_gtitle, (ALIGNTYP_P)); -E void FDECL(altar_wrath, (int, int)); +E int prayer_done(); +#endif +E int dosacrifice(); +E boolean can_pray(BOOLEAN_P); +E int dopray(); +E const char *u_gname(); +E int doturn(); +E int altarmask_at(int, int); +E const char *a_gname(); +E const char *a_gname_at(XCHAR_P x, XCHAR_P y); +E const char *align_gname(ALIGNTYP_P); +E const char *halu_gname(ALIGNTYP_P); +E const char *rnd_gname(int); +E const char *align_gtitle(ALIGNTYP_P); +E void altar_wrath(int, int); #ifdef ASTRAL_ESCAPE -E int FDECL(invoke_amulet, (struct obj *)); +E int invoke_amulet(struct obj *); #endif -E int NDECL(in_trouble); +E int in_trouble(); extern void msg_luck_change(int change); /* ### priest.c ### */ -E int FDECL(move_special, (struct monst *, BOOLEAN_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); -E char FDECL(temple_occupied, (char *)); -E boolean FDECL(inhistemple, (struct monst *)); -E int FDECL(pri_move, (struct monst *)); -E void FDECL(priestini, (d_level *, struct mkroom *, int, int, BOOLEAN_P)); -E aligntyp FDECL(mon_aligntyp, (struct monst *)); -E char *FDECL(priestname, (struct monst *, char *)); -E boolean FDECL(p_coaligned, (struct monst *)); -E struct monst *FDECL(findpriest, (CHAR_P)); -E void FDECL(intemple, (int)); -E void FDECL(forget_temple_entry, (struct monst *)); -E void FDECL(priest_talk, (struct monst *)); -E struct monst *FDECL(mk_roamer, (struct permonst *, ALIGNTYP_P, - XCHAR_P, XCHAR_P, BOOLEAN_P)); -E void FDECL(reset_hostility, (struct monst *)); -E boolean FDECL(in_your_sanctuary, (struct monst *, XCHAR_P, XCHAR_P)); -E void FDECL(ghod_hitsu, (struct monst *)); -E void NDECL(angry_priest); -E void NDECL(clearpriests); -E void FDECL(restpriest, (struct monst *, BOOLEAN_P)); -E void FDECL(newepri, (struct monst *)); -E void FDECL(free_epri, (struct monst *)); -E char *FDECL(piousness, (BOOLEAN_P, const char *)); +E int move_special(struct monst *, BOOLEAN_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P, + XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); +E char temple_occupied(char *); +E boolean inhistemple(struct monst *); +E int pri_move(struct monst *); +E void priestini(d_level *, struct mkroom *, int, int, BOOLEAN_P); +E aligntyp mon_aligntyp(struct monst *); +E char *priestname(struct monst *, char *); +E boolean p_coaligned(struct monst *); +E struct monst *findpriest(CHAR_P); +E void intemple(int); +E void forget_temple_entry(struct monst *); +E void priest_talk(struct monst *); +E struct monst *mk_roamer(struct permonst *, ALIGNTYP_P, + XCHAR_P, XCHAR_P, BOOLEAN_P); +E void reset_hostility(struct monst *); +E boolean in_your_sanctuary(struct monst *, XCHAR_P, XCHAR_P); +E void ghod_hitsu(struct monst *); +E void angry_priest(); +E void clearpriests(); +E void restpriest(struct monst *, BOOLEAN_P); +E void newepri(struct monst *); +E void free_epri(struct monst *); +E char *piousness(BOOLEAN_P, const char *); /* ### quest.c ### */ -E void NDECL(onquest); -E void NDECL(nemdead); -E void NDECL(artitouch); -E boolean NDECL(ok_to_quest); -E void FDECL(leader_speaks, (struct monst *)); -E void NDECL(nemesis_speaks); -E void FDECL(quest_chat, (struct monst *)); -E void FDECL(quest_talk, (struct monst *)); -E void FDECL(quest_stat_check, (struct monst *)); -E void FDECL(finish_quest, (struct obj *)); +E void onquest(); +E void nemdead(); +E void artitouch(); +E boolean ok_to_quest(); +E void leader_speaks(struct monst *); +E void nemesis_speaks(); +E void quest_chat(struct monst *); +E void quest_talk(struct monst *); +E void quest_stat_check(struct monst *); +E void finish_quest(struct obj *); /* ### questpgr.c ### */ -E void NDECL(load_qtlist); -E void NDECL(unload_qtlist); -E short FDECL(quest_info, (int)); -E const char *NDECL(ldrname); -E boolean FDECL(is_quest_artifact, (struct obj*)); -E void FDECL(com_pager, (int)); -E void FDECL(qt_pager, (int)); -E char *FDECL(string_subst, (char *)); -E void FDECL(qt_com_firstline, (int, char*)); -E void NDECL(deliver_splev_message); +E void load_qtlist(); +E void unload_qtlist(); +E short quest_info(int); +E const char *ldrname(); +E boolean is_quest_artifact(struct obj*); +E void com_pager(int); +E void qt_pager(int); +E char *string_subst(char *); +E void qt_com_firstline(int, char*); +E void deliver_splev_message(); /* ### random.c ### */ #if defined(RANDOM) && !defined(__GO32__) /* djgpp has its own random */ -E void FDECL(srandom, (unsigned)); -E char *FDECL(initstate, (unsigned, char *, int)); -E char *FDECL(setstate, (char *)); -E long NDECL(random); +E void srandom(unsigned); +E char *initstate(unsigned, char *, int); +E char *setstate(char *); +E long random(); #endif /* RANDOM */ /* ### read.c ### */ -E void FDECL(learn_scroll, (struct obj *)); -E char *FDECL(tshirt_text, (struct obj *, char *)); +E void learn_scroll(struct obj *); +E char *tshirt_text(struct obj *, char *); extern char *hawaiian_motif(struct obj *, char *); extern char *apron_text(struct obj *, char *); -E int NDECL(doread); -E boolean FDECL(is_chargeable, (struct obj *)); -E void FDECL(recharge, (struct obj *, int)); -E void FDECL(forget_objects, (int)); -E void FDECL(forget_levels, (int)); -E void NDECL(forget_traps); -E void FDECL(forget_map, (int)); -E int FDECL(seffects, (struct obj *)); +E int doread(); +E boolean is_chargeable(struct obj *); +E void recharge(struct obj *, int); +E void forget_objects(int); +E void forget_levels(int); +E void forget_traps(); +E void forget_map(int); +E int seffects(struct obj *); #ifdef USE_TRAMPOLI -E void FDECL(set_lit, (int, int, genericptr_t)); +E void set_lit(int, int, genericptr_t); #endif -E void FDECL(litroom, (BOOLEAN_P, struct obj *)); -E void FDECL(do_genocide, (int, BOOLEAN_P)); -E void FDECL(punish, (struct obj *)); -E void NDECL(unpunish); -E boolean FDECL(cant_revive, (int *, BOOLEAN_P, struct obj *)); +E void litroom(BOOLEAN_P, struct obj *); +E void do_genocide(int, BOOLEAN_P); +E void punish(struct obj *); +E void unpunish(); +E boolean cant_revive(int *, BOOLEAN_P, struct obj *); #ifdef WIZARD -E boolean NDECL(create_particular); +E boolean create_particular(); #endif -E void FDECL(drop_boulder_on_player, (BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); -E int FDECL(drop_boulder_on_monster, (int, int, BOOLEAN_P, BOOLEAN_P)); +E void drop_boulder_on_player(BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +E int drop_boulder_on_monster(int, int, BOOLEAN_P, BOOLEAN_P); extern boolean create_particular_from_buffer(const char*); /* ### rect.c ### */ -E void NDECL(init_rect); -E NhRect *FDECL(get_rect, (NhRect *)); -E NhRect *NDECL(rnd_rect); -E void FDECL(remove_rect, (NhRect *)); -E void FDECL(add_rect, (NhRect *)); -E void FDECL(split_rects, (NhRect *, NhRect *)); +E void init_rect(); +E NhRect *get_rect(NhRect *); +E NhRect *rnd_rect(); +E void remove_rect(NhRect *); +E void add_rect(NhRect *); +E void split_rects(NhRect *, NhRect *); /* ## region.c ### */ -E void NDECL(clear_regions); -E void NDECL(run_regions); -E boolean FDECL(in_out_region, (XCHAR_P, XCHAR_P)); -E boolean FDECL(m_in_out_region, (struct monst *, XCHAR_P, XCHAR_P)); -E void NDECL(update_player_regions); -E void FDECL(update_monster_region, (struct monst *)); -E NhRegion *FDECL(visible_region_at, (XCHAR_P, XCHAR_P)); -E void FDECL(show_region, (NhRegion*, XCHAR_P, XCHAR_P)); -E void FDECL(save_regions, (int, int)); -E void FDECL(rest_regions, (int, BOOLEAN_P)); -E NhRegion* FDECL(create_gas_cloud, (XCHAR_P, XCHAR_P, int, size_t, int)); -E NhRegion* FDECL(create_cthulhu_death_cloud, (XCHAR_P, XCHAR_P, int, size_t, int)); -E boolean NDECL(region_danger); -E void NDECL(region_safety); +E void clear_regions(); +E void run_regions(); +E boolean in_out_region(XCHAR_P, XCHAR_P); +E boolean m_in_out_region(struct monst *, XCHAR_P, XCHAR_P); +E void update_player_regions(); +E void update_monster_region(struct monst *); +E NhRegion *visible_region_at(XCHAR_P, XCHAR_P); +E void show_region(NhRegion*, XCHAR_P, XCHAR_P); +E void save_regions(int, int); +E void rest_regions(int, BOOLEAN_P); +E NhRegion* create_gas_cloud(XCHAR_P, XCHAR_P, int, size_t, int); +E NhRegion* create_cthulhu_death_cloud(XCHAR_P, XCHAR_P, int, size_t, int); +E boolean region_danger(); +E void region_safety(); /* ### restore.c ### */ -E void FDECL(inven_inuse, (BOOLEAN_P)); -E int FDECL(dorecover, (int)); -E void FDECL(restcemetery, (int, struct cemetery **)); -E void FDECL(trickery, (char *)); -E void FDECL(getlev, (int, int, XCHAR_P, BOOLEAN_P)); -E void NDECL(minit); -E boolean FDECL(lookup_id_mapping, (unsigned, unsigned *)); +E void inven_inuse(BOOLEAN_P); +E int dorecover(int); +E void restcemetery(int, struct cemetery **); +E void trickery(char *); +E void getlev(int, int, XCHAR_P, BOOLEAN_P); +E void minit(); +E boolean lookup_id_mapping(unsigned, unsigned *); #ifdef ZEROCOMP -E int FDECL(mread, (int, genericptr_t, unsigned int)); +E int mread(int, genericptr_t, unsigned int); #else -E void FDECL(mread, (int, genericptr_t, unsigned int)); +E void mread(int, genericptr_t, unsigned int); #endif /* ### rip.c ### */ -E void FDECL(genl_outrip, (winid, int)); +E void genl_outrip(winid, int); /* ### rnd.c ### */ -E int FDECL(rn2, (int)); -E int FDECL(rnl, (int)); -E int FDECL(rnd, (int)); -E int FDECL(d, (int, int)); -E int FDECL(rne, (int)); -E int FDECL(rnz, (int)); -E int FDECL(rnf, (int, int)); +E int rn2(int); +E int rnl(int); +E int rnd(int); +E int d(int, int); +E int rne(int); +E int rnz(int); +E int rnf(int, int); /* ### role.c ### */ -E boolean FDECL(validrole, (int)); -E boolean FDECL(validrace, (int, int)); -E boolean FDECL(validgend, (int, int, int)); -E boolean FDECL(validalign, (int, int, int)); -E int NDECL(randrole); -E int FDECL(randrace, (int)); -E int FDECL(randgend, (int, int)); -E int FDECL(randalign, (int, int)); +E boolean validrole(int); +E boolean validrace(int, int); +E boolean validgend(int, int, int); +E boolean validalign(int, int, int); +E int randrole(); +E int randrace(int); +E int randgend(int, int); +E int randalign(int, int); extern int str2role(const char *); extern int str2race(const char *); extern int str2gend(const char *); extern int str2align(const char *); -E boolean FDECL(ok_role, (int, int, int, int)); -E int FDECL(pick_role, (int, int, int, int)); -E boolean FDECL(ok_race, (int, int, int, int)); -E int FDECL(pick_race, (int, int, int, int)); -E boolean FDECL(ok_gend, (int, int, int, int)); -E int FDECL(pick_gend, (int, int, int, int)); -E boolean FDECL(ok_align, (int, int, int, int)); -E int FDECL(pick_align, (int, int, int, int)); -E void FDECL(role_selection_prolog, (int, winid)); -E void FDECL(role_menu_extra, (int, winid, BOOLEAN_P)); -E void NDECL(role_init); -E void NDECL(rigid_role_checks); -E boolean FDECL(setrolefilter, (const char *)); -E boolean NDECL(gotrolefilter); -E void NDECL(clearrolefilter); -E void NDECL(plnamesuffix); -E const char *FDECL(Hello, (struct monst *)); -E const char *NDECL(Goodbye); -E char *FDECL(build_plselection_prompt, (char *, int, int, int, int, int)); -E char *FDECL(root_plselection_prompt, (char *, int, int, int, int, int)); -E void FDECL(violated, (int)); -E boolean FDECL(successful_cdt, (int)); -E boolean FDECL(intended_cdt, (int)); -E boolean FDECL(superfluous_cdt, (int)); -E boolean FDECL(failed_cdt, (int)); +E boolean ok_role(int, int, int, int); +E int pick_role(int, int, int, int); +E boolean ok_race(int, int, int, int); +E int pick_race(int, int, int, int); +E boolean ok_gend(int, int, int, int); +E int pick_gend(int, int, int, int); +E boolean ok_align(int, int, int, int); +E int pick_align(int, int, int, int); +E void role_selection_prolog(int, winid); +E void role_menu_extra(int, winid, BOOLEAN_P); +E void role_init(); +E void rigid_role_checks(); +E boolean setrolefilter(const char *); +E boolean gotrolefilter(); +E void clearrolefilter(); +E void plnamesuffix(); +E const char *Hello(struct monst *); +E const char *Goodbye(); +E char *build_plselection_prompt(char *, int, int, int, int, int); +E char *root_plselection_prompt(char *, int, int, int, int, int); +E void violated(int); +E boolean successful_cdt(int); +E boolean intended_cdt(int); +E boolean superfluous_cdt(int); +E boolean failed_cdt(int); /* ### rumors.c ### */ -E char *FDECL(getrumor, (int, char *, BOOLEAN_P)); -E void FDECL(outrumor, (int, int)); -E void FDECL(outoracle, (BOOLEAN_P, BOOLEAN_P)); -E void FDECL(save_oracles, (int, int)); -E void FDECL(restore_oracles, (int)); -E int FDECL(doconsult, (struct monst *)); +E char *getrumor(int, char *, BOOLEAN_P); +E void outrumor(int, int); +E void outoracle(BOOLEAN_P, BOOLEAN_P); +E void save_oracles(int, int); +E void restore_oracles(int); +E int doconsult(struct monst *); /* ### save.c ### */ -E int NDECL(dosave); +E int dosave(); #if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32) -E void FDECL(hangup, (int)); +E void hangup(int); #endif -E int NDECL(dosave0); +E int dosave0(); #ifdef INSURANCE -E void NDECL(savestateinlock); +E void savestateinlock(); #endif #ifdef MFLOPPY -E boolean FDECL(savelev, (int, XCHAR_P, int)); -E boolean FDECL(swapin_file, (int)); -E void NDECL(co_false); +E boolean savelev(int, XCHAR_P, int); +E boolean swapin_file(int); +E void co_false(); #else -E void FDECL(savelev, (int, XCHAR_P, int)); -#endif -E void FDECL(bufon, (int)); -E void FDECL(bufoff, (int)); -E void FDECL(bflush, (int)); -E void FDECL(bwrite, (int, genericptr_t, unsigned int)); -E void FDECL(bclose, (int)); -E void FDECL(savecemetery, (int, int, struct cemetery **)); -E void FDECL(savefruitchn, (int, int)); -E void NDECL(free_dungeons); -E void NDECL(freedynamicdata); +E void savelev(int, XCHAR_P, int); +#endif +E void bufon(int); +E void bufoff(int); +E void bflush(int); +E void bwrite(int, genericptr_t, unsigned int); +E void bclose(int); +E void savecemetery(int, int, struct cemetery **); +E void savefruitchn(int, int); +E void free_dungeons(); +E void freedynamicdata(); /* ### shk.c ### */ -E void FDECL(neweshk, (struct monst *)); -E void FDECL(free_eshk, (struct monst *)); -E long FDECL(money2mon, (struct monst *, long)); -E void FDECL(money2u, (struct monst *, long)); -E char *FDECL(Shknam, (struct monst *)); -E char *FDECL(shkname, (struct monst *)); -E void FDECL(shkgone, (struct monst *)); -E void FDECL(set_residency, (struct monst *, BOOLEAN_P)); -E void FDECL(replshk, (struct monst *, struct monst *)); -E void FDECL(restshk, (struct monst *, BOOLEAN_P)); -E char FDECL(inside_shop, (XCHAR_P, XCHAR_P)); -E void FDECL(u_left_shop, (char *, BOOLEAN_P)); -E void FDECL(remote_burglary, (XCHAR_P, XCHAR_P)); -E void FDECL(u_entered_shop, (char *)); -E void FDECL(pick_pick, (struct obj *)); -E boolean FDECL(same_price, (struct obj *, struct obj *)); -E void NDECL(shopper_financial_report); -E int FDECL(inhishop, (struct monst *)); -E struct monst *FDECL(shop_keeper, (CHAR_P)); -E boolean FDECL(tended_shop, (struct mkroom *)); -E boolean FDECL(is_unpaid, (struct obj *)); -E void FDECL(delete_contents, (struct obj *)); -E void FDECL(obfree, (struct obj *, struct obj *)); -E void FDECL(home_shk, (struct monst *, BOOLEAN_P)); -E void FDECL(make_happy_shk, (struct monst *, BOOLEAN_P)); -E void FDECL(make_happy_shoppers, (BOOLEAN_P)); -E void FDECL(hot_pursuit, (struct monst *)); -E void FDECL(make_angry_shk, (struct monst *, XCHAR_P, XCHAR_P)); -E int NDECL(dopay); -E boolean FDECL(paybill, (int, BOOLEAN_P)); -E void NDECL(finish_paybill); -E struct obj *FDECL(find_oid, (unsigned)); -E long FDECL(contained_cost, (struct obj *, struct monst *, long, BOOLEAN_P, BOOLEAN_P)); -E long FDECL(contained_gold, (struct obj *)); -E void FDECL(picked_container, (struct obj *)); -E void FDECL(alter_cost, (struct obj *, long)); -E long FDECL(unpaid_cost, (struct obj *, BOOLEAN_P)); -E boolean FDECL(billable, (struct monst **, struct obj *, CHAR_P, BOOLEAN_P)); -E void FDECL(addtobill, (struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(append_honorific, (char *)); -E void FDECL(splitbill, (struct obj *, struct obj *)); -E void FDECL(subfrombill, (struct obj *, struct monst *)); -E long FDECL(stolen_value, (struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(sellobj_state, (int)); -E void FDECL(sellobj, (struct obj *, XCHAR_P, XCHAR_P)); -E int FDECL(doinvbill, (int)); -E struct monst *FDECL(shkcatch, (struct obj *, XCHAR_P, XCHAR_P)); -E void FDECL(add_damage, (XCHAR_P, XCHAR_P, long)); -E int FDECL(repair_damage, (struct monst *, struct damage *, BOOLEAN_P)); -E int FDECL(shk_move, (struct monst *)); -E void FDECL(after_shk_move, (struct monst *)); -E boolean FDECL(is_fshk, (struct monst *)); -E void FDECL(shopdig, (int)); -E void FDECL(pay_for_damage, (const char *, BOOLEAN_P)); -E boolean FDECL(costly_spot, (XCHAR_P, XCHAR_P)); -E struct obj *FDECL(shop_object, (XCHAR_P, XCHAR_P)); -E void FDECL(price_quote, (struct obj *)); -E void FDECL(shk_chat, (struct monst *)); -E void FDECL(check_unpaid_usage, (struct obj *, BOOLEAN_P)); -E void FDECL(check_unpaid, (struct obj *)); -E void FDECL(costly_gold, (XCHAR_P, XCHAR_P, long)); -E long FDECL(get_cost_of_shop_item, (struct obj *)); -E int FDECL(oid_price_adjustment, (struct obj *, unsigned)); -E boolean FDECL(block_door, (XCHAR_P, XCHAR_P)); -E boolean FDECL(block_entry, (XCHAR_P, XCHAR_P)); +E void neweshk(struct monst *); +E void free_eshk(struct monst *); +E long money2mon(struct monst *, long); +E void money2u(struct monst *, long); +E char *Shknam(struct monst *); +E char *shkname(struct monst *); +E void shkgone(struct monst *); +E void set_residency(struct monst *, BOOLEAN_P); +E void replshk(struct monst *, struct monst *); +E void restshk(struct monst *, BOOLEAN_P); +E char inside_shop(XCHAR_P, XCHAR_P); +E void u_left_shop(char *, BOOLEAN_P); +E void remote_burglary(XCHAR_P, XCHAR_P); +E void u_entered_shop(char *); +E void pick_pick(struct obj *); +E boolean same_price(struct obj *, struct obj *); +E void shopper_financial_report(); +E int inhishop(struct monst *); +E struct monst *shop_keeper(CHAR_P); +E boolean tended_shop(struct mkroom *); +E boolean is_unpaid(struct obj *); +E void delete_contents(struct obj *); +E void obfree(struct obj *, struct obj *); +E void home_shk(struct monst *, BOOLEAN_P); +E void make_happy_shk(struct monst *, BOOLEAN_P); +E void make_happy_shoppers(BOOLEAN_P); +E void hot_pursuit(struct monst *); +E void make_angry_shk(struct monst *, XCHAR_P, XCHAR_P); +E int dopay(); +E boolean paybill(int, BOOLEAN_P); +E void finish_paybill(); +E struct obj *find_oid(unsigned); +E long contained_cost(struct obj *, struct monst *, long, BOOLEAN_P, BOOLEAN_P); +E long contained_gold(struct obj *); +E void picked_container(struct obj *); +E void alter_cost(struct obj *, long); +E long unpaid_cost(struct obj *, BOOLEAN_P); +E boolean billable(struct monst **, struct obj *, CHAR_P, BOOLEAN_P); +E void addtobill(struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +E void append_honorific(char *); +E void splitbill(struct obj *, struct obj *); +E void subfrombill(struct obj *, struct monst *); +E long stolen_value(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P, BOOLEAN_P); +E void sellobj_state(int); +E void sellobj(struct obj *, XCHAR_P, XCHAR_P); +E int doinvbill(int); +E struct monst *shkcatch(struct obj *, XCHAR_P, XCHAR_P); +E void add_damage(XCHAR_P, XCHAR_P, long); +E int repair_damage(struct monst *, struct damage *, BOOLEAN_P); +E int shk_move(struct monst *); +E void after_shk_move(struct monst *); +E boolean is_fshk(struct monst *); +E void shopdig(int); +E void pay_for_damage(const char *, BOOLEAN_P); +E boolean costly_spot(XCHAR_P, XCHAR_P); +E struct obj *shop_object(XCHAR_P, XCHAR_P); +E void price_quote(struct obj *); +E void shk_chat(struct monst *); +E void check_unpaid_usage(struct obj *, BOOLEAN_P); +E void check_unpaid(struct obj *); +E void costly_gold(XCHAR_P, XCHAR_P, long); +E long get_cost_of_shop_item(struct obj *); +E int oid_price_adjustment(struct obj *, unsigned); +E boolean block_door(XCHAR_P, XCHAR_P); +E boolean block_entry(XCHAR_P, XCHAR_P); #ifdef BLACKMARKET -E void FDECL(blkmar_guards, (struct monst *)); -E void NDECL(set_black_marketeer_angry); -E void FDECL(bars_around_portal, (BOOLEAN_P)); +E void blkmar_guards(struct monst *); +E void set_black_marketeer_angry(); +E void bars_around_portal(BOOLEAN_P); #endif /* BLACKMARKET */ -E char *FDECL(shk_your, (char *, struct obj *)); -E char *FDECL(Shk_Your, (char *, struct obj *)); +E char *shk_your(char *, struct obj *); +E char *Shk_Your(char *, struct obj *); extern void sanity_check_shopkeepers(); /* ### shknam.c ### */ -E void FDECL(stock_room, (int, struct mkroom *)); -E boolean FDECL(saleable, (struct monst *, struct obj *)); -E int FDECL(get_shop_item, (int)); -E void NDECL(shop_selection_init); -E boolean FDECL(is_izchak, (struct monst *, BOOLEAN_P)); +E void stock_room(int, struct mkroom *); +E boolean saleable(struct monst *, struct obj *); +E int get_shop_item(int); +E void shop_selection_init(); +E boolean is_izchak(struct monst *, BOOLEAN_P); /* ### sit.c ### */ -E void NDECL(take_gold); -E int NDECL(dosit); -E void NDECL(rndcurse); -E void NDECL(attrcurse); +E void take_gold(); +E int dosit(); +E void rndcurse(); +E void attrcurse(); /* ### sounds.c ### */ -E void NDECL(dosounds); -E const char *FDECL(growl_sound, (struct monst *)); -E void FDECL(growl, (struct monst *)); -E void FDECL(yelp, (struct monst *)); -E void FDECL(whimper, (struct monst *)); -E void FDECL(beg, (struct monst *)); -E int NDECL(dotalk); +E void dosounds(); +E const char *growl_sound(struct monst *); +E void growl(struct monst *); +E void yelp(struct monst *); +E void whimper(struct monst *); +E void beg(struct monst *); +E int dotalk(); #ifdef USER_SOUNDS -E int FDECL(add_sound_mapping, (const char *)); -E void FDECL(play_sound_for_message, (const char *)); +E int add_sound_mapping(const char *); +E void play_sound_for_message(const char *); #endif /* ### sys/msdos/sound.c ### */ #ifdef MSDOS -E int FDECL(assign_soundcard, (char *)); +E int assign_soundcard(char *); #endif /* ### sp_lev.c ### */ -E boolean FDECL(check_room, (xchar *, xchar *, xchar *, xchar *, BOOLEAN_P)); -E boolean FDECL(create_room, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); -E void FDECL(create_secret_door, (struct mkroom *, XCHAR_P)); -E boolean FDECL(dig_corridor, (coord *, coord *, BOOLEAN_P, SCHAR_P, SCHAR_P)); -E void FDECL(fill_room, (struct mkroom *, BOOLEAN_P)); -E boolean FDECL(load_special, (const char *)); -E xchar FDECL(selection_getpoint, (int, int, struct opvar *)); -E struct opvar *FDECL(selection_opvar, (char *)); -E void FDECL(opvar_free_x, (struct opvar *)); -E void FDECL(set_selection_floodfillchk, (int FDECL((*), (int,int)))); -E void FDECL(selection_floodfill, (struct opvar *, int, int, BOOLEAN_P)); +E boolean check_room(xchar *, xchar *, xchar *, xchar *, BOOLEAN_P); +E boolean create_room(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, + XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); +E void create_secret_door(struct mkroom *, XCHAR_P); +E boolean dig_corridor(coord *, coord *, BOOLEAN_P, SCHAR_P, SCHAR_P); +E void fill_room(struct mkroom *, BOOLEAN_P); +E boolean load_special(const char *); +E xchar selection_getpoint(int, int, struct opvar *); +E struct opvar *selection_opvar(char *); +E void opvar_free_x(struct opvar *); +E void set_selection_floodfillchk(int(*)(int,int)); +E void selection_floodfill(struct opvar *, int, int, BOOLEAN_P); /* ### spell.c ### */ -E void FDECL(book_cursed, (struct obj *)); +E void book_cursed(struct obj *); #ifdef USE_TRAMPOLI -E int NDECL(learn); -#endif -E int FDECL(study_book, (struct obj *)); -E void FDECL(book_disappears, (struct obj *)); -E void FDECL(book_substitution, (struct obj *, struct obj *)); -E void NDECL(age_spells); -E int NDECL(docast); -E int FDECL(spell_skilltype, (int)); -E int FDECL(spelleffects, (int, BOOLEAN_P)); -E int FDECL(tport_spell, (int)); -E void NDECL(losespells); -E int NDECL(dovspell); -E void FDECL(initialspell, (struct obj *)); -E void NDECL(dump_spells); -E boolean FDECL(parse_spellorder, (char *)); +E int learn(); +#endif +E int study_book(struct obj *); +E void book_disappears(struct obj *); +E void book_substitution(struct obj *, struct obj *); +E void age_spells(); +E int docast(); +E int spell_skilltype(int); +E int spelleffects(int, BOOLEAN_P); +E int tport_spell(int); +E void losespells(); +E int dovspell(); +E void initialspell(struct obj *); +E void dump_spells(); +E boolean parse_spellorder(char *); extern const char* spelltypemnemonic(int); extern int num_spells(void); /* ### steal.c ### */ #ifdef USE_TRAMPOLI -E int NDECL(stealarm); -#endif -E long FDECL(somegold, (long)); -E void FDECL(stealgold, (struct monst *)); -E void FDECL(remove_worn_item, (struct obj *, BOOLEAN_P)); -E int FDECL(steal, (struct monst *, char *)); -E int FDECL(mpickobj, (struct monst *, struct obj *)); -E void FDECL(stealamulet, (struct monst *)); -E void FDECL(maybe_absorb_item, (struct monst *, struct obj *, int, int)); -E void FDECL(mdrop_obj, (struct monst *, struct obj *, BOOLEAN_P)); -E void FDECL(mdrop_special_objs, (struct monst *)); -E void FDECL(relobj, (struct monst *, int, BOOLEAN_P)); -E struct obj *FDECL(findgold, (struct obj *)); +E int stealarm(); +#endif +E long somegold(long); +E void stealgold(struct monst *); +E void remove_worn_item(struct obj *, BOOLEAN_P); +E int steal(struct monst *, char *); +E int mpickobj(struct monst *, struct obj *); +E void stealamulet(struct monst *); +E void maybe_absorb_item(struct monst *, struct obj *, int, int); +E void mdrop_obj(struct monst *, struct obj *, BOOLEAN_P); +E void mdrop_special_objs(struct monst *); +E void relobj(struct monst *, int, BOOLEAN_P); +E struct obj *findgold(struct obj *); /* ### steed.c ### */ -E void NDECL(rider_cant_reach); -E boolean FDECL(can_saddle, (struct monst *)); -E int FDECL(use_saddle, (struct obj *)); -E void FDECL(put_saddle_on_mon, (struct obj *, struct monst *)); -E boolean FDECL(can_ride, (struct monst *)); -E int NDECL(doride); -E boolean FDECL(mount_steed, (struct monst *, BOOLEAN_P)); -E void NDECL(exercise_steed); -E void NDECL(kick_steed); -E void FDECL(dismount_steed, (int)); -E void FDECL(place_monster, (struct monst *, int, int)); -E boolean FDECL(stucksteed, (BOOLEAN_P)); +E void rider_cant_reach(); +E boolean can_saddle(struct monst *); +E int use_saddle(struct obj *); +E void put_saddle_on_mon(struct obj *, struct monst *); +E boolean can_ride(struct monst *); +E int doride(); +E boolean mount_steed(struct monst *, BOOLEAN_P); +E void exercise_steed(); +E void kick_steed(); +E void dismount_steed(int); +E void place_monster(struct monst *, int, int); +E boolean stucksteed(BOOLEAN_P); /* ### sys.c ### */ @@ -2512,172 +2497,171 @@ extern void sys_early_init(); /* ### teleport.c ### */ -E boolean FDECL(goodpos, (int, int, struct monst *, unsigned)); -E boolean FDECL(enexto, (coord *, XCHAR_P, XCHAR_P, struct permonst *)); -E boolean FDECL(enexto_core, (coord *, XCHAR_P, XCHAR_P, struct permonst *, unsigned)); -E boolean FDECL(enexto_core_range, (coord *, XCHAR_P, XCHAR_P, struct permonst *, unsigned, int)); -E int FDECL(epathto, (coord *, int, XCHAR_P, XCHAR_P, struct permonst *)); -E void FDECL(teleds, (int, int, BOOLEAN_P)); -E boolean FDECL(safe_teleds, (BOOLEAN_P)); -E boolean FDECL(teleport_pet, (struct monst *, BOOLEAN_P)); -E int NDECL(dotelecmd); -E void NDECL(tele); -E int FDECL(dotele, (BOOLEAN_P)); -E void NDECL(level_tele); -E void FDECL(domagicportal, (struct trap *)); -E void FDECL(tele_trap, (struct trap *)); -E void FDECL(level_tele_trap, (struct trap *, unsigned)); -E void FDECL(rloc_to, (struct monst *, int, int)); -E boolean FDECL(rloc, (struct monst *, BOOLEAN_P)); -E boolean FDECL(tele_restrict, (struct monst *)); -E void FDECL(mtele_trap, (struct monst *, struct trap *, int)); -E int FDECL(mlevel_tele_trap, (struct monst *, struct trap *, BOOLEAN_P, int)); -E boolean FDECL(rloco, (struct obj *)); -E int NDECL(random_teleport_level); -E boolean FDECL(u_teleport_mon, (struct monst *, BOOLEAN_P)); +E boolean goodpos(int, int, struct monst *, unsigned); +E boolean enexto(coord *, XCHAR_P, XCHAR_P, struct permonst *); +E boolean enexto_core(coord *, XCHAR_P, XCHAR_P, struct permonst *, unsigned); +E boolean enexto_core_range(coord *, XCHAR_P, XCHAR_P, struct permonst *, unsigned, int); +E int epathto(coord *, int, XCHAR_P, XCHAR_P, struct permonst *); +E void teleds(int, int, BOOLEAN_P); +E boolean safe_teleds(BOOLEAN_P); +E boolean teleport_pet(struct monst *, BOOLEAN_P); +E int dotelecmd(); +E void tele(); +E int dotele(BOOLEAN_P); +E void level_tele(); +E void domagicportal(struct trap *); +E void tele_trap(struct trap *); +E void level_tele_trap(struct trap *, unsigned); +E void rloc_to(struct monst *, int, int); +E boolean rloc(struct monst *, BOOLEAN_P); +E boolean tele_restrict(struct monst *); +E void mtele_trap(struct monst *, struct trap *, int); +E int mlevel_tele_trap(struct monst *, struct trap *, BOOLEAN_P, int); +E boolean rloco(struct obj *); +E int random_teleport_level(); +E boolean u_teleport_mon(struct monst *, BOOLEAN_P); /* ### termcap.c ### */ -E void FDECL(term_start_color, (int)); -E void NDECL(term_end_color); -E void FDECL(term_start_attr, (int)); -E void FDECL(term_end_attr, (int)); +E void term_start_color(int); +E void term_end_color(); +E void term_start_attr(int); +E void term_end_attr(int); /* ### tile.c ### */ #ifdef USE_TILES -E void FDECL(substitute_tiles, (d_level *)); +E void substitute_tiles(d_level *); #endif /* ### timeout.c ### */ -E void NDECL(burn_away_slime); -E void NDECL(nh_timeout); -E void FDECL(fall_asleep, (int, BOOLEAN_P)); -E void FDECL(attach_egg_hatch_timeout, (struct obj *, long)); -E void FDECL(attach_fig_transform_timeout, (struct obj *)); -E void FDECL(kill_egg, (struct obj *)); -E void FDECL(hatch_egg, (ANY_P *, long)); -E void FDECL(learn_egg_type, (int)); -E void FDECL(burn_object, (ANY_P *, long)); -E void FDECL(begin_burn, (struct obj *, BOOLEAN_P)); -E void FDECL(end_burn, (struct obj *, BOOLEAN_P)); -E void NDECL(do_storms); -E boolean FDECL(start_timer, (long, SHORT_P, SHORT_P, ANY_P *)); -E long FDECL(stop_timer, (SHORT_P, ANY_P *)); -E long FDECL(peek_timer, (SHORT_P, ANY_P *)); -E void NDECL(run_timers); -E void FDECL(obj_move_timers, (struct obj *, struct obj *)); -E void FDECL(obj_split_timers, (struct obj *, struct obj *)); -E void FDECL(obj_stop_timers, (struct obj *)); -E boolean FDECL(obj_has_timer, (struct obj *, SHORT_P)); -E void FDECL(spot_stop_timers, (XCHAR_P, XCHAR_P, SHORT_P)); -E long FDECL(spot_time_expires, (XCHAR_P, XCHAR_P, SHORT_P)); -E long FDECL(spot_time_left, (XCHAR_P, XCHAR_P, SHORT_P)); -E boolean FDECL(obj_is_local, (struct obj *)); -E void FDECL(save_timers, (int, int, int)); -E void FDECL(restore_timers, (int, int, BOOLEAN_P, long)); -E void FDECL(timer_stats, (const char *, char *, long *, long *)); -E void FDECL(relink_timers, (BOOLEAN_P)); +E void burn_away_slime(); +E void nh_timeout(); +E void fall_asleep(int, BOOLEAN_P); +E void attach_egg_hatch_timeout(struct obj *, long); +E void attach_fig_transform_timeout(struct obj *); +E void kill_egg(struct obj *); +E void hatch_egg(ANY_P *, long); +E void learn_egg_type(int); +E void burn_object(ANY_P *, long); +E void begin_burn(struct obj *, BOOLEAN_P); +E void end_burn(struct obj *, BOOLEAN_P); +E void do_storms(); +E boolean start_timer(long, SHORT_P, SHORT_P, ANY_P *); +E long stop_timer(SHORT_P, ANY_P *); +E long peek_timer(SHORT_P, ANY_P *); +E void run_timers(); +E void obj_move_timers(struct obj *, struct obj *); +E void obj_split_timers(struct obj *, struct obj *); +E void obj_stop_timers(struct obj *); +E boolean obj_has_timer(struct obj *, SHORT_P); +E void spot_stop_timers(XCHAR_P, XCHAR_P, SHORT_P); +E long spot_time_expires(XCHAR_P, XCHAR_P, SHORT_P); +E long spot_time_left(XCHAR_P, XCHAR_P, SHORT_P); +E boolean obj_is_local(struct obj *); +E void save_timers(int, int, int); +E void restore_timers(int, int, BOOLEAN_P, long); +E void timer_stats(const char *, char *, long *, long *); +E void relink_timers(BOOLEAN_P); #ifdef WIZARD -E int NDECL(wiz_timeout_queue); -E void NDECL(timer_sanity_check); +E int wiz_timeout_queue(); +E void timer_sanity_check(); #endif /* ### topten.c ### */ #ifdef RECORD_CONDUCT -E long FDECL(encodeconduct, (void)); +E long encodeconduct(void); #endif -E void FDECL(topten, (int)); -E void FDECL(prscore, (int, char **)); -E struct obj *FDECL(tt_oname, (struct obj *)); +E void topten(int); +E void prscore(int, char **); +E struct obj *tt_oname(struct obj *); /* ### track.c ### */ -E void NDECL(initrack); -E void NDECL(settrack); -E coord *FDECL(gettrack, (int, int)); +E void initrack(); +E void settrack(); +E coord *gettrack(int, int); /* ### trap.c ### */ -E boolean FDECL(burnarmor, (struct monst *)); -E int FDECL(erode_obj, (struct obj *, const char *, int, int)); -E boolean FDECL(grease_protect, (struct obj *, const char *, struct monst *)); -E struct trap *FDECL(maketrap, (int, int, int)); -E void FDECL(fall_through, (BOOLEAN_P, unsigned)); -E struct monst *FDECL(animate_statue, (struct obj *, XCHAR_P, XCHAR_P, int, int *)); -E struct monst *FDECL(activate_statue_trap, - (struct trap *, XCHAR_P, XCHAR_P, BOOLEAN_P)); -E void FDECL(set_utrap, (unsigned, unsigned)); -E void FDECL(reset_utrap, (BOOLEAN_P)); -E void FDECL(dotrap, (struct trap *, unsigned)); -E void FDECL(seetrap, (struct trap *)); -E void FDECL(feeltrap, (struct trap *)); +E boolean burnarmor(struct monst *); +E int erode_obj(struct obj *, const char *, int, int); +E boolean grease_protect(struct obj *, const char *, struct monst *); +E struct trap *maketrap(int, int, int); +E void fall_through(BOOLEAN_P, unsigned); +E struct monst *animate_statue(struct obj *, XCHAR_P, XCHAR_P, int, int *); +E struct monst *activate_statue_trap(struct trap *, XCHAR_P, XCHAR_P, BOOLEAN_P); +E void set_utrap(unsigned, unsigned); +E void reset_utrap(BOOLEAN_P); +E void dotrap(struct trap *, unsigned); +E void seetrap(struct trap *); +E void feeltrap(struct trap *); extern int mintrap(struct monst *, unsigned); -E void FDECL(instapetrify, (const char *)); -E void FDECL(minstapetrify, (struct monst *, BOOLEAN_P)); +E void instapetrify(const char *); +E void minstapetrify(struct monst *, BOOLEAN_P); #ifdef WEBB_DISINT -E int FDECL(instadisintegrate, (const char *)); -E int FDECL(minstadisintegrate, (struct monst *)); -#endif -E void FDECL(selftouch, (const char *)); -E void FDECL(mselftouch, (struct monst *, const char *, BOOLEAN_P)); -E void NDECL(float_up); -E void FDECL(fill_pit, (int, int)); -E int FDECL(float_down, (long, long)); -E void NDECL(climb_pit); -E boolean FDECL(fire_damage, (struct obj *, BOOLEAN_P, XCHAR_P, XCHAR_P)); -E int FDECL(fire_damage_chain, (struct obj *, BOOLEAN_P, BOOLEAN_P, XCHAR_P, XCHAR_P)); -E boolean FDECL(lava_damage, (struct obj *, XCHAR_P, XCHAR_P)); +E int instadisintegrate(const char *); +E int minstadisintegrate(struct monst *); +#endif +E void selftouch(const char *); +E void mselftouch(struct monst *, const char *, BOOLEAN_P); +E void float_up(); +E void fill_pit(int, int); +E int float_down(long, long); +E void climb_pit(); +E boolean fire_damage(struct obj *, BOOLEAN_P, XCHAR_P, XCHAR_P); +E int fire_damage_chain(struct obj *, BOOLEAN_P, BOOLEAN_P, XCHAR_P, XCHAR_P); +E boolean lava_damage(struct obj *, XCHAR_P, XCHAR_P); E void acid_damage(struct obj *); -E int FDECL(water_damage, (struct obj *, const char *, BOOLEAN_P)); -E void FDECL(water_damage_chain, (struct obj *, BOOLEAN_P)); -E boolean NDECL(drown); -E void FDECL(drain_en, (int)); -E int NDECL(dountrap); -E void FDECL(cnv_trap_obj, (int, int, struct trap *, BOOLEAN_P)); -E int FDECL(untrap, (BOOLEAN_P)); -E boolean FDECL(openholdingtrap, (struct monst *, boolean *)); -E boolean FDECL(closeholdingtrap, (struct monst *, boolean *)); -E boolean FDECL(openfallingtrap, (struct monst *, BOOLEAN_P, boolean *)); -E boolean FDECL(chest_trap, (struct obj *, int, BOOLEAN_P)); -E void FDECL(deltrap, (struct trap *)); -E boolean FDECL(delfloortrap, (struct trap *)); -E struct trap *FDECL(t_at, (int, int)); -E void FDECL(b_trapped, (const char *, int)); -E boolean NDECL(unconscious); -E boolean FDECL(uteetering_at_seen_pit, (struct trap *)); -E boolean FDECL(uescaped_shaft, (struct trap *)); -E boolean NDECL(lava_effects); -E boolean NDECL(swamp_effects); -E void FDECL(blow_up_landmine, (struct trap *)); -E int FDECL(launch_obj, (SHORT_P, int, int, int, int, int)); +E int water_damage(struct obj *, const char *, BOOLEAN_P); +E void water_damage_chain(struct obj *, BOOLEAN_P); +E boolean drown(); +E void drain_en(int); +E int dountrap(); +E void cnv_trap_obj(int, int, struct trap *, BOOLEAN_P); +E int untrap(BOOLEAN_P); +E boolean openholdingtrap(struct monst *, boolean *); +E boolean closeholdingtrap(struct monst *, boolean *); +E boolean openfallingtrap(struct monst *, BOOLEAN_P, boolean *); +E boolean chest_trap(struct obj *, int, BOOLEAN_P); +E void deltrap(struct trap *); +E boolean delfloortrap(struct trap *); +E struct trap *t_at(int, int); +E void b_trapped(const char *, int); +E boolean unconscious(); +E boolean uteetering_at_seen_pit(struct trap *); +E boolean uescaped_shaft(struct trap *); +E boolean lava_effects(); +E boolean swamp_effects(); +E void blow_up_landmine(struct trap *); +E int launch_obj(SHORT_P, int, int, int, int, int); /* ### u_init.c ### */ -E void NDECL(u_init); +E void u_init(); /* ### uhitm.c ### */ -E void FDECL(hurtmarmor, (struct monst *, int)); -E boolean FDECL(attack_checks, (struct monst *, struct obj *)); -E void FDECL(check_caitiff, (struct monst *)); -E int FDECL(find_roll_to_hit, (struct monst *, UCHAR_P, struct obj *, int *, int *)); -E boolean FDECL(attack, (struct monst *)); -E boolean FDECL(hmon, (struct monst *, struct obj *, int, int)); -E boolean FDECL(shade_miss, (struct monst *, struct monst *, struct obj *, boolean, boolean)); -E int FDECL(damageum, (struct monst *, struct attack *, int)); -E void FDECL(missum, (struct monst *, struct attack *, BOOLEAN_P)); -E int FDECL(passive, (struct monst *, struct obj *, BOOLEAN_P, int, UCHAR_P, BOOLEAN_P)); -E void FDECL(passive_obj, (struct monst *, struct obj *, struct attack *)); -E void FDECL(stumble_onto_mimic, (struct monst *)); -E int FDECL(flash_hits_mon, (struct monst *, struct obj *)); -E void FDECL(light_hits_gremlin, (struct monst *, int)); +E void hurtmarmor(struct monst *, int); +E boolean attack_checks(struct monst *, struct obj *); +E void check_caitiff(struct monst *); +E int find_roll_to_hit(struct monst *, UCHAR_P, struct obj *, int *, int *); +E boolean attack(struct monst *); +E boolean hmon(struct monst *, struct obj *, int, int); +E boolean shade_miss(struct monst *, struct monst *, struct obj *, boolean, boolean); +E int damageum(struct monst *, struct attack *, int); +E void missum(struct monst *, struct attack *, BOOLEAN_P); +E int passive(struct monst *, struct obj *, BOOLEAN_P, int, UCHAR_P, BOOLEAN_P); +E void passive_obj(struct monst *, struct obj *, struct attack *); +E void stumble_onto_mimic(struct monst *); +E int flash_hits_mon(struct monst *, struct obj *); +E void light_hits_gremlin(struct monst *, int); /* ### unixmain.c ### */ #ifdef UNIX # ifdef PORT_HELP -E void NDECL(port_help); +E void port_help(); # endif #endif /* UNIX */ @@ -2685,40 +2669,39 @@ E void NDECL(port_help); /* ### unixtty.c ### */ #if defined(UNIX) || defined(__BEOS__) -E void NDECL(gettty); -E void FDECL(settty, (const char *)); -E void NDECL(setftty); -E void NDECL(intron); -E void NDECL(introff); +E void gettty(); +E void settty(const char *); +E void setftty(); +E void intron(); +E void introff(); E void VDECL(error, (const char *, ...)) PRINTF_F(1, 2); #endif /* UNIX || __BEOS__ */ /* ### unixunix.c ### */ #ifdef UNIX -E void NDECL(getlock); -E void FDECL(regularize, (char *)); +E void getlock(); +E void regularize(char *); # if defined(TIMED_DELAY) && !defined(msleep) && defined(SYSV) -E void FDECL(msleep, (unsigned)); +E void msleep(unsigned); # endif # ifdef SHELL -E int NDECL(dosh); +E int dosh(); # endif /* SHELL */ # if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER) -E int FDECL(child, (int)); +E int child(int); # endif #ifdef FILE_AREAS -E char *FDECL(make_file_name, (const char *, const char *)); -E FILE *FDECL(fopen_datafile_area, (const char *, const char *, const char *, - BOOLEAN_P)); -E FILE *FDECL(freopen_area, (const char *, const char *, const char *, FILE *)); -E int FDECL(chmod_area, (const char *, const char *, int)); -E int FDECL(open_area, (const char *, const char *, int, int)); -E int FDECL(creat_area, (const char *, const char *, int)); -E boolean FDECL(lock_file_area, (const char *, const char *, int)); -E void FDECL(unlock_file_area, (const char *, const char *)); -E int FDECL(rename_area, (const char *, const char *, const char *)); -E int FDECL(remove_area, (const char *, const char *)); +E char *make_file_name(const char *, const char *); +E FILE *fopen_datafile_area(const char *, const char *, const char *, BOOLEAN_P); +E FILE *freopen_area(const char *, const char *, const char *, FILE *); +E int chmod_area(const char *, const char *, int); +E int open_area(const char *, const char *, int, int); +E int creat_area(const char *, const char *, int); +E boolean lock_file_area(const char *, const char *, int); +E void unlock_file_area(const char *, const char *); +E int rename_area(const char *, const char *, const char *); +E int remove_area(const char *, const char *); #endif #endif /* UNIX */ @@ -2726,380 +2709,376 @@ E int FDECL(remove_area, (const char *, const char *)); #ifdef UNIX # ifdef GNOME_GRAPHICS -E int FDECL(hide_privileges, (BOOLEAN_P)); +E int hide_privileges(BOOLEAN_P); # endif #endif /* UNIX */ /* ### vault.c ### */ -E void FDECL(newegd, (struct monst *)); -E void FDECL(free_egd, (struct monst *)); -E boolean FDECL(grddead, (struct monst *)); -E struct monst *NDECL(findgd); -E void NDECL(vault_summon_gd); -E char FDECL(vault_occupied, (char *)); -E void FDECL(uleftvault, (struct monst *)); -E void NDECL(invault); -E int FDECL(gd_move, (struct monst *)); -E void FDECL(paygd, (BOOLEAN_P)); -E long NDECL(hidden_gold); -E boolean NDECL(gd_sound); -E void FDECL(vault_gd_watching, (unsigned int)); +E void newegd(struct monst *); +E void free_egd(struct monst *); +E boolean grddead(struct monst *); +E struct monst *findgd(); +E void vault_summon_gd(); +E char vault_occupied(char *); +E void uleftvault(struct monst *); +E void invault(); +E int gd_move(struct monst *); +E void paygd(BOOLEAN_P); +E long hidden_gold(); +E boolean gd_sound(); +E void vault_gd_watching(unsigned int); /* ### version.c ### */ -E char *FDECL(version_string, (char *)); -E char *FDECL(getversionstring, (char *)); -E int NDECL(doversion); -E int NDECL(doextversion); +E char *version_string(char *); +E char *getversionstring(char *); +E int doversion(); +E int doextversion(); #ifdef MICRO -E boolean FDECL(comp_times, (long)); +E boolean comp_times(long); #endif -E boolean FDECL(check_version, (struct version_info *, - const char *, BOOLEAN_P)); -E unsigned long FDECL(get_feature_notice_ver, (char *)); -E unsigned long NDECL(get_current_feature_ver); +E boolean check_version(struct version_info *, const char *, BOOLEAN_P); +E unsigned long get_feature_notice_ver(char *); +E unsigned long get_current_feature_ver(); #ifdef RUNTIME_PORT_ID -E void FDECL(append_port_id, (char *)); +E void append_port_id(char *); #endif /* ### video.c ### */ #ifdef MSDOS -E int FDECL(assign_video, (char *)); +E int assign_video(char *); # ifdef NO_TERMS -E void NDECL(gr_init); -E void NDECL(gr_finish); +E void gr_init(); +E void gr_finish(); # endif -E void FDECL(tileview, (BOOLEAN_P)); +E void tileview(BOOLEAN_P); #endif #ifdef VIDEOSHADES -E int FDECL(assign_videoshades, (char *)); -E int FDECL(assign_videocolors, (char *)); +E int assign_videoshades(char *); +E int assign_videocolors(char *); #endif /* ### vis_tab.c ### */ #ifdef VISION_TABLES -E void NDECL(vis_tab_init); +E void vis_tab_init(); #endif /* ### vision.c ### */ -E void NDECL(vision_init); -E int FDECL(does_block, (int, int, struct rm*)); -E void NDECL(vision_reset); -E void FDECL(vision_recalc, (int)); -E void FDECL(block_point, (int, int)); -E void FDECL(unblock_point, (int, int)); -E boolean FDECL(clear_path, (int, int, int, int)); -E void FDECL(do_clear_area, (int, int, int, - void (*)(int, int, genericptr_t), genericptr_t)); -E unsigned FDECL(how_mon_is_seen, (struct monst *)); +E void vision_init(); +E int does_block(int, int, struct rm*); +E void vision_reset(); +E void vision_recalc(int); +E void block_point(int, int); +E void unblock_point(int, int); +E boolean clear_path(int, int, int, int); +E void do_clear_area(int, int, int, void (*)(int, int, genericptr_t), genericptr_t); +E unsigned how_mon_is_seen(struct monst *); #ifdef VMS /* ### vmsfiles.c ### */ -E int FDECL(vms_link, (const char *, const char *)); -E int FDECL(vms_unlink, (const char *)); -E int FDECL(vms_creat, (const char *, unsigned int)); -E int FDECL(vms_open, (const char *, int, unsigned int)); -E boolean FDECL(same_dir, (const char *, const char *)); -E int FDECL(c__translate, (int)); -E char *FDECL(vms_basename, (const char *)); +E int vms_link(const char *, const char *); +E int vms_unlink(const char *); +E int vms_creat(const char *, unsigned int); +E int vms_open(const char *, int, unsigned int); +E boolean same_dir(const char *, const char *); +E int c__translate(int); +E char *vms_basename(const char *); /* ### vmsmail.c ### */ -E unsigned long NDECL(init_broadcast_trapping); -E unsigned long NDECL(enable_broadcast_trapping); -E unsigned long NDECL(disable_broadcast_trapping); +E unsigned long init_broadcast_trapping(); +E unsigned long enable_broadcast_trapping(); +E unsigned long disable_broadcast_trapping(); # if 0 -E struct mail_info *NDECL(parse_next_broadcast); +E struct mail_info *parse_next_broadcast(); # endif /*0*/ /* ### vmsmain.c ### */ -E int FDECL(main, (int, char **)); +E int main(int, char **); # ifdef CHDIR -E void FDECL(chdirx, (const char *, BOOLEAN_P)); +E void chdirx(const char *, BOOLEAN_P); # endif /* CHDIR */ /* ### vmsmisc.c ### */ -E void NDECL(vms_abort); -E void FDECL(vms_exit, (int)); +E void vms_abort(); +E void vms_exit(int); /* ### vmstty.c ### */ -E int NDECL(vms_getchar); -E void NDECL(gettty); -E void FDECL(settty, (const char *)); -E void FDECL(shuttty, (const char *)); -E void NDECL(setftty); -E void NDECL(intron); -E void NDECL(introff); +E int vms_getchar(); +E void gettty(); +E void settty(const char *); +E void shuttty(const char *); +E void setftty(); +E void intron(); +E void introff(); E void VDECL(error, (const char *, ...)) PRINTF_F(1, 2); #ifdef TIMED_DELAY -E void FDECL(msleep, (unsigned)); +E void msleep(unsigned); #endif /* ### vmsunix.c ### */ -E void NDECL(getlock); -E void FDECL(regularize, (char *)); -E int NDECL(vms_getuid); -E boolean FDECL(file_is_stmlf, (int)); -E int FDECL(vms_define, (const char *, const char *, int)); -E int FDECL(vms_putenv, (const char *)); -E char *NDECL(verify_termcap); +E void getlock(); +E void regularize(char *); +E int vms_getuid(); +E boolean file_is_stmlf(int); +E int vms_define(const char *, const char *, int); +E int vms_putenv(const char *); +E char *verify_termcap(); # if defined(CHDIR) || defined(SHELL) || defined(SECURE) -E void NDECL(privoff); -E void NDECL(privon); +E void privoff(); +E void privon(); # endif # ifdef SHELL -E int NDECL(dosh); +E int dosh(); # endif # if defined(SHELL) || defined(MAIL) -E int FDECL(vms_doshell, (const char *, BOOLEAN_P)); +E int vms_doshell(const char *, BOOLEAN_P); # endif # ifdef SUSPEND -E int NDECL(dosuspend); +E int dosuspend(); # endif #endif /* VMS */ /* ### weapon.c ### */ -E const char *FDECL(weapon_descr, (struct obj *)); -E int FDECL(hitval, (struct obj *, struct monst *)); -E int FDECL(dmgval, (struct obj *, struct monst *)); -E int FDECL(special_dmgval, (struct monst *, struct monst *, long, long *)); +E const char *weapon_descr(struct obj *); +E int hitval(struct obj *, struct monst *); +E int dmgval(struct obj *, struct monst *); +E int special_dmgval(struct monst *, struct monst *, long, long *); extern struct damage_info_t dmgval_info(struct obj*); -E void FDECL(silver_sears, (struct monst *, struct monst *, long)); -E struct obj *FDECL(select_rwep, (struct monst *)); -E boolean FDECL(mon_might_throw_wep, (struct obj *)); -E struct obj *FDECL(select_hwep, (struct monst *)); -E void FDECL(possibly_unwield, (struct monst *, BOOLEAN_P)); -E int FDECL(mon_wield_item, (struct monst *)); -E void FDECL(mwepgone, (struct monst *)); -E int NDECL(abon); -E int NDECL(dbon); -E void FDECL(wet_a_towel, (struct obj *, int, BOOLEAN_P)); -E void FDECL(dry_a_towel, (struct obj *, int, BOOLEAN_P)); +E void silver_sears(struct monst *, struct monst *, long); +E struct obj *select_rwep(struct monst *); +E boolean mon_might_throw_wep(struct obj *); +E struct obj *select_hwep(struct monst *); +E void possibly_unwield(struct monst *, BOOLEAN_P); +E int mon_wield_item(struct monst *); +E void mwepgone(struct monst *); +E int abon(); +E int dbon(); +E void wet_a_towel(struct obj *, int, BOOLEAN_P); +E void dry_a_towel(struct obj *, int, BOOLEAN_P); extern const char* skill_name(int); -E int NDECL(enhance_weapon_skill); +E int enhance_weapon_skill(); #ifdef DUMP_LOG -E void NDECL(dump_weapon_skill); -#endif -E void FDECL(unrestrict_weapon_skill, (int)); -E void FDECL(use_skill, (int, int)); -E void FDECL(add_weapon_skill, (int)); -E void FDECL(lose_weapon_skill, (int)); -E int FDECL(weapon_type, (struct obj *)); -E int NDECL(uwep_skill_type); -E int FDECL(weapon_hit_bonus, (struct obj *)); -E int FDECL(weapon_dam_bonus, (struct obj *)); -E void FDECL(skill_init, (const struct def_skill *)); -E boolean NDECL(can_advance_something); +E void dump_weapon_skill(); +#endif +E void unrestrict_weapon_skill(int); +E void use_skill(int, int); +E void add_weapon_skill(int); +E void lose_weapon_skill(int); +E int weapon_type(struct obj *); +E int uwep_skill_type(); +E int weapon_hit_bonus(struct obj *); +E int weapon_dam_bonus(struct obj *); +E void skill_init(const struct def_skill *); +E boolean can_advance_something(); /* ### were.c ### */ -E void FDECL(were_change, (struct monst *)); -E int FDECL(counter_were, (int)); -E int FDECL(were_beastie, (int)); -E void FDECL(new_were, (struct monst *)); -E int FDECL(were_summon, (struct permonst *, BOOLEAN_P, int *, char *)); -E void NDECL(you_were); -E void FDECL(you_unwere, (BOOLEAN_P)); -E void FDECL(set_ulycn, (int)); +E void were_change(struct monst *); +E int counter_were(int); +E int were_beastie(int); +E void new_were(struct monst *); +E int were_summon(struct permonst *, BOOLEAN_P, int *, char *); +E void you_were(); +E void you_unwere(BOOLEAN_P); +E void set_ulycn(int); /* ### wield.c ### */ -E void FDECL(setuwep, (struct obj *)); -E void FDECL(setuqwep, (struct obj *)); -E void FDECL(setuswapwep, (struct obj *)); -E int NDECL(dowield); -E int NDECL(doswapweapon); -E int NDECL(dowieldquiver); -E int NDECL(dounwield); -E boolean FDECL(wield_tool, (struct obj *, const char *)); -E int NDECL(can_twoweapon); -E void NDECL(drop_uswapwep); -E int NDECL(dotwoweapon); -E void NDECL(uwepgone); -E void NDECL(uswapwepgone); -E void NDECL(uqwepgone); -E void NDECL(untwoweapon); -E int FDECL(chwepon, (struct obj *, int)); -E int FDECL(welded, (struct obj *)); -E void FDECL(weldmsg, (struct obj *)); -E void FDECL(setmnotwielded, (struct monst *, struct obj *)); -E boolean FDECL(mwelded, (struct obj *)); -E void NDECL(unwield_weapons_silently); +E void setuwep(struct obj *); +E void setuqwep(struct obj *); +E void setuswapwep(struct obj *); +E int dowield(); +E int doswapweapon(); +E int dowieldquiver(); +E int dounwield(); +E boolean wield_tool(struct obj *, const char *); +E int can_twoweapon(); +E void drop_uswapwep(); +E int dotwoweapon(); +E void uwepgone(); +E void uswapwepgone(); +E void uqwepgone(); +E void untwoweapon(); +E int chwepon(struct obj *, int); +E int welded(struct obj *); +E void weldmsg(struct obj *); +E void setmnotwielded(struct monst *, struct obj *); +E boolean mwelded(struct obj *); +E void unwield_weapons_silently(); /* ### windows.c ### */ -E void FDECL(choose_windows, (const char *)); -E char FDECL(genl_message_menu, (CHAR_P, int, const char *)); -E void FDECL(genl_preference_update, (const char *)); +E void choose_windows(const char *); +E char genl_message_menu(CHAR_P, int, const char *); +E void genl_preference_update(const char *); /* ### wizard.c ### */ -E void NDECL(amulet); -E int FDECL(mon_has_amulet, (struct monst *)); -E int FDECL(mon_has_special, (struct monst *)); -E int FDECL(tactics, (struct monst *)); -E boolean FDECL(has_aggravatables, (struct monst *)); -E void NDECL(aggravate); -E void NDECL(clonewiz); -E int NDECL(pick_nasty); -E int FDECL(nasty, (struct monst*)); -E void NDECL(resurrect); -E void NDECL(intervene); -E void NDECL(wizdead); -E void FDECL(cuss, (struct monst *)); +E void amulet(); +E int mon_has_amulet(struct monst *); +E int mon_has_special(struct monst *); +E int tactics(struct monst *); +E boolean has_aggravatables(struct monst *); +E void aggravate(); +E void clonewiz(); +E int pick_nasty(); +E int nasty(struct monst*); +E void resurrect(); +E void intervene(); +E void wizdead(); +E void cuss(struct monst *); /* ### worm.c ### */ -E int NDECL(get_wormno); -E void FDECL(initworm, (struct monst *, int)); -E void FDECL(worm_move, (struct monst *)); -E void FDECL(worm_nomove, (struct monst *)); -E void FDECL(wormgone, (struct monst *)); -E void FDECL(wormhitu, (struct monst *)); -E void FDECL(cutworm, (struct monst *, XCHAR_P, XCHAR_P, struct obj *)); -E void FDECL(see_wsegs, (struct monst *)); -E void FDECL(detect_wsegs, (struct monst *, BOOLEAN_P)); -E void FDECL(save_worm, (int, int)); -E void FDECL(rest_worm, (int)); -E void FDECL(place_wsegs, (struct monst *, struct monst *)); -E void FDECL(sanity_check_worm, (struct monst *)); -E void FDECL(remove_worm, (struct monst *)); -E void FDECL(place_worm_tail_randomly, (struct monst *, XCHAR_P, XCHAR_P)); -E int FDECL(size_wseg, (struct monst *)); -E int FDECL(count_wsegs, (struct monst *)); -E boolean FDECL(worm_known, (struct monst *)); -E int FDECL(wseg_at, (struct monst *, int, int)); +E int get_wormno(); +E void initworm(struct monst *, int); +E void worm_move(struct monst *); +E void worm_nomove(struct monst *); +E void wormgone(struct monst *); +E void wormhitu(struct monst *); +E void cutworm(struct monst *, XCHAR_P, XCHAR_P, struct obj *); +E void see_wsegs(struct monst *); +E void detect_wsegs(struct monst *, BOOLEAN_P); +E void save_worm(int, int); +E void rest_worm(int); +E void place_wsegs(struct monst *, struct monst *); +E void sanity_check_worm(struct monst *); +E void remove_worm(struct monst *); +E void place_worm_tail_randomly(struct monst *, XCHAR_P, XCHAR_P); +E int size_wseg(struct monst *); +E int count_wsegs(struct monst *); +E boolean worm_known(struct monst *); +E int wseg_at(struct monst *, int, int); extern void flip_worm_segs_vertical(struct monst *, int, int); extern void flip_worm_segs_horizontal(struct monst *, int, int); /* ### worn.c ### */ -E void FDECL(setworn, (struct obj *, long)); -E void FDECL(setnotworn, (struct obj *)); -E struct obj *FDECL(wearmask_to_obj, (long)); -E long FDECL(wearslot, (struct obj *)); -E void FDECL(mon_set_minvis, (struct monst *)); -E void FDECL(mon_adjust_speed, (struct monst *, int, struct obj *)); -E void FDECL(update_mon_intrinsics, - (struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P)); -E int FDECL(find_mac, (struct monst *)); -E void FDECL(m_dowear, (struct monst *, BOOLEAN_P)); -E struct obj *FDECL(which_armor, (struct monst *, long)); -E void FDECL(mon_break_armor, (struct monst *, BOOLEAN_P)); -E void FDECL(bypass_obj, (struct obj *)); -E void NDECL(clear_bypasses); -E void FDECL(bypass_objlist, (struct obj *, BOOLEAN_P)); -E struct obj *FDECL(nxt_unbypassed_obj, (struct obj *)); -E int FDECL(racial_exception, (struct monst *, struct obj *)); +E void setworn(struct obj *, long); +E void setnotworn(struct obj *); +E struct obj *wearmask_to_obj(long); +E long wearslot(struct obj *); +E void mon_set_minvis(struct monst *); +E void mon_adjust_speed(struct monst *, int, struct obj *); +E void update_mon_intrinsics(struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P); +E int find_mac(struct monst *); +E void m_dowear(struct monst *, BOOLEAN_P); +E struct obj *which_armor(struct monst *, long); +E void mon_break_armor(struct monst *, BOOLEAN_P); +E void bypass_obj(struct obj *); +E void clear_bypasses(); +E void bypass_objlist(struct obj *, BOOLEAN_P); +E struct obj *nxt_unbypassed_obj(struct obj *); +E int racial_exception(struct monst *, struct obj *); /* ### write.c ### */ extern int ink_cost(struct obj *); -E int FDECL(dowrite, (struct obj *)); +E int dowrite(struct obj *); /* ### zap.c ### */ -E void FDECL(learn_wand, (struct obj *)); -E int FDECL(bhitm, (struct monst *, struct obj *)); -E void FDECL(probe_monster, (struct monst *)); -E boolean FDECL(get_obj_location, (struct obj *, xchar *, xchar *, int)); -E boolean FDECL(get_mon_location, (struct monst *, xchar *, xchar *, int)); -E struct monst *FDECL(get_container_location, (struct obj *obj, int *, int *)); -E struct monst *FDECL(montraits, (struct obj *, coord *, BOOLEAN_P)); -E struct monst *FDECL(revive, (struct obj *, BOOLEAN_P)); -E int FDECL(unturn_dead, (struct monst *)); -E void FDECL(cancel_item, (struct obj *)); -E boolean FDECL(drain_item, (struct obj *, BOOLEAN_P)); -E struct obj *FDECL(poly_obj, (struct obj *, int)); -E boolean FDECL(obj_resists, (struct obj *, int, int)); -E boolean FDECL(obj_shudders, (struct obj *)); -E void FDECL(do_osshock, (struct obj *)); -E int FDECL(bhito, (struct obj *, struct obj *)); -E int FDECL(bhitpile, (struct obj *, int (*)(OBJ_P, OBJ_P), int, int, SCHAR_P)); -E int FDECL(zappable, (struct obj *)); -E void FDECL(zapnodir, (struct obj *)); -E int NDECL(dozap); -E int FDECL(zapyourself, (struct obj *, BOOLEAN_P)); -E void FDECL(ubreatheu, (struct attack *)); -E int FDECL(lightdamage, (struct obj *, BOOLEAN_P, int)); -E boolean FDECL(flashburn, (long)); -E boolean FDECL(cancel_monst, (struct monst *, struct obj *, - BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); -E void NDECL(zapsetup); -E void NDECL(zapwrapup); -E void FDECL(weffects, (struct obj *)); -E int FDECL(spell_damage_bonus, (int)); -E const char *FDECL(exclam, (int force)); -E void FDECL(hit, (const char *, struct monst *, const char *)); -E void FDECL(miss, (const char *, struct monst *)); -E struct monst *FDECL(bhit, (int, int, int, int, int (*)(MONST_P, OBJ_P), - int (*)(OBJ_P, OBJ_P), struct obj *, boolean *)); -E struct monst *FDECL(boomhit, (struct obj *, int, int)); -E int FDECL(zhitm, (struct monst *, int, int, struct obj **)); -E int FDECL(burn_floor_objects, (int, int, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(buzz, (int, int, XCHAR_P, XCHAR_P, int, int)); -E void FDECL(dobuzz, (int, int, XCHAR_P, XCHAR_P, int, int, BOOLEAN_P)); -E void FDECL(melt_ice, (XCHAR_P, XCHAR_P, const char *)); -E void FDECL(melt_ice_away, (ANY_P *, long)); -E int FDECL(zap_over_floor, (XCHAR_P, XCHAR_P, int, boolean *, SHORT_P)); -E void FDECL(fracture_rock, (struct obj *)); -E boolean FDECL(break_statue, (struct obj *)); -E void FDECL(destroy_item, (int, int)); -E int FDECL(destroy_mitem, (struct monst *, int, int)); -E int FDECL(resist, (struct monst *, CHAR_P, int, int)); -E void FDECL(makewish, (BOOLEAN_P)); -E void FDECL(remove_corpse, (struct obj *)); +E void learn_wand(struct obj *); +E int bhitm(struct monst *, struct obj *); +E void probe_monster(struct monst *); +E boolean get_obj_location(struct obj *, xchar *, xchar *, int); +E boolean get_mon_location(struct monst *, xchar *, xchar *, int); +E struct monst *get_container_location(struct obj *obj, int *, int *); +E struct monst *montraits(struct obj *, coord *, BOOLEAN_P); +E struct monst *revive(struct obj *, BOOLEAN_P); +E int unturn_dead(struct monst *); +E void cancel_item(struct obj *); +E boolean drain_item(struct obj *, BOOLEAN_P); +E struct obj *poly_obj(struct obj *, int); +E boolean obj_resists(struct obj *, int, int); +E boolean obj_shudders(struct obj *); +E void do_osshock(struct obj *); +E int bhito(struct obj *, struct obj *); +E int bhitpile(struct obj *, int (*)(OBJ_P, OBJ_P), int, int, SCHAR_P); +E int zappable(struct obj *); +E void zapnodir(struct obj *); +E int dozap(); +E int zapyourself(struct obj *, BOOLEAN_P); +E void ubreatheu(struct attack *); +E int lightdamage(struct obj *, BOOLEAN_P, int); +E boolean flashburn(long); +E boolean cancel_monst(struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +E void zapsetup(); +E void zapwrapup(); +E void weffects(struct obj *); +E int spell_damage_bonus(int); +E const char *exclam(int force); +E void hit(const char *, struct monst *, const char *); +E void miss(const char *, struct monst *); +E struct monst *bhit(int, int, int, int, int (*)(MONST_P, OBJ_P), + int (*)(OBJ_P, OBJ_P), struct obj *, boolean *); +E struct monst *boomhit(struct obj *, int, int); +E int zhitm(struct monst *, int, int, struct obj **); +E int burn_floor_objects(int, int, BOOLEAN_P, BOOLEAN_P); +E void buzz(int, int, XCHAR_P, XCHAR_P, int, int); +E void dobuzz(int, int, XCHAR_P, XCHAR_P, int, int, BOOLEAN_P); +E void melt_ice(XCHAR_P, XCHAR_P, const char *); +E void melt_ice_away(ANY_P *, long); +E int zap_over_floor(XCHAR_P, XCHAR_P, int, boolean *, SHORT_P); +E void fracture_rock(struct obj *); +E boolean break_statue(struct obj *); +E void destroy_item(int, int); +E int destroy_mitem(struct monst *, int, int); +E int resist(struct monst *, CHAR_P, int, int); +E void makewish(BOOLEAN_P); +E void remove_corpse(struct obj *); /* ### livelog.c ### */ #ifdef LIVELOGFILE -E boolean NDECL(livelog_start); -E void NDECL(livelog_achieve_update); -E void FDECL(livelog_wish, (char*)); +E boolean livelog_start(); +E void livelog_achieve_update(); +E void livelog_wish(char*); # ifdef LIVELOG_SHOUT -E int NDECL(doshout); +E int doshout(); # endif # ifdef LIVELOG_BONES_KILLER E void livelog_bones_killed(struct monst *); # endif -E void FDECL(livelog_shoplifting, (const char*, const char*, long)); +E void livelog_shoplifting(const char*, const char*, long); #endif -E void FDECL(livelog_game_started, (const char*, const char*, const char*, const char*)); -E void FDECL(livelog_game_action, (const char*)); -E void FDECL(livelog_generic, (const char*, const char*)); -E void FDECL(livelog_genocide, (const char*, int)); +E void livelog_game_started(const char*, const char*, const char*, const char*); +E void livelog_game_action(const char*); +E void livelog_generic(const char*, const char*); +E void livelog_genocide(const char*, int); extern void livelog_printf(unsigned int, const char *, ...) PRINTF_F(2, 3); #endif /* !MAKEDEFS_C && !LEV_LEX_C */ /* ### tutorial.c ### */ -E boolean FDECL(check_tutorial_message, (int)); -E void NDECL(maybe_tutorial); -E int NDECL(tutorial_redisplay); -E void NDECL(tutorial_redisplay_message); -E void FDECL(check_tutorial_farlook, (int, int)); -E void FDECL(check_tutorial_command, (char)); -E int FDECL(check_tutorial_location, (int, int, BOOLEAN_P)); -E int FDECL(check_tutorial_oclass, (int)); +E boolean check_tutorial_message(int); +E void maybe_tutorial(); +E int tutorial_redisplay(); +E void tutorial_redisplay_message(); +E void check_tutorial_farlook(int, int); +E void check_tutorial_command(char); +E int check_tutorial_location(int, int, BOOLEAN_P); +E int check_tutorial_oclass(int); /* ### base32.c ### */ long decode_base32(const char*); const char* encode_base32(unsigned long); /* ### unicode.c ### */ -E glyph_t FDECL(get_unicode_codepoint, (int)); -E int FDECL(pututf8char, (glyph_t)); +E glyph_t get_unicode_codepoint(int); +E int pututf8char(glyph_t); #undef E diff --git a/include/func_tab.h b/include/func_tab.h index 4dcaf9c92..b7ab0ca78 100644 --- a/include/func_tab.h +++ b/include/func_tab.h @@ -15,7 +15,7 @@ struct ext_func_tab { uchar key; const char *ef_txt, *ef_desc; - int NDECL((*ef_funct)); + int (*ef_funct)(void); int flags; const char *f_text; }; diff --git a/include/global.h b/include/global.h index 6b2d38474..71efe62b0 100644 --- a/include/global.h +++ b/include/global.h @@ -341,9 +341,9 @@ typedef glyph_t nhsym; /* primitive memory leak debugging; see alloc.c */ #ifdef MONITOR_HEAP -extern long *FDECL(nhalloc, (unsigned int, const char *, int)); -extern void FDECL(nhfree, (genericptr_t, const char *, int)); -extern char *FDECL(nhdupstr, (const char *, const char *, int)); +extern long *nhalloc(unsigned int, const char *, int); +extern void nhfree(genericptr_t, const char *, int); +extern char *nhdupstr(const char *, const char *, int); # ifndef __FILE__ # define __FILE__ "" # endif @@ -354,8 +354,8 @@ extern char *FDECL(nhdupstr, (const char *, const char *, int)); # define free(a) nhfree(a, __FILE__, (int)__LINE__) # define dupstr(s) nhdupstr(s, __FILE__, (int) __LINE__) #else /* !MONITOR_HEAP */ -extern long *FDECL(alloc, (unsigned int)); /* alloc.c */ -extern char *FDECL(dupstr, (const char *)); /* ditto */ +extern long *alloc(unsigned int); /* alloc.c */ +extern char *dupstr(const char *); /* ditto */ #endif /* Used for consistency checks of various data files; declare it here so diff --git a/include/hack.h b/include/hack.h index 3cfc30e68..47fc60b5b 100644 --- a/include/hack.h +++ b/include/hack.h @@ -223,11 +223,6 @@ enum hmon_atkmode_types { #define def_objsyms_explain(i) objexplain[i] #define def_oc_syms_name(i) oclass_names[i] -#ifdef USE_TRAMPOLI /* This doesn't belong here, but we have little choice */ -#undef NDECL -#define NDECL(f) f() -#endif - #include "extern.h" #include "winprocs.h" #include "sys.h" @@ -504,36 +499,6 @@ enum optset_restrictions { #define getlogin() ((char *)0) #endif /* MICRO */ -#if defined(OVERLAY)&&(defined(OVL0)||defined(OVL1)||defined(OVL2)||defined(OVL3)||defined(OVLB)) -# define USE_OVLx -# define STATIC_DCL extern -# define STATIC_OVL -# ifdef OVLB -# define STATIC_VAR -# else -# define STATIC_VAR extern -# endif - -#else /* !OVERLAY || (!OVL0 && !OVL1 && !OVL2 && !OVL3 && !OVLB) */ -# define STATIC_DCL static -# define STATIC_OVL static -# define STATIC_VAR static - -/* If not compiling an overlay, compile everything. */ -# define OVL0 /* highest priority */ -# define OVL1 -# define OVL2 -# define OVL3 /* lowest specified priority */ -# define OVLB /* the base overlay segment */ -#endif /* OVERLAY && (OVL0 || OVL1 || OVL2 || OVL3 || OVLB) */ - -/* Macro for a few items that are only static if we're not overlaid.... */ -#if defined(USE_TRAMPOLI) || defined(USE_OVLx) -# define STATIC_PTR -#else -# define STATIC_PTR static -#endif - /* The function argument to qsort() requires a particular * calling convention under WINCE which is not the default * in that environment. diff --git a/include/macwin.h b/include/macwin.h index 4ae5d9e13..8af062b01 100644 --- a/include/macwin.h +++ b/include/macwin.h @@ -167,7 +167,7 @@ extern Boolean RetrievePosition (short, short *, short *); extern Boolean RetrieveSize (short, short, short, short *, short *); extern void SaveWindowPos (WindowPtr); extern void SaveWindowSize (WindowPtr); -extern Boolean FDECL(RetrieveWinPos, (WindowPtr, short *, short *)); +extern Boolean RetrieveWinPos(WindowPtr, short *, short *); /* ### macerrs.c ### */ @@ -183,8 +183,8 @@ extern void attemptingto(char *); /* ### macfile.c ### */ /* extern char *macgets(int fd, char *ptr, unsigned len); unused */ -extern void FDECL(C2P, (const char *c, unsigned char *p)); -extern void FDECL(P2C, (const unsigned char *p, char *c)); +extern void C2P(const char *c, unsigned char *p); +extern void P2C(const unsigned char *p, char *c); /* ### macmenu.c ### */ @@ -196,50 +196,50 @@ extern void AdjustMenus(short); /* ### macmain.c ### */ -extern void FDECL (process_openfile, (short s_vol, long s_dir, Str255 fNm, OSType ft)); +extern void process_openfile(short s_vol, long s_dir, Str255 fNm, OSType ft); /* ### macwin.c ### */ extern void AddToKeyQueue(unsigned char, Boolean); extern unsigned char GetFromKeyQueue (void); void trans_num_keys (EventRecord *); -extern void NDECL (InitMac); -int FDECL (try_key_queue, (char *)); -void FDECL (enter_topl_mode, (char *)); -void FDECL (leave_topl_mode, (char *)); -void FDECL (topl_set_resp, (char *, char)); -Boolean FDECL (topl_key, (unsigned char, Boolean)); -E void FDECL(HandleEvent, (EventRecord *)); /* used in mmodal.c */ -extern void NDECL(port_help); +extern void InitMac(void); +int try_key_queue(char *); +void enter_topl_mode(char *); +void leave_topl_mode(char *); +void topl_set_resp(char *, char); +Boolean topl_key(unsigned char, Boolean); +E void HandleEvent(EventRecord *); /* used in mmodal.c */ +extern void port_help(); extern Boolean small_screen; -E void FDECL(mac_init_nhwindows, (int *, char **)); -E void NDECL(mac_askname); -E void NDECL(mac_get_nh_event); -E void FDECL(mac_exit_nhwindows, (const char *)); -E winid FDECL(mac_create_nhwindow, (int)); -E void FDECL(mac_clear_nhwindow, (winid)); -E void FDECL(mac_display_nhwindow, (winid, BOOLEAN_P)); -E void FDECL(mac_destroy_nhwindow, (winid)); -E void FDECL(mac_curs, (winid, int, int)); -E void FDECL(mac_putstr, (winid, int, const char *)); -E void FDECL(mac_start_menu, (winid)); -E void FDECL(mac_add_menu, (winid, int, const anything *, - CHAR_P, CHAR_P, int, const char *, BOOLEAN_P)); -E void FDECL(mac_end_menu, (winid, const char *)); -E int FDECL(mac_select_menu, (winid, int, menu_item **)); +E void mac_init_nhwindows(int *, char **); +E void mac_askname(); +E void mac_get_nh_event(); +E void mac_exit_nhwindows(const char *); +E winid mac_create_nhwindow(int); +E void mac_clear_nhwindow(winid); +E void mac_display_nhwindow(winid, BOOLEAN_P); +E void mac_destroy_nhwindow(winid); +E void mac_curs(winid, int, int); +E void mac_putstr(winid, int, const char *); +E void mac_start_menu(winid); +E void mac_add_menu(winid, int, const anything *, + CHAR_P, CHAR_P, int, const char *, BOOLEAN_P); +E void mac_end_menu(winid, const char *); +E int mac_select_menu(winid, int, menu_item **); #ifdef CLIPPING -E void FDECL(mac_cliparound, (int, int)); +E void mac_cliparound(int, int); #endif -E int NDECL(mac_nhgetch); -E int FDECL(mac_nh_poskey, (int *, int *, int *)); -E int NDECL(mac_doprev_message); -E char FDECL(mac_yn_function, (const char *, const char *, CHAR_P)); -E void FDECL(mac_getlin, (const char *, char *)); -E int NDECL(mac_get_ext_cmd); -E void FDECL(mac_number_pad, (int)); -E void NDECL(mac_delay_output); +E int mac_nhgetch(); +E int mac_nh_poskey(int *, int *, int *); +E int mac_doprev_message(); +E char mac_yn_function(const char *, const char *, CHAR_P); +E void mac_getlin(const char *, char *); +E int mac_get_ext_cmd(); +E void mac_number_pad(int); +E void mac_delay_output(); #undef E diff --git a/include/mextra.h b/include/mextra.h index a584fb46c..9c3dfd018 100644 --- a/include/mextra.h +++ b/include/mextra.h @@ -24,8 +24,8 @@ * function in an appropriate new or existing source file and add * a prototype for it to include/extern.h. * - * void FDECL(newXX, (struct monst *)); - * void FDECL(free_XX, (struct monst *)); + * void newXX(struct monst *); + * void free_XX(struct monst *); * * void * newXX(mtmp) diff --git a/include/ntconf.h b/include/ntconf.h index b8bcb6cc5..d27619c56 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -62,8 +62,8 @@ /* Stuff to help the user with some common, yet significant errors */ #define INTERJECT_PANIC 0 #define INTERJECTION_TYPES (INTERJECT_PANIC + 1) -extern void FDECL(interject_assistance, (int, int, genericptr_t, genericptr_t)); -extern void FDECL(interject, (int)); +extern void interject_assistance(int, int, genericptr_t, genericptr_t); +extern void interject(int); /* The following is needed for prototypes of certain functions */ #if defined(_MSC_VER) @@ -128,12 +128,12 @@ extern char hackdir[]; #define ABORT C('a') #define getuid() 1 #define getlogin() ((char *)0) -extern void NDECL(win32_abort); +extern void win32_abort(); #ifdef WIN32CON -extern void FDECL(nttty_preference_update, (const char *)); -extern void NDECL(toggle_mouse_support); -extern void FDECL(map_subkeyvalue, (char *)); -extern void NDECL(load_keyboard_handler); +extern void nttty_preference_update(const char *); +extern void toggle_mouse_support(); +extern void map_subkeyvalue(char *); +extern void load_keyboard_handler(); #endif #include @@ -186,7 +186,7 @@ int _RTLENTRY _EXPFUNC read (int __handle, void _FAR *__buf, unsigned __len); #endif #endif -extern int FDECL(set_win32_option, (const char *, const char *)); +extern int set_win32_option(const char *, const char *); #ifdef WIN32CON #define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED diff --git a/include/obj.h b/include/obj.h index 413b60395..9c7c530a8 100644 --- a/include/obj.h +++ b/include/obj.h @@ -426,8 +426,8 @@ struct obj { * for it to include/extern.h. The majority of these are currently * located in mkobj.c for convenience. * - * void FDECL(newXX, (struct obj *)); - * void FDECL(free_XX, (struct obj *)); + * void newXX(struct obj *); + * void free_XX(struct obj *); * * void * newxx(otmp) diff --git a/include/pcconf.h b/include/pcconf.h index 75e3a08e2..2e1c5088f 100644 --- a/include/pcconf.h +++ b/include/pcconf.h @@ -243,15 +243,6 @@ # endif #endif -#if defined(FUNCTION_LEVEL_LINKING) -#define OVERLAY -#define OVL0 -#define OVL1 -#define OVL2 -#define OVL3 -#define OVLB -#endif - #if defined(OVERLAY) && !defined(MOVERLAY) && !defined(VROOMM) && !defined(FUNCTION_LEVEL_LINKING) #define USE_TRAMPOLI #endif diff --git a/include/region.h b/include/region.h index 460cdbab4..074212b62 100644 --- a/include/region.h +++ b/include/region.h @@ -7,7 +7,7 @@ /* generic callback function */ -typedef boolean FDECL ((*callback_proc), (genericptr_t, genericptr_t)); +typedef boolean (*callback_proc)(genericptr_t, genericptr_t); /* * Overload the old player_inside field with two values, coded in such diff --git a/include/system.h b/include/system.h index f01b0b0e7..40b049935 100644 --- a/include/system.h +++ b/include/system.h @@ -93,13 +93,13 @@ typedef long off_t; # undef random # endif # if !defined(__SC__) && !defined(LINUX) -E long NDECL(random); +E long random(); # endif # if (!defined(SUNOS4) && !defined(bsdi) && !defined(__FreeBSD__) && !defined(__NetBSD__)) || defined(RANDOM) -E void FDECL(srandom, (unsigned int)); +E void srandom(unsigned int); # else # if !defined(bsdi) && !defined(__FreeBSD__) && !defined(__NetBSD__) -E int FDECL(srandom, (unsigned int)); +E int srandom(unsigned int); # endif # endif #else @@ -111,7 +111,7 @@ E void srand48(); #if !defined(BSD) || defined(ultrix) /* real BSD wants all these to return int */ # ifndef MICRO -E void FDECL(exit, (int)); +E void exit(int); # endif /* MICRO */ /* compensate for some CSet/2 bogosities */ # if defined(OS2_CSET2) && defined(OS2_CSET2_VER_2) @@ -130,16 +130,16 @@ E void FDECL(exit, (int)); # if defined(__STDC__) || !defined(FLEX_SCANNER) # ifndef OS2_CSET2 # ifndef MONITOR_HEAP -E void FDECL(free, (genericptr_t)); +E void free(genericptr_t); # endif # endif # endif #if !defined(__SASC_60) && !defined(_DCC) && !defined(__SC__) # if defined(AMIGA) && !defined(AZTEC_50) && !defined(__GNUC__) -E int FDECL(perror, (const char *)); +E int perror(const char *); # else # if !(defined(ULTRIX_PROTO) && defined(__GNUC__)) -E void FDECL(perror, (const char *)); +E void perror(const char *); # endif # endif #endif @@ -147,15 +147,15 @@ E void FDECL(perror, (const char *)); #endif /* LEGACY_CODE */ #ifndef NeXT #ifdef POSIX_TYPES -E void FDECL(qsort, (genericptr_t, size_t, size_t, - int (*)(const genericptr, const genericptr))); +E void qsort(genericptr_t, size_t, size_t, + int (*)(const genericptr, const genericptr)); #else # if defined(BSD) || defined(ULTRIX) E int qsort(); # else # if !defined(LATTICE) && !defined(AZTEC_50) -E void FDECL(qsort, (genericptr_t, size_t, size_t, - int (*)(const genericptr, const genericptr))); +E void qsort(genericptr_t, size_t, size_t, + int (*)(const genericptr, const genericptr)); # endif # endif #endif @@ -167,37 +167,37 @@ E void FDECL(qsort, (genericptr_t, size_t, size_t, # ifdef ULTRIX # ifdef ULTRIX_PROTO -E int FDECL(lseek, (int, off_t, int)); +E int lseek(int, off_t, int); # else -E long FDECL(lseek, (int, off_t, int)); +E long lseek(int, off_t, int); # endif /* Ultrix 3.0 man page mistakenly says it returns an int. */ -E int FDECL(write, (int, char *, int)); -E int FDECL(link, (const char *, const char*)); +E int write(int, char *, int); +E int link(const char *, const char*); # else # ifndef bsdi -E long FDECL(lseek, (int, long, int)); +E long lseek(int, long, int); # endif # if defined(POSIX_TYPES) || defined(__TURBOC__) # ifndef bsdi -E int FDECL(write, (int, const void *, unsigned)); +E int write(int, const void *, unsigned); # endif # else # ifndef __MWERKS__ /* metrowerks defines write via universal headers */ -E int FDECL(write, (int, genericptr_t, unsigned)); +E int write(int, genericptr_t, unsigned); # endif # endif # endif /* ULTRIX */ # ifdef OS2_CSET2 /* IBM CSet/2 */ # ifdef OS2_CSET2_VER_1 -E int FDECL(unlink, (char *)); +E int unlink(char *); # else -E int FDECL(unlink, (const char *)); /* prototype is ok in ver >= 2 */ +E int unlink(const char *); /* prototype is ok in ver >= 2 */ # endif # else # ifndef __SC__ -E int FDECL(unlink, (const char *)); +E int unlink(const char *); # endif # endif @@ -205,87 +205,87 @@ E int FDECL(unlink, (const char *)); #ifdef MAC #ifndef __CONDITIONALMACROS__ /* universal headers */ -E int FDECL(close, (int)); /* unistd.h */ -E int FDECL(read, (int, char *, int)); /* unistd.h */ -E int FDECL(chdir, (const char *)); /* unistd.h */ -E char *FDECL(getcwd, (char *, int)); /* unistd.h */ +E int close(int); /* unistd.h */ +E int read(int, char *, int); /* unistd.h */ +E int chdir(const char *); /* unistd.h */ +E char *getcwd(char *, int); /* unistd.h */ #endif -E int FDECL(open, (const char *, int)); +E int open(const char *, int); #endif #if defined(MICRO) -E int FDECL(close, (int)); +E int close(int); #ifndef __EMX__ -E int FDECL(read, (int, genericptr_t, unsigned int)); +E int read(int, genericptr_t, unsigned int); #endif -E int FDECL(open, (const char *, int, ...)); -E int FDECL(dup2, (int, int)); -E int FDECL(setmode, (int, int)); -E int NDECL(kbhit); +E int open(const char *, int, ...); +E int dup2(int, int); +E int setmode(int, int); +E int kbhit(); # if !defined(_DCC) # if defined(__TURBOC__) -E int FDECL(chdir, (const char *)); +E int chdir(const char *); # else # ifndef __EMX__ -E int FDECL(chdir, (char *)); +E int chdir(char *); # endif # endif # ifndef __EMX__ -E char *FDECL(getcwd, (char *, int)); +E char *getcwd(char *, int); # endif # endif /* !_DCC */ #endif #ifdef ULTRIX -E int FDECL(close, (int)); -E int FDECL(atoi, (const char *)); -E int FDECL(chdir, (const char *)); +E int close(int); +E int atoi(const char *); +E int chdir(const char *); # if !defined(ULTRIX_CC20) && !defined(__GNUC__) -E int FDECL(chmod, (const char *, int)); -E mode_t FDECL(umask, (int)); +E int chmod(const char *, int); +E mode_t umask(int); # endif -E int FDECL(read, (int, genericptr_t, unsigned)); +E int read(int, genericptr_t, unsigned); /* these aren't quite right, but this saves including lots of system files */ -E int FDECL(stty, (int, genericptr_t)); -E int FDECL(gtty, (int, genericptr_t)); -E int FDECL(ioctl, (int, int, char*)); -E int FDECL(isatty, (int)); /* 1==yes, 0==no, -1==error */ +E int stty(int, genericptr_t); +E int gtty(int, genericptr_t); +E int ioctl(int, int, char*); +E int isatty(int); /* 1==yes, 0==no, -1==error */ #include # if defined(ULTRIX_PROTO) || defined(__GNUC__) -E int NDECL(fork); +E int fork(); # else -E long NDECL(fork); +E long fork(); # endif #endif /* ULTRIX */ #ifdef VMS # ifndef abs -E int FDECL(abs, (int)); +E int abs(int); # endif -E int FDECL(atexit, (void (*)(void))); -E int FDECL(atoi, (const char *)); -E int FDECL(chdir, (const char *)); -E int FDECL(chown, (const char *, unsigned, unsigned)); +E int atexit(void (*)(void)); +E int atoi(const char *); +E int chdir(const char *); +E int chown(const char *, unsigned, unsigned); # ifdef __DECC_VER -E int FDECL(chmod, (const char *, mode_t)); -E mode_t FDECL(umask, (mode_t)); +E int chmod(const char *, mode_t); +E mode_t umask(mode_t); # else -E int FDECL(chmod, (const char *, int)); -E int FDECL(umask, (int)); +E int chmod(const char *, int); +E int umask(int); # endif /* #include */ -E int FDECL(close, (int)); +E int close(int); E int VDECL(creat, (const char *, unsigned, ...)); -E int FDECL(delete, (const char *)); -E int FDECL(fstat, ( /*_ int, stat_t * _*/ )); -E int FDECL(isatty, (int)); /* 1==yes, 0==no, -1==error */ -E long FDECL(lseek, (int, long, int)); +E int delete(const char *); +E int fstat( /*_ int, stat_t * _*/ ); +E int isatty(int); /* 1==yes, 0==no, -1==error */ +E long lseek(int, long, int); E int VDECL(open, (const char *, int, unsigned, ...)); -E int FDECL(read, (int, genericptr_t, unsigned)); -E int FDECL(rename, (const char *, const char *)); -E int FDECL(stat, ( /*_ const char *,stat_t * _*/ )); -E int FDECL(write, (int, const genericptr, unsigned)); +E int read(int, genericptr_t, unsigned); +E int rename(const char *, const char *); +E int stat( /*_ const char *,stat_t * _*/ ); +E int write(int, const genericptr, unsigned); #endif #endif /* __SASC_60 */ @@ -295,19 +295,19 @@ E int FDECL(write, (int, const genericptr, unsigned)); E void abort(); E void bcopy(); # ifdef ULTRIX -E int FDECL(system, (const char *)); +E int system(const char *); # ifndef _UNISTD_H_ -E int FDECL(execl, (const char *, ...)); +E int execl(const char *, ...); # endif # endif #endif #ifdef MICRO -E void NDECL(abort); -E void FDECL(_exit, (int)); -E int FDECL(system, (const char *)); +E void abort(); +E void _exit(int); +E int system(const char *); #endif #if defined(HPUX) && !defined(_POSIX_SOURCE) -E long NDECL(fork); +E long fork(); #endif #ifdef POSIX_TYPES @@ -318,9 +318,9 @@ E long NDECL(fork); # if defined(NHSTDC) || (defined(VMS) && !defined(ANCIENT_VAXC)) # if !defined(_AIX32) && !(defined(SUNOS4) && defined(__STDC__)) /* Solaris unbundled cc (acc) */ -E int FDECL(memcmp, (const void *, const void *, size_t)); -E void *FDECL(memcpy, (void *, const void *, size_t)); -E void *FDECL(memset, (void *, int, size_t)); +E int memcmp(const void *, const void *, size_t); +E void *memcpy(void *, const void *, size_t); +E void *memset(void *, int, size_t); # endif # else # ifndef memcmp /* some systems seem to macro these back to b*() */ @@ -335,27 +335,27 @@ E char *memset(); # endif #else # ifdef HPUX -E int FDECL(memcmp, (char *, char *, int)); -E void *FDECL(memcpy, (char *, char *, int)); -E void *FDECL(memset, (char*, int, int)); +E int memcmp(char *, char *, int); +E void *memcpy(char *, char *, int); +E void *memset(char*, int, int); # endif #endif #endif /* POSIX_TYPES */ #if defined(MICRO) && !defined(LATTICE) # if defined(TOS) && defined(__GNUC__) -E int FDECL(memcmp, (const void *, const void *, size_t)); -E void *FDECL(memcpy, (void *, const void *, size_t)); -E void *FDECL(memset, (void *, int, size_t)); +E int memcmp(const void *, const void *, size_t); +E void *memcpy(void *, const void *, size_t); +E void *memset(void *, int, size_t); # else # if defined(AZTEC_50) || defined(NHSTDC) || defined(WIN32) -E int FDECL(memcmp, (const void *, const void *, size_t)); -E void *FDECL(memcpy, (void *, const void *, size_t)); -E void *FDECL(memset, (void *, int, size_t)); +E int memcmp(const void *, const void *, size_t); +E void *memcpy(void *, const void *, size_t); +E void *memset(void *, int, size_t); # else -E int FDECL(memcmp, (char *, char *, unsigned int)); -E char *FDECL(memcpy, (char *, char *, unsigned int)); -E char *FDECL(memset, (char*, int, int)); +E int memcmp(char *, char *, unsigned int); +E char *memcpy(char *, char *, unsigned int); +E char *memset(char*, int, int); # endif /* AZTEC_50 || NHSTDC */ # endif /* TOS */ #endif /* MICRO */ @@ -367,40 +367,40 @@ E void sleep(); E unsigned sleep(); #endif #if defined(HPUX) -E unsigned int FDECL(sleep, (unsigned int)); +E unsigned int sleep(unsigned int); #endif #ifdef VMS -E int FDECL(sleep, (unsigned)); +E int sleep(unsigned); #endif -E char *FDECL(getenv, (const char *)); +E char *getenv(const char *); E char *getlogin(); #if defined(HPUX) && !defined(_POSIX_SOURCE) -E long NDECL(getuid); -E long NDECL(getgid); -E long NDECL(getpid); +E long getuid(); +E long getgid(); +E long getpid(); #else # ifdef POSIX_TYPES -E pid_t NDECL(getpid); -E uid_t NDECL(getuid); -E gid_t NDECL(getgid); +E pid_t getpid(); +E uid_t getuid(); +E gid_t getgid(); # ifdef VMS -E pid_t NDECL(getppid); +E pid_t getppid(); # endif # else /*!POSIX_TYPES*/ # ifndef getpid /* Borland C defines getpid() as a macro */ -E int NDECL(getpid); +E int getpid(); # endif # ifdef VMS -E int NDECL(getppid); -E unsigned NDECL(getuid); -E unsigned NDECL(getgid); +E int getppid(); +E unsigned getuid(); +E unsigned getgid(); # endif # if defined(ULTRIX) && !defined(_UNISTD_H_) -E unsigned NDECL(getuid); -E unsigned NDECL(getgid); -E int FDECL(setgid, (int)); -E int FDECL(setuid, (int)); +E unsigned getuid(); +E unsigned getgid(); +E int setgid(int); +E int setuid(int); # endif # endif /*?POSIX_TYPES*/ #endif /*?(HPUX && !_POSIX_SOURCE)*/ @@ -417,30 +417,30 @@ E int FDECL(setuid, (int)); #if (defined(ULTRIX) || defined(NeXT)) && defined(__GNUC__) #include #else -E char *FDECL(strcpy, (char *, const char *)); -E char *FDECL(strncpy, (char *, const char *, size_t)); -E char *FDECL(strcat, (char *, const char *)); -E char *FDECL(strncat, (char *, const char *, size_t)); -E char *FDECL(strpbrk, (const char *, const char *)); +E char *strcpy(char *, const char *); +E char *strncpy(char *, const char *, size_t); +E char *strcat(char *, const char *); +E char *strncat(char *, const char *, size_t); +E char *strpbrk(const char *, const char *); # if defined(SYSV) || defined(MICRO) || defined(MAC) || defined(VMS) || defined(HPUX) -E char *FDECL(strchr, (const char *, int)); -E char *FDECL(strrchr, (const char *, int)); +E char *strchr(const char *, int); +E char *strrchr(const char *, int); # else /* BSD */ -E char *FDECL(index, (const char *, int)); -E char *FDECL(rindex, (const char *, int)); +E char *index(const char *, int); +E char *rindex(const char *, int); # endif -E int FDECL(strcmp, (const char *, const char *)); -E int FDECL(strncmp, (const char *, const char *, size_t)); +E int strcmp(const char *, const char *); +E int strncmp(const char *, const char *, size_t); # if defined(MICRO) || defined(MAC) || defined(VMS) -E size_t FDECL(strlen, (const char *)); +E size_t strlen(const char *); # else # ifdef HPUX -E unsigned int FDECL(strlen, (char *)); +E unsigned int strlen(char *); # else # if !(defined(ULTRIX_PROTO) && defined(__GNUC__)) -E int FDECL(strlen, (const char *)); +E int strlen(const char *); # endif # endif /* HPUX */ # endif /* MICRO */ @@ -449,8 +449,8 @@ E int FDECL(strlen, (const char *)); #endif /* !_XtIntrinsic_h_ && !POSIX_TYPES */ #if defined(ULTRIX) && defined(__GNUC__) -E char *FDECL(index, (const char *, int)); -E char *FDECL(rindex, (const char *, int)); +E char *index(const char *, int); +E char *rindex(const char *, int); #endif /* Old varieties of BSD have char *sprintf(). @@ -478,7 +478,7 @@ E char *FDECL(rindex, (const char *, int)); #ifndef SPRINTF_PROTO # if defined(POSIX_TYPES) || defined(DGUX) || defined(NeXT) || !defined(BSD) -E int FDECL(sprintf, (char *, const char *, ...)); +E int sprintf(char *, const char *, ...); # else # define OLD_SPRINTF E char *sprintf(); @@ -494,9 +494,9 @@ E char *sprintf(); # if !defined(SVR4) && !defined(apollo) # if !(defined(ULTRIX_PROTO) && defined(__GNUC__)) # if !(defined(SUNOS4) && defined(__STDC__)) /* Solaris unbundled cc (acc) */ -E int FDECL(vsprintf, (char *, const char *, va_list)); -E int FDECL(vfprintf, (FILE *, const char *, va_list)); -E int FDECL(vprintf, (const char *, va_list)); +E int vsprintf(char *, const char *, va_list); +E int vfprintf(FILE *, const char *, va_list); +E int vprintf(const char *, va_list); # endif # endif # endif @@ -510,25 +510,25 @@ E int FDECL(vprintf, (const char *, va_list)); #ifdef MICRO -E int FDECL(tgetent, (const char *, const char *)); -E void FDECL(tputs, (const char *, int, int (*)())); -E int FDECL(tgetnum, (const char *)); -E int FDECL(tgetflag, (const char *)); -E char *FDECL(tgetstr, (const char *, char **)); -E char *FDECL(tgoto, (const char *, int, int)); +E int tgetent(const char *, const char *); +E void tputs(const char *, int, int (*)()); +E int tgetnum(const char *); +E int tgetflag(const char *); +E char *tgetstr(const char *, char **); +E char *tgoto(const char *, int, int); #else # if !(defined(HPUX) && defined(_POSIX_SOURCE)) -E int FDECL(tgetent, (char *, const char *)); -E void FDECL(tputs, (const char *, int, int (*)())); +E int tgetent(char *, const char *); +E void tputs(const char *, int, int (*)()); # endif -E int FDECL(tgetnum, (const char *)); -E int FDECL(tgetflag, (const char *)); -E char *FDECL(tgetstr, (const char *, char **)); -E char *FDECL(tgoto, (const char *, int, int)); +E int tgetnum(const char *); +E int tgetflag(const char *); +E char *tgetstr(const char *, char **); +E char *tgoto(const char *, int, int); #endif #ifdef ALLOC_C -E genericptr_t FDECL(malloc, (size_t)); +E genericptr_t malloc(size_t); #endif /* time functions */ @@ -536,20 +536,20 @@ E genericptr_t FDECL(malloc, (size_t)); #ifdef LEGACY_CODE # ifndef LATTICE # if !(defined(ULTRIX_PROTO) && defined(__GNUC__)) -E struct tm *FDECL(localtime, (const time_t *)); +E struct tm *localtime(const time_t *); # endif # endif # if defined(ULTRIX) || (defined(BSD) && defined(POSIX_TYPES)) || defined(SYSV) || defined(MICRO) || defined(VMS) || defined(MAC) || (defined(HPUX) && defined(_POSIX_SOURCE)) -E time_t FDECL(time, (time_t *)); +E time_t time(time_t *); # else -E long FDECL(time, (time_t *)); +E long time(time_t *); # endif /* ULTRIX */ #endif /* LEGACY_CODE */ #ifdef VMS /* used in makedefs.c, but missing from gcc-vms's */ -E char *FDECL(ctime, (const time_t *)); +E char *ctime(const time_t *); #endif @@ -557,11 +557,11 @@ E char *FDECL(ctime, (const time_t *)); # ifdef abs # undef abs # endif -E int FDECL(abs, (int)); +E int abs(int); # ifdef atoi # undef atoi # endif -E int FDECL(atoi, (const char *)); +E int atoi(const char *); #endif #undef E diff --git a/include/timeout.h b/include/timeout.h index 223f8a387..1b6d44b59 100644 --- a/include/timeout.h +++ b/include/timeout.h @@ -6,7 +6,7 @@ #define TIMEOUT_H /* generic timeout function */ -typedef void FDECL((*timeout_proc), (ANY_P *, long)); +typedef void (*timeout_proc)(ANY_P *, long); /* kind of timer */ enum timer_type { diff --git a/include/tosconf.h b/include/tosconf.h index 3e7ba07b0..5317bf271 100644 --- a/include/tosconf.h +++ b/include/tosconf.h @@ -54,8 +54,8 @@ */ #define STRNCMPI #undef strcmpi -extern int FDECL(strcmpi, (const char *, const char *)); -extern int FDECL(strncmpi, (const char *, const char *, size_t)); +extern int strcmpi(const char *, const char *); +extern int strncmpi(const char *, const char *, size_t); #endif #include diff --git a/include/tradstdc.h b/include/tradstdc.h index cf4b0304a..b4e6def11 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -178,18 +178,12 @@ typedef const char *vA; * Used for robust ANSI parameter forward declarations: * int VDECL(sprintf, (char *, const char *, ...)); * - * NDECL() is used for functions with zero arguments; - * FDECL() is used for functions with a fixed number of arguments; * VDECL() is used for functions with a variable number of arguments. * Separate macros are needed because ANSI will mix old-style declarations * with prototypes, except in the case of varargs, and the OVERLAY-specific * trampoli.* mechanism conflicts with the ANSI <> syntax. */ -# define NDECL(f) f(void) /* overridden later if USE_TRAMPOLI set */ - -# define FDECL(f, p) f p - # if defined(MSDOS) || defined(USE_STDARG) # define VDECL(f, p) f p # else @@ -237,8 +231,6 @@ typedef const char *vA; #else /* NHSTDC */ /* a "traditional" C compiler */ -# define NDECL(f) f() -# define FDECL(f, p) f() # define VDECL(f, p) f() # define VOID_ARGS /*empty*/ @@ -335,7 +327,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ #endif #endif -/* These are used for arguments within FDECL/VDECL prototype declarations. +/* These are used for arguments within VDECL prototype declarations. */ #ifdef UNWIDENED_PROTOTYPES #define CHAR_P char @@ -360,7 +352,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ #define ALIGNTYP_P int #else /* Neither widened nor unwidened prototypes. Argument list expansion - * by FDECL/VDECL always empty; all xxx_P vanish so defs aren't needed. */ + * by VDECL always empty; all xxx_P vanish so defs aren't needed. */ #endif #endif @@ -393,11 +385,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ * include files have prototypes and the compiler also complains that * prototyped and unprototyped declarations don't match. */ -# undef NDECL -# undef FDECL # undef VDECL -# define NDECL(f) f() -# define FDECL(f, p) f() # define VDECL(f, p) f() # undef VOID_ARGS # define VOID_ARGS /*empty*/ diff --git a/include/trampoli.h b/include/trampoli.h deleted file mode 100644 index c21de6972..000000000 --- a/include/trampoli.h +++ /dev/null @@ -1,332 +0,0 @@ -/* SCCS Id: @(#)trampoli.h 3.4 1995/06/01 */ -/* Copyright (c) 1989, by Norm Meluch and Stephen Spackman */ -/* NetHack may be freely redistributed. See license for details. */ - -#ifndef TRAMPOLI_H -#define TRAMPOLI_H - -#ifdef USE_TRAMPOLI - -/* ### apply.c ### */ -#define dig() dig_() -#define doapply() doapply_() -#define dojump() dojump_() -#define dorub() dorub_() - - -/* ### artifact.c ### */ -#define doinvoke() doinvoke_() - - -/* ### cmd.c ### */ -#define doextcmd() doextcmd_() -#define doextlist() doextlist_() -#define domonability() domonability_() -#define enter_explore_mode() enter_explore_mode_() -#define doprev_message() doprev_message_() -#define timed_occupation() timed_occupation_() -#define wiz_attributes() wiz_attributes_() -#ifdef WIZARD -#define wiz_detect() wiz_detect_() -#define wiz_genesis() wiz_genesis_() -#define wiz_identify() wiz_identify_() -#define wiz_level_tele() wiz_level_tele_() -#define wiz_map() wiz_map_() -#define wiz_where() wiz_where_() -#define wiz_wish() wiz_wish_() -#endif - -/* ### display.c ### */ -#define doredraw() doredraw_() - -/* ### do.c ### */ -#define doddrop() doddrop_() -#define dodown() dodown_() -#define dodrop() dodrop_() -#define donull() donull_() -#define doup() doup_() -#define dowipe() dowipe_() -#define drop(x) drop_(x) -#define wipeoff() wipeoff_() - - -/* ### do_name.c ### */ -#define ddocall() ddocall_() -#define do_mname() do_mname_() - - -/* ### do_wear.c ### */ -#define Armor_off() Armor_off_() -#define Boots_off() Boots_off_() -#define Gloves_off() Gloves_off_() -#define Helmet_off() Helmet_off_() -#define Armor_on() Armor_on_() -#define Boots_on() Boots_on_() -#define Gloves_on() Gloves_on_() -#define Helmet_on() Helmet_on_() -#define doddoremarm() doddoremarm_() -#define doputon() doputon_() -#define doremring() doremring_() -#define dotakeoff() dotakeoff_() -#define dowear() dowear_() -#define select_off(x) select_off_(x) -#define take_off() take_off_() - - -/* ### dogmove.c ### */ -#define wantdoor(x, y, dummy) wantdoor_(x, y, dummy) - - -/* ### dokick.c ### */ -#define dokick() dokick_() - - -/* ### dothrow.c ### */ -#define dothrow() dothrow_() - - -/* ### eat.c ### */ -#define Hear_again() Hear_again_() -#define eatmdone() eatmdone_() -#define doeat() doeat_() -#define eatfood() eatfood_() -#define opentin() opentin_() -#define unfaint() unfaint_() - - -/* ### end.c ### */ -#define done1(sig) done1_(sig) -#define done2() done2_() -#define done_intr(sig) done_intr_(sig) -#if defined(UNIX) || defined (VMS) || defined(__EMX__) -#define done_hangup(sig) done_hangup_(sig) -#endif - - -/* ### engrave.c ### */ -#define doengrave() doengrave_() - - -/* ### fountain.c ### */ -#define gush(x, y, poolcnt) gush_(x, y, poolcnt) - - -/* ### hack.c ### */ -#define dopickup() dopickup_() -#define identify(x) identify_(x) - - -/* ### invent.c ### */ -#define ckunpaid(x) ckunpaid_(x) -#define ddoinv() ddoinv_() -#define dolook() dolook_() -#define dopramulet() dopramulet_() -#define doprarm() doprarm_() -#define doprgold() doprgold_() -#define doprring() doprring_() -#define doprtool() doprtool_() -#define doprwep() doprwep_() -#define dotypeinv() dotypeinv_() -#define doorganize() doorganize_() - - -/* ### ioctl.c ### */ -#ifdef UNIX -# ifdef SUSPEND -#define dosuspend() dosuspend_() -# endif /* SUSPEND */ -#endif /* UNIX */ - - -/* ### lock.c ### */ -#define doclose() doclose_() -#define doforce() doforce_() -#define doopen() doopen_() -#define forcelock() forcelock_() -#define picklock() picklock_() - - -/* ### mklev.c ### */ -#define do_comp(x, y) comp_(x, y) - - -/* ### mondata.c ### */ -/* See comment in trampoli.c before uncommenting canseemon. */ -/* #define canseemon(x) canseemon_(x) */ - - -/* ### muse.c ### */ -#define mbhitm(x, y) mbhitm_(x, y) - - -/* ### o_init.c ### */ -#define dodiscovered() dodiscovered_() - - -/* ### objnam.c ### */ -#define doname(x) doname_(x) -#define xname(x) xname_(x) - - -/* ### options.c ### */ -#define doset() doset_() -#define dotogglepickup() dotogglepickup_() - - -/* ### pager.c ### */ -#define dohelp() dohelp_() -#define dohistory() dohistory_() -#ifdef UNIX -#define intruph() intruph_() -#endif /* UNIX */ -#define dowhatdoes() dowhatdoes_() -#define dowhatis() dowhatis_() -#define doquickwhatis() doquickwhatis_() - - -/* ### pcsys.c ### */ -#ifdef SHELL -#define dosh() dosh_() -#endif /* SHELL */ - - -/* ### pickup.c ### */ -#define ck_bag(x) ck_bag_(x) -#define doloot() doloot_() -#define in_container(x) in_container_(x) -#define out_container(x) out_container_(x) - - -/* ### potion.c ### */ -#define dodrink() dodrink_() -#define dodip() dodip_() - - -/* ### pray.c ### */ -#define doturn() doturn_() -#define dopray() dopray_() -#define prayer_done() prayer_done_() -#define dosacrifice() dosacrifice_() - - -/* ### read.c ### */ -#define doread() doread_() -#define set_lit(x, y, val) set_lit_(x, y, val) - - -/* ### rip.c ### */ -#define genl_outrip(tmpwin, how) genl_outrip_(tmpwin, how) - - -/* ### save.c ### */ -#define dosave() dosave_() -#if defined(UNIX) || defined (VMS) || defined(__EMX__) -#define hangup(sig) hangup_(sig) -#endif - - -/* ### search.c ### */ -#define doidtrap() doidtrap_() -#define dosearch() dosearch_() -#define findone(zx, zy, num) findone_(zx, zy, num) -#define openone(zx, zy, num) openone_(zx, zy, num) - - -/* ### shk.c ### */ -#define dopay() dopay_() - - -/* ### sit.c ### */ -#define dosit() dosit_() - - -/* ### sounds.c ### */ -#define dotalk() dotalk_() - - -/* ### spell.c ### */ -#define learn() learn_() -#define docast() docast_() -#define dovspell() dovspell_() - - -/* ### steal.c ### */ -#define stealarm() stealarm_() - - -/* ### trap.c ### */ -#define dotele() dotele_() -#define dountrap() dountrap_() -#define float_down() float_down_() - - -/* ### version.c ### */ -#define doversion() doversion_() -#define doextversion() doextversion_() - - -/* ### wield.c ### */ -#define dowield() dowield_() - - -/* ### zap.c ### */ -#define bhitm(x, y) bhitm_(x, y) -#define bhito(x, y) bhito_(x, y) -#define dozap() dozap_() - - -/* ### getline.c ### */ -#define tty_getlin(x, y) tty_getlin_(x, y) -#define tty_get_ext_cmd() tty_get_ext_cmd_() - - -/* ### termcap.c ### */ -#define tty_nhbell() tty_nhbell_() -#define tty_number_pad(x) tty_number_pad_(x) -#define tty_delay_output() tty_delay_output_() -#define tty_start_screen() tty_start_screen_() -#define tty_end_screen() tty_end_screen_() - - -/* ### topl.c ### */ -#define tty_doprev_message() tty_doprev_message_() -#define tty_yn_function(x, y, z) tty_yn_function_(x, y, z) - - -/* ### wintty.c ### */ -#define tty_init_nhwindows(x, y) tty_init_nhwindows_(x, y) -#define tty_player_selection() tty_player_selection_() -#define tty_askname() tty_askname_() -#define tty_get_nh_event() tty_get_nh_event_() -#define tty_exit_nhwindows(x) tty_exit_nhwindows_(x) -#define tty_suspend_nhwindows(x) tty_suspend_nhwindows_(x) -#define tty_resume_nhwindows() tty_resume_nhwindows_() -#define tty_create_nhwindow(x) tty_create_nhwindow_(x) -#define tty_clear_nhwindow(x) tty_clear_nhwindow_(x) -#define tty_display_nhwindow(x, y) tty_display_nhwindow_(x, y) -#define tty_destroy_nhwindow(x) tty_destroy_nhwindow_(x) -#define tty_curs(x, y, z) tty_curs_(x, y, z) -#define tty_putstr(x, y, z) tty_putstr_(x, y, z) -#define tty_display_file(x, y) tty_display_file_(x, y) -#define tty_start_menu(x) tty_start_menu_(x) -#define tty_add_menu(a, b, c, d, e, f, g, h, i) tty_add_menu_(a, b, c, d, e, f, g, h, i) -#define tty_end_menu(a, b) tty_end_menu_(a, b) -#define tty_select_menu(a, b, c) tty_select_menu_(a, b, c) -#define tty_update_inventory() tty_update_inventory_() -#define tty_mark_synch() tty_mark_synch_() -#define tty_wait_synch() tty_wait_synch_() -#ifdef CLIPPING -#define tty_cliparound(x, y) tty_cliparound_(x, y) -#endif -#ifdef POSITIONBAR -#define tty_update_positionbar(x) tty_update_positionbar_(x) -#endif -#define tty_print_glyph(a, b, c, d) tty_print_glyph_(a, b, c, d) -#define tty_raw_print(x) tty_raw_print_(x) -#define tty_raw_print_bold(x) tty_raw_print_bold_(x) -#define tty_nhgetch() tty_nhgetch_() -#define tty_nh_poskey(x, y, z) tty_nh_poskey_(x, y, z) - -#endif /* USE_TRAMPOLI */ - -#endif /* TRAMPOLI_H */ diff --git a/include/vmsconf.h b/include/vmsconf.h index 66bcf95eb..6adf66ed2 100644 --- a/include/vmsconf.h +++ b/include/vmsconf.h @@ -245,8 +245,8 @@ typedef __mode_t mode_t; #define ospeed vms_ospeed /* used in several files which don't #include "extern.h" */ -extern void FDECL(vms_exit, (int)); -extern int FDECL(vms_open, (const char *, int, unsigned)); +extern void vms_exit(int); +extern int vms_open(const char *, int, unsigned); #endif /* VMSCONF_H */ #endif /* VMS */ diff --git a/include/wceconf.h b/include/wceconf.h index 12b97ae9f..3a3b8d7e2 100644 --- a/include/wceconf.h +++ b/include/wceconf.h @@ -164,10 +164,10 @@ extern char hackdir[]; #define ABORT C('a') #define getuid() 1 #define getlogin() ((char *)0) -extern void NDECL(win32_abort); +extern void win32_abort(); #ifdef WIN32CON -extern void FDECL(nttty_preference_update, (const char *)); -extern void NDECL(toggle_mouse_support); +extern void nttty_preference_update(const char *); +extern void toggle_mouse_support(); #endif #ifndef alloca @@ -216,7 +216,7 @@ extern void NDECL(toggle_mouse_support); #define NH_A2W(a, w, cb) (strncpy((w), (a), (cb))) #endif -extern int FDECL(set_win32_option, (const char *, const char *)); +extern int set_win32_option(const char *, const char *); /* * 3.4.3 addition - Stuff to help the user with some common, yet significant errors diff --git a/include/winX.h b/include/winX.h index d23103b6e..12eb0b1f5 100644 --- a/include/winX.h +++ b/include/winX.h @@ -270,146 +270,146 @@ extern struct window_procs X11_procs; /* ### dialogs.c ### */ -E Widget FDECL(CreateDialog, (Widget, String, XtCallbackProc, XtCallbackProc)); -E void FDECL(SetDialogPrompt, (Widget, String)); -E String FDECL(GetDialogResponse, (Widget)); -E void FDECL(SetDialogResponse, (Widget, String)); -E void FDECL(positionpopup, (Widget, BOOLEAN_P)); +E Widget CreateDialog(Widget, String, XtCallbackProc, XtCallbackProc); +E void SetDialogPrompt(Widget, String); +E String GetDialogResponse(Widget); +E void SetDialogResponse(Widget, String); +E void positionpopup(Widget, BOOLEAN_P); /* ### winX.c ### */ -E struct xwindow *FDECL(find_widget, (Widget)); -E Boolean FDECL(nhApproxColor, (Screen*, Colormap, char*, XColor*)); -E Dimension FDECL(nhFontHeight, (Widget)); -E char FDECL(key_event_to_char, (XKeyEvent*)); -E void FDECL(msgkey, (Widget, XtPointer, XEvent*)); -E void FDECL(nh_XtPopup, (Widget, int, Widget)); -E void FDECL(nh_XtPopdown, (Widget)); -E void NDECL(win_X11_init); -E void FDECL(nh_keyscroll, (Widget, XEvent*, String*, Cardinal*)); +E struct xwindow *find_widget(Widget); +E Boolean nhApproxColor(Screen*, Colormap, char*, XColor*); +E Dimension nhFontHeight(Widget); +E char key_event_to_char(XKeyEvent*); +E void msgkey(Widget, XtPointer, XEvent*); +E void nh_XtPopup(Widget, int, Widget); +E void nh_XtPopdown(Widget); +E void win_X11_init(); +E void nh_keyscroll(Widget, XEvent*, String*, Cardinal*); /* ### winmesg.c ### */ -E void FDECL(set_message_slider, (struct xwindow*)); -E void FDECL(create_message_window, (struct xwindow*, BOOLEAN_P, Widget)); -E void FDECL(destroy_message_window, (struct xwindow*)); -E void FDECL(display_message_window, (struct xwindow*)); -E void FDECL(append_message, (struct xwindow*, const char*)); -E void FDECL(set_last_pause, (struct xwindow*)); +E void set_message_slider(struct xwindow*); +E void create_message_window(struct xwindow*, BOOLEAN_P, Widget); +E void destroy_message_window(struct xwindow*); +E void display_message_window(struct xwindow*); +E void append_message(struct xwindow*, const char*); +E void set_last_pause(struct xwindow*); /* ### winmap.c ### */ -E void NDECL(post_process_tiles); -E void FDECL(check_cursor_visibility, (struct xwindow*)); -E void FDECL(display_map_window, (struct xwindow*)); -E void FDECL(clear_map_window, (struct xwindow*)); -E void FDECL(map_input, (Widget, XEvent*, String*, Cardinal*)); -E void FDECL(set_map_size, (struct xwindow*, DIMENSION_P, DIMENSION_P)); -E void FDECL(create_map_window, (struct xwindow*, BOOLEAN_P, Widget)); -E void FDECL(destroy_map_window, (struct xwindow*)); -E int FDECL(x_event, (int)); +E void post_process_tiles(); +E void check_cursor_visibility(struct xwindow*); +E void display_map_window(struct xwindow*); +E void clear_map_window(struct xwindow*); +E void map_input(Widget, XEvent*, String*, Cardinal*); +E void set_map_size(struct xwindow*, DIMENSION_P, DIMENSION_P); +E void create_map_window(struct xwindow*, BOOLEAN_P, Widget); +E void destroy_map_window(struct xwindow*); +E int x_event(int); /* ### winmenu.c ### */ -E void FDECL(menu_delete, (Widget, XEvent*, String*, Cardinal*)); -E void FDECL(menu_key, (Widget, XEvent*, String*, Cardinal*)); -E void FDECL(create_menu_window, (struct xwindow*)); -E void FDECL(destroy_menu_window, (struct xwindow*)); +E void menu_delete(Widget, XEvent*, String*, Cardinal*); +E void menu_key(Widget, XEvent*, String*, Cardinal*); +E void create_menu_window(struct xwindow*); +E void destroy_menu_window(struct xwindow*); /* ### winmisc.c ### */ -E void FDECL(ps_key, (Widget, XEvent*, String*, Cardinal*)); /* player selection action */ -E void FDECL(race_key, (Widget, XEvent*, String*, Cardinal*)); /* race selection action */ -E void FDECL(gend_key, (Widget, XEvent *, String *, Cardinal *)); /* gender */ -E void FDECL(algn_key, (Widget, XEvent *, String *, Cardinal *)); /* alignment */ -E void FDECL(ec_delete, (Widget, XEvent*, String*, Cardinal*)); -E void FDECL(ec_key, (Widget, XEvent*, String*, Cardinal*)); /* extended command action */ +E void ps_key(Widget, XEvent*, String*, Cardinal*); /* player selection action */ +E void race_key(Widget, XEvent*, String*, Cardinal*); /* race selection action */ +E void gend_key(Widget, XEvent *, String *, Cardinal *); /* gender */ +E void algn_key(Widget, XEvent *, String *, Cardinal *); /* alignment */ +E void ec_delete(Widget, XEvent*, String*, Cardinal*); +E void ec_key(Widget, XEvent*, String*, Cardinal*); /* extended command action */ /* ### winstatus.c ### */ -E void FDECL(create_status_window, (struct xwindow*, BOOLEAN_P, Widget)); -E void FDECL(destroy_status_window, (struct xwindow*)); -E void FDECL(adjust_status, (struct xwindow*, const char*)); -E void NDECL(null_out_status); -E void NDECL(check_turn_events); +E void create_status_window(struct xwindow*, BOOLEAN_P, Widget); +E void destroy_status_window(struct xwindow*); +E void adjust_status(struct xwindow*, const char*); +E void null_out_status(); +E void check_turn_events(); /* ### wintext.c ### */ -E void FDECL(delete_text, (Widget, XEvent*, String*, Cardinal*)); -E void FDECL(dismiss_text, (Widget, XEvent*, String*, Cardinal*)); -E void FDECL(key_dismiss_text, (Widget, XEvent*, String*, Cardinal*)); +E void delete_text(Widget, XEvent*, String*, Cardinal*); +E void dismiss_text(Widget, XEvent*, String*, Cardinal*); +E void key_dismiss_text(Widget, XEvent*, String*, Cardinal*); #ifdef GRAPHIC_TOMBSTONE -E void FDECL(rip_dismiss_text, (Widget, XEvent*, String*, Cardinal*)); +E void rip_dismiss_text(Widget, XEvent*, String*, Cardinal*); #endif -E void FDECL(add_to_text_window, (struct xwindow*, int, const char*)); -E void FDECL(display_text_window, (struct xwindow*, BOOLEAN_P)); -E void FDECL(create_text_window, (struct xwindow*)); -E void FDECL(destroy_text_window, (struct xwindow*)); -E void FDECL(clear_text_window, (struct xwindow*)); -E void FDECL(append_text_buffer, (struct text_buffer*, const char*, BOOLEAN_P)); /* text buffer routines */ -E void FDECL(init_text_buffer, (struct text_buffer*)); -E void FDECL(clear_text_buffer, (struct text_buffer*)); -E void FDECL(free_text_buffer, (struct text_buffer*)); +E void add_to_text_window(struct xwindow*, int, const char*); +E void display_text_window(struct xwindow*, BOOLEAN_P); +E void create_text_window(struct xwindow*); +E void destroy_text_window(struct xwindow*); +E void clear_text_window(struct xwindow*); +E void append_text_buffer(struct text_buffer*, const char*, BOOLEAN_P); /* text buffer routines */ +E void init_text_buffer(struct text_buffer*); +E void clear_text_buffer(struct text_buffer*); +E void free_text_buffer(struct text_buffer*); #ifdef GRAPHIC_TOMBSTONE -E void FDECL(calculate_rip_text, (int)); +E void calculate_rip_text(int); #endif /* ### winval.c ### */ -E Widget FDECL(create_value, (Widget, const char*)); -E void FDECL(set_name, (Widget, char*)); -E void FDECL(set_name_width, (Widget, int)); -E int FDECL(get_name_width, (Widget)); -E void FDECL(set_value, (Widget, const char*)); -E void FDECL(set_value_width, (Widget, int)); -E int FDECL(get_value_width, (Widget)); -E void FDECL(hilight_value, (Widget)); -E void FDECL(swap_fg_bg, (Widget)); +E Widget create_value(Widget, const char*); +E void set_name(Widget, char*); +E void set_name_width(Widget, int); +E int get_name_width(Widget); +E void set_value(Widget, const char*); +E void set_value_width(Widget, int); +E int get_value_width(Widget); +E void hilight_value(Widget); +E void swap_fg_bg(Widget); /* external declarations */ -E void FDECL(X11_init_nhwindows, (int *, char **)); -E void NDECL(X11_player_selection); -E void NDECL(X11_askname); -E void NDECL(X11_get_nh_event); -E void FDECL(X11_exit_nhwindows, (const char *)); -E void FDECL(X11_suspend_nhwindows, (const char *)); -E void NDECL(X11_resume_nhwindows); -E winid FDECL(X11_create_nhwindow, (int)); -E void FDECL(X11_clear_nhwindow, (winid)); -E void FDECL(X11_display_nhwindow, (winid, BOOLEAN_P)); -E void FDECL(X11_destroy_nhwindow, (winid)); -E void FDECL(X11_curs, (winid, int, int)); -E void FDECL(X11_putstr, (winid, int, const char *)); +E void X11_init_nhwindows(int *, char **); +E void X11_player_selection(); +E void X11_askname(); +E void X11_get_nh_event(); +E void X11_exit_nhwindows(const char *); +E void X11_suspend_nhwindows(const char *); +E void X11_resume_nhwindows(); +E winid X11_create_nhwindow(int); +E void X11_clear_nhwindow(winid); +E void X11_display_nhwindow(winid, BOOLEAN_P); +E void X11_destroy_nhwindow(winid); +E void X11_curs(winid, int, int); +E void X11_putstr(winid, int, const char *); #ifdef FILE_AREAS -E void FDECL(X11_display_file, (const char *, const char *, BOOLEAN_P)); +E void X11_display_file(const char *, const char *, BOOLEAN_P); #else -E void FDECL(X11_display_file, (const char *, BOOLEAN_P)); +E void X11_display_file(const char *, BOOLEAN_P); #endif -E void FDECL(X11_start_menu, (winid)); -E void FDECL(X11_add_menu, (winid, int, int, const ANY_P *, - CHAR_P, CHAR_P, int, const char *, unsigned int)); -E void FDECL(X11_end_menu, (winid, const char *)); -E int FDECL(X11_select_menu, (winid, int, MENU_ITEM_P **)); -E void NDECL(X11_update_inventory); -E void NDECL(X11_mark_synch); -E void NDECL(X11_wait_synch); +E void X11_start_menu(winid); +E void X11_add_menu(winid, int, int, const ANY_P *, + CHAR_P, CHAR_P, int, const char *, unsigned int); +E void X11_end_menu(winid, const char *); +E int X11_select_menu(winid, int, MENU_ITEM_P **); +E void X11_update_inventory(); +E void X11_mark_synch(); +E void X11_wait_synch(); #ifdef CLIPPING -E void FDECL(X11_cliparound, (int, int)); +E void X11_cliparound(int, int); #endif -E void FDECL(X11_print_glyph, (winid, XCHAR_P, XCHAR_P, int, int)); -E void FDECL(X11_raw_print, (const char *)); -E void FDECL(X11_raw_print_bold, (const char *)); -E int NDECL(X11_nhgetch); -E int FDECL(X11_nh_poskey, (int *, int *, int *)); -E void NDECL(X11_nhbell); -E int NDECL(X11_doprev_message); -E char FDECL(X11_yn_function, (const char *, const char *, CHAR_P)); -E void FDECL(X11_getlin, (const char *, char *)); -E int NDECL(X11_get_ext_cmd); -E void FDECL(X11_number_pad, (int)); -E void NDECL(X11_delay_output); +E void X11_print_glyph(winid, XCHAR_P, XCHAR_P, int, int); +E void X11_raw_print(const char *); +E void X11_raw_print_bold(const char *); +E int X11_nhgetch(); +E int X11_nh_poskey(int *, int *, int *); +E void X11_nhbell(); +E int X11_doprev_message(); +E char X11_yn_function(const char *, const char *, CHAR_P); +E void X11_getlin(const char *, char *); +E int X11_get_ext_cmd(); +E void X11_number_pad(int); +E void X11_delay_output(); /* other defs that really should go away (they're tty specific) */ -E void NDECL(X11_start_screen); -E void NDECL(X11_end_screen); +E void X11_start_screen(); +E void X11_end_screen(); #ifdef GRAPHIC_TOMBSTONE -E void FDECL(X11_outrip, (winid, int)); +E void X11_outrip(winid, int); #else -E void FDECL(genl_outrip, (winid, int)); +E void genl_outrip(winid, int); #endif #endif /* WINX_H */ diff --git a/include/wingem.h b/include/wingem.h index c27983398..2e2507c95 100644 --- a/include/wingem.h +++ b/include/wingem.h @@ -25,87 +25,87 @@ extern struct window_procs Gem_procs; /* ### wingem1.c ### */ #ifdef CLIPPING -E void NDECL(setclipped); +E void setclipped(); #endif -E void FDECL(docorner, (int, int)); -E void NDECL(end_glyphout); -E void FDECL(g_putch, (int)); -E void NDECL(win_Gem_init); -E int NDECL(mar_gem_init); -E char NDECL(mar_ask_class); -E char * NDECL(mar_ask_name); -E int FDECL(mar_create_window, (int)); -E void FDECL(mar_destroy_nhwindow, (int)); -E void FDECL(mar_print_glyph, (int, int, int, int)); -E void FDECL(mar_print_line, (int, int, int, char *)); -E void FDECL(mar_set_message, (char *, char *, char *)); -E Gem_menu_item *NDECL(mar_hol_inv); -E void FDECL(mar_set_menu_type, (int)); -E void NDECL(mar_reverse_menu); -E void FDECL(mar_set_menu_title, (const char *)); -E void NDECL(mar_set_accelerators); -E void FDECL(mar_add_menu, (winid, Gem_menu_item *)); -E void FDECL(mar_change_menu_2_text, (winid)); -E void FDECL(mar_add_message, (const char *)); -E void NDECL(mar_status_dirty); -E int FDECL(mar_hol_win_type, (int)); -E void NDECL(mar_clear_messagewin); -E void FDECL(mar_set_no_glyph, (int)); -E void NDECL(mar_map_curs_weiter); +E void docorner(int, int); +E void end_glyphout(); +E void g_putch(int); +E void win_Gem_init(); +E int mar_gem_init(); +E char mar_ask_class(); +E char * mar_ask_name(); +E int mar_create_window(int); +E void mar_destroy_nhwindow(int); +E void mar_print_glyph(int, int, int, int); +E void mar_print_line(int, int, int, char *); +E void mar_set_message(char *, char *, char *); +E Gem_menu_item *mar_hol_inv(); +E void mar_set_menu_type(int); +E void mar_reverse_menu(); +E void mar_set_menu_title(const char *); +E void mar_set_accelerators(); +E void mar_add_menu(winid, Gem_menu_item *); +E void mar_change_menu_2_text(winid); +E void mar_add_message(const char *); +E void mar_status_dirty(); +E int mar_hol_win_type(int); +E void mar_clear_messagewin(); +E void mar_set_no_glyph(int); +E void mar_map_curs_weiter(); /* external declarations */ -E void FDECL(Gem_init_nhwindows, (int *, char **)); -E void NDECL(Gem_player_selection); -E void NDECL(Gem_askname); -E void NDECL(Gem_get_nh_event); -E void FDECL(Gem_exit_nhwindows, (const char *)); -E void FDECL(Gem_suspend_nhwindows, (const char *)); -E void NDECL(Gem_resume_nhwindows); -E winid FDECL(Gem_create_nhwindow, (int)); -E void FDECL(Gem_clear_nhwindow, (winid)); -E void FDECL(Gem_display_nhwindow, (winid, BOOLEAN_P)); -E void FDECL(Gem_dismiss_nhwindow, (winid)); -E void FDECL(Gem_destroy_nhwindow, (winid)); -E void FDECL(Gem_curs, (winid, int, int)); -E void FDECL(Gem_putstr, (winid, int, const char *)); -E void FDECL(Gem_display_file, (const char *, BOOLEAN_P)); -E void FDECL(Gem_start_menu, (winid)); -E void FDECL(Gem_add_menu, (winid, int, const ANY_P *, - CHAR_P, CHAR_P, int, const char *, BOOLEAN_P)); -E void FDECL(Gem_end_menu, (winid, const char *)); -E int FDECL(Gem_select_menu, (winid, int, MENU_ITEM_P **)); -E char FDECL(Gem_message_menu, (CHAR_P, int, const char *)); -E void NDECL(Gem_update_inventory); -E void NDECL(Gem_mark_synch); -E void NDECL(Gem_wait_synch); +E void Gem_init_nhwindows(int *, char **); +E void Gem_player_selection(); +E void Gem_askname(); +E void Gem_get_nh_event(); +E void Gem_exit_nhwindows(const char *); +E void Gem_suspend_nhwindows(const char *); +E void Gem_resume_nhwindows(); +E winid Gem_create_nhwindow(int); +E void Gem_clear_nhwindow(winid); +E void Gem_display_nhwindow(winid, BOOLEAN_P); +E void Gem_dismiss_nhwindow(winid); +E void Gem_destroy_nhwindow(winid); +E void Gem_curs(winid, int, int); +E void Gem_putstr(winid, int, const char *); +E void Gem_display_file(const char *, BOOLEAN_P); +E void Gem_start_menu(winid); +E void Gem_add_menu(winid, int, const ANY_P *, + CHAR_P, CHAR_P, int, const char *, BOOLEAN_P); +E void Gem_end_menu(winid, const char *); +E int Gem_select_menu(winid, int, MENU_ITEM_P **); +E char Gem_message_menu(CHAR_P, int, const char *); +E void Gem_update_inventory(); +E void Gem_mark_synch(); +E void Gem_wait_synch(); #ifdef CLIPPING -E void FDECL(Gem_cliparound, (int, int)); +E void Gem_cliparound(int, int); #endif #ifdef POSITIONBAR -E void FDECL(Gem_update_positionbar, (char *)); +E void Gem_update_positionbar(char *); #endif -E void FDECL(Gem_print_glyph, (winid, XCHAR_P, XCHAR_P, int)); -E void FDECL(Gem_raw_print, (const char *)); -E void FDECL(Gem_raw_print_bold, (const char *)); -E int NDECL(Gem_nhgetch); -E int FDECL(Gem_nh_poskey, (int *, int *, int *)); -E void NDECL(Gem_nhbell); -E int NDECL(Gem_doprev_message); -E char FDECL(Gem_yn_function, (const char *, const char *, CHAR_P)); -E void FDECL(Gem_getlin, (const char *, char *)); -E int NDECL(Gem_get_ext_cmd); -E void FDECL(Gem_number_pad, (int)); -E void NDECL(Gem_delay_output); +E void Gem_print_glyph(winid, XCHAR_P, XCHAR_P, int); +E void Gem_raw_print(const char *); +E void Gem_raw_print_bold(const char *); +E int Gem_nhgetch(); +E int Gem_nh_poskey(int *, int *, int *); +E void Gem_nhbell(); +E int Gem_doprev_message(); +E char Gem_yn_function(const char *, const char *, CHAR_P); +E void Gem_getlin(const char *, char *); +E int Gem_get_ext_cmd(); +E void Gem_number_pad(int); +E void Gem_delay_output(); #ifdef CHANGE_COLOR -E void FDECL(Gem_change_color, (int color, long rgb, int reverse)); -E char * NDECL(Gem_get_color_string); +E void Gem_change_color(int color, long rgb, int reverse); +E char * Gem_get_color_string(); #endif /* other defs that really should go away (they're tty specific) */ -E void NDECL(Gem_start_screen); -E void NDECL(Gem_end_screen); +E void Gem_start_screen(); +E void Gem_end_screen(); -E void FDECL(genl_outrip, (winid, int)); +E void genl_outrip(winid, int); #undef E diff --git a/include/winlisp.h b/include/winlisp.h index b2f26e93e..0dc7a40fc 100644 --- a/include/winlisp.h +++ b/include/winlisp.h @@ -18,57 +18,57 @@ extern struct window_procs tty_procs; /* ### winlisp.c ### */ -E void NDECL(win_lisp_init); -E void FDECL(lisp_init_nhwindows, (int *, char **)); -E void NDECL(lisp_player_selection); -E void NDECL(lisp_askname); -E void NDECL(lisp_get_nh_event); -E void FDECL(lisp_exit_nhwindows, (const char *)); -E void FDECL(lisp_suspend_nhwindows, (const char *)); -E void NDECL(lisp_resume_nhwindows); -E winid FDECL(lisp_create_nhwindow, (int)); -E void FDECL(lisp_clear_nhwindow, (winid)); -E void FDECL(lisp_display_nhwindow, (winid, BOOLEAN_P)); -E void FDECL(lisp_destroy_nhwindow, (winid)); -E void FDECL(lisp_curs, (winid, int, int)); -E void FDECL(lisp_putstr, (winid, int, const char *)); +E void win_lisp_init(); +E void lisp_init_nhwindows(int *, char **); +E void lisp_player_selection(); +E void lisp_askname(); +E void lisp_get_nh_event(); +E void lisp_exit_nhwindows(const char *); +E void lisp_suspend_nhwindows(const char *); +E void lisp_resume_nhwindows(); +E winid lisp_create_nhwindow(int); +E void lisp_clear_nhwindow(winid); +E void lisp_display_nhwindow(winid, BOOLEAN_P); +E void lisp_destroy_nhwindow(winid); +E void lisp_curs(winid, int, int); +E void lisp_putstr(winid, int, const char *); #ifdef FILE_AREAS -E void FDECL(lisp_display_file, (const char *, const char *, BOOLEAN_P)); +E void lisp_display_file(const char *, const char *, BOOLEAN_P); #else -E void FDECL(lisp_display_file, (const char *, BOOLEAN_P)); +E void lisp_display_file(const char *, BOOLEAN_P); #endif -E void FDECL(lisp_start_menu, (winid)); -E void FDECL(lisp_add_menu, (winid, int, int, const ANY_P *, - CHAR_P, CHAR_P, int, const char *, unsigned int)); -E void FDECL(lisp_end_menu, (winid, const char *)); -E int FDECL(lisp_select_menu, (winid, int, MENU_ITEM_P **)); -E char FDECL(lisp_message_menu, (char, int, const char *mesg)); -E void NDECL(lisp_update_inventory); -E void NDECL(lisp_mark_synch); -E void NDECL(lisp_wait_synch); +E void lisp_start_menu(winid); +E void lisp_add_menu(winid, int, int, const ANY_P *, + CHAR_P, CHAR_P, int, const char *, unsigned int); +E void lisp_end_menu(winid, const char *); +E int lisp_select_menu(winid, int, MENU_ITEM_P **); +E char lisp_message_menu(char, int, const char *mesg); +E void lisp_update_inventory(); +E void lisp_mark_synch(); +E void lisp_wait_synch(); #ifdef CLIPPING -E void FDECL(lisp_cliparound, (int, int)); +E void lisp_cliparound(int, int); #endif #ifdef POSITIONBAR -E void FDECL(lisp_update_positionbar, (char *)); +E void lisp_update_positionbar(char *); #endif -E void FDECL(lisp_print_glyph, (winid, XCHAR_P, XCHAR_P, int, int)); -E void FDECL(lisp_raw_print, (const char *)); -E void FDECL(lisp_raw_print_bold, (const char *)); -E int NDECL(lisp_nhgetch); -E int FDECL(lisp_nh_poskey, (int *, int *, int *)); -E void NDECL(lisp_nhbell); -E int NDECL(lisp_doprev_message); -E char FDECL(lisp_yn_function, (const char *, const char *, CHAR_P)); -E void FDECL(lisp_getlin, (const char *, char *)); -E int NDECL(lisp_get_ext_cmd); -E void FDECL(lisp_number_pad, (int)); -E void NDECL(lisp_delay_output); +E void lisp_print_glyph(winid, XCHAR_P, XCHAR_P, int, int); +E void lisp_raw_print(const char *); +E void lisp_raw_print_bold(const char *); +E int lisp_nhgetch(); +E int lisp_nh_poskey(int *, int *, int *); +E void lisp_nhbell(); +E int lisp_doprev_message(); +E char lisp_yn_function(const char *, const char *, CHAR_P); +E void lisp_getlin(const char *, char *); +E int lisp_get_ext_cmd(); +E void lisp_number_pad(int); +E void lisp_delay_output(); /* other defs that really should go away (they're tty specific) */ -E void NDECL(lisp_start_screen); -E void NDECL(lisp_end_screen); +E void lisp_start_screen(); +E void lisp_end_screen(); -E void FDECL(lisp_outrip, (winid, int)); +E void lisp_outrip(winid, int); #endif /* WINLISP_H */ diff --git a/include/winprocs.h b/include/winprocs.h index 2cb86654a..8c2fa39c3 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -9,66 +9,66 @@ struct window_procs { const char *name; unsigned long wincap; /* window port capability options supported */ unsigned long wincap2; /* additional window port capability options supported */ - void FDECL((*win_init_nhwindows), (int *, char **)); - void NDECL((*win_player_selection)); - void NDECL((*win_askname)); - void NDECL((*win_get_nh_event)); - void FDECL((*win_exit_nhwindows), (const char *)); - void FDECL((*win_suspend_nhwindows), (const char *)); - void NDECL((*win_resume_nhwindows)); - winid FDECL((*win_create_nhwindow), (int)); - void FDECL((*win_clear_nhwindow), (winid)); - void FDECL((*win_display_nhwindow), (winid, BOOLEAN_P)); - void FDECL((*win_destroy_nhwindow), (winid)); - void FDECL((*win_curs), (winid, int, int)); - void FDECL((*win_putstr), (winid, int, const char *)); + void (*win_init_nhwindows)(int *, char **); + void (*win_player_selection)(void); + void (*win_askname)(void); + void (*win_get_nh_event)(void); + void (*win_exit_nhwindows)(const char *); + void (*win_suspend_nhwindows)(const char *); + void (*win_resume_nhwindows)(void); + winid (*win_create_nhwindow)(int); + void (*win_clear_nhwindow)(winid); + void (*win_display_nhwindow)(winid, BOOLEAN_P); + void (*win_destroy_nhwindow)(winid); + void (*win_curs)(winid, int, int); + void (*win_putstr)(winid, int, const char *); #ifdef FILE_AREAS - void FDECL((*win_display_file), (const char *, const char *, BOOLEAN_P)); + void (*win_display_file)(const char *, const char *, BOOLEAN_P); #else - void FDECL((*win_display_file), (const char *, BOOLEAN_P)); + void (*win_display_file)(const char *, BOOLEAN_P); #endif - void FDECL((*win_start_menu), (winid)); - void FDECL((*win_add_menu), (winid, int, int, const ANY_P *, - CHAR_P, CHAR_P, int, const char *, unsigned int)); - void FDECL((*win_end_menu), (winid, const char *)); - int FDECL((*win_select_menu), (winid, int, MENU_ITEM_P **)); - char FDECL((*win_message_menu), (CHAR_P, int, const char *)); - void NDECL((*win_update_inventory)); - void NDECL((*win_mark_synch)); - void NDECL((*win_wait_synch)); + void (*win_start_menu)(winid); + void (*win_add_menu)(winid, int, int, const ANY_P *, + CHAR_P, CHAR_P, int, const char *, unsigned int); + void (*win_end_menu)(winid, const char *); + int (*win_select_menu)(winid, int, MENU_ITEM_P **); + char (*win_message_menu)(CHAR_P, int, const char *); + void (*win_update_inventory)(void); + void (*win_mark_synch)(void); + void (*win_wait_synch)(void); #ifdef CLIPPING - void FDECL((*win_cliparound), (int, int)); + void (*win_cliparound)(int, int); #endif #ifdef POSITIONBAR - void FDECL((*win_update_positionbar), (char *)); + void (*win_update_positionbar)(char *); #endif - void FDECL((*win_print_glyph), (winid, XCHAR_P, XCHAR_P, int, int)); - void FDECL((*win_raw_print), (const char *)); - void FDECL((*win_raw_print_bold), (const char *)); - int NDECL((*win_nhgetch)); - int FDECL((*win_nh_poskey), (int *, int *, int *)); - void NDECL((*win_nhbell)); - int NDECL((*win_doprev_message)); - char FDECL((*win_yn_function), (const char *, const char *, CHAR_P)); - void FDECL((*win_getlin), (const char *, char *)); - int NDECL((*win_get_ext_cmd)); - void FDECL((*win_number_pad), (int)); - void NDECL((*win_delay_output)); + void (*win_print_glyph)(winid, XCHAR_P, XCHAR_P, int, int); + void (*win_raw_print)(const char *); + void (*win_raw_print_bold)(const char *); + int (*win_nhgetch)(void); + int (*win_nh_poskey)(int *, int *, int *); + void (*win_nhbell)(void); + int (*win_doprev_message)(void); + char (*win_yn_function)(const char *, const char *, CHAR_P); + void (*win_getlin)(const char *, char *); + int (*win_get_ext_cmd)(void); + void (*win_number_pad)(int); + void (*win_delay_output)(void); #ifdef CHANGE_COLOR - void FDECL((*win_change_color), (int, long, int)); + void (*win_change_color)(int, long, int); #ifdef MAC - void FDECL((*win_change_background), (int)); - short FDECL((*win_set_font_name), (winid, char *)); + void (*win_change_background)(int); + short (*win_set_font_name)(winid, char *); #endif - char * NDECL((*win_get_color_string)); + char * (*win_get_color_string)(void); #endif /* other defs that really should go away (they're tty specific) */ - void NDECL((*win_start_screen)); - void NDECL((*win_end_screen)); + void (*win_start_screen)(void); + void (*win_end_screen)(void); - void FDECL((*win_outrip), (winid, int)); - void FDECL((*win_preference_update), (const char *)); + void (*win_outrip)(winid, int); + void (*win_preference_update)(const char *); }; extern NEARDATA struct window_procs windowprocs; diff --git a/include/wintty.h b/include/wintty.h index e6affbbe0..f8add5700 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -101,35 +101,35 @@ extern char defmorestr[]; /* default --more-- prompt */ /* port specific external function references */ /* ### getline.c ### */ -E void FDECL(xwaitforspace, (const char *)); +E void xwaitforspace(const char *); /* ### termcap.c, video.c ### */ -E void FDECL(tty_startup, (int*, int*)); +E void tty_startup(int*, int*); #ifndef NO_TERMS -E void NDECL(tty_shutdown); +E void tty_shutdown(); #endif extern int xputc(int); -E void FDECL(xputs, (const char *)); +E void xputs(const char *); #if defined(SCREEN_VGA) || defined(SCREEN_8514) -E void FDECL(xputg, (int, int, unsigned)); +E void xputg(int, int, unsigned); #endif -E void NDECL(cl_end); -E void NDECL(clear_screen); -E void NDECL(home); -E void NDECL(standoutbeg); -E void NDECL(standoutend); +E void cl_end(); +E void clear_screen(); +E void home(); +E void standoutbeg(); +E void standoutend(); # if 0 -E void NDECL(revbeg); -E void NDECL(boldbeg); -E void NDECL(blinkbeg); -E void NDECL(dimbeg); -E void NDECL(m_end); +E void revbeg(); +E void boldbeg(); +E void blinkbeg(); +E void dimbeg(); +E void m_end(); # endif -E void NDECL(backsp); -E void NDECL(graph_on); -E void NDECL(graph_off); -E void NDECL(cl_eos); +E void backsp(); +E void graph_on(); +E void graph_off(); +E void cl_eos(); /* * termcap.c (or facsimiles in other ports) is the right place for doing @@ -137,101 +137,101 @@ E void NDECL(cl_eos); * a color or whatever. wintty.c should concern itself with WHERE to put * stuff in a window. */ -E void FDECL(term_start_attr, (int attr)); -E void FDECL(term_end_attr, (int attr)); -E void NDECL(term_start_raw_bold); -E void NDECL(term_end_raw_bold); +E void term_start_attr(int attr); +E void term_end_attr(int attr); +E void term_start_raw_bold(); +E void term_end_raw_bold(); #ifdef TEXTCOLOR -E void NDECL(term_end_color); -E void FDECL(term_start_color, (int color)); -E int FDECL(has_color, (int color)); +E void term_end_color(); +E void term_start_color(int color); +E int has_color(int color); #endif /* TEXTCOLOR */ #ifdef STATUS_COLORS -E boolean FDECL(parse_status_color_options, (char *)); +E boolean parse_status_color_options(char *); #endif /* STATUS_COLOR */ /* ### topl.c ### */ extern void show_topl(const char *); extern void remember_topl(void); -E void FDECL(addtopl, (const char *)); -E void NDECL(more); -E void FDECL(update_topl, (const char *)); -E void FDECL(putsyms, (const char*)); +E void addtopl(const char *); +E void more(); +E void update_topl(const char *); +E void putsyms(const char*); /* ### wintty.c ### */ #ifdef CLIPPING -E void NDECL(setclipped); +E void setclipped(); #endif -E void FDECL(docorner, (int, int)); -E void NDECL(end_glyphout); -E void FDECL(g_putch, (int)); -E void NDECL(win_tty_init); +E void docorner(int, int); +E void end_glyphout(); +E void g_putch(int); +E void win_tty_init(); /* external declarations */ -E void FDECL(tty_init_nhwindows, (int *, char **)); -E void NDECL(tty_player_selection); -E void NDECL(tty_askname); -E void NDECL(tty_get_nh_event); -E void FDECL(tty_exit_nhwindows, (const char *)); -E void FDECL(tty_suspend_nhwindows, (const char *)); -E void NDECL(tty_resume_nhwindows); -E winid FDECL(tty_create_nhwindow, (int)); -E void FDECL(tty_clear_nhwindow, (winid)); -E void FDECL(tty_display_nhwindow, (winid, BOOLEAN_P)); -E void FDECL(tty_dismiss_nhwindow, (winid)); -E void FDECL(tty_destroy_nhwindow, (winid)); -E void FDECL(tty_curs, (winid, int, int)); -E void FDECL(tty_putstr, (winid, int, const char *)); +E void tty_init_nhwindows(int *, char **); +E void tty_player_selection(); +E void tty_askname(); +E void tty_get_nh_event(); +E void tty_exit_nhwindows(const char *); +E void tty_suspend_nhwindows(const char *); +E void tty_resume_nhwindows(); +E winid tty_create_nhwindow(int); +E void tty_clear_nhwindow(winid); +E void tty_display_nhwindow(winid, BOOLEAN_P); +E void tty_dismiss_nhwindow(winid); +E void tty_destroy_nhwindow(winid); +E void tty_curs(winid, int, int); +E void tty_putstr(winid, int, const char *); #ifdef FILE_AREAS -E void FDECL(tty_display_file, (const char *, const char *, BOOLEAN_P)); +E void tty_display_file(const char *, const char *, BOOLEAN_P); #else -E void FDECL(tty_display_file, (const char *, BOOLEAN_P)); +E void tty_display_file(const char *, BOOLEAN_P); #endif -E void FDECL(tty_start_menu, (winid)); -E void FDECL(tty_add_menu, (winid, int, int, const ANY_P *, - CHAR_P, CHAR_P, int, const char *, unsigned int)); -E void FDECL(tty_end_menu, (winid, const char *)); -E int FDECL(tty_select_menu, (winid, int, MENU_ITEM_P **)); -E char FDECL(tty_message_menu, (CHAR_P, int, const char *)); -E void NDECL(tty_update_inventory); -E void NDECL(tty_mark_synch); -E void NDECL(tty_wait_synch); +E void tty_start_menu(winid); +E void tty_add_menu(winid, int, int, const ANY_P *, + CHAR_P, CHAR_P, int, const char *, unsigned int); +E void tty_end_menu(winid, const char *); +E int tty_select_menu(winid, int, MENU_ITEM_P **); +E char tty_message_menu(CHAR_P, int, const char *); +E void tty_update_inventory(); +E void tty_mark_synch(); +E void tty_wait_synch(); #ifdef CLIPPING -E void FDECL(tty_cliparound, (int, int)); +E void tty_cliparound(int, int); #endif #ifdef POSITIONBAR -E void FDECL(tty_update_positionbar, (char *)); +E void tty_update_positionbar(char *); #endif -E void FDECL(tty_print_glyph, (winid, XCHAR_P, XCHAR_P, int, int)); -E void FDECL(tty_raw_print, (const char *)); -E void FDECL(tty_raw_print_bold, (const char *)); -E int NDECL(tty_nhgetch); -E int FDECL(tty_nh_poskey, (int *, int *, int *)); -E void NDECL(tty_nhbell); -E int NDECL(tty_doprev_message); -E char FDECL(tty_yn_function, (const char *, const char *, CHAR_P)); -E void FDECL(tty_getlin, (const char *, char *)); -E int NDECL(tty_get_ext_cmd); -E void FDECL(tty_number_pad, (int)); -E void NDECL(tty_delay_output); +E void tty_print_glyph(winid, XCHAR_P, XCHAR_P, int, int); +E void tty_raw_print(const char *); +E void tty_raw_print_bold(const char *); +E int tty_nhgetch(); +E int tty_nh_poskey(int *, int *, int *); +E void tty_nhbell(); +E int tty_doprev_message(); +E char tty_yn_function(const char *, const char *, CHAR_P); +E void tty_getlin(const char *, char *); +E int tty_get_ext_cmd(); +E void tty_number_pad(int); +E void tty_delay_output(); #ifdef CHANGE_COLOR -E void FDECL(tty_change_color, (int color, long rgb, int reverse)); +E void tty_change_color(int color, long rgb, int reverse); #ifdef MAC -E void FDECL(tty_change_background, (int white_or_black)); -E short FDECL(set_tty_font_name, (winid, char *)); +E void tty_change_background(int white_or_black); +E short set_tty_font_name(winid, char *); #endif -E char * NDECL(tty_get_color_string); +E char * tty_get_color_string(); #endif -E int NDECL(tty_debug_show_colors); +E int tty_debug_show_colors(); /* other defs that really should go away (they're tty specific) */ -E void NDECL(tty_start_screen); -E void NDECL(tty_end_screen); +E void tty_start_screen(); +E void tty_end_screen(); -E void FDECL(genl_outrip, (winid, int)); +E void genl_outrip(winid, int); #ifdef NO_TERMS # ifdef MAC @@ -242,9 +242,9 @@ E void FDECL(genl_outrip, (winid, int)); # define putchar term_putc # define fflush term_flush # define puts term_puts -E int FDECL(term_putc, (int c)); -E int FDECL(term_flush, (void *desc)); -E int FDECL(term_puts, (const char *str)); +E int term_putc(int c); +E int term_flush(void *desc); +E int term_puts(const char *str); # endif /* MAC */ # if defined(MSDOS) || defined(WIN32CON) # if defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST) || defined(WIN32CON) @@ -256,7 +256,7 @@ E int FDECL(term_puts, (const char *str)); # define puts(x) xputs(x) # endif/*SCREEN_BIOS || SCREEN_DJGPPFAST || WIN32CON */ # ifdef POSITIONBAR -E void FDECL(video_update_positionbar, (char *)); +E void video_update_positionbar(char *); # endif # endif/*MSDOS*/ #endif/*NO_TERMS*/ diff --git a/include/wintype.h b/include/wintype.h index 43c68868a..0ac7f52b2 100644 --- a/include/wintype.h +++ b/include/wintype.h @@ -24,7 +24,7 @@ typedef union any { unsigned long *a_ulptr; unsigned *a_uptr; const char *a_string; - int NDECL((*a_nfunc)); + int (*a_nfunc)(void); unsigned long a_mask32; /* used by status highlighting */ /* add types as needed */ } anything; diff --git a/src/allmain.c b/src/allmain.c index ef868c639..ca54e0159 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -23,9 +23,9 @@ early_init() } #ifdef POSITIONBAR -STATIC_DCL void NDECL(do_positionbar); +static void do_positionbar(); #endif -STATIC_DCL void FDECL(interrupt_multi, (const char *, int, int)); +static void interrupt_multi(const char *, int, int); static int prev_hp_notify; enum monster_generation monclock; @@ -858,7 +858,7 @@ boolean new_game; /* false => restoring an old game */ } #ifdef POSITIONBAR -STATIC_DCL void +static void do_positionbar() { static char pbar[COLNO]; @@ -934,8 +934,7 @@ get_realtime(void) #endif /* REALTIME_ON_BOTL || RECORD_REALTIME */ /** Interrupt a multiturn action if current_points is equal to max_points. */ -STATIC_DCL -void +static void interrupt_multi(points, current_points, max_points) const char *points; int current_points; diff --git a/src/alloc.c b/src/alloc.c index a58f199db..33ee53a61 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -10,20 +10,20 @@ #include "config.h" #if defined(MONITOR_HEAP) || defined(WIZARD) -char *FDECL(fmt_ptr, (const genericptr)); +char *fmt_ptr(const genericptr); #endif #ifdef MONITOR_HEAP #undef alloc #undef free -extern void FDECL(free, (genericptr_t)); -static void NDECL(heapmon_init); +extern void free(genericptr_t); +static void heapmon_init(); static FILE *heaplog = 0; static boolean tried_heaplog = FALSE; #endif -long *FDECL(alloc, (unsigned int)); +long *alloc(unsigned int); extern void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2); diff --git a/src/apply.c b/src/apply.c index 6461f8e4f..4bc03816d 100644 --- a/src/apply.c +++ b/src/apply.c @@ -9,41 +9,40 @@ static const char tools[] = { COIN_CLASS, TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, static const char tools_too[] = { COIN_CLASS, ALL_CLASSES, TOOL_CLASS, POTION_CLASS, WEAPON_CLASS, WAND_CLASS, GEM_CLASS, 0 }; -STATIC_DCL int FDECL(use_camera, (struct obj *)); -STATIC_DCL int FDECL(use_towel, (struct obj *)); -STATIC_DCL boolean FDECL(its_dead, (int, int, int *, struct obj*)); -STATIC_DCL int FDECL(use_stethoscope, (struct obj *)); -STATIC_DCL void FDECL(use_whistle, (struct obj *)); -STATIC_DCL void FDECL(use_magic_whistle, (struct obj *)); -STATIC_DCL int FDECL(use_mirror, (struct obj *)); -STATIC_DCL void FDECL(use_bell, (struct obj **)); -STATIC_DCL void FDECL(use_candelabrum, (struct obj *)); -STATIC_DCL void FDECL(use_candle, (struct obj **)); -STATIC_DCL void FDECL(use_lamp, (struct obj *)); -STATIC_DCL void FDECL(use_tinning_kit, (struct obj *)); -STATIC_DCL void FDECL(use_figurine, (struct obj **)); -STATIC_DCL void FDECL(use_grease, (struct obj *)); -STATIC_DCL void FDECL(use_trap, (struct obj *)); -STATIC_DCL void FDECL(use_stone, (struct obj *)); -STATIC_PTR int NDECL(set_trap); /* occupation callback */ -STATIC_DCL int FDECL(use_whip, (struct obj *)); -STATIC_DCL int FDECL(use_pole, (struct obj *)); -STATIC_DCL int FDECL(use_cream_pie, (struct obj *)); -STATIC_DCL int FDECL(use_grapple, (struct obj *)); -STATIC_DCL int FDECL(do_break_wand, (struct obj *)); -STATIC_DCL int FDECL(do_flip_coin, (struct obj *)); -STATIC_DCL boolean FDECL(figurine_location_checks, - (struct obj *, coord *, BOOLEAN_P)); -STATIC_DCL boolean NDECL(uhave_graystone); -STATIC_DCL void FDECL(add_class, (char *, CHAR_P)); +static int use_camera(struct obj *); +static int use_towel(struct obj *); +static boolean its_dead(int, int, int *, struct obj*); +static int use_stethoscope(struct obj *); +static void use_whistle(struct obj *); +static void use_magic_whistle(struct obj *); +static int use_mirror(struct obj *); +static void use_bell(struct obj **); +static void use_candelabrum(struct obj *); +static void use_candle(struct obj **); +static void use_lamp(struct obj *); +static void use_tinning_kit(struct obj *); +static void use_figurine(struct obj **); +static void use_grease(struct obj *); +static void use_trap(struct obj *); +static void use_stone(struct obj *); +static int set_trap(); /* occupation callback */ +static int use_whip(struct obj *); +static int use_pole(struct obj *); +static int use_cream_pie(struct obj *); +static int use_grapple(struct obj *); +static int do_break_wand(struct obj *); +static int do_flip_coin(struct obj *); +static boolean figurine_location_checks(struct obj *, coord *, BOOLEAN_P); +static boolean uhave_graystone(); +static void add_class(char *, CHAR_P); #ifdef AMIGA -void FDECL( amii_speaker, ( struct obj *, char *, int ) ); +void amii_speaker( struct obj *, char *, int ) ; #endif static const char no_elbow_room[] = "don't have enough elbow-room to maneuver."; -STATIC_OVL int +static int use_camera(obj) struct obj *obj; { @@ -74,8 +73,8 @@ struct obj *obj; } else if (!u.dx && !u.dy) { (void) zapyourself(obj, TRUE); } else if ((mtmp = bhit(u.dx, u.dy, COLNO, FLASHED_LIGHT, - (int FDECL((*), (MONST_P, OBJ_P))) 0, - (int FDECL((*), (OBJ_P, OBJ_P))) 0, + (int (*) (MONST_P, OBJ_P)) 0, + (int (*) (OBJ_P, OBJ_P)) 0, obj, NULL)) != 0) { obj->ox = u.ux, obj->oy = u.uy; (void) flash_hits_mon(mtmp, obj); @@ -83,7 +82,7 @@ struct obj *obj; return 1; } -STATIC_OVL int +static int use_towel(obj) struct obj *obj; { @@ -175,7 +174,7 @@ struct obj *obj; } /* maybe give a stethoscope message based on floor objects */ -STATIC_OVL boolean +static boolean its_dead(rx, ry, resp, tobj) int rx, ry, *resp; struct obj* tobj; @@ -327,7 +326,7 @@ static const char hollow_str[] = "a hollow sound. This must be a secret %s!"; not take any time; however, unless it did, the stethoscope would be almost useless. As a compromise, one use per turn is free, another uses up the turn; this makes curse status have a tangible effect. */ -STATIC_OVL int +static int use_stethoscope(obj) register struct obj *obj; { @@ -486,7 +485,7 @@ register struct obj *obj; static const char whistle_str[] = "produce a %s whistling sound."; static const char alt_whistle_str[] = "produce a %s, sharp vibration."; -STATIC_OVL void +static void use_whistle(obj) struct obj *obj; { @@ -508,7 +507,7 @@ struct obj *obj; } } -STATIC_OVL void +static void use_magic_whistle(obj) struct obj *obj; { @@ -850,7 +849,7 @@ register xchar x, y; static const char look_str[] = "look %s."; -STATIC_OVL int +static int use_mirror(obj) struct obj *obj; { @@ -921,8 +920,8 @@ struct obj *obj; return 1; } mtmp = bhit(u.dx, u.dy, COLNO, INVIS_BEAM, - (int FDECL((*), (MONST_P, OBJ_P))) 0, - (int FDECL((*), (OBJ_P, OBJ_P))) 0, + (int (*) (MONST_P, OBJ_P)) 0, + (int (*) (OBJ_P, OBJ_P)) 0, obj, NULL); if (!mtmp || !haseyes(mtmp->data) || notonhead) { return 1; @@ -1037,7 +1036,7 @@ struct obj *obj; return 1; } -STATIC_OVL void +static void use_bell(optr) struct obj **optr; { @@ -1159,7 +1158,7 @@ struct obj **optr; if (wakem) wake_nearby(); } -STATIC_OVL void +static void use_candelabrum(obj) register struct obj *obj; { @@ -1219,7 +1218,7 @@ register struct obj *obj; begin_burn(obj, FALSE); } -STATIC_OVL void +static void use_candle(optr) struct obj **optr; { @@ -1377,7 +1376,7 @@ struct obj *obj; return FALSE; } -STATIC_OVL void +static void use_lamp(obj) struct obj *obj; { @@ -1431,7 +1430,7 @@ struct obj *obj; } } -STATIC_OVL void +static void light_cocktail(optr) struct obj **optr; { @@ -1888,7 +1887,7 @@ struct obj *corpse; return 1; } -STATIC_OVL void +static void use_tinning_kit(obj) register struct obj *obj; { @@ -2233,7 +2232,7 @@ long timeout; } } -STATIC_OVL boolean +static boolean figurine_location_checks(obj, cc, quietly) struct obj *obj; coord *cc; @@ -2269,7 +2268,7 @@ boolean quietly; return TRUE; } -STATIC_OVL void +static void use_figurine(optr) struct obj **optr; { @@ -2312,7 +2311,7 @@ struct obj **optr; static NEARDATA const char lubricables[] = { ALL_CLASSES, ALLOW_NONE, 0 }; -STATIC_OVL void +static void use_grease(obj) struct obj *obj; { @@ -2382,7 +2381,7 @@ reset_trapset() } /* touchstones - by Ken Arnold */ -STATIC_OVL void +static void use_stone(tstone) struct obj *tstone; { @@ -2516,7 +2515,7 @@ struct obj *tstone; } /* Place a landmine/bear trap. Helge Hafting */ -STATIC_OVL void +static void use_trap(otmp) struct obj *otmp; { @@ -2612,8 +2611,7 @@ struct obj *otmp; return; } -STATIC_PTR -int +static int set_trap() { struct obj *otmp = trapinfo.tobj; @@ -2652,7 +2650,7 @@ set_trap() return 0; } -STATIC_OVL int +static int use_whip(obj) struct obj *obj; { @@ -3004,7 +3002,7 @@ int state; } /* Distance attacks by pole-weapons */ -STATIC_OVL int +static int use_pole(obj) struct obj *obj; { @@ -3129,7 +3127,7 @@ struct obj *obj; return (1); } -STATIC_OVL int +static int use_cream_pie(obj) struct obj *obj; { @@ -3172,7 +3170,7 @@ struct obj *obj; return(0); } -STATIC_OVL int +static int use_grapple (obj) struct obj *obj; { @@ -3707,7 +3705,7 @@ struct obj *obj; return 1; } -STATIC_OVL boolean +static boolean uhave_graystone() { register struct obj *otmp; @@ -3718,7 +3716,7 @@ uhave_graystone() return FALSE; } -STATIC_OVL int +static int do_flip_coin(obj) struct obj *obj; { @@ -3761,7 +3759,7 @@ struct obj *obj; return 1; } -STATIC_OVL void +static void add_class(cl, class) char *cl; char class; diff --git a/src/artifact.c b/src/artifact.c index 98ac8adaf..427e33b73 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -16,11 +16,11 @@ extern boolean notonhead; /* for long worms */ #define get_artifact(o) \ (((o)&&(o)->oartifact) ? &artilist[(int) (o)->oartifact] : 0) -static boolean FDECL(bane_applies, (const struct artifact *, struct monst *)); -STATIC_DCL int FDECL(spec_applies, (const struct artifact *, struct monst *)); -STATIC_DCL int FDECL(arti_invoke, (struct obj*)); -STATIC_DCL boolean FDECL(Mb_hit, (struct monst *magr, struct monst *mdef, - struct obj *, int *, int, BOOLEAN_P, char *)); +static boolean bane_applies(const struct artifact *, struct monst *); +static int spec_applies(const struct artifact *, struct monst *); +static int arti_invoke(struct obj*); +static boolean Mb_hit(struct monst *magr, struct monst *mdef, + struct obj *, int *, int, BOOLEAN_P, char *); /* The amount added to the victim's total hit points to insure that the victim will be killed even after damage bonus/penalty adjustments. @@ -33,18 +33,18 @@ STATIC_DCL boolean FDECL(Mb_hit, (struct monst *magr, struct monst *mdef, #define FATAL_DAMAGE_MODIFIER 200 /* coordinate effects from spec_dbon() with messages in artifact_hit() */ -STATIC_OVL int spec_dbon_applies = 0; +static int spec_dbon_applies = 0; /* flags including which artifacts have already been created */ static boolean artiexist[1+NROFARTIFACTS+1]; /* and a discovery list for them (no dummy first entry here) */ -STATIC_OVL xchar artidisco[NROFARTIFACTS]; +static xchar artidisco[NROFARTIFACTS]; -STATIC_DCL void NDECL(hack_artifacts); -STATIC_DCL boolean FDECL(attacks, (int, struct obj *)); +static void hack_artifacts(); +static boolean attacks(int, struct obj *); /* handle some special cases; must be called after u_init() */ -STATIC_OVL void +static void hack_artifacts() { struct artifact *art; @@ -323,7 +323,7 @@ register boolean restrict_typ; /* restrict for otmp->otyp? */ return FALSE; } -STATIC_OVL boolean +static boolean attacks(adtyp, otmp) register int adtyp; register struct obj *otmp; @@ -786,7 +786,7 @@ struct monst *mon; } /* decide whether an artifact's special attacks apply against mtmp */ -STATIC_OVL int +static int spec_applies(weap, mtmp) register const struct artifact *weap; struct monst *mtmp; @@ -996,7 +996,7 @@ static const char *const mb_verb[2][NUM_MB_INDICES] = { }; /* called when someone is being hit by Magicbane */ -STATIC_OVL boolean +static boolean Mb_hit(magr, mdef, mb, dmgptr, dieroll, vis, hittee) struct monst *magr, *mdef; /* attacker and defender */ struct obj *mb; /* Magicbane */ @@ -1591,7 +1591,7 @@ doinvoke() return arti_invoke(obj); } -STATIC_OVL int +static int arti_invoke(obj) struct obj *obj; { diff --git a/src/attrib.c b/src/attrib.c index f912b1918..32593f959 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -116,8 +116,8 @@ hea_abil[] = { { 1, &(HPoison_resistance), "", "" }, hum_abil[] = { { 0, 0, 0, 0 } }; static long next_check = 600L; /* arbitrary first setting */ -STATIC_DCL void NDECL(exerper); -STATIC_DCL void FDECL(postadjabil, (long *)); +static void exerper(); +static void postadjabil(long *); /* adjust an attribute; return TRUE if change is made, FALSE otherwise */ boolean @@ -315,7 +315,7 @@ boolean inc_or_dec; if (moves > 0 && (i == A_STR || i == A_CON)) (void)encumber_msg(); } -STATIC_OVL void +static void exerper() { if(!(moves % 10)) { @@ -540,8 +540,7 @@ redist_attr() (void)encumber_msg(); } -STATIC_OVL -void +static void postadjabil(ability) long *ability; { diff --git a/src/ball.c b/src/ball.c index 8f8a904aa..cb786adf1 100644 --- a/src/ball.c +++ b/src/ball.c @@ -5,11 +5,11 @@ #include "hack.h" -STATIC_DCL int NDECL(bc_order); -STATIC_DCL void NDECL(litter); -static void NDECL(placebc_core); -static void NDECL(unplacebc_core); -static boolean FDECL(check_restriction, (int)); +static int bc_order(); +static void litter(); +static void placebc_core(); +static void unplacebc_core(); +static boolean check_restriction(int); static int bcrestriction = 0; #ifdef BREADCRUMBS @@ -358,7 +358,7 @@ int linenum; * Return the stacking of the hero's ball & chain. This assumes that the * hero is being punished. */ -STATIC_OVL int +static int bc_order() { struct obj *obj; @@ -966,7 +966,7 @@ xchar x, y; } /* ball&chain cause hero to randomly lose stuff from inventory */ -STATIC_OVL void +static void litter() { struct obj *otmp, *nextobj = 0; diff --git a/src/bones.c b/src/bones.c index 6d6fad529..e517cb6a4 100644 --- a/src/bones.c +++ b/src/bones.c @@ -9,12 +9,12 @@ extern char bones[]; /* from files.c */ extern long bytes_counted; #endif -STATIC_DCL boolean FDECL(no_bones_level, (d_level *)); -STATIC_DCL void FDECL(goodfruit, (int)); -STATIC_DCL void FDECL(resetobjs, (struct obj *, BOOLEAN_P)); -static boolean FDECL(fixuporacle, (struct monst *)); +static boolean no_bones_level(d_level *); +static void goodfruit(int); +static void resetobjs(struct obj *, BOOLEAN_P); +static boolean fixuporacle(struct monst *); -STATIC_OVL boolean +static boolean no_bones_level(lev) d_level *lev; { @@ -38,7 +38,7 @@ d_level *lev; * ID is positive instead of negative). This way, when we later save the * chain of fruit types, we know to only save the types that exist. */ -STATIC_OVL void +static void goodfruit(id) int id; { @@ -49,7 +49,7 @@ int id; } } -STATIC_OVL void +static void resetobjs(ochain, restore) struct obj *ochain; boolean restore; @@ -196,7 +196,7 @@ boolean restore; } /** Removes objects recursively from a container with a probability of prob1/prob2. */ -STATIC_OVL void +static void trim_contents(container, prob1, prob2) struct obj *container; int prob1; diff --git a/src/botl.c b/src/botl.c index a2167527a..b29b0f5c3 100644 --- a/src/botl.c +++ b/src/botl.c @@ -14,9 +14,9 @@ const char * const enc_stat[] = { "Overloaded" }; -STATIC_DCL void NDECL(bot1); -STATIC_DCL void NDECL(bot2); -STATIC_DCL void NDECL(bot3); +static void bot1(); +static void bot2(); +static void bot3(); #if defined(STATUS_COLORS) && defined(TEXTCOLOR) @@ -153,7 +153,7 @@ int statusline; #endif -STATIC_OVL NEARDATA int mrank_sz = 0; /* loaded by max_rank_sz (from u_init) */ +static NEARDATA int mrank_sz = 0; /* loaded by max_rank_sz (from u_init) */ /* convert experience level (1..30) to rank index (0..8) */ int @@ -268,7 +268,7 @@ botl_score() #ifdef DUMP_LOG void bot1str(char *newbot1) #else -STATIC_OVL void +static void bot1() #endif { @@ -368,7 +368,7 @@ bot1() #endif #ifdef DUMP_LOG } -STATIC_OVL void +static void bot1() { char newbot1[MAXCO]; @@ -476,7 +476,7 @@ botl_realtime() void bot2str(newbot2) char* newbot2; #else -STATIC_OVL void +static void bot2() #endif { @@ -586,7 +586,7 @@ bot2() } #ifdef DUMP_LOG } -STATIC_OVL void +static void bot2() { char newbot2[MAXCO]; diff --git a/src/cmd.c b/src/cmd.c index 49931df70..59e479a5c 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -45,157 +45,157 @@ static boolean alt_esc = FALSE; * module you are trying to debug) or things are going to get rather * hard to link :-) */ -extern int NDECL(wiz_debug_cmd); +extern int wiz_debug_cmd(); #endif struct cmd Cmd = { 0 }; /* flag.h */ #ifdef DUMB /* stuff commented out in extern.h, but needed here */ -extern int NDECL(doapply); /**/ -extern int NDECL(dorub); /**/ -extern int NDECL(dojump); /**/ -extern int NDECL(doextlist); /**/ -extern int NDECL(dodrop); /**/ -extern int NDECL(doddrop); /**/ -extern int NDECL(dodown); /**/ -extern int NDECL(doup); /**/ -extern int NDECL(donull); /**/ -extern int NDECL(dowipe); /**/ -extern int NDECL(do_mname); /**/ -extern int NDECL(ddocall); /**/ -extern int NDECL(dotakeoff); /**/ -extern int NDECL(doremring); /**/ -extern int NDECL(dowear); /**/ -extern int NDECL(doputon); /**/ -extern int NDECL(doddoremarm); /**/ -extern int NDECL(dokick); /**/ -extern int NDECL(dofire); /**/ -extern int NDECL(dothrow); /**/ -extern int NDECL(doeat); /**/ -extern int NDECL(done2); /**/ -extern int NDECL(doengrave); /**/ -extern int NDECL(doengrave_elbereth); /**/ -extern int NDECL(dopickup); /**/ -extern int NDECL(ddoinv); /**/ -extern int NDECL(dotypeinv); /**/ -extern int NDECL(dolook); /**/ -extern int NDECL(doprgold); /**/ -extern int NDECL(doprwep); /**/ -extern int NDECL(doprarm); /**/ -extern int NDECL(doprring); /**/ -extern int NDECL(dopramulet); /**/ -extern int NDECL(doprtool); /**/ -extern int NDECL(dosuspend); /**/ -extern int NDECL(doforce); /**/ -extern int NDECL(doopen); /**/ -extern int NDECL(doclose); /**/ -extern int NDECL(dodiscovered); /**/ -extern int NDECL(doset); /**/ -extern int NDECL(dotogglepickup); /**/ -extern int NDECL(dowhatis); /**/ -extern int NDECL(doquickwhatis); /**/ -extern int NDECL(dowhatdoes); /**/ -extern int NDECL(dohelp); /**/ -extern int NDECL(dohistory); /**/ -extern int NDECL(doloot); /**/ -extern int NDECL(dodrink); /**/ -extern int NDECL(dodip); /**/ -extern int NDECL(dosacrifice); /**/ -extern int NDECL(dopray); /**/ -extern int NDECL(doturn); /**/ -extern int NDECL(doredraw); /**/ -extern int NDECL(doread); /**/ -extern int NDECL(dosave); /**/ -extern int NDECL(dosearch); /**/ -extern int NDECL(doidtrap); /**/ -extern int NDECL(dopay); /**/ -extern int NDECL(dosit); /**/ -extern int NDECL(dotalk); /**/ -extern int NDECL(docast); /**/ -extern int NDECL(dovspell); /**/ -extern int NDECL(dotelecmd); /**/ -extern int NDECL(dotele); /**/ -extern int NDECL(dountrap); /**/ -extern int NDECL(doversion); /**/ -extern int NDECL(doextversion); /**/ -extern int NDECL(doswapweapon); /**/ -extern int NDECL(dowield); /**/ -extern int NDECL(dowieldquiver); /**/ -extern int NDECL(dozap); /**/ -extern int NDECL(doorganize); /**/ -extern int NDECL(dovanquished); /**/ +extern int doapply(); /**/ +extern int dorub(); /**/ +extern int dojump(); /**/ +extern int doextlist(); /**/ +extern int dodrop(); /**/ +extern int doddrop(); /**/ +extern int dodown(); /**/ +extern int doup(); /**/ +extern int donull(); /**/ +extern int dowipe(); /**/ +extern int do_mname(); /**/ +extern int ddocall(); /**/ +extern int dotakeoff(); /**/ +extern int doremring(); /**/ +extern int dowear(); /**/ +extern int doputon(); /**/ +extern int doddoremarm(); /**/ +extern int dokick(); /**/ +extern int dofire(); /**/ +extern int dothrow(); /**/ +extern int doeat(); /**/ +extern int done2(); /**/ +extern int doengrave(); /**/ +extern int doengrave_elbereth(); /**/ +extern int dopickup(); /**/ +extern int ddoinv(); /**/ +extern int dotypeinv(); /**/ +extern int dolook(); /**/ +extern int doprgold(); /**/ +extern int doprwep(); /**/ +extern int doprarm(); /**/ +extern int doprring(); /**/ +extern int dopramulet(); /**/ +extern int doprtool(); /**/ +extern int dosuspend(); /**/ +extern int doforce(); /**/ +extern int doopen(); /**/ +extern int doclose(); /**/ +extern int dodiscovered(); /**/ +extern int doset(); /**/ +extern int dotogglepickup(); /**/ +extern int dowhatis(); /**/ +extern int doquickwhatis(); /**/ +extern int dowhatdoes(); /**/ +extern int dohelp(); /**/ +extern int dohistory(); /**/ +extern int doloot(); /**/ +extern int dodrink(); /**/ +extern int dodip(); /**/ +extern int dosacrifice(); /**/ +extern int dopray(); /**/ +extern int doturn(); /**/ +extern int doredraw(); /**/ +extern int doread(); /**/ +extern int dosave(); /**/ +extern int dosearch(); /**/ +extern int doidtrap(); /**/ +extern int dopay(); /**/ +extern int dosit(); /**/ +extern int dotalk(); /**/ +extern int docast(); /**/ +extern int dovspell(); /**/ +extern int dotelecmd(); /**/ +extern int dotele(); /**/ +extern int dountrap(); /**/ +extern int doversion(); /**/ +extern int doextversion(); /**/ +extern int doswapweapon(); /**/ +extern int dowield(); /**/ +extern int dowieldquiver(); /**/ +extern int dozap(); /**/ +extern int doorganize(); /**/ +extern int dovanquished(); /**/ #ifdef DUMP_LOG -extern int NDECL(dump_screenshot); /**/ +extern int dump_screenshot(); /**/ #endif #ifdef LIVELOG_SHOUT -extern int NDECL(doshout); /**/ +extern int doshout(); /**/ #endif #endif /* DUMB */ -static int NDECL((*timed_occ_fn)); +static int (*timed_occ_fn)(void); -STATIC_PTR int NDECL(doprev_message); -STATIC_PTR int NDECL(timed_occupation); -STATIC_PTR int NDECL(doextcmd); -STATIC_PTR int NDECL(domonability); -STATIC_PTR int NDECL(dooverview_or_wiz_where); -STATIC_PTR int NDECL(dotravel); -STATIC_PTR int NDECL(doautoexplore); -STATIC_PTR int NDECL(doautofight); +static int doprev_message(); +static int timed_occupation(); +static int doextcmd(); +static int domonability(); +static int dooverview_or_wiz_where(); +static int dotravel(); +static int doautoexplore(); +static int doautofight(); # ifdef WIZARD -int NDECL(wiz_show_rooms); -STATIC_PTR int NDECL(wiz_wish); -STATIC_PTR int NDECL(wiz_identify); -STATIC_PTR int NDECL(wiz_map); -STATIC_PTR int NDECL(wiz_genesis); -STATIC_PTR int NDECL(wiz_where); -STATIC_PTR int NDECL(wiz_detect); -STATIC_PTR int NDECL(wiz_panic); -STATIC_PTR int NDECL(wiz_polyself); -STATIC_PTR int NDECL(wiz_level_tele); -STATIC_PTR int NDECL(wiz_level_change); -STATIC_PTR int NDECL(wiz_show_seenv); -STATIC_PTR int NDECL(wiz_show_vision); -STATIC_PTR int NDECL(wiz_mon_polycontrol); -STATIC_PTR int NDECL(wiz_show_wmodes); -STATIC_PTR int NDECL(wiz_mazewalkmap); +int wiz_show_rooms(); +static int wiz_wish(); +static int wiz_identify(); +static int wiz_map(); +static int wiz_genesis(); +static int wiz_where(); +static int wiz_detect(); +static int wiz_panic(); +static int wiz_polyself(); +static int wiz_level_tele(); +static int wiz_level_change(); +static int wiz_show_seenv(); +static int wiz_show_vision(); +static int wiz_mon_polycontrol(); +static int wiz_show_wmodes(); +static int wiz_mazewalkmap(); extern char SpLev_Map[COLNO][ROWNO]; -STATIC_PTR int NDECL(wiz_showkills); /* showborn patch */ +static int wiz_showkills(); /* showborn patch */ static void wiz_map_levltyp(); static void wiz_levltyp_legend(); #if defined(__BORLANDC__) && !defined(_WIN32) -extern void FDECL(show_borlandc_stats, (winid)); +extern void show_borlandc_stats(winid); #endif #ifdef DEBUG_MIGRATING_MONS -STATIC_PTR int NDECL(wiz_migrate_mons); +static int wiz_migrate_mons(); #endif -STATIC_DCL int FDECL(size_monst, (struct monst *, BOOLEAN_P)); -STATIC_DCL int FDECL(size_obj, (struct obj *)); -STATIC_DCL void FDECL(count_obj, (struct obj *, long *, long *, BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL void FDECL(obj_chain, (winid, const char *, struct obj *, BOOLEAN_P, long *, long *)); -STATIC_DCL void FDECL(mon_invent_chain, (winid, const char *, struct monst *, long *, long *)); -STATIC_DCL void FDECL(mon_chain, (winid, const char *, struct monst *, BOOLEAN_P, long *, long *)); -STATIC_DCL void FDECL(contained_stats, (winid, const char *, long *, long *)); -STATIC_DCL void FDECL(misc_stats, (winid, long *, long *)); -STATIC_PTR int NDECL(wiz_show_stats); -static boolean FDECL(accept_menu_prefix, (int NDECL((*)))); +static int size_monst(struct monst *, BOOLEAN_P); +static int size_obj(struct obj *); +static void count_obj(struct obj *, long *, long *, BOOLEAN_P, BOOLEAN_P); +static void obj_chain(winid, const char *, struct obj *, BOOLEAN_P, long *, long *); +static void mon_invent_chain(winid, const char *, struct monst *, long *, long *); +static void mon_chain(winid, const char *, struct monst *, BOOLEAN_P, long *, long *); +static void contained_stats(winid, const char *, long *, long *); +static void misc_stats(winid, long *, long *); +static int wiz_show_stats(); +static boolean accept_menu_prefix(int (*)()); # ifdef PORT_DEBUG -STATIC_DCL int NDECL(wiz_port_debug); +static int wiz_port_debug(); # endif # else -extern int NDECL(tutorial_redisplay); +extern int tutorial_redisplay(); # endif -STATIC_PTR int NDECL(enter_explore_mode); -STATIC_PTR int NDECL(doattributes); -STATIC_PTR int NDECL(doconduct); /**/ -STATIC_PTR boolean NDECL(minimal_enlightenment); +static int enter_explore_mode(); +static int doattributes(); +static int doconduct(); /**/ +static boolean minimal_enlightenment(); -STATIC_DCL void FDECL(enlght_line, (const char *, const char *, const char *)); -STATIC_DCL char *FDECL(enlght_combatinc, (const char *, int, int, char *)); +static void enlght_line(const char *, const char *, const char *); +static char *enlght_combatinc(const char *, int, int, char *); #ifdef UNIX -static void NDECL(end_of_input); +static void end_of_input(); #endif static const char* readchar_queue=""; @@ -206,25 +206,25 @@ static const char unavailcmd[] = "Unavailable command '%s'."; /* for rejecting #if !SHELL, !SUSPEND */ static const char cmdnotavail[] = "'%s' command not available."; -static char FDECL(here_cmd_menu, (BOOLEAN_P)); -static char FDECL(there_cmd_menu, (BOOLEAN_P, int, int)); -STATIC_DCL char *NDECL(parse); -static boolean FDECL(help_dir, (CHAR_P, int, const char *)); -static int NDECL(dosuspend_core); +static char here_cmd_menu(BOOLEAN_P); +static char there_cmd_menu(BOOLEAN_P, int, int); +static char *parse(); +static boolean help_dir(CHAR_P, int, const char *); +static int dosuspend_core(); /* allmain.c */ extern int monclock; static int debug_show_colors(); -STATIC_PTR int +static int doprev_message() { return nh_doprev_message(); } /* Count down by decrementing multi */ -STATIC_PTR int +static int timed_occupation() { (*timed_occ_fn)(); @@ -260,7 +260,7 @@ reset_occupations() */ void set_occupation(fn, txt, xtime) -int NDECL((*fn)); +int (*fn)(void); const char *txt; int xtime; { @@ -276,7 +276,7 @@ int xtime; #ifdef REDO -static char NDECL(popch); +static char popch(); /* Provide a means to redo the last command. The flag `in_doagain' is set * to true while redoing the command. This flag is tested in commands that @@ -342,11 +342,11 @@ char ch; #endif /* REDO */ /** here after # - now read a full-word command */ -STATIC_PTR int +static int doextcmd() { int idx, retval; - int NDECL((*func)); + int (*func)(void); /* keep repeating until we don't run help or quit */ do { @@ -710,7 +710,7 @@ extcmd_via_menu() /* here after # - now show pick-list of possible commands */ #endif /* #monster command - use special monster ability while polymorphed */ -STATIC_PTR int +static int domonability() { if (can_breathe(youmonst.data)) return dobreathe(); @@ -740,7 +740,7 @@ domonability() return 0; } -STATIC_PTR int +static int enter_explore_mode() { if(!discover && !wizard) { @@ -759,13 +759,13 @@ enter_explore_mode() } /* #vanquished command */ -STATIC_PTR int dovanquished() +static int dovanquished() { list_vanquishedonly(); return 0; } -STATIC_PTR int +static int dooverview_or_wiz_where() { /* @@ -811,7 +811,7 @@ wiz_show_rooms() } /* ^W command - wish for something */ -STATIC_PTR int +static int wiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */ { if (wizard) { @@ -827,7 +827,7 @@ wiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */ } /* ^I command - identify hero's inventory */ -STATIC_PTR int +static int wiz_identify() { if (wizard) { @@ -839,7 +839,7 @@ wiz_identify() } /* ^F command - reveal the level map and any traps on it */ -STATIC_PTR int +static int wiz_map() { if (wizard) { @@ -861,7 +861,7 @@ wiz_map() } /* ^G command - generate monster(s); a count prefix will be honored */ -STATIC_PTR int +static int wiz_genesis() { if (wizard) (void) create_particular(); @@ -870,7 +870,7 @@ wiz_genesis() } /* ^O command - display dungeon layout */ -STATIC_PTR int +static int wiz_where() { if (wizard) { @@ -882,7 +882,7 @@ wiz_where() } /* ^E command - detect unseen (secret doors, traps, hidden monsters) */ -STATIC_PTR int +static int wiz_detect() { if (wizard) { @@ -894,7 +894,7 @@ wiz_detect() } /* ^V command - level teleport, or tutorial review */ -STATIC_PTR int +static int wiz_level_tele() { if (wizard) level_tele(); @@ -904,7 +904,7 @@ wiz_level_tele() } /* #monpolycontrol command - choose new form for shapechangers, polymorphees */ -STATIC_PTR int +static int wiz_mon_polycontrol() { iflags.mon_polycontrol = !iflags.mon_polycontrol; @@ -914,7 +914,7 @@ wiz_mon_polycontrol() } /* #levelchange command - adjust hero's experience level */ -STATIC_PTR int +static int wiz_level_change() { char buf[BUFSZ]; @@ -954,7 +954,7 @@ wiz_level_change() } /* #panic command - test program's panic handling */ -STATIC_PTR int +static int wiz_panic() { if (iflags.debug_fuzzer) { @@ -969,7 +969,7 @@ wiz_panic() } /* #polyself command - change hero's form */ -STATIC_PTR int +static int wiz_polyself() { polyself(TRUE); @@ -977,7 +977,7 @@ wiz_polyself() } /* #seenv command */ -STATIC_PTR int +static int wiz_show_seenv() { winid win; @@ -1019,7 +1019,7 @@ wiz_show_seenv() } /* #vision command */ -STATIC_PTR int +static int wiz_show_vision() { winid win; @@ -1056,7 +1056,7 @@ wiz_show_vision() } /* #wmode command */ -STATIC_PTR int +static int wiz_show_wmodes() { winid win; @@ -1088,7 +1088,7 @@ wiz_show_wmodes() } /* #showkills command */ -STATIC_PTR int wiz_showkills() /* showborn patch */ +static int wiz_showkills() /* showborn patch */ { list_vanquished('y', FALSE); return 0; @@ -1858,7 +1858,7 @@ boolean want_disp; * to help refresh them about who/what they are. * Returns FALSE if menu cancelled (dismissed with ESC), TRUE otherwise. */ -STATIC_OVL boolean +static boolean minimal_enlightenment() { winid tmpwin; @@ -2113,7 +2113,7 @@ do_naming_ddocall() return do_naming(0); } -STATIC_PTR int +static int doattributes() { if (!minimal_enlightenment()) @@ -2126,7 +2126,7 @@ doattributes() /* KMH, #conduct * (shares enlightenment's tense handling) */ -STATIC_PTR int +static int doconduct() { show_conduct(0, TRUE); @@ -2646,7 +2646,7 @@ commands_init() char cmd_from_func(fn) -int NDECL((*fn)); +int (*fn)(void); { int i; @@ -2667,7 +2667,7 @@ static const char template[] = "%-27s %4ld %6ld"; static const char stats_hdr[] = " count bytes"; static const char stats_sep[] = "--------------------------- ----- -------"; -STATIC_OVL int +static int size_obj(otmp) struct obj *otmp; { @@ -2689,7 +2689,7 @@ struct obj *otmp; return sz; } -STATIC_OVL void +static void count_obj(chain, total_count, total_size, top, recurse) struct obj *chain; long *total_count; @@ -2713,7 +2713,7 @@ boolean recurse; *total_size += size; } -STATIC_OVL void +static void obj_chain(win, src, chain, force, total_count, total_size) winid win; const char *src; @@ -2735,7 +2735,7 @@ long *total_size; } } -STATIC_OVL void +static void mon_invent_chain(win, src, chain, total_count, total_size) winid win; const char *src; @@ -2755,7 +2755,7 @@ long *total_size; putstr(win, 0, buf); } -STATIC_OVL void +static void contained_stats(win, src, total_count, total_size) winid win; const char *src; @@ -2785,7 +2785,7 @@ long *total_size; } } -STATIC_OVL int +static int size_monst(mtmp, incl_wsegs) struct monst *mtmp; boolean incl_wsegs; @@ -2815,7 +2815,7 @@ boolean incl_wsegs; return sz; } -STATIC_OVL void +static void mon_chain(win, src, chain, force, total_count, total_size) winid win; const char *src; @@ -2843,7 +2843,7 @@ long *total_size; } } -STATIC_OVL void +static void misc_stats(win, total_count, total_size) winid win; long *total_count; @@ -3453,7 +3453,7 @@ boolean initial; /* non-movement commands which accept 'm' prefix to request menu operation */ static boolean accept_menu_prefix(cmd_func) -int NDECL((*cmd_func)); +int (*cmd_func)(void); { if (cmd_func == dopickup || cmd_func == dotip || /* eat, #offer, and apply tinning-kit all use floorfood() to pick @@ -3740,7 +3740,7 @@ register char *cmd; if (prefix_seen && cmd[0] == Cmd.spkeys[NHKF_REQMENU]) { /* (for func_tab cast, see below) */ const struct ext_func_tab *ft = Cmd.commands[cmd[1] & 0xff]; - int NDECL((*func)) = ft ? ((struct ext_func_tab *) ft)->ef_funct : 0; + int (*func)() = ft ? ((struct ext_func_tab *) ft)->ef_funct : 0; if (func && accept_menu_prefix(func)) { iflags.menu_requested = TRUE; @@ -3773,7 +3773,7 @@ register char *cmd; /* handle all other commands */ } else { const struct ext_func_tab *tlist; - int res, NDECL((*func)); + int res, (*func)(); /* current - use *cmd to directly index cmdlist array */ if ((tlist = Cmd.commands[*cmd & 0xff]) != 0) { @@ -4044,7 +4044,7 @@ boolean nodiag; /* explain choices if player has asked for getdir() help or has given an invalid direction after a prefix key ('F', 'g', 'm', &c), which might be bogus but could be up, down, or self when not applicable */ -STATIC_OVL boolean +static boolean help_dir(sym, spkey, msg) char sym; int spkey; /* NHKF_ code for prefix key, if one was used, or for ESC */ @@ -4257,7 +4257,7 @@ dotherecmdmenu() static void add_herecmd_menuitem(win, func, text) winid win; -int NDECL((*func)); +int (*func)(); const char *text; { char ch; @@ -4354,7 +4354,7 @@ int x, y; destroy_nhwindow(win); ch = '\0'; if (npick > 0) { - int NDECL((*func)) = picks->item.a_nfunc; + int (*func)() = picks->item.a_nfunc; free(picks); if (doit) { @@ -4451,7 +4451,7 @@ boolean doit; destroy_nhwindow(win); ch = '\0'; if (npick > 0) { - int NDECL((*func)) = picks->item.a_nfunc; + int (*func)() = picks->item.a_nfunc; free(picks); if (doit) { @@ -4662,7 +4662,7 @@ boolean historical; /* whether to include in message history: True => yes */ return key; } -STATIC_OVL char * +static char * parse() { #ifdef LINT /* static char in_line[COLNO]; */ @@ -4916,7 +4916,7 @@ do_stair_travel(char up_or_down) } /** '_' command, #travel, via keyboard rather than mouse click */ -STATIC_PTR int +static int dotravel() { /* Keyboard travel command */ @@ -4969,7 +4969,7 @@ dotravel() return 0; } -STATIC_PTR int +static int doautoexplore() { static char cmd[2]; @@ -4980,7 +4980,7 @@ doautoexplore() } /** Chooses a suitable monster and fights it. */ -STATIC_PTR int +static int doautofight() { int i, j; @@ -5007,8 +5007,8 @@ doautofight() #ifdef PORT_DEBUG # ifdef WIN32CON -extern void NDECL(win32con_debug_keystrokes); -extern void NDECL(win32con_handler_info); +extern void win32con_debug_keystrokes(); +extern void win32con_handler_info(); # endif int @@ -5021,13 +5021,13 @@ wiz_port_debug() int num_menu_selections; struct menu_selection_struct { char *menutext; - void NDECL((*fn)); + void (*fn)(); } menu_selections[] = { #ifdef WIN32CON {"test win32 keystrokes", win32con_debug_keystrokes}, {"show keystroke handler information", win32con_handler_info}, #endif - {(char *)0, (void NDECL((*))) 0} /* array terminator */ + {(char) 0, NULL} /* array terminator */ }; num_menu_selections = SIZE(menu_selections) - 1; diff --git a/src/dbridge.c b/src/dbridge.c index a6710d993..1bcd32618 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -18,19 +18,19 @@ #include "hack.h" -STATIC_DCL void FDECL(get_wall_for_db, (int *, int *)); -STATIC_DCL struct entity *FDECL(e_at, (int, int)); -STATIC_DCL void FDECL(m_to_e, (struct monst *, int, int, struct entity *)); -STATIC_DCL void FDECL(u_to_e, (struct entity *)); -STATIC_DCL void FDECL(set_entity, (int, int, struct entity *)); -STATIC_DCL const char *FDECL(e_nam, (struct entity *)); -STATIC_DCL const char *FDECL(E_phrase, (struct entity *, const char *)); -STATIC_DCL boolean FDECL(e_survives_at, (struct entity *, int, int)); -STATIC_DCL void FDECL(e_died, (struct entity *, int, int)); -STATIC_DCL boolean FDECL(automiss, (struct entity *)); -STATIC_DCL boolean FDECL(e_missed, (struct entity *, BOOLEAN_P)); -STATIC_DCL boolean FDECL(e_jumps, (struct entity *)); -STATIC_DCL void FDECL(do_entity, (struct entity *)); +static void get_wall_for_db(int *, int *); +static struct entity *e_at(int, int); +static void m_to_e(struct monst *, int, int, struct entity *); +static void u_to_e(struct entity *); +static void set_entity(int, int, struct entity *); +static const char *e_nam(struct entity *); +static const char *E_phrase(struct entity *, const char *); +static boolean e_survives_at(struct entity *, int, int); +static void e_died(struct entity *, int, int); +static boolean automiss(struct entity *); +static boolean e_missed(struct entity *, BOOLEAN_P); +static boolean e_jumps(struct entity *); +static void do_entity(struct entity *); boolean is_pool(x, y) @@ -221,7 +221,7 @@ int *x, *y; /* * Find the drawbridge wall associated with a drawbridge. */ -STATIC_OVL void +static void get_wall_for_db(x, y) int *x, *y; { @@ -299,8 +299,7 @@ struct entity { static NEARDATA struct entity occupants[ENTITIES]; -STATIC_OVL -struct entity * +static struct entity * e_at(x, y) int x, y; { @@ -319,7 +318,7 @@ int x, y; (struct entity *)0 : &(occupants[entitycnt])); } -STATIC_OVL void +static void m_to_e(mtmp, x, y, etmp) struct monst *mtmp; int x, y; @@ -337,7 +336,7 @@ struct entity *etmp; etmp->edata = (struct permonst *)0; } -STATIC_OVL void +static void u_to_e(etmp) struct entity *etmp; { @@ -347,7 +346,7 @@ struct entity *etmp; etmp->edata = youmonst.data; } -STATIC_OVL void +static void set_entity(x, y, etmp) int x, y; struct entity *etmp; @@ -370,7 +369,7 @@ struct entity *etmp; /* #define e_strg(etmp, func) (is_u(etmp)? (char *)0 : func(etmp->emon)) */ -STATIC_OVL const char * +static const char * e_nam(etmp) struct entity *etmp; { @@ -381,7 +380,7 @@ struct entity *etmp; * Generates capitalized entity name, makes 2nd -> 3rd person conversion on * verb, where necessary. */ -STATIC_OVL const char * +static const char * E_phrase(etmp, verb) struct entity *etmp; const char *verb; @@ -403,7 +402,7 @@ const char *verb; /* * Simple-minded "can it be here?" routine */ -STATIC_OVL boolean +static boolean e_survives_at(etmp, x, y) struct entity *etmp; int x, y; @@ -426,7 +425,7 @@ int x, y; return(TRUE); } -STATIC_OVL void +static void e_died(etmp, xkill_flags, how) struct entity *etmp; int xkill_flags, how; @@ -489,7 +488,7 @@ int xkill_flags, how; /* * These are never directly affected by a bridge or portcullis. */ -STATIC_OVL boolean +static boolean automiss(etmp) struct entity *etmp; { @@ -500,7 +499,7 @@ struct entity *etmp; /* * Does falling drawbridge or portcullis miss etmp? */ -STATIC_OVL boolean +static boolean e_missed(etmp, chunks) struct entity *etmp; boolean chunks; @@ -537,7 +536,7 @@ boolean chunks; /* * Can etmp jump from death? */ -STATIC_OVL boolean +static boolean e_jumps(etmp) struct entity *etmp; { @@ -562,7 +561,7 @@ struct entity *etmp; return ((tmp >= rnd(10)) ? TRUE : FALSE); } -STATIC_OVL void +static void do_entity(etmp) struct entity *etmp; { diff --git a/src/decl.c b/src/decl.c index 91cc185fd..5b20bcb47 100644 --- a/src/decl.c +++ b/src/decl.c @@ -3,8 +3,8 @@ #include "hack.h" -int NDECL((*afternmv)); -int NDECL((*occupation)); +int (*afternmv)(void); +int (*occupation)(void); /* from xxxmain.c */ const char *hname = 0; /* name of the game (argv[0] of main) */ diff --git a/src/detect.c b/src/detect.c index dff09cc5a..17f849f57 100644 --- a/src/detect.c +++ b/src/detect.c @@ -11,13 +11,13 @@ extern boolean known; /* from read.c */ -STATIC_DCL void FDECL(do_dknown_of, (struct obj *)); -STATIC_DCL boolean FDECL(check_map_spot, (int, int, CHAR_P, unsigned)); -STATIC_DCL boolean FDECL(clear_stale_map, (CHAR_P, unsigned)); -STATIC_DCL void FDECL(sense_trap, (struct trap *, XCHAR_P, XCHAR_P, int)); -STATIC_DCL void FDECL(show_map_spot, (int, int)); -STATIC_PTR void FDECL(findone, (int, int, genericptr_t)); -STATIC_PTR void FDECL(openone, (int, int, genericptr_t)); +static void do_dknown_of(struct obj *); +static boolean check_map_spot(int, int, CHAR_P, unsigned); +static boolean clear_stale_map(CHAR_P, unsigned); +static void sense_trap(struct trap *, XCHAR_P, XCHAR_P, int); +static void show_map_spot(int, int); +static void findone(int, int, genericptr_t); +static void openone(int, int, genericptr_t); /* bring hero out from underwater or underground or being engulfed; return True iff any change occurred */ @@ -207,7 +207,7 @@ unsigned material; return (struct obj *) 0; } -STATIC_OVL void +static void do_dknown_of(obj) struct obj *obj; { @@ -221,7 +221,7 @@ struct obj *obj; } /* Check whether the location has an outdated object displayed on it. */ -STATIC_OVL boolean +static boolean check_map_spot(x, y, oclass, material) int x, y; char oclass; @@ -275,7 +275,7 @@ unsigned material; reappear after the detection has completed. Return true if noticeable change occurs. */ -STATIC_OVL boolean +static boolean clear_stale_map(oclass, material) char oclass; unsigned material; @@ -836,7 +836,7 @@ int mclass; /* monster class, 0 for all */ return 0; } -STATIC_OVL void +static void sense_trap(trap, x, y, src_cursed) struct trap *trap; xchar x, y; @@ -1195,7 +1195,7 @@ struct obj **optr; return; } -STATIC_OVL void +static void show_map_spot(x, y) register int x, y; { @@ -1305,7 +1305,7 @@ struct rm *lev; /* find something at one location; it should find all somethings there since it is used for magical detection rather than physical searching */ -STATIC_PTR void +static void findone(zx, zy, num) int zx, zy; genericptr_t num; @@ -1363,7 +1363,7 @@ genericptr_t num; } } -STATIC_PTR void +static void openone(zx, zy, num) int zx, zy; genericptr_t num; @@ -1449,7 +1449,7 @@ openit() /* callback hack for overriding vision in do_clear_area() */ boolean detecting(func) -void FDECL((*func), (int, int, void *)); +void (*func)(int, int, void *); { return (func == findone || func == openone); } diff --git a/src/dig.c b/src/dig.c index bf689fdd5..6226db74d 100644 --- a/src/dig.c +++ b/src/dig.c @@ -5,12 +5,12 @@ static NEARDATA boolean did_dig_msg; -static boolean NDECL(rm_waslit); -static void FDECL(mkcavepos, (XCHAR_P, XCHAR_P, int, BOOLEAN_P, BOOLEAN_P)); -static void FDECL(mkcavearea, (BOOLEAN_P)); -static int NDECL(dig); -static int FDECL(adj_pit_checks, (coord *, char *)); -static void FDECL(pit_flow, (struct trap *, SCHAR_P)); +static boolean rm_waslit(); +static void mkcavepos(XCHAR_P, XCHAR_P, int, BOOLEAN_P, BOOLEAN_P); +static void mkcavearea(BOOLEAN_P); +static int dig(); +static int adj_pit_checks(coord *, char *); +static void pit_flow(struct trap *, SCHAR_P); enum grave_type { GRAVE_NORMAL = 0, diff --git a/src/display.c b/src/display.c index eb857d5c7..d9904ca59 100644 --- a/src/display.c +++ b/src/display.c @@ -122,24 +122,24 @@ */ #include "hack.h" -STATIC_DCL void FDECL(show_mon_or_warn, (int, int, int)); -STATIC_DCL void FDECL(display_monster, (XCHAR_P, XCHAR_P, struct monst *, int, XCHAR_P)); -STATIC_DCL int FDECL(swallow_to_glyph, (int, int)); -STATIC_DCL void FDECL(display_warning, (struct monst *)); - -STATIC_DCL int FDECL(check_pos, (int, int, int)); -STATIC_DCL int FDECL(get_bk_glyph, (XCHAR_P, XCHAR_P)); -STATIC_DCL int FDECL(tether_glyph, (int, int)); +static void show_mon_or_warn(int, int, int); +static void display_monster(XCHAR_P, XCHAR_P, struct monst *, int, XCHAR_P); +static int swallow_to_glyph(int, int); +static void display_warning(struct monst *); + +static int check_pos(int, int, int); +static int get_bk_glyph(XCHAR_P, XCHAR_P); +static int tether_glyph(int, int); #ifdef WA_VERBOSE -STATIC_DCL boolean FDECL(more_than_one, (int, int, int, int, int)); +static boolean more_than_one(int, int, int, int, int); #endif -STATIC_DCL int FDECL(set_twall, (int, int, int, int, int, int, int, int)); -STATIC_DCL int FDECL(set_wall, (int, int, int)); -STATIC_DCL int FDECL(set_corn, (int, int, int, int, int, int, int, int)); -STATIC_DCL int FDECL(set_crosswall, (int, int)); -STATIC_DCL void FDECL(set_seenv, (struct rm *, int, int, int, int)); -STATIC_DCL void FDECL(t_warn, (struct rm *)); -STATIC_DCL int FDECL(wall_angle, (struct rm *)); +static int set_twall(int, int, int, int, int, int, int, int); +static int set_wall(int, int, int); +static int set_corn(int, int, int, int, int, int, int, int); +static int set_crosswall(int, int); +static void set_seenv(struct rm *, int, int, int, int); +static void t_warn(struct rm *); +static int wall_angle(struct rm *); int is_safemon(struct monst *mon) @@ -375,7 +375,7 @@ int x, y, show; } /* display something on monster layer; may need to fixup object layer */ -STATIC_OVL void +static void show_mon_or_warn(x, y, monglyph) int x, y, monglyph; { @@ -409,7 +409,7 @@ int x, y, monglyph; * a worm tail. * */ -STATIC_OVL void +static void display_monster(x, y, mon, sightflags, worm_tail) register xchar x, y; /* display position */ register struct monst *mon; /* monster to display */ @@ -527,7 +527,7 @@ xchar worm_tail; /* mon is actually a worm tail */ * * Do not call for worm tails. */ -STATIC_OVL void +static void display_warning(mon) register struct monst *mon; { @@ -944,7 +944,7 @@ xchar x, y; } } -STATIC_OVL int +static int tether_glyph(x, y) int x, y; { @@ -1716,7 +1716,7 @@ int cursor_on_u; #ifdef DUMP_LOG /* D: Added to dump screen to output file */ -STATIC_PTR uchar get_glyph_char(glyph, oclass) +static uchar get_glyph_char(glyph, oclass) int glyph; int *oclass; { @@ -1768,7 +1768,7 @@ int *oclass; } #ifdef TTY_GRAPHICS -extern const char * FDECL(compress_str, (const char *)); +extern const char * compress_str(const char *); #else const char* compress_str(str) /* copied from win/tty/wintty.c */ @@ -2052,7 +2052,7 @@ xchar x, y; * If you don't want a patchwork monster while hallucinating, decide on * a random monster in swallowed() and don't use what_mon() here. */ -STATIC_OVL int +static int swallow_to_glyph(mnum, loc) int mnum; int loc; @@ -2120,7 +2120,7 @@ xchar x, y; * than current data from the map.] */ -STATIC_OVL int +static int get_bk_glyph(x, y) xchar x, y; { @@ -2194,8 +2194,8 @@ xchar x, y; #ifdef WA_VERBOSE -static const char *FDECL(type_to_name, (int)); -static void FDECL(error4, (int, int, int, int, int, int)); +static const char *type_to_name(int); +static void error4(int, int, int, int, int, int); static int bad_count[MAX_TYPE]; /* count of positions flagged as bad */ static const char *type_names[MAX_TYPE] = { @@ -2236,7 +2236,7 @@ int x, y, a, b, c, dd; * * Things that are ambigious: lava */ -STATIC_OVL int +static int check_pos(x, y, which) int x, y, which; { @@ -2250,7 +2250,7 @@ int x, y, which; /* Return TRUE if more than one is non-zero. */ /*ARGSUSED*/ #ifdef WA_VERBOSE -STATIC_OVL boolean +static boolean more_than_one(x, y, a, b, c) int x, y, a, b, c; { @@ -2265,7 +2265,7 @@ int x, y, a, b, c; #endif /* Return the wall mode for a T wall. */ -STATIC_OVL int +static int set_twall(x0, y0, x1, y1, x2, y2, x3, y3) int x0, y0, x1, y1, x2, y2, x3, y3; { @@ -2289,7 +2289,7 @@ int x0, y0, x1, y1, x2, y2, x3, y3; } /* Return wall mode for a horizontal or vertical wall. */ -STATIC_OVL int +static int set_wall(x, y, horiz) int x, y, horiz; { @@ -2312,7 +2312,7 @@ int x, y, horiz; /* Return a wall mode for a corner wall. (x4,y4) is the "inner" position. */ -STATIC_OVL int +static int set_corn(x1, y1, x2, y2, x3, y3, x4, y4) int x1, y1, x2, y2, x3, y3, x4, y4; { @@ -2341,7 +2341,7 @@ int x1, y1, x2, y2, x3, y3, x4, y4; } /* Return mode for a crosswall. */ -STATIC_OVL int +static int set_crosswall(x, y) int x, y; { @@ -2459,7 +2459,7 @@ unsigned char seenv_matrix[3][3] = { {SV2, SV1, SV0}, #define sign(z) ((z) < 0 ? -1 : ((z) > 0 ? 1 : 0)) /* Set the seen vector of lev as if seen from (x0,y0) to (x,y). */ -STATIC_OVL void +static void set_seenv(lev, x0, y0, x, y) struct rm *lev; int x0, y0, x, y; /* from, to */ @@ -2538,7 +2538,7 @@ static const int cross_matrix[4][6] = { /* Print out a T wall warning and all interesting info. */ -STATIC_OVL void +static void t_warn(lev) struct rm *lev; { @@ -2567,7 +2567,7 @@ struct rm *lev; * draw diagrams. See rm.h for more details on the wall modes and * seen vector (SV). */ -STATIC_OVL int +static int wall_angle(lev) struct rm *lev; { diff --git a/src/dlb.c b/src/dlb.c index e318fa0d9..b050790dc 100644 --- a/src/dlb.c +++ b/src/dlb.c @@ -18,27 +18,27 @@ */ typedef struct dlb_procs { - boolean NDECL((*dlb_init_proc)); - void NDECL((*dlb_cleanup_proc)); - boolean FDECL((*dlb_fopen_proc), (DLB_P, const char *, const char *)); - int FDECL((*dlb_fclose_proc), (DLB_P)); - int FDECL((*dlb_fread_proc), (char *, int, int, DLB_P)); - int FDECL((*dlb_fseek_proc), (DLB_P, long, int)); - char *FDECL((*dlb_fgets_proc), (char *, int, DLB_P)); - int FDECL((*dlb_fgetc_proc), (DLB_P)); - long FDECL((*dlb_ftell_proc), (DLB_P)); + boolean (*dlb_init_proc)(void); + void (*dlb_cleanup_proc)(void); + boolean (*dlb_fopen_proc)(DLB_P, const char *, const char *); + int (*dlb_fclose_proc)(DLB_P); + int (*dlb_fread_proc)(char *, int, int, DLB_P); + int (*dlb_fseek_proc)(DLB_P, long, int); + char *(*dlb_fgets_proc)(char *, int, DLB_P); + int (*dlb_fgetc_proc)(DLB_P); + long (*dlb_ftell_proc)(DLB_P); } dlb_procs_t; /* without extern.h via hack.h, these haven't been declared for us */ #ifdef FILE_AREAS -extern FILE *FDECL(fopen_datafile_area, (const char *, const char *, - const char *, int)); +extern FILE *fopen_datafile_area(const char *, const char *, + const char *, int); #else /* * If FILE_AREAS is not defined, then fopen_datafile_area * is a macro defined in terms of fopen_datafile. */ -extern FILE *FDECL(fopen_datafile, (const char *, const char *, int)); +extern FILE *fopen_datafile(const char *, const char *, int); #endif #ifdef DLBLIB @@ -61,25 +61,24 @@ extern FILE *FDECL(fopen_datafile, (const char *, const char *, int)); #define MAX_LIBS 4 static library dlb_libs[MAX_LIBS]; -static boolean FDECL(readlibdir, (library *lp)); -static boolean FDECL(find_file, (const char *name, library **lib, long *startp, - long *sizep)); -static boolean NDECL(lib_dlb_init); -static void NDECL(lib_dlb_cleanup); -static boolean FDECL(lib_dlb_fopen, (dlb *, const char *, const char *)); -static int FDECL(lib_dlb_fclose, (dlb *)); -static int FDECL(lib_dlb_fread, (char *, int, int, dlb *)); -static int FDECL(lib_dlb_fseek, (dlb *, long, int)); -static char *FDECL(lib_dlb_fgets, (char *, int, dlb *)); -static int FDECL(lib_dlb_fgetc, (dlb *)); -static long FDECL(lib_dlb_ftell, (dlb *)); +static boolean readlibdir(library *lp); +static boolean find_file(const char *name, library **lib, long *startp, long *sizep); +static boolean lib_dlb_init(); +static void lib_dlb_cleanup(); +static boolean lib_dlb_fopen(dlb *, const char *, const char *); +static int lib_dlb_fclose(dlb *); +static int lib_dlb_fread(char *, int, int, dlb *); +static int lib_dlb_fseek(dlb *, long, int); +static char *lib_dlb_fgets(char *, int, dlb *); +static int lib_dlb_fgetc(dlb *); +static long lib_dlb_ftell(dlb *); /* not static because shared with dlb_main.c */ -boolean FDECL(open_library, (const char *lib_area, const char *lib_name, library *lp)); -void FDECL(close_library, (library *lp)); +boolean open_library(const char *lib_area, const char *lib_name, library *lp); +void close_library(library *lp); /* without extern.h via hack.h, these haven't been declared for us */ -extern char *FDECL(eos, (char *)); +extern char *eos(char *); diff --git a/src/do.c b/src/do.c index c6ae4715d..9b274c856 100644 --- a/src/do.c +++ b/src/do.c @@ -9,20 +9,20 @@ #include #ifdef SINKS -static void NDECL(polymorph_sink); -static boolean NDECL(teleport_sink); -STATIC_DCL void FDECL(dosinkring, (struct obj *)); +static void polymorph_sink(); +static boolean teleport_sink(); +static void dosinkring(struct obj *); #endif /* SINKS */ -STATIC_PTR int FDECL(drop, (struct obj *)); -STATIC_PTR int NDECL(wipeoff); +static int drop(struct obj *); +static int wipeoff(); -STATIC_DCL int FDECL(menu_drop, (int)); -STATIC_DCL int NDECL(currentlevel_rewrite); -STATIC_DCL void NDECL(final_level); -/* static boolean FDECL(badspot, (XCHAR_P,XCHAR_P)); */ -STATIC_DCL boolean NDECL(unique_item_check); -STATIC_DCL void NDECL(levelport_monsters); +static int menu_drop(int); +static int currentlevel_rewrite(); +static void final_level(); +/* static boolean badspot(XCHAR_P,XCHAR_P); */ +static boolean unique_item_check(); +static void levelport_monsters(); static NEARDATA const char drop_types[] = { ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, 0 }; @@ -466,8 +466,7 @@ teleport_sink() return FALSE; } -STATIC_OVL -void +static void dosinkring(obj) /* obj is a ring being dropped over a kitchen sink */ register struct obj *obj; { @@ -673,8 +672,7 @@ const char *word; return(TRUE); } -STATIC_PTR -int +static int drop(obj) register struct obj *obj; { @@ -879,7 +877,7 @@ doddrop() } /* Drop things from the hero's inventory, using a menu. */ -STATIC_OVL int +static int menu_drop(retry) int retry; { @@ -1217,7 +1215,7 @@ doup() d_level save_dlevel = {0, 0}; /* check that we can write out the current level */ -STATIC_OVL int +static int currentlevel_rewrite() { register int fd; @@ -1851,7 +1849,7 @@ boolean at_stairs, falling, portal; #endif } -STATIC_OVL void +static void final_level() { struct monst *mtmp; @@ -2168,7 +2166,7 @@ donull() return(1); /* Do nothing, but let other things happen */ } -STATIC_PTR int +static int wipeoff() { if(u.ucreamed < 4) u.ucreamed = 0; diff --git a/src/do_name.c b/src/do_name.c index af0cb3928..a99c5b329 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -2,9 +2,9 @@ /* NetHack may be freely redistributed. See license for details. */ #include "hack.h" -STATIC_DCL char *NDECL(nextmbuf); -static void FDECL(getpos_help, (BOOLEAN_P, const char *)); -static void FDECL(gather_locs, (coord **, int *, int)); +static char *nextmbuf(); +static void getpos_help(BOOLEAN_P, const char *); +static void gather_locs(coord **, int *, int); static void auto_describe(int, int); static void call_object(int, char *); static void call_input(int, char *); @@ -14,7 +14,7 @@ extern const char what_is_an_unknown_object[]; /* from pager.c */ #define NUMMBUF 5 /* manage a pool of BUFSZ buffers, so callers don't have to */ -STATIC_OVL char * +static char * nextmbuf() { static char NEARDATA bufs[NUMMBUF][BUFSZ]; @@ -27,13 +27,13 @@ nextmbuf() /* function for getpos() to highlight desired map locations. * parameter value 0 = initialize, 1 = highlight, 2 = done */ -static void FDECL((*getpos_hilitefunc), (int)) = (void FDECL((*), (int))) 0; -static boolean FDECL((*getpos_getvalid), (int, int)) = (boolean FDECL((*), (int, int))) 0; +static void (*getpos_hilitefunc)(int) = (void (*)(int)) 0; +static boolean (*getpos_getvalid)(int, int) = (boolean (*)(int, int)) 0; void getpos_sethilite(gp_hilitef, gp_getvalidf) -void FDECL((*gp_hilitef), (int)); -boolean FDECL((*gp_getvalidf), (int, int)); +void (*gp_hilitef)(int); +boolean (*gp_getvalidf)(int, int); { getpos_hilitefunc = gp_hilitef; getpos_getvalid = gp_getvalidf; @@ -1259,7 +1259,7 @@ do_mname() return(0); } -STATIC_VAR int via_naming = 0; +static int via_naming = 0; /* * This routine changes the address of obj. Be careful not to call it @@ -1453,7 +1453,7 @@ ddocall() } /* for use by safe_qbuf() */ -STATIC_PTR char * +static char * docall_xname(obj) struct obj *obj; { diff --git a/src/do_wear.c b/src/do_wear.c index a40a11d42..b924ad661 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -3,7 +3,7 @@ #include "hack.h" -STATIC_OVL NEARDATA long takeoff_mask = 0L; +static NEARDATA long takeoff_mask = 0L; static NEARDATA long taking_off = 0L; static NEARDATA int todelay; @@ -30,22 +30,22 @@ static NEARDATA const long takeoff_order[] = { WORN_BLINDF, W_WEP, WORN_SHIRT, WORN_BOOTS, W_SWAPWEP, W_QUIVER, 0L }; -STATIC_DCL void FDECL(on_msg, (struct obj *)); -STATIC_PTR int NDECL(Armor_on); -STATIC_DCL int NDECL(Cloak_on); -STATIC_PTR int NDECL(Helmet_on); -STATIC_PTR int NDECL(Gloves_on); -STATIC_PTR int NDECL(Shield_on); -STATIC_PTR int NDECL(Shirt_on); -STATIC_DCL void NDECL(Amulet_on); -static void FDECL(learnring, (struct obj *, BOOLEAN_P)); -STATIC_DCL void FDECL(Ring_off_or_gone, (struct obj *, BOOLEAN_P)); -STATIC_PTR int FDECL(select_off, (struct obj *)); -STATIC_DCL struct obj *NDECL(do_takeoff); -STATIC_PTR int NDECL(take_off); -STATIC_DCL int FDECL(menu_remarm, (int)); -STATIC_DCL void FDECL(already_wearing, (const char*)); -STATIC_DCL void FDECL(already_wearing2, (const char*, const char*)); +static void on_msg(struct obj *); +static int Armor_on(); +static int Cloak_on(); +static int Helmet_on(); +static int Gloves_on(); +static int Shield_on(); +static int Shirt_on(); +static void Amulet_on(); +static void learnring(struct obj *, BOOLEAN_P); +static void Ring_off_or_gone(struct obj *, BOOLEAN_P); +static int select_off(struct obj *); +static struct obj *do_takeoff(); +static int take_off(); +static int menu_remarm(int); +static void already_wearing(const char*); +static void already_wearing2(const char*, const char*); /* plural "fingers" or optionally "gloves" */ const char * @@ -66,7 +66,7 @@ struct obj *otmp; } /* for items that involve no delay */ -STATIC_OVL void +static void on_msg(otmp) register struct obj *otmp; { @@ -308,7 +308,7 @@ Boots_off() return 0; } -STATIC_OVL int +static int Cloak_on() { long oldprop; @@ -456,8 +456,7 @@ Cloak_off() return 0; } -STATIC_PTR -int +static int Helmet_on() { if (!uarmh) { @@ -598,8 +597,7 @@ Helmet_off() return 0; } -STATIC_PTR -int +static int Gloves_on() { if (!uarmg) { @@ -721,7 +719,7 @@ Gloves_off() return 0; } -STATIC_OVL int +static int Shield_on() { /* no shield currently requires special handling when put on, but we @@ -775,7 +773,7 @@ Shield_off() return 0; } -STATIC_OVL int +static int Shirt_on() { /* no shirt currently requires special handling when put on, but we @@ -823,8 +821,7 @@ lucky_fedora() return 1; } -STATIC_PTR -int +static int Armor_on() { if (uarm && Is_glowing_dragon_armor(uarm->otyp)) { @@ -914,7 +911,7 @@ Armor_gone() return 0; } -STATIC_OVL void +static void Amulet_on() { if (!uamul) { @@ -1277,7 +1274,7 @@ register struct obj *obj; } } -STATIC_OVL void +static void Ring_off_or_gone(obj, gone) register struct obj *obj; boolean gone; @@ -1654,7 +1651,7 @@ struct obj *stolenobj; /* no message if stolenobj is already being doffing */ cancel_don(); /* don't want _on() or _off() being called by unmul() since the on or off action isn't completing */ - afternmv = (int NDECL((*))) 0; + afternmv = (int (*)(void)) 0; if (putting_on || otmp != stolenobj) { Sprintf(buf, "You stop %s %s.", putting_on ? "putting on" : "taking off", @@ -1955,14 +1952,14 @@ struct obj *otmp; return(1); } -STATIC_OVL void +static void already_wearing(cc) const char *cc; { You("are already wearing %s%c", cc, (cc == c_that_) ? '!' : '.'); } -STATIC_OVL void +static void already_wearing2(cc1, cc2) const char *cc1, *cc2; { @@ -2587,8 +2584,7 @@ unchanger() } /* occupation callback for 'A' */ -STATIC_PTR -int +static int select_off(otmp) register struct obj *otmp; { @@ -2692,7 +2688,7 @@ register struct obj *otmp; return(0); } -STATIC_OVL struct obj * +static struct obj * do_takeoff() { struct obj *otmp = (struct obj *) 0; @@ -2753,8 +2749,7 @@ do_takeoff() static const char *disrobing = ""; /* occupation callback for 'A' */ -STATIC_PTR -int +static int take_off() { register int i; @@ -2881,7 +2876,7 @@ doddoremarm() return 0; } -STATIC_OVL int +static int menu_remarm(retry) int retry; { diff --git a/src/dog.c b/src/dog.c index 3986b342a..eb7e0c315 100644 --- a/src/dog.c +++ b/src/dog.c @@ -3,7 +3,7 @@ #include "hack.h" -STATIC_DCL int NDECL(pet_type); +static int pet_type(); void newedog(mtmp) @@ -52,7 +52,7 @@ register struct monst *mtmp; EDOG(mtmp)->killed_by_u = 0; } -STATIC_OVL int +static int pet_type() { if (urole.petnum != NON_PM) diff --git a/src/dogmove.c b/src/dogmove.c index 558c5f9d5..474c802ef 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -7,19 +7,18 @@ extern boolean notonhead; -STATIC_DCL boolean FDECL(dog_hunger, (struct monst *, struct edog *)); -STATIC_DCL int FDECL(dog_invent, (struct monst *, struct edog *, int)); -STATIC_DCL int FDECL(dog_goal, (struct monst *, struct edog *, int, int, int)); +static boolean dog_hunger(struct monst *, struct edog *); +static int dog_invent(struct monst *, struct edog *, int); +static int dog_goal(struct monst *, struct edog *, int, int, int); -static struct monst *FDECL(find_targ, (struct monst *, int, int, int)); -static int FDECL(find_friends, (struct monst *, struct monst *, int)); -static struct monst *FDECL(best_target, (struct monst *)); -static long FDECL(score_targ, (struct monst *, struct monst *)); +static struct monst *find_targ(struct monst *, int, int, int); +static int find_friends(struct monst *, struct monst *, int); +static struct monst *best_target(struct monst *); +static long score_targ(struct monst *, struct monst *); -STATIC_DCL boolean FDECL(can_reach_location, (struct monst *, XCHAR_P, XCHAR_P, - XCHAR_P, XCHAR_P)); -STATIC_DCL boolean FDECL(could_reach_item, (struct monst *, XCHAR_P, XCHAR_P)); -static void FDECL(quickmimic, (struct monst *)); +static boolean can_reach_location(struct monst *, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); +static boolean could_reach_item(struct monst *, XCHAR_P, XCHAR_P); +static void quickmimic(struct monst *); /* pick a carried item for pet to drop */ struct obj * @@ -138,9 +137,9 @@ struct monst *mon; static NEARDATA const char nofetch[] = { BALL_CLASS, CHAIN_CLASS, ROCK_CLASS, 0 }; -STATIC_VAR xchar gtyp, gx, gy; /* type and position of dog's current goal */ +static xchar gtyp, gx, gy; /* type and position of dog's current goal */ -STATIC_PTR void FDECL(wantdoor, (int, int, genericptr_t)); +static void wantdoor(int, int, genericptr_t); boolean cursed_object_at(x, y) @@ -386,7 +385,7 @@ boolean devour; } /* hunger effects -- returns TRUE on starvation */ -STATIC_OVL boolean +static boolean dog_hunger(mtmp, edog) struct monst *mtmp; struct edog *edog; @@ -433,7 +432,7 @@ struct edog *edog; /* do something with object (drop, pick up, eat) at current position * returns 1 if object eaten (since that counts as dog's move), 2 if died */ -STATIC_OVL int +static int dog_invent(mtmp, edog, udist) struct monst *mtmp; struct edog *edog; @@ -505,7 +504,7 @@ int udist; /* set dog's goal -- gtyp, gx, gy * returns -1/0/1 (dog's desire to approach player) or -2 (abort move) */ -STATIC_OVL int +static int dog_goal(mtmp, edog, after, udist, whappr) register struct monst *mtmp; struct edog *edog; @@ -1323,7 +1322,7 @@ nxti: ; } /* check if a monster could pick up objects from a location */ -STATIC_OVL boolean +static boolean could_reach_item(mon, nx, ny) struct monst *mon; xchar nx, ny; @@ -1342,7 +1341,7 @@ xchar nx, ny; * Since the maximum food distance is 5, this should never be more than 5 calls * deep. */ -STATIC_OVL boolean +static boolean can_reach_location(mon, mx, my, fx, fy) struct monst *mon; xchar mx, my, fx, fy; @@ -1376,7 +1375,7 @@ xchar mx, my, fx, fy; } /* do_clear_area client */ -STATIC_PTR void +static void wantdoor(x, y, distance) int x, y; genericptr_t distance; diff --git a/src/dokick.c b/src/dokick.c index a60e7e2d0..c72688b30 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -12,20 +12,20 @@ static NEARDATA const char *gate_str; extern boolean notonhead; /* for long worms */ -STATIC_DCL void FDECL(kickdmg, (struct monst *, BOOLEAN_P)); -static boolean FDECL(maybe_kick_monster, (struct monst *, XCHAR_P, XCHAR_P)); -static void FDECL(kick_monster, (struct monst *, XCHAR_P, XCHAR_P)); -STATIC_DCL void FDECL(lawful_bribery_alignment, (SCHAR_P)); -static int FDECL(kick_object, (XCHAR_P, XCHAR_P, char *)); -static int FDECL(kick_object_core, (XCHAR_P, XCHAR_P)); -static char *FDECL(kickstr, (char *, const char *)); -STATIC_DCL void FDECL(otransit_msg, (struct obj *, BOOLEAN_P, long)); -STATIC_DCL void FDECL(drop_to, (coord *, SCHAR_P)); +static void kickdmg(struct monst *, BOOLEAN_P); +static boolean maybe_kick_monster(struct monst *, XCHAR_P, XCHAR_P); +static void kick_monster(struct monst *, XCHAR_P, XCHAR_P); +static void lawful_bribery_alignment(SCHAR_P); +static int kick_object(XCHAR_P, XCHAR_P, char *); +static int kick_object_core(XCHAR_P, XCHAR_P); +static char *kickstr(char *, const char *); +static void otransit_msg(struct obj *, BOOLEAN_P, long); +static void drop_to(coord *, SCHAR_P); static const char kick_passes_thru[] = "kick passes harmlessly through"; /* kicking damage when not poly'd into a form with a kick attack */ -STATIC_OVL void +static void kickdmg(mon, clumsy) struct monst *mon; boolean clumsy; @@ -499,7 +499,7 @@ xchar x, y; /* coordinates where object was before the impact, not after */ } /* jacket around kick_object_core */ -STATIC_OVL int +static int kick_object(x, y, kickobjnam) xchar x, y; char *kickobjnam; @@ -743,8 +743,8 @@ xchar x, y; newsym(x, y); boolean kickedobj_broken = FALSE; mon = bhit(u.dx, u.dy, range, KICKED_WEAPON, - (int FDECL((*), (MONST_P, OBJ_P))) 0, - (int FDECL((*), (OBJ_P, OBJ_P))) 0, + (int (*) (MONST_P, OBJ_P)) 0, + (int (*) (OBJ_P, OBJ_P)) 0, kickedobj, &kickedobj_broken); if (kickedobj_broken) { return 1; /* object broken */ @@ -1415,7 +1415,7 @@ dokick() return(1); } -STATIC_OVL void +static void drop_to(cc, loc) coord *cc; schar loc; @@ -1823,7 +1823,7 @@ unsigned long deliverflags; } } -STATIC_OVL void +static void otransit_msg(otmp, nodrop, num) register struct obj *otmp; register boolean nodrop; diff --git a/src/dothrow.c b/src/dothrow.c index 7bbf4fc61..ad6b80cdc 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -5,17 +5,17 @@ #include "hack.h" -STATIC_DCL int FDECL(throw_obj, (struct obj *, int)); -STATIC_DCL boolean FDECL(ok_to_throw, (int *)); -STATIC_DCL void NDECL(autoquiver); -STATIC_DCL int FDECL(gem_accept, (struct monst *, struct obj *)); -STATIC_DCL void FDECL(tmiss, (struct obj *, struct monst *, BOOLEAN_P)); -STATIC_DCL int FDECL(throw_gold, (struct obj *)); -STATIC_DCL void FDECL(check_shop_obj, (struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P)); -STATIC_DCL void FDECL(breakmsg, (struct obj *, BOOLEAN_P)); -STATIC_DCL boolean FDECL(toss_up, (struct obj *, BOOLEAN_P)); -STATIC_DCL void FDECL(sho_obj_return_to_u, (struct obj *obj)); -STATIC_DCL boolean FDECL(mhurtle_step, (genericptr_t, int, int)); +static int throw_obj(struct obj *, int); +static boolean ok_to_throw(int *); +static void autoquiver(); +static int gem_accept(struct monst *, struct obj *); +static void tmiss(struct obj *, struct monst *, BOOLEAN_P); +static int throw_gold(struct obj *); +static void check_shop_obj(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P); +static void breakmsg(struct obj *, BOOLEAN_P); +static boolean toss_up(struct obj *, BOOLEAN_P); +static void sho_obj_return_to_u(struct obj *obj); +static boolean mhurtle_step(genericptr_t, int, int); static NEARDATA const char toss_objs[] = { ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, WEAPON_CLASS, 0 }; @@ -26,7 +26,7 @@ static NEARDATA const char bullets[] = extern boolean notonhead; /* for long worms */ /* Throw the selected object, asking for direction */ -STATIC_OVL int +static int throw_obj(obj, shotlimit) struct obj *obj; int shotlimit; @@ -261,7 +261,7 @@ int shotlimit; } /* common to dothrow() and dofire() */ -STATIC_OVL boolean +static boolean ok_to_throw(shotlimit_p) int *shotlimit_p; /* (see dothrow()) */ { @@ -518,7 +518,7 @@ boolean walk_path(src_cc, dest_cc, check_proc, arg) coord *src_cc; coord *dest_cc; -boolean FDECL((*check_proc), (genericptr_t, int, int)); +boolean (*check_proc)(genericptr_t, int, int); genericptr_t arg; { int x, y, dx, dy, x_change, y_change, err, i, prev_x, prev_y; @@ -836,7 +836,7 @@ int x, y; return TRUE; } -STATIC_OVL boolean +static boolean mhurtle_step(arg, x, y) genericptr_t arg; int x, y; @@ -960,7 +960,7 @@ int dx, dy, range; return; } -STATIC_OVL void +static void check_shop_obj(obj, x, y, broken) struct obj *obj; xchar x, y; @@ -1000,7 +1000,7 @@ boolean broken; * * Returns FALSE if the object is gone. */ -STATIC_OVL boolean +static boolean toss_up(obj, hitsroof) struct obj *obj; boolean hitsroof; @@ -1133,7 +1133,7 @@ struct obj *obj; } /* the currently thrown object is returning to you (not for boomerangs) */ -STATIC_OVL void +static void sho_obj_return_to_u(obj) struct obj *obj; { @@ -1351,8 +1351,8 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ boolean obj_destroyed = FALSE; mon = bhit(u.dx, u.dy, range, tethered_weapon ? THROWN_TETHERED_WEAPON : THROWN_WEAPON, - (int FDECL((*), (MONST_P, OBJ_P))) 0, - (int FDECL((*), (OBJ_P, OBJ_P))) 0, + (int (*) (MONST_P, OBJ_P)) 0, + (int (*) (OBJ_P, OBJ_P)) 0, obj, &obj_destroyed); /* have to do this after bhit() so u.ux & u.uy are correct */ @@ -1591,7 +1591,7 @@ boolean mon_notices; } /* thrown object misses target monster */ -STATIC_OVL void +static void tmiss(obj, mon, maybe_wakeup) struct obj *obj; struct monst *mon; @@ -1977,7 +1977,7 @@ struct obj *obj; /* thrownobj or kickedobj or uwep */ return 0; } -STATIC_OVL int +static int gem_accept(mon, obj) register struct monst *mon; register struct obj *obj; @@ -2268,7 +2268,7 @@ struct obj *obj; } } -STATIC_OVL void +static void breakmsg(obj, in_view) struct obj *obj; boolean in_view; @@ -2311,7 +2311,7 @@ boolean in_view; } } -STATIC_OVL int +static int throw_gold(obj) struct obj *obj; { @@ -2357,8 +2357,8 @@ struct obj *obj; } else { boolean object_destroyed = FALSE; mon = bhit(u.dx, u.dy, range, THROWN_WEAPON, - (int FDECL((*), (MONST_P, OBJ_P))) 0, - (int FDECL((*), (OBJ_P, OBJ_P))) 0, + (int (*) (MONST_P, OBJ_P)) 0, + (int (*) (OBJ_P, OBJ_P)) 0, obj, &object_destroyed); if (object_destroyed) { thrownobj = 0; diff --git a/src/drawing.c b/src/drawing.c index 86ba494ce..0eb4f93b3 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -325,11 +325,11 @@ struct symdef defsyms[MAXPCHARS] = { #ifdef ASCIIGRAPH #ifdef PC9800 -void NDECL((*ibmgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ +void (*ibmgraphics_mode_callback)(void) = 0; /* set in tty_start_screen() */ #endif /* PC9800 */ #ifdef CURSES_GRAPHICS -void NDECL((*cursesgraphics_mode_callback)) = 0; +void (*cursesgraphics_mode_callback)(void) = 0; #endif static glyph_t ibm_graphics[MAXPCHARS] = { @@ -438,7 +438,7 @@ static glyph_t ibm_graphics[MAXPCHARS] = { #endif /* ASCIIGRAPH */ #ifdef TERMLIB -void NDECL((*decgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ +void (*decgraphics_mode_callback)(void) = 0; /* set in tty_start_screen() */ static glyph_t dec_graphics[MAXPCHARS] = { /* 0*/ g_FILLER(S_stone), @@ -760,7 +760,7 @@ static glyph_t utf8_graphics[MAXPCHARS] = { #endif #ifdef PC9800 -void NDECL((*ascgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ +void (*ascgraphics_mode_callback)(void) = 0; /* set in tty_start_screen() */ #endif /* diff --git a/src/dump.c b/src/dump.c index 67d996258..7e0e31309 100644 --- a/src/dump.c +++ b/src/dump.c @@ -19,7 +19,7 @@ extern char msgs[][BUFSZ]; extern int lastmsg; -void FDECL(do_vanquished, (int, BOOLEAN_P)); +void do_vanquished(int, BOOLEAN_P); #endif #ifdef DUMP_LOG diff --git a/src/dungeon.c b/src/dungeon.c index a4f5ff332..2e1599c89 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -37,43 +37,43 @@ struct lchoice { char menuletter; }; -static void FDECL(Fread, (genericptr_t, int, int, dlb *)); -STATIC_DCL xchar FDECL(dname_to_dnum, (const char *)); -STATIC_DCL int FDECL(find_branch, (const char *, struct proto_dungeon *)); -STATIC_DCL mapseen* FDECL(find_level_by_custom_name, (const char *)); -STATIC_DCL xchar FDECL(parent_dnum, (const char *, struct proto_dungeon *)); -STATIC_DCL int FDECL(level_range, (XCHAR_P, int, int, int, struct proto_dungeon *, int *)); -STATIC_DCL xchar FDECL(parent_dlevel, (const char *, struct proto_dungeon *)); -STATIC_DCL int FDECL(correct_branch_type, (struct tmpbranch *)); -STATIC_DCL branch *FDECL(add_branch, (int, int, struct proto_dungeon *)); -STATIC_DCL void FDECL(add_level, (s_level *)); -STATIC_DCL void FDECL(init_level, (int, int, struct proto_dungeon *)); -STATIC_DCL int FDECL(possible_places, (int, boolean *, struct proto_dungeon *)); -STATIC_DCL xchar FDECL(pick_level, (boolean *, int)); -STATIC_DCL boolean FDECL(place_level, (int, struct proto_dungeon *)); +static void Fread(genericptr_t, int, int, dlb *); +static xchar dname_to_dnum(const char *); +static int find_branch(const char *, struct proto_dungeon *); +static mapseen* find_level_by_custom_name(const char *); +static xchar parent_dnum(const char *, struct proto_dungeon *); +static int level_range(XCHAR_P, int, int, int, struct proto_dungeon *, int *); +static xchar parent_dlevel(const char *, struct proto_dungeon *); +static int correct_branch_type(struct tmpbranch *); +static branch *add_branch(int, int, struct proto_dungeon *); +static void add_level(s_level *); +static void init_level(int, int, struct proto_dungeon *); +static int possible_places(int, boolean *, struct proto_dungeon *); +static xchar pick_level(boolean *, int); +static boolean place_level(int, struct proto_dungeon *); #ifdef WIZARD -STATIC_DCL const char *FDECL(br_string, (int)); -STATIC_DCL void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P, struct lchoice *)); +static const char *br_string(int); +static void print_branch(winid, int, int, int, BOOLEAN_P, struct lchoice *); #endif #ifdef RANDOMIZED_PLANES -STATIC_DCL void NDECL(shuffle_planes); +static void shuffle_planes(); #endif mapseen *mapseenchn = (struct mapseen *)0; -/*STATIC_DCL void FDECL(free_mapseen, (mapseen *));*/ -STATIC_DCL mapseen *FDECL(load_mapseen, (int)); -STATIC_DCL void FDECL(save_mapseen, (int, mapseen *)); -STATIC_DCL mapseen *FDECL(find_mapseen, (d_level *)); -STATIC_DCL void FDECL(print_mapseen, (winid, mapseen *, boolean, boolean, boolean)); -static boolean FDECL(interest_mapseen, (mapseen *, boolean)); +/*static void free_mapseen(mapseen *);*/ +static mapseen *load_mapseen(int); +static void save_mapseen(int, mapseen *); +static mapseen *find_mapseen(d_level *); +static void print_mapseen(winid, mapseen *, boolean, boolean, boolean); +static boolean interest_mapseen(mapseen *, boolean); static const char *seen_string(xchar, const char *); -STATIC_DCL const char *FDECL(br_string2, (branch *)); +static const char *br_string2(branch *); #ifdef DEBUG #define DD dungeons[i] -STATIC_DCL void NDECL(dumpit); +static void dumpit(); -STATIC_OVL void +static void dumpit() { int i; @@ -246,7 +246,7 @@ dlb *stream; } } -STATIC_OVL xchar +static xchar dname_to_dnum(s) const char *s; { @@ -324,7 +324,7 @@ get_first_elemental_plane() #endif /* Find the branch that links the named dungeon. */ -STATIC_OVL int +static int find_branch(s, pd) const char *s; /* dungeon name */ struct proto_dungeon *pd; @@ -356,7 +356,7 @@ struct proto_dungeon *pd; * Find the "parent" by searching the prototype branch list for the branch * listing, then figuring out to which dungeon it belongs. */ -STATIC_OVL xchar +static xchar parent_dnum(s, pd) const char *s; /* dungeon name */ struct proto_dungeon *pd; @@ -388,7 +388,7 @@ struct proto_dungeon *pd; * a negative random component means from the (adjusted) base to the * end of the dungeon. */ -STATIC_OVL int +static int level_range(dgn, base, rand, chain, pd, adjusted_base) xchar dgn; int base, rand, chain; @@ -421,7 +421,7 @@ int *adjusted_base; return 1; } -STATIC_OVL xchar +static xchar parent_dlevel(s, pd) const char *s; struct proto_dungeon *pd; @@ -448,7 +448,7 @@ struct proto_dungeon *pd; } /* Convert from the temporary branch type to the dungeon branch type. */ -STATIC_OVL int +static int correct_branch_type(tbr) struct tmpbranch *tbr; { @@ -515,7 +515,7 @@ boolean extract_first; } /* Add a dungeon branch to the branch list. */ -STATIC_OVL branch * +static branch * add_branch(dgn, child_entry_level, pd) int dgn; int child_entry_level; @@ -547,7 +547,7 @@ struct proto_dungeon *pd; * level that has a dungeon number less than the dungeon number of the * last entry. */ -STATIC_OVL void +static void add_level(new_lev) s_level *new_lev; { @@ -569,7 +569,7 @@ s_level *new_lev; } } -STATIC_OVL void +static void init_level(dgn, proto_index, pd) int dgn, proto_index; struct proto_dungeon *pd; @@ -602,7 +602,7 @@ struct proto_dungeon *pd; new_level->next = (s_level *) 0; } -STATIC_OVL int +static int possible_places(idx, map, pd) int idx; /* prototype index */ boolean *map; /* array MAXLEVEL+1 in length */ @@ -634,7 +634,7 @@ struct proto_dungeon *pd; } /* Pick the nth TRUE entry in the given boolean array. */ -STATIC_OVL xchar +static xchar pick_level(map, nth) boolean *map; /* an array MAXLEVEL+1 in size */ int nth; @@ -647,7 +647,7 @@ int nth; } #ifdef DDEBUG -static void FDECL(indent, (int)); +static void indent(int); static void indent(d) @@ -664,7 +664,7 @@ int d; * all possible places have been tried. If all possible places have * been exhausted, return false. */ -STATIC_OVL boolean +static boolean place_level(proto_index, pd) int proto_index; struct proto_dungeon *pd; @@ -1853,7 +1853,7 @@ boolean unreachable; } /* Convert a branch type to a string usable by print_dungeon(). */ -STATIC_OVL const char * +static const char * br_string(type) int type; { @@ -1874,7 +1874,7 @@ d_level *dlev; } /* Print all child branches between the lower and upper bounds. */ -STATIC_OVL void +static void print_branch(win, dnum, lower_bound, upper_bound, bymenu, lchoices) winid win; int dnum; @@ -2131,7 +2131,7 @@ donamelevel() /* find the particular mapseen object in the chain */ /* may return 0 */ -STATIC_OVL mapseen * +static mapseen * find_mapseen(lev) d_level *lev; { @@ -2209,7 +2209,7 @@ int ledger_num; } } -STATIC_OVL void +static void save_mapseen(fd, mptr) int fd; mapseen *mptr; @@ -2234,7 +2234,7 @@ mapseen *mptr; savecemetery(fd, WRITE_SAVE, &mptr->final_resting_place); } -STATIC_OVL mapseen * +static mapseen * load_mapseen(fd) int fd; { @@ -2390,7 +2390,7 @@ d_level *lev; */ /* returns true if this level has something interesting to print out */ -STATIC_OVL boolean +static boolean interest_mapseen(mptr, final) mapseen *mptr; boolean final; /**< if game is finished */ @@ -2821,7 +2821,7 @@ seen_string(xchar x, const char *obj) } /* better br_string */ -STATIC_OVL const char * +static const char * br_string2(br) branch *br; { @@ -2874,7 +2874,7 @@ int indx; return outbuf; } -STATIC_OVL const char* +static const char* shop_string(rtype) int rtype; { diff --git a/src/eat.c b/src/eat.c index b7c19a056..b35fcee76 100644 --- a/src/eat.c +++ b/src/eat.c @@ -12,34 +12,34 @@ # endif #endif -STATIC_PTR int NDECL(eatmdone); -STATIC_PTR int NDECL(eatfood); -STATIC_PTR int NDECL(opentin); -STATIC_PTR int NDECL(unfaint); - -STATIC_DCL const char *FDECL(food_xname, (struct obj *, BOOLEAN_P)); -STATIC_DCL void FDECL(choke, (struct obj *)); -STATIC_DCL void NDECL(recalc_wt); -STATIC_DCL struct obj *FDECL(touchfood, (struct obj *)); -STATIC_DCL void NDECL(do_reset_eat); -STATIC_DCL void FDECL(done_eating, (BOOLEAN_P)); -STATIC_DCL void FDECL(cprefx, (int)); -STATIC_DCL void FDECL(givit, (int, struct permonst *)); -STATIC_DCL void FDECL(cpostfx, (int)); -static void FDECL(consume_tin, (const char *)); -STATIC_DCL void FDECL(start_tin, (struct obj *)); -STATIC_DCL int FDECL(eatcorpse, (struct obj *)); -STATIC_DCL void FDECL(fprefx, (struct obj *)); -STATIC_DCL void FDECL(accessory_has_effect, (struct obj *)); -STATIC_DCL void FDECL(fpostfx, (struct obj *)); -STATIC_DCL int NDECL(bite); -STATIC_DCL int FDECL(edibility_prompts, (struct obj *)); -STATIC_DCL int FDECL(rottenfood, (struct obj *)); -STATIC_DCL void NDECL(eatspecial); -STATIC_DCL void FDECL(eataccessory, (struct obj *)); -STATIC_DCL const char *FDECL(foodword, (struct obj *)); -STATIC_DCL boolean FDECL(maybe_cannibal, (int, BOOLEAN_P)); -STATIC_DCL int FDECL(tin_variety, (struct obj *, BOOLEAN_P)); +static int eatmdone(); +static int eatfood(); +static int opentin(); +static int unfaint(); + +static const char *food_xname(struct obj *, BOOLEAN_P); +static void choke(struct obj *); +static void recalc_wt(); +static struct obj *touchfood(struct obj *); +static void do_reset_eat(); +static void done_eating(BOOLEAN_P); +static void cprefx(int); +static void givit(int, struct permonst *); +static void cpostfx(int); +static void consume_tin(const char *); +static void start_tin(struct obj *); +static int eatcorpse(struct obj *); +static void fprefx(struct obj *); +static void accessory_has_effect(struct obj *); +static void fpostfx(struct obj *); +static int bite(); +static int edibility_prompts(struct obj *); +static int rottenfood(struct obj *); +static void eatspecial(); +static void eataccessory(struct obj *); +static const char *foodword(struct obj *); +static boolean maybe_cannibal(int, BOOLEAN_P); +static int tin_variety(struct obj *, BOOLEAN_P); char msgbuf[BUFSZ]; @@ -59,20 +59,20 @@ char msgbuf[BUFSZ]; #define nonrotting_food(otyp) \ ((otyp) == LEMBAS_WAFER || (otyp) == CRAM_RATION) -STATIC_OVL NEARDATA const char comestibles[] = { FOOD_CLASS, 0 }; +static NEARDATA const char comestibles[] = { FOOD_CLASS, 0 }; #ifdef ASTRAL_ESCAPE -STATIC_OVL NEARDATA const char sacrifice_types[] = { AMULET_CLASS, FOOD_CLASS, 0 }; +static NEARDATA const char sacrifice_types[] = { AMULET_CLASS, FOOD_CLASS, 0 }; #endif /* Gold must come first for getobj(). */ -STATIC_OVL NEARDATA const char allobj[] = { +static NEARDATA const char allobj[] = { COIN_CLASS, WEAPON_CLASS, ARMOR_CLASS, POTION_CLASS, SCROLL_CLASS, WAND_CLASS, RING_CLASS, AMULET_CLASS, FOOD_CLASS, TOOL_CLASS, GEM_CLASS, ROCK_CLASS, BALL_CLASS, CHAIN_CLASS, SPBOOK_CLASS, 0 }; -STATIC_OVL boolean force_save_hs = FALSE; +static boolean force_save_hs = FALSE; const char *hu_stat[] = { "Satiated", @@ -202,8 +202,7 @@ static NEARDATA struct { static char *eatmbuf = 0; /* set by cpostfx() */ /* called after mimicing is over */ -STATIC_PTR -int +static int eatmdone() /* called after mimicing is over */ { /* release `eatmbuf' */ @@ -256,7 +255,7 @@ eatmupdate() } /* ``[the(] singular(food, xname) [)]'' with awareness of unique monsters */ -STATIC_OVL const char * +static const char * food_xname(food, the_pfx) struct obj *food; boolean the_pfx; @@ -287,7 +286,7 @@ boolean the_pfx; * * To a full belly all food is bad. (It.) */ -STATIC_OVL void +static void choke(food) struct obj *food; { @@ -336,7 +335,7 @@ struct obj *food; } /* modify object wt. depending on time spent consuming it */ -STATIC_OVL void +static void recalc_wt() { struct obj *piece = victual.piece; @@ -410,7 +409,7 @@ struct obj *otmp; return nut; } -STATIC_OVL struct obj * +static struct obj * touchfood(otmp) struct obj *otmp; { @@ -478,7 +477,7 @@ struct obj *old_obj, *new_obj; } } -STATIC_OVL void +static void do_reset_eat() { #ifdef DEBUG @@ -534,7 +533,7 @@ eatfood() } } -STATIC_OVL void +static void done_eating(message) boolean message; { @@ -568,7 +567,7 @@ boolean message; } /* eating a corpse or egg of one's own species is usually naughty */ -STATIC_OVL boolean +static boolean maybe_cannibal(pm, allowmsg) int pm; boolean allowmsg; @@ -609,7 +608,7 @@ boolean allowmsg; return FALSE; } -STATIC_OVL void +static void cprefx(pm) register int pm; { @@ -844,7 +843,7 @@ register struct permonst *ptr; /* givit() tries to give you an intrinsic based on the monster's level * and what type of intrinsic it is trying to give you. */ -STATIC_OVL void +static void givit(type, ptr) int type; register struct permonst *ptr; @@ -992,7 +991,7 @@ register struct permonst *ptr; } /* called after completely consuming a corpse */ -STATIC_OVL void +static void cpostfx(pm) int pm; { @@ -1364,7 +1363,7 @@ int forcetype; obj->spe = -(r + 1); /* offset by 1 to allow index 0 */ } -STATIC_OVL int +static int tin_variety(obj, disp) struct obj *obj; boolean disp; /* we're just displaying so leave things alone */ @@ -1570,7 +1569,7 @@ const char *mesg; } /* called when starting to open a tin */ -STATIC_OVL void +static void start_tin(otmp) register struct obj *otmp; { @@ -1646,7 +1645,7 @@ Hear_again() } /* called on the "first bite" of rotten food */ -STATIC_OVL int +static int rottenfood(obj) struct obj *obj; { @@ -1687,7 +1686,7 @@ struct obj *obj; } /* called when a corpse is selected as food */ -STATIC_OVL int +static int eatcorpse(otmp) struct obj *otmp; { @@ -1902,7 +1901,7 @@ boolean already_partly_eaten; * Messages should use present tense since multi-turn food won't be * finishing at the time they're issued. */ -STATIC_OVL void +static void fprefx(otmp) struct obj *otmp; { @@ -2060,7 +2059,7 @@ int old, inc, typ; return old + inc; } -STATIC_OVL void +static void accessory_has_effect(otmp) struct obj *otmp; { @@ -2068,7 +2067,7 @@ struct obj *otmp; otmp->oclass == RING_CLASS ? "ring" : "amulet"); } -STATIC_OVL void +static void eataccessory(otmp) struct obj *otmp; { @@ -2225,7 +2224,7 @@ struct obj *otmp; } } /* called after eating non-food */ -STATIC_OVL void +static void eatspecial() { struct obj *otmp = victual.piece; @@ -2306,7 +2305,7 @@ static const char *foodwords[] = { "plastic", "glass", "rich food", "stone" }; -STATIC_OVL const char * +static const char * foodword(otmp) register struct obj *otmp; { @@ -2319,7 +2318,7 @@ register struct obj *otmp; } /* called after consuming (non-corpse) food */ -STATIC_OVL void +static void fpostfx(otmp) struct obj *otmp; { @@ -2412,7 +2411,7 @@ struct obj *otmp; * return 1 if the food was dangerous and you chose to stop. * return 2 if the food was dangerous and you chose to eat it anyway. */ -STATIC_OVL int +static int edibility_prompts(otmp) struct obj *otmp; { @@ -2900,7 +2899,7 @@ struct obj *obj; /* Take a single bite from a piece of food, checking for choking and * modifying usedtime. Returns 1 if they choked and survived, 0 otherwise. */ -STATIC_OVL int +static int bite() { if (victual.canchoke && u.uhunger >= 2000) { @@ -3031,8 +3030,7 @@ int num; newuhs(FALSE); } -STATIC_PTR -int +static int unfaint() { (void) Hear_again(); diff --git a/src/end.c b/src/end.c index d9642d014..ff233cd03 100644 --- a/src/end.c +++ b/src/end.c @@ -30,28 +30,28 @@ static struct val_list { struct valuable_data *list; int size; } valuables[] = { }; #ifndef NO_SIGNAL -STATIC_PTR void FDECL(done_intr, (int)); +static void done_intr(int); # if defined(UNIX) || defined(VMS) || defined (__EMX__) -static void FDECL(done_hangup, (int)); +static void done_hangup(int); # endif #endif -STATIC_PTR int NDECL(heaven_or_hell_lifesave_end); -STATIC_DCL void FDECL(disclose, (int, BOOLEAN_P)); -STATIC_DCL void FDECL(get_valuables, (struct obj *)); -STATIC_DCL void FDECL(sort_valuables, (struct valuable_data *, int)); -STATIC_DCL void FDECL(artifact_score, (struct obj *, BOOLEAN_P, winid)); -STATIC_DCL void FDECL(savelife, (int)); +static int heaven_or_hell_lifesave_end(); +static void disclose(int, BOOLEAN_P); +static void get_valuables(struct obj *); +static void sort_valuables(struct valuable_data *, int); +static void artifact_score(struct obj *, BOOLEAN_P, winid); +static void savelife(int); #ifdef DUMP_LOG extern char msgs[][BUFSZ]; extern int msgs_count[]; extern int lastmsg; -void FDECL(do_vanquished, (int, BOOLEAN_P)); +void do_vanquished(int, BOOLEAN_P); #endif /* DUMP_LOG */ -STATIC_DCL void FDECL(list_genocided, (int, BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL boolean FDECL(should_query_disclose_option, (int, char *)); +static void list_genocided(int, BOOLEAN_P, BOOLEAN_P); +static boolean should_query_disclose_option(int, char *); #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2) -extern void FDECL(nethack_exit, (int)); +extern void nethack_exit(int); #else #define nethack_exit exit #endif @@ -176,7 +176,7 @@ done2() #ifndef NO_SIGNAL /*ARGSUSED*/ -STATIC_PTR void +static void done_intr(sig_unused) /* called as signal() handler, so sent at least one arg */ int sig_unused UNUSED; { @@ -360,7 +360,7 @@ panic VA_DECL(const char *, str) done(PANICKED); } -STATIC_OVL boolean +static boolean should_query_disclose_option(category, defquery) int category; char *defquery; @@ -398,7 +398,7 @@ char *defquery; return TRUE; } -STATIC_OVL void +static void disclose(how, taken) int how; boolean taken; @@ -462,7 +462,7 @@ boolean taken; } /* try to get the player back in a viable state after being killed */ -STATIC_OVL void +static void savelife(how) int how; { @@ -492,7 +492,7 @@ int how; * Get valuables from the given list. Revised code: the list always remains * intact. */ -STATIC_OVL void +static void get_valuables(list) struct obj *list; /* inventory or container contents */ { @@ -525,7 +525,7 @@ struct obj *list; /* inventory or container contents */ * Sort collected valuables, most frequent to least. We could just * as easily use qsort, but we don't care about efficiency here. */ -STATIC_OVL void +static void sort_valuables(list, size) struct valuable_data list[]; int size; /* max value is less than 20 */ @@ -548,7 +548,7 @@ int size; /* max value is less than 20 */ } /* called twice; first to calculate total, then to list relevant items */ -STATIC_OVL void +static void artifact_score(list, counting, endwin) struct obj *list; boolean counting; /* true => add up points; false => display them */ @@ -1149,7 +1149,7 @@ int how; nh_terminate(EXIT_SUCCESS); } -STATIC_PTR int +static int heaven_or_hell_lifesave_end() { u.uinvulnerable = FALSE; @@ -1467,7 +1467,7 @@ num_genocides() return n; } -STATIC_OVL void +static void list_genocided(defquery, ask, want_disp) int defquery; boolean ask; diff --git a/src/engrave.c b/src/engrave.c index af7ee9899..e94e3e618 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -108,7 +108,7 @@ static const char *random_mesg[] = { "Our coil is broken, and we don't have a replacement. It's useless. It's so useless.", }; -static const char *NDECL(blengr); +static const char *blengr(); char * random_engraving(outbuf) diff --git a/src/exper.c b/src/exper.c index 061258ae2..457f43dce 100644 --- a/src/exper.c +++ b/src/exper.c @@ -6,7 +6,7 @@ #include #endif -STATIC_DCL int FDECL(enermod, (int)); +static int enermod(int); /* Return the experience points cutoff to level up to the next level. * Oddly, the experience point values are offset by one from the levels they @@ -60,7 +60,7 @@ newuexp(int lev) return 10000000; } -STATIC_OVL int +static int enermod(en) int en; { diff --git a/src/extralev.c b/src/extralev.c index 722e27275..118a42a18 100644 --- a/src/extralev.c +++ b/src/extralev.c @@ -22,12 +22,11 @@ struct rogueroom { #define RIGHT 8 static NEARDATA struct rogueroom r[3][3]; -STATIC_DCL void FDECL(roguejoin, (int, int, int, int, int)); -STATIC_DCL void FDECL(roguecorr, (int, int, int)); -STATIC_DCL void FDECL(miniwalk, (int, int)); +static void roguejoin(int, int, int, int, int); +static void roguecorr(int, int, int); +static void miniwalk(int, int); -STATIC_OVL -void +static void roguejoin(x1, y1, x2, y2, horiz) int x1, y1, x2, y2; int horiz; @@ -58,8 +57,7 @@ int horiz; } } -STATIC_OVL -void +static void roguecorr(x, y, dir) int x, y, dir; { @@ -157,8 +155,7 @@ int x, y, dir; } /* Modified walkfrom() from mkmaze.c */ -STATIC_OVL -void +static void miniwalk(x, y) int x, y; { diff --git a/src/files.c b/src/files.c index 7e7adf333..81cd2fdc8 100644 --- a/src/files.c +++ b/src/files.c @@ -121,7 +121,7 @@ struct level_ftrack { #ifdef WIZARD #define WIZKIT_MAX 128 static char wizkit[WIZKIT_MAX]; -STATIC_DCL FILE *NDECL(fopen_wizkit_file); +static FILE *fopen_wizkit_file(); #endif #ifdef AMIGA @@ -133,7 +133,7 @@ static int lockptr; # endif #include -extern void FDECL(amii_set_text_font, ( char *, int )); +extern void amii_set_text_font( char *, int ); #endif #if defined(WIN32) || defined(MSDOS) @@ -157,29 +157,29 @@ extern char *sounddir; extern int n_dgns; /* from dungeon.c */ -STATIC_DCL char *FDECL(set_bonesfile_name, (char *, d_level*)); -STATIC_DCL char *NDECL(set_bonestemp_name); +static char *set_bonesfile_name(char *, d_level*); +static char *set_bonestemp_name(); #ifdef COMPRESS -STATIC_DCL void FDECL(redirect, (const char *, const char *, const char *, FILE *, BOOLEAN_P)); -STATIC_DCL void FDECL(docompress_file, (const char *, const char *, BOOLEAN_P)); +static void redirect(const char *, const char *, const char *, FILE *, BOOLEAN_P); +static void docompress_file(const char *, const char *, BOOLEAN_P); #endif #ifndef FILE_AREAS -STATIC_DCL char *FDECL(make_lockname, (const char *, char *)); +static char *make_lockname(const char *, char *); #endif static FILE *fopen_config_file(const char *, int); -STATIC_DCL int FDECL(get_uchars, (FILE *, char *, char *, uchar *, BOOLEAN_P, int, const char *)); +static int get_uchars(FILE *, char *, char *, uchar *, BOOLEAN_P, int, const char *); int parse_config_line(FILE *, char *, char *, char *, boolean , int ); #ifdef NOCWD_ASSUMPTIONS -STATIC_DCL void FDECL(adjust_prefix, (char *, int)); +static void adjust_prefix(char *, int); #endif #ifdef SELF_RECOVER -STATIC_DCL boolean FDECL(copy_bytes, (int, int)); +static boolean copy_bytes(int, int); #endif #ifdef HOLD_LOCKFILE_OPEN -STATIC_DCL int FDECL(open_levelfile_exclusively, (const char *, int, int)); +static int open_levelfile_exclusively(const char *, int, int); #endif #ifdef WHEREIS_FILE -STATIC_DCL void FDECL(write_whereis, (int)); +static void write_whereis(int); #endif /* @@ -587,7 +587,7 @@ clearlocks() } #ifdef HOLD_LOCKFILE_OPEN -STATIC_OVL int +static int open_levelfile_exclusively(name, lev, oflag) const char *name; int lev, oflag; @@ -754,7 +754,7 @@ delete_whereis() /* set up "file" to be file name for retrieving bones, and return a * bonesid to be read/written in the bones file. */ -STATIC_OVL char * +static char * set_bonesfile_name(file, lev) char *file; d_level *lev; @@ -789,7 +789,7 @@ d_level *lev; * (we are not reading or writing level files while writing bones files, so * the same array may be used instead of copying.) */ -STATIC_OVL char * +static char * set_bonestemp_name() { char *tf; @@ -1294,7 +1294,7 @@ char** saved; #ifdef COMPRESS -STATIC_OVL void +static void redirect(filearea, filename, mode, stream, uncomp) const char *filearea, *filename, *mode; FILE *stream; @@ -1318,7 +1318,7 @@ boolean uncomp; * * cf. child() in unixunix.c. */ -STATIC_OVL void +static void docompress_file(filearea, filename, uncomp) const char *filearea, *filename; boolean uncomp; @@ -1514,7 +1514,7 @@ struct flock sflock; /* for unlocking, same as above */ #ifndef FILE_AREAS -STATIC_OVL char * +static char * make_lockname(filename, lockname) const char *filename; char *lockname; @@ -1980,7 +1980,7 @@ fopen_config_file(const char *filename, int src) * NOTE: zeros are inserted unless modlist is TRUE, in which case the list * location is unchanged. Callers must handle zeros if modlist is FALSE. */ -STATIC_OVL int +static int get_uchars(fp, buf, bufp, list, modlist, size, name) FILE *fp; /* input file pointer */ char *buf; /* read buffer, must be of size BUFSZ */ @@ -2037,7 +2037,7 @@ const char *name; /* name of option for error message */ } #ifdef NOCWD_ASSUMPTIONS -STATIC_OVL void +static void adjust_prefix(bufp, prefixid) char *bufp; int prefixid; @@ -2555,7 +2555,7 @@ read_config_file(const char *filename, int src) } #ifdef WIZARD -STATIC_OVL FILE * +static FILE * fopen_wizkit_file() { FILE *fp; diff --git a/src/fountain.c b/src/fountain.c index 905155daa..f7abe6536 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -5,11 +5,11 @@ #include "hack.h" -STATIC_DCL void NDECL(dowatersnakes); -STATIC_DCL void NDECL(dowaterdemon); -STATIC_DCL void NDECL(dowaternymph); -STATIC_PTR void FDECL(gush, (int, int, genericptr_t)); -STATIC_DCL void NDECL(dofindgem); +static void dowatersnakes(); +static void dowaterdemon(); +static void dowaternymph(); +static void gush(int, int, genericptr_t); +static void dofindgem(); /* used when trying to dip in or drink from fountain or sink or pool while levitating above it, or when trying to move downwards in that state */ @@ -29,7 +29,7 @@ const char *what; } /* Fountain of snakes! */ -STATIC_OVL void +static void dowatersnakes() { register int num = rn1(5, 2); @@ -77,7 +77,7 @@ dowaterdemon() } /* Water Nymph */ -STATIC_OVL void +static void dowaternymph() { register struct monst *mtmp; @@ -115,7 +115,7 @@ int drinking; } } -STATIC_PTR void +static void gush(x, y, poolcnt) int x, y; genericptr_t poolcnt; @@ -149,7 +149,7 @@ genericptr_t poolcnt; } /* Find a gem in the sparkling waters. */ -STATIC_OVL void +static void dofindgem() { if (!Blind) You("spot a gem in the sparkling waters!"); diff --git a/src/hack.c b/src/hack.c index c4cc62261..b0d2a6a38 100644 --- a/src/hack.c +++ b/src/hack.c @@ -7,20 +7,20 @@ /* #define DEBUG */ /* uncomment for debugging */ -static void NDECL(maybe_wail); -static int NDECL(moverock); -static int FDECL(still_chewing, (XCHAR_P, XCHAR_P)); +static void maybe_wail(); +static int moverock(); +static int still_chewing(XCHAR_P, XCHAR_P); #ifdef SINKS -static void NDECL(dosinkfall); +static void dosinkfall(); #endif -static boolean FDECL(findtravelpath, (boolean (*)(int, int))); -static boolean FDECL(trapmove, (int, int, struct trap *)); -static struct monst *FDECL(monstinroom, (struct permonst *, int)); -static boolean FDECL(doorless_door, (int, int)); -static void FDECL(move_update, (BOOLEAN_P)); +static boolean findtravelpath(boolean (*)(int, int)); +static boolean trapmove(int, int, struct trap *); +static struct monst *monstinroom(struct permonst *, int); +static boolean doorless_door(int, int); +static void move_update(BOOLEAN_P); static void check_buried_zombies(xchar, xchar); static boolean domove_swap_with_pet(struct monst *, xchar, xchar); -static void FDECL(struggle_sub, (const char *)); +static void struggle_sub(const char *); static boolean check_interrupt(struct monst *mtmp); static boolean door_opened; /* set to true if door was opened during test_move */ @@ -3867,11 +3867,11 @@ const char *msg_override; nomovemsg = 0; u.usleep = 0; if (afternmv) { - int NDECL((*f)) = afternmv; + int (*f)(void) = afternmv; /* clear afternmv before calling it (to override the encumbrance hack for levitation--see weight_cap()) */ - afternmv = (int NDECL((*))) 0; + afternmv = (int (*)(void)) 0; (void) (*f)(); /* for finishing Armor/Boots/&c_on() */ update_inventory(); diff --git a/src/hacklib.c b/src/hacklib.c index 05891c714..2fec10eaa 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -13,8 +13,7 @@ # define Static static #endif -static boolean FDECL(pmatch_internal, (const char *, const char *, - BOOLEAN_P, const char *)); +static boolean pmatch_internal(const char *, const char *, BOOLEAN_P, const char *); /* is 'c' a digit? */ boolean @@ -817,9 +816,9 @@ boolean caseblind; */ #if defined(AMIGA) && !defined(AZTEC_C) && !defined(__SASC_60) && !defined(_DCC) && !defined(__GNUC__) -extern struct tm *FDECL(localtime, (time_t *)); +extern struct tm *localtime(time_t *); #endif -static struct tm *NDECL(getlt); +static struct tm *getlt(); static int get_int_from_dev_random() diff --git a/src/invent.c b/src/invent.c index 5e747b450..70f392762 100644 --- a/src/invent.c +++ b/src/invent.c @@ -7,25 +7,25 @@ #define CONTAINED_SYM '>' /* designator for inside a container */ #define HANDS_SYM '-' -STATIC_DCL void NDECL(reorder_invent); -static void FDECL(noarmor, (BOOLEAN_P)); -STATIC_DCL void FDECL(invdisp_nothing, (const char *, const char *)); -STATIC_DCL boolean FDECL(worn_wield_only, (struct obj *)); -STATIC_DCL boolean FDECL(only_here, (struct obj *)); -STATIC_DCL void FDECL(compactify, (char *)); -STATIC_DCL boolean FDECL(taking_off, (const char *)); -STATIC_DCL boolean FDECL(putting_on, (const char *)); -STATIC_PTR int FDECL(ckunpaid, (struct obj *)); -STATIC_PTR int FDECL(ckvalidcat, (struct obj *)); -static char FDECL(display_pickinv, (const char *, const char *, - const char *, BOOLEAN_P, long *, BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL boolean FDECL(this_type_only, (struct obj *)); -STATIC_DCL void NDECL(dounpaid); -STATIC_DCL struct obj *FDECL(find_unpaid, (struct obj *, struct obj **)); -STATIC_DCL void FDECL(menu_identify, (int)); -STATIC_DCL boolean FDECL(tool_in_use, (struct obj *)); -STATIC_DCL char FDECL(obj_to_let, (struct obj *)); -STATIC_DCL int FDECL(itemactions, (struct obj *)); +static void reorder_invent(); +static void noarmor(BOOLEAN_P); +static void invdisp_nothing(const char *, const char *); +static boolean worn_wield_only(struct obj *); +static boolean only_here(struct obj *); +static void compactify(char *); +static boolean taking_off(const char *); +static boolean putting_on(const char *); +static int ckunpaid(struct obj *); +static int ckvalidcat(struct obj *); +static char display_pickinv(const char *, const char *, + const char *, BOOLEAN_P, long *, BOOLEAN_P, BOOLEAN_P); +static boolean this_type_only(struct obj *); +static void dounpaid(); +static struct obj *find_unpaid(struct obj *, struct obj **); +static void menu_identify(int); +static boolean tool_in_use(struct obj *); +static char obj_to_let(struct obj *); +static int itemactions(struct obj *); static int lastinvnr = 51; /* 0 ... 51 (never saved&restored) */ @@ -92,7 +92,7 @@ register struct obj *otmp; #define inv_rank(o) ((o)->invlet ^ 040) /* sort the inventory; used by addinv() and doorganize() */ -STATIC_OVL void +static void reorder_invent() { struct obj *otmp, *prev, *next; @@ -811,7 +811,7 @@ register int x, y; } /* compact a string of inventory letters by dashing runs of letters */ -STATIC_OVL void +static void compactify(buf) register char *buf; { @@ -858,7 +858,7 @@ struct obj *obj; } /* match the prompt for either 'T' or 'R' command */ -STATIC_OVL boolean +static boolean taking_off(action) const char *action; { @@ -866,7 +866,7 @@ const char *action; } /* match the prompt for either 'W' or 'P' command */ -STATIC_OVL boolean +static boolean putting_on(action) const char *action; { @@ -1312,7 +1312,7 @@ struct obj *otmp; #endif } -STATIC_PTR int +static int ckvalidcat(otmp) register struct obj *otmp; { @@ -1320,7 +1320,7 @@ register struct obj *otmp; return((int)allow_category(otmp)); } -STATIC_PTR int +static int ckunpaid(otmp) register struct obj *otmp; { @@ -1341,13 +1341,13 @@ struct obj *otmp; } /* extra xprname() input that askchain() can't pass through safe_qbuf() */ -STATIC_VAR struct xprnctx { +static struct xprnctx { char let; boolean dot; } safeq_xprn_ctx; /* safe_qbuf() -> short_oname() callback */ -STATIC_PTR char * +static char * safeq_xprname(obj) struct obj *obj; { @@ -1355,7 +1355,7 @@ struct obj *obj; } /* alternate safe_qbuf() -> short_oname() callback */ -STATIC_PTR char * +static char * safeq_shortxprname(obj) struct obj *obj; { @@ -1371,12 +1371,12 @@ static NEARDATA const char removeables[] = int ggetobj(word, fn, mx, combo, resultflags) const char *word; -int FDECL((*fn), (OBJ_P)), mx; +int (*fn) (OBJ_P), mx; boolean combo; /* combination menu flag */ unsigned *resultflags; { - int FDECL((*ckfn), (OBJ_P)) = (int FDECL((*), (OBJ_P))) 0; - boolean FDECL((*filter), (OBJ_P)) = (boolean FDECL((*), (OBJ_P))) 0; + int (*ckfn) (OBJ_P) = (int (*) (OBJ_P)) 0; + boolean (*filter) (OBJ_P) = (boolean (*) (OBJ_P)) 0; boolean takeoff, ident, allflag, m_seen; int itemcount; int oletct, iletct, unpaid, oc_of_sym; @@ -1559,7 +1559,7 @@ askchain(objchn, olets, allflag, fn, ckfn, mx, word) struct obj **objchn; /* *objchn might change */ int allflag, mx; const char *olets, *word; /* olets is an Obj Class char array */ -int FDECL((*fn), (OBJ_P)), FDECL((*ckfn), (OBJ_P)); +int (*fn)(OBJ_P), (*ckfn)(OBJ_P); { struct obj *otmp, *otmp2, *otmpo; register char sym, ilet; @@ -1808,7 +1808,7 @@ struct obj *otmp; } /* menu of unidentified objects; select and identify up to id_limit of them */ -STATIC_OVL void +static void menu_identify(id_limit) int id_limit; { @@ -1929,7 +1929,7 @@ update_inventory() (*windowprocs.win_update_inventory)(); } -STATIC_OVL char +static char obj_to_let(obj) /* should of course only be called for things in invent */ register struct obj *obj; { @@ -2042,7 +2042,7 @@ struct obj *obj; { winid win; int n; - int NDECL((*feedback_fn)) = 0; + int (*feedback_fn)(void) = 0; anything any; menu_item *selected = 0; @@ -2340,8 +2340,12 @@ struct obj *obj; n = select_menu(win, PICK_ONE, &selected); destroy_nhwindow(win); - if (n == 1) feedback_fn = (int NDECL((*)))selected[0].item.a_void; - if (n == 1) free((genericptr_t) selected); + if (n == 1) { + feedback_fn = (int (*)(void))selected[0].item.a_void; + } + if (n == 1) { + free(selected); + } if (!feedback_fn) return 0; #if 0 @@ -2377,7 +2381,7 @@ struct obj *obj; * next unpaid object is returned. This routine recursively follows * containers. */ -STATIC_OVL struct obj * +static struct obj * find_unpaid(list, last_found) struct obj *list, **last_found; { @@ -2935,7 +2939,7 @@ int count_buc(list, type, filterfunc) struct obj *list; int type; -boolean FDECL((*filterfunc), (OBJ_P)); +boolean (*filterfunc)(OBJ_P); { int count = 0; @@ -3044,7 +3048,7 @@ boolean nested, /* include contents of any nested containers */ return count; } -STATIC_OVL void +static void dounpaid() { winid win; @@ -3135,7 +3139,7 @@ dounpaid() /* query objlist callback: return TRUE if obj type matches "this_type" */ static int this_type; -STATIC_OVL boolean +static boolean this_type_only(obj) struct obj *obj; { @@ -3210,7 +3214,7 @@ dotypeinv() types[0] = 0; class_count = collect_obj_classes(types, invent, FALSE, - (boolean FDECL((*), (OBJ_P))) 0, &itemcount); + (boolean (*)(OBJ_P)) 0, &itemcount); if (unpaid_count || billx || (bcnt + ccnt + ucnt + xcnt) != 0) { types[class_count++] = ' '; } @@ -3802,7 +3806,7 @@ dopramulet() return 0; } -STATIC_OVL boolean +static boolean tool_in_use(obj) struct obj *obj; { @@ -3880,7 +3884,7 @@ long numused; * Conversion from a class to a string for printing. * This must match the object class order. */ -STATIC_VAR NEARDATA const char *names[] = { 0, +static NEARDATA const char *names[] = { 0, "Illegal objects", "Weapons", "Armor", "Rings", "Amulets", "Tools", "Comestibles", "Potions", "Scrolls", "Spellbooks", "Wands", "Coins", "Gems", "Boulders/Statues", "Iron balls", @@ -4208,7 +4212,7 @@ doorganize() /* inventory organizer by Del Lamb */ } /* common to display_minventory and display_cinventory */ -STATIC_OVL void +static void invdisp_nothing(hdr, txt) const char *hdr, *txt; { @@ -4230,7 +4234,7 @@ const char *hdr, *txt; } /* query_objlist callback: return things that could possibly be worn/wielded */ -STATIC_OVL boolean +static boolean worn_wield_only(obj) struct obj *obj; { @@ -4337,7 +4341,7 @@ register struct obj *obj; /* query objlist callback: return TRUE if obj is at given location */ static coord only; -STATIC_OVL boolean +static boolean only_here(obj) struct obj *obj; { diff --git a/src/light.c b/src/light.c index 42ead2b47..760b5db26 100644 --- a/src/light.c +++ b/src/light.c @@ -44,8 +44,8 @@ static light_source *light_base = 0; -STATIC_DCL void FDECL(write_ls, (int, light_source *)); -STATIC_DCL int FDECL(maybe_write_ls, (int, int, BOOLEAN_P)); +static void write_ls(int, light_source *); +static int maybe_write_ls(int, int, BOOLEAN_P); /* imported from vision.c, for small circles */ extern char circle_data[]; @@ -443,7 +443,7 @@ boolean ghostly; * sources that would be written. If write_it is true, actually write * the light source out. */ -STATIC_OVL int +static int maybe_write_ls(fd, range, write_it) int fd, range; boolean write_it; @@ -510,7 +510,7 @@ light_sources_sanity_check() } /* Write a light source structure to disk. */ -STATIC_OVL void +static void write_ls(fd, ls) int fd; light_source *ls; diff --git a/src/lock.c b/src/lock.c index b13cd4403..6a72ab56d 100644 --- a/src/lock.c +++ b/src/lock.c @@ -4,7 +4,7 @@ #include "hack.h" /* at most one of `door' and `box' should be non-null at any given time */ -STATIC_VAR NEARDATA struct xlock_s { +static NEARDATA struct xlock_s { struct rm *door; struct obj *box; int picktyp; /* key|pick|card for unlock, sharp vs blunt for #force */ @@ -13,12 +13,12 @@ STATIC_VAR NEARDATA struct xlock_s { } xlock; /* occupation callbacks */ -static int NDECL(picklock); -static int NDECL(forcelock); +static int picklock(); +static int forcelock(); -STATIC_DCL const char *NDECL(lock_action); -static boolean FDECL(obstructed, (int, int, BOOLEAN_P)); -STATIC_DCL void FDECL(chest_shatter_msg, (struct obj *)); +static const char *lock_action(); +static boolean obstructed(int, int, BOOLEAN_P); +static void chest_shatter_msg(struct obj *); boolean picking_lock(x, y) @@ -42,7 +42,7 @@ int x, y; } /* produce an occupation string appropriate for the current activity */ -STATIC_OVL const char * +static const char * lock_action() { /* "unlocking"+2 == "locking" */ @@ -1138,7 +1138,7 @@ int x, y; return res; } -STATIC_OVL void +static void chest_shatter_msg(otmp) struct obj *otmp; { diff --git a/src/mail.c b/src/mail.c index 804aa2fac..6a43b36c8 100644 --- a/src/mail.c +++ b/src/mail.c @@ -34,10 +34,10 @@ * random intervals. */ -STATIC_DCL boolean FDECL(md_start, (coord *)); -STATIC_DCL boolean FDECL(md_stop, (coord *, coord *)); -STATIC_DCL boolean FDECL(md_rush, (struct monst *, int, int)); -STATIC_DCL void FDECL(newmail, (struct mail_info *)); +static boolean md_start(coord *); +static boolean md_stop(coord *, coord *); +static boolean md_rush(struct monst *, int, int); +static void newmail(struct mail_info *); int mailckfreq = 0; @@ -57,9 +57,9 @@ static int gethint = -1; # if !defined(SUNOS4) && !(defined(ULTRIX) && defined(__GNUC__)) /* DO trust all SVR4 to typedef uid_t in (probably to a long) */ # if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX) -extern struct passwd *FDECL(getpwuid, (uid_t)); +extern struct passwd *getpwuid(uid_t); # else -extern struct passwd *FDECL(getpwuid, (int)); +extern struct passwd *getpwuid(int); # endif # endif # endif @@ -135,7 +135,7 @@ getmailstatus() * Pick coordinates for a starting position for the mail daemon. Called * from newmail() and newphone(). */ -STATIC_OVL boolean +static boolean md_start(startp) coord *startp; { @@ -236,7 +236,7 @@ coord *startp; * enexto(). Use enexto() as a last resort because enexto() chooses * its point randomly, which is not what we want. */ -STATIC_OVL boolean +static boolean md_stop(stopp, startp) coord *stopp; /* stopping position (we fill it in) */ coord *startp; /* starting position (read only) */ @@ -280,7 +280,7 @@ static NEARDATA const char *mail_text[] = { * FALSE if the md gets stuck in a position where there is a monster. Return * TRUE otherwise. */ -STATIC_OVL boolean +static boolean md_rush(md, tx, ty) struct monst *md; register int tx, ty; /* destination of mail daemon */ @@ -381,7 +381,7 @@ register int tx, ty; /* destination of mail daemon */ /* Deliver a scroll of mail. */ /*ARGSUSED*/ -STATIC_OVL void +static void newmail(info) struct mail_info *info; { @@ -631,7 +631,7 @@ struct obj *otmp; # ifdef VMS -extern NDECL(struct mail_info *parse_next_broadcast); +extern struct mail_info *parse_next_broadcast(); volatile int broadcasts = 0; diff --git a/src/makemon.c b/src/makemon.c index 09d58c3e7..02fab5537 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -13,15 +13,15 @@ (mptr->mlet == S_HUMAN && Role_if(role_pm) && \ (mptr->msound == MS_LEADER || mptr->msound == MS_NEMESIS)) -STATIC_DCL boolean FDECL(uncommon, (int)); -STATIC_DCL int FDECL(align_shift, (struct permonst *)); -STATIC_DCL boolean FDECL(mk_gen_ok, (int, int, int)); -STATIC_DCL boolean FDECL(wrong_elem_type, (struct permonst *)); -static void FDECL(m_initgrp, (struct monst *, int, int, int, int)); -STATIC_DCL void FDECL(m_initthrow, (struct monst *, int, int)); -STATIC_DCL void FDECL(m_initweap, (struct monst *)); -STATIC_DCL void FDECL(m_inityour, (struct monst *, struct obj *)); -STATIC_DCL void FDECL(m_initinv, (struct monst *)); +static boolean uncommon(int); +static int align_shift(struct permonst *); +static boolean mk_gen_ok(int, int, int); +static boolean wrong_elem_type(struct permonst *); +static void m_initgrp(struct monst *, int, int, int, int); +static void m_initthrow(struct monst *, int, int); +static void m_initweap(struct monst *); +static void m_inityour(struct monst *, struct obj *); +static void m_initinv(struct monst *); extern const int monstr[]; @@ -47,7 +47,7 @@ register struct permonst *ptr; /* * Return true if the given monster cannot exist on this elemental level. */ -STATIC_OVL boolean +static boolean wrong_elem_type(ptr) struct permonst *ptr; { @@ -72,7 +72,7 @@ struct permonst *ptr; return FALSE; } /* make a group just like mtmp */ -STATIC_OVL void +static void m_initgrp(mtmp, x, y, n, mmflags) struct monst *mtmp; int x, y, n, mmflags; @@ -139,8 +139,7 @@ int x, y, n, mmflags; } } -STATIC_OVL -void +static void m_initthrow(mtmp, otyp, oquan) struct monst *mtmp; int otyp, oquan; @@ -154,7 +153,7 @@ int otyp, oquan; (void) mpickobj(mtmp, otmp); } -STATIC_OVL void +static void m_inityour(mtmp, obj) struct monst *mtmp; struct obj *obj; @@ -172,7 +171,7 @@ struct obj *obj; (void) mpickobj(mtmp, otmp); } -STATIC_OVL void +static void m_initweap(mtmp) register struct monst *mtmp; { @@ -606,7 +605,7 @@ long amount; add_to_minv(mtmp, gold); } -STATIC_OVL void +static void m_initinv(mtmp) register struct monst *mtmp; { @@ -1612,7 +1611,7 @@ struct permonst *mptr; /* usually null; used for confused reading */ return known; } -STATIC_OVL boolean +static boolean uncommon(mndx) int mndx; { @@ -1671,7 +1670,7 @@ prohibited_by_generation_flags(struct permonst *ptr) * comparing the dungeon alignment and monster alignment. * return an integer in the range of 0-5. */ -STATIC_OVL int +static int align_shift(ptr) register struct permonst *ptr; { @@ -1873,7 +1872,7 @@ int mndx; /* particular species that can no longer be created */ } /* decide whether it's ok to generate a candidate monster by mkclass() */ -STATIC_OVL boolean +static boolean mk_gen_ok(mndx, mvflagsmask, genomask) int mndx, mvflagsmask, genomask; { diff --git a/src/mcastu.c b/src/mcastu.c index 14105f963..94072581b 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -48,23 +48,22 @@ enum mcast_cleric_spells { #define NUM_PUN_SPELLS 10 -STATIC_DCL void FDECL(cursetxt, (struct monst *, BOOLEAN_P)); -STATIC_DCL int FDECL(choose_magic_spell, (int)); -STATIC_DCL int FDECL(choose_clerical_spell, (int)); -STATIC_DCL int FDECL(choose_punisher_spell, (void)); -STATIC_DCL void FDECL(cast_wizard_spell, (struct monst *, int, int)); -STATIC_DCL void FDECL(cast_cleric_spell, (struct monst *, int, int)); -STATIC_DCL void FDECL(cast_punisher_spell, (struct monst *, int, int)); -STATIC_DCL void FDECL(map_punisher_spell, (int, unsigned int*, int*)); -static int FDECL(m_cure_self, (struct monst *, int)); -STATIC_DCL boolean FDECL(is_undirected_spell, (unsigned int, int)); -STATIC_DCL boolean FDECL(spell_would_be_useless, (struct monst *, unsigned int, int)); +static void cursetxt(struct monst *, BOOLEAN_P); +static int choose_magic_spell(int); +static int choose_clerical_spell(int); +static int choose_punisher_spell(void); +static void cast_wizard_spell(struct monst *, int, int); +static void cast_cleric_spell(struct monst *, int, int); +static void cast_punisher_spell(struct monst *, int, int); +static void map_punisher_spell(int, unsigned int*, int*); +static int m_cure_self(struct monst *, int); +static boolean is_undirected_spell(unsigned int, int); +static boolean spell_would_be_useless(struct monst *, unsigned int, int); extern const char * const flash_types[]; /* from zap.c */ /* feedback when frustrated monster couldn't cast a spell */ -STATIC_OVL -void +static void cursetxt(mtmp, undirected) struct monst *mtmp; boolean undirected; @@ -97,7 +96,7 @@ boolean undirected; /* convert a level based random selection into a specific mage spell; inappropriate choices will be screened out by spell_would_be_useless() */ -STATIC_OVL int +static int choose_magic_spell(spellval) int spellval; { @@ -154,7 +153,7 @@ int spellval; } /* convert a level based random selection into a specific cleric spell */ -STATIC_OVL int +static int choose_clerical_spell(spellnum) int spellnum; { @@ -200,7 +199,7 @@ int spellnum; /* choose a Punisher statue spell. These statues are powerful enough * that I think adjusting based on level is not useful. */ -STATIC_OVL int +static int choose_punisher_spell(void) { int spell = rn2(NUM_PUN_SPELLS); @@ -415,8 +414,7 @@ int dmg; If you modify either of these, be sure to change is_undirected_spell() and spell_would_be_useless(). */ -STATIC_OVL -void +static void cast_wizard_spell(mtmp, dmg, spellnum) struct monst *mtmp; int dmg; @@ -586,8 +584,7 @@ int spellnum; if (dmg) mdamageu(mtmp, dmg); } -STATIC_OVL -void +static void cast_punisher_spell(mtmp, dmg, spellnum) struct monst* mtmp UNUSED; int dmg UNUSED; @@ -600,8 +597,7 @@ int spellnum; } } -STATIC_OVL -void +static void cast_cleric_spell(mtmp, dmg, spellnum) struct monst *mtmp; int dmg; @@ -813,8 +809,7 @@ int spellnum; if (dmg) mdamageu(mtmp, dmg); } -STATIC_DCL -void +static void map_punisher_spell(spellnum, padtyp, pspellnum) int spellnum; unsigned int* padtyp; @@ -863,8 +858,7 @@ int* pspellnum; } } -STATIC_DCL -boolean +static boolean is_undirected_spell(adtyp, spellnum) unsigned int adtyp; int spellnum; @@ -905,8 +899,7 @@ int spellnum; } /* Some spells are useless under some circumstances. */ -STATIC_DCL -boolean +static boolean spell_would_be_useless(mtmp, adtyp, spellnum) struct monst *mtmp; unsigned int adtyp; diff --git a/src/mhitm.c b/src/mhitm.c index 83831e4c9..8b760e0ff 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -13,18 +13,18 @@ static NEARDATA struct obj *otmp; static const char brief_feeling[] = "have a %s feeling for a moment, then it passes."; -STATIC_DCL int FDECL(hitmm, (struct monst *, struct monst *, struct attack *)); -STATIC_DCL int FDECL(gazemm, (struct monst *, struct monst *, struct attack *)); -STATIC_DCL int FDECL(gulpmm, (struct monst *, struct monst *, struct attack *)); -STATIC_DCL int FDECL(explmm, (struct monst *, struct monst *, struct attack *)); -STATIC_DCL int FDECL(mdamagem, (struct monst *, struct monst *, struct attack *)); +static int hitmm(struct monst *, struct monst *, struct attack *); +static int gazemm(struct monst *, struct monst *, struct attack *); +static int gulpmm(struct monst *, struct monst *, struct attack *); +static int explmm(struct monst *, struct monst *, struct attack *); +static int mdamagem(struct monst *, struct monst *, struct attack *); #ifdef WEBB_DISINT -STATIC_DCL int FDECL(defdisintagr, (struct monst *, struct monst *, struct attack *)); +static int defdisintagr(struct monst *, struct monst *, struct attack *); #endif -STATIC_DCL void FDECL(mswingsm, (struct monst *, struct monst *, struct obj *)); -STATIC_DCL void FDECL(noises, (struct monst *, struct attack *)); -STATIC_DCL void FDECL(missmm, (struct monst *, struct monst *, struct attack *)); -STATIC_DCL int FDECL(passivemm, (struct monst *, struct monst *, BOOLEAN_P, int)); +static void mswingsm(struct monst *, struct monst *, struct obj *); +static void noises(struct monst *, struct attack *); +static void missmm(struct monst *, struct monst *, struct attack *); +static int passivemm(struct monst *, struct monst *, BOOLEAN_P, int); /* Needed for the special case of monsters wielding vorpal blades (rare). * If we use this a lot it should probably be a parameter to mdamagem() @@ -32,7 +32,7 @@ STATIC_DCL int FDECL(passivemm, (struct monst *, struct monst *, BOOLEAN_P, int) */ static int dieroll; -STATIC_OVL void +static void noises(magr, mattk) register struct monst *magr; register struct attack *mattk; @@ -48,8 +48,7 @@ register struct attack *mattk; } } -STATIC_OVL -void +static void missmm(magr, mdef, mattk) register struct monst *magr, *mdef; struct attack *mattk; @@ -576,7 +575,7 @@ register struct monst *magr, *mdef; } /* Returns the result of mdamagem(). */ -STATIC_OVL int +static int hitmm(magr, mdef, mattk) register struct monst *magr, *mdef; struct attack *mattk; @@ -697,7 +696,7 @@ struct attack *mattk; } /* Returns the same values as mdamagem(). */ -STATIC_OVL int +static int gazemm(magr, mdef, mattk) register struct monst *magr, *mdef; struct attack *mattk; @@ -797,7 +796,7 @@ struct monst *magr, *mdef; } /* Returns the same values as mattackm(). */ -STATIC_OVL int +static int gulpmm(magr, mdef, mattk) register struct monst *magr, *mdef; register struct attack *mattk; @@ -894,7 +893,7 @@ register struct attack *mattk; return status; } -STATIC_OVL int +static int explmm(magr, mdef, mattk) struct monst *magr, *mdef; struct attack *mattk; @@ -935,7 +934,7 @@ struct attack *mattk; } #ifdef WEBB_DISINT -STATIC_OVL int +static int defdisintagr(magr, mdef, mattk) register struct monst *magr, *mdef; register struct attack *mattk; @@ -1068,7 +1067,7 @@ register struct attack *mattk; /* * See comment at top of mattackm(), for return values. */ -STATIC_OVL int +static int mdamagem(magr, mdef, mattk) register struct monst *magr, *mdef; register struct attack *mattk; @@ -1975,7 +1974,7 @@ struct obj *obj; } } -STATIC_OVL void +static void mswingsm(magr, mdef, otemp) struct monst *magr, *mdef; struct obj *otemp; @@ -1992,7 +1991,7 @@ struct obj *otemp; * Passive responses by defenders. Does not replicate responses already * handled above. Returns same values as mattackm. */ -STATIC_OVL int +static int passivemm(magr, mdef, mhit, mdead) register struct monst *magr, *mdef; boolean mhit; diff --git a/src/mhitu.c b/src/mhitu.c index 630221acf..21a9072bb 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -6,32 +6,32 @@ static struct obj *mon_currwep = (struct obj *) 0; -STATIC_DCL void FDECL(urustm, (struct monst *, struct obj *)); -STATIC_DCL boolean FDECL(u_slip_free, (struct monst *, struct attack *)); -STATIC_DCL int FDECL(passiveum, (struct permonst *, struct monst *, struct attack *)); +static void urustm(struct monst *, struct obj *); +static boolean u_slip_free(struct monst *, struct attack *); +static int passiveum(struct permonst *, struct monst *, struct attack *); # ifdef SEDUCE -static void FDECL(mayberem, (struct monst *, const char *, struct obj *, const char *)); +static void mayberem(struct monst *, const char *, struct obj *, const char *); # endif -STATIC_DCL boolean FDECL(diseasemu, (struct permonst *)); -STATIC_DCL int FDECL(hitmu, (struct monst *, struct attack *)); -STATIC_DCL int FDECL(gulpmu, (struct monst *, struct attack *)); -STATIC_DCL int FDECL(explmu, (struct monst *, struct attack *, BOOLEAN_P)); -STATIC_DCL void FDECL(missmu, (struct monst *, BOOLEAN_P, struct attack *)); -STATIC_DCL void FDECL(mswings, (struct monst *, struct obj *)); -STATIC_DCL void FDECL(wildmiss, (struct monst *, struct attack *)); -STATIC_DCL int FDECL(mon_scream, (struct monst*, struct attack*)); +static boolean diseasemu(struct permonst *); +static int hitmu(struct monst *, struct attack *); +static int gulpmu(struct monst *, struct attack *); +static int explmu(struct monst *, struct attack *, BOOLEAN_P); +static void missmu(struct monst *, BOOLEAN_P, struct attack *); +static void mswings(struct monst *, struct obj *); +static void wildmiss(struct monst *, struct attack *); +static int mon_scream(struct monst*, struct attack*); -STATIC_DCL void FDECL(hitmsg, (struct monst *, struct attack *)); +static void hitmsg(struct monst *, struct attack *); -STATIC_DCL void FDECL(invulnerability_messages, (struct monst *, BOOLEAN_P, BOOLEAN_P)); +static void invulnerability_messages(struct monst *, BOOLEAN_P, BOOLEAN_P); /* See comment in mhitm.c. If we use this a lot it probably should be */ /* changed to a parameter to mhitu. */ static int dieroll; -STATIC_OVL void +static void hitmsg(mtmp, mattk) struct monst *mtmp; struct attack *mattk; @@ -84,7 +84,7 @@ struct attack *mattk; } /* monster missed you */ -STATIC_OVL void +static void missmu(mtmp, nearmiss, mattk) struct monst *mtmp; boolean nearmiss; @@ -104,7 +104,7 @@ struct attack *mattk; stop_occupation(); } -STATIC_OVL void +static void mswings(mtmp, otemp) /* monster swings obj */ register struct monst *mtmp; register struct obj *otemp; @@ -146,7 +146,7 @@ u_slow_down() exercise(A_DEX, FALSE); } -STATIC_OVL void +static void wildmiss(mtmp, mattk) /* monster attacked your displaced image */ register struct monst *mtmp; register struct attack *mattk; @@ -837,7 +837,7 @@ register struct monst *mtmp; return(0); } -STATIC_OVL boolean +static boolean diseasemu(mdat) struct permonst *mdat; { @@ -852,7 +852,7 @@ struct permonst *mdat; } /* check whether slippery clothing protects from hug or wrap attack */ -STATIC_OVL boolean +static boolean u_slip_free(mtmp, mattk) struct monst *mtmp; struct attack *mattk; @@ -933,7 +933,7 @@ struct monst *mon; * 3 if the monster lives but teleported/paralyzed, so it can't keep * attacking you */ -STATIC_OVL int +static int hitmu(mtmp, mattk) register struct monst *mtmp; register struct attack *mattk; @@ -1960,7 +1960,7 @@ gulp_blnd_check() } /* monster swallows you, or damage if u.uswallow */ -STATIC_OVL int +static int gulpmu(mtmp, mattk) struct monst *mtmp; struct attack *mattk; @@ -2256,7 +2256,7 @@ struct attack *mattk; } /* monster explodes in your face */ -STATIC_OVL int +static int explmu(mtmp, mattk, ufound) struct monst *mtmp; struct attack *mattk; @@ -3073,7 +3073,7 @@ int* pdmg; } #ifdef SEDUCE -STATIC_OVL void +static void mayberem(mon, seducer, obj, str) struct monst *mon; const char *seducer; /* only used for alternate message */ @@ -3115,7 +3115,7 @@ const char *str; } #endif /* SEDUCE */ -STATIC_OVL int +static int mon_scream(mtmp, mattk) struct monst* mtmp; struct attack* mattk; @@ -3165,7 +3165,7 @@ struct attack* mattk; * to know whether hero reverted in order to decide whether passive * damage applies. */ -STATIC_OVL int +static int passiveum(olduasmon, mtmp, mattk) struct permonst *olduasmon; struct monst *mtmp; @@ -3358,7 +3358,7 @@ struct attack *mattk; return 1; } -STATIC_OVL void +static void invulnerability_messages(mtmp, range2, youseeit) struct monst *mtmp; boolean range2; diff --git a/src/mklev.c b/src/mklev.c index 78b1878c3..71902a70e 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -19,33 +19,33 @@ /* conversion of result to int is reasonable */ -STATIC_DCL void FDECL(mkfount, (int, struct mkroom *)); +static void mkfount(int, struct mkroom *); #ifdef SINKS -STATIC_DCL void FDECL(mksink, (struct mkroom *)); +static void mksink(struct mkroom *); #endif -STATIC_DCL void FDECL(mkaltar, (struct mkroom *)); -STATIC_DCL void FDECL(mkgrave, (struct mkroom *)); -STATIC_DCL void NDECL(makevtele); -STATIC_DCL void NDECL(clear_level_structures); -STATIC_DCL void NDECL(makelevel); -STATIC_DCL struct mkroom *FDECL(find_branch_room, (coord *)); -STATIC_DCL struct mkroom *FDECL(pos_to_room, (XCHAR_P, XCHAR_P)); -STATIC_DCL boolean FDECL(place_niche, (struct mkroom *, int*, int*, int*)); -STATIC_DCL void FDECL(makeniche, (int)); -STATIC_DCL void NDECL(make_niches); - -STATIC_PTR int FDECL( CFDECLSPEC do_comp, (const genericptr, const genericptr)); - -STATIC_DCL void FDECL(dosdoor, (XCHAR_P, XCHAR_P, struct mkroom *, int)); -STATIC_DCL void FDECL(join, (int, int, BOOLEAN_P)); -STATIC_DCL void FDECL(do_room_or_subroom, (struct mkroom *, int, int, int, int, - BOOLEAN_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL void NDECL(makerooms); -STATIC_DCL void FDECL(finddpos, (coord *, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); -STATIC_DCL void FDECL(mkinvpos, (XCHAR_P, XCHAR_P, int)); -STATIC_DCL void FDECL(mk_knox_portal, (XCHAR_P, XCHAR_P)); - -STATIC_DCL void NDECL(place_random_engravings); +static void mkaltar(struct mkroom *); +static void mkgrave(struct mkroom *); +static void makevtele(); +static void clear_level_structures(); +static void makelevel(); +static struct mkroom *find_branch_room(coord *); +static struct mkroom *pos_to_room(XCHAR_P, XCHAR_P); +static boolean place_niche(struct mkroom *, int*, int*, int*); +static void makeniche(int); +static void make_niches(); + +static int CFDECLSPEC do_comp(const genericptr, const genericptr); + +static void dosdoor(XCHAR_P, XCHAR_P, struct mkroom *, int); +static void join(int, int, BOOLEAN_P); +static void do_room_or_subroom(struct mkroom *, int, int, int, int, + BOOLEAN_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P); +static void makerooms(); +static void finddpos(coord *, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); +static void mkinvpos(XCHAR_P, XCHAR_P, int); +static void mk_knox_portal(XCHAR_P, XCHAR_P); + +static void place_random_engravings(); #define create_vault() create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE) #define init_vault() vault_x = -1 @@ -56,7 +56,7 @@ static boolean made_branch; /* used only during level creation */ /* Args must be (const genericptr) so that qsort will always be happy. */ -STATIC_PTR int CFDECLSPEC +static int CFDECLSPEC do_comp(vx, vy) const genericptr vx; const genericptr vy; @@ -77,7 +77,7 @@ const genericptr vy; #endif /* LINT */ } -STATIC_OVL void +static void finddpos(cc, xl, yl, xh, yh) coord *cc; xchar xl, yl, xh, yh; @@ -115,7 +115,7 @@ sort_rooms() #endif } -STATIC_OVL void +static void do_room_or_subroom(croom, lowx, lowy, hix, hiy, lit, rtype, special, is_room) register struct mkroom *croom; int lowx, lowy; @@ -289,7 +289,7 @@ rndvault_getname() return NULL; } -STATIC_OVL void +static void makerooms() { boolean tried_vault = FALSE; @@ -324,7 +324,7 @@ makerooms() return; } -STATIC_OVL void +static void join(a, b, nxcor) register int a, b; boolean nxcor; @@ -499,7 +499,7 @@ register struct mkroom *aroom; for( ; broom->hx >= 0; broom++) broom->fdoor++; } -STATIC_OVL void +static void dosdoor(x, y, aroom, type) register xchar x, y; register struct mkroom *aroom; @@ -557,7 +557,7 @@ register int type; add_door(x, y, aroom); } -STATIC_OVL boolean +static boolean place_niche(aroom, dy, xx, yy) register struct mkroom *aroom; int *dy, *xx, *yy; @@ -616,7 +616,7 @@ static const char * const hhgtg_engravings[] = { "We apologize for the inconvenience", }; -STATIC_OVL void +static void makeniche(trap_type) int trap_type; { @@ -709,7 +709,7 @@ int chance; } -STATIC_OVL void +static void make_niches() { register int ct = rnd((nroom>>1) + 1), dep = depth(&u.uz); @@ -728,7 +728,7 @@ make_niches() } } -STATIC_OVL void +static void makevtele() { makeniche(TELEP_TRAP); @@ -739,7 +739,7 @@ makevtele() * special) but it's easier to put it all in one place than make sure * each type initializes what it needs to separately. */ -STATIC_OVL void +static void clear_level_structures() { static struct rm zerorm = { cmap_to_glyph(S_stone), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -815,7 +815,7 @@ mk_knox_vault(int x, int y, int w, int h) mk_knox_portal(x+w, y+h); } -STATIC_OVL void +static void makelevel() { register struct mkroom *croom, *troom; @@ -1393,7 +1393,7 @@ register struct mkroom *croom; } /* Find an unused room for a branch location. */ -STATIC_OVL struct mkroom * +static struct mkroom * find_branch_room(mp) coord *mp; { @@ -1424,7 +1424,7 @@ coord *mp; } /* Find the room for (x,y). Return null if not in a room. */ -STATIC_OVL struct mkroom * +static struct mkroom * pos_to_room(x, y) xchar x, y; { @@ -1720,8 +1720,7 @@ struct mkroom *croom; levl[x][y].ladder = up ? LA_UP : LA_DOWN; } -STATIC_OVL -void +static void mkfount(mazeflag, croom) register int mazeflag; register struct mkroom *croom; @@ -1742,7 +1741,7 @@ register struct mkroom *croom; } #ifdef SINKS -STATIC_OVL void +static void mksink(croom) register struct mkroom *croom; { @@ -1759,7 +1758,7 @@ register struct mkroom *croom; #endif /* SINKS */ -STATIC_OVL void +static void mkaltar(croom) register struct mkroom *croom; { @@ -1885,7 +1884,7 @@ mkinvokearea() /* Change level topology. Boulders in the vicinity are eliminated. * Temporarily overrides vision in the name of a nice effect. */ -STATIC_OVL void +static void mkinvpos(x, y, dist) xchar x, y; int dist; @@ -1991,7 +1990,7 @@ get_floating_branch(d_level *target, branch *br) * * Ludios will remain isolated until the branch is corrected by this function. */ -STATIC_OVL void +static void mk_knox_portal(x, y) xchar x, y; { diff --git a/src/mkmap.c b/src/mkmap.c index 7c4644be7..919701658 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -8,24 +8,24 @@ #define HEIGHT (ROWNO - 1) #define WIDTH (COLNO - 2) -STATIC_DCL void FDECL(init_map, (SCHAR_P)); -STATIC_DCL void FDECL(init_fill, (SCHAR_P, SCHAR_P)); -STATIC_DCL schar FDECL(get_map, (int, int, SCHAR_P)); -STATIC_DCL void FDECL(pass_one, (SCHAR_P, SCHAR_P)); -STATIC_DCL void FDECL(pass_two, (SCHAR_P, SCHAR_P)); -STATIC_DCL void FDECL(pass_three, (SCHAR_P, SCHAR_P)); -STATIC_DCL void NDECL(wallify_map); -STATIC_DCL void FDECL(join_map, (SCHAR_P, SCHAR_P)); -STATIC_DCL void FDECL(finish_map, (SCHAR_P, SCHAR_P, XCHAR_P, XCHAR_P)); -STATIC_DCL void FDECL(remove_room, (unsigned)); -STATIC_DCL void FDECL(backfill, (SCHAR_P, SCHAR_P)); -void FDECL(mkmap, (lev_init *)); +static void init_map(SCHAR_P); +static void init_fill(SCHAR_P, SCHAR_P); +static schar get_map(int, int, SCHAR_P); +static void pass_one(SCHAR_P, SCHAR_P); +static void pass_two(SCHAR_P, SCHAR_P); +static void pass_three(SCHAR_P, SCHAR_P); +static void wallify_map(); +static void join_map(SCHAR_P, SCHAR_P); +static void finish_map(SCHAR_P, SCHAR_P, XCHAR_P, XCHAR_P); +static void remove_room(unsigned); +static void backfill(SCHAR_P, SCHAR_P); +void mkmap(lev_init *); char *new_locations; int min_rx, max_rx, min_ry, max_ry; /* rectangle bounds for regions */ static int n_loc_filled; -STATIC_OVL void +static void init_map(bg_typ) schar bg_typ; { @@ -41,7 +41,7 @@ schar bg_typ; } -STATIC_OVL void +static void backfill(bg_typ, filler) schar bg_typ, filler; { @@ -63,7 +63,7 @@ schar bg_typ, filler; } -STATIC_OVL void +static void init_fill(bg_typ, fg_typ) schar bg_typ, fg_typ; { @@ -84,7 +84,7 @@ schar bg_typ, fg_typ; } } -STATIC_OVL schar +static schar get_map(col, row, bg_typ) int col, row; schar bg_typ; @@ -100,7 +100,7 @@ static int dirs[16] = { 1, -1 /**/, 1, 0 /**/, 1, 1 }; -STATIC_OVL void +static void pass_one(bg_typ, fg_typ) schar bg_typ, fg_typ; { @@ -136,7 +136,7 @@ schar bg_typ, fg_typ; #define new_loc(i, j) *(new_locations+ ((j)*(WIDTH+1)) + (i)) -STATIC_OVL void +static void pass_two(bg_typ, fg_typ) schar bg_typ, fg_typ; { @@ -161,7 +161,7 @@ schar bg_typ, fg_typ; levl[i][j].typ = new_loc(i, j); } -STATIC_OVL void +static void pass_three(bg_typ, fg_typ) schar bg_typ, fg_typ; { @@ -291,7 +291,7 @@ boolean anyroom; * If we have drawn a map without walls, this allows us to * auto-magically wallify it. Taken from lev_main.c. */ -STATIC_OVL void +static void wallify_map() { @@ -309,7 +309,7 @@ wallify_map() } } -STATIC_OVL void +static void join_map(bg_typ, fg_typ) schar bg_typ, fg_typ; { @@ -380,7 +380,7 @@ schar bg_typ, fg_typ; } } -STATIC_OVL void +static void finish_map(fg_typ, bg_typ, lit, walled) schar fg_typ, bg_typ; boolean lit, walled; @@ -446,7 +446,7 @@ int lx, ly, hx, hy; * level structure contents corresponding to roomno have already been reset. * Currently handles only the removal of rooms that have no subrooms. */ -STATIC_OVL void +static void remove_room(roomno) unsigned roomno; { diff --git a/src/mkmaze.c b/src/mkmaze.c index 4910a978f..5cc93b77d 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -12,22 +12,22 @@ extern int num_lregions; static lev_region bughack = { { COLNO, ROWNO, 0, 0 }, { COLNO, ROWNO, 0, 0 }, 0, 0, 0, 0, { 0 } }; extern char SpLev_Map[COLNO][ROWNO]; -static int FDECL(iswall, (int, int)); -static int FDECL(iswall_or_stone, (int, int)); -STATIC_DCL boolean FDECL(is_solid, (int, int)); -STATIC_DCL int FDECL(extend_spine, (int [3][3], int, int, int)); -STATIC_DCL boolean FDECL(okay, (int, int, int)); -STATIC_DCL void FDECL(maze0xy, (coord *)); -STATIC_DCL boolean FDECL(put_lregion_here, (XCHAR_P, XCHAR_P, XCHAR_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, BOOLEAN_P, d_level *, XCHAR_P)); -STATIC_DCL void FDECL(move, (int *, int *, int)); -STATIC_DCL void NDECL(setup_waterlevel); -STATIC_DCL void NDECL(unsetup_waterlevel); - -static void FDECL(check_ransacked, (char *)); -static void FDECL(migr_booty_item, (int, const char *)); -static void FDECL(migrate_orc, (struct monst *, unsigned long)); -static void NDECL(stolen_booty); +static int iswall(int, int); +static int iswall_or_stone(int, int); +static boolean is_solid(int, int); +static int extend_spine(int [3][3], int, int, int); +static boolean okay(int, int, int); +static void maze0xy(coord *); +static boolean put_lregion_here(XCHAR_P, XCHAR_P, XCHAR_P, + XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, BOOLEAN_P, d_level *, XCHAR_P); +static void move(int *, int *, int); +static void setup_waterlevel(); +static void unsetup_waterlevel(); + +static void check_ransacked(char *); +static void migr_booty_item(int, const char *); +static void migrate_orc(struct monst *, unsigned long); +static void stolen_booty(); /* adjust a coordinate one step in the specified direction */ #define mz_move(X, Y, dir) \ @@ -68,7 +68,7 @@ int x, y; } /* return TRUE if out of bounds, wall or rock */ -STATIC_OVL boolean +static boolean is_solid(x, y) int x, y; { @@ -93,7 +93,7 @@ int x, y; * W x W This would extend a spine from x down. * . W W */ -STATIC_OVL int +static int extend_spine(locale, wall_there, dx, dy) int locale[3][3]; int wall_there, dx, dy; @@ -223,7 +223,7 @@ int x1, y1, x2, y2; } } -STATIC_OVL boolean +static boolean okay(x, y, dir) int x, y; int dir; @@ -237,7 +237,7 @@ int dir; } /* find random starting point for maze generation */ -STATIC_OVL void +static void maze0xy(cc) coord *cc; { @@ -320,7 +320,7 @@ d_level *lev; return FALSE; } -STATIC_OVL boolean +static boolean put_lregion_here(x, y, nlx, nly, nhx, nhy, rtype, oneshot, lev, lax) xchar x, y; xchar nlx, nly, nhx, nhy; @@ -1440,7 +1440,7 @@ schar typ; } #endif /* MICRO */ -STATIC_OVL void +static void move(x, y, dir) register int *x, *y; register int dir; @@ -1668,9 +1668,9 @@ static int xmin, ymin, xmax, ymax; /* level boundaries */ #define bxmax (xmax - 1) #define bymax (ymax - 1) -STATIC_DCL void NDECL(set_wportal); -STATIC_DCL void FDECL(mk_bubble, (int, int, int)); -STATIC_DCL void FDECL(mv_bubble, (struct bubble *, int, int, BOOLEAN_P)); +static void set_wportal(); +static void mk_bubble(int, int, int); +static void mv_bubble(struct bubble *, int, int, BOOLEAN_P); void movebubbles() @@ -1920,7 +1920,7 @@ xchar x, y; return hliquid("water"); } -STATIC_OVL void +static void set_wportal() { /* there better be only one magic portal on water level... */ @@ -1929,7 +1929,7 @@ set_wportal() impossible("set_wportal(): no portal!"); } -STATIC_OVL void +static void setup_waterlevel() { int x, y; @@ -1962,7 +1962,7 @@ setup_waterlevel() mk_bubble(x, y, rn2(7)); } -STATIC_OVL void +static void unsetup_waterlevel() { struct bubble *b, *bb; @@ -1975,7 +1975,7 @@ unsetup_waterlevel() bbubbles = ebubbles = (struct bubble *)0; } -STATIC_OVL void +static void mk_bubble(x, y, n) int x, y, n; { @@ -2036,7 +2036,7 @@ int x, y, n; * in the immediate neighborhood of one, he/she may get sucked inside. * This property also makes leaving a bubble slightly difficult. */ -STATIC_OVL void +static void mv_bubble(b, dx, dy, ini) struct bubble *b; int dx, dy; diff --git a/src/mkobj.c b/src/mkobj.c index e874bed90..8cbcde81c 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -3,22 +3,21 @@ #include "hack.h" -STATIC_DCL void FDECL(mkbox_cnts, (struct obj *)); -STATIC_DCL unsigned FDECL(nextoid, (struct obj *, struct obj *)); -STATIC_DCL void FDECL(maybe_adjust_light, (struct obj *, int)); -STATIC_DCL void FDECL(obj_timer_checks, (struct obj *, XCHAR_P, XCHAR_P, int)); -STATIC_DCL void FDECL(container_weight, (struct obj *)); -STATIC_DCL struct obj *FDECL(save_mtraits, (struct obj *, struct monst *)); -STATIC_DCL void FDECL(objlist_sanity, (struct obj *, int, const char *)); -STATIC_DCL void FDECL(mon_obj_sanity, (struct monst *, const char *)); +static void mkbox_cnts(struct obj *); +static unsigned nextoid(struct obj *, struct obj *); +static void maybe_adjust_light(struct obj *, int); +static void obj_timer_checks(struct obj *, XCHAR_P, XCHAR_P, int); +static void container_weight(struct obj *); +static struct obj *save_mtraits(struct obj *, struct monst *); +static void objlist_sanity(struct obj *, int, const char *); +static void mon_obj_sanity(struct monst *, const char *); #ifdef WIZARD -STATIC_DCL const char *FDECL(where_name, (struct obj *)); -STATIC_DCL void FDECL(check_contained, (struct obj *, const char *)); +static const char *where_name(struct obj *); +static void check_contained(struct obj *, const char *); #endif -STATIC_DCL void FDECL(insane_object, (struct obj *, const char *, - const char *, struct monst *)); -STATIC_DCL void FDECL(check_contained, (struct obj *, const char *)); -STATIC_DCL void FDECL(sanity_check_worn, (struct obj *)); +static void insane_object(struct obj *, const char *, const char *, struct monst *); +static void check_contained(struct obj *, const char *); +static void sanity_check_worn(struct obj *); extern struct obj *thrownobj; /* defined in dothrow.c */ @@ -287,7 +286,7 @@ boolean artif; return(mksobj(i, TRUE, artif)); } -STATIC_OVL void +static void mkbox_cnts(box) struct obj *box; { @@ -494,7 +493,7 @@ long num; /* when splitting a stack that has o_id-based shop prices, pick an o_id value for the new stack that will maintain the same price */ -STATIC_OVL unsigned +static unsigned nextoid(oldobj, newobj) struct obj *oldobj, *newobj; { @@ -1291,7 +1290,7 @@ struct obj *body; (void) start_timer(when, TIMER_OBJECT, action, obj_to_any(body)); } -STATIC_OVL void +static void maybe_adjust_light(obj, old_range) struct obj *obj; int old_range; @@ -1941,7 +1940,7 @@ struct obj *otmp; return retval; } -STATIC_OVL void +static void obj_timer_checks(otmp, x, y, force) struct obj *otmp; xchar x, y; @@ -2240,7 +2239,7 @@ struct obj *obj; } /* Recalculate the weight of this container and all of _its_ containers. */ -STATIC_OVL void +static void container_weight(container) struct obj *container; { @@ -2453,7 +2452,7 @@ obj_sanity_check() } /* sanity check for objects on specified list (fobj, &c) */ -STATIC_OVL void +static void objlist_sanity(objlist, wheretype, mesg) struct obj *objlist; int wheretype; @@ -2504,7 +2503,7 @@ const char *mesg; } /* sanity check for objects carried by all monsters in specified list */ -STATIC_OVL void +static void mon_obj_sanity(monlist, mesg) struct monst *monlist; const char *mesg; @@ -2543,7 +2542,7 @@ static const char *obj_state_names[NOBJ_STATES] = { "minvent", "migrating", "buried", "onbill" }; -STATIC_OVL const char * +static const char * where_name(obj) struct obj *obj; { @@ -2562,7 +2561,7 @@ struct obj *obj; return obj_state_names[where]; } -STATIC_OVL void +static void insane_object(obj, fmt, mesg, mon) struct obj *obj; const char *fmt, *mesg; @@ -2620,7 +2619,7 @@ long oquan; } /* obj sanity check: check objects inside container */ -STATIC_OVL void +static void check_contained(container, mesg) struct obj *container; const char *mesg; @@ -2670,7 +2669,7 @@ const char *mesg; } /* check an object in hero's or monster's inventory which has worn mask set */ -STATIC_OVL void +static void sanity_check_worn(obj) struct obj *obj; { diff --git a/src/mkroom.c b/src/mkroom.c index 7c3f900cb..033eb922b 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -15,23 +15,23 @@ #include "hack.h" -STATIC_DCL boolean FDECL(isbig, (struct mkroom *)); -STATIC_DCL void NDECL(mkshop), FDECL(mkzoo, (int)), NDECL(mkswamp); -STATIC_DCL void NDECL(mktemple); -STATIC_DCL void FDECL(mkgarden, (struct mkroom *)); -STATIC_DCL coord * FDECL(shrine_pos, (int)); -STATIC_DCL struct permonst * NDECL(morguemon); -STATIC_DCL struct permonst * NDECL(antholemon); -STATIC_DCL struct permonst * NDECL(squadmon); -STATIC_DCL struct permonst * NDECL(armorymon); -STATIC_DCL void FDECL(save_room, (int, struct mkroom *)); -STATIC_DCL void FDECL(rest_room, (int, struct mkroom *)); +static boolean isbig(struct mkroom *); +static void mkshop(void), mkzoo(int), mkswamp(void); +static void mktemple(); +static void mkgarden(struct mkroom *); +static coord * shrine_pos(int); +static struct permonst * morguemon(); +static struct permonst * antholemon(); +static struct permonst * squadmon(); +static struct permonst * armorymon(); +static void save_room(int, struct mkroom *); +static void rest_room(int, struct mkroom *); #define sq(x) ((x)*(x)) extern const struct shclass shtypes[]; /* defined in shknam.c */ -STATIC_OVL boolean +static boolean isbig(sroom) register struct mkroom *sroom; { @@ -67,7 +67,7 @@ int roomtype; } } -STATIC_OVL void +static void mkshop() { register struct mkroom *sroom; @@ -237,7 +237,7 @@ boolean strict; return (struct mkroom *)0; } -STATIC_OVL void +static void mkzoo(type) int type; { @@ -516,7 +516,7 @@ int mm_flags; level.flags.graveyard = TRUE; /* reduced chance for undead corpse */ } -STATIC_OVL struct permonst * +static struct permonst * morguemon() { register int i = rn2(100), hd = rn2(level_difficulty()); @@ -541,7 +541,7 @@ morguemon() (i < 40) ? &mons[PM_WRAITH] : mkclass(S_ZOMBIE, 0)); } -STATIC_OVL struct permonst * +static struct permonst * antholemon() { int mtyp; @@ -566,7 +566,7 @@ armorymon() /** Create a special room with trees, fountains and nymphs. * @author Pasi Kallinen */ -STATIC_OVL void +static void mkgarden(croom) struct mkroom *croom; /* NULL == choose random room */ { @@ -613,7 +613,7 @@ struct mkroom *croom; /* NULL == choose random room */ } } -STATIC_OVL void +static void mkswamp() /* Michiel Huisjes & Fred de Wilde */ { register struct mkroom *sroom; @@ -655,7 +655,7 @@ mkswamp() /* Michiel Huisjes & Fred de Wilde */ } } -STATIC_OVL coord * +static coord * shrine_pos(roomno) int roomno; { @@ -679,7 +679,7 @@ int roomno; return &buf; } -STATIC_OVL void +static void mktemple() { register struct mkroom *sroom; @@ -886,7 +886,7 @@ static struct { {PM_SOLDIER, 80}, {PM_SERGEANT, 15}, {PM_LIEUTENANT, 4}, {PM_CAPTAIN, 1} }; -STATIC_OVL struct permonst * +static struct permonst * squadmon() /* return soldier types. */ { int sel_prob, i, cpro, mndx; @@ -912,7 +912,7 @@ squadmon() /* return soldier types. */ * (if any). */ -STATIC_OVL void +static void save_room(fd, r) int fd; struct mkroom *r; @@ -944,7 +944,7 @@ int fd; save_room(fd, &rooms[i]); } -STATIC_OVL void +static void rest_room(fd, r) int fd; struct mkroom *r; diff --git a/src/mon.c b/src/mon.c index 69f79faa9..94b87f2f0 100644 --- a/src/mon.c +++ b/src/mon.c @@ -10,29 +10,29 @@ #include "mfndpos.h" #include -STATIC_VAR boolean vamp_rise_msg, disintegested; - -STATIC_DCL void FDECL(sanity_check_single_mon, (struct monst *, BOOLEAN_P, const char *)); -STATIC_DCL boolean FDECL(restrap, (struct monst *)); -static long FDECL(mm_2way_aggression, (struct monst *, struct monst *)); -STATIC_DCL long FDECL(mm_aggression, (struct monst *, struct monst *)); -STATIC_DCL long FDECL(mm_displacement, (struct monst *, struct monst *)); -STATIC_DCL int NDECL(pick_animal); -STATIC_DCL void FDECL(kill_eggs, (struct obj *)); -STATIC_DCL int FDECL(pickvampshape, (struct monst *)); -STATIC_DCL boolean FDECL(isspecmon, (struct monst *)); -STATIC_DCL boolean FDECL(validspecmon, (struct monst *, int)); -STATIC_DCL struct permonst *FDECL(accept_newcham_form, (struct monst *, int)); -STATIC_DCL struct obj *FDECL(make_corpse, (struct monst *, unsigned)); -STATIC_DCL void FDECL(m_detach, (struct monst *, struct permonst *)); +static boolean vamp_rise_msg, disintegested; + +static void sanity_check_single_mon(struct monst *, BOOLEAN_P, const char *); +static boolean restrap(struct monst *); +static long mm_2way_aggression(struct monst *, struct monst *); +static long mm_aggression(struct monst *, struct monst *); +static long mm_displacement(struct monst *, struct monst *); +static int pick_animal(); +static void kill_eggs(struct obj *); +static int pickvampshape(struct monst *); +static boolean isspecmon(struct monst *); +static boolean validspecmon(struct monst *, int); +static struct permonst *accept_newcham_form(struct monst *, int); +static struct obj *make_corpse(struct monst *, unsigned); +static void m_detach(struct monst *, struct permonst *); #ifdef WEBB_DISINT -STATIC_DCL void FDECL(lifesaved_monster, (struct monst *, uchar)); +static void lifesaved_monster(struct monst *, uchar); #else -STATIC_DCL void FDECL(lifesaved_monster, (struct monst *)); +static void lifesaved_monster(struct monst *); #endif -STATIC_DCL void FDECL(migrate_mon, (struct monst *, XCHAR_P, XCHAR_P)); -STATIC_DCL boolean FDECL(ok_to_obliterate, (struct monst *)); -STATIC_DCL void FDECL(deal_with_overcrowding, (struct monst *)); +static void migrate_mon(struct monst *, XCHAR_P, XCHAR_P); +static boolean ok_to_obliterate(struct monst *); +static void deal_with_overcrowding(struct monst *); #ifdef REINCARNATION #define LEVEL_SPECIFIC_NOCORPSE(mdat) \ @@ -54,10 +54,10 @@ const char *warnings[] = { "white", "pink", "red", "ruby", "purple", "black" }; -STATIC_DCL void NDECL(warn_effects); +static void warn_effects(); #endif /* 0 */ -STATIC_OVL void +static void sanity_check_single_mon(mtmp, chk_geno, msg) struct monst *mtmp; boolean chk_geno; @@ -345,7 +345,7 @@ int mndx; * G_NOCORPSE set in order to prevent wishing for one, finding tins of one, * etc.... */ -STATIC_OVL struct obj * +static struct obj * make_corpse(mtmp, corpseflags) register struct monst *mtmp; unsigned corpseflags; @@ -2013,7 +2013,7 @@ struct monst *mon; } /* remove effects of mtmp from other data structures */ -STATIC_OVL void +static void m_detach(mtmp, mptr) struct monst *mtmp; struct permonst *mptr; /* reflects mtmp->data _prior_ to mtmp's death */ @@ -2075,7 +2075,7 @@ struct monst *mon; return (struct obj *)0; } -STATIC_OVL void +static void #ifdef WEBB_DISINT lifesaved_monster(mtmp, adtyp) struct monst *mtmp; @@ -3060,7 +3060,7 @@ struct monst *mtmp; migrate_mon(mtmp, target_lev, xyloc); } -STATIC_OVL void +static void migrate_mon(mtmp, target_lev, xyloc) struct monst *mtmp; xchar target_lev, xyloc; @@ -3071,7 +3071,7 @@ xchar target_lev, xyloc; mtmp->mstate |= MON_MIGRATING; } -STATIC_OVL boolean +static boolean ok_to_obliterate(mtmp) struct monst *mtmp; { @@ -3201,7 +3201,7 @@ struct monst *mtmp; } } -STATIC_OVL void +static void deal_with_overcrowding(mtmp) struct monst *mtmp; { @@ -3660,7 +3660,7 @@ struct monst *mon; } /* unwatched hiders may hide again; if so, returns True */ -STATIC_OVL boolean +static boolean restrap(mtmp) register struct monst *mtmp; { @@ -3777,7 +3777,7 @@ boolean construct; } } -STATIC_OVL int +static int pick_animal() { if (!animal_list) { @@ -3858,7 +3858,7 @@ int shiftflags; } } -STATIC_OVL int +static int pickvampshape(mon) struct monst *mon; { @@ -4484,7 +4484,7 @@ boolean egg; } /* kill off any eggs of genocided monsters */ -STATIC_OVL void +static void kill_eggs(obj_list) struct obj *obj_list; { diff --git a/src/monmove.c b/src/monmove.c index 3b75b103f..f52603355 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -7,11 +7,11 @@ extern boolean notonhead; -STATIC_DCL int FDECL(disturb, (struct monst *)); -STATIC_DCL void FDECL(distfleeck, (struct monst *, int *, int *, int *)); -STATIC_DCL int FDECL(m_arrival, (struct monst *)); -STATIC_DCL void FDECL(watch_on_duty, (struct monst *)); -static int FDECL(vamp_shift, (struct monst *, struct permonst *, BOOLEAN_P)); +static int disturb(struct monst *); +static void distfleeck(struct monst *, int *, int *, int *); +static int m_arrival(struct monst *); +static void watch_on_duty(struct monst *); +static int vamp_shift(struct monst *, struct permonst *, BOOLEAN_P); static void make_group_attackers_flee(struct monst* mtmp); static void share_hp(struct monst* mon1, struct monst* mon2); @@ -79,7 +79,7 @@ const char *shout; } } -STATIC_OVL void +static void watch_on_duty(mtmp) register struct monst *mtmp; { @@ -221,7 +221,7 @@ boolean digest_meal; * Possibly awaken the given monster. Return a 1 if the monster has been * jolted awake. */ -STATIC_OVL int +static int disturb(mtmp) register struct monst *mtmp; { @@ -336,7 +336,7 @@ boolean fleemsg; memset(mtmp->mtrack, 0, sizeof(mtmp->mtrack)); } -STATIC_OVL void +static void distfleeck(mtmp, inrange, nearby, scared) register struct monst *mtmp; int *inrange, *nearby, *scared; @@ -382,7 +382,7 @@ int *inrange, *nearby, *scared; /* perform a special one-time action for a monster; returns -1 if nothing special happened, 0 if monster uses up its turn, 1 if monster is killed */ -STATIC_OVL int +static int m_arrival(mon) struct monst *mon; { diff --git a/src/monst.c b/src/monst.c index a3aa1bf60..3a1f6cc37 100644 --- a/src/monst.c +++ b/src/monst.c @@ -25,7 +25,7 @@ #define C(color) #endif -void NDECL(monst_init); +void monst_init(); /* * Entry Format: (from permonst.h) * diff --git a/src/mplayer.c b/src/mplayer.c index fccb6875c..150d535ee 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -3,8 +3,8 @@ #include "hack.h" -STATIC_DCL void FDECL(get_mplname, (struct monst *, char *)); -STATIC_DCL void FDECL(mk_mplayer_armor, (struct monst *, SHORT_P)); +static void get_mplname(struct monst *, char *); +static void mk_mplayer_armor(struct monst *, SHORT_P); /* These are the names of those who * contributed to the development of NetHack 3.2/3.3/3.4/3.6. @@ -61,7 +61,7 @@ dev_name() return(developers[i]); } -STATIC_OVL void +static void get_mplname(mtmp, nam) register struct monst *mtmp; char *nam; @@ -86,7 +86,7 @@ char *nam; (boolean)mtmp->female)); } -STATIC_OVL void +static void mk_mplayer_armor(mon, typ) struct monst *mon; short typ; diff --git a/src/mthrowu.c b/src/mthrowu.c index a90ba661f..031e52ac4 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -3,10 +3,10 @@ #include "hack.h" -STATIC_DCL int FDECL(monmulti, (struct monst *, struct obj *, struct obj *)); -STATIC_DCL void FDECL(monshoot, (struct monst *, struct obj *, struct obj *)); -STATIC_DCL int FDECL(drop_throw, (struct obj *, BOOLEAN_P, int, int)); -STATIC_DCL boolean FDECL(m_lined_up, (struct monst *, struct monst *)); +static int monmulti(struct monst *, struct obj *, struct obj *); +static void monshoot(struct monst *, struct obj *, struct obj *); +static int drop_throw(struct obj *, BOOLEAN_P, int, int); +static boolean m_lined_up(struct monst *, struct monst *); #define URETREATING(x, y) (distmin(u.ux, u.uy, x, y) > distmin(u.ux0, u.uy0, x, y)) @@ -17,7 +17,7 @@ STATIC_DCL boolean FDECL(m_lined_up, (struct monst *, struct monst *)); /* * Keep consistent with breath weapons in zap.c, and AD_* in monattk.h. */ -STATIC_OVL NEARDATA const char *breathwep[] = { +static NEARDATA const char *breathwep[] = { "fragments", "fire", "frost", @@ -31,7 +31,7 @@ STATIC_OVL NEARDATA const char *breathwep[] = { }; extern boolean notonhead; /* for long worms */ -STATIC_VAR int mesg_given; /* for m_throw()/thitu() 'miss' message */ +static int mesg_given; /* for m_throw()/thitu() 'miss' message */ /* hero is hit by something other than a monster */ int @@ -110,7 +110,7 @@ const char *name; /* if null, then format `*objp' */ * Returns 0 if object still exists (not destroyed). */ -STATIC_OVL int +static int drop_throw(obj, ohit, x, y) register struct obj *obj; boolean ohit; @@ -151,13 +151,13 @@ int x, y; } /* The monster that's being shot at when one monster shoots at another */ -STATIC_OVL struct monst *target = 0; +static struct monst *target = 0; /* The monster that's doing the shooting/throwing */ -STATIC_OVL struct monst *archer = 0; +static struct monst *archer = 0; /* calculate multishot volley count for mtmp throwing otmp (if not ammo) or shooting otmp with mwep (if otmp is ammo and mwep appropriate launcher) */ -STATIC_OVL int +static int monmulti(mtmp, otmp, mwep) struct monst *mtmp; struct obj *otmp, *mwep; @@ -253,7 +253,7 @@ struct obj *otmp, *mwep; } /* mtmp throws otmp, or shoots otmp with mwep, at hero or at monster mtarg */ -STATIC_OVL void +static void monshoot(mtmp, otmp, mwep) struct monst *mtmp; struct obj *otmp, *mwep; @@ -1122,7 +1122,7 @@ int boulderhandling; /* 0=block, 1=ignore, 2=conditionally block */ return FALSE; } -STATIC_OVL boolean +static boolean m_lined_up(mtarg, mtmp) struct monst *mtarg, *mtmp; { diff --git a/src/muse.c b/src/muse.c index 62f07140b..485b0a138 100644 --- a/src/muse.c +++ b/src/muse.c @@ -17,23 +17,21 @@ boolean m_using = FALSE; * don't know not to read scrolls, etc.... */ -STATIC_DCL struct permonst *FDECL(muse_newcham_mon, (struct monst *)); -STATIC_DCL int FDECL(precheck, (struct monst *, struct obj *)); -static void FDECL(mzapwand, (struct monst *, struct obj *, BOOLEAN_P)); -STATIC_DCL void FDECL(mreadmsg, (struct monst *, struct obj *)); -STATIC_DCL void FDECL(mquaffmsg, (struct monst *, struct obj *)); -STATIC_PTR int FDECL(mbhitm, (struct monst *, struct obj *)); -STATIC_DCL void FDECL(mbhit, - (struct monst *, int, int FDECL((*), (MONST_P, OBJ_P)), - int FDECL((*), (OBJ_P, OBJ_P)), struct obj *)); -STATIC_DCL void FDECL(you_aggravate, (struct monst *)); -STATIC_DCL void FDECL(mon_consume_unstone, (struct monst *, struct obj *, - BOOLEAN_P, BOOLEAN_P)); -static boolean FDECL(mcould_eat_tin, (struct monst *)); -static boolean FDECL(muse_unslime, (struct monst *, struct obj *, struct trap *, BOOLEAN_P)); -static boolean FDECL(cures_stoning, (struct monst *, struct obj *, BOOLEAN_P)); -static int FDECL(cures_sliming, (struct monst *, struct obj *)); -static boolean FDECL(green_mon, (struct monst *)); +static struct permonst *muse_newcham_mon(struct monst *); +static int precheck(struct monst *, struct obj *); +static void mzapwand(struct monst *, struct obj *, BOOLEAN_P); +static void mreadmsg(struct monst *, struct obj *); +static void mquaffmsg(struct monst *, struct obj *); +static int mbhitm(struct monst *, struct obj *); +static void mbhit(struct monst *, int, int (*) (MONST_P, OBJ_P), + int (*)(OBJ_P, OBJ_P), struct obj *); +static void you_aggravate(struct monst *); +static void mon_consume_unstone(struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P); +static boolean mcould_eat_tin(struct monst *); +static boolean muse_unslime(struct monst *, struct obj *, struct trap *, BOOLEAN_P); +static boolean cures_stoning(struct monst *, struct obj *, BOOLEAN_P); +static int cures_sliming(struct monst *, struct obj *); +static boolean green_mon(struct monst *); static struct musable { struct obj *offensive; @@ -56,7 +54,7 @@ static boolean zap_oseen; * the item. Returns 0 if nothing happened, 2 if the monster can't do anything * (i.e. it teleported) and 1 if it's dead. */ -STATIC_OVL int +static int precheck(mon, obj) struct monst *mon; struct obj *obj; @@ -154,7 +152,7 @@ struct obj *obj; /* when a monster zaps a wand give a message, deduct a charge, and if it isn't directly seen, remove hero's memory of the number of charges */ -STATIC_OVL void +static void mzapwand(mtmp, otmp, self) struct monst *mtmp; struct obj *otmp; @@ -204,7 +202,7 @@ boolean self; otmp->spe -= 1; /* use a charge */ } -STATIC_OVL void +static void mreadmsg(mtmp, otmp) struct monst *mtmp; struct obj *otmp; @@ -244,7 +242,7 @@ struct obj *otmp; vismon ? mon_nam(mtmp) : mhe(mtmp)); } -STATIC_OVL void +static void mquaffmsg(mtmp, otmp) struct monst *mtmp; struct obj *otmp; @@ -1251,8 +1249,7 @@ struct monst *mtmp; #undef nomore } -STATIC_PTR -int +static int mbhitm(mtmp, otmp) register struct monst *mtmp; register struct obj *otmp; @@ -1331,12 +1328,12 @@ register struct obj *otmp; * zapping you, so we need a special function for it. (Unless someone wants * to merge the two functions...) */ -STATIC_OVL void +static void mbhit(mon, range, fhitm, fhito, obj) struct monst *mon; /* monster shooting the wand */ register int range; /* direction and range */ -int FDECL((*fhitm), (MONST_P, OBJ_P)); -int FDECL((*fhito), (OBJ_P, OBJ_P)); /* fns called when mon/obj hit */ +int (*fhitm)(MONST_P, OBJ_P); +int (*fhito)(OBJ_P, OBJ_P); /* fns called when mon/obj hit */ struct obj *obj; /* 2nd arg to fhitm/fhito */ { register struct monst *mtmp; @@ -2000,7 +1997,7 @@ struct monst *mtmp; return 0; } -STATIC_OVL void +static void you_aggravate(mtmp) struct monst *mtmp; { @@ -2295,7 +2292,7 @@ boolean by_you; return FALSE; } -STATIC_OVL void +static void mon_consume_unstone(mon, obj, by_you, stoning) struct monst *mon; struct obj *obj; diff --git a/src/music.c b/src/music.c index 31fa520a5..ab089f474 100644 --- a/src/music.c +++ b/src/music.c @@ -27,27 +27,27 @@ #include "hack.h" -STATIC_DCL void FDECL(put_monsters_to_sleep, (int)); -STATIC_DCL void FDECL(charm_snakes, (int)); -STATIC_DCL void FDECL(calm_nymphs, (int)); -STATIC_DCL void FDECL(charm_monsters, (int)); -STATIC_DCL int FDECL(do_improvisation, (struct obj *)); +static void put_monsters_to_sleep(int); +static void charm_snakes(int); +static void calm_nymphs(int); +static void charm_monsters(int); +static int do_improvisation(struct obj *); #ifdef UNIX386MUSIC -STATIC_DCL int NDECL(atconsole); -STATIC_DCL void FDECL(speaker, (struct obj *, char *)); +static int atconsole(); +static void speaker(struct obj *, char *); #endif #ifdef VPIX_MUSIC extern int sco_flag_console; /* will need changing if not _M_UNIX */ -STATIC_DCL void NDECL(playinit); -STATIC_DCL void FDECL(playstring, (char *, size_t)); -STATIC_DCL void FDECL(speaker, (struct obj *, char *)); +static void playinit(); +static void playstring(char *, size_t); +static void speaker(struct obj *, char *); #endif #ifdef PCMUSIC -void FDECL( pc_speaker, ( struct obj *, char * ) ); +void pc_speaker( struct obj *, char * ) ; #endif #ifdef AMIGA -void FDECL( amii_speaker, ( struct obj *, char *, int ) ); +void amii_speaker( struct obj *, char *, int ) ; #endif /* @@ -87,7 +87,7 @@ int distance; * Make monsters fall asleep. Note that they may resist the spell. */ -STATIC_OVL void +static void put_monsters_to_sleep(distance) int distance; { @@ -109,7 +109,7 @@ int distance; * Charm snakes in range. Note that the snakes are NOT tamed. */ -STATIC_OVL void +static void charm_snakes(distance) int distance; { @@ -146,7 +146,7 @@ int distance; * Calm nymphs in range. */ -STATIC_OVL void +static void calm_nymphs(distance) int distance; { @@ -213,7 +213,7 @@ struct monst *bugler; /* monster that played instrument */ /* Charm monsters in range. Note that they may resist the spell. * If swallowed, range is reduced to 0. */ -STATIC_OVL void +static void charm_monsters(distance) int distance; { @@ -452,7 +452,7 @@ const char *beats[] = { /* * The player is trying to extract something from his/her instrument. */ -STATIC_OVL int +static int do_improvisation(instr) struct obj *instr; { @@ -834,7 +834,7 @@ struct obj *instr; * Play audible music on the machine's speaker if appropriate. */ -STATIC_OVL int +static int atconsole() { /* @@ -852,7 +852,7 @@ atconsole() return(!strcmp(termtype, "AT386") || !strcmp(termtype, "xterm")); } -STATIC_OVL void +static void speaker(instr, buf) struct obj *instr; char *buf; @@ -933,7 +933,7 @@ int ticks; #include "interp.c" /* from snd86unx.shr */ -STATIC_OVL void +static void speaker(instr, buf) struct obj *instr; char *buf; diff --git a/src/o_init.c b/src/o_init.c index 64b806d8d..50775f0d5 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -4,17 +4,17 @@ #include "hack.h" #include "lev.h" /* save & restore info */ -STATIC_DCL void FDECL(setgemprobs, (d_level*)); -STATIC_DCL void FDECL(shuffle, (int, int, BOOLEAN_P)); -STATIC_DCL void NDECL(shuffle_all); -STATIC_DCL boolean FDECL(interesting_to_discover, (int)); -STATIC_DCL void FDECL(swap_armor, (int, int, int)); -static char *FDECL(oclass_to_name, (CHAR_P, char *)); +static void setgemprobs(d_level*); +static void shuffle(int, int, BOOLEAN_P); +static void shuffle_all(); +static boolean interesting_to_discover(int); +static void swap_armor(int, int, int); +static char *oclass_to_name(CHAR_P, char *); static NEARDATA short disco[NUM_OBJECTS] = DUMMY; #ifdef USE_TILES -STATIC_DCL void NDECL(shuffle_tiles); +static void shuffle_tiles(); extern short glyph2tile[]; /* from tile.c */ /* Shuffle tile assignments to match descriptions, so a red potion isn't @@ -26,7 +26,7 @@ extern short glyph2tile[]; /* from tile.c */ * is restored. So might as well do that the first time instead of writing * another routine. */ -STATIC_OVL void +static void shuffle_tiles() { int i; @@ -41,7 +41,7 @@ shuffle_tiles() } #endif /* USE_TILES */ -STATIC_OVL void +static void setgemprobs(dlev) d_level *dlev; { @@ -68,7 +68,7 @@ d_level *dlev; } /* shuffle descriptions on objects o_low to o_high */ -STATIC_OVL void +static void shuffle(o_low, o_high, domaterial) int o_low, o_high; boolean domaterial; @@ -176,7 +176,7 @@ init_objects() #endif } -STATIC_OVL void +static void shuffle_all() { int first, last, oclass; diff --git a/src/objects.c b/src/objects.c index 2eb0e0be9..2ed1a9346 100644 --- a/src/objects.c +++ b/src/objects.c @@ -1088,7 +1088,7 @@ NEARDATA struct objclass objects[] = { # define OBJECTS_PASS_2_ #include "objects.c" -void NDECL(objects_init); +void objects_init(); /* dummy routine used to force linkage */ void diff --git a/src/objnam.c b/src/objnam.c index 677c1de06..574c6d419 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -8,15 +8,15 @@ #define SCHAR_LIM 127 #define NUMOBUF 12 -STATIC_DCL char *FDECL(strprepend, (char *, const char *)); -static boolean FDECL(wishymatch, (const char *, const char *, BOOLEAN_P)); -static char *NDECL(nextobuf); -STATIC_DCL void FDECL(releaseobuf, (char *)); -static char *FDECL(minimal_xname, (struct obj *)); -static void FDECL(add_erosion_words, (struct obj *, char *, BOOLEAN_P)); -static char *FDECL(just_an, (char *str, const char *)); -static char *FDECL(xname_flags, (struct obj *, unsigned)); -static boolean FDECL(badman, (const char *, BOOLEAN_P)); +static char *strprepend(char *, const char *); +static boolean wishymatch(const char *, const char *, BOOLEAN_P); +static char *nextobuf(); +static void releaseobuf(char *); +static char *minimal_xname(struct obj *); +static void add_erosion_words(struct obj *, char *, BOOLEAN_P); +static char *just_an(char *str, const char *); +static char *xname_flags(struct obj *, unsigned); +static boolean badman(const char *, BOOLEAN_P); struct Jitem { int item; @@ -40,7 +40,7 @@ struct Jitem { typ != EMERALD && \ typ != OPAL))) -STATIC_OVL struct Jitem Japanese_items[] = { +static struct Jitem Japanese_items[] = { { SHORT_SWORD, "wakizashi" }, { BROADSWORD, "ninja-to" }, { FLAIL, "nunchaku" }, @@ -56,9 +56,9 @@ STATIC_OVL struct Jitem Japanese_items[] = { {0, "" } }; -STATIC_DCL const char *FDECL(Japanese_item_name, (int i)); +static const char *Japanese_item_name(int i); -STATIC_OVL char * +static char * strprepend(s, pref) char *s; const char *pref; @@ -74,7 +74,7 @@ static char NEARDATA obufs[NUMOBUF][BUFSZ]; static int obufidx = 0; /* manage a pool of BUFSZ buffers, so callers don't have to */ -STATIC_OVL char * +static char * nextobuf() { obufidx = (obufidx + 1) % NUMOBUF; @@ -83,7 +83,7 @@ nextobuf() } /* put the most recently allocated buffer back if possible */ -STATIC_OVL void +static void releaseobuf(bufp) char *bufp; { @@ -250,7 +250,7 @@ static int distantname = 0; char * distant_name(obj, func) struct obj *obj; -char *FDECL((*func), (OBJ_P)); +char *(*func)(OBJ_P); { char *str; @@ -1863,8 +1863,8 @@ struct obj *obj; char * short_oname(obj, func, altfunc, lenlimit) struct obj *obj; -char *FDECL((*func), (OBJ_P)), /* main formatting routine */ - *FDECL((*altfunc), (OBJ_P)); /* alternate for shortest result */ +char *(*func) (OBJ_P), /* main formatting routine */ + *(*altfunc)(OBJ_P); /* alternate for shortest result */ unsigned lenlimit; { struct obj save_obj; @@ -1945,7 +1945,7 @@ unsigned lenlimit; const char * singular(otmp, func) register struct obj *otmp; -char *FDECL((*func), (OBJ_P)); +char *(*func)(OBJ_P); { long savequan; #ifdef SHOW_WEIGHT @@ -2815,7 +2815,7 @@ struct o_range { }; /* wishable subranges of objects */ -STATIC_OVL NEARDATA const struct o_range o_ranges[] = { +static NEARDATA const struct o_range o_ranges[] = { { "bag", TOOL_CLASS, SACK, BAG_OF_TRICKS }, { "lamp", TOOL_CLASS, OIL_LAMP, MAGIC_LAMP }, { "candle", TOOL_CLASS, TALLOW_CANDLE, WAX_CANDLE }, @@ -4653,7 +4653,7 @@ int first, last; return 0; } -STATIC_OVL const char * +static const char * Japanese_item_name(i) int i; { @@ -4776,7 +4776,7 @@ safe_qbuf(qbuf, qprefix, qsuffix, obj, func, altfunc, lastR) char *qbuf; /* output buffer */ const char *qprefix, *qsuffix; struct obj *obj; -char *FDECL((*func), (OBJ_P)), *FDECL((*altfunc), (OBJ_P)); +char *(*func) (OBJ_P), *(*altfunc) (OBJ_P); const char *lastR; { char *bufp, *endp; diff --git a/src/options.c b/src/options.c index 54ff75847..9b30ed795 100644 --- a/src/options.c +++ b/src/options.c @@ -597,45 +597,45 @@ static short n_menu_mapped = 0; static boolean initial, from_file; -STATIC_DCL void FDECL(doset_add_menu, (winid, const char *, int)); -STATIC_DCL void FDECL(nmcpy, (char *, const char *, int)); -STATIC_DCL void FDECL(escapes, (const char *, char *)); -STATIC_DCL void FDECL(rejectoption, (const char *)); -STATIC_DCL void FDECL(badoption, (const char *)); -STATIC_DCL char *FDECL(string_for_opt, (char *, BOOLEAN_P)); -STATIC_DCL char *FDECL(string_for_env_opt, (const char *, char *, BOOLEAN_P)); -STATIC_DCL void FDECL(bad_negation, (const char *, BOOLEAN_P)); -STATIC_DCL int FDECL(change_inv_order, (char *)); -STATIC_DCL void FDECL(oc_to_str, (char *, char *)); -STATIC_DCL void FDECL(graphics_opts, (char *, const char *, int, int)); -STATIC_DCL int FDECL(feature_alert_opts, (char *, const char *)); -STATIC_DCL const char *FDECL(get_compopt_value, (const char *, char *)); -STATIC_DCL boolean FDECL(special_handling, (const char *, BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL void FDECL(warning_opts, (char *, const char *)); -STATIC_DCL void FDECL(duplicate_opt_detection, (const char *, int)); - -STATIC_OVL void FDECL(wc_set_font_name, (int, char *)); -STATIC_OVL int FDECL(wc_set_window_colors, (char *)); -STATIC_OVL boolean FDECL(is_wc_option, (const char *)); -STATIC_OVL boolean FDECL(wc_supported, (const char *)); -STATIC_OVL boolean FDECL(is_wc2_option, (const char *)); -STATIC_OVL boolean FDECL(wc2_supported, (const char *)); - -static int FDECL(handle_add_list_remove, (const char *, int)); - -static const char *FDECL(attr2attrname, (int)); -static boolean FDECL(test_regex_pattern, (const char *, const char *)); +static void doset_add_menu(winid, const char *, int); +static void nmcpy(char *, const char *, int); +static void escapes(const char *, char *); +static void rejectoption(const char *); +static void badoption(const char *); +static char *string_for_opt(char *, BOOLEAN_P); +static char *string_for_env_opt(const char *, char *, BOOLEAN_P); +static void bad_negation(const char *, BOOLEAN_P); +static int change_inv_order(char *); +static void oc_to_str(char *, char *); +static void graphics_opts(char *, const char *, int, int); +static int feature_alert_opts(char *, const char *); +static const char *get_compopt_value(const char *, char *); +static boolean special_handling(const char *, BOOLEAN_P, BOOLEAN_P); +static void warning_opts(char *, const char *); +static void duplicate_opt_detection(const char *, int); + +static void wc_set_font_name(int, char *); +static int wc_set_window_colors(char *); +static boolean is_wc_option(const char *); +static boolean wc_supported(const char *); +static boolean is_wc2_option(const char *); +static boolean wc2_supported(const char *); + +static int handle_add_list_remove(const char *, int); + +static const char *attr2attrname(int); +static boolean test_regex_pattern(const char *, const char *); /* menu coloring */ extern struct menucoloring *menu_colorings; -static boolean FDECL(add_menu_coloring_parsed, (char *, int, int)); -static void FDECL(free_one_menu_coloring, (int)); -static int NDECL(count_menucolors); +static boolean add_menu_coloring_parsed(char *, int, int); +static void free_one_menu_coloring(int); +static int count_menucolors(); #ifdef AUTOPICKUP_EXCEPTIONS -static int NDECL(handler_autopickup_exception); -static void FDECL(remove_autopickup_exception, (struct autopickup_exception *)); -static int NDECL(count_apes); +static int handler_autopickup_exception(); +static void remove_autopickup_exception(struct autopickup_exception *); +static int count_apes(); #endif #ifdef AUTOPICKUP_EXCEPTIONS @@ -1041,7 +1041,7 @@ initoptions() obj_descr[SLIME_MOLD].oc_name = "fruit"; } -STATIC_OVL void +static void nmcpy(dest, src, maxlen) char *dest; const char *src; @@ -1078,7 +1078,7 @@ int maxlen; * an appropriate digit will also fall through to \ and yield 'X' * or 'O', plus stop if the non-digit is end-of-string. */ -STATIC_OVL void +static void escapes(cp, tp) const char *cp; /* might be 'tp', updating in place */ char *tp; /* result is never longer than 'cp' */ @@ -1140,7 +1140,7 @@ char *tp; /* result is never longer than 'cp' */ *tp = '\0'; } -STATIC_OVL void +static void rejectoption(optname) const char *optname; { @@ -1152,7 +1152,7 @@ const char *optname; #endif } -STATIC_OVL void +static void badoption(opts) const char *opts; { @@ -1175,7 +1175,7 @@ const char *opts; wait_synch(); } -STATIC_OVL char * +static char * string_for_opt(opts, val_optional) char *opts; boolean val_optional; @@ -1193,7 +1193,7 @@ boolean val_optional; return colon; } -STATIC_OVL char * +static char * string_for_env_opt(optname, opts, val_optional) const char *optname; char *opts; @@ -1206,7 +1206,7 @@ boolean val_optional; return string_for_opt(opts, val_optional); } -STATIC_OVL void +static void bad_negation(optname, with_parameter) const char *optname; boolean with_parameter; @@ -1225,7 +1225,7 @@ boolean with_parameter; * This routine returns 1 unless there is a duplicate or bad char in * the string. */ -STATIC_OVL int +static int change_inv_order(op) char *op; { @@ -1260,7 +1260,7 @@ char *op; return 1; } -STATIC_OVL void +static void graphics_opts(opts, optype, maxlen, offset) register char *opts; const char *optype; @@ -1281,7 +1281,7 @@ int maxlen, offset; assign_graphics(translate, length, maxlen, offset); } -STATIC_OVL void +static void warning_opts(opts, optype) register char *opts; const char *optype; @@ -1311,7 +1311,7 @@ register uchar *graph_chars; if (graph_chars[i]) warnsyms[i] = graph_chars[i]; } -STATIC_OVL int +static int feature_alert_opts(op, optn) char *op; const char *optn; @@ -1562,7 +1562,7 @@ int on_or_off; } } -STATIC_OVL void +static void duplicate_opt_detection(opts, bool_or_comp) const char *opts; int bool_or_comp; /* 0 == boolean option, 1 == compound */ @@ -4307,7 +4307,7 @@ static NEARDATA const char *sortltype[] = { * Convert the given string of object classes to a string of default object * symbols. */ -STATIC_OVL void +static void oc_to_str(src, dest) char *src, *dest; { @@ -4367,7 +4367,7 @@ char ch; static char fmtstr_doset_add_menu[] = "%s%-15s [%s] "; static char fmtstr_doset_add_menu_tab[] = "%s\t[%s]"; -STATIC_OVL void +static void doset_add_menu(win, option, indexoffset) winid win; /* window to add to */ const char *option; /* option name */ @@ -4613,7 +4613,7 @@ doset() return 0; } -STATIC_OVL boolean +static boolean special_handling(optname, setinitial, setfromfile) const char *optname; boolean setinitial, setfromfile; @@ -5092,7 +5092,7 @@ boolean setinitial, setfromfile; /* This is ugly. We have all the option names in the compopt[] array, but we need to look at each option individually to get the value. */ -STATIC_OVL const char * +static const char * get_compopt_value(optname, buf) const char *optname; char *buf; @@ -6052,7 +6052,7 @@ int status; } } -STATIC_OVL boolean +static boolean is_wc_option(optnam) const char *optnam; { @@ -6065,7 +6065,7 @@ const char *optnam; return FALSE; } -STATIC_OVL boolean +static boolean wc_supported(optnam) const char *optnam; { @@ -6108,7 +6108,7 @@ int status; } } -STATIC_OVL boolean +static boolean is_wc2_option(optnam) const char *optnam; { @@ -6121,7 +6121,7 @@ const char *optnam; return FALSE; } -STATIC_OVL boolean +static boolean wc2_supported(optnam) const char *optnam; { @@ -6136,7 +6136,7 @@ const char *optnam; } -STATIC_OVL void +static void wc_set_font_name(wtype, fontname) int wtype; char *fontname; @@ -6170,7 +6170,7 @@ char *fontname; return; } -STATIC_OVL int +static int wc_set_window_colors(op) char *op; { diff --git a/src/pager.c b/src/pager.c index 3b746be5f..4b57f57f3 100644 --- a/src/pager.c +++ b/src/pager.c @@ -7,23 +7,23 @@ #include "hack.h" #include "dlb.h" -STATIC_DCL boolean FDECL(is_swallow_sym, (int)); -STATIC_DCL int FDECL(append_str, (char *, const char *)); -STATIC_DCL struct permonst * FDECL(lookat, (int, int, char *, char *)); +static boolean is_swallow_sym(int); +static int append_str(char *, const char *); +static struct permonst * lookat(int, int, char *, char *); static void look_all(boolean, boolean, boolean); static void add_obj_info(winid, struct obj *, short); static void add_mon_info(winid, struct permonst *); -static void FDECL(do_supplemental_info, (char *, struct permonst *, BOOLEAN_P)); -STATIC_DCL boolean FDECL(help_menu, (int *)); +static void do_supplemental_info(char *, struct permonst *, BOOLEAN_P); +static boolean help_menu(int *); #ifdef PORT_HELP -extern void NDECL(port_help); +extern void port_help(); #endif static boolean lookup_database_entry(dlb *fp, struct obj *obj, const char* dbase_str, const char* inp, struct permonst *pm, boolean user_typed_name, boolean without_asking, char *supplemental_name); /* Returns "true" for characters that could represent a monster's stomach. */ -STATIC_OVL boolean +static boolean is_swallow_sym(c) int c; { @@ -38,7 +38,7 @@ int c; * a substring of buf. Return 1 if the string was appended, 0 otherwise. * It is expected that buf is of size BUFSZ. */ -STATIC_OVL int +static int append_str(buf, new_str) char *buf; const char *new_str; @@ -393,7 +393,7 @@ int x, y; * Return the name of the glyph found at (x,y). * If not hallucinating and the glyph is a monster, also monster data. */ -STATIC_OVL struct permonst * +static struct permonst * lookat(x, y, buf, monbuf) int x, y; char *buf, *monbuf; @@ -2860,7 +2860,7 @@ static const char *help_menu_items[] = { (char *)0 }; -STATIC_OVL boolean +static boolean help_menu(sel) int *sel; { diff --git a/src/pickup.c b/src/pickup.c index 30facece7..d6ece7143 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -9,34 +9,33 @@ #define CONTAINED_SYM '>' /* from invent.c */ -STATIC_DCL void FDECL(simple_look, (struct obj *, BOOLEAN_P)); -STATIC_DCL boolean FDECL(query_classes, (char *, boolean *, boolean *, - const char *, struct obj *, BOOLEAN_P, int *)); -STATIC_DCL void FDECL(check_here, (BOOLEAN_P)); -STATIC_DCL boolean FDECL(n_or_more, (struct obj *)); -STATIC_DCL boolean FDECL(all_but_uchain, (struct obj *)); +static void simple_look(struct obj *, BOOLEAN_P); +static boolean query_classes(char *, boolean *, boolean *, + const char *, struct obj *, BOOLEAN_P, int *); +static void check_here(BOOLEAN_P); +static boolean n_or_more(struct obj *); +static boolean all_but_uchain(struct obj *); #if 0 /* not used */ -STATIC_DCL boolean FDECL(allow_cat_no_uchain, (struct obj *)); +static boolean allow_cat_no_uchain(struct obj *); #endif -STATIC_DCL int FDECL(autopick, (struct obj*, int, menu_item **)); -STATIC_DCL int FDECL(count_categories, (struct obj *, int)); -STATIC_DCL long FDECL(carry_count, - (struct obj *, struct obj *, long, BOOLEAN_P, int *, int *)); -STATIC_DCL int FDECL(lift_object, (struct obj *, struct obj *, long *, BOOLEAN_P)); -STATIC_DCL boolean FDECL(mbag_explodes, (struct obj *, int)); -STATIC_PTR int FDECL(in_container, (struct obj *)); -STATIC_PTR int FDECL(ck_bag, (struct obj *)); -STATIC_PTR int FDECL(out_container, (struct obj *)); -static void FDECL(removed_from_icebox, (struct obj *)); -STATIC_DCL long FDECL(mbag_item_gone, (int, struct obj *)); -static int FDECL(traditional_loot, (BOOLEAN_P)); -static int FDECL(menu_loot, (int, BOOLEAN_P)); -static char FDECL(in_or_out_menu, (const char *, struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL boolean FDECL(able_to_loot, (int, int, BOOLEAN_P)); -STATIC_DCL boolean FDECL(mon_beside, (int, int)); -static int FDECL(do_loot_cont, (struct obj **, int, int)); -STATIC_DCL int FDECL(dump_container, (struct obj*, BOOLEAN_P)); -STATIC_DCL void NDECL(del_sokoprize); +static int autopick(struct obj*, int, menu_item **); +static int count_categories(struct obj *, int); +static long carry_count(struct obj *, struct obj *, long, BOOLEAN_P, int *, int *); +static int lift_object(struct obj *, struct obj *, long *, BOOLEAN_P); +static boolean mbag_explodes(struct obj *, int); +static int in_container(struct obj *); +static int ck_bag(struct obj *); +static int out_container(struct obj *); +static void removed_from_icebox(struct obj *); +static long mbag_item_gone(int, struct obj *); +static int traditional_loot(BOOLEAN_P); +static int menu_loot(int, BOOLEAN_P); +static char in_or_out_menu(const char *, struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +static boolean able_to_loot(int, int, BOOLEAN_P); +static boolean mon_beside(int, int); +static int do_loot_cont(struct obj **, int, int); +static int dump_container(struct obj*, BOOLEAN_P); +static void del_sokoprize(); /* define for query_objlist() and autopickup() */ #define FOLLOW(curr, flags) \ @@ -60,7 +59,7 @@ static const char overloadmsg[] = "You have extreme difficulty lifting"; /* BUG: this lets you look at cockatrice corpses while blind without touching them */ /* much simpler version of the look-here code; used by query_classes() */ -STATIC_OVL void +static void simple_look(otmp, here) struct obj *otmp; /* list of objects */ boolean here; /* flag for type of obj list linkage */ @@ -90,7 +89,7 @@ collect_obj_classes(ilets, otmp, here, filter, itemcount) char ilets[]; register struct obj *otmp; boolean here; -boolean FDECL((*filter), (OBJ_P)); +boolean (*filter)(OBJ_P); int *itemcount; { register int iletct = 0; @@ -121,7 +120,7 @@ int *itemcount; * "?/a" or "a?/" or "/a?",&c picks all '?' even though no '/' * (ie, treated as if it had just been "?a"). */ -STATIC_OVL boolean +static boolean query_classes(oclasses, one_at_a_time, everything, action, objs, here, menu_on_demand) char oclasses[]; @@ -143,8 +142,7 @@ int *menu_on_demand; if (menu_on_demand) { *menu_on_demand = 0; } - iletct = collect_obj_classes(ilets, objs, here, - (boolean FDECL((*), (OBJ_P))) 0, &itemcount); + iletct = collect_obj_classes(ilets, objs, here, (boolean (*)(OBJ_P)) 0, &itemcount); if (iletct == 0) { return FALSE; } else if (iletct == 1) { @@ -287,7 +285,7 @@ boolean remotely; } /* look at the objects at our location, unless there are too many of them */ -STATIC_OVL void +static void check_here(picked_some) boolean picked_some; { @@ -314,7 +312,7 @@ boolean picked_some; static long val_for_n_or_more; /* query_objlist callback: return TRUE if obj's count is >= reference value */ -STATIC_OVL boolean +static boolean n_or_more(obj) struct obj *obj; { @@ -381,7 +379,7 @@ int c; } /* query_objlist callback: return TRUE if not uchain */ -STATIC_OVL boolean +static boolean all_but_uchain(obj) struct obj *obj; { @@ -456,7 +454,7 @@ struct obj *obj; #if 0 /* not used */ /* query_objlist callback: return TRUE if valid category (class), no uchain */ -STATIC_OVL boolean +static boolean allow_cat_no_uchain(obj) struct obj *obj; { @@ -856,7 +854,7 @@ boolean calc_costly; * picked is zero, the pickup list is left alone. The caller of this * function must free the pickup list. */ -STATIC_OVL int +static int autopick(olist, follow, pick_list) struct obj *olist; /* the object list */ int follow; /* how to follow the object list */ @@ -916,7 +914,7 @@ struct obj *olist; /* the list to pick from */ int qflags; /* options to control the query */ menu_item **pick_list; /* return list of items picked */ int how; /* type of query */ -boolean FDECL((*allow), (OBJ_P));/* allow function */ +boolean (*allow)(OBJ_P);/* allow function */ { int i; #ifdef SORTLOOT @@ -1073,7 +1071,7 @@ int how; /* type of query */ boolean collected_type_name; char invlet; int ccount; - boolean FDECL((*ofilter), (OBJ_P)) = (boolean FDECL((*), (OBJ_P))) 0; + boolean (*ofilter) (OBJ_P) = (boolean (*) (OBJ_P)) 0; boolean do_unpaid = FALSE; boolean do_unidentified = FALSE; boolean do_blessed = FALSE, do_cursed = FALSE, do_uncursed = FALSE, @@ -1269,7 +1267,7 @@ int how; /* type of query */ return n; } -STATIC_OVL int +static int count_categories(olist, qflags) struct obj *olist; int qflags; @@ -1333,7 +1331,7 @@ delta_cwt(struct obj *container, struct obj *obj) } /* could we carry `obj'? if not, could we carry some of it/them? */ -STATIC_OVL long +static long carry_count(obj, container, count, telekinesis, wt_before, wt_after) struct obj *obj, *container; /* object to pick up, bag it's coming out of */ long count; @@ -1468,8 +1466,7 @@ int *wt_before, *wt_after; } /* determine whether character is able and player is willing to carry `obj' */ -STATIC_OVL -int +static int lift_object(obj, container, cnt_p, telekinesis) struct obj *obj, *container; /* object to pick up, bag it's coming out of */ long *cnt_p; @@ -1770,7 +1767,7 @@ boolean countem; * We don't want to add annoying messages between checking * for tippability and bringing up the inventory prompt. */ -STATIC_OVL boolean +static boolean able_to_loot(x, y, looting) int x, y; boolean looting; /* loot vs tip */ @@ -1800,7 +1797,7 @@ boolean looting; /* loot vs tip */ return TRUE; } -STATIC_OVL boolean +static boolean mon_beside(x, y) int x, y; { @@ -2249,7 +2246,7 @@ boolean *prev_loot; * Decide whether an object being placed into a magic bag will cause * it to explode. If the object is a bag itself, check recursively. */ -STATIC_OVL boolean +static boolean mbag_explodes(obj, depthin) struct obj *obj; int depthin; @@ -2300,7 +2297,7 @@ static NEARDATA struct obj *current_container; #define Icebox (current_container->otyp == ICE_BOX) /* Returns: -1 to stop, 1 item was inserted, 0 item was not inserted. */ -STATIC_PTR int +static int in_container(obj) register struct obj *obj; { @@ -2473,7 +2470,7 @@ register struct obj *obj; return(current_container ? 1 : -1); } -STATIC_PTR int +static int ck_bag(obj) struct obj *obj; { @@ -2481,7 +2478,7 @@ struct obj *obj; } /* Returns: -1 to stop, 1 item was removed, 0 item was not removed. */ -STATIC_PTR int +static int out_container(obj) register struct obj *obj; { @@ -2557,7 +2554,7 @@ struct obj *obj; } /* an object inside a cursed bag of holding is being destroyed */ -STATIC_OVL long +static long mbag_item_gone(held, item) int held; struct obj *item; @@ -2674,7 +2671,7 @@ boolean past; /* used by askchain() to check for magic bag explosion */ boolean container_gone(fn) -int FDECL((*fn), (OBJ_P)); +int (*fn)(OBJ_P); { /* result is only meaningful while use_container() is executing */ return ((fn == in_container || fn == out_container) && !current_container); @@ -3010,7 +3007,7 @@ static int traditional_loot(put_in) boolean put_in; { - int FDECL((*actionfunc), (OBJ_P)), FDECL((*checkfunc), (OBJ_P)); + int (*actionfunc)(OBJ_P), (*checkfunc)(OBJ_P); struct obj **objlist; char selection[MAXOCLASSES + 10]; /* +10: room for B,U,C,X plus slop */ const char *action; @@ -3026,7 +3023,7 @@ boolean put_in; action = "take out"; objlist = &(current_container->cobj); actionfunc = out_container; - checkfunc = (int FDECL((*), (OBJ_P))) 0; + checkfunc = (int (*) (OBJ_P)) 0; } if (query_classes(selection, &one_by_one, &allflag, action, *objlist, FALSE, &menu_on_request)) { @@ -3041,7 +3038,7 @@ boolean put_in; } /* Loot a container (take things out, put things in), using a menu. */ -STATIC_OVL int +static int menu_loot(retry, put_in) int retry; boolean put_in; @@ -3337,7 +3334,7 @@ BOOLEAN_P destroy_after; } -STATIC_OVL void +static void del_sokoprize() { int x, y, cnt = 0; diff --git a/src/pline.c b/src/pline.c index 51295ff10..68ca203a2 100644 --- a/src/pline.c +++ b/src/pline.c @@ -6,7 +6,7 @@ static boolean no_repeat = FALSE; -static char *FDECL(You_buf, (int)); +static char *You_buf(int); #if defined(DUMP_LOG) && defined(DUMPMSGS) char msgs[DUMPMSGS][BUFSZ]; @@ -77,7 +77,7 @@ putmesg(const char *line) */ #if defined(USE_STDARG) || defined(USE_VARARGS) -static void FDECL(vpline, (const char *, va_list)); +static void vpline(const char *, va_list); void pline VA_DECL(const char *, line) @@ -336,7 +336,7 @@ verbalize VA_DECL(const char *, line) */ #if defined(USE_STDARG) || defined(USE_VARARGS) -static void FDECL(vraw_printf, (const char *, va_list)); +static void vraw_printf(const char *, va_list); void raw_printf VA_DECL(const char *, line) diff --git a/src/polyself.c b/src/polyself.c index 8d930a02a..56422dbbf 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -20,12 +20,12 @@ #include "hack.h" -STATIC_DCL void FDECL(polyman, (const char *, const char *)); -static void FDECL(dropp, (struct obj *)); -STATIC_DCL void NDECL(break_armor); -STATIC_DCL void FDECL(drop_weapon, (int)); -STATIC_DCL int FDECL(armor_to_dragon, (int)); -STATIC_DCL void NDECL(newman); +static void polyman(const char *, const char *); +static void dropp(struct obj *); +static void break_armor(); +static void drop_weapon(int); +static int armor_to_dragon(int); +static void newman(); static const char no_longer_petrify_resistant[] = "No longer petrify-resistant, you"; @@ -142,7 +142,7 @@ boolean on; } /* make a (new) human out of the player */ -STATIC_OVL void +static void polyman(fmt, arg) const char *fmt, *arg; { @@ -240,7 +240,7 @@ change_sex() } } -STATIC_OVL void +static void newman() { int tmp, oldlvl; @@ -772,7 +772,7 @@ struct obj *obj; } } -STATIC_OVL void +static void break_armor() { register struct obj *otmp; @@ -875,7 +875,7 @@ break_armor() } } -STATIC_OVL void +static void drop_weapon(alone) int alone; { @@ -1547,7 +1547,7 @@ int damtype, dam; } } -STATIC_OVL int +static int armor_to_dragon(atyp) int atyp; { diff --git a/src/potion.c b/src/potion.c index e70602008..f70407be2 100644 --- a/src/potion.c +++ b/src/potion.c @@ -8,18 +8,18 @@ boolean notonhead = FALSE; static NEARDATA int nothing, unkn; static NEARDATA const char beverages[] = { POTION_CLASS, 0 }; -STATIC_DCL long FDECL(itimeout, (long)); -STATIC_DCL long FDECL(itimeout_incr, (long, int)); -STATIC_DCL void NDECL(ghost_from_bottle); -STATIC_OVL void NDECL(alchemy_init); -STATIC_DCL boolean FDECL(H2Opotion_dip, (struct obj *, struct obj *, BOOLEAN_P, const char *)); +static long itimeout(long); +static long itimeout_incr(long, int); +static void ghost_from_bottle(); +static void alchemy_init(); +static boolean H2Opotion_dip(struct obj *, struct obj *, BOOLEAN_P, const char *); #ifndef TESTING -STATIC_DCL int FDECL(dip, (struct obj *, struct obj *)); +static int dip(struct obj *, struct obj *); #endif /* force `val' to be within valid range for intrinsic timeout value */ -STATIC_OVL long +static long itimeout(val) long val; { @@ -30,7 +30,7 @@ long val; } /* increment `old' by `incr' and force result to be valid intrinsic timeout */ -STATIC_OVL long +static long itimeout_incr(old, incr) long old; int incr; @@ -432,7 +432,7 @@ int xtime; } } -STATIC_OVL void +static void ghost_from_bottle() { struct monst *mtmp = makemon(&mons[PM_GHOST], u.ux, u.uy, NO_MM_FLAGS); @@ -1251,13 +1251,13 @@ bottlename() } /* handle item dipped into water potion or steed saddle splashed by same */ -STATIC_OVL boolean +static boolean H2Opotion_dip(potion, targobj, useeit, objphrase) struct obj *potion, *targobj; boolean useeit; const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ { - void FDECL((*func), (OBJ_P)) = 0; + void (*func) (OBJ_P) = 0; const char *glowcolor = 0; #define COST_alter (-2) #define COST_none (-1) @@ -1897,7 +1897,7 @@ short alchemy_table2[17]; #define IS_DARK_COLOR(x) ((x)&8) /** Does a one-time set up of alchemical tables. */ -STATIC_OVL void +static void alchemy_init() { static boolean init = FALSE; diff --git a/src/pray.c b/src/pray.c index 8a9e959a3..df3ec5825 100644 --- a/src/pray.c +++ b/src/pray.c @@ -3,21 +3,21 @@ #include "hack.h" -STATIC_PTR int NDECL(prayer_done); -STATIC_DCL struct obj *NDECL(worst_cursed_item); -STATIC_DCL void FDECL(fix_worst_trouble, (int)); -STATIC_DCL void FDECL(angrygods, (ALIGNTYP_P)); -STATIC_DCL void FDECL(at_your_feet, (const char *)); -STATIC_DCL void NDECL(gcrownu); -STATIC_DCL void FDECL(pleased, (ALIGNTYP_P)); -STATIC_DCL void FDECL(godvoice, (ALIGNTYP_P, const char*)); -STATIC_DCL void FDECL(god_zaps_you, (ALIGNTYP_P)); -static void FDECL(fry_by_god, (ALIGNTYP_P, BOOLEAN_P)); -STATIC_DCL void FDECL(gods_angry, (ALIGNTYP_P)); -STATIC_DCL void FDECL(gods_upset, (ALIGNTYP_P)); -STATIC_DCL void FDECL(consume_offering, (struct obj *)); -STATIC_DCL boolean FDECL(water_prayer, (BOOLEAN_P)); -STATIC_DCL boolean FDECL(blocked_boulder, (int, int)); +static int prayer_done(); +static struct obj *worst_cursed_item(); +static void fix_worst_trouble(int); +static void angrygods(ALIGNTYP_P); +static void at_your_feet(const char *); +static void gcrownu(); +static void pleased(ALIGNTYP_P); +static void godvoice(ALIGNTYP_P, const char*); +static void god_zaps_you(ALIGNTYP_P); +static void fry_by_god(ALIGNTYP_P, BOOLEAN_P); +static void gods_angry(ALIGNTYP_P); +static void gods_upset(ALIGNTYP_P); +static void consume_offering(struct obj *); +static boolean water_prayer(BOOLEAN_P); +static boolean blocked_boulder(int, int); /* simplify a few tests */ #define Cursed_obj(obj, typ) ((obj) && (obj)->otyp == (typ) && (obj)->cursed) @@ -223,7 +223,7 @@ in_trouble() } /* select an item for TROUBLE_CURSED_ITEMS */ -STATIC_OVL struct obj * +static struct obj * worst_cursed_item() { register struct obj *otmp; @@ -282,7 +282,7 @@ worst_cursed_item() return otmp; } -STATIC_OVL void +static void fix_worst_trouble(trouble) register int trouble; { @@ -551,7 +551,7 @@ register int trouble; * bathroom walls, but who is foiled by bathrobes." --Bertrand Russell, 1943 * Divine wrath, dungeon walls, and armor follow the same principle. */ -STATIC_OVL void +static void god_zaps_you(resp_god) aligntyp resp_god; { @@ -626,7 +626,7 @@ aligntyp resp_god; } } -STATIC_OVL void +static void fry_by_god(resp_god, via_disintegration) aligntyp resp_god; boolean via_disintegration; @@ -637,7 +637,7 @@ boolean via_disintegration; done(DIED); } -STATIC_OVL void +static void angrygods(resp_god) aligntyp resp_god; { @@ -722,7 +722,7 @@ const char *str; } } -STATIC_OVL void +static void gcrownu() { struct obj *obj; @@ -923,7 +923,7 @@ gcrownu() add_weapon_skill(1); } -STATIC_OVL void +static void pleased(g_align) aligntyp g_align; { @@ -1223,7 +1223,7 @@ aligntyp g_align; /* either blesses or curses water on the altar, * returns true if it found any water here. */ -STATIC_OVL boolean +static boolean water_prayer(bless_water) boolean bless_water; { @@ -1252,7 +1252,7 @@ boolean bless_water; return((boolean)(changed > 0L)); } -STATIC_OVL void +static void godvoice(g_align, words) aligntyp g_align; const char *words; @@ -1267,7 +1267,7 @@ const char *words; godvoices[rn2(SIZE(godvoices))], quot, words, quot); } -STATIC_OVL void +static void gods_angry(g_align) aligntyp g_align; { @@ -1275,7 +1275,7 @@ aligntyp g_align; } /* The g_align god is upset with you. */ -STATIC_OVL void +static void gods_upset(g_align) aligntyp g_align; { @@ -1286,7 +1286,7 @@ aligntyp g_align; static NEARDATA const char sacrifice_types[] = { FOOD_CLASS, AMULET_CLASS, 0 }; -STATIC_OVL void +static void consume_offering(otmp) register struct obj *otmp; { @@ -1909,7 +1909,7 @@ dopray() return(1); } -STATIC_PTR int +static int prayer_done() /* M. Stephenson (1.0.3b) */ { aligntyp alignment = p_aligntyp; @@ -2278,7 +2278,7 @@ register int x, y; } /* assumes isok() at one space away, but not necessarily at two */ -STATIC_OVL boolean +static boolean blocked_boulder(dx, dy) int dx, dy; { diff --git a/src/priest.c b/src/priest.c index 8052a61be..683cfa5e5 100644 --- a/src/priest.c +++ b/src/priest.c @@ -8,8 +8,8 @@ #define ALGN_SINNED (-4) /* worse than strayed */ #define ALGN_PIOUS 14 /* better than fervent (9..13) */ -STATIC_DCL boolean FDECL(histemple_at, (struct monst *, XCHAR_P, XCHAR_P)); -STATIC_DCL boolean FDECL(has_shrine, (struct monst *)); +static boolean histemple_at(struct monst *, XCHAR_P, XCHAR_P); +static boolean has_shrine(struct monst *); void newepri(mtmp) @@ -159,7 +159,7 @@ register char *array; return('\0'); } -STATIC_OVL boolean +static boolean histemple_at(priest, x, y) register struct monst *priest; register xchar x, y; @@ -375,7 +375,7 @@ struct monst *priest; return (boolean) (u.ualign.type == mon_aligntyp(priest)); } -STATIC_OVL boolean +static boolean has_shrine(pri) struct monst *pri; { diff --git a/src/quest.c b/src/quest.c index 9563b7e35..2cc1bf344 100644 --- a/src/quest.c +++ b/src/quest.c @@ -12,19 +12,19 @@ #define Not_firsttime (on_level(&u.uz0, &u.uz)) #define Qstat(x) (quest_status.x) -STATIC_DCL void NDECL(on_start); -STATIC_DCL void NDECL(on_locate); -STATIC_DCL void NDECL(on_goal); -STATIC_DCL boolean NDECL(not_capable); -STATIC_DCL int FDECL(is_pure, (BOOLEAN_P)); -STATIC_DCL void FDECL(expulsion, (BOOLEAN_P)); -STATIC_DCL void NDECL(chat_with_leader); -STATIC_DCL void NDECL(chat_with_nemesis); -STATIC_DCL void NDECL(chat_with_guardian); -STATIC_DCL void FDECL(prisoner_speaks, (struct monst *)); - - -STATIC_OVL void +static void on_start(); +static void on_locate(); +static void on_goal(); +static boolean not_capable(); +static int is_pure(BOOLEAN_P); +static void expulsion(BOOLEAN_P); +static void chat_with_leader(); +static void chat_with_nemesis(); +static void chat_with_guardian(); +static void prisoner_speaks(struct monst *); + + +static void on_start() { if(!Qstat(first_start)) { @@ -36,7 +36,7 @@ on_start() } } -STATIC_OVL void +static void on_locate() { if(!Qstat(first_locate)) { @@ -46,7 +46,7 @@ on_locate() qt_pager(QT_NEXTLOCATE); } -STATIC_OVL void +static void on_goal() { if (Qstat(killed_nemesis)) { @@ -102,7 +102,7 @@ ok_to_quest() return FALSE; } -STATIC_OVL boolean +static boolean not_capable() { return((boolean)(u.ulevel < MIN_QUEST_LEVEL)); @@ -114,7 +114,7 @@ not_capable() * 0 if his alignment status is too low * 1 if he is worthy */ -STATIC_OVL int +static int is_pure(talk) boolean talk; { @@ -150,7 +150,7 @@ boolean talk; * This assumes that the hero is currently _in_ the quest dungeon and that * there is a single branch to and from it. */ -STATIC_OVL void +static void expulsion(seal) boolean seal; { @@ -213,7 +213,7 @@ struct obj *obj; /* quest artifact; possibly null if carrying Amulet */ } } -STATIC_OVL void +static void chat_with_leader() { /* Rule 0: Cheater checks. */ @@ -312,7 +312,7 @@ register struct monst *mtmp; } } -STATIC_OVL void +static void chat_with_nemesis() { /* The nemesis will do most of the talking, but... */ @@ -336,7 +336,7 @@ nemesis_speaks() if(!rn2(5)) qt_pager(rn1(10, QT_DISCOURAGE)); } -STATIC_OVL void +static void chat_with_guardian() { /* These guys/gals really don't have much to say... */ @@ -346,7 +346,7 @@ chat_with_guardian() qt_pager(rn1(5, QT_GUARDTALK)); } -STATIC_OVL void +static void prisoner_speaks (mtmp) register struct monst *mtmp; { diff --git a/src/questpgr.c b/src/questpgr.c index 282856a6e..8dfdc43c9 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -17,19 +17,19 @@ /* from sp_lev.c, for deliver_splev_message() */ extern char *lev_message; -static void FDECL(Fread, (genericptr_t, int, int, dlb *)); -STATIC_DCL struct qtmsg * FDECL(construct_qtlist, (long)); -STATIC_DCL const char * NDECL(intermed); -STATIC_DCL const char * NDECL(creatorname); -STATIC_DCL const char * NDECL(neminame); -STATIC_DCL const char * NDECL(guardname); -STATIC_DCL const char * NDECL(homebase); -static void FDECL(qtext_pronoun, (CHAR_P, CHAR_P)); -STATIC_DCL struct qtmsg * FDECL(msg_in, (struct qtmsg *, int)); -STATIC_DCL void FDECL(convert_arg, (CHAR_P)); -static void FDECL(convert_line, (char *,char *)); -STATIC_DCL void FDECL(deliver_by_pline, (struct qtmsg *)); -STATIC_DCL void FDECL(deliver_by_window, (struct qtmsg *, int)); +static void Fread(genericptr_t, int, int, dlb *); +static struct qtmsg * construct_qtlist(long); +static const char * intermed(); +static const char * creatorname(); +static const char * neminame(); +static const char * guardname(); +static const char * homebase(); +static void qtext_pronoun(CHAR_P, CHAR_P); +static struct qtmsg * msg_in(struct qtmsg *, int); +static void convert_arg(CHAR_P); +static void convert_line(char *,char *); +static void deliver_by_pline(struct qtmsg *); +static void deliver_by_window(struct qtmsg *, int); static char in_line[80], cvt_buf[64], out_line[128]; static struct qtlists qt_list; @@ -38,7 +38,7 @@ static dlb *msg_file; static char nambuf[sizeof cvt_buf]; #ifdef DEBUG -static void NDECL(dump_qtlist); +static void dump_qtlist(); static void dump_qtlist() /* dump the character msg list to check appearance */ @@ -71,7 +71,7 @@ dlb *stream; } } -STATIC_OVL struct qtmsg * +static struct qtmsg * construct_qtlist(hdr_offset) long hdr_offset; { @@ -177,7 +177,7 @@ ldrname() /* return your role leader's name */ return nambuf; } -STATIC_OVL const char * +static const char * intermed() /* return your intermediate target string */ { return (urole.intermed); @@ -190,7 +190,7 @@ struct obj *otmp; return((boolean)(otmp->oartifact == urole.questarti)); } -STATIC_OVL const char * +static const char * neminame() /* return your role nemesis' name */ { int i = urole.neminum; @@ -201,7 +201,7 @@ neminame() /* return your role nemesis' name */ return nambuf; } -STATIC_OVL const char * +static const char * guardname() /* return your role leader's guard monster name */ { int i = urole.guardnum; @@ -209,7 +209,7 @@ guardname() /* return your role leader's guard monster name */ return(mons[i].mname); } -STATIC_OVL const char * +static const char * homebase() /* return your role leader's location */ { return(urole.homebase); @@ -254,7 +254,7 @@ char which; /* 'h'|'H'|'i'|'I'|'j'|'J' */ return; } -STATIC_OVL struct qtmsg * +static struct qtmsg * msg_in(qtm_list, msgnum) struct qtmsg *qtm_list; int msgnum; @@ -267,7 +267,7 @@ int msgnum; return((struct qtmsg *)0); } -STATIC_OVL void +static void convert_arg(c) char c; { @@ -342,7 +342,7 @@ char c; Strcpy(cvt_buf, str); } -STATIC_OVL void +static void convert_line(in_line, out_line) char *in_line, *out_line; { @@ -439,7 +439,7 @@ char *str; } -STATIC_OVL void +static void deliver_by_pline(qt_msg) struct qtmsg *qt_msg; { @@ -454,7 +454,7 @@ struct qtmsg *qt_msg; } -STATIC_OVL void +static void deliver_by_window(qt_msg, how) struct qtmsg *qt_msg; int how; @@ -595,7 +595,7 @@ static const char *creator_names[] = { /** Return the name of the creator deity. * The name stays the same for the running game. */ -STATIC_OVL const char * +static const char * creatorname() { if (pirateday()) { diff --git a/src/read.c b/src/read.c index 5a3be38ed..9197a7740 100644 --- a/src/read.c +++ b/src/read.c @@ -20,23 +20,23 @@ static NEARDATA const char readable[] = { COIN_CLASS, ALL_CLASSES, SCROLL_CLASS, SPBOOK_CLASS, 0 }; static const char all_count[] = { ALLOW_COUNT, ALL_CLASSES, 0 }; -static void FDECL(wand_explode, (struct obj *)); +static void wand_explode(struct obj *); #if 0 -static void NDECL(do_class_genocide); +static void do_class_genocide(); #endif -static void FDECL(stripspe, (struct obj *)); -static void FDECL(p_glow1, (struct obj *)); -static void FDECL(p_glow2, (struct obj *, const char *)); -static void FDECL(randomize, (int *, int)); -static void FDECL(forget_single_object, (int)); +static void stripspe(struct obj *); +static void p_glow1(struct obj *); +static void p_glow2(struct obj *, const char *); +static void randomize(int *, int); +static void forget_single_object(int); #if 0 -static void FDECL(forget, (int)); +static void forget(int); #endif -static int FDECL(maybe_tame, (struct monst *, struct obj *)); +static int maybe_tame(struct monst *, struct obj *); -STATIC_PTR void FDECL(do_flood, (int, int, genericptr_t)); -STATIC_PTR void FDECL(undo_flood, (int, int, genericptr_t)); -STATIC_PTR void FDECL(set_lit, (int, int, genericptr_t)); +static void do_flood(int, int, genericptr_t); +static void undo_flood(int, int, genericptr_t); +static void set_lit(int, int, genericptr_t); static boolean learn_scroll_typ(short scrolltyp, boolean verbose) @@ -1153,7 +1153,7 @@ struct obj *sobj; } /** Remove water tile at x,y. */ -STATIC_PTR void +static void undo_flood(x, y, roomcnt) int x, y; genericptr_t roomcnt; @@ -1171,7 +1171,7 @@ genericptr_t roomcnt; newsym(x, y); } -STATIC_PTR void +static void do_flood(x, y, poolcnt) int x, y; genericptr_t poolcnt; @@ -2178,7 +2178,7 @@ static struct litmon *gremlins = 0; /* * Low-level lit-field update routine. */ -STATIC_PTR void +static void set_lit(x, y, val) int x, y; genericptr_t val; diff --git a/src/rect.c b/src/rect.c index a200569f1..b0593374f 100644 --- a/src/rect.c +++ b/src/rect.c @@ -3,9 +3,9 @@ #include "hack.h" -int FDECL(get_rect_ind, (NhRect *)); +int get_rect_ind(NhRect *); -static boolean FDECL(intersect, (NhRect *, NhRect *, NhRect *)); +static boolean intersect(NhRect *, NhRect *, NhRect *); /* * In this file, we will handle the various rectangle functions we diff --git a/src/region.c b/src/region.c index 518006e56..91868450c 100644 --- a/src/region.c +++ b/src/region.c @@ -17,34 +17,33 @@ static int max_regions = 0; #define NO_CALLBACK (-1) -boolean FDECL(inside_gas_cloud, (genericptr, genericptr)); -boolean FDECL(expire_gas_cloud, (genericptr, genericptr)); -boolean FDECL(revive_cthulhu, (genericptr, genericptr)); -boolean FDECL(inside_rect, (NhRect *, int, int)); -boolean FDECL(inside_region, (NhRegion *, int, int)); -NhRegion *FDECL(create_region, (NhRect *, int)); -void FDECL(add_rect_to_reg, (NhRegion *, NhRect *)); -void FDECL(add_mon_to_reg, (NhRegion *, struct monst *)); -void FDECL(remove_mon_from_reg, (NhRegion *, struct monst *)); -boolean FDECL(mon_in_region, (NhRegion *, struct monst *)); +boolean inside_gas_cloud(genericptr, genericptr); +boolean expire_gas_cloud(genericptr, genericptr); +boolean revive_cthulhu(genericptr, genericptr); +boolean inside_rect(NhRect *, int, int); +boolean inside_region(NhRegion *, int, int); +NhRegion *create_region(NhRect *, int); +void add_rect_to_reg(NhRegion *, NhRect *); +void add_mon_to_reg(NhRegion *, struct monst *); +void remove_mon_from_reg(NhRegion *, struct monst *); +boolean mon_in_region(NhRegion *, struct monst *); #if 0 -NhRegion *FDECL(clone_region, (NhRegion *)); +NhRegion *clone_region(NhRegion *); #endif -void FDECL(free_region, (NhRegion *)); -void FDECL(add_region, (NhRegion *)); -void FDECL(remove_region, (NhRegion *)); +void free_region(NhRegion *); +void add_region(NhRegion *); +void remove_region(NhRegion *); #if 0 -void FDECL(replace_mon_regions, (struct monst *, struct monst *)); -void FDECL(remove_mon_from_regions, (struct monst *)); -NhRegion *FDECL(create_msg_region, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, - const char *, const char *)); -boolean FDECL(enter_force_field, (genericptr, genericptr)); -NhRegion *FDECL(create_force_field, (XCHAR_P, XCHAR_P, int, int)); +void replace_mon_regions(struct monst *, struct monst *); +void remove_mon_from_regions(struct monst *); +NhRegion *create_msg_region(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, const char *, const char *); +boolean enter_force_field(genericptr, genericptr); +NhRegion *create_force_field(XCHAR_P, XCHAR_P, int, int); #endif -static void FDECL(reset_region_mids, (NhRegion *)); +static void reset_region_mids(NhRegion *); static callback_proc callbacks[] = { #define INSIDE_GAS_CLOUD 0 diff --git a/src/restore.c b/src/restore.c index 8159a2625..7ad62d3c9 100644 --- a/src/restore.c +++ b/src/restore.c @@ -12,26 +12,26 @@ extern int dotrow; /* shared with save */ #endif #ifdef USE_TILES -extern void FDECL(substitute_tiles, (d_level *)); /* from tile.c */ +extern void substitute_tiles(d_level *); /* from tile.c */ #endif #ifdef ZEROCOMP -static int NDECL(mgetc); +static int mgetc(); #endif -STATIC_DCL void NDECL(find_lev_obj); -STATIC_DCL void FDECL(restlevchn, (int)); -STATIC_DCL void FDECL(restdamage, (int, BOOLEAN_P)); -STATIC_DCL void FDECL(restobj, (int, struct obj *)); -STATIC_DCL struct obj *FDECL(restobjchn, (int, BOOLEAN_P, BOOLEAN_P)); -STATIC_OVL void FDECL(restmon, (int, struct monst *)); -STATIC_DCL struct monst *FDECL(restmonchn, (int, BOOLEAN_P)); -STATIC_DCL struct fruit *FDECL(loadfruitchn, (int)); -STATIC_DCL void FDECL(freefruitchn, (struct fruit *)); -STATIC_DCL void FDECL(ghostfruit, (struct obj *)); -STATIC_DCL boolean FDECL(restgamestate, (int, unsigned int *, unsigned int *)); -STATIC_DCL void FDECL(restlevelstate, (unsigned int, unsigned int)); -STATIC_DCL int FDECL(restlevelfile, (int, XCHAR_P)); -STATIC_DCL void FDECL(reset_oattached_mids, (BOOLEAN_P)); +static void find_lev_obj(); +static void restlevchn(int); +static void restdamage(int, BOOLEAN_P); +static void restobj(int, struct obj *); +static struct obj *restobjchn(int, BOOLEAN_P, BOOLEAN_P); +static void restmon(int, struct monst *); +static struct monst *restmonchn(int, BOOLEAN_P); +static struct fruit *loadfruitchn(int); +static void freefruitchn(struct fruit *); +static void ghostfruit(struct obj *); +static boolean restgamestate(int, unsigned int *, unsigned int *); +static void restlevelstate(unsigned int, unsigned int); +static int restlevelfile(int, XCHAR_P); +static void reset_oattached_mids(BOOLEAN_P); /* * Save a mapping of IDs from ghost levels to the current level. This @@ -46,15 +46,15 @@ struct bucket { } map[N_PER_BUCKET]; }; -STATIC_DCL void NDECL(clear_id_mapping); -STATIC_DCL void FDECL(add_id_mapping, (unsigned, unsigned)); +static void clear_id_mapping(); +static void add_id_mapping(unsigned, unsigned); static int n_ids_mapped = 0; static struct bucket *id_map = 0; #ifdef AMII_GRAPHICS -void FDECL( amii_setpens, (int) ); /* use colors from save file */ +void amii_setpens(int) ; /* use colors from save file */ extern int amii_numcolors; #endif @@ -67,7 +67,7 @@ static NEARDATA long omoves; #define Is_IceBox(o) ((o)->otyp == ICE_BOX ? TRUE : FALSE) /* Recalculate level.objects[x][y], since this info was not saved. */ -STATIC_OVL void +static void find_lev_obj() { register struct obj *fobjtmp = (struct obj *)0; @@ -115,7 +115,7 @@ boolean quietly; } } -STATIC_OVL void +static void restlevchn(fd) register int fd; { @@ -138,7 +138,7 @@ register int fd; } } -STATIC_OVL void +static void restdamage(fd, ghostly) int fd; boolean ghostly; @@ -239,7 +239,7 @@ register int fd; } /* restore one object */ -STATIC_OVL void +static void restobj(fd, otmp) int fd; struct obj *otmp; @@ -293,7 +293,7 @@ struct obj *otmp; } } -STATIC_OVL struct obj * +static struct obj * restobjchn(fd, ghostly, frozen) register int fd; boolean ghostly, frozen; @@ -385,7 +385,7 @@ boolean ghostly, frozen; } /* restore one monster */ -STATIC_OVL void +static void restmon(fd, mtmp) int fd; struct monst *mtmp; @@ -442,7 +442,7 @@ struct monst *mtmp; } /* mextra */ } -STATIC_OVL struct monst * +static struct monst * restmonchn(fd, ghostly) register int fd; boolean ghostly; @@ -517,7 +517,7 @@ boolean ghostly; return first; } -STATIC_OVL struct fruit * +static struct fruit * loadfruitchn(fd) int fd; { @@ -534,7 +534,7 @@ int fd; return flist; } -STATIC_OVL void +static void freefruitchn(flist) register struct fruit *flist; { @@ -547,7 +547,7 @@ register struct fruit *flist; } } -STATIC_OVL void +static void ghostfruit(otmp) register struct obj *otmp; { @@ -560,8 +560,7 @@ register struct obj *otmp; else otmp->spe = fruitadd(oldf->fname); } -STATIC_OVL -boolean +static boolean restgamestate(fd, stuckid, steedid) register int fd; unsigned int *stuckid, *steedid; /* STEED */ @@ -668,7 +667,7 @@ unsigned int *stuckid, *steedid; /* STEED */ /* update game state pointers to those valid for the current level (so we * don't dereference a wild u.ustuck when saving the game state, for instance) */ -STATIC_OVL void +static void restlevelstate(stuckid, steedid) unsigned int stuckid, steedid; /* STEED */ { @@ -691,7 +690,7 @@ unsigned int stuckid, steedid; /* STEED */ } /*ARGSUSED*/ /* fd used in MFLOPPY only */ -STATIC_OVL int +static int restlevelfile(fd, ltmp) int fd UNUSED; xchar ltmp; @@ -1175,7 +1174,7 @@ boolean ghostly; /* Clear all structures for object and monster ID mapping. */ -STATIC_OVL void +static void clear_id_mapping() { struct bucket *curr; @@ -1188,7 +1187,7 @@ clear_id_mapping() } /* Add a mapping to the ID map. */ -STATIC_OVL void +static void add_id_mapping(gid, nid) unsigned gid, nid; { @@ -1239,7 +1238,7 @@ unsigned gid, *nidp; return FALSE; } -STATIC_OVL void +static void reset_oattached_mids(ghostly) boolean ghostly; { diff --git a/src/rip.c b/src/rip.c index 2548955a2..d0a4943a6 100644 --- a/src/rip.c +++ b/src/rip.c @@ -15,7 +15,7 @@ extern const char * const killed_by_prefix[]; /* from topten.c */ #endif #ifdef TEXT_TOMBSTONE -static void FDECL(center, (int, char *)); +static void center(int, char *); #ifndef NH320_DEDICATION /* A normal tombstone for end of game display. */ @@ -70,7 +70,7 @@ static const char *rip_txt[] = { static char **rip; -STATIC_OVL void +static void center(line, text) int line; char *text; diff --git a/src/role.c b/src/role.c index 34010006f..91fe0f560 100644 --- a/src/role.c +++ b/src/role.c @@ -576,10 +576,10 @@ static struct { short mask; } rfilter; -static int NDECL(randrole_filtered); -STATIC_DCL char * FDECL(promptsep, (char *, int)); -STATIC_DCL int FDECL(role_gendercount, (int)); -STATIC_DCL int FDECL(race_alignmentcount, (int)); +static int randrole_filtered(); +static char * promptsep(char *, int); +static int role_gendercount(int); +static int race_alignmentcount(int); /* used by str2XXX() */ static char NEARDATA randomstr[] = "random"; @@ -1254,9 +1254,9 @@ clearrolefilter() #define BP_ROLE 3 #define NUM_BP 4 -STATIC_VAR char pa[NUM_BP], post_attribs; +static char pa[NUM_BP], post_attribs; -STATIC_OVL char * +static char * promptsep(buf, num_post_attribs) char *buf; int num_post_attribs; @@ -1272,7 +1272,7 @@ int num_post_attribs; return buf; } -STATIC_OVL int +static int role_gendercount(rolenum) int rolenum; { @@ -1285,7 +1285,7 @@ int rolenum; return gendcount; } -STATIC_OVL int +static int race_alignmentcount(racenum) int racenum; { diff --git a/src/rumors.c b/src/rumors.c index a863f9304..21680f33d 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -39,8 +39,8 @@ * and placed there by 'makedefs'. */ -STATIC_DCL void FDECL(init_rumors, (dlb *)); -STATIC_DCL void FDECL(init_oracles, (dlb *)); +static void init_rumors(dlb *); +static void init_oracles(dlb *); /* rumor size variables are signed so that value -1 can be used as a flag */ static long true_rumor_size = 0L, false_rumor_size; @@ -53,7 +53,7 @@ static int oracle_flg = 0; /* -1=>don't use, 0=>need init, 1=>init done */ static unsigned oracle_cnt = 0; static long *oracle_loc = 0; -STATIC_OVL void +static void init_rumors(fp) dlb *fp; { @@ -195,7 +195,7 @@ int mechanism; pline("%s", line); } -STATIC_OVL void +static void init_oracles(fp) dlb *fp; { diff --git a/src/save.c b/src/save.c index 246989d6d..211e1ce69 100644 --- a/src/save.c +++ b/src/save.c @@ -23,22 +23,22 @@ int dotcnt, dotrow; /* also used in restore */ #endif #ifdef ZEROCOMP -STATIC_DCL void FDECL(bputc, (int)); +static void bputc(int); #endif -STATIC_DCL void FDECL(savelevchn, (int, int)); -STATIC_DCL void FDECL(savedamage, (int, int)); -STATIC_DCL void FDECL(saveobj, (int, struct obj *)); -STATIC_DCL void FDECL(saveobjchn, (int, struct obj *, int)); -STATIC_DCL void FDECL(savemon, (int, struct monst *)); -STATIC_DCL void FDECL(savemonchn, (int, struct monst *, int)); -STATIC_DCL void FDECL(savetrapchn, (int, struct trap *, int)); -STATIC_DCL void FDECL(savegamestate, (int, int)); -void FDECL(save_mongen_override, (int, struct mon_gen_override *, int)); -void FDECL(save_lvl_sounds, (int, struct lvl_sounds *, int)); +static void savelevchn(int, int); +static void savedamage(int, int); +static void saveobj(int, struct obj *); +static void saveobjchn(int, struct obj *, int); +static void savemon(int, struct monst *); +static void savemonchn(int, struct monst *, int); +static void savetrapchn(int, struct trap *, int); +static void savegamestate(int, int); +void save_mongen_override(int, struct mon_gen_override *, int); +void save_lvl_sounds(int, struct lvl_sounds *, int); #ifdef MFLOPPY -STATIC_DCL void FDECL(savelev0, (int, XCHAR_P, int)); -STATIC_DCL boolean NDECL(swapout_oldest); -STATIC_DCL void FDECL(copyfile, (char *, char *)); +static void savelev0(int, XCHAR_P, int); +static boolean swapout_oldest(); +static void copyfile(char *, char *); #endif /* MFLOPPY */ #ifdef GCC_WARN static long nulls[10]; @@ -306,7 +306,7 @@ dosave0() return(1); } -STATIC_OVL void +static void savegamestate(fd, mode) register int fd, mode; { @@ -477,7 +477,7 @@ int mode; return TRUE; } -STATIC_OVL void +static void savelev0(fd, lev, mode) #else void @@ -672,7 +672,7 @@ static NEARDATA boolean compressing = FALSE; HUP printf("outbufp %d outrunlength %d\n", outbufp,outrunlength); }*/ -STATIC_OVL void +static void bputc(c) int c; { @@ -881,7 +881,7 @@ int fd; } #endif /* ZEROCOMP */ -STATIC_OVL void +static void savelevchn(fd, mode) register int fd, mode; { @@ -932,7 +932,7 @@ struct cemetery **cemeteryaddr; } } -STATIC_OVL void +static void savedamage(fd, mode) register int fd, mode; { @@ -1029,7 +1029,7 @@ register struct lvl_sounds *or; } } -STATIC_OVL void +static void saveobj(fd, otmp) int fd; struct obj *otmp; @@ -1069,7 +1069,7 @@ struct obj *otmp; } } -STATIC_OVL void +static void saveobjchn(fd, otmp, mode) register int fd, mode; register struct obj *otmp; @@ -1118,7 +1118,7 @@ register struct obj *otmp; bwrite(fd, (genericptr_t) &minusone, sizeof (int)); } -STATIC_OVL void +static void savemon(fd, mtmp) int fd; struct monst *mtmp; @@ -1167,7 +1167,7 @@ struct monst *mtmp; } } -STATIC_OVL void +static void savemonchn(fd, mtmp, mode) register int fd, mode; register struct monst *mtmp; @@ -1199,7 +1199,7 @@ register struct monst *mtmp; bwrite(fd, (genericptr_t) &minusone, sizeof (int)); } -STATIC_OVL void +static void savetrapchn(fd, trap, mode) register int fd, mode; register struct trap *trap; @@ -1389,7 +1389,7 @@ int lev; return TRUE; } -STATIC_OVL boolean +static boolean swapout_oldest() { char to[PATHLEN], from[PATHLEN]; int i, oldest; @@ -1421,7 +1421,7 @@ swapout_oldest() { return TRUE; } -STATIC_OVL void +static void copyfile(from, to) char *from, *to; { diff --git a/src/shk.c b/src/shk.c index 44e0fae88..161d6838d 100644 --- a/src/shk.c +++ b/src/shk.c @@ -13,9 +13,9 @@ #define PAY_BROKE (-2) #ifdef KOPS -STATIC_DCL void FDECL(makekops, (coord *)); -STATIC_DCL void FDECL(call_kops, (struct monst *, BOOLEAN_P)); -STATIC_DCL void FDECL(kops_gone, (BOOLEAN_P)); +static void makekops(coord *); +static void call_kops(struct monst *, BOOLEAN_P); +static void kops_gone(BOOLEAN_P); #endif /* KOPS */ #define NOTANGRY(mon) ((mon)->mpeaceful) @@ -33,49 +33,45 @@ muteshk(struct monst *shkp) extern const struct shclass shtypes[]; /* defined in shknam.c */ extern struct obj *thrownobj; /* defined in dothrow.c */ -STATIC_VAR NEARDATA long int followmsg; /* last time of follow message */ +static NEARDATA long int followmsg; /* last time of follow message */ static const char and_its_contents[] = " and its contents"; static const char the_contents_of[] = "the contents of "; -STATIC_DCL void FDECL(setpaid, (struct monst *)); -STATIC_DCL long FDECL(addupbill, (struct monst *)); -STATIC_DCL void FDECL(pacify_shk, (struct monst *)); -STATIC_DCL struct bill_x *FDECL(onbill, (struct obj *, struct monst *, BOOLEAN_P)); -STATIC_DCL struct monst *FDECL(next_shkp, (struct monst *, BOOLEAN_P)); -STATIC_DCL long FDECL(shop_debt, (struct eshk *)); -STATIC_DCL char *FDECL(shk_owns, (char *, struct obj *)); -STATIC_DCL char *FDECL(mon_owns, (char *, struct obj *)); -static void FDECL(clear_unpaid_obj, (struct monst *, struct obj *)); -static void FDECL(clear_unpaid, (struct monst *, struct obj *)); -STATIC_DCL long FDECL(check_credit, (long, struct monst *)); -STATIC_DCL void FDECL(pay, (long, struct monst *)); -STATIC_DCL long FDECL(get_cost, (struct obj *, struct monst *)); -STATIC_DCL long FDECL(set_cost, (struct obj *, struct monst *)); -STATIC_DCL const char *FDECL(shk_embellish, (struct obj *, long)); -STATIC_DCL long FDECL(cost_per_charge, (struct monst *, struct obj *, BOOLEAN_P)); -STATIC_DCL long FDECL(cheapest_item, (struct monst *)); -STATIC_DCL int FDECL(dopayobj, (struct monst *, struct bill_x *, - struct obj **, int, BOOLEAN_P)); -STATIC_DCL long FDECL(stolen_container, (struct obj *, struct monst *, long, - BOOLEAN_P)); -STATIC_DCL long FDECL(getprice, (struct obj *, BOOLEAN_P)); -STATIC_DCL void FDECL(shk_names_obj, - (struct monst *, struct obj *, const char *, long, const char *)); -STATIC_DCL struct obj *FDECL(bp_to_obj, (struct bill_x *)); -static boolean FDECL(inherits, (struct monst *, int, int, BOOLEAN_P)); -static void FDECL(set_repo_loc, (struct monst *)); -STATIC_DCL boolean NDECL(angry_shk_exists); -STATIC_DCL void FDECL(rile_shk, (struct monst *)); -STATIC_DCL void FDECL(rouse_shk, (struct monst *, BOOLEAN_P)); -STATIC_DCL void FDECL(remove_damage, (struct monst *, BOOLEAN_P)); -STATIC_DCL void FDECL(sub_one_frombill, (struct obj *, struct monst *)); -static void FDECL(add_one_tobill, (struct obj *, BOOLEAN_P, struct monst *)); -STATIC_DCL void FDECL(dropped_container, (struct obj *, struct monst *, - BOOLEAN_P)); -static void FDECL(add_to_billobjs, (struct obj *)); -static boolean FDECL(rob_shop, (struct monst *)); -static boolean FDECL(special_stock, (struct obj *, struct monst *, BOOLEAN_P)); -static const char *FDECL(cad, (BOOLEAN_P)); +static void setpaid(struct monst *); +static long addupbill(struct monst *); +static void pacify_shk(struct monst *); +static struct bill_x *onbill(struct obj *, struct monst *, BOOLEAN_P); +static struct monst *next_shkp(struct monst *, BOOLEAN_P); +static long shop_debt(struct eshk *); +static char *shk_owns(char *, struct obj *); +static char *mon_owns(char *, struct obj *); +static void clear_unpaid_obj(struct monst *, struct obj *); +static void clear_unpaid(struct monst *, struct obj *); +static long check_credit(long, struct monst *); +static void pay(long, struct monst *); +static long get_cost(struct obj *, struct monst *); +static long set_cost(struct obj *, struct monst *); +static const char *shk_embellish(struct obj *, long); +static long cost_per_charge(struct monst *, struct obj *, BOOLEAN_P); +static long cheapest_item(struct monst *); +static int dopayobj(struct monst *, struct bill_x *, struct obj **, int, BOOLEAN_P); +static long stolen_container(struct obj *, struct monst *, long, BOOLEAN_P); +static long getprice(struct obj *, BOOLEAN_P); +static void shk_names_obj(struct monst *, struct obj *, const char *, long, const char *); +static struct obj *bp_to_obj(struct bill_x *); +static boolean inherits(struct monst *, int, int, BOOLEAN_P); +static void set_repo_loc(struct monst *); +static boolean angry_shk_exists(); +static void rile_shk(struct monst *); +static void rouse_shk(struct monst *, BOOLEAN_P); +static void remove_damage(struct monst *, BOOLEAN_P); +static void sub_one_frombill(struct obj *, struct monst *); +static void add_one_tobill(struct obj *, BOOLEAN_P, struct monst *); +static void dropped_container(struct obj *, struct monst *, BOOLEAN_P); +static void add_to_billobjs(struct obj *); +static boolean rob_shop(struct monst *); +static boolean special_stock(struct obj *, struct monst *, BOOLEAN_P); +static const char *cad(BOOLEAN_P); /* invariants: obj->unpaid iff onbill(obj) [unless bp->useup] @@ -158,7 +154,7 @@ long amount; } } -STATIC_OVL struct monst * +static struct monst * next_shkp(shkp, withbill) register struct monst *shkp; register boolean withbill; @@ -316,7 +312,7 @@ register struct monst *shkp; } } -STATIC_OVL long +static long addupbill(shkp) register struct monst *shkp; { @@ -332,7 +328,7 @@ register struct monst *shkp; } #ifdef KOPS -STATIC_OVL void +static void call_kops(shkp, nearshop) register struct monst *shkp; register boolean nearshop; @@ -935,7 +931,7 @@ struct obj *obj1, *obj2; * turning the `$' command into a way to discover that the current * level is bones data which has a shk on the warpath. */ -STATIC_OVL long +static long shop_debt(eshkp) struct eshk *eshkp; { @@ -1038,7 +1034,7 @@ struct mkroom *sroom; return((boolean)(inhishop(mtmp))); } -STATIC_OVL struct bill_x * +static struct bill_x * onbill(obj, shkp, silent) register struct obj *obj; register struct monst *shkp; @@ -1176,7 +1172,7 @@ register struct obj *obj, *merge; dealloc_obj(obj); } -STATIC_OVL long +static long check_credit(tmp, shkp) long tmp; register struct monst *shkp; @@ -1197,7 +1193,7 @@ register struct monst *shkp; return(tmp); } -STATIC_OVL void +static void pay(tmp, shkp) long tmp; register struct monst *shkp; @@ -1237,7 +1233,7 @@ register boolean killkops; after_shk_move(shkp); } -STATIC_OVL boolean +static boolean angry_shk_exists() { register struct monst *shkp; @@ -1249,7 +1245,7 @@ angry_shk_exists() } /* remove previously applied surcharge from all billed items */ -STATIC_OVL void +static void pacify_shk(shkp) register struct monst *shkp; { @@ -1268,7 +1264,7 @@ register struct monst *shkp; } /* add aggravation surcharge to all billed items */ -STATIC_OVL void +static void rile_shk(shkp) register struct monst *shkp; { @@ -1287,7 +1283,7 @@ register struct monst *shkp; } /* wakeup and/or unparalyze shopkeeper */ -STATIC_OVL void +static void rouse_shk(shkp, verbosely) struct monst *shkp; boolean verbosely; @@ -1393,12 +1389,12 @@ xchar oy UNUSED; hot_pursuit(shkp); } -STATIC_VAR const char no_money[] = "Moreover, you%s have no money."; -STATIC_VAR const char not_enough_money[] = +static const char no_money[] = "Moreover, you%s have no money."; +static const char not_enough_money[] = "Besides, you don't have enough to interest %s."; /* delivers the cheapest item on the list */ -STATIC_OVL long +static long cheapest_item(shkp) register struct monst *shkp; { @@ -1768,7 +1764,7 @@ dopay() /* 0 if not enough money */ /* -1 if skip this object */ /* -2 if no money/credit left */ -STATIC_OVL int +static int dopayobj(shkp, bp, obj_p, which, itemize) register struct monst *shkp; register struct bill_x *bp; @@ -1972,7 +1968,7 @@ boolean silently; /* maybe avoid messages */ return taken; } -STATIC_OVL boolean +static boolean inherits(shkp, numsk, croaked, silently) struct monst *shkp; int numsk; @@ -2081,7 +2077,7 @@ boolean silently; return(taken); } -STATIC_OVL void +static void set_repo_loc(shkp) struct monst *shkp; { @@ -2140,7 +2136,7 @@ finish_paybill() } /* find obj on one of the lists */ -STATIC_OVL struct obj * +static struct obj * bp_to_obj(bp) register struct bill_x *bp; { @@ -2231,7 +2227,7 @@ register struct obj *obj; return cost; } /* calculate the value that the shk will charge for [one of] an object */ -STATIC_OVL long +static long get_cost(obj, shkp) register struct obj *obj; register struct monst *shkp; /* if angry, impose a surcharge */ @@ -2396,7 +2392,7 @@ struct obj *obj; return(value); } -STATIC_OVL void +static void dropped_container(obj, shkp, sale) register struct obj *obj; register struct monst *shkp; @@ -2474,7 +2470,7 @@ boolean quietly; } /* calculate how much the shk will pay when buying [all of] an object */ -STATIC_OVL long +static long set_cost(obj, shkp) register struct obj *obj; register struct monst *shkp; @@ -2613,7 +2609,7 @@ boolean include_contents; return amt; } -STATIC_OVL void +static void add_one_tobill(obj, dummy, shkp) struct obj *obj; boolean dummy; @@ -2654,7 +2650,7 @@ struct monst *shkp; obj->unpaid = 1; } -STATIC_OVL void +static void add_to_billobjs(obj) struct obj *obj; { @@ -2696,7 +2692,7 @@ struct monst *shkp; } /* shopkeeper tells you what you bought or sold, sometimes partly IDing it */ -STATIC_OVL void +static void shk_names_obj(shkp, obj, fmt, amt, arg) struct monst *shkp; struct obj *obj; @@ -2938,7 +2934,7 @@ register struct obj *obj, *otmp; } } -STATIC_OVL void +static void sub_one_frombill(obj, shkp) register struct obj *obj; register struct monst *shkp; @@ -3000,7 +2996,7 @@ register struct monst *shkp; } } -STATIC_OVL long +static long stolen_container(obj, shkp, price, ininv) struct obj *obj; struct monst *shkp; @@ -3529,7 +3525,7 @@ int mode; /* 0: deliver count 1: paged */ return(0); } -STATIC_OVL long +static long getprice(obj, shk_buying) register struct obj *obj; boolean shk_buying; @@ -3648,8 +3644,7 @@ long cost; * assumption (they might all be dead too), but we have no reasonable way of * telling that. */ -STATIC_OVL -void +static void remove_damage(shkp, croaked) struct monst *shkp; boolean croaked; @@ -4181,7 +4176,7 @@ register int fall; #ifdef KOPS /* modified by M. Campostrini (campo@sunthpi3.difi.unipi.it) */ /* to allow for multiple choices of kops */ -STATIC_OVL void +static void makekops(mm) coord *mm; { @@ -4510,7 +4505,7 @@ register struct obj *first_obj; destroy_nhwindow(tmpwin); } -STATIC_OVL const char * +static const char * shk_embellish(itm, cost) register struct obj *itm; long cost; @@ -4659,7 +4654,7 @@ struct monst *shkp; } #ifdef KOPS -STATIC_OVL void +static void kops_gone(silent) register boolean silent; { @@ -4679,7 +4674,7 @@ register boolean silent; } #endif /* KOPS */ -STATIC_OVL long +static long cost_per_charge(shkp, otmp, altusage) struct monst *shkp; struct obj *otmp; @@ -4920,7 +4915,7 @@ struct obj *obj; return buf; } -STATIC_OVL char * +static char * shk_owns(buf, obj) char *buf; struct obj *obj; @@ -4937,7 +4932,7 @@ struct obj *obj; return (char *)0; } -STATIC_OVL char * +static char * mon_owns(buf, obj) char *buf; struct obj *obj; diff --git a/src/shknam.c b/src/shknam.c index fe66b066c..8fcf02645 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -5,12 +5,11 @@ #include "hack.h" -STATIC_DCL boolean FDECL(stock_room_goodpos, (struct mkroom *, int, int, int, int)); -STATIC_DCL void FDECL(nameshk, (struct monst *, const char * const *)); -STATIC_DCL int FDECL(shkinit, (const struct shclass *, struct mkroom *)); +static boolean stock_room_goodpos(struct mkroom *, int, int, int, int); +static void nameshk(struct monst *, const char * const *); +static int shkinit(const struct shclass *, struct mkroom *); #ifdef BLACKMARKET -STATIC_DCL void FDECL(stock_blkmar, - (const struct shclass *, struct mkroom *, int)); +static void stock_blkmar(const struct shclass *, struct mkroom *, int); #endif /* BLACKMARKET */ /* @@ -301,7 +300,7 @@ shop_selection_init() } /* make an object of the appropriate type for a shop square */ -STATIC_OVL void +static void mkshobj_at(const struct shclass *shp, int sx, int sy, int color) { struct monst *mtmp; @@ -347,7 +346,7 @@ mkshobj_at(const struct shclass *shp, int sx, int sy, int color) } /* extract a shopkeeper name for the given shop type */ -STATIC_OVL void +static void nameshk(shk, nlp) struct monst *shk; const char * const *nlp; @@ -477,7 +476,7 @@ struct monst *mtmp; } /* create a new shopkeeper in the given room */ -STATIC_OVL int +static int shkinit(shp, sroom) const struct shclass *shp; struct mkroom *sroom; @@ -639,7 +638,7 @@ struct mkroom *sroom; return(sh); } -STATIC_OVL boolean +static boolean stock_room_goodpos(sroom, rmno, sh, sx, sy) struct mkroom *sroom; int rmno, sh, sx,sy; diff --git a/src/sit.c b/src/sit.c index c87cdf5e1..d6edd96b4 100644 --- a/src/sit.c +++ b/src/sit.c @@ -4,7 +4,7 @@ #include "hack.h" #include "artifact.h" -STATIC_DCL void FDECL(curse_objects, (struct obj *, int, boolean)); +static void curse_objects(struct obj *, int, boolean); /* take away the hero's money */ void diff --git a/src/sounds.c b/src/sounds.c index fbbceacf3..cd24ff9f2 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -9,10 +9,10 @@ # endif #endif -static int FDECL(domonnoise, (struct monst *)); -static int NDECL(dochat); +static int domonnoise(struct monst *); +static int dochat(); -static int FDECL(mon_in_room, (struct monst *, int)); +static int mon_in_room(struct monst *, int); /* this easily could be a macro, but it might overtax dumb compilers */ static int @@ -1276,7 +1276,7 @@ dochat() #ifdef USER_SOUNDS -extern void FDECL(play_usersound, (const char*, int)); +extern void play_usersound(const char*, int); typedef struct audio_mapping_rec { #ifdef USER_SOUNDS_REGEX diff --git a/src/sp_lev.c b/src/sp_lev.c index cd42b30c8..6a54d837b 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -24,25 +24,24 @@ #include "rect.h" -extern void FDECL(mkmap, (lev_init *)); - -STATIC_DCL void FDECL(get_room_loc, (schar *, schar *, struct mkroom *)); -STATIC_DCL void FDECL(get_free_room_loc, (schar *, schar *, struct mkroom *, packed_coord)); -STATIC_DCL void FDECL(create_trap, (trap *, struct mkroom *)); -STATIC_DCL int FDECL(noncoalignment, (ALIGNTYP_P)); -STATIC_DCL void FDECL(create_monster, (monster *, struct mkroom *)); -STATIC_DCL void FDECL(create_object, (object *, struct mkroom *)); -STATIC_DCL void FDECL(create_altar, (altar *, struct mkroom *)); -STATIC_DCL boolean FDECL(search_door, (struct mkroom *, xchar *, xchar *, - XCHAR_P, int)); -STATIC_DCL void NDECL(fix_stair_rooms); -STATIC_DCL void FDECL(create_corridor, (corridor *)); -STATIC_DCL void NDECL(count_features); - -STATIC_DCL boolean FDECL(create_subroom, (struct mkroom *, XCHAR_P, XCHAR_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); - -long FDECL(opvar_array_length, (struct sp_coder *)); +extern void mkmap(lev_init *); + +static void get_room_loc(schar *, schar *, struct mkroom *); +static void get_free_room_loc(schar *, schar *, struct mkroom *, packed_coord); +static void create_trap(trap *, struct mkroom *); +static int noncoalignment(ALIGNTYP_P); +static void create_monster(monster *, struct mkroom *); +static void create_object(object *, struct mkroom *); +static void create_altar(altar *, struct mkroom *); +static boolean search_door(struct mkroom *, xchar *, xchar *, XCHAR_P, int); +static void fix_stair_rooms(); +static void create_corridor(corridor *); +static void count_features(); + +static boolean create_subroom(struct mkroom *, XCHAR_P, XCHAR_P, + XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); + +long opvar_array_length(struct sp_coder *); #define LEFT 1 #define H_LEFT 2 @@ -75,15 +74,15 @@ static aligntyp ralign[3] = { AM_CHAOTIC, AM_NEUTRAL, AM_LAWFUL }; static NEARDATA xchar xstart, ystart; static NEARDATA char xsize, ysize; -STATIC_DCL void FDECL(set_wall_property, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, int)); -STATIC_DCL int NDECL(rnddoor); -STATIC_DCL int NDECL(rndtrap); -STATIC_DCL void FDECL(get_location, (schar *, schar *, int, struct mkroom *)); -STATIC_DCL void FDECL(light_region, (region *)); -STATIC_DCL void FDECL(maze1xy, (coord *, int)); -STATIC_DCL boolean FDECL(sp_level_loader, (dlb *, sp_lev *)); -STATIC_DCL void FDECL(create_door, (room_door *, struct mkroom *)); -STATIC_DCL struct mkroom *FDECL(build_room, (room *, struct mkroom *)); +static void set_wall_property(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, int); +static int rnddoor(); +static int rndtrap(); +static void get_location(schar *, schar *, int, struct mkroom *); +static void light_region(region *); +static void maze1xy(coord *, int); +static boolean sp_level_loader(dlb *, sp_lev *); +static void create_door(room_door *, struct mkroom *); +static struct mkroom *build_room(room *, struct mkroom *); char *lev_message = 0; lev_region *lregions = 0; @@ -886,7 +885,7 @@ flip_level_rnd(int flp) /* * Make walls of the area (x1, y1, x2, y2) non diggable/non passwall-able */ -STATIC_OVL void +static void set_wall_property(x1, y1, x2, y2, prop) xchar x1, y1, x2, y2; int prop; @@ -911,7 +910,7 @@ int prop; } } -STATIC_OVL void +static void shuffle_alignments() { int i; @@ -924,7 +923,7 @@ shuffle_alignments() /* * Count the different features (sinks, fountains) in the level. */ -STATIC_OVL void +static void count_features() { xchar x, y; @@ -1072,7 +1071,7 @@ fill_rooms() /* * Choose randomly the state (nodoor, open, closed or locked) for a door */ -STATIC_OVL int +static int rnddoor() { int i = 1 << rn2(5); @@ -1084,7 +1083,7 @@ rnddoor() /* * Select a random trap */ -STATIC_OVL int +static int rndtrap() { int rtrap; @@ -1116,9 +1115,9 @@ rndtrap() * The "humidity" flag is used to insure that engravings aren't * created underwater, or eels on dry land. */ -STATIC_DCL boolean FDECL(is_ok_location, (SCHAR_P, SCHAR_P, int)); +static boolean is_ok_location(SCHAR_P, SCHAR_P, int); -STATIC_OVL void +static void get_location(x, y, humidity, croom) schar *x, *y; int humidity; @@ -1184,7 +1183,7 @@ found_it:; } } -STATIC_OVL boolean +static boolean is_ok_location(x, y, humidity) register schar x, y; register int humidity; @@ -1232,7 +1231,7 @@ int defhumidity; return c; } -STATIC_OVL void +static void get_location_coord(x, y, humidity, croom, crd) schar *x, *y; int humidity; @@ -1255,7 +1254,7 @@ long crd; * negative values for x or y means RANDOM! */ -STATIC_OVL void +static void get_room_loc(x, y, croom) schar *x, *y; struct mkroom *croom; @@ -1283,7 +1282,7 @@ struct mkroom *croom; * negative values for x or y means RANDOM! */ -STATIC_OVL void +static void get_free_room_loc(x, y, croom, pos) schar *x, *y; struct mkroom *croom; @@ -1551,7 +1550,7 @@ xchar rtype, rlit; * Create a subroom in room proom at pos x,y with width w & height h. * x & y are relative to the parent room. */ -STATIC_OVL boolean +static boolean create_subroom(proom, x, y, w, h, rtype, rlit) struct mkroom *proom; xchar x, y; @@ -1599,7 +1598,7 @@ xchar rtype, rlit; * Create a new door in a room. * It's placed on a wall (north, south, east or west). */ -STATIC_OVL void +static void create_door(dd, broom) room_door *dd; struct mkroom *broom; @@ -1731,7 +1730,7 @@ xchar walls; /* any of W_NORTH | W_SOUTH | W_EAST | W_WEST (or W_ANY) */ /* * Create a trap in a room. */ -STATIC_OVL void +static void create_trap(t, croom) trap *t; struct mkroom *croom; @@ -1755,7 +1754,7 @@ struct mkroom *croom; mktrap(t->type, 1, (struct mkroom*) 0, &tm); } -STATIC_OVL void +static void spill_terrain(sp, croom) spill* sp; struct mkroom* croom; @@ -1836,7 +1835,7 @@ struct mkroom* croom; /* * Create a monster in a room. */ -STATIC_OVL int +static int noncoalignment(alignment) aligntyp alignment; { @@ -1896,7 +1895,7 @@ struct permonst *pm; return loc; } -STATIC_OVL void +static void create_monster(m, croom) monster *m; struct mkroom *croom; @@ -2145,7 +2144,7 @@ struct mkroom *croom; /* * Create an object in a room. */ -STATIC_OVL void +static void create_object(o, croom) object *o; struct mkroom *croom; @@ -2383,7 +2382,7 @@ struct mkroom *croom; /* * Create an altar in a room. */ -STATIC_OVL void +static void create_altar(a, croom) altar *a; struct mkroom *croom; @@ -2465,7 +2464,7 @@ struct mkroom *croom; /* * Search for a door in a room on a specified wall. */ -STATIC_OVL boolean +static boolean search_door(croom, x, y, wall, cnt) struct mkroom *croom; xchar *x, *y; @@ -2635,7 +2634,7 @@ schar ftyp, btyp; * and dnstairs_room after the rooms have been sorted. On normal levels, * stairs don't get created until _after_ sorting takes place. */ -STATIC_OVL void +static void fix_stair_rooms() { int i; @@ -2676,7 +2675,7 @@ fix_stair_rooms() * Basically we search for door coordinates or for endpoints coordinates * (from a distance). */ -STATIC_OVL void +static void create_corridor(c) corridor *c; { @@ -2788,7 +2787,7 @@ boolean prefilled; } } -STATIC_OVL struct mkroom * +static struct mkroom * build_room(r, mkr) room *r; struct mkroom *mkr; @@ -2823,7 +2822,7 @@ struct mkroom *mkr; /* * set lighting in a region that will not become a room. */ -STATIC_OVL void +static void light_region(tmpregion) region *tmpregion; { @@ -2886,7 +2885,7 @@ int x1, y1, x2, y2; * We want a place not 'touched' by the loader. That is, a place in * the maze outside every part of the special level. */ -STATIC_OVL void +static void maze1xy(m, humidity) coord *m; int humidity; @@ -2913,7 +2912,7 @@ int humidity; * Makes the number of traps, monsters, etc. proportional * to the size of the maze. */ -STATIC_OVL void +static void fill_empty_maze() { int mapcountmax, mapcount, mapfact; @@ -2968,7 +2967,7 @@ fill_empty_maze() /* * special level loader */ -STATIC_OVL boolean +static boolean sp_level_loader(fd, lvl) dlb *fd; sp_lev *lvl; @@ -3039,7 +3038,7 @@ sp_lev *lvl; /* Frees the memory allocated for special level creation structs */ -STATIC_OVL boolean +static boolean sp_level_free(lvl) sp_lev *lvl; { @@ -4404,12 +4403,12 @@ int dir; if (tmp[x][y]) selection_setpoint(x, y, ov, 1); } -static int FDECL((*selection_flood_check_func), (int, int)); +static int (*selection_flood_check_func)(int, int); static schar floodfillchk_match_under_typ; void set_selection_floodfillchk(f) -int FDECL((*f), (int, int)); +int (*f)(int, int); { selection_flood_check_func = f; } @@ -4482,7 +4481,7 @@ boolean diagonals; xchar dy[SEL_FLOOD_STACK]; schar under = levl[x][y].typ; - if (selection_flood_check_func == (int FDECL((*), (int, int))) 0) { + if (selection_flood_check_func == (int (*) (int, int)) 0) { opvar_free(tmp); return; } @@ -4750,7 +4749,7 @@ struct opvar *ov; void selection_iterate(ov, func, arg) struct opvar *ov; -void FDECL((*func), (int, int, genericptr_t)); +void (*func)(int, int, genericptr_t); genericptr_t arg; { int x, y; @@ -5828,7 +5827,7 @@ struct sp_coder *coder; /* Special level coder, creates the special level from the sp_lev codes. * Does not free the allocated memory. */ -STATIC_OVL boolean +static boolean sp_level_coder(lvl) sp_lev *lvl; { diff --git a/src/spell.c b/src/spell.c index 65a51f35c..75394d902 100644 --- a/src/spell.c +++ b/src/spell.c @@ -18,17 +18,17 @@ static NEARDATA struct obj *book; /* last/current book being xscribed */ #define spellev(spell) spl_book[spell].sp_lev #define spellname(spell) OBJ_NAME(objects[spellid(spell)]) -STATIC_DCL int FDECL(spell_let_to_idx, (CHAR_P)); -STATIC_DCL boolean FDECL(cursed_book, (struct obj *bp)); -STATIC_DCL boolean FDECL(confused_book, (struct obj *)); -STATIC_DCL void FDECL(deadbook, (struct obj *)); -STATIC_PTR int NDECL(learn); -STATIC_DCL boolean FDECL(getspell, (int *)); -STATIC_DCL boolean FDECL(dospellmenu, (const char *, int, int *)); -STATIC_DCL int FDECL(percent_success, (int)); -STATIC_DCL int NDECL(throwspell); -STATIC_DCL void NDECL(cast_protection); -STATIC_DCL void FDECL(spell_backfire, (int)); +static int spell_let_to_idx(CHAR_P); +static boolean cursed_book(struct obj *bp); +static boolean confused_book(struct obj *); +static void deadbook(struct obj *); +static int learn(); +static boolean getspell(int *); +static boolean dospellmenu(const char *, int, int *); +static int percent_success(int); +static int throwspell(); +static void cast_protection(); +static void spell_backfire(int); /* The roles[] table lists the role-specific values for tuning * percent_success(). @@ -70,7 +70,7 @@ STATIC_DCL void FDECL(spell_backfire, (int)); static const char explodes[] = "radiates explosive energy"; /* convert a letter into a number in the range 0..51, or -1 if not a letter */ -STATIC_OVL int +static int spell_let_to_idx(ilet) char ilet; { @@ -84,7 +84,7 @@ char ilet; } /* TRUE: book should be destroyed by caller */ -STATIC_OVL boolean +static boolean cursed_book(bp) struct obj *bp; { @@ -154,7 +154,7 @@ struct obj *bp; } /* study while confused: returns TRUE if the book is destroyed */ -STATIC_OVL boolean +static boolean confused_book(spellbook) struct obj *spellbook; { @@ -179,7 +179,7 @@ struct obj *spellbook; } /* special effects for The Book of the Dead */ -STATIC_OVL void +static void deadbook(book2) struct obj *book2; { @@ -308,7 +308,7 @@ struct obj *book; #endif } -STATIC_PTR int +static int learn() { int i; @@ -536,7 +536,7 @@ age_spells() * Return TRUE if a spell was picked, with the spell index in the return * parameter. Otherwise return FALSE. */ -STATIC_OVL boolean +static boolean getspell(spell_no) int *spell_no; { @@ -621,7 +621,7 @@ int booktype; return (objects[booktype].oc_skill); } -STATIC_OVL void +static void cast_protection() { int loglev = 0; @@ -684,7 +684,7 @@ cast_protection() } /* attempting to cast a forgotten spell will cause disorientation */ -STATIC_OVL void +static void spell_backfire(spell) int spell; { @@ -989,7 +989,7 @@ boolean atme; } /* Choose location where spell takes effect. */ -STATIC_OVL int +static int throwspell() { coord cc; @@ -1161,7 +1161,7 @@ dovspell() return 0; } -STATIC_OVL boolean +static boolean dospellmenu(prompt, splaction, spell_no) const char *prompt; int splaction; /* SPELLMENU_CAST, SPELLMENU_VIEW, or spl_book[] index */ @@ -1276,7 +1276,7 @@ dump_spells() /** * Returns the success rate of the specified spell in percent. */ -STATIC_OVL int +static int percent_success(spell) int spell; { diff --git a/src/steal.c b/src/steal.c index 137597183..83911734e 100644 --- a/src/steal.c +++ b/src/steal.c @@ -3,11 +3,11 @@ #include "hack.h" -STATIC_PTR int NDECL(stealarm); +static int stealarm(); -STATIC_DCL const char *FDECL(equipname, (struct obj *)); +static const char *equipname(struct obj *); -STATIC_OVL const char * +static const char * equipname(otmp) register struct obj *otmp; { @@ -135,7 +135,7 @@ register struct monst *mtmp; unsigned int stealoid; /* object to be stolen */ unsigned int stealmid; /* monster doing the stealing */ -STATIC_PTR int +static int stealarm() { register struct monst *mtmp; diff --git a/src/steed.c b/src/steed.c index 3c8f1e47a..917e44f23 100644 --- a/src/steed.c +++ b/src/steed.c @@ -8,8 +8,8 @@ static NEARDATA const char steeds[] = { S_QUADRUPED, S_UNICORN, S_ANGEL, S_CENTAUR, S_DRAGON, S_JABBERWOCK, '\0' }; -static boolean FDECL(landing_spot, (coord *, int, int)); -static void FDECL(maybewakesteed, (struct monst *)); +static boolean landing_spot(coord *, int, int); +static void maybewakesteed(struct monst *); /* caller has decided that hero can't reach something while mounted */ void @@ -449,7 +449,7 @@ kick_steed() * room's walls, which is not what we want. * Adapted from mail daemon code. */ -STATIC_OVL boolean +static boolean landing_spot(spot, reason, forceit) coord *spot; /* landing position (we fill it in) */ int reason; diff --git a/src/teleport.c b/src/teleport.c index 14805affe..f32815146 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -3,11 +3,11 @@ #include "hack.h" -STATIC_DCL boolean FDECL(tele_jump_ok, (int, int, int, int)); -STATIC_DCL boolean FDECL(teleok, (int, int, BOOLEAN_P)); -STATIC_DCL void NDECL(vault_tele); -STATIC_DCL boolean FDECL(rloc_pos_ok, (int, int, struct monst *)); -STATIC_DCL void FDECL(mvault_tele, (struct monst *)); +static boolean tele_jump_ok(int, int, int, int); +static boolean teleok(int, int, BOOLEAN_P); +static void vault_tele(); +static boolean rloc_pos_ok(int, int, struct monst *); +static void mvault_tele(struct monst *); /* non-null when teleporting via having read this scroll */ static struct obj *telescroll = 0; @@ -461,7 +461,7 @@ struct permonst *mdat; * need to be augmented to allow deliberate passage in wizard mode, but * only for explicitly chosen destinations.) */ -STATIC_OVL boolean +static boolean tele_jump_ok(x1, y1, x2, y2) int x1, y1, x2, y2; { @@ -497,7 +497,7 @@ int x1, y1, x2, y2; return TRUE; } -STATIC_OVL boolean +static boolean teleok(x, y, trapok) register int x, y; boolean trapok; @@ -669,7 +669,7 @@ boolean allow_drag; return FALSE; } -STATIC_OVL void +static void vault_tele() { register struct mkroom *croom = search_special(VAULT); @@ -1391,7 +1391,7 @@ unsigned trflags; } /* check whether monster can arrive at location via Tport (or fall) */ -STATIC_OVL boolean +static boolean rloc_pos_ok(x, y, mtmp) register int x, y; /* coordinates of candidate location */ struct monst *mtmp; @@ -1556,7 +1556,7 @@ boolean suppress_impossible; return TRUE; } -STATIC_OVL void +static void mvault_tele(mtmp) struct monst *mtmp; { diff --git a/src/timeout.c b/src/timeout.c index 9480cdd8f..1e301feaa 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -4,19 +4,19 @@ #include "hack.h" #include "lev.h" /* for checking save modes */ -STATIC_DCL void NDECL(stoned_dialogue); -STATIC_DCL void NDECL(phasing_dialogue); -STATIC_DCL void NDECL(vomiting_dialogue); -STATIC_DCL void NDECL(choke_dialogue); -STATIC_DCL void NDECL(slime_dialogue); -STATIC_DCL void FDECL(slimed_to_death, (struct kinfo *)); -STATIC_DCL void NDECL(sickness_dialogue); -STATIC_DCL void NDECL(phaze_dialogue); -STATIC_DCL void FDECL(done_timeout, (int, int)); -STATIC_DCL void NDECL(slip_or_trip); -STATIC_DCL void FDECL(see_lamp_flicker, (struct obj *, const char *)); -STATIC_DCL void FDECL(lantern_message, (struct obj *)); -STATIC_DCL void FDECL(cleanup_burn, (ANY_P *, long)); +static void stoned_dialogue(); +static void phasing_dialogue(); +static void vomiting_dialogue(); +static void choke_dialogue(); +static void slime_dialogue(); +static void slimed_to_death(struct kinfo *); +static void sickness_dialogue(void); +static void phaze_dialogue(); +static void done_timeout(int, int); +static void slip_or_trip(); +static void see_lamp_flicker(struct obj *, const char *); +static void lantern_message(struct obj *); +static void cleanup_burn(ANY_P *, long); /* used by wizard mode #timeout and #wizintrinsic; order by 'interest' for timeout countdown, where most won't occur in normal play */ @@ -106,7 +106,7 @@ static NEARDATA const char * const stoned_texts[] = { "You are a statue." /* 1 */ }; -STATIC_OVL void +static void stoned_dialogue() { register long i = (Stoned & TIMEOUT); @@ -172,7 +172,7 @@ stoned_dialogue() exercise(A_DEX, FALSE); } -STATIC_OVL void +static void phasing_dialogue() { if (Phasing == 15) { @@ -201,7 +201,7 @@ static NEARDATA const char * const vomiting_texts[] = { "are about to vomit." /* 2 */ }; -STATIC_OVL void +static void vomiting_dialogue() { const char *txt = 0; @@ -287,7 +287,7 @@ static NEARDATA const char * const choke_texts2[] = { "You suffocate." }; -STATIC_OVL void +static void choke_dialogue() { register long i = (Strangled & TIMEOUT); @@ -344,7 +344,7 @@ static NEARDATA const char *const levi_texts[] = { "You wobble unsteadily %s the %s." }; -STATIC_OVL void +static void levitation_dialogue() { /* -1 because the last message comes via float_down() */ @@ -379,7 +379,7 @@ static NEARDATA const char * const slime_texts[] = { "You have become %s." /* 1 */ }; -STATIC_OVL void +static void slime_dialogue() { register long i = (Slimed & TIMEOUT) / 2L; @@ -466,7 +466,7 @@ static NEARDATA const char *const phaze_texts[] = { "You are feeling rather flabby.", }; -STATIC_OVL void +static void phaze_dialogue() { long i = ((HPasses_walls & TIMEOUT) / 2L); @@ -483,7 +483,7 @@ phaze_dialogue() /* when a status timeout is fatal, keep the status line indicator shown during end of game rundown (and potential dumplog); timeout has already counted down to 0 by the time we get here */ -STATIC_OVL void +static void done_timeout(how, which) int how, which; { @@ -1044,7 +1044,7 @@ struct obj *figurine; } /* give a fumble message */ -STATIC_OVL void +static void slip_or_trip() { struct obj *otmp = vobj_at(u.ux, u.uy), *otmp2; @@ -1125,7 +1125,7 @@ slip_or_trip() } /* Print a lamp flicker message with tailer. */ -STATIC_OVL void +static void see_lamp_flicker(obj, tailer) struct obj *obj; const char *tailer; @@ -1142,7 +1142,7 @@ const char *tailer; } /* Print a dimming message for brass lanterns. */ -STATIC_OVL void +static void lantern_message(obj) struct obj *obj; { @@ -1742,16 +1742,15 @@ do_storms() */ #ifdef WIZARD -STATIC_DCL const char *FDECL(kind_name, (SHORT_P)); -STATIC_DCL void FDECL(print_queue, (winid, timer_element *)); +static const char *kind_name(SHORT_P); +static void print_queue(winid, timer_element *); #endif -STATIC_DCL void FDECL(insert_timer, (timer_element *)); -STATIC_DCL timer_element *FDECL(remove_timer, - (timer_element **, SHORT_P, ANY_P *)); -STATIC_DCL void FDECL(write_timer, (int, timer_element *)); -STATIC_DCL boolean FDECL(mon_is_local, (struct monst *)); -STATIC_DCL boolean FDECL(timer_is_local, (timer_element *)); -STATIC_DCL int FDECL(maybe_write_timer, (int, int, BOOLEAN_P)); +static void insert_timer(timer_element *); +static timer_element *remove_timer(timer_element **, SHORT_P, ANY_P *); +static void write_timer(int, timer_element *); +static boolean mon_is_local(struct monst *); +static boolean timer_is_local(timer_element *); +static int maybe_write_timer(int, int, BOOLEAN_P); /* ordered timer list */ timer_element *timer_base; /* "active" */ @@ -1785,7 +1784,7 @@ static const ttable timeout_funcs[NUM_TIME_FUNCS] = { #if defined(WIZARD) -STATIC_OVL const char * +static const char * kind_name(kind) short kind; { @@ -1798,7 +1797,7 @@ short kind; return "unknown"; } -STATIC_OVL void +static void print_queue(win, base) winid win; timer_element *base; @@ -2207,7 +2206,7 @@ short func_index; } /* Insert timer into the global queue */ -STATIC_OVL void +static void insert_timer(gnu) timer_element *gnu; { @@ -2224,7 +2223,7 @@ timer_element *gnu; } -STATIC_OVL timer_element * +static timer_element * remove_timer(base, func_index, arg) timer_element **base; short func_index; @@ -2248,7 +2247,7 @@ anything *arg; } -STATIC_OVL void +static void write_timer(fd, timer) int fd; timer_element *timer; @@ -2325,7 +2324,7 @@ struct obj *obj; * Return TRUE if the given monster will stay on the level when the * level is saved. */ -STATIC_OVL boolean +static boolean mon_is_local(mon) struct monst *mon; { @@ -2344,7 +2343,7 @@ struct monst *mon; * Return TRUE if the timer is attached to something that will stay on the * level when the level is saved. */ -STATIC_OVL boolean +static boolean timer_is_local(timer) timer_element *timer; { @@ -2367,7 +2366,7 @@ timer_element *timer; * Part of the save routine. Count up the number of timers that would * be written. If write_it is true, actually write the timer. */ -STATIC_OVL int +static int maybe_write_timer(fd, range, write_it) int fd, range; boolean write_it; diff --git a/src/topten.c b/src/topten.c index 5a49205d7..a576e616d 100644 --- a/src/topten.c +++ b/src/topten.c @@ -61,33 +61,32 @@ struct toptenentry { char death[DTHSZ+1]; } *tt_head; -STATIC_DCL void FDECL(topten_print, (const char *)); -STATIC_DCL void FDECL(topten_print_bold, (const char *)); -STATIC_DCL xchar FDECL(observable_depth, (d_level *)); -STATIC_DCL void NDECL(outheader); -STATIC_DCL void FDECL(outentry, (int, struct toptenentry *, BOOLEAN_P)); -STATIC_DCL void FDECL(readentry, (FILE *, struct toptenentry *)); -STATIC_DCL void FDECL(writeentry, (FILE *, struct toptenentry *)); +static void topten_print(const char *); +static void topten_print_bold(const char *); +static xchar observable_depth(d_level *); +static void outheader(); +static void outentry(int, struct toptenentry *, BOOLEAN_P); +static void readentry(FILE *, struct toptenentry *); +static void writeentry(FILE *, struct toptenentry *); #ifdef XLOGFILE -STATIC_DCL void FDECL(munge_xlstring, (char *dest, char *src, int n)); -STATIC_DCL void FDECL(write_xlentry, (FILE *, struct toptenentry *)); -static void FDECL(add_achieveX, (char *, const char *, BOOLEAN_P)); -static char *NDECL(encode_extended_achievements); -static char *NDECL(encode_extended_conducts); +static void munge_xlstring(char *dest, char *src, int n); +static void write_xlentry(FILE *, struct toptenentry *); +static void add_achieveX(char *, const char *, BOOLEAN_P); +static char *encode_extended_achievements(); +static char *encode_extended_conducts(); #endif -STATIC_DCL void FDECL(free_ttlist, (struct toptenentry *)); -STATIC_DCL int FDECL(classmon, (char *, BOOLEAN_P)); -STATIC_DCL int FDECL(score_wanted, - (BOOLEAN_P, int, struct toptenentry *, int, const char **, int)); +static void free_ttlist(struct toptenentry *); +static int classmon(char *, BOOLEAN_P); +static int score_wanted(BOOLEAN_P, int, struct toptenentry *, int, const char **, int); #ifdef RECORD_ACHIEVE -STATIC_DCL long FDECL(encodeachieve, (void)); +static long encodeachieve(void); #endif -STATIC_DCL long FDECL(encode_xlogflags, (void)); +static long encode_xlogflags(void); #ifdef NO_SCAN_BRACK -STATIC_DCL void FDECL(nsb_mung_line, (char*)); -STATIC_DCL void FDECL(nsb_unmung_line, (char*)); +static void nsb_mung_line(char*); +static void nsb_unmung_line(char*); #endif -static char* FDECL(killed_uniques, (void)); +static char* killed_uniques(void); /* must fit with end.c; used in rip.c */ NEARDATA const char * const killed_by_prefix[] = { @@ -106,7 +105,7 @@ NEARDATA const char * const killed_by_prefix[] = { static winid toptenwin = WIN_ERR; -STATIC_OVL void +static void topten_print(x) const char *x; { @@ -116,7 +115,7 @@ const char *x; putstr(toptenwin, ATR_NONE, x); } -STATIC_OVL void +static void topten_print_bold(x) const char *x; { @@ -126,7 +125,7 @@ const char *x; putstr(toptenwin, ATR_BOLD, x); } -STATIC_OVL xchar +static xchar observable_depth(lev) d_level *lev; { @@ -144,7 +143,7 @@ d_level *lev; return depth(lev); } -STATIC_OVL void +static void readentry(rfile, tt) FILE *rfile; struct toptenentry *tt; @@ -207,7 +206,7 @@ struct toptenentry *tt; } } -STATIC_OVL void +static void writeentry(rfile, tt) FILE *rfile; struct toptenentry *tt; @@ -255,7 +254,7 @@ struct toptenentry *tt; /* copy a maximum of n-1 characters from src to dest, changing ':' and '\n' * to '_'; always null-terminate. */ -STATIC_OVL void +static void munge_xlstring(dest, src, n) char *dest; char *src; @@ -275,7 +274,7 @@ int n; return; } -STATIC_OVL unsigned long +static unsigned long encode_uevent() { unsigned long c = 0UL; @@ -312,7 +311,7 @@ encode_uevent() return c; } -STATIC_OVL unsigned long +static unsigned long encode_carried() { unsigned long c = 0UL; @@ -328,7 +327,7 @@ encode_carried() return c; } -STATIC_OVL void +static void write_xlentry(rfile, tt) FILE *rfile; struct toptenentry *tt; @@ -536,7 +535,7 @@ encode_extended_conducts() #undef SEPC #endif /* XLOGFILE */ -STATIC_OVL void +static void free_ttlist(tt) struct toptenentry *tt; { @@ -907,7 +906,7 @@ int how; } } -STATIC_OVL void +static void outheader() { char linebuf[BUFSZ]; @@ -924,7 +923,7 @@ outheader() } /* so>0: standout line; so=0: ordinary line */ -STATIC_OVL void +static void outentry(rank, t1, so) struct toptenentry *t1; int rank; @@ -1103,7 +1102,7 @@ boolean so; #endif } -STATIC_OVL int +static int score_wanted(current_ver, rank, t1, playerct, players, uid) boolean current_ver; int rank; @@ -1392,7 +1391,7 @@ char **argv; #endif } -STATIC_OVL int +static int classmon(plch, fem) char *plch; boolean fem; @@ -1470,14 +1469,14 @@ struct obj *otmp; /* Lattice scanf isn't up to reading the scorefile. What */ /* follows deals with that; I admit it's ugly. (KL) */ /* Now generally available (KL) */ -STATIC_OVL void +static void nsb_mung_line(p) char *p; { while ((p = index(p, ' ')) != 0) *p = '|'; } -STATIC_OVL void +static void nsb_unmung_line(p) char *p; { diff --git a/src/track.c b/src/track.c index 4efd6d6b7..87c9719a5 100644 --- a/src/track.c +++ b/src/track.c @@ -7,8 +7,8 @@ #define UTSZ 50 -STATIC_VAR NEARDATA int utcnt, utpnt; -STATIC_VAR NEARDATA coord utrack[UTSZ]; +static NEARDATA int utcnt, utpnt; +static NEARDATA coord utrack[UTSZ]; void initrack() diff --git a/src/trap.c b/src/trap.c index 0e0945d64..73f2f145d 100644 --- a/src/trap.c +++ b/src/trap.c @@ -5,42 +5,40 @@ extern const char *const destroy_strings[][3]; /* from zap.c */ -static struct obj *FDECL(t_missile, (int, struct trap *)); -static void FDECL(launch_drop_spot, (struct obj *, XCHAR_P, XCHAR_P)); -STATIC_DCL void FDECL(decrease_mon_trapcounter, (struct monst *)); -STATIC_DCL void FDECL(dofiretrap, (struct obj *)); -STATIC_DCL void FDECL(doicetrap, (struct obj *)); -STATIC_DCL void NDECL(domagictrap); -STATIC_DCL boolean FDECL(emergency_disrobe, (boolean *)); -STATIC_DCL int FDECL(untrap_prob, (struct trap *ttmp)); -STATIC_DCL void FDECL(move_into_trap, (struct trap *)); -STATIC_DCL int FDECL(try_disarm, (struct trap *, BOOLEAN_P)); -STATIC_DCL void FDECL(reward_untrap, (struct trap *, struct monst *)); -STATIC_DCL int FDECL(disarm_holdingtrap, (struct trap *)); -STATIC_DCL int FDECL(disarm_landmine, (struct trap *)); -STATIC_DCL int FDECL(disarm_squeaky_board, (struct trap *)); -STATIC_DCL int FDECL(disarm_shooting_trap, (struct trap *, int)); -static void FDECL(clear_conjoined_pits, (struct trap *)); -static boolean FDECL(adj_nonconjoined_pit, (struct trap *)); -STATIC_DCL int FDECL(try_lift, (struct monst *, struct trap *, int, BOOLEAN_P)); -STATIC_DCL int FDECL(help_monster_out, (struct monst *, struct trap *)); +static struct obj *t_missile(int, struct trap *); +static void launch_drop_spot(struct obj *, XCHAR_P, XCHAR_P); +static void decrease_mon_trapcounter(struct monst *); +static void dofiretrap(struct obj *); +static void doicetrap(struct obj *); +static void domagictrap(); +static boolean emergency_disrobe(boolean *); +static int untrap_prob(struct trap *ttmp); +static void move_into_trap(struct trap *); +static int try_disarm(struct trap *, BOOLEAN_P); +static void reward_untrap(struct trap *, struct monst *); +static int disarm_holdingtrap(struct trap *); +static int disarm_landmine(struct trap *); +static int disarm_squeaky_board(struct trap *); +static int disarm_shooting_trap(struct trap *, int); +static void clear_conjoined_pits(struct trap *); +static boolean adj_nonconjoined_pit(struct trap *); +static int try_lift(struct monst *, struct trap *, int, BOOLEAN_P); +static int help_monster_out(struct monst *, struct trap *); #if 0 -static void FDECL(join_adjacent_pits, (struct trap *)); +static void join_adjacent_pits(struct trap *); #endif -STATIC_DCL boolean FDECL(thitm, (int, struct monst *, struct obj *, int, BOOLEAN_P)); -static void NDECL(maybe_finish_sokoban); -STATIC_DCL int FDECL(mkroll_launch, - (struct trap *, XCHAR_P, XCHAR_P, SHORT_P, long)); -STATIC_DCL boolean FDECL(isclearpath, (coord *, int, SCHAR_P, SCHAR_P)); -STATIC_OVL int FDECL(steedintrap, (struct trap *, struct obj *)); -STATIC_OVL boolean FDECL(keep_saddle_with_steedcorpse, - (unsigned, struct obj *, struct obj *)); - -STATIC_VAR const char *const a_your[2] = { "a", "your" }; -STATIC_VAR const char *const A_Your[2] = { "A", "Your" }; -STATIC_VAR const char tower_of_flame[] = "tower of flame"; -STATIC_VAR const char *const A_gush_of_water_hits = "A gush of water hits"; -STATIC_VAR const char *const blindgas[6] = +static boolean thitm(int, struct monst *, struct obj *, int, BOOLEAN_P); +static void maybe_finish_sokoban(); +static int mkroll_launch(struct trap *, XCHAR_P, XCHAR_P, SHORT_P, long); +static boolean isclearpath(coord *, int, SCHAR_P, SCHAR_P); +static int steedintrap(struct trap *, struct obj *); +static boolean keep_saddle_with_steedcorpse(unsigned, struct obj *, struct obj *); + +static const char *const a_your[2] = { "a", "your" }; +static const char *const A_Your[2] = { "A", "Your" }; +static const char tower_of_flame[] = "tower of flame"; +static const char *const A_gush_of_water_hits = "A gush of water hits"; +static const char *const blindgas[6] = {"humid", "odorless", "pungent", "chilling", "acrid", "biting"}; /* called when you're hit by fire (dofiretrap,buzz,zapyourself,explode) */ @@ -783,7 +781,7 @@ boolean shatter; return mtmp; } -STATIC_OVL boolean +static boolean keep_saddle_with_steedcorpse(steed_mid, objchn, saddle) unsigned steed_mid; struct obj *objchn, *saddle; @@ -1585,7 +1583,7 @@ unsigned trflags; } } -STATIC_OVL int +static int steedintrap(trap, otmp) struct trap *trap; struct obj *otmp; @@ -2038,7 +2036,7 @@ struct trap *trap; newsym(trap->tx, trap->ty); } -STATIC_OVL int +static int mkroll_launch(ttmp, x, y, otyp, ocount) struct trap *ttmp; xchar x, y; @@ -2113,7 +2111,7 @@ long ocount; return 1; } -STATIC_OVL boolean +static boolean isclearpath(cc, distance, dx, dy) coord *cc; int distance; @@ -3229,7 +3227,7 @@ climb_pit() } } -STATIC_OVL void +static void doicetrap(box) struct obj *box; /* at the moment only for floor traps */ { @@ -3254,7 +3252,7 @@ struct obj *box; /* at the moment only for floor traps */ destroy_item(POTION_CLASS, AD_COLD); } -STATIC_OVL void +static void dofiretrap(box) struct obj *box; /* null for floor trap */ { @@ -3319,7 +3317,7 @@ struct obj *box; /* null for floor trap */ melt_ice(u.ux, u.uy, (char *) 0); } -STATIC_OVL void +static void domagictrap() { register int fate = rnd(20); @@ -3850,7 +3848,7 @@ boolean here; * Returns TRUE if disrobing made player unencumbered enough to * crawl out of the current predicament. */ -STATIC_OVL boolean +static boolean emergency_disrobe(lostsome) boolean *lostsome; { @@ -4112,7 +4110,7 @@ dountrap() /* disarm a trap */ } /* Probability of disabling a trap. Helge Hafting */ -STATIC_OVL int +static int untrap_prob(ttmp) struct trap *ttmp; { @@ -4168,7 +4166,7 @@ boolean bury_it; } /* while attempting to disarm an adjacent trap, we've fallen into it */ -STATIC_OVL void +static void move_into_trap(ttmp) struct trap *ttmp; { @@ -4204,7 +4202,7 @@ struct trap *ttmp; * 1: tries and fails * 2: succeeds */ -STATIC_OVL int +static int try_disarm(ttmp, force_failure) struct trap *ttmp; boolean force_failure; @@ -4288,7 +4286,7 @@ boolean force_failure; return 2; } -STATIC_OVL void +static void reward_untrap(ttmp, mtmp) struct trap *ttmp; struct monst *mtmp; @@ -4311,7 +4309,7 @@ struct monst *mtmp; } } -STATIC_OVL int +static int disarm_holdingtrap(ttmp) /* Helge Hafting */ struct trap *ttmp; { @@ -4343,7 +4341,7 @@ struct trap *ttmp; return 1; } -STATIC_OVL int +static int disarm_landmine(ttmp) /* Helge Hafting */ struct trap *ttmp; { @@ -4359,7 +4357,7 @@ struct trap *ttmp; static NEARDATA const char oil[] = { ALL_CLASSES, TOOL_CLASS, POTION_CLASS, 0 }; /* it may not make much sense to use grease on floor boards, but so what? */ -STATIC_OVL int +static int disarm_squeaky_board(ttmp) struct trap *ttmp; { @@ -4393,7 +4391,7 @@ struct trap *ttmp; } /* removes traps that shoot arrows, darts, etc. */ -STATIC_OVL int +static int disarm_shooting_trap(ttmp, otyp) struct trap *ttmp; int otyp; @@ -4408,7 +4406,7 @@ int otyp; /* Is the weight too heavy? * Formula as in near_capacity() & check_capacity() */ -STATIC_OVL int +static int try_lift(mtmp, ttmp, wt, stuff) struct monst *mtmp; struct trap *ttmp; @@ -4433,7 +4431,7 @@ boolean stuff; } /* Help trapped monster (out of a (spiked) pit) */ -STATIC_OVL int +static int help_monster_out(mtmp, ttmp) struct monst *mtmp; struct trap *ttmp; @@ -5386,7 +5384,7 @@ register int bodypart; /* Monster is hit by trap. */ /* Note: doesn't work if both obj and d_override are null */ -STATIC_OVL boolean +static boolean thitm(tlev, mon, obj, d_override, nocorpse) int tlev; struct monst *mon; diff --git a/src/u_init.c b/src/u_init.c index 6774be1d0..298303c3b 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -11,10 +11,10 @@ struct trobj { Bitfield(trbless, 2); }; -STATIC_DCL void FDECL(ini_inv, (struct trobj *)); -STATIC_DCL void FDECL(knows_object, (int)); +static void ini_inv(struct trobj *); +static void knows_object(int); static void knows_class(char); -STATIC_DCL boolean FDECL(restricted_spell_discipline, (int)); +static boolean restricted_spell_discipline(int); #define UNDEF_TYP 0 #define UNDEF_SPE '\177' @@ -616,7 +616,7 @@ static const struct def_skill Skill_W[] = { }; -STATIC_OVL void +static void knows_object(obj) register int obj; { @@ -1143,7 +1143,7 @@ u_init() } /* skills aren't initialized, so we use the role-specific skill lists */ -STATIC_OVL boolean +static boolean restricted_spell_discipline(otyp) int otyp; { @@ -1177,7 +1177,7 @@ int otyp; return TRUE; } -STATIC_OVL void +static void ini_inv(trop) register struct trobj *trop; { diff --git a/src/uhitm.c b/src/uhitm.c index b254432a4..3d3f216a8 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -3,20 +3,20 @@ #include "hack.h" -STATIC_DCL void FDECL(steal_it, (struct monst *, struct attack *)); -static boolean FDECL(hitum, (struct monst *, struct attack *)); -static boolean FDECL(hmon_hitmon, (struct monst *, struct obj *, int, int)); -STATIC_DCL void FDECL(noisy_hit, (struct monst*, struct obj*, int)); -STATIC_DCL int FDECL(joust, (struct monst *, struct obj *)); -STATIC_DCL void NDECL(demonpet); -STATIC_DCL boolean FDECL(m_slips_free, (struct monst *mtmp, struct attack *mattk)); -STATIC_DCL int FDECL(explum, (struct monst *, struct attack *)); -STATIC_DCL void FDECL(start_engulf, (struct monst *)); -STATIC_DCL void NDECL(end_engulf); -STATIC_DCL int FDECL(gulpum, (struct monst *, struct attack *)); -static boolean FDECL(hmonas, (struct monst *)); -STATIC_DCL void FDECL(nohandglow, (struct monst *)); -STATIC_DCL boolean FDECL(shade_aware, (struct obj *)); +static void steal_it(struct monst *, struct attack *); +static boolean hitum(struct monst *, struct attack *); +static boolean hmon_hitmon(struct monst *, struct obj *, int, int); +static void noisy_hit(struct monst*, struct obj*, int); +static int joust(struct monst *, struct obj *); +static void demonpet(); +static boolean m_slips_free(struct monst *mtmp, struct attack *mattk); +static int explum(struct monst *, struct attack *); +static void start_engulf(struct monst *); +static void end_engulf(); +static int gulpum(struct monst *, struct attack *); +static boolean hmonas(struct monst *); +static void nohandglow(struct monst *); +static boolean shade_aware(struct obj *); extern boolean notonhead; /* for long worms */ /* The below might become a parameter instead if we use it a lot */ @@ -649,7 +649,7 @@ struct attack *uattk; /* ... but we don't enforce that here; Null works ok */ } /* hit target monster; returns TRUE if it still lives */ -STATIC_OVL boolean +static boolean hitum(mon, uattk) struct monst *mon; struct attack *uattk; @@ -720,7 +720,7 @@ int dieroll; } /* guts of hmon() */ -STATIC_OVL boolean +static boolean hmon_hitmon(mon, obj, thrown, dieroll) struct monst *mon; struct obj *obj; @@ -1532,7 +1532,7 @@ int dieroll; * drop any special noise effects you may want to occur when a * particular monster is hit. */ -STATIC_OVL void +static void noisy_hit(mtmp, otmp, thrown) struct monst* mtmp; struct obj* otmp; @@ -1588,7 +1588,7 @@ int thrown; } } -STATIC_OVL boolean +static boolean shade_aware(obj) struct obj *obj; { @@ -1651,7 +1651,7 @@ boolean thrown, verbose; /* check whether slippery clothing protects from hug or wrap attack */ /* [currently assumes that you are the attacker] */ -STATIC_OVL boolean +static boolean m_slips_free(mdef, mattk) struct monst *mdef; struct attack *mattk; @@ -1692,7 +1692,7 @@ struct attack *mattk; } /* used when hitting a monster with a lance while mounted */ -STATIC_OVL int /* 1: joust hit; 0: ordinary hit; -1: joust but break lance */ +static int /* 1: joust hit; 0: ordinary hit; -1: joust but break lance */ joust(mon, obj) struct monst *mon; /* target */ struct obj *obj; /* weapon */ @@ -1726,7 +1726,7 @@ struct obj *obj; /* weapon */ * (DR4 and DR4.5) screws up with an internal error 5 "Expression Too Complex." * Pulling it out makes it work. */ -STATIC_OVL void +static void demonpet() { int i; @@ -1753,7 +1753,7 @@ demonpet() * If that ever changes, the check for touching a cockatrice corpse * will need to be smarter about whether to break out of the theft loop. */ -STATIC_OVL void +static void steal_it(mdef, mattk) struct monst *mdef; struct attack *mattk; @@ -2322,7 +2322,7 @@ int specialdmg; /* blessed and/or silver bonus against various things */ return(1); } -STATIC_OVL int +static int explum(mdef, mattk) register struct monst *mdef; register struct attack *mattk; @@ -2382,7 +2382,7 @@ register struct attack *mattk; return(1); } -STATIC_OVL void +static void start_engulf(mdef) struct monst *mdef; { @@ -2396,7 +2396,7 @@ struct monst *mdef; delay_output(); } -STATIC_OVL void +static void end_engulf() { if (!Invisible) { @@ -2405,7 +2405,7 @@ end_engulf() } } -STATIC_OVL int +static int gulpum(mdef, mattk) register struct monst *mdef; register struct attack *mattk; @@ -2624,7 +2624,7 @@ boolean wouldhavehit; } /* attack monster as a monster; returns true if mon survives */ -STATIC_OVL boolean +static boolean hmonas(mon) register struct monst *mon; { @@ -3447,7 +3447,7 @@ struct monst *mtmp; } } -STATIC_OVL void +static void nohandglow(mon) struct monst *mon; { diff --git a/src/vault.c b/src/vault.c index 553be3c8d..9020fe739 100644 --- a/src/vault.c +++ b/src/vault.c @@ -3,16 +3,16 @@ #include "hack.h" -STATIC_DCL boolean FDECL(clear_fcorr, (struct monst *, BOOLEAN_P)); -STATIC_DCL void FDECL(blackout, (int, int)); -STATIC_DCL void FDECL(restfakecorr, (struct monst *)); -STATIC_DCL void FDECL(parkguard, (struct monst *)); -STATIC_DCL boolean FDECL(in_fcorridor, (struct monst *, int, int)); -STATIC_DCL boolean FDECL(find_guard_dest, (struct monst *, xchar *, xchar *)); -STATIC_DCL void FDECL(move_gold, (struct obj *, int)); -STATIC_DCL void FDECL(wallify_vault, (struct monst *)); -STATIC_DCL void FDECL(gd_mv_monaway, (struct monst *, int, int)); -STATIC_OVL void FDECL(gd_pick_corridor_gold, (struct monst *, int, int)); +static boolean clear_fcorr(struct monst *, BOOLEAN_P); +static void blackout(int, int); +static void restfakecorr(struct monst *); +static void parkguard(struct monst *); +static boolean in_fcorridor(struct monst *, int, int); +static boolean find_guard_dest(struct monst *, xchar *, xchar *); +static void move_gold(struct obj *, int); +static void wallify_vault(struct monst *); +static void gd_mv_monaway(struct monst *, int, int); +static void gd_pick_corridor_gold(struct monst *, int, int); void newegd(mtmp) @@ -40,7 +40,7 @@ struct monst *mtmp; /* try to remove the temporary corridor (from vault to rest of map) being maintained by guard 'grd'; if guard is still in it, removal will fail, to be tried again later */ -STATIC_OVL boolean +static boolean clear_fcorr(grd, forceshow) struct monst *grd; boolean forceshow; @@ -124,7 +124,7 @@ boolean forceshow; spots to unlit; if player used scroll/wand/spell of light while inside the corridor, we don't want the light to reappear if/when a new tunnel goes through the same area */ -STATIC_OVL void +static void blackout(x, y) int x, y; { @@ -147,7 +147,7 @@ int x, y; } } -STATIC_OVL void +static void restfakecorr(grd) struct monst *grd; { @@ -159,7 +159,7 @@ struct monst *grd; } /* move guard--dead to alive--to <0,0> until temporary corridor is removed */ -STATIC_OVL void +static void parkguard(grd) struct monst *grd; { @@ -199,7 +199,7 @@ struct monst *grd; return(dispose); } -STATIC_OVL boolean +static boolean in_fcorridor(grd, x, y) struct monst *grd; int x, y; @@ -279,7 +279,7 @@ struct monst *grd; } } -STATIC_OVL boolean +static boolean find_guard_dest(guard, rx, ry) struct monst *guard; xchar *rx, *ry; @@ -562,7 +562,7 @@ invault() } } -STATIC_OVL void +static void move_gold(gold, vroom) struct obj *gold; int vroom; @@ -578,7 +578,7 @@ int vroom; newsym(nx, ny); } -STATIC_OVL void +static void wallify_vault(grd) struct monst *grd; { @@ -652,7 +652,7 @@ struct monst *grd; } } -STATIC_OVL void +static void gd_mv_monaway(grd, nx, ny) register struct monst *grd; int nx, ny; @@ -667,7 +667,7 @@ int nx, ny; /* have guard pick gold off the floor, possibly moving to the gold's position before message and back to his current spot after */ -STATIC_OVL void +static void gd_pick_corridor_gold(grd, goldx, goldy) struct monst *grd; int goldx, goldy; /* ox, gold->oy> */ diff --git a/src/vision.c b/src/vision.c index b8cd3fcd7..7da0bd1c3 100644 --- a/src/vision.c +++ b/src/vision.c @@ -92,14 +92,15 @@ static char left_ptrs[ROWNO][COLNO]; /* LOS algorithm helpers */ static char right_ptrs[ROWNO][COLNO]; /* Forward declarations. */ -STATIC_DCL void FDECL(fill_point, (int, int)); -STATIC_DCL void FDECL(dig_point, (int, int)); -STATIC_DCL void NDECL(view_init); -STATIC_DCL void FDECL(view_from, (int, int, char **, char *, char *, int, - void (*)(int, int, genericptr_t), genericptr_t)); -STATIC_DCL void FDECL(get_unused_cs, (char ***, char **, char **)); +static void fill_point(int, int); +static void dig_point(int, int); +static void view_init(); +static void view_from(int, int, char **, char *, char *, int, + void (*)(int, int, genericptr_t), + genericptr_t); +static void get_unused_cs(char ***, char **, char **); #ifdef REINCARNATION -STATIC_DCL void FDECL(rogue_vision, (char **, char *, char *)); +static void rogue_vision(char **, char *, char *); #endif /* Macro definitions that I can't find anywhere. */ @@ -253,7 +254,7 @@ vision_reset() * Called from vision_recalc() and at least one light routine. Get pointers * to the unused vision work area. */ -STATIC_OVL void +static void get_unused_cs(rows, rmin, rmax) char ***rows; char **rmin, **rmax; @@ -296,7 +297,7 @@ char **rmin, **rmax; * We set the in_sight bit here as well to escape a bug that shows up * due to the one-sided lit wall hack. */ -STATIC_OVL void +static void rogue_vision(next, rmin, rmax) char **next; /* could_see array pointers */ char *rmin, *rmax; @@ -353,7 +354,7 @@ char *rmin, *rmax; #ifdef EXTEND_SPINE -STATIC_DCL int FDECL(new_angle, (struct rm *, unsigned char *, int, int)); +static int new_angle(struct rm *, unsigned char *, int, int); /* * new_angle() * @@ -396,7 +397,7 @@ STATIC_DCL int FDECL(new_angle, (struct rm *, unsigned char *, int, int)); * many exceptions. I may have to bite the bullet and do more * checks. - Dean 2/11/93 */ -STATIC_OVL int +static int new_angle(lev, sv, row, col) struct rm *lev; unsigned char *sv; @@ -536,7 +537,7 @@ int control; * + Monsters can see you even when you're in a pit. */ view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, - 0, (void FDECL((*), (int, int, genericptr_t))) 0, (genericptr_t)0); + 0, (void (*)(int, int, genericptr_t)) 0, (genericptr_t)0); /* * Our own version of the update loop below. We know we can't see @@ -605,7 +606,7 @@ int control; } } else view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, - 0, (void FDECL((*), (int, int, genericptr_t))) 0, (genericptr_t)0); + 0, (void (*)(int, int, genericptr_t)) 0, (genericptr_t)0); /* * Set the IN_SIGHT bit for xray and night vision. @@ -909,7 +910,7 @@ int x, y; * This means that a right-edge (a blocked spot that has an open * spot on its right) will point to itself. */ -STATIC_OVL void +static void dig_point(row, col) int row, col; { @@ -990,7 +991,7 @@ int row, col; } } -STATIC_OVL void +static void fill_point(row, col) int row, col; { @@ -1086,7 +1087,7 @@ static char **cs_rows; static char *cs_left; static char *cs_right; -static void FDECL((*vis_func), (int, int, genericptr_t)); +static void (*vis_func)(int, int, genericptr_t); static genericptr_t varg; /* @@ -1315,10 +1316,10 @@ static genericptr_t varg; #else /* quadrants are really functions */ -STATIC_DCL int FDECL(_q1_path, (int, int, int, int)); -STATIC_DCL int FDECL(_q2_path, (int, int, int, int)); -STATIC_DCL int FDECL(_q3_path, (int, int, int, int)); -STATIC_DCL int FDECL(_q4_path, (int, int, int, int)); +static int _q1_path(int, int, int, int); +static int _q2_path(int, int, int, int); +static int _q3_path(int, int, int, int); +static int _q4_path(int, int, int, int); #define q1_path(sy, sx, y, x, dummy) result = _q1_path(sy, sx, y, x) #define q2_path(sy, sx, y, x, dummy) result = _q2_path(sy, sx, y, x) @@ -1328,7 +1329,7 @@ STATIC_DCL int FDECL(_q4_path, (int, int, int, int)); /* * Quadrant I (step < 0). */ -STATIC_OVL int +static int _q1_path(srow, scol, y2, x2) int scol, srow, y2, x2; { @@ -1372,7 +1373,7 @@ int scol, srow, y2, x2; /* * Quadrant IV (step > 0). */ -STATIC_OVL int +static int _q4_path(srow, scol, y2, x2) int scol, srow, y2, x2; { @@ -1416,7 +1417,7 @@ int scol, srow, y2, x2; /* * Quadrant II (step < 0). */ -STATIC_OVL int +static int _q2_path(srow, scol, y2, x2) int scol, srow, y2, x2; { @@ -1460,7 +1461,7 @@ int scol, srow, y2, x2; /* * Quadrant III (step > 0). */ -STATIC_OVL int +static int _q3_path(srow, scol, y2, x2) int scol, srow, y2, x2; { @@ -1561,16 +1562,16 @@ int col1, row1, col2, row2; static close2d *close_dy[CLOSE_MAX_BC_DY]; static far2d *far_dy[FAR_MAX_BC_DY]; -STATIC_DCL void FDECL(right_side, (int, int, int, int, int, int, int, char*)); -STATIC_DCL void FDECL(left_side, (int, int, int, int, int, int, int, char*)); -STATIC_DCL int FDECL(close_shadow, (int, int, int, int)); -STATIC_DCL int FDECL(far_shadow, (int, int, int, int)); +static void right_side(int, int, int, int, int, int, int, char*); +static void left_side(int, int, int, int, int, int, int, char*); +static int close_shadow(int, int, int, int); +static int far_shadow(int, int, int, int); /* * Initialize algorithm D's table pointers. If we don't have these, * then we do 3D table lookups. Verrrry slow. */ -STATIC_OVL void +static void view_init() { int i; @@ -1590,7 +1591,7 @@ view_init() */ #define OFF_TABLE 0xff -STATIC_OVL int +static int close_shadow(side, this_row, block_row, block_col) int side, this_row, block_row, block_col; { @@ -1619,7 +1620,7 @@ int side, this_row, block_row, block_col; } -STATIC_OVL int +static int far_shadow(side, this_row, block_row, block_col) int side, this_row, block_row, block_col; { @@ -1659,7 +1660,7 @@ int side, this_row, block_row, block_col; * * Figure out what could be seen on the right side of the source. */ -STATIC_OVL void +static void right_side(row, cb_row, cb_col, fb_row, fb_col, left, right_mark, limits) int row; /* current row */ int cb_row, cb_col; /* close block row and col */ @@ -1911,7 +1912,7 @@ char *limits; /* points at range limit for current row, or NULL */ * This routine is the mirror image of right_side(). Please see right_side() * for blow by blow comments. */ -STATIC_OVL void +static void left_side(row, cb_row, cb_col, fb_row, fb_col, left_mark, right, limits) int row; /* the current row */ int cb_row, cb_col; /* close block row and col */ @@ -2089,13 +2090,13 @@ char *limits; * seen from the source location. Initialize and fill the left most * and right most boundaries of what could be seen. */ -STATIC_OVL void +static void view_from(srow, scol, loc_cs_rows, left_most, right_most, range, func, arg) int srow, scol; /* source row and column */ char **loc_cs_rows; /* could_see array (row pointers) */ char *left_most, *right_most; /* limits of what could be seen */ int range; /* 0 if unlimited */ -void FDECL((*func), (int, int, genericptr_t)); +void (*func)(int, int, genericptr_t); genericptr_t arg; { register int i; @@ -2180,11 +2181,11 @@ genericptr_t arg; /* * Defines local to Algorithm C. */ -STATIC_DCL void FDECL(right_side, (int, int, int, char*)); -STATIC_DCL void FDECL(left_side, (int, int, int, char*)); +static void right_side(int, int, int, char*); +static void left_side(int, int, int, char*); /* Initialize algorithm C (nothing). */ -STATIC_OVL void +static void view_init() { } @@ -2193,7 +2194,7 @@ view_init() * Mark positions as visible on one quadrant of the right side. The * quadrant is determined by the value of the global variable step. */ -STATIC_OVL void +static void right_side(row, left, right_mark, limits) int row; /* current row */ int left; /* first (left side) visible spot on prev row */ @@ -2373,7 +2374,7 @@ char *limits; /* points at range limit for current row, or NULL */ * This routine is the mirror image of right_side(). See right_side() for * extensive comments. */ -STATIC_OVL void +static void left_side(row, left_mark, right, limits) int row, left_mark, right; char *limits; @@ -2493,14 +2494,14 @@ char *limits; * (srow,scol). NOTE this is (y,x)! Mark the visible locations in the * array provided. */ -STATIC_OVL void +static void view_from(srow, scol, loc_cs_rows, left_most, right_most, range, func, arg) int srow, scol; /* starting row and column */ char **loc_cs_rows; /* pointers to the rows of the could_see array */ char *left_most; /* min mark on each row */ char *right_most; /* max mark on each row */ int range; /* 0 if unlimited */ -void FDECL((*func), (int, int, genericptr_t)); +void (*func)(int, int, genericptr_t); genericptr_t arg; { register int i; /* loop counter */ @@ -2591,7 +2592,7 @@ genericptr_t arg; void do_clear_area(scol, srow, range, func, arg) int scol, srow, range; -void FDECL((*func), (int, int, genericptr_t)); +void (*func)(int, int, genericptr_t); genericptr_t arg; { /* If not centered on hero, do the hard work of figuring the area */ diff --git a/src/weapon.c b/src/weapon.c index c80ac0281..540979cd6 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -8,12 +8,12 @@ */ #include "hack.h" -static void FDECL(give_may_advance_msg, (int)); -static int FDECL(enhance_skill, (boolean)); -static boolean FDECL(could_advance, (int)); -static boolean FDECL(peaked_skill, (int)); -static int FDECL(slots_required, (int)); -static void FDECL(skill_advance, (int)); +static void give_may_advance_msg(int); +static int enhance_skill(boolean); +static boolean could_advance(int); +static boolean peaked_skill(int); +static int slots_required(int); +static void skill_advance(int); static int dmgval_core(struct obj*, struct monst*, struct damage_info_t*); /* Categories whose names don't come from OBJ_NAME(objects[type]) @@ -33,7 +33,7 @@ static int dmgval_core(struct obj*, struct monst*, struct damage_info_t*); #define PN_ESCAPE_SPELL (-13) #define PN_MATTER_SPELL (-14) -STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = { +static NEARDATA const short skill_names_indices[P_NUM_SKILLS] = { 0, DAGGER, KNIFE, AXE, PICK_AXE, SHORT_SWORD, BROADSWORD, LONG_SWORD, TWO_HANDED_SWORD, SCIMITAR, PN_SABER, CLUB, @@ -51,7 +51,7 @@ STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = { }; /* note: entry [0] isn't used */ -STATIC_VAR NEARDATA const char * const odd_skill_names[] = { +static NEARDATA const char * const odd_skill_names[] = { "no skill", "bare hands", /* use barehands_or_martial[] instead */ "two weapon combat", @@ -69,11 +69,11 @@ STATIC_VAR NEARDATA const char * const odd_skill_names[] = { "matter spells", }; /* indexed vis `is_martial() */ -STATIC_VAR NEARDATA const char * const barehands_or_martial[] = { +static NEARDATA const char * const barehands_or_martial[] = { "bare handed combat", "martial arts" }; -STATIC_OVL void +static void give_may_advance_msg(skill) int skill; { @@ -87,12 +87,12 @@ int skill; "fighting "); } -STATIC_DCL boolean FDECL(can_advance, (int, BOOLEAN_P)); -STATIC_DCL boolean FDECL(could_advance, (int)); -STATIC_DCL boolean FDECL(peaked_skill, (int)); -STATIC_DCL int FDECL(slots_required, (int)); +static boolean can_advance(int, BOOLEAN_P); +static boolean could_advance(int); +static boolean peaked_skill(int); +static int slots_required(int); -STATIC_DCL void FDECL(skill_advance, (int)); +static void skill_advance(int); #define P_NAME(type) ((skill_names_indices[type] > 0) ? \ OBJ_NAME(objects[skill_names_indices[type]]) : \ @@ -547,10 +547,10 @@ long silverhit; } } -STATIC_DCL struct obj *FDECL(oselect, (struct monst *, int)); +static struct obj *oselect(struct monst *, int); #define Oselect(x) if ((otmp = oselect(mtmp, x)) != 0) return (otmp); -STATIC_OVL struct obj * +static struct obj * oselect(mtmp, x) struct monst *mtmp; int x; @@ -1124,7 +1124,7 @@ int skill; } /* return the # of slots required to advance the skill */ -STATIC_OVL int +static int slots_required(skill) int skill; { @@ -1181,7 +1181,7 @@ can_advance_something() } /* return true if this skill could be advanced if more slots were available */ -STATIC_OVL boolean +static boolean could_advance(skill) int skill; { @@ -1196,7 +1196,7 @@ int skill; /* return true if this skill has reached its maximum and there's been enough practice to become eligible for the next step if that had been possible */ -STATIC_OVL boolean +static boolean peaked_skill(skill) int skill; { @@ -1210,7 +1210,7 @@ int skill; /* return true if this skill requires only a bit more exercise before it can * be advanced (if it's 80% of the way to the next level) */ -STATIC_OVL boolean +static boolean can_almost_advance(skill) int skill; { @@ -1229,7 +1229,7 @@ int skill; } } -STATIC_OVL void +static void skill_advance(skill) int skill; { diff --git a/src/wield.c b/src/wield.c index cb7e910b6..0e4941964 100644 --- a/src/wield.c +++ b/src/wield.c @@ -50,8 +50,8 @@ * No item may be in more than one of these slots. */ -static boolean FDECL(cant_wield_corpse, (struct obj *)); -STATIC_DCL int FDECL(ready_weapon, (struct obj *)); +static boolean cant_wield_corpse(struct obj *); +static int ready_weapon(struct obj *); static int wield(boolean prompt_for_obj); @@ -162,7 +162,7 @@ struct obj *obj; return TRUE; } -STATIC_OVL int +static int ready_weapon(wep) struct obj *wep; { diff --git a/src/windows.c b/src/windows.c index 9f918548b..8b0299bb2 100644 --- a/src/windows.c +++ b/src/windows.c @@ -13,7 +13,7 @@ extern struct window_procs curses_procs; /* cannot just blindly include winX.h without including all of X11 stuff */ /* and must get the order of include files right. Don't bother */ extern struct window_procs X11_procs; -extern void NDECL(win_X11_init); +extern void win_X11_init(); #endif #ifdef QT_GRAPHICS extern struct window_procs Qt_procs; @@ -26,12 +26,12 @@ extern struct window_procs mac_procs; #endif #ifdef BEOS_GRAPHICS extern struct window_procs beos_procs; -extern void NDECL(be_win_init); +extern void be_win_init(); #endif #ifdef AMIGA_INTUITION extern struct window_procs amii_procs; extern struct window_procs amiv_procs; -extern void NDECL(ami_wininit_data); +extern void ami_wininit_data(); #endif #ifdef WIN32_GRAPHICS extern struct window_procs win32_procs; @@ -51,14 +51,14 @@ extern struct window_procs dummy_procs; extern struct window_procs lisp_procs; #endif -STATIC_DCL void FDECL(def_raw_print, (const char *s)); +static void def_raw_print(const char *s); NEARDATA struct window_procs windowprocs; static struct win_choices { struct window_procs *procs; - void NDECL((*ini_routine)); /* optional (can be 0) */ + void (*ini_routine)(void); /* optional (can be 0) */ } winchoices[] = { #ifdef TTY_GRAPHICS { &tty_procs, win_tty_init }, @@ -103,8 +103,7 @@ struct win_choices { { 0, 0 } /* must be last */ }; -STATIC_OVL -void +static void def_raw_print(s) const char *s; { diff --git a/src/wizard.c b/src/wizard.c index e8963689f..f08a6776b 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -11,13 +11,13 @@ extern const int monstr[]; -STATIC_DCL short FDECL(which_arti, (int)); -STATIC_DCL boolean FDECL(mon_has_arti, (struct monst *, SHORT_P)); -STATIC_DCL struct monst *FDECL(other_mon_has_arti, (struct monst *, SHORT_P)); -STATIC_DCL struct obj *FDECL(on_ground, (SHORT_P)); -STATIC_DCL boolean FDECL(you_have, (int)); -static unsigned long FDECL(target_on, (int, struct monst *)); -static unsigned long FDECL(strategy, (struct monst *)); +static short which_arti(int); +static boolean mon_has_arti(struct monst *, SHORT_P); +static struct monst *other_mon_has_arti(struct monst *, SHORT_P); +static struct obj *on_ground(SHORT_P); +static boolean you_have(int); +static unsigned long target_on(int, struct monst *); +static unsigned long strategy(struct monst *); static NEARDATA const int nasties[] = { /* neutral */ @@ -131,7 +131,7 @@ register struct monst *mtmp; #define M_Wants(mask) (mtmp->data->mflags3 & (mask)) -STATIC_OVL short +static short which_arti(mask) register int mask; { @@ -150,7 +150,7 @@ register int mask; * since bell, book, candle, and amulet are all objects, not really * artifacts right now. [MRS] */ -STATIC_OVL boolean +static boolean mon_has_arti(mtmp, otyp) register struct monst *mtmp; register short otyp; @@ -168,7 +168,7 @@ register short otyp; } -STATIC_OVL struct monst * +static struct monst * other_mon_has_arti(mtmp, otyp) register struct monst *mtmp; register short otyp; @@ -183,7 +183,7 @@ register short otyp; return((struct monst *)0); } -STATIC_OVL struct obj * +static struct obj * on_ground(otyp) register short otyp; { @@ -198,7 +198,7 @@ register short otyp; return((struct obj *)0); } -STATIC_OVL boolean +static boolean you_have(mask) register int mask; { diff --git a/src/worm.c b/src/worm.c index fe58f3201..f6d4ed418 100644 --- a/src/worm.c +++ b/src/worm.c @@ -13,10 +13,10 @@ struct wseg { xchar wx, wy; /* the segment's position */ }; -STATIC_DCL void FDECL(toss_wsegs, (struct wseg *, BOOLEAN_P)); -STATIC_DCL void FDECL(shrink_worm, (int)); -STATIC_DCL void FDECL(random_dir, (XCHAR_P, XCHAR_P, xchar *, xchar *)); -STATIC_DCL struct wseg *FDECL(create_worm_tail, (int)); +static void toss_wsegs(struct wseg *, BOOLEAN_P); +static void shrink_worm(int); +static void random_dir(XCHAR_P, XCHAR_P, xchar *, xchar *); +static struct wseg *create_worm_tail(int); /* Description of long worm implementation. * @@ -140,8 +140,7 @@ int wseg_count; * Get rid of all worm segments on and following the given pointer curr. * The display may or may not need to be updated as we free the segments. */ -STATIC_OVL -void +static void toss_wsegs(curr, display_update) register struct wseg *curr; register boolean display_update; @@ -173,8 +172,7 @@ register boolean display_update; * * Remove the tail segment of the worm (the starting segment of the list). */ -STATIC_OVL -void +static void shrink_worm(wnum) int wnum; /* worm number */ { @@ -729,8 +727,7 @@ xchar x, y; * This function, and the loop it serves, could be eliminated by coding * enexto() with a search radius. */ -STATIC_OVL -void +static void random_dir(x, y, nx, ny) register xchar x, y; register xchar *nx, *ny; @@ -797,8 +794,7 @@ struct monst *mtmp; * * will create a worm tail chain of (num_segs + 1) and return a pointer to it. */ -STATIC_OVL -struct wseg * +static struct wseg * create_worm_tail(num_segs) int num_segs; { diff --git a/src/worn.c b/src/worn.c index 431649033..b8ed80caa 100644 --- a/src/worn.c +++ b/src/worn.c @@ -3,9 +3,9 @@ #include "hack.h" -STATIC_DCL void FDECL(m_lose_armor, (struct monst *, struct obj *)); -STATIC_DCL void FDECL(m_dowear_type, (struct monst *, long, BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL int FDECL(extra_pref, (struct monst *, struct obj *)); +static void m_lose_armor(struct monst *, struct obj *); +static void m_dowear_type(struct monst *, long, BOOLEAN_P, BOOLEAN_P); +static int extra_pref(struct monst *, struct obj *); const struct worn { long w_mask; @@ -543,7 +543,7 @@ boolean creation; m_dowear_type(mon, W_ARM, creation, RACE_EXCEPTION); } -STATIC_OVL void +static void m_dowear_type(mon, flag, creation, racialexception) struct monst *mon; long flag; @@ -713,7 +713,7 @@ long flag; } /* remove an item of armor and then drop it */ -STATIC_OVL void +static void m_lose_armor(mon, obj) struct monst *mon; struct obj *obj; diff --git a/src/write.c b/src/write.c index b507708ab..dcdc1fa0c 100644 --- a/src/write.c +++ b/src/write.c @@ -2,8 +2,8 @@ #include "hack.h" -static boolean FDECL(label_known, (int, struct obj *)); -static char *FDECL(new_book_description, (int, char *)); +static boolean label_known(int, struct obj *); +static char *new_book_description(int, char *); /* * returns basecost of a scroll or a spellbook diff --git a/src/zap.c b/src/zap.c index f6efb5251..19f5b61d1 100644 --- a/src/zap.c +++ b/src/zap.c @@ -20,16 +20,16 @@ extern boolean notonhead; /* for long worms */ extern boolean m_using; static boolean zombie_can_dig(xchar x, xchar y); -STATIC_DCL void FDECL(polyuse, (struct obj*, int, int)); -STATIC_DCL void FDECL(create_polymon, (struct obj *, int)); -STATIC_DCL boolean FDECL(zap_updown, (struct obj *)); -STATIC_DCL void FDECL(zhitu, (int, int, const char *, XCHAR_P, XCHAR_P)); -STATIC_DCL void FDECL(revive_egg, (struct obj *)); -STATIC_DCL boolean FDECL(zap_steed, (struct obj *)); +static void polyuse(struct obj*, int, int); +static void create_polymon(struct obj *, int); +static boolean zap_updown(struct obj *); +static void zhitu(int, int, const char *, XCHAR_P, XCHAR_P); +static void revive_egg(struct obj *); +static boolean zap_steed(struct obj *); -STATIC_DCL int FDECL(zap_hit, (int, int)); -STATIC_DCL void FDECL(backfire, (struct obj *)); -STATIC_DCL int FDECL(spell_hit_bonus, (int)); +static int zap_hit(int, int); +static void backfire(struct obj *); +static int spell_hit_bonus(int); #define ZT_MAGIC_MISSILE (AD_MAGM-1) #define ZT_FIRE (AD_FIRE-1) @@ -50,7 +50,7 @@ STATIC_DCL int FDECL(spell_hit_bonus, (int)); #define M_IN_WATER(ptr) ((ptr)->mlet == S_EEL || amphibious(ptr) || is_swimmer(ptr)) -STATIC_VAR const char are_blinded_by_the_flash[] = "are blinded by the flash!"; +static const char are_blinded_by_the_flash[] = "are blinded by the flash!"; const char * const flash_types[] = { /* also used in buzzmu(mcastu.c) */ "magic missile", /* Wands must be 0-9 */ @@ -1032,7 +1032,7 @@ struct obj *corpse; } } -STATIC_OVL void +static void revive_egg(obj) struct obj *obj; { @@ -1395,7 +1395,7 @@ struct obj *obj; * there's a random factor here to keep from always using the stuff * at the top of the pile. */ -STATIC_OVL void +static void polyuse(objhdr, mat, minwt) struct obj *objhdr; int mat, minwt; @@ -1436,7 +1436,7 @@ int mat, minwt; * Polymorph some of the stuff in this pile into a monster, preferably * a golem of the kind okind. */ -STATIC_OVL void +static void create_polymon(obj, okind) struct obj *obj; int okind; @@ -1860,7 +1860,7 @@ int id; } /* stone-to-flesh spell hits and maybe transforms or animates obj */ -STATIC_OVL int +static int stone_to_flesh_obj(obj) struct obj *obj; { @@ -2229,7 +2229,7 @@ struct obj *obj, *otmp; int bhitpile(obj, fhito, tx, ty, zz) struct obj *obj; -int FDECL((*fhito), (OBJ_P, OBJ_P)); +int (*fhito)(OBJ_P, OBJ_P); int tx, ty; schar zz; { @@ -2339,7 +2339,7 @@ register struct obj *obj; } } -STATIC_OVL void +static void backfire(otmp) struct obj *otmp; { @@ -2831,7 +2831,7 @@ long duration; * Return TRUE if the steed was hit by the wand. * Return FALSE if the steed was not hit by the wand. */ -STATIC_OVL boolean +static boolean zap_steed(obj) struct obj *obj; /* wand or spell */ { @@ -3065,7 +3065,7 @@ boolean youattack, allow_cancel_kill, self_cancel; } /* you've zapped an immediate type wand up or down */ -STATIC_OVL boolean +static boolean zap_updown(obj) struct obj *obj; /* wand or spell */ { @@ -3409,7 +3409,7 @@ int dmg; /* base amount to be adjusted by bonus or penalty */ * Generate the to hit bonus for a spell. Based on the hero's skill in * spell class and dexterity. */ -STATIC_OVL int +static int spell_hit_bonus(skill) int skill; { @@ -3473,7 +3473,7 @@ register struct monst *mtmp; mon_nam(mtmp) : "it"); } -STATIC_OVL void +static void skiprange(range, skipstart, skipend) int range, *skipstart, *skipend; { @@ -3509,8 +3509,8 @@ struct monst * bhit(ddx, ddy, range, weapon, fhitm, fhito, obj, obj_destroyed) register int ddx, ddy, range; /**< direction and range */ int weapon; /**< see values in hack.h */ -int FDECL((*fhitm), (MONST_P, OBJ_P)), /**< fns called when mon/obj hit */ -FDECL((*fhito), (OBJ_P, OBJ_P)); +int (*fhitm) (MONST_P, OBJ_P), /**< fns called when mon/obj hit */ +(*fhito)(OBJ_P, OBJ_P); struct obj *obj; /**< object tossed/used */ boolean *obj_destroyed; /**< has object been deallocated? Pointer to boolean, may be NULL */ { @@ -4072,7 +4072,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ return(tmp); } -STATIC_OVL void +static void zhitu(type, nd, fltxt, sx, sy) int type, nd; const char *fltxt; @@ -4320,7 +4320,7 @@ boolean u_caused; } /* will zap/spell/breath attack score a hit against armor class `ac'? */ -STATIC_OVL int +static int zap_hit(ac, type) int ac; int type; /* either hero cast spell type or 0 */ @@ -4337,7 +4337,7 @@ int type; /* either hero cast spell type or 0 */ return (3 - chance) < ac+spell_bonus; } -STATIC_OVL void +static void disintegrate_mon(mon, type, fltxt) struct monst *mon; int type; /* hero vs other */ @@ -5142,7 +5142,7 @@ const char *const destroy_strings[][3] = { /* guts of destroy_item(), which ought to be called maybe_destroy_items(); caller must decide whether obj is eligible */ -STATIC_OVL void +static void destroy_one_item(obj, osym, dmgtyp) struct obj *obj; int osym, dmgtyp; @@ -5552,7 +5552,7 @@ int damage, tell; #define MAXWISHTRY 5 -STATIC_OVL void +static void wishcmdassist(triesleft) int triesleft; { diff --git a/sys/autoconf/Makefile.src b/sys/autoconf/Makefile.src index bb2c4de2e..23fc6bcba 100644 --- a/sys/autoconf/Makefile.src +++ b/sys/autoconf/Makefile.src @@ -251,7 +251,7 @@ HACKINCL = align.h amiconf.h artifact.h artilist.h attrib.h beconf.h color.h \ monattk.h mondata.h monflag.h monst.h monsym.h obj.h objclass.h \ os2conf.h patchlevel.h pcconf.h permonst.h prop.h rect.h region.h rm.h \ sp_lev.h spell.h system.h tcap.h timeout.h tosconf.h tradstdc.h \ - trampoli.h trap.h unixconf.h vision.h vmsconf.h wintty.h \ + trap.h unixconf.h vision.h vmsconf.h wintty.h \ winX.h winprocs.h wintype.h you.h youprop.h HSOURCES = $(HACKINCL) date.h onames.h pm.h vis_tab.h\ @@ -499,7 +499,7 @@ $(HACK_H): ../include/hack.h $(CONFIG_H) ../include/align.h \ ../include/timeout.h ../include/trap.h ../include/flag.h \ ../include/rm.h ../include/vision.h ../include/display.h \ ../include/engrave.h ../include/rect.h ../include/region.h \ - ../include/winprocs.h ../include/wintty.h ../include/trampoli.h + ../include/winprocs.h ../include/wintty.h touch $(HACK_H) # nhlan.o: $(srcdir)/../sys/share/nhlan.c $(HACK_H) diff --git a/sys/autoconf/Makefile.utl b/sys/autoconf/Makefile.utl index 657917ad6..616863fa3 100644 --- a/sys/autoconf/Makefile.utl +++ b/sys/autoconf/Makefile.utl @@ -231,7 +231,7 @@ lev_main.o: lev_main.c $(HACK_H) ../include/sp_lev.h ../include/tcap.h \ # is one "_cplusplus" inside a comment lev_lex.o: lev_lex.c $(HACK_H) ../include/lev_comp.h ../include/sp_lev.h @echo $(CC) -c $(CFLAGS) lev_lex.c - @$(CC) -c $(CFLAGS) -DWEIRD_LEX=`egrep -c _cplusplus lev_lex.c` lev_lex.c + @$(CC) -c $(CFLAGS) -D_POSIX_C_SOURCE=200809L -DWEIRD_LEX=`egrep -c _cplusplus lev_lex.c` lev_lex.c ../include/lev_comp.h: lev_yacc.c @@ -263,7 +263,7 @@ dgn_main.o: dgn_main.c $(CONFIG_H) ../include/dlb.h # see dgn_comp.l for WEIRD_LEX discussion dgn_lex.o: dgn_lex.c $(CONFIG.H) ../include/dgn_comp.h ../include/dgn_file.h @echo $(CC) -c $(CFLAGS) dgn_lex.c - @$(CC) -c $(CFLAGS) -DWEIRD_LEX=`egrep -c _cplusplus dgn_lex.c` dgn_lex.c + @$(CC) -c $(CFLAGS) -D_POSIX_C_SOURCE=200809L -DWEIRD_LEX=`egrep -c _cplusplus dgn_lex.c` dgn_lex.c ../include/dgn_comp.h: dgn_yacc.c diff --git a/sys/share/dgn_lex.c b/sys/share/dgn_lex.c index 054a25dcb..f79699d0f 100644 --- a/sys/share/dgn_lex.c +++ b/sys/share/dgn_lex.c @@ -155,19 +155,19 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void FDECL(yyrestart, (FILE *)); - -void FDECL(yy_switch_to_buffer, (YY_BUFFER_STATE)); -void NDECL(yy_load_buffer_state); -YY_BUFFER_STATE FDECL(yy_create_buffer, (FILE *,int)); -void FDECL(yy_delete_buffer, (YY_BUFFER_STATE)); -void FDECL(yy_init_buffer, (YY_BUFFER_STATE,FILE *)); -void FDECL(yy_flush_buffer, (YY_BUFFER_STATE)); +void yyrestart(FILE *); + +void yy_switch_to_buffer(YY_BUFFER_STATE); +void yy_load_buffer_state(); +YY_BUFFER_STATE yy_create_buffer(FILE *,int); +void yy_delete_buffer(YY_BUFFER_STATE); +void yy_init_buffer(YY_BUFFER_STATE,FILE *); +void yy_flush_buffer(YY_BUFFER_STATE); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) -static genericptr_t FDECL(yy_flex_alloc, (yy_size_t)); -static genericptr_t FDECL(yy_flex_realloc2, (genericptr_t,yy_size_t,int)); -static void FDECL(yy_flex_free, (genericptr_t)); +static genericptr_t yy_flex_alloc(yy_size_t); +static genericptr_t yy_flex_realloc2(genericptr_t,yy_size_t,int); +static void yy_flex_free(genericptr_t); #define yy_new_buffer yy_create_buffer @@ -193,10 +193,10 @@ typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext -static yy_state_type NDECL(yy_get_previous_state); -static yy_state_type FDECL(yy_try_NUL_trans, (yy_state_type)); -static int NDECL(yy_get_next_buffer); -static void FDECL(yy_fatal_error, (const char *)); +static yy_state_type yy_get_previous_state(); +static yy_state_type yy_try_NUL_trans(yy_state_type); +static int yy_get_next_buffer(); +static void yy_fatal_error(const char *); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -422,11 +422,11 @@ char *yytext; * yyunput is properly declared in flex.skel. */ #if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) -int FDECL(yyback, (int *,int)); -int NDECL(yylook); -int NDECL(yyinput); -int NDECL(yywrap); -int NDECL(yylex); +int yyback(int *,int); +int yylook(); +int yyinput(); +int yywrap(); +int yylex(); /* Traditional lexes let yyunput() and yyoutput() default to int; * newer ones may declare them as void since they don't return * values. For even more fun, the lex supplied as part of the @@ -456,23 +456,23 @@ int NDECL(yylex); # undef VOIDYYPUT # endif # ifdef VOIDYYPUT -void FDECL(yyunput, (int)); -void FDECL(yyoutput, (int)); +void yyunput(int); +void yyoutput(int); # else -int FDECL(yyunput, (int)); -int FDECL(yyoutput, (int)); +int yyunput(int); +int yyoutput(int); # endif #endif /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ #ifdef FLEX_SCANNER #define YY_MALLOC_DECL \ - genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t,size_t)); + genericptr_t malloc(size_t); \ + genericptr_t realloc(genericptr_t,size_t); #endif -void FDECL(init_yyin, (FILE *)); -void FDECL(init_yyout, (FILE *)); +void init_yyin(FILE *); +void init_yyout(FILE *); /* this doesn't always get put in dgn_comp.h * (esp. when using older versions of bison) @@ -488,19 +488,19 @@ int line_number = 1; */ #ifndef YY_SKIP_YYWRAP -extern int NDECL(yywrap); +extern int yywrap(); #endif #ifndef YY_NO_UNPUT -static void FDECL(yyunput, (int,char *)); +static void yyunput(int,char *); #endif #ifndef yytext_ptr -static void FDECL(yy_flex_strncpy, (char *,const char *,int)); +static void yy_flex_strncpy(char *,const char *,int); #endif #ifndef YY_NO_INPUT -static int NDECL(input); +static int input(); #endif /* Amount of stuff to slurp up with each read. */ @@ -575,7 +575,7 @@ static int NDECL(input); (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION -int NDECL(yylex); +int yylex(); int yylex() { register yy_state_type yy_current_state; @@ -1329,7 +1329,7 @@ YY_BUFFER_STATE b; #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE -extern int FDECL(isatty, (int)); +extern int isatty(int); #endif #endif diff --git a/sys/share/dgn_yacc.c b/sys/share/dgn_yacc.c index 427cf1437..cbd08ac23 100644 --- a/sys/share/dgn_yacc.c +++ b/sys/share/dgn_yacc.c @@ -58,18 +58,18 @@ static int yygrowstack(void); #include "date.h" #include "dgn_file.h" -void FDECL(yyerror, (const char *)); -void FDECL(yywarning, (const char *)); -int NDECL(yylex); -int NDECL(yyparse); -int FDECL(getchain, (char *)); -int NDECL(check_dungeon); -int NDECL(check_branch); -int NDECL(check_level); -void NDECL(init_dungeon); -void NDECL(init_branch); -void NDECL(init_level); -void NDECL(output_dgn); +void yyerror(const char *); +void yywarning(const char *); +int yylex(); +int yyparse(); +int getchain(char *); +int check_dungeon(); +int check_branch(); +int check_level(); +void init_dungeon(); +void init_branch(); +void init_level(); +void output_dgn(); #define Free(ptr) free((genericptr_t)ptr) diff --git a/sys/share/ioctl.c b/sys/share/ioctl.c index c8947e480..bf0605434 100644 --- a/sys/share/ioctl.c +++ b/sys/share/ioctl.c @@ -74,12 +74,12 @@ struct termio termio; #endif #ifdef _M_UNIX -extern void NDECL(sco_mapon); -extern void NDECL(sco_mapoff); +extern void sco_mapon(); +extern void sco_mapoff(); #endif #ifdef __linux__ -extern void NDECL(linux_mapon); -extern void NDECL(linux_mapoff); +extern void linux_mapon(); +extern void linux_mapoff(); #endif #ifdef AUX diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index 776e048ce..56d30e442 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -155,19 +155,19 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void FDECL(yyrestart, (FILE *)); - -void FDECL(yy_switch_to_buffer, (YY_BUFFER_STATE)); -void NDECL(yy_load_buffer_state); -YY_BUFFER_STATE FDECL(yy_create_buffer, (FILE *,int)); -void FDECL(yy_delete_buffer, (YY_BUFFER_STATE)); -void FDECL(yy_init_buffer, (YY_BUFFER_STATE,FILE *)); -void FDECL(yy_flush_buffer, (YY_BUFFER_STATE)); +void yyrestart(FILE *); + +void yy_switch_to_buffer(YY_BUFFER_STATE); +void yy_load_buffer_state(); +YY_BUFFER_STATE yy_create_buffer(FILE *,int); +void yy_delete_buffer(YY_BUFFER_STATE); +void yy_init_buffer(YY_BUFFER_STATE,FILE *); +void yy_flush_buffer(YY_BUFFER_STATE); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) -static genericptr_t FDECL(yy_flex_alloc, (yy_size_t)); -static genericptr_t FDECL(yy_flex_realloc2, (genericptr_t,yy_size_t,int)); -static void FDECL(yy_flex_free, (genericptr_t)); +static genericptr_t yy_flex_alloc(yy_size_t); +static genericptr_t yy_flex_realloc2(genericptr_t,yy_size_t,int); +static void yy_flex_free(genericptr_t); #define yy_new_buffer yy_create_buffer @@ -193,10 +193,10 @@ typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext -static yy_state_type NDECL(yy_get_previous_state); -static yy_state_type FDECL(yy_try_NUL_trans, (yy_state_type)); -static int NDECL(yy_get_next_buffer); -static void FDECL(yy_fatal_error, (const char *)); +static yy_state_type yy_get_previous_state(); +static yy_state_type yy_try_NUL_trans(yy_state_type); +static int yy_get_next_buffer(); +static void yy_fatal_error(const char *); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -700,11 +700,11 @@ char *yytext; * yyunput is properly declared in flex.skel. */ #if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) -int FDECL(yyback, (int *,int)); -int NDECL(yylook); -int NDECL(yyinput); -int NDECL(yywrap); -int NDECL(yylex); +int yyback(int *,int); +int yylook(); +int yyinput(); +int yywrap(); +int yylex(); /* Traditional lexes let yyunput() and yyoutput() default to int; * newer ones may declare them as void since they don't return * values. For even more fun, the lex supplied as part of the @@ -734,22 +734,22 @@ int NDECL(yylex); # undef VOIDYYPUT # endif # ifdef VOIDYYPUT -void FDECL(yyunput, (int)); -void FDECL(yyoutput, (int)); +void yyunput(int); +void yyoutput(int); # else -int FDECL(yyunput, (int)); -int FDECL(yyoutput, (int)); +int yyunput(int); +int yyoutput(int); # endif #endif /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ #ifdef FLEX_SCANNER #define YY_MALLOC_DECL \ - genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t,size_t)); + genericptr_t malloc(size_t); \ + genericptr_t realloc(genericptr_t,size_t); #endif -void FDECL(init_yyin, (FILE *)); -void FDECL(init_yyout, (FILE *)); +void init_yyin(FILE *); +void init_yyout(FILE *); /* * This doesn't always get put in lev_comp.h @@ -769,19 +769,19 @@ static int map_cnt = 0; */ #ifndef YY_SKIP_YYWRAP -extern int NDECL(yywrap); +extern int yywrap(); #endif #ifndef YY_NO_UNPUT -static void FDECL(yyunput, (int,char *)); +static void yyunput(int,char *); #endif #ifndef yytext_ptr -static void FDECL(yy_flex_strncpy, (char *,const char *,int)); +static void yy_flex_strncpy(char *,const char *,int); #endif #ifndef YY_NO_INPUT -static int NDECL(input); +static int input(); #endif /* Amount of stuff to slurp up with each read. */ @@ -856,7 +856,7 @@ static int NDECL(input); (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION -int NDECL(yylex); +int yylex(); int yylex() { register yy_state_type yy_current_state; @@ -1935,7 +1935,7 @@ YY_BUFFER_STATE b; #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE -extern int FDECL(isatty, (int)); +extern int isatty(int); #endif #endif diff --git a/sys/share/lev_yacc.c b/sys/share/lev_yacc.c index d596015f9..b488c7006 100644 --- a/sys/share/lev_yacc.c +++ b/sys/share/lev_yacc.c @@ -399,44 +399,44 @@ extern void VDECL(lc_error, (const char *, ...)); extern void VDECL(lc_warning, (const char *, ...)); -extern void FDECL(yyerror, (const char *)); -extern void FDECL(yywarning, (const char *)); -extern int NDECL(yylex); -int NDECL(yyparse); - extern void FDECL(include_push, (const char *)); -extern int NDECL(include_pop); - -extern int FDECL(get_floor_type, (CHAR_P)); -extern int FDECL(get_room_type, (char *)); -extern int FDECL(get_trap_type, (char *)); -extern int FDECL(get_monster_id, (char *,CHAR_P)); -extern int FDECL(get_object_id, (char *,CHAR_P)); -extern boolean FDECL(check_monster_char, (CHAR_P)); -extern boolean FDECL(check_object_char, (CHAR_P)); -extern char FDECL(what_map_char, (CHAR_P)); -extern void FDECL(scan_map, (char *, sp_lev *)); -extern void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); -extern genericptr_t FDECL(get_last_opcode_data1, (sp_lev *, int)); -extern genericptr_t FDECL(get_last_opcode_data2, (sp_lev *, int,int)); -extern boolean FDECL(check_subrooms, (sp_lev *)); -extern boolean FDECL(write_level_file, (char *,sp_lev *)); -extern struct opvar *FDECL(set_opvar_int, (struct opvar *, long)); +extern void yyerror(const char *); +extern void yywarning(const char *); +extern int yylex(); +int yyparse(); + extern void include_push(const char *); +extern int include_pop(); + +extern int get_floor_type(CHAR_P); +extern int get_room_type(char *); +extern int get_trap_type(char *); +extern int get_monster_id(char *,CHAR_P); +extern int get_object_id(char *,CHAR_P); +extern boolean check_monster_char(CHAR_P); +extern boolean check_object_char(CHAR_P); +extern char what_map_char(CHAR_P); +extern void scan_map(char *, sp_lev *); +extern void add_opcode(sp_lev *, int, genericptr_t); +extern genericptr_t get_last_opcode_data1(sp_lev *, int); +extern genericptr_t get_last_opcode_data2(sp_lev *, int,int); +extern boolean check_subrooms(sp_lev *); +extern boolean write_level_file(char *,sp_lev *); +extern struct opvar *set_opvar_int(struct opvar *, long); extern void VDECL(add_opvars, (sp_lev *, const char *, ...)); -extern struct lc_funcdefs *FDECL(funcdef_new,(long,char *)); -extern void FDECL(funcdef_free_all,(struct lc_funcdefs *)); -extern struct lc_funcdefs *FDECL(funcdef_defined,(struct lc_funcdefs *,char *, int)); +extern struct lc_funcdefs *funcdef_new(long,char *); +extern void funcdef_free_all(struct lc_funcdefs *); +extern struct lc_funcdefs *funcdef_defined(struct lc_funcdefs *,char *, int); -extern struct lc_vardefs *FDECL(vardef_new,(long,char *)); -extern void FDECL(vardef_free_all,(struct lc_vardefs *)); -extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); +extern struct lc_vardefs *vardef_new(long,char *); +extern void vardef_free_all(struct lc_vardefs *); +extern struct lc_vardefs *vardef_defined(struct lc_vardefs *,char *, int); -extern void FDECL(splev_add_from, (sp_lev *, sp_lev *)); +extern void splev_add_from(sp_lev *, sp_lev *); -extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long)); -extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *, char *, long)); +extern void check_vardef_type(struct lc_vardefs *, char *, long); +extern struct lc_vardefs *add_vardef_type(struct lc_vardefs *, char *, long); -extern int FDECL(reverse_jmp_opcode, (int)); +extern int reverse_jmp_opcode(int); struct coord { @@ -2366,7 +2366,7 @@ yyparse () #endif #endif { - + int yystate; int yyn; int yyresult; diff --git a/sys/share/nhlan.c b/sys/share/nhlan.c index 27b1783b6..23ebd4787 100644 --- a/sys/share/nhlan.c +++ b/sys/share/nhlan.c @@ -26,11 +26,11 @@ #ifdef LAN_MAIL /* Port specific code needs to implement these routines for LAN_MAIL */ -extern char *FDECL(get_username, (int *)); -extern boolean NDECL(mail_check); -extern boolean FDECL(mail_fetch, (struct lan_mail_struct *)); -extern void FDECL(mail_init, (char *)); -extern void NDECL(mail_finish); +extern char *get_username(int *); +extern boolean mail_check(); +extern boolean mail_fetch(struct lan_mail_struct *); +extern void mail_init(char *); +extern void mail_finish(); struct lan_mail_struct mailmessage; #endif /* LAN_MAIL */ diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index bd374be05..a5cb47f1a 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -22,14 +22,7 @@ #include /* for getcwd() prototype */ #endif -#ifdef OVL0 -#define SHARED_DCL -#else -#define SHARED_DCL extern -#endif - - -SHARED_DCL char orgdir[PATHLEN]; /* also used in pcsys.c, amidos.c */ +char orgdir[PATHLEN]; /* also used in pcsys.c, amidos.c */ #ifdef TOS boolean run_from_desktop = TRUE; /* should we pause before exiting?? */ @@ -40,14 +33,14 @@ long _stksize = 16*1024; #ifdef AMIGA extern int bigscreen; -void NDECL( preserve_icon ); +void preserve_icon (); #endif -STATIC_DCL void FDECL(process_options,(int argc,char **argv)); -STATIC_DCL void NDECL(nhusage); +static void process_options(int argc,char **argv); +static void nhusage(); #if defined(MICRO) || defined(WIN32) || defined(OS2) -extern void FDECL(nethack_exit,(int)); +extern void nethack_exit(int); #else #define nethack_exit exit #endif @@ -57,32 +50,25 @@ extern boolean getreturn_enabled; /* from sys/share/pcsys.c */ #endif #if defined(MSWIN_GRAPHICS) -extern void NDECL(mswin_destroy_reg); +extern void mswin_destroy_reg(); #endif #ifdef EXEPATH -STATIC_DCL char *FDECL(exepath,(char *)); +static char *exepath(char *); #endif -#ifdef OVL0 -int FDECL(main, (int,char **)); -#endif +int main(int,char **); -extern int FDECL(pcmain, (int,char **)); +extern int pcmain(int,char **); #if defined(__BORLANDC__) && !defined(_WIN32) -void NDECL( startup ); -# ifdef OVLB +void startup (); unsigned _stklen = STKSIZ; -# else -extern unsigned _stklen; -# endif #endif -#ifdef OVL0 /* If the graphics version is built, we don't need a main; it is skipped - * to help MinGW decide which entry point to choose. If both main and + * to help MinGW decide which entry point to choose. If both main and * WinMain exist, the resulting executable won't work correctly. */ #ifndef MSWIN_GRAPHICS @@ -101,8 +87,6 @@ char *argv[]; return 0; } #endif /*MSWIN_GRAPHICS*/ -#endif /*OVL0*/ -#ifdef OVL1 int pcmain(argc,argv) @@ -451,7 +435,7 @@ char *argv[]; return resuming; } -STATIC_OVL void +static void process_options(argc, argv) int argc; char *argv[]; @@ -584,7 +568,7 @@ char *argv[]; } } -STATIC_OVL void +static void nhusage() { char buf1[BUFSZ], buf2[BUFSZ], *bufptr; @@ -654,8 +638,6 @@ boolean wr; if (wr) check_recordfile(dir ? dir : thisdir); } #endif /* CHDIR */ -#endif /*OVL1*/ -#ifdef OVLB #ifdef PORT_HELP # if defined(MSDOS) || defined(WIN32) @@ -705,5 +687,4 @@ char *str; return tmp; } #endif /* EXEPATH */ -#endif /*OVLB*/ /*pcmain.c*/ diff --git a/sys/share/pcsys.c b/sys/share/pcsys.c index 97627f66e..92fd47baf 100644 --- a/sys/share/pcsys.c +++ b/sys/share/pcsys.c @@ -29,11 +29,11 @@ #if defined(MICRO) || defined(WIN32) || defined(OS2) -void FDECL(nethack_exit,(int)); +void nethack_exit(int); #else #define nethack_exit exit #endif -static void NDECL(msexit); +static void msexit(); #ifdef MOVERLAY @@ -46,9 +46,9 @@ extern unsigned short __far __cdecl _movefpaused; #endif /* MOVERLAY */ #ifdef MFLOPPY -STATIC_DCL boolean NDECL(record_exists); +static boolean record_exists(); # ifndef TOS -STATIC_DCL boolean NDECL(comspec_exists); +static boolean comspec_exists(); # endif #endif @@ -306,7 +306,7 @@ int start; } /* Return 1 if the record file was found */ -STATIC_OVL boolean +static boolean record_exists() { FILE *fp; @@ -325,7 +325,7 @@ record_exists() # else # ifdef MFLOPPY /* Return 1 if the comspec was found */ -STATIC_OVL boolean +static boolean comspec_exists() { int fd; diff --git a/sys/share/pcunix.c b/sys/share/pcunix.c index 1f1149e2a..75b4feb4d 100644 --- a/sys/share/pcunix.c +++ b/sys/share/pcunix.c @@ -15,13 +15,11 @@ #if defined(WIN32) || defined(MSDOS) extern char orgdir[]; # ifdef WIN32 -extern void NDECL(backsp); +extern void backsp(); # endif -extern void NDECL(clear_screen); +extern void clear_screen(); #endif -#ifdef OVLB - #if 0 static struct stat buf; #endif @@ -31,7 +29,7 @@ static struct stat hbuf; # endif #ifdef PC_LOCKING -static int NDECL(eraseoldlocks); +static int eraseoldlocks(); #endif #if 0 @@ -54,8 +52,8 @@ int fd; if(moves > 1) pline("Cannot get status of saved level? "); else pline("Cannot get status of saved game."); return(0); - } - if(comp_times(buf.st_mtime)) { + } + if(comp_times(buf.st_mtime)) { if(moves > 1) pline("Saved level is out of date."); else pline("Saved game is out of date. "); /* This problem occurs enough times we need to give the player @@ -145,13 +143,13 @@ getlock() # else perror(fq_lock); # endif - unlock_file(HLOCK); + unlock_file(HLOCK); error("Cannot open %s", fq_lock); } (void) close(fd); - if(iflags.window_inited) { + if(iflags.window_inited) { # ifdef SELF_RECOVER c = yn("There are files from a game in progress under your name. Recover?"); # else @@ -233,7 +231,7 @@ getlock() chdirx(orgdir, 0); # endif # if defined(WIN32) - error("cannot creat file (%s.)\n%s\n%s\"%s\" exists?\n", + error("cannot creat file (%s.)\n%s\n%s\"%s\" exists?\n", fq_lock, strerror(ern), " Are you sure that the directory", fqn_prefix[LEVELPREFIX]); # else @@ -257,7 +255,7 @@ getlock() # if defined(MSDOS) && defined(NO_TERMS) if (grmode) gr_init(); # endif -} +} #endif /* PC_LOCKING */ # ifndef WIN32 @@ -281,8 +279,6 @@ register char *s; *lp = '_'; } # endif /* WIN32 */ -#endif /* OVLB */ - #ifdef __EMX__ void seteuid(int i){;} diff --git a/sys/share/tclib.c b/sys/share/tclib.c index 0ccfcb373..fa33a8934 100644 --- a/sys/share/tclib.c +++ b/sys/share/tclib.c @@ -21,13 +21,13 @@ char *BC, *UP; short ospeed; /* exported routines */ -int FDECL(tgetent, (char *,const char *)); -int FDECL(tgetflag, (const char *)); -int FDECL(tgetnum, (const char *)); -char *FDECL(tgetstr, (const char *,char **)); -char *FDECL(tgoto, (const char *,int,int)); -char *FDECL(tparam, (const char *,char *,int,int,int,int,int)); -void FDECL(tputs, (const char *,int,int (*)())); +int tgetent (char *,const char *); +int tgetflag(const char *); +int tgetnum (const char *); +char *tgetstr (const char *,char **); +char *tgoto (const char *,int,int); +char *tparam (const char *,char *,int,int,int,int,int); +void tputs (const char *,int,int (*)()); /* local support data */ static char *tc_entry; @@ -49,10 +49,10 @@ static short baud_rates[] = { #endif /* !NO_DELAY_PADDING */ /* local support code */ -static int FDECL(tc_store, (const char *,const char *)); -static char *FDECL(tc_find, (FILE *,const char *,char *,int)); -static char *FDECL(tc_name, (const char *,char *)); -static const char *FDECL(tc_field, (const char *,const char **)); +static int tc_store(const char *,const char *); +static char *tc_find (FILE *,const char *,char *,int); +static char *tc_name (const char *,char *); +static const char *tc_field(const char *,const char **); #ifndef min #define min(a,b) ((a)<(b)?(a):(b)) diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c index e04f27048..bdb6d2d8c 100644 --- a/sys/share/unixtty.c +++ b/sys/share/unixtty.c @@ -319,10 +319,10 @@ int sco_flag_console = 0; int sco_map_valid = -1; unsigned char sco_chanmap_buf[BSIZE]; -void NDECL(sco_mapon); -void NDECL(sco_mapoff); -void NDECL(check_sco_console); -void NDECL(init_sco_cons); +void sco_mapon(); +void sco_mapoff(); +void check_sco_console(); +void init_sco_cons(); void sco_mapon() @@ -382,10 +382,10 @@ init_sco_cons() int linux_flag_console = 0; -void NDECL(linux_mapon); -void NDECL(linux_mapoff); -void NDECL(check_linux_console); -void NDECL(init_linux_cons); +void linux_mapon(); +void linux_mapoff(); +void check_linux_console(); +void init_linux_cons(); void linux_mapon() diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index b2cf477fb..7d12ed7d7 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -18,29 +18,29 @@ #if !defined(_BULL_SOURCE) && !defined(__sgi) && !defined(_M_UNIX) # if !defined(SUNOS4) && !(defined(ULTRIX) && defined(__GNUC__)) # if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX) -extern struct passwd *FDECL(getpwuid,(uid_t)); +extern struct passwd *getpwuid(uid_t); # else -extern struct passwd *FDECL(getpwuid,(int)); +extern struct passwd *getpwuid(int); # endif # endif #endif -extern struct passwd *FDECL(getpwnam,(const char *)); +extern struct passwd *getpwnam(const char *); #ifdef CHDIR -static void FDECL(chdirx, (const char *,BOOLEAN_P)); +static void chdirx(const char *,BOOLEAN_P); #endif /* CHDIR */ -static boolean NDECL(whoami); -static void FDECL(process_options, (int, char **)); +static boolean whoami(); +static void process_options(int, char **); #ifdef _M_UNIX -extern void NDECL(check_sco_console); -extern void NDECL(init_sco_cons); +extern void check_sco_console(); +extern void init_sco_cons(); #endif #ifdef __linux__ -extern void NDECL(check_linux_console); -extern void NDECL(init_linux_cons); +extern void check_linux_console(); +extern void init_linux_cons(); #endif -static void NDECL(wd_message); +static void wd_message(); #ifdef WIZARD static boolean wiz_error_flag = FALSE; #endif diff --git a/sys/unix/unixunix.c b/sys/unix/unixunix.c index 9d0f5cd89..af7adfb6e 100644 --- a/sys/unix/unixunix.c +++ b/sys/unix/unixunix.c @@ -15,19 +15,19 @@ #include #ifdef _M_UNIX -extern void NDECL(sco_mapon); -extern void NDECL(sco_mapoff); +extern void sco_mapon(); +extern void sco_mapoff(); #endif #ifdef __linux__ -extern void NDECL(linux_mapon); -extern void NDECL(linux_mapoff); +extern void linux_mapon(); +extern void linux_mapoff(); #endif #ifndef NHSTDC extern int errno; #endif -extern int FDECL(restore_savefile, (char *, const char *)); +extern int restore_savefile(char *, const char *); static struct stat buf; @@ -510,12 +510,12 @@ FILE *stream; #ifdef GETRES_SUPPORT -extern int FDECL(nh_getresuid, (uid_t *, uid_t *, uid_t *)); -extern uid_t NDECL(nh_getuid); -extern uid_t NDECL(nh_geteuid); -extern int FDECL(nh_getresgid, (gid_t *, gid_t *, gid_t *)); -extern gid_t NDECL(nh_getgid); -extern gid_t NDECL(nh_getegid); +extern int nh_getresuid(uid_t *, uid_t *, uid_t *); +extern uid_t nh_getuid(); +extern uid_t nh_geteuid(); +extern int nh_getresgid(gid_t *, gid_t *, gid_t *); +extern gid_t nh_getgid(); +extern gid_t nh_getegid(); int (getresuid)(ruid, euid, suid) diff --git a/sys/unsupported/amiga/amidos.p b/sys/unsupported/amiga/amidos.p index ee91b3a81..d305aed83 100644 --- a/sys/unsupported/amiga/amidos.p +++ b/sys/unsupported/amiga/amidos.p @@ -3,40 +3,40 @@ /* NetHack may be freely redistributed. See license for details. */ /* amidos.c */ -void NDECL(flushout ); +void flushout (); #ifndef getuid -int NDECL(getuid ); +int getuid (); #endif #ifndef getpid -int NDECL(getpid ); +int getpid (); #endif #ifndef getlogin -char *NDECL(getlogin ); +char *getlogin (); #endif #ifndef abs -int FDECL(abs, (int )); -#endif -int NDECL(tgetch ); -int NDECL(dosh ); -long FDECL(freediskspace, (char *)); -long FDECL(filesize, (char *)); -void FDECL(eraseall, (const char * , const char *)); -char *FDECL(CopyFile, (const char * , const char *)); -void FDECL(copybones, (int )); -void NDECL(playwoRAMdisk ); -int FDECL(saveDiskPrompt, (int )); -void NDECL(gameDiskPrompt ); -void FDECL(append_slash, (char *)); -void FDECL(getreturn, (const char *)); +int abs(int ); +#endif +int tgetch (); +int dosh (); +long freediskspace(char *); +long filesize(char *); +void eraseall(const char * , const char *); +char *CopyFile(const char * , const char *); +void copybones(int ); +void playwoRAMdisk (); +int saveDiskPrompt(int ); +void gameDiskPrompt (); +void append_slash(char *); +void getreturn(const char *); #ifndef msmsg -void FDECL(msmsg, ( const char *, ... )); +void msmsg( const char *, ... ); #endif #if !defined(__SASC_60) && !defined(_DCC) -int FDECL(chdir, (char *)); +int chdir(char *); #endif #ifndef strcmpi -int FDECL(strcmpi, (char * , char *)); +int strcmpi(char * , char *); #endif #if !defined(memcmp) && !defined(AZTEC_C) && !defined(_DCC) && !defined(__GNUC__) -int FDECL(memcmp, (unsigned char * , unsigned char * , int )); +int memcmp(unsigned char * , unsigned char * , int ); #endif diff --git a/sys/unsupported/amiga/amitty.c b/sys/unsupported/amiga/amitty.c index 236d4b392..5c963c23d 100644 --- a/sys/unsupported/amiga/amitty.c +++ b/sys/unsupported/amiga/amitty.c @@ -20,8 +20,8 @@ # include #endif -void NDECL( tty_change_color ); -char *NDECL( tty_get_color_string ); +void tty_change_color (); +char * tty_get_color_string (); #ifdef TTY_GRAPHICS diff --git a/sys/unsupported/amiga/amiwind.c b/sys/unsupported/amiga/amiwind.c index 860bc3c28..dce808b7e 100644 --- a/sys/unsupported/amiga/amiwind.c +++ b/sys/unsupported/amiga/amiwind.c @@ -13,7 +13,7 @@ #ifdef AMII_GRAPHICS /* too early in the file? too late? */ #ifdef AMIFLUSH -static struct Message *FDECL(GetFMsg,(struct MsgPort *)); +static struct Message *GetFMsg(struct MsgPort *); #endif static int BufferGetchar(void); @@ -112,7 +112,7 @@ struct NewWindow *nw; * Close a window that shared the HackPort IDCMP port. */ -void FDECL(CloseShWindow, (struct Window *)); +void CloseShWindow(struct Window *); void CloseShWindow(win) struct Window *win; { @@ -266,7 +266,7 @@ register struct IntuiMessage *message; theEvent.ie_Qualifier = numeric_pad ? IEQUALIFIER_NUMERICPAD : qualifier; theEvent.ie_EventAddress = (APTR) (message->IAddress); - length = RawKeyConvert(&theEvent, (char *)buffer, + length = RawKeyConvert(&theEvent, (char *)buffer, (long) sizeof(buffer), NULL); if (length == 1) { /* Plain ASCII character */ diff --git a/sys/unsupported/amiga/amiwind.p b/sys/unsupported/amiga/amiwind.p index ca009d44b..a8385db29 100644 --- a/sys/unsupported/amiga/amiwind.p +++ b/sys/unsupported/amiga/amiwind.p @@ -4,37 +4,37 @@ /* amiwind.c */ #ifdef INTUI_NEW_LOOK -struct Window *FDECL( OpenShWindow, (struct ExtNewWindow *) ); +struct Window * OpenShWindow(struct ExtNewWindow *) ; #else -struct Window *FDECL( OpenShWindow, (struct NewWindow *) ); +struct Window * OpenShWindow(struct NewWindow *) ; #endif -void FDECL( CloseShWindow, (struct Window *)); -int NDECL( kbhit ); -int NDECL( amikbhit ); -int NDECL( WindowGetchar ); -WETYPE NDECL( WindowGetevent ); -void NDECL( WindowFlush ); -void FDECL( WindowPutchar, (char )); -void FDECL( WindowFPuts, (const char *)); -void FDECL( WindowPuts, (const char *)); -void FDECL( WindowPrintf, ( char *,... )); -void NDECL( CleanUp ); -int FDECL( ConvertKey, ( struct IntuiMessage * )); +void CloseShWindow(struct Window *); +int kbhit (); +int amikbhit (); +int WindowGetchar (); +WETYPE WindowGetevent (); +void WindowFlush (); +void WindowPutchar(char ); +void WindowFPuts(const char *); +void WindowPuts(const char *); +void WindowPrintf( char *,... ); +void CleanUp (); +int ConvertKey( struct IntuiMessage * ); #ifndef SHAREDLIB -void FDECL( Abort, (long )); +void Abort(long ); #endif -void FDECL( flush_glyph_buffer, (struct Window *)); -void FDECL( amiga_print_glyph, (winid , int , int )); -void FDECL( start_glyphout, (winid )); -void FDECL( amii_end_glyphout, (winid )); +void flush_glyph_buffer(struct Window *); +void amiga_print_glyph(winid , int , int ); +void start_glyphout(winid ); +void amii_end_glyphout(winid ); #ifdef INTUI_NEW_LOOK -struct ExtNewWindow *FDECL( DupNewWindow, (struct ExtNewWindow *)); -void FDECL( FreeNewWindow, (struct ExtNewWindow *)); +struct ExtNewWindow * DupNewWindow(struct ExtNewWindow *); +void FreeNewWindow(struct ExtNewWindow *); #else -struct NewWindow *FDECL( DupNewWindow, (struct NewWindow *)); -void FDECL( FreeNewWindow, (struct NewWindow *)); +struct NewWindow * DupNewWindow(struct NewWindow *); +void FreeNewWindow(struct NewWindow *); #endif -void NDECL( bell ); -void NDECL( amii_delay_output ); -void FDECL( amii_number_pad, (int )); +void bell (); +void amii_delay_output (); +void amii_number_pad(int ); void amii_cleanup( void ); diff --git a/sys/unsupported/amiga/winami.c b/sys/unsupported/amiga/winami.c index cc69185a5..1b785ffba 100644 --- a/sys/unsupported/amiga/winami.c +++ b/sys/unsupported/amiga/winami.c @@ -9,7 +9,7 @@ #ifdef AMIGA_INTUITION -static int FDECL( put_ext_cmd, ( char *, int, struct amii_WinDesc *, int ) ); +static int put_ext_cmd( char *, int, struct amii_WinDesc *, int ) ; struct amii_DisplayDesc *amiIDisplay; /* the Amiga Intuition descriptor */ struct Rectangle lastinvent, lastmsg; diff --git a/sys/unsupported/amiga/winami.p b/sys/unsupported/amiga/winami.p index b34f8e5fa..99a16d95e 100644 --- a/sys/unsupported/amiga/winami.p +++ b/sys/unsupported/amiga/winami.p @@ -2,56 +2,56 @@ /* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */ /* NetHack may be freely redistributed. See license for details. */ /* winami.c */ -void FDECL(amii_raw_print, (const char *)); -void FDECL(amii_raw_print_bold, (const char *)); -void FDECL(amii_start_menu, (winid )); -void FDECL(amii_add_menu, (winid , char , int , const char *)); -void FDECL(amii_end_menu, (winid , char , const char * , const char *)); -char FDECL(amii_select_menu, (winid )); -void NDECL(amii_update_inventory ); -void NDECL(amii_mark_synch ); -void NDECL(amii_wait_synch ); -void NDECL(amii_setclipped ); -void FDECL(amii_cliparound, (int , int )); -void NDECL(amii_askname ); -void NDECL(amii_player_selection ); -void NDECL(flush_output ); -void FDECL(amii_destroy_nhwindow, (winid )); -int FDECL(amii_create_nhwindow, (int )); -void NDECL(amii_init_nhwindows ); -int NDECL(amii_get_ext_cmd); -char FDECL(amii_yn_function, (const char * , const char * , char )); -void FDECL(amii_addtopl, (const char *)); -void FDECL(TextSpaces, (struct RastPort * , int )); -void FDECL(amii_putstr, (winid , int , const char *)); -void FDECL(amii_putsym, (winid , int , int , CHAR_P )); -void FDECL(amii_clear_nhwindow, (winid )); -void FDECL(amii_exit_nhwindows, (const char *)); -int FDECL(amii_nh_poskey, (int * , int * , int *)); -int NDECL(amii_nhgetch ); -void NDECL(amii_get_nh_event ); -void NDECL(amii_remember_topl ); -int NDECL(amii_doprev_message ); -void FDECL(amii_display_nhwindow, (winid , boolean )); -void FDECL(amii_display_file, (const char * , boolean )); -void FDECL(amii_curs, (winid , int , int )); -void FDECL(amii_print_glyph, (winid , xchar , xchar , int )); -void FDECL(DoMenuScroll, (int , int )); -void FDECL(DisplayData, (int , int , int )); -void FDECL(SetPropInfo, (struct Window * , struct Gadget * , long , long , long )); -void FDECL(kill_nhwindows, (int )); -void FDECL(amii_cl_end, (struct amii_WinDesc * , int )); -void FDECL(cursor_off, (winid )); -void FDECL(cursor_on, (winid )); -void NDECL(amii_getret ); -void FDECL(amii_getlin, (const char * , char *)); -void FDECL(getlind, (const char * , char * , const char *)); -void FDECL(amii_suspend_nhwindows, (char * )); -void NDECL(amii_resume_nhwindows); -void NDECL(amii_bell); -void NDECL(EditColor); -void FDECL(DrawCol, ( struct Window *, int, UWORD * ) ); -void FDECL( DispCol, ( struct Window *w, int idx, UWORD * ) ); -void FDECL( SetBorder, (struct Gadget *) ); -void NDECL( port_help ); -void FDECL( dismiss_nhwindow, (winid) ); +void amii_raw_print(const char *); +void amii_raw_print_bold(const char *); +void amii_start_menu(winid ); +void amii_add_menu(winid , char , int , const char *); +void amii_end_menu(winid , char , const char * , const char *); +char amii_select_menu(winid ); +void amii_update_inventory (); +void amii_mark_synch (); +void amii_wait_synch (); +void amii_setclipped (); +void amii_cliparound(int , int ); +void amii_askname (); +void amii_player_selection (); +void flush_output (); +void amii_destroy_nhwindow(winid ); +int amii_create_nhwindow(int ); +void amii_init_nhwindows (); +int amii_get_ext_cmd(); +char amii_yn_function(const char * , const char * , char ); +void amii_addtopl(const char *); +void TextSpaces(struct RastPort * , int ); +void amii_putstr(winid , int , const char *); +void amii_putsym(winid , int , int , CHAR_P ); +void amii_clear_nhwindow(winid ); +void amii_exit_nhwindows(const char *); +int amii_nh_poskey(int * , int * , int *); +int amii_nhgetch (); +void amii_get_nh_event (); +void amii_remember_topl (); +int amii_doprev_message (); +void amii_display_nhwindow(winid , boolean ); +void amii_display_file(const char * , boolean ); +void amii_curs(winid , int , int ); +void amii_print_glyph(winid , xchar , xchar , int ); +void DoMenuScroll(int , int ); +void DisplayData(int , int , int ); +void SetPropInfo(struct Window * , struct Gadget * , long , long , long ); +void kill_nhwindows(int ); +void amii_cl_end(struct amii_WinDesc * , int ); +void cursor_off(winid ); +void cursor_on(winid ); +void amii_getret (); +void amii_getlin(const char * , char *); +void getlind(const char * , char * , const char *); +void amii_suspend_nhwindows(char * ); +void amii_resume_nhwindows(); +void amii_bell(); +void EditColor(); +void DrawCol( struct Window *, int, UWORD * ) ; +void DispCol( struct Window *w, int idx, UWORD * ) ; +void SetBorder(struct Gadget *) ; +void port_help (); +void dismiss_nhwindow(winid) ; diff --git a/sys/unsupported/amiga/winproto.h b/sys/unsupported/amiga/winproto.h index d0106a0d0..cf793cdd0 100644 --- a/sys/unsupported/amiga/winproto.h +++ b/sys/unsupported/amiga/winproto.h @@ -39,9 +39,9 @@ void amii_getret ( void ); /* winmenu.c */ void amii_start_menu ( winid window ); -void FDECL(amii_add_menu, (winid,int,const anything *,CHAR_P,CHAR_P,int,const char *,BOOLEAN_P)); -void FDECL(amii_end_menu, (winid, const char *)); -int FDECL(amii_select_menu, (winid, int, menu_item **)); +void amii_add_menu(winid,int,const anything *,CHAR_P,CHAR_P,int,const char *,BOOLEAN_P); +void amii_end_menu(winid, const char *); +int amii_select_menu(winid, int, menu_item **); int DoMenuScroll ( int win , int blocking, int how, menu_item ** ); void ReDisplayData ( winid win ); void DisplayData ( winid win , int start ); @@ -139,7 +139,7 @@ void Abort ( long rc ); #endif /* amirip.c */ -void FDECL(amii_outrip, ( winid tmpwin, int how )); +void amii_outrip( winid tmpwin, int how ); /* winchar.c */ void SetMazeType(MazeType); diff --git a/sys/unsupported/atari/tos.c b/sys/unsupported/atari/tos.c index e1f003ea2..b6e68e7bf 100644 --- a/sys/unsupported/atari/tos.c +++ b/sys/unsupported/atari/tos.c @@ -24,9 +24,9 @@ static char *nh_HE="\033q"; #include -static char NDECL(DOSgetch); -static char NDECL(BIOSgetch); -static void NDECL(init_aline); +static char DOSgetch(); +static char BIOSgetch(); +static void init_aline(); char *_a_line; /* for Line A variables */ # ifdef TEXTCOLOR boolean colors_changed = FALSE; diff --git a/sys/unsupported/mac/macfile.c b/sys/unsupported/mac/macfile.c index 535bf6053..622656408 100644 --- a/sys/unsupported/mac/macfile.c +++ b/sys/unsupported/mac/macfile.c @@ -28,7 +28,7 @@ /* The HandleFiles are resources built into the application which are treated as read-only files: if we fail to open a file we look for a resource */ - + #define FIRST_HF 32000 /* file ID of first HandleFile */ #define MAX_HF 6 /* Max # of open HandleFiles */ @@ -42,11 +42,11 @@ typedef struct handlefile { Handle data; /* The resource, purgeable */ } HandleFile; -static HandleFile *FDECL(IsHandleFile,(int)); -static int FDECL(OpenHandleFile,(const unsigned char *, long)); -static int FDECL(CloseHandleFile,(int)); -static int FDECL(ReadHandleFile,(int, void *, unsigned)); -static long FDECL(SetHandleFilePos,(int, short, long)); +static HandleFile *IsHandleFile(int); +static int OpenHandleFile(const unsigned char *, long); +static int CloseHandleFile(int); +static int ReadHandleFile(int, void *, unsigned); +static long SetHandleFilePos(int, short, long); HandleFile theHandleFiles [MAX_HF]; MacDirs theDirs; /* also referenced in macwin.c */ @@ -76,13 +76,13 @@ OpenHandleFile (const unsigned char *name, long fileType) for (i = 0; i < MAX_HF; i ++) { if (theHandleFiles[i].data == 0L) break; } - + if (i >= MAX_HF) return -1; h = GetNamedResource (fileType, name); if (!h) return (-1); - + theHandleFiles[i].data = h; theHandleFiles[i].size = GetHandleSize (h); GetResInfo (h, &theHandleFiles[i].id, (void*) &theHandleFiles[i].type, s); @@ -112,18 +112,18 @@ ReadHandleFile (int fd, void *ptr, unsigned len) Handle h; if (!IsHandleFile (fd)) return -1; - + fd -= FIRST_HF; maxBytes = theHandleFiles[fd].size - theHandleFiles[fd].mark; if (len > maxBytes) len = maxBytes; - + h = theHandleFiles[fd].data; - + HLock(h); BlockMove (*h + theHandleFiles[fd].mark, ptr, len); HUnlock(h); theHandleFiles[fd].mark += len; - + return(len); } @@ -132,17 +132,17 @@ static long SetHandleFilePos (int fd, short whence, long pos) { long curpos; - + if (!IsHandleFile (fd)) return -1; - + fd -= FIRST_HF; - + curpos = theHandleFiles [fd].mark; switch (whence) { - case SEEK_CUR : + case SEEK_CUR : curpos += pos; break; - case SEEK_END : + case SEEK_END : curpos = theHandleFiles[fd].size - pos; break; default : /* set */ @@ -154,9 +154,9 @@ SetHandleFilePos (int fd, short whence, long pos) curpos = 0; else if (curpos > theHandleFiles [fd].size) curpos = theHandleFiles [fd].size; - + theHandleFiles [fd].mark = curpos; - + return curpos; } @@ -294,7 +294,7 @@ int macread (int fd, void *ptr, unsigned len) { long amt = len; - + if (IsHandleFile (fd)) { return ReadHandleFile (fd, ptr, amt); } else { @@ -393,7 +393,7 @@ boolean rsrc_dlb_fopen(dlb *dp, const char *name, const char *mode) { # pragma unused(mode) #endif Str255 pname; - + C2P(name, pname); dp->fd = OpenHandleFile(pname, 'File'); /* automatically read-only */ return dp->fd >= 0; @@ -408,7 +408,7 @@ int rsrc_dlb_fread(char *buf, int size, int quan, dlb *dp) { if (size < 0 || quan < 0) return 0; nread = ReadHandleFile(dp->fd, buf, (unsigned)size * (unsigned)quan); - + return nread/size; /* # of whole pieces (== quan in normal case) */ } diff --git a/sys/unsupported/mac/macwin.c b/sys/unsupported/mac/macwin.c index a54f454e7..d2647601a 100644 --- a/sys/unsupported/mac/macwin.c +++ b/sys/unsupported/mac/macwin.c @@ -53,7 +53,7 @@ static char topl_resp[10] = ""; static winid inSelect = WIN_ERR; /* - * The key queue ring buffer where Read is where to take from, + * The key queue ring buffer where Read is where to take from, * Write is where next char goes and count is queue depth. */ static unsigned char keyQueue [QUEUE_LEN]; @@ -136,27 +136,27 @@ Boolean small_screen = 0; #endif #define NHW_BASE 0 -static int FDECL(filter_scroll_key,(const int, NhWindow *)); +static int filter_scroll_key(const int, NhWindow *); -static void FDECL(GeneralKey, (EventRecord *, WindowPtr)); -static void FDECL(macKeyMenu, (EventRecord *, WindowPtr)); -static void FDECL(macKeyText, (EventRecord *, WindowPtr)); +static void GeneralKey(EventRecord *, WindowPtr); +static void macKeyMenu(EventRecord *, WindowPtr); +static void macKeyText(EventRecord *, WindowPtr); -static void FDECL(macClickMessage, (EventRecord *, WindowPtr)); -static void FDECL(macClickTerm, (EventRecord *, WindowPtr)); -static void FDECL(macClickMenu, (EventRecord *, WindowPtr)); -static void FDECL(macClickText, (EventRecord *, WindowPtr)); +static void macClickMessage(EventRecord *, WindowPtr); +static void macClickTerm(EventRecord *, WindowPtr); +static void macClickMenu(EventRecord *, WindowPtr); +static void macClickText(EventRecord *, WindowPtr); -static short FDECL(macDoNull, (EventRecord *, WindowPtr)); -static short FDECL(macUpdateMessage, (EventRecord *, WindowPtr)); -static short FDECL(macUpdateMenu, (EventRecord *, WindowPtr)); -static short FDECL(GeneralUpdate, (EventRecord *, WindowPtr)); +static short macDoNull(EventRecord *, WindowPtr); +static short macUpdateMessage(EventRecord *, WindowPtr); +static short macUpdateMenu(EventRecord *, WindowPtr); +static short GeneralUpdate(EventRecord *, WindowPtr); -static void FDECL(macCursorTerm, (EventRecord *, WindowPtr, RgnHandle)); -static void FDECL(GeneralCursor, (EventRecord *, WindowPtr, RgnHandle)); +static void macCursorTerm(EventRecord *, WindowPtr, RgnHandle); +static void GeneralCursor(EventRecord *, WindowPtr, RgnHandle); -static void FDECL(DoScrollBar,(Point, short, ControlHandle, NhWindow *)); -static pascal void FDECL(MoveScrollBar, (ControlHandle, short)); +static void DoScrollBar(Point, short, ControlHandle, NhWindow *); +static pascal void MoveScrollBar(ControlHandle, short); typedef void (*CbFunc) (EventRecord *, WindowPtr); typedef short (*CbUpFunc) (EventRecord *, WindowPtr); @@ -253,7 +253,7 @@ AppleEventHandler (const AppleEvent* inAppleEvent, AppleEvent* outAEReply, long if (noErr != err) break; - if (fndrInfo.fdType != SAVE_TYPE) + if (fndrInfo.fdType != SAVE_TYPE) continue; /* only look at save files */ process_openfile (fss.vRefNum, fss.parID, fss.name, fndrInfo.fdType); @@ -264,13 +264,13 @@ AppleEventHandler (const AppleEvent* inAppleEvent, AppleEvent* outAEReply, long break; } } - } + } /* Check to see if all required parameters for this type of event are present */ if (err == noErr) { - err = AEGetAttributePtr (inAppleEvent, keyMissedKeywordAttr, + err = AEGetAttributePtr (inAppleEvent, keyMissedKeywordAttr, typeWildCard, &typeCode, NULL, 0, &actualSize); - if (err == errAEDescNotFound) + if (err == errAEDescNotFound) err = noErr; /* got all the required parameters */ else if (err == noErr) /* missed a required parameter */ err = errAEEventNotHandled; @@ -316,7 +316,7 @@ InitMac(void) { if (!Gestalt (gestaltFindFolderAttr, & l)) macFlags.folders = (l & (1 << gestaltFindFolderPresent)) ? 1 : 0; - + if (!Gestalt (gestaltHelpMgrAttr, & l)) macFlags.help = (l & (1 << gestaltHelpMgrPresent)) ? 1 : 0; @@ -339,7 +339,7 @@ InitMac(void) { InitCursor(); GetQDGlobalsArrow(&qdarrow); ObscureCursor (); - + MoveScrollUPP = NewControlActionUPP(MoveScrollBar); /* Set up base fonts for all window types */ @@ -400,10 +400,10 @@ short set_tty_font_name (int window_type, char *font_name) { short fnum; Str255 new_font; - + if (window_type < NHW_BASE || window_type > NHW_TEXT) return general_failure; - + C2P (font_name, new_font); GetFNum (new_font, &(fnum)); if (!fnum) @@ -450,7 +450,7 @@ DrawScrollbar (NhWindow *aWin) /* calculate how big scroll bar is for message window */ lin -= (win_height - SBARHEIGHT) / aWin->row_height; if (lin < 0) - lin = 0; + lin = 0; val = 0; /* always have message scrollbar active */ } else { @@ -552,7 +552,7 @@ SanePositions (void) } else { if (!RetrievePosition (kTextWindow, &top, &left)) { top = mbar_height * 2; - left = screenArea.right - 3 - + left = screenArea.right - 3 - (theWindow->portRect.right - theWindow->portRect.left); } top += (numText * mbar_height); @@ -610,7 +610,7 @@ got1 : aWin->miLen = 0; aWin->miSize = 0; aWin->menuChar = 'a'; - + dprintf ("cre_win: New kind %d", kind); if (kind == NHW_BASE || kind == NHW_MAP || kind == NHW_STATUS) { @@ -664,7 +664,7 @@ got1 : aWin->font_size = iflags.wc_fontsiz_text ? iflags.wc_fontsiz_text : 9; } - TextFont (aWin->font_number); + TextFont (aWin->font_number); TextSize (aWin->font_size); GetFontInfo (&fi); @@ -882,7 +882,7 @@ leave_topl_mode(char *answer) { } } *bp = 0; - + if (aWin->windowTextLen && (*aWin->windowText)[aWin->windowTextLen-1] == CHAR_CR) { -- aWin->windowTextLen; -- aWin->y_size; @@ -1110,7 +1110,7 @@ adjust_window_pos(NhWindow *aWin, short width, short height) if (pos.h + width + win_ind.right > scr_r.right) pos.h = scr_r.right - width - win_ind.right; MoveWindow(theWindow, pos.h, pos.v, false); - if (aWin->scrollBar) + if (aWin->scrollBar) DrawScrollbar (aWin); #endif return; @@ -1284,7 +1284,7 @@ static void ToggleMenuSelect (NhWindow *aWin, int line) { GetWindowBounds(aWin->its_window, kWindowContentRgn, &r); OffsetRect(&r, -r.left, -r.top); if (aWin->scrollBar) - r.right -= SBARWIDTH; + r.right -= SBARWIDTH; r.top = line * aWin->row_height; r.bottom = r.top + aWin->row_height; @@ -1365,7 +1365,7 @@ macKeyMenu (EventRecord *theEvent, WindowPtr theWindow) { if (mi->line >= aWin->scrollPos && mi->line <= aWin->y_size) { SetPortWindowPort(theWindow); ToggleMenuSelect (aWin, mi->line - aWin->scrollPos); - } + } /* Dismiss window if only picking one item */ if (aWin->how != PICK_ANY) AddToKeyQueue(CHAR_CR, 1); @@ -1442,7 +1442,7 @@ macClickMenu (EventRecord *theEvent, WindowRef theWindow) { if (item == -1) continue; /* header line */ - + if (majorSelectState != itemIsSelected) { ToggleMenuListItemSelected (aWin, item); ToggleMenuSelect (aWin, currentRow); @@ -1563,7 +1563,7 @@ MoveScrollBar (ControlHandle theBar, short part) { int now, amtToScroll; WindowPtr theWin; NhWindow *winToScroll; - + if (!part) return; @@ -1573,7 +1573,7 @@ MoveScrollBar (ControlHandle theBar, short part) { winToScroll = (NhWindow*)(GetWRefCon(theWin)); now = GetControlValue (theBar); - if (part == kControlPageUpPart || part == kControlPageDownPart) + if (part == kControlPageUpPart || part == kControlPageDownPart) amtToScroll = (r.bottom - r.top) / winToScroll->row_height; else amtToScroll = 1; @@ -1588,7 +1588,7 @@ MoveScrollBar (ControlHandle theBar, short part) { if (bound - now < amtToScroll) amtToScroll = bound - now; } - + if (!amtToScroll) return; @@ -1659,7 +1659,7 @@ mac_doprev_message(void) { mac_display_nhwindow(WIN_MESSAGE, FALSE); SetPortWindowPort(winToScroll->its_window); MoveScrollBar(winToScroll->scrollBar, kControlUpButtonPart); - } + } return 0; } @@ -1815,12 +1815,12 @@ macUpdateMessage (EventRecord *theEvent, WindowPtr theWindow) } -static short +static short macUpdateMenu (EventRecord *theEvent, WindowPtr theWindow) { NhWindow *aWin = GetNhWin (theWindow); int i, line; MacMHMenuItem *mi; - + GeneralUpdate (theEvent, theWindow); HLock ((char**)aWin->menuInfo); HLock ((char**)aWin->menuSelected); @@ -1995,7 +1995,7 @@ HandleClick (EventRecord *theEvent) { code = FindWindow (theEvent->where, &theWindow); aWin = GetNhWin (theWindow); not_inSelect = (inSelect == WIN_ERR || aWin - theWindows == inSelect); - + switch (code) { case inContent : if (not_inSelect) { @@ -2067,7 +2067,7 @@ HandleUpdate (EventRecord *theEvent) { char existing_update_region = FALSE; Rect rect; - + if (theWindow == _mt_window) { existing_update_region = (get_invalid_region (theWindow, &rect) == noErr); } @@ -2076,7 +2076,7 @@ HandleUpdate (EventRecord *theEvent) { GetWindowBounds(theWindow, kWindowContentRgn, &r); OffsetRect(&r, -r.left, -r.top); EraseRect(&r); - winUpdateFuncs [GetWindowKind(theWindow) - WIN_BASE_KIND] + winUpdateFuncs [GetWindowKind(theWindow) - WIN_BASE_KIND] (theEvent, theWindow); if (theWindow == _mt_window && existing_update_region) { @@ -2267,7 +2267,7 @@ mac_putstr (winid win, int attr, const char *str) { if (win == WIN_MESSAGE) { r.right -= SBARWIDTH; r.bottom -= SBARHEIGHT; - if (flags.page_wait && + if (flags.page_wait && aWin->last_more_lin <= aWin->y_size - (r.bottom - r.top) / aWin->row_height) { aWin->last_more_lin = aWin->y_size; mac_display_nhwindow(win, TRUE); @@ -2290,7 +2290,7 @@ mac_putstr (winid win, int attr, const char *str) { aWin->y_size = 0; } } - + len = aWin->windowTextLen; dst = *(aWin->windowText) + len; sline = src = (char *)str; @@ -2320,7 +2320,7 @@ mac_putstr (winid win, int attr, const char *str) { } aWin->windowTextLen += slen; - + if (ch != CHAR_CR) { (*(aWin->windowText)) [len + slen] = CHAR_CR; aWin->windowTextLen ++; @@ -2421,7 +2421,7 @@ mac_add_menu (winid win, int glyph, const anything *any, CHAR_P menuChar, CHAR_P aWin->miSize += kMenuSizeBump; } - if (menuChar == 0) { + if (menuChar == 0) { if (('a' <= aWin->menuChar && aWin->menuChar <= 'z') || ('A' <= aWin->menuChar && aWin->menuChar <= 'Z')) { menuChar = aWin->menuChar++; @@ -2429,7 +2429,7 @@ mac_add_menu (winid win, int glyph, const anything *any, CHAR_P menuChar, CHAR_P aWin->menuChar = 'A'; } } - + Sprintf(locStr, "%c - %s", (menuChar ? menuChar : ' '), inStr); str = locStr; HLock ((char**)aWin->menuInfo); @@ -2462,7 +2462,7 @@ mac_end_menu (winid win, const char *morestr) { NhWindow *aWin = &theWindows [win]; buf [0] = 0; - if (morestr) + if (morestr) C2P (morestr, buf); SetWTitle (aWin->its_window, buf); } @@ -2526,7 +2526,7 @@ boolean complain; Ptr buf; int win; dlb *fp = dlb_fopen(name, "r"); - + if (fp) { long l = dlb_fseek(fp, 0, SEEK_END); (void) dlb_fseek(fp, 0, 0L); diff --git a/sys/unsupported/mac/mgetline.c b/sys/unsupported/mac/mgetline.c index 35c3849ce..ce337baf3 100644 --- a/sys/unsupported/mac/mgetline.c +++ b/sys/unsupported/mac/mgetline.c @@ -8,9 +8,9 @@ #include "macpopup.h" #include "func_tab.h" -extern int NDECL(extcmd_via_menu); /* cmd.c */ +extern int extcmd_via_menu(); /* cmd.c */ -typedef Boolean FDECL ((* key_func), (unsigned char)); +typedef Boolean (* key_func)(unsigned char); int get_line_from_key_queue (char * bufp) { diff --git a/sys/unsupported/os2/os2.c b/sys/unsupported/os2/os2.c index 676774ebd..10367d90b 100644 --- a/sys/unsupported/os2/os2.c +++ b/sys/unsupported/os2/os2.c @@ -30,8 +30,8 @@ #include -static char NDECL(DOSgetch); -static char NDECL(BIOSgetch); +static char DOSgetch(); +static char BIOSgetch(); int tgetch() diff --git a/sys/unsupported/vms/vmsfiles.c b/sys/unsupported/vms/vmsfiles.c index 657c060ff..20599de08 100644 --- a/sys/unsupported/vms/vmsfiles.c +++ b/sys/unsupported/vms/vmsfiles.c @@ -10,13 +10,13 @@ #include /* lint supression due to lack of extern.h */ -int FDECL(vms_link, (const char *,const char *)); -int FDECL(vms_unlink, (const char *)); -int FDECL(vms_creat, (const char *,unsigned int)); -int FDECL(vms_open, (const char *,int,unsigned int)); -boolean FDECL(same_dir, (const char *,const char *)); -int FDECL(c__translate, (int)); -char *FDECL(vms_basename, (const char *)); +int vms_link(const char *,const char *); +int vms_unlink(const char *); +int vms_creat(const char *,unsigned int); +int vms_open(const char *,int,unsigned int); +boolean same_dir(const char *,const char *); +int c__translate(int); +char *vms_basename(const char *); #include #if 0 diff --git a/sys/unsupported/vms/vmsmail.c b/sys/unsupported/vms/vmsmail.c index 29e0192c3..a71ce3bc7 100644 --- a/sys/unsupported/vms/vmsmail.c +++ b/sys/unsupported/vms/vmsmail.c @@ -6,10 +6,10 @@ #include "mail.h" /* lint supression due to lack of extern.h */ -unsigned long NDECL(init_broadcast_trapping); -unsigned long NDECL(enable_broadcast_trapping); -unsigned long NDECL(disable_broadcast_trapping); -struct mail_info *NDECL(parse_next_broadcast); +unsigned long init_broadcast_trapping(); +unsigned long enable_broadcast_trapping(); +unsigned long disable_broadcast_trapping(); +struct mail_info *parse_next_broadcast(); #ifdef MAIL #include "wintype.h" @@ -27,15 +27,15 @@ struct mail_info *NDECL(parse_next_broadcast); /* #include */ # define vms_ok(sts) ((sts)&1) -static struct mail_info *FDECL(parse_brdcst, (char *)); -static void FDECL(filter_brdcst, (char *)); -static void NDECL(flush_broadcasts); -static void FDECL(broadcast_ast, (int)); -extern char *FDECL(eos, (char *)); -extern char *FDECL(strstri, (const char *,const char *)); -extern int FDECL(strncmpi, (const char *,const char *,int)); +static struct mail_info *parse_brdcst(char *); +static void filter_brdcst(char *); +static void flush_broadcasts(); +static void broadcast_ast(int); +extern char *eos(char *); +extern char *strstri(const char *,const char *); +extern int strncmpi(const char *,const char *,int); -extern size_t FDECL(strspn, (const char *,const char *)); +extern size_t strspn(const char *,const char *); #ifndef __DECC extern int VDECL(sscanf, (const char *,const char *,...)); #endif diff --git a/sys/unsupported/vms/vmsmain.c b/sys/unsupported/vms/vmsmain.c index faec2299d..6e33dca19 100644 --- a/sys/unsupported/vms/vmsmain.c +++ b/sys/unsupported/vms/vmsmain.c @@ -8,21 +8,21 @@ #include -static void NDECL(whoami); -static void FDECL(process_options, (int, char **)); -static void NDECL(byebye); +static void whoami(); +static void process_options(int, char **); +static void byebye(); #ifndef SAVE_ON_FATAL_ERROR # ifndef __DECC # define vms_handler_type int # else # define vms_handler_type unsigned int # endif -extern void FDECL(VAXC$ESTABLISH, (vms_handler_type (*)(genericptr_t,genericptr_t))); -static vms_handler_type FDECL(vms_handler, (genericptr_t,genericptr_t)); +extern void VAXC$ESTABLISH(vms_handler_type (*)(genericptr_t,genericptr_t)); +static vms_handler_type vms_handler(genericptr_t,genericptr_t); #include /* system service status codes */ #endif -static void NDECL(wd_message); +static void wd_message(); #ifdef WIZARD static boolean wiz_error_flag = FALSE; #endif @@ -382,7 +382,7 @@ byebye() int (*hup)(); #ifdef SHELL extern unsigned long dosh_pid, mail_pid; - extern unsigned long FDECL(sys$delprc,(unsigned long *,const genericptr_t)); + extern unsigned long sys$delprc(unsigned long *,const genericptr_t); /* clean up any subprocess we've spawned that may still be hanging around */ if (dosh_pid) (void) sys$delprc(&dosh_pid, 0), dosh_pid = 0; diff --git a/sys/unsupported/vms/vmstty.c b/sys/unsupported/vms/vmstty.c index 314a91230..737a368a5 100644 --- a/sys/unsupported/vms/vmstty.c +++ b/sys/unsupported/vms/vmstty.c @@ -37,10 +37,10 @@ unsigned long sys$assign(), sys$dassgn(), sys$qiow(); unsigned long smg$create_virtual_keyboard(), smg$delete_virtual_keyboard(), smg$read_keystroke(), smg$cancel_input(); #else -static short FDECL(parse_function_key, (int)); +static short parse_function_key(int); #endif -static void NDECL(setctty); -static void NDECL(resettty); +static void setctty(); +static void resettty(); #define vms_ok(sts) ((sts)&1) #define META(c) ((c)|0x80) /* 8th bit */ @@ -445,7 +445,7 @@ introff() /* disable kbd interrupts if required*/ #ifdef TIMED_DELAY extern unsigned long - FDECL(lib$emul, (const long *,const long *,const long *,long *)); + lib$emul(const long *,const long *,const long *,long *); extern unsigned long sys$schdwk(), sys$hiber(); #define VMS_UNITS_PER_SECOND 10000000L /* hundreds of nanoseconds, 1e-7 */ diff --git a/sys/unsupported/vms/vmsunix.c b/sys/unsupported/vms/vmsunix.c index fdaa53c1b..8ed8f674e 100644 --- a/sys/unsupported/vms/vmsunix.c +++ b/sys/unsupported/vms/vmsunix.c @@ -27,11 +27,11 @@ extern unsigned long lib$getdvi(), lib$getjpi(), lib$spawn(), lib$attach(); extern unsigned long smg$init_term_table_by_type(), smg$del_term_table(); #define vms_ok(sts) ((sts) & 1) /* odd => success */ -static int FDECL(veryold, (int)); -static char *NDECL(verify_term); +static int veryold(int); +static char *verify_term(); #if defined(SHELL) || defined(SUSPEND) -static void FDECL(hack_escape, (BOOLEAN_P,const char *)); -static void FDECL(hack_resume, (BOOLEAN_P)); +static void hack_escape(BOOLEAN_P,const char *); +static void hack_resume(BOOLEAN_P); #endif static int diff --git a/sys/unsupported/wince/winhack.c b/sys/unsupported/wince/winhack.c index 6a768ac49..866422749 100644 --- a/sys/unsupported/wince/winhack.c +++ b/sys/unsupported/wince/winhack.c @@ -8,15 +8,9 @@ #include "mhmain.h" #include "mhmap.h" -#ifdef OVL0 -#define SHARED_DCL -#else -#define SHARED_DCL extern -#endif +char orgdir[PATHLEN]; /* also used in pcsys.c, amidos.c */ -SHARED_DCL char orgdir[PATHLEN]; /* also used in pcsys.c, amidos.c */ - -extern void FDECL(nethack_exit,(int)); +extern void nethack_exit(int); static TCHAR* _get_cmd_arg(TCHAR* pCmdLine); // Global Variables: @@ -29,7 +23,7 @@ static void win_hack_init(int, char **); static void __cdecl mswin_moveloop(void *); static BOOL setMapTiles(const char* fname); -extern void FDECL(pcmain, (int,char **)); +extern void pcmain(int,char **); #define MAX_CMDLINE_PARAM 255 @@ -104,12 +98,12 @@ int APIENTRY WinMain(HINSTANCE hInstance, } // Perform application initialization: - if (!InitInstance (hInstance, nCmdShow)) + if (!InitInstance (hInstance, nCmdShow)) { return FALSE; } - /* get command line parameters */ + /* get command line parameters */ p = _get_cmd_arg( #if defined(WIN_CE_PS2xx) || defined(WIN32_PLATFORM_HPCPRO) lpCmdLine @@ -211,7 +205,7 @@ getlock() GetNHApp()->hMainWnd, TEXT("There are files from a game in progress under your name. Recover?"), TEXT("Nethack"), - MB_YESNO | MB_DEFBUTTON1 + MB_YESNO | MB_DEFBUTTON1 ); switch(choice) { case IDYES: @@ -222,7 +216,7 @@ getlock() } break; - case IDNO: + case IDNO: unlock_file(HLOCK); error("%s", "Cannot start a new game."); break; @@ -254,25 +248,25 @@ error VA_DECL(const char *,s) VA_INIT(s, const char *); /* error() may get called before tty is initialized */ if (iflags.window_inited) end_screen(); - + vsprintf(buf, s, VA_ARGS); NH_A2W(buf, wbuf, sizeof(wbuf)/sizeof(wbuf[0])); if( last_error>0 ) { LPVOID lpMsgBuf; - if( FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | + if( FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, last_error, 0, // Default language (LPTSTR) &lpMsgBuf, 0, - NULL + NULL ) ) { - + _tcsncat(wbuf, TEXT("\nSystem Error: "), sizeof(wbuf)/sizeof(wbuf[0]) - _tcslen(wbuf) ); _tcsncat(wbuf, lpMsgBuf, sizeof(wbuf)/sizeof(wbuf[0]) - _tcslen(wbuf) ); @@ -283,7 +277,7 @@ error VA_DECL(const char *,s) VA_END(); MessageBox( NULL, wbuf, TEXT("Error"), MB_OK | MB_ICONERROR ); - + exit(EXIT_FAILURE); } @@ -312,7 +306,7 @@ TCHAR* _get_cmd_arg(TCHAR* pCmdLine) /* skip to whitespace */ for(pArgs = pRetArg; *pArgs && !_istspace(*pArgs); pArgs = CharNext(pArgs)); } - + if( pArgs && *pArgs ) { TCHAR* p; p = pArgs; @@ -325,7 +319,7 @@ TCHAR* _get_cmd_arg(TCHAR* pCmdLine) return pRetArg; } -/* +/* * Strip out troublesome file system characters. */ diff --git a/sys/unsupported/wince/winmain.c b/sys/unsupported/wince/winmain.c index 0bb3d67b9..795f69989 100644 --- a/sys/unsupported/wince/winmain.c +++ b/sys/unsupported/wince/winmain.c @@ -5,7 +5,7 @@ #define MAX_CMDLINE_PARAM 255 -extern int FDECL (main, (int,char **)); +extern int main(int,char **); static TCHAR* _get_cmd_arg(TCHAR* pCmdLine); int APIENTRY WinMain(HINSTANCE hInstance, diff --git a/sys/winnt/nh340key.c b/sys/winnt/nh340key.c index e1481a48b..f6514ea06 100644 --- a/sys/winnt/nh340key.c +++ b/sys/winnt/nh340key.c @@ -22,9 +22,9 @@ extern INPUT_RECORD ir; char dllname[512]; char *shortdllname; -int FDECL(__declspec(dllexport) __stdcall -ProcessKeystroke, (HANDLE hConIn, INPUT_RECORD *ir, - boolean *valid, BOOLEAN_P numberpad, int portdebug)); +int __declspec(dllexport) __stdcall +ProcessKeystroke(HANDLE hConIn, INPUT_RECORD *ir, + boolean *valid, BOOLEAN_P numberpad, int portdebug); int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) { @@ -222,7 +222,7 @@ int __declspec(dllexport) __stdcall CheckInput(hConIn, ir, count, numpad, mode, mod, cc) HANDLE hConIn; INPUT_RECORD *ir; -DWORD *count; +DWORD *count; boolean numpad; int mode; int *mod; @@ -255,11 +255,11 @@ coord *cc; #if 0 /* middle button */ else if (ir->Event.MouseEvent.dwButtonState & MIDBUTTON) *mod = CLICK_3; -#endif +#endif return 0; } } - } else + } else done = 1; } } diff --git a/sys/winnt/nhdefkey.c b/sys/winnt/nhdefkey.c index 24c635da7..cca2177a6 100644 --- a/sys/winnt/nhdefkey.c +++ b/sys/winnt/nhdefkey.c @@ -28,9 +28,9 @@ extern INPUT_RECORD ir; char dllname[512]; char *shortdllname; -int FDECL(__declspec(dllexport) __stdcall -ProcessKeystroke, (HANDLE hConIn, INPUT_RECORD *ir, - boolean *valid, BOOLEAN_P numberpad, int portdebug)); +int __declspec(dllexport) __stdcall +ProcessKeystroke(HANDLE hConIn, INPUT_RECORD *ir, + boolean *valid, BOOLEAN_P numberpad, int portdebug); int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) { @@ -254,7 +254,7 @@ int __declspec(dllexport) __stdcall CheckInput(hConIn, ir, count, numpad, mode, mod, cc) HANDLE hConIn; INPUT_RECORD *ir; -DWORD *count; +DWORD *count; boolean numpad; int mode; int *mod; @@ -287,11 +287,11 @@ coord *cc; #if 0 /* middle button */ else if (ir->Event.MouseEvent.dwButtonState & MIDBUTTON) *mod = CLICK_3; -#endif +#endif return 0; } } - } else + } else done = 1; } } diff --git a/sys/winnt/nhraykey.c b/sys/winnt/nhraykey.c index a845f58ec..71a4029a3 100644 --- a/sys/winnt/nhraykey.c +++ b/sys/winnt/nhraykey.c @@ -5,156 +5,156 @@ /* * Keystroke handling contributed by Ray Chason. * The following text was written by Ray Chason. - * + * * The problem * =========== - * + * * The console-mode Nethack wants both keyboard and mouse input. The * problem is that the Windows API provides no easy way to get mouse input * and also keyboard input properly translated according to the user's * chosen keyboard layout. - * + * * The ReadConsoleInput function returns a stream of keyboard and mouse * events. Nethack is interested in those events that represent a key * pressed, or a click on a mouse button. The keyboard events from * ReadConsoleInput are not translated according to the keyboard layout, * and do not take into account the shift, control, or alt keys. - * + * * The PeekConsoleInput function works similarly to ReadConsoleInput, * except that it does not remove an event from the queue and it returns * instead of blocking when the queue is empty. - * + * * A program can also use ReadConsole to get a properly translated stream * of characters. Unfortunately, ReadConsole does not return mouse events, * does not distinguish the keypad from the main keyboard, does not return * keys shifted with Alt, and does not even return the ESC key when - * pressed. - * + * pressed. + * * We want both the functionality of ReadConsole and the functionality of * ReadConsoleInput. But Microsoft didn't seem to think of that. - * - * + * + * * The solution, in the original code * ================================== - * + * * The original 3.4.1 distribution tries to get proper keyboard translation * by passing keyboard events to the ToAscii function. This works, to some * extent -- it takes the shift key into account, and it processes dead * keys properly. But it doesn't take non-US keyboards into account. It * appears that ToAscii is meant for windowed applications, and does not * have enough information to do its job properly in a console application. - * - * + * + * * The Finnish keyboard patch * ========================== - * + * * This patch adds the "subkeyvalue" option to the defaults.nh file. The * user can then add OPTIONS=sukeyvalue:171/92, for instance, to replace * the 171 character with 92, which is \. This works, once properly * configured, but places too much burden on the user. It also bars the * use of the substituted characters in naming objects or monsters. - * - * + * + * * The solution presented here * =========================== - * + * * The best way I could find to combine the functionality of ReadConsole * with that of ReadConsoleInput is simple in concept. First, call * PeekConsoleInput to get the first event. If it represents a key press, * call ReadConsole to retrieve the key. Otherwise, pop it off the queue * with ReadConsoleInput and, if it's a mouse click, return it as such. - * + * * But the Devil, as they say, is in the details. The problem is in * recognizing an event that ReadConsole will return as a key. We don't * want to call ReadConsole unless we know that it will immediately return: * if it blocks, the mouse and the Alt sequences will cease to function * until it returns. - * + * * Separating process_keystroke into two functions, one for commands and a * new one, process_keystroke2, for answering prompts, makes the job a lot * easier. process_keystroke2 doesn't have to worry about mouse events or - * Alt sequences, and so the consequences are minor if ReadConsole blocks. + * Alt sequences, and so the consequences are minor if ReadConsole blocks. * process_keystroke, OTOH, never needs to return a non-ASCII character * that was read from ReadConsole; it returns bytes with the high bit set * only in response to an Alt sequence. - * + * * So in process_keystroke, before calling ReadConsole, a bogus key event * is pushed on the queue. This event causes ReadConsole to return, even * if there was no other character available. Because the bogus key has * the eighth bit set, it is filtered out. This is not done in * process_keystroke2, because that would render dead keys unusable. - * + * * A separate process_keystroke2 can also process the numeric keypad in a * way that makes sense for prompts: just return the corresponding symbol, * and pay no mind to number_pad or the num lock key. - * + * * The recognition of Alt sequences is modified, to support the use of * characters generated with the AltGr key. A keystroke is an Alt sequence * if an Alt key is seen that can't be an AltGr (since an AltGr sequence * could be a character, and in some layouts it could even be an ASCII * character). This recognition is different on NT-based and 95-based * Windows: - * + * * * On NT-based Windows, AltGr signals as right Alt and left Ctrl * together. So an Alt sequence is recognized if either Alt key is * pressed and if right Alt and left Ctrl are not both present. This * is true even if the keyboard in use does not have an AltGr key, and * uses right Alt for AltGr. - * + * * * On 95-based Windows, with a keyboard that lacks the AltGr key, the * right Alt key is used instead. But it still signals as right Alt, * without left Ctrl. There is no way for the application to know * whether right Alt is Alt or AltGr, and so it is always assumed * to be AltGr. This means that Alt sequences must be formed with * left Alt. - * + * * So the patch processes keystrokes as follows: - * + * * * If the scan and virtual key codes are both 0, it's the bogus key, * and we ignore it. - * + * * * Keys on the numeric keypad are processed for commands as in the * unpatched Nethack, and for prompts by returning the ASCII * character, even if the num lock is off. - * + * * * Alt sequences are processed for commands as in the unpatched * Nethack, and ignored for prompts. - * + * * * Control codes are returned as received, because ReadConsole will * not return the ESC key. - * + * * * Other key-down events are passed to ReadConsole. The use of * ReadConsole is different for commands than for prompts: - * + * * o For commands, the bogus key is pushed onto the queue before * ReadConsole is called. On return, non-ASCII characters are * filtered, so they are not mistaken for Alt sequences; this also * filters the bogus key. - * + * * o For prompts, the bogus key is not used, because that would * interfere with dead keys. Eight bit characters may be returned, * and are coded in the configured code page. - * - * + * + * * Possible improvements * ===================== - * + * * Some possible improvements remain: - * + * * * Integrate the existing Finnish keyboard patch, for use with non- * QWERTY layouts such as the German QWERTZ keyboard or Dvorak. - * + * * * Fix the keyboard glitches in the graphical version. Namely, dead * keys don't work, and input comes in as ISO-8859-1 but is displayed * as code page 437 if IBMgraphics is set on startup. - * + * * * Transform incoming text to ISO-8859-1, for full compatibility with * the graphical version. - * + * * * After pushing the bogus key and calling ReadConsole, check to see * if we got the bogus key; if so, and an Alt is pressed, process the * event as an Alt sequence. - * + * */ static char where_to_get_source[] = "http://www.nethack.org/"; @@ -169,9 +169,9 @@ extern INPUT_RECORD ir; char dllname[512]; char *shortdllname; -int FDECL(__declspec(dllexport) __stdcall -ProcessKeystroke, (HANDLE hConIn, INPUT_RECORD *ir, - boolean *valid, BOOLEAN_P numberpad, int portdebug)); +int __declspec(dllexport) __stdcall +ProcessKeystroke(HANDLE hConIn, INPUT_RECORD *ir, + boolean *valid, BOOLEAN_P numberpad, int portdebug); static INPUT_RECORD bogus_key; @@ -251,9 +251,9 @@ static const struct pad { #define inmap(x,vk) (((x) > 'A' && (x) < 'Z') || (vk) == 0xBF || (x) == '2') /* Use process_keystroke for key commands, process_keystroke2 for prompts */ -/* int FDECL(process_keystroke, (INPUT_RECORD *ir, boolean *valid, int portdebug)); */ -int FDECL(process_keystroke2, (HANDLE,INPUT_RECORD *ir, boolean *valid)); -static int FDECL(is_altseq, (unsigned long shiftstate)); +/* int process_keystroke(INPUT_RECORD *ir, boolean *valid, int portdebug); */ +int process_keystroke2(HANDLE,INPUT_RECORD *ir, boolean *valid); +static int is_altseq(unsigned long shiftstate); static int is_altseq(shiftstate) @@ -490,10 +490,10 @@ coord *cc; *mod = CLICK_1; else if (ir->Event.MouseEvent.dwButtonState & RIGHTBUTTON) *mod = CLICK_2; -#if 0 /* middle button */ +#if 0 /* middle button */ else if (ir->Event.MouseEvent.dwButtonState & MIDBUTTON) *mod = CLICK_3; -#endif +#endif return 0; } } @@ -505,7 +505,7 @@ coord *cc; } #endif } - } else + } else done = 1; } } diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 4ce5fd44d..13639c233 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -19,10 +19,10 @@ #include #include "win32api.h" -void FDECL(cmov, (int, int)); -void FDECL(nocmov, (int, int)); -int FDECL(process_keystroke, (INPUT_RECORD *, boolean *, - BOOLEAN_P numberpad, int portdebug)); +void cmov(int, int); +void nocmov(int, int); +int process_keystroke(INPUT_RECORD *, boolean *, + BOOLEAN_P numberpad, int portdebug); /* * The following WIN32 Console API routines are used in this file. @@ -56,7 +56,7 @@ INPUT_RECORD ir; * from the command line. */ int GUILaunched; -static BOOL FDECL(CtrlHandler, (DWORD)); +static BOOL CtrlHandler(DWORD); #ifdef PORT_DEBUG static boolean display_cursor_info = FALSE; @@ -115,9 +115,9 @@ KEYHANDLERNAME pKeyHandlerName; boolean colorflag = FALSE; /* colors are initialized */ int ttycolors[CLR_MAX]; # ifdef TEXTCOLOR -static void NDECL(init_ttycolor); +static void init_ttycolor(); # endif -static void NDECL(really_move_cursor); +static void really_move_cursor(); #define MAX_OVERRIDES 256 unsigned char key_overrides[MAX_OVERRIDES]; @@ -624,7 +624,7 @@ init_ttycolor() # endif /* TEXTCOLOR */ #ifdef VIDEOSHADES -static int FDECL(convert_uchars,(char *, uchar *, int)); +static int convert_uchars(char *, uchar *, int); /* * OPTIONS=videocolors:1-2-3-4-5-6-7-8-9-10-11-12-13-14-15 diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index 657701e54..5fb80fc71 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -230,7 +230,7 @@ void Delay(int ms) } #ifdef WIN32CON -extern void NDECL(backsp); +extern void backsp(); #endif void win32_abort() diff --git a/unnethack.doxygen b/unnethack.doxygen index 267f75325..88ee6c583 100644 --- a/unnethack.doxygen +++ b/unnethack.doxygen @@ -1388,11 +1388,7 @@ INCLUDE_FILE_PATTERNS = # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = OVL0 \ - OVL1 \ - OVL2 \ - OVL3 \ - OVLB +# PREDEFINED = xxx \ # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. diff --git a/util/dgn_comp.l b/util/dgn_comp.l index 110b51a52..51b88994b 100644 --- a/util/dgn_comp.l +++ b/util/dgn_comp.l @@ -15,11 +15,11 @@ * yyunput is properly declared in flex.skel. */ #if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) -int FDECL(yyback, (int *,int)); -int NDECL(yylook); -int NDECL(yyinput); -int NDECL(yywrap); -int NDECL(yylex); +int yyback(int *,int); +int yylook(); +int yyinput(); +int yywrap(); +int yylex(); /* Traditional lexes let yyunput() and yyoutput() default to int; * newer ones may declare them as void since they don't return * values. For even more fun, the lex supplied as part of the @@ -49,23 +49,23 @@ int NDECL(yylex); # undef VOIDYYPUT # endif # ifdef VOIDYYPUT -void FDECL(yyunput, (int)); -void FDECL(yyoutput, (int)); +void yyunput(int); +void yyoutput(int); # else -int FDECL(yyunput, (int)); -int FDECL(yyoutput, (int)); +int yyunput(int); +int yyoutput(int); # endif #endif /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ #ifdef FLEX_SCANNER #define YY_MALLOC_DECL \ - genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t,size_t)); + genericptr_t malloc(size_t); \ + genericptr_t realloc(genericptr_t,size_t); #endif -void FDECL(init_yyin, (FILE *)); -void FDECL(init_yyout, (FILE *)); +void init_yyin(FILE *); +void init_yyout(FILE *); /* this doesn't always get put in dgn_comp.h * (esp. when using older versions of bison) diff --git a/util/dgn_comp.y b/util/dgn_comp.y index 9b355cb26..c47b960c2 100644 --- a/util/dgn_comp.y +++ b/util/dgn_comp.y @@ -26,18 +26,18 @@ #include "date.h" #include "dgn_file.h" -void FDECL(yyerror, (const char *)); -void FDECL(yywarning, (const char *)); -int NDECL(yylex); -int NDECL(yyparse); -int FDECL(getchain, (char *)); -int NDECL(check_dungeon); -int NDECL(check_branch); -int NDECL(check_level); -void NDECL(init_dungeon); -void NDECL(init_branch); -void NDECL(init_level); -void NDECL(output_dgn); +void yyerror(const char *); +void yywarning(const char *); +int yylex(); +int yyparse(); +int getchain(char *); +int check_dungeon(); +int check_branch(); +int check_level(); +void init_dungeon(); +void init_branch(); +void init_level(); +void output_dgn(); #define Free(ptr) free((genericptr_t)ptr) diff --git a/util/dgn_main.c b/util/dgn_main.c index 75e5199a4..aba0f85ba 100644 --- a/util/dgn_main.c +++ b/util/dgn_main.c @@ -32,20 +32,20 @@ #define MAX_ERRORS 25 -extern int NDECL (yyparse); +extern int yyparse(void); extern int line_number; const char *fname = "(stdin)"; int fatal_error = 0; -int FDECL (main, (int,char **)); -void FDECL (yyerror, (const char *)); -void FDECL (yywarning, (const char *)); -int NDECL (yywrap); -void FDECL (init_yyin, (FILE *)); -void FDECL (init_yyout, (FILE *)); +int main(int,char **); +void yyerror(const char *); +void yywarning(const char *); +int yywrap(void); +void init_yyin(FILE *); +void init_yyout(FILE *); #ifdef AZTEC_36 -FILE *FDECL (freopen, (char *,char *,FILE *)); +FILE *freopen(char *,char *,FILE *); #endif #define Fprintf (void)fprintf diff --git a/util/dlb_main.c b/util/dlb_main.c index d9cc396e4..da5df7329 100644 --- a/util/dlb_main.c +++ b/util/dlb_main.c @@ -13,7 +13,7 @@ #include #endif -static void FDECL(xexit, (int)); +static void xexit(int); #ifdef DLB #ifdef DLBLIB @@ -22,21 +22,21 @@ static void FDECL(xexit, (int)); #define LIBLISTFILE "dlb.lst" /* default list file */ /* library functions (from dlb.c) */ -extern boolean FDECL(open_library,(const char *,library *)); -extern void FDECL(close_library,(library *)); +extern boolean open_library(const char *,library *); +extern void close_library(library *); -char *FDECL(eos, (char *)); /* also used by dlb.c */ -FILE *FDECL(fopen_datafile, (const char *,const char *)); +char *eos(char *); /* also used by dlb.c */ +FILE *fopen_datafile(const char *,const char *); #ifdef VMS -extern char *FDECL(vms_basename, (const char *)); -extern int FDECL(vms_open, (const char *,int,unsigned int)); +extern char *vms_basename(const char *); +extern int vms_open(const char *,int,unsigned int); #endif -static void FDECL(Write, (int,char *,long)); -static void NDECL(usage); -static void NDECL(verbose_help); -static void FDECL(write_dlb_directory, (int,int,libdir *,long,long,long)); +static void Write(int,char *,long); +static void usage(); +static void verbose_help(); +static void write_dlb_directory(int,int,libdir *,long,long,long); static char default_progname[] = "dlb"; static char *progname = default_progname; diff --git a/util/lev_comp.l b/util/lev_comp.l index 7d1bb6cee..edfebe29c 100644 --- a/util/lev_comp.l +++ b/util/lev_comp.l @@ -13,11 +13,11 @@ * yyunput is properly declared in flex.skel. */ #if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) -int FDECL(yyback, (int *,int)); -int NDECL(yylook); -int NDECL(yyinput); -int NDECL(yywrap); -int NDECL(yylex); +int yyback(int *,int); +int yylook(); +int yyinput(); +int yywrap(); +int yylex(); /* Traditional lexes let yyunput() and yyoutput() default to int; * newer ones may declare them as void since they don't return * values. For even more fun, the lex supplied as part of the @@ -47,47 +47,47 @@ int NDECL(yylex); # undef VOIDYYPUT # endif # ifdef VOIDYYPUT -void FDECL(yyunput, (int)); -void FDECL(yyoutput, (int)); +void yyunput(int); +void yyoutput(int); # else -int FDECL(yyunput, (int)); -int FDECL(yyoutput, (int)); +int yyunput(int); +int yyoutput(int); # endif #endif /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ #ifdef FLEX_SCANNER #define YY_MALLOC_DECL \ - genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t,size_t)); + genericptr_t malloc(size_t); \ + genericptr_t realloc(genericptr_t,size_t); #endif -void FDECL(init_yyin, (FILE *)); -void FDECL(init_yyout, (FILE *)); +void init_yyin(FILE *); +void init_yyout(FILE *); -void FDECL(include_push, (const char *)); -int NDECL(include_pop); +void include_push(const char *); +int include_pop(); -long NDECL(handle_varstring_method); -long FDECL(corefunc_str_check, (char *, long)); +long handle_varstring_method(); +long corefunc_str_check(char *, long); -extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); +extern struct lc_vardefs *vardef_defined(struct lc_vardefs *,char *, int); extern struct lc_vardefs *variable_definitions; -extern long FDECL(method_defined, (char *, long, long *)); +extern long method_defined(char *, long, long *); -void FDECL(savetoken, (char *)); -void NDECL(newline); -void FDECL(advancepos, (char *)); +void savetoken(char *); +void newline(); +void advancepos(char *); extern void VDECL(lc_error, (const char *, ...)); -extern char FDECL(core_func_retval, (int)); -extern int FDECL(is_core_func, (char *)); -extern int FDECL(core_func_idx, (char *)); +extern char core_func_retval(int); +extern int is_core_func(char *); +extern int core_func_idx(char *); -extern int NDECL(yyparse); -extern void FDECL(yyerror, (const char *)); +extern int yyparse(); +extern void yyerror(const char *); /* * This doesn't always get put in lev_comp.h diff --git a/util/lev_comp.y b/util/lev_comp.y index 0d6221816..c9291b1e2 100644 --- a/util/lev_comp.y +++ b/util/lev_comp.y @@ -41,58 +41,58 @@ extern void VDECL(lc_error, (const char *, ...)); extern void VDECL(lc_warning, (const char *, ...)); -extern void FDECL(yyerror, (const char *)); -extern void FDECL(yywarning, (const char *)); -extern int NDECL(yylex); -int NDECL(yyparse); - extern void FDECL(include_push, (const char *)); -extern int NDECL(include_pop); - -extern int FDECL(get_floor_type, (CHAR_P)); -extern int FDECL(get_room_type, (char *)); -extern int FDECL(get_trap_type, (char *)); -extern int FDECL(get_monster_id, (char *,CHAR_P)); -extern int FDECL(get_object_id, (char *,CHAR_P)); -extern boolean FDECL(check_monster_char, (CHAR_P)); -extern boolean FDECL(check_object_char, (CHAR_P)); -extern char FDECL(what_map_char, (CHAR_P)); -extern void FDECL(scan_map, (char *, sp_lev *)); -extern void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); -extern genericptr_t FDECL(get_last_opcode_data1, (sp_lev *, int)); -extern genericptr_t FDECL(get_last_opcode_data2, (sp_lev *, int,int)); -extern boolean FDECL(check_subrooms, (sp_lev *)); -extern boolean FDECL(write_level_file, (char *,sp_lev *)); -extern struct opvar *FDECL(set_opvar_int, (struct opvar *, long)); +extern void yyerror(const char *); +extern void yywarning(const char *); +extern int yylex(); +int yyparse(); + extern void include_push(const char *); +extern int include_pop(); + +extern int get_floor_type(CHAR_P); +extern int get_room_type(char *); +extern int get_trap_type(char *); +extern int get_monster_id(char *,CHAR_P); +extern int get_object_id(char *,CHAR_P); +extern boolean check_monster_char(CHAR_P); +extern boolean check_object_char(CHAR_P); +extern char what_map_char(CHAR_P); +extern void scan_map(char *, sp_lev *); +extern void add_opcode(sp_lev *, int, genericptr_t); +extern genericptr_t get_last_opcode_data1(sp_lev *, int); +extern genericptr_t get_last_opcode_data2(sp_lev *, int,int); +extern boolean check_subrooms(sp_lev *); +extern boolean write_level_file(char *,sp_lev *); +extern struct opvar *set_opvar_int(struct opvar *, long); extern void VDECL(add_opvars, (sp_lev *, const char *, ...)); -extern struct lc_funcdefs *FDECL(funcdef_new,(long,char *)); -extern void FDECL(funcdef_free_all,(struct lc_funcdefs *)); -extern struct lc_funcdefs *FDECL(funcdef_defined,(struct lc_funcdefs *,char *, int)); -extern char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *)); -extern char *FDECL(decode_parm_str, (char *)); +extern struct lc_funcdefs *funcdef_new(long,char *); +extern void funcdef_free_all(struct lc_funcdefs *); +extern struct lc_funcdefs *funcdef_defined(struct lc_funcdefs *,char *, int); +extern char *funcdef_paramtypes(struct lc_funcdefs *); +extern char *decode_parm_str(char *); -extern struct lc_vardefs *FDECL(vardef_new,(long,char *)); -extern void FDECL(vardef_free_all,(struct lc_vardefs *)); -extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); +extern struct lc_vardefs *vardef_new(long,char *); +extern void vardef_free_all(struct lc_vardefs *); +extern struct lc_vardefs *vardef_defined(struct lc_vardefs *,char *, int); -extern void NDECL(break_stmt_start); -extern void FDECL(break_stmt_end, (sp_lev *)); -extern void FDECL(break_stmt_new, (sp_lev *, long)); +extern void break_stmt_start(); +extern void break_stmt_end(sp_lev *); +extern void break_stmt_new(sp_lev *, long); -extern void FDECL(splev_add_from, (sp_lev *, sp_lev *)); +extern void splev_add_from(sp_lev *, sp_lev *); -extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long)); -extern void FDECL(vardef_used, (struct lc_vardefs *, char *)); -extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *, char *, long)); +extern void check_vardef_type(struct lc_vardefs *, char *, long); +extern void vardef_used(struct lc_vardefs *, char *); +extern struct lc_vardefs *add_vardef_type(struct lc_vardefs *, char *, long); -extern int FDECL(reverse_jmp_opcode, (int)); +extern int reverse_jmp_opcode(int); -extern int FDECL(is_core_func, (char *)); -extern int FDECL(core_func_idx, (char *)); -extern char FDECL(core_func_retval, (int)); -extern const char *FDECL(core_func_params, (int)); -extern const char *FDECL(core_func_name, (int)); -extern int FDECL(handle_corefunc, (sp_lev *, char *, char *, char)); +extern int is_core_func(char *); +extern int core_func_idx(char *); +extern char core_func_retval(int); +extern const char *core_func_params(int); +extern const char *core_func_name(int); +extern int handle_corefunc(sp_lev *, char *, char *, char); struct coord { long x; diff --git a/util/lev_main.c b/util/lev_main.c index e91b133b2..ea62910c8 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -69,45 +69,45 @@ extern unsigned _stklen = STKSIZ; #endif #define MAX_ERRORS 25 -extern int NDECL (yyparse); -extern void FDECL (init_yyin, (FILE *)); -extern void FDECL (init_yyout, (FILE *)); - -int FDECL (main, (int, char **)); -void FDECL (yyerror, (const char *)); -void FDECL (yywarning, (const char *)); -int NDECL (yywrap); -int FDECL(get_floor_type, (CHAR_P)); -int FDECL(get_room_type, (char *)); -int FDECL(get_trap_type, (char *)); -int FDECL(get_monster_id, (char *,CHAR_P)); -int FDECL(get_object_id, (char *,CHAR_P)); -boolean FDECL(check_monster_char, (CHAR_P)); -boolean FDECL(check_object_char, (CHAR_P)); -char FDECL(what_map_char, (CHAR_P)); -void FDECL(scan_map, (char *, sp_lev *)); -boolean FDECL(check_subrooms, (sp_lev *)); -boolean FDECL(write_level_file, (char *,sp_lev *)); - -struct lc_funcdefs *FDECL(funcdef_new,(long,char *)); -void FDECL(funcdef_free_all,(struct lc_funcdefs *)); -struct lc_funcdefs *FDECL(funcdef_defined,(struct lc_funcdefs *,char *, int)); - -struct lc_vardefs *FDECL(vardef_new,(long,char *)); -void FDECL(vardef_free_all,(struct lc_vardefs *)); -struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); - -void FDECL(splev_add_from, (sp_lev *, sp_lev *)); - -extern void NDECL(monst_init); -extern void NDECL(objects_init); -extern void NDECL(decl_init); - -void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); - -static boolean FDECL(write_common_data, (int,sp_lev *)); -static boolean FDECL(write_maze, (int,sp_lev *)); -static void NDECL(init_obj_classes); +extern int yyparse(void); +extern void init_yyin(FILE *); +extern void init_yyout(FILE *); + +int main(int, char **); +void yyerror(const char *); +void yywarning(const char *); +int yywrap(void); +int get_floor_type(CHAR_P); +int get_room_type(char *); +int get_trap_type(char *); +int get_monster_id(char *,CHAR_P); +int get_object_id(char *,CHAR_P); +boolean check_monster_char(CHAR_P); +boolean check_object_char(CHAR_P); +char what_map_char(CHAR_P); +void scan_map(char *, sp_lev *); +boolean check_subrooms(sp_lev *); +boolean write_level_file(char *,sp_lev *); + +struct lc_funcdefs *funcdef_new(long,char *); +void funcdef_free_all(struct lc_funcdefs *); +struct lc_funcdefs *funcdef_defined(struct lc_funcdefs *,char *, int); + +struct lc_vardefs *vardef_new(long,char *); +void vardef_free_all(struct lc_vardefs *); +struct lc_vardefs *vardef_defined(struct lc_vardefs *,char *, int); + +void splev_add_from(sp_lev *, sp_lev *); + +extern void monst_init(); +extern void objects_init(); +extern void decl_init(); + +void add_opcode(sp_lev *, int, genericptr_t); + +static boolean write_common_data(int,sp_lev *); +static boolean write_maze(int,sp_lev *); +static void init_obj_classes(); void VDECL(lc_error, (const char *, ...)); void VDECL(add_opvars, (sp_lev *, const char *, ...)); diff --git a/util/makedefs.c b/util/makedefs.c index 0dac365fa..35e032e2f 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -141,60 +141,60 @@ char *file_prefix=""; #endif #ifdef MACsansMPWTOOL -int FDECL(main, (void)); +int main(void); #else -int FDECL(main, (int,char **)); -#endif -void FDECL(do_makedefs, (char *)); -void NDECL(do_objs); -void NDECL(do_data); -void NDECL(do_dungeon); -void NDECL(do_date); -void NDECL(do_options); -void NDECL(do_monstr); -void NDECL(do_permonst); -void NDECL(do_questtxt); -void NDECL(do_rumors); -void NDECL(do_oracles); -void NDECL(do_vision); - -extern void NDECL(monst_init); /* monst.c */ -extern void NDECL(objects_init); /* objects.c */ - -static void NDECL(make_version); -static char *FDECL(version_string, (char *)); -static char *FDECL(version_id_string, (char *,const char *)); -static char *FDECL(xcrypt, (const char *)); -static int FDECL(check_control, (char *)); -static char *FDECL(without_control, (char *)); -static boolean FDECL(d_filter, (char *)); -static boolean FDECL(h_filter, (char *)); -static boolean FDECL(ranged_attk,(struct permonst*)); -static int FDECL(mstrength,(struct permonst *)); -static void NDECL(build_savebones_compat_string); - -static boolean FDECL(qt_comment, (char *)); -static boolean FDECL(qt_control, (char *)); -static int FDECL(get_hdr, (char *)); -static boolean FDECL(new_id, (char *)); -static boolean FDECL(known_msg, (int,int)); -static void FDECL(new_msg, (char *,int,int)); -static void FDECL(do_qt_control, (char *)); -static void FDECL(do_qt_text, (char *)); -static void NDECL(adjust_qt_hdrs); -static void NDECL(put_qt_hdrs); +int main(int,char **); +#endif +void do_makedefs(char *); +void do_objs(); +void do_data(); +void do_dungeon(); +void do_date(); +void do_options(); +void do_monstr(); +void do_permonst(); +void do_questtxt(); +void do_rumors(); +void do_oracles(); +void do_vision(); + +extern void monst_init(); /* monst.c */ +extern void objects_init(); /* objects.c */ + +static void make_version(); +static char *version_string(char *); +static char *version_id_string(char *,const char *); +static char *xcrypt(const char *); +static int check_control(char *); +static char *without_control(char *); +static boolean d_filter(char *); +static boolean h_filter(char *); +static boolean ranged_attk(struct permonst*); +static int mstrength(struct permonst *); +static void build_savebones_compat_string(); + +static boolean qt_comment(char *); +static boolean qt_control(char *); +static int get_hdr(char *); +static boolean new_id(char *); +static boolean known_msg(int,int); +static void new_msg(char *,int,int); +static void do_qt_control(char *); +static void do_qt_text(char *); +static void adjust_qt_hdrs(); +static void put_qt_hdrs(); #ifdef VISION_TABLES -static void NDECL(H_close_gen); -static void NDECL(H_far_gen); -static void NDECL(C_close_gen); -static void NDECL(C_far_gen); -static int FDECL(clear_path, (int,int,int,int)); +static void H_close_gen(); +static void H_far_gen(); +static void C_close_gen(); +static void C_far_gen(); +static int clear_path(int,int,int,int); #endif -static char *FDECL(tmpdup, (const char *)); -static char *FDECL(limit, (char *,int)); -static char *FDECL(eos, (char *)); +static char *tmpdup(const char *); +static char *limit(char *,int); +static char *eos(char *); /* input, output, tmp */ static FILE *ifp, *ofp, *tfp; @@ -1398,7 +1398,7 @@ do_monstr() /* might want to insert a final 0 entry here instead of just newline */ Fprintf(ofp,"%s};\n", (j & 15) ? "\n" : ""); - Fprintf(ofp,"\nvoid NDECL(monstr_init);\n"); + Fprintf(ofp,"\nvoid monstr_init();\n"); Fprintf(ofp,"\nvoid\n"); Fprintf(ofp,"monstr_init()\n"); Fprintf(ofp,"{\n"); diff --git a/util/panic.c b/util/panic.c index c8c52a3d3..aac53680c 100644 --- a/util/panic.c +++ b/util/panic.c @@ -14,7 +14,7 @@ #define abort() exit() #endif #ifdef VMS -extern void NDECL(vms_abort); +extern void vms_abort(); #endif /*VARARGS1*/ diff --git a/util/recover.c b/util/recover.c index ef84b4248..75541dd23 100644 --- a/util/recover.c +++ b/util/recover.c @@ -17,15 +17,15 @@ #endif #ifdef VMS -extern int FDECL(vms_creat, (const char *,unsigned)); -extern int FDECL(vms_open, (const char *,int,unsigned)); +extern int vms_creat(const char *,unsigned); +extern int vms_open(const char *,int,unsigned); #endif /* VMS */ -int FDECL(restore_savefile, (char *, const char *)); -static void FDECL(set_levelfile_name, (int)); -static int FDECL(open_levelfile, (int, const char *)); -static int NDECL(create_savefile); -void FDECL(copy_bytes, (int,int)); +int restore_savefile(char *, const char *); +static void set_levelfile_name(int); +static int open_levelfile(int, const char *); +static int create_savefile(); +void copy_bytes(int,int); #ifndef WIN_CE #define Fprintf (void)fprintf @@ -51,7 +51,7 @@ static void nhce_message(FILE*, const char*, ...); #endif #if defined(EXEPATH) -char *FDECL(exepath, (char *)); +char *exepath(char *); #endif #if defined(__BORLANDC__) && !defined(_WIN32) diff --git a/win/X11/winX.c b/win/X11/winX.c index bdecd325e..9fdc4286b 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -83,7 +83,7 @@ static struct icon_info { */ struct xwindow window_list[MAX_WINDOWS]; AppResources appResources; -void FDECL((*input_func), (Widget,XEvent *,String *,Cardinal *)); +void (*input_func)(Widget,XEvent *,String *,Cardinal *); int click_x, click_y, click_button; /* Click position on a map window */ /* (filled by set_button_values()). */ int updated_inventory; @@ -152,16 +152,16 @@ struct window_procs X11_procs = { /* * Local functions. */ -static void FDECL(dismiss_file, (Widget, XEvent*, String*, Cardinal*)); -static void FDECL(delete_file, (Widget, XEvent*, String*, Cardinal*)); -static void FDECL(yn_key, (Widget, XEvent*, String*, Cardinal*)); -static void FDECL(yn_delete, (Widget, XEvent*, String*, Cardinal*)); -static void FDECL(askname_delete, (Widget, XEvent*, String*, Cardinal*)); -static void FDECL(getline_delete, (Widget, XEvent*, String*, Cardinal*)); -static void FDECL(X11_hangup, (Widget, XEvent*, String*, Cardinal*)); -static int FDECL(input_event, (int)); -static void FDECL(win_visible, (Widget,XtPointer,XEvent *,Boolean *)); -static void NDECL(init_standard_windows); +static void dismiss_file(Widget, XEvent*, String*, Cardinal*); +static void delete_file(Widget, XEvent*, String*, Cardinal*); +static void yn_key(Widget, XEvent*, String*, Cardinal*); +static void yn_delete(Widget, XEvent*, String*, Cardinal*); +static void askname_delete(Widget, XEvent*, String*, Cardinal*); +static void getline_delete(Widget, XEvent*, String*, Cardinal*); +static void X11_hangup(Widget, XEvent*, String*, Cardinal*); +static int input_event(int); +static void win_visible(Widget,XtPointer,XEvent *,Boolean *); +static void init_standard_windows(); /* diff --git a/win/X11/winmap.c b/win/X11/winmap.c index 99fa6a73a..3037a290e 100644 --- a/win/X11/winmap.c +++ b/win/X11/winmap.c @@ -50,7 +50,7 @@ extern short glyph2tile[]; extern int total_tiles_used; /* from dlb.c */ -extern FILE *FDECL(fopen_datafile, (const char *,const char *,int)); +extern FILE *fopen_datafile(const char *,const char *,int); /* Define these if you really want a lot of junk on your screen. */ /* #define VERBOSE */ /* print various info & events as they happen */ @@ -61,16 +61,16 @@ extern FILE *FDECL(fopen_datafile, (const char *,const char *,int)); #define USE_WHITE /* almost always use white as a tile cursor border */ -static boolean FDECL(init_tiles, (struct xwindow *)); -static void FDECL(set_button_values, (Widget,int,int,unsigned)); -static void FDECL(map_check_size_change, (struct xwindow *)); -static void FDECL(map_update, (struct xwindow *,int,int,int,int,BOOLEAN_P)); -static void FDECL(init_text, (struct xwindow *)); -static void FDECL(map_exposed, (Widget,XtPointer,XtPointer)); -static void FDECL(set_gc, (Widget,Font,char *,Pixel,GC *,GC *)); -static void FDECL(get_text_gc, (struct xwindow *,Font)); -static void FDECL(get_char_info, (struct xwindow *)); -static void FDECL(display_cursor, (struct xwindow *)); +static boolean init_tiles(struct xwindow *); +static void set_button_values(Widget,int,int,unsigned); +static void map_check_size_change(struct xwindow *); +static void map_update(struct xwindow *,int,int,int,int,BOOLEAN_P); +static void init_text(struct xwindow *); +static void map_exposed(Widget,XtPointer,XtPointer); +static void set_gc(Widget,Font,char *,Pixel,GC *,GC *); +static void get_text_gc(struct xwindow *,Font); +static void get_char_info(struct xwindow *); +static void display_cursor(struct xwindow *); /* Global functions ======================================================== */ diff --git a/win/X11/winmenu.c b/win/X11/winmenu.c index 7fb0e7f92..86c65ff1f 100644 --- a/win/X11/winmenu.c +++ b/win/X11/winmenu.c @@ -41,29 +41,29 @@ #include -static void FDECL(menu_select, (Widget, XtPointer, XtPointer)); -static void FDECL(invert_line, (struct xwindow *,x11_menu_item *,int,long)); -static void FDECL(menu_ok, (Widget, XtPointer, XtPointer)); -static void FDECL(menu_cancel, (Widget, XtPointer, XtPointer)); -static void FDECL(menu_all, (Widget, XtPointer, XtPointer)); -static void FDECL(menu_none, (Widget, XtPointer, XtPointer)); -static void FDECL(menu_invert, (Widget, XtPointer, XtPointer)); -static void FDECL(menu_search, (Widget, XtPointer, XtPointer)); -static void FDECL(select_all, (struct xwindow *)); -static void FDECL(select_none, (struct xwindow *)); -static void FDECL(select_match, (struct xwindow *, char*)); -static void FDECL(invert_all, (struct xwindow *)); -static void FDECL(invert_match, (struct xwindow *, char*)); -static void FDECL(menu_popdown, (struct xwindow *)); +static void menu_select(Widget, XtPointer, XtPointer); +static void invert_line(struct xwindow *,x11_menu_item *,int,long); +static void menu_ok(Widget, XtPointer, XtPointer); +static void menu_cancel(Widget, XtPointer, XtPointer); +static void menu_all(Widget, XtPointer, XtPointer); +static void menu_none(Widget, XtPointer, XtPointer); +static void menu_invert(Widget, XtPointer, XtPointer); +static void menu_search(Widget, XtPointer, XtPointer); +static void select_all(struct xwindow *); +static void select_none(struct xwindow *); +static void select_match(struct xwindow *, char*); +static void invert_all(struct xwindow *); +static void invert_match(struct xwindow *, char*); +static void menu_popdown(struct xwindow *); #ifdef USE_FWF -static void FDECL(sync_selected, (struct menu_info_t *, int, int *)); +static void sync_selected(struct menu_info_t *, int, int *); #endif -static void FDECL(move_menu, (struct menu *, struct menu *)); -static void FDECL(free_menu, (struct menu *)); -static void FDECL(reset_menu_to_default, (struct menu *)); -static void FDECL(clear_old_menu, (struct xwindow *)); -static char *FDECL(copy_of, (const char *)); +static void move_menu(struct menu *, struct menu *); +static void free_menu(struct menu *); +static void reset_menu_to_default(struct menu *); +static void clear_old_menu(struct xwindow *); +static char *copy_of(const char *); #define reset_menu_count(mi) ((mi)->counting = FALSE, (mi)->menu_count = 0L) diff --git a/win/X11/winmesg.c b/win/X11/winmesg.c index 4d9f36af8..87784dbc2 100644 --- a/win/X11/winmesg.c +++ b/win/X11/winmesg.c @@ -35,15 +35,15 @@ #include "hack.h" #include "winX.h" -static struct line_element *FDECL(get_previous, (struct line_element *)); -static void FDECL(set_circle_buf, (struct mesg_info_t *,int)); -static char *FDECL(split, (char *,XFontStruct *,DIMENSION_P)); -static void FDECL(add_line, (struct mesg_info_t *,const char *)); -static void FDECL(redraw_message_window, (struct xwindow *)); -static void FDECL(mesg_check_size_change, (struct xwindow *)); -static void FDECL(mesg_exposed, (Widget,XtPointer,XtPointer)); -static void FDECL(get_gc, (Widget,struct mesg_info_t *)); -static void FDECL(mesg_resized, (Widget,XtPointer,XtPointer)); +static struct line_element *get_previous(struct line_element *); +static void set_circle_buf(struct mesg_info_t *,int); +static char *split(char *,XFontStruct *,DIMENSION_P); +static void add_line(struct mesg_info_t *,const char *); +static void redraw_message_window(struct xwindow *); +static void mesg_check_size_change(struct xwindow *); +static void mesg_exposed(Widget,XtPointer,XtPointer); +static void get_gc(Widget,struct mesg_info_t *); +static void mesg_resized(Widget,XtPointer,XtPointer); static char mesg_translations[] = "#override\n\ diff --git a/win/X11/winmisc.c b/win/X11/winmisc.c index b7bab4287..6c468a2c4 100644 --- a/win/X11/winmisc.c +++ b/win/X11/winmisc.c @@ -70,17 +70,17 @@ static const char algn_select_translations[] = "#override\n\ : algn_key()"; -static void FDECL(popup_delete, (Widget, XEvent*, String*, Cardinal*)); -static void NDECL(ec_dismiss); -static Widget FDECL(make_menu, (const char *,const char *,const char *, +static void popup_delete(Widget, XEvent*, String*, Cardinal*); +static void ec_dismiss(); +static Widget make_menu(const char *,const char *,const char *, const char *,XtCallbackProc, const char *,XtCallbackProc, int,const char **, Widget **, - XtCallbackProc,Widget *)); -static void NDECL(init_extended_commands_popup); -static void FDECL(ps_quit, (Widget,XtPointer,XtPointer)); -static void FDECL(ps_random, (Widget,XtPointer,XtPointer)); -static void FDECL(ps_select, (Widget,XtPointer,XtPointer)); + XtCallbackProc,Widget *); +static void init_extended_commands_popup(); +static void ps_quit(Widget,XtPointer,XtPointer); +static void ps_random(Widget,XtPointer,XtPointer); +static void ps_select(Widget,XtPointer,XtPointer); /* Player Selection -------------------------------------------------------- */ diff --git a/win/X11/winstat.c b/win/X11/winstat.c index e37cff72e..c5ab6625f 100644 --- a/win/X11/winstat.c +++ b/win/X11/winstat.c @@ -37,9 +37,9 @@ extern const char *hu_stat[]; /* from eat.c */ extern const char *enc_stat[]; /* from botl.c */ -static void FDECL(update_fancy_status, (struct xwindow *)); -static Widget FDECL(create_fancy_status, (Widget,Widget)); -static void FDECL(destroy_fancy_status, (struct xwindow *)); +static void update_fancy_status(struct xwindow *); +static Widget create_fancy_status(Widget,Widget); +static void destroy_fancy_status(struct xwindow *); void create_status_window(wp, create_popup, parent) @@ -195,14 +195,14 @@ struct X_status_value { #define SV_LABEL 1 /* displays a changable label */ #define SV_NAME 2 /* displays an unchangeable name */ -static void FDECL(hilight_label, (Widget)); -static void FDECL(update_val, (struct X_status_value *,long)); -static const char *FDECL(width_string, (int)); -static void FDECL(create_widget, (Widget,struct X_status_value *,int)); -static void FDECL(get_widths, (struct X_status_value *,int *,int *)); -static void FDECL(set_widths, (struct X_status_value *,int,int)); -static Widget FDECL(init_column, (char *,Widget,Widget,Widget,int *)); -static Widget FDECL(init_info_form, (Widget,Widget,Widget)); +static void hilight_label(Widget); +static void update_val(struct X_status_value *,long); +static const char *width_string(int); +static void create_widget(Widget,struct X_status_value *,int); +static void get_widths(struct X_status_value *,int *,int *); +static void set_widths(struct X_status_value *,int,int); +static Widget init_column(char *,Widget,Widget,Widget,int *); +static Widget init_info_form(Widget,Widget,Widget); /* * Form entry storage indices. diff --git a/win/X11/wintext.c b/win/X11/wintext.c index 16798b44b..c128dfc2e 100644 --- a/win/X11/wintext.c +++ b/win/X11/wintext.c @@ -50,7 +50,7 @@ static const char rip_translations[] = : rip_dismiss_text()\n\ : rip_dismiss_text()"; -static Widget FDECL(create_ripout_widget, (Widget)); +static Widget create_ripout_widget(Widget); #endif /*ARGSUSED*/ @@ -449,7 +449,7 @@ free_text_buffer(tb) #ifdef GRAPHIC_TOMBSTONE -static void FDECL(rip_exposed, (Widget,XtPointer,XtPointer)); +static void rip_exposed(Widget,XtPointer,XtPointer); static XImage* rip_image=0; diff --git a/win/share/gifread.c b/win/share/gifread.c index 9757227ea..fc91e7fcd 100644 --- a/win/share/gifread.c +++ b/win/share/gifread.c @@ -17,7 +17,7 @@ #include "tile.h" #ifndef MONITOR_HEAP -extern long *FDECL(alloc, (unsigned int)); +extern long *alloc(unsigned int); #endif #define PPM_ASSIGN(p,red,grn,blu) do { (p).r = (red); (p).g = (grn); (p).b = (blu); } while ( 0 ) @@ -56,19 +56,19 @@ static int tiles_across, tiles_down, curr_tiles_across, curr_tiles_down; static pixel **image; static unsigned char input_code_size; -static int FDECL(GetDataBlock, (FILE *fd, unsigned char *buf)); -static void FDECL(DoExtension, (FILE *fd, int label)); -static boolean FDECL(ReadColorMap, (FILE *fd, int number)); -static void FDECL(read_header, (FILE *fd)); -static int FDECL(GetCode, (FILE *fd, int code_size, int flag)); -static int FDECL(LWZReadByte, (FILE *fd, int flag, int input_code_size)); -static void FDECL(ReadInterleavedImage, (FILE *fd, int len, int height)); -static void FDECL(ReadTileStrip, (FILE *fd, int len)); +static int GetDataBlock(FILE *fd, unsigned char *buf); +static void DoExtension(FILE *fd, int label); +static boolean ReadColorMap(FILE *fd, int number); +static void read_header(FILE *fd); +static int GetCode(FILE *fd, int code_size, int flag); +static int LWZReadByte(FILE *fd, int flag, int input_code_size); +static void ReadInterleavedImage(FILE *fd, int len, int height); +static void ReadTileStrip(FILE *fd, int len); /* These should be in gif.h, but there isn't one. */ -boolean FDECL(fopen_gif_file, (const char *, const char *)); -boolean FDECL(read_gif_tile, (pixel(*)[])); -int NDECL(fclose_gif_file); +boolean fopen_gif_file(const char *, const char *); +boolean read_gif_tile(pixel(*)[]); +int fclose_gif_file(); static int GetDataBlock(fd, buf) diff --git a/win/share/ppmwrite.c b/win/share/ppmwrite.c index ced5ffceb..ed44f3da7 100644 --- a/win/share/ppmwrite.c +++ b/win/share/ppmwrite.c @@ -6,7 +6,7 @@ #include "tile.h" #ifndef MONITOR_HEAP -extern long *FDECL(alloc, (unsigned int)); +extern long *alloc(unsigned int); #endif FILE *ppm_file; @@ -19,8 +19,8 @@ struct ppmscreen { static int tiles_across, tiles_down, curr_tiles_across; static pixel **image; -static void NDECL(write_header); -static void NDECL(WriteTileStrip); +static void write_header(); +static void WriteTileStrip(); static void write_header() diff --git a/win/share/tile.h b/win/share/tile.h index 4dd763344..565c79a72 100644 --- a/win/share/tile.h +++ b/win/share/tile.h @@ -30,17 +30,17 @@ extern int colorsinmainmap; #define Fprintf (void) fprintf -extern boolean FDECL(fopen_text_file, (const char *, const char *)); -extern boolean FDECL(read_text_tile, (pixel (*)[TILE_X])); -extern boolean FDECL(write_text_tile, (pixel (*)[TILE_X])); -extern int NDECL(fclose_text_file); +extern boolean fopen_text_file(const char *, const char *); +extern boolean read_text_tile(pixel (*)[TILE_X]); +extern boolean write_text_tile(pixel (*)[TILE_X]); +extern int fclose_text_file(); -extern void NDECL(init_colormap); -extern void NDECL(merge_colormap); +extern void init_colormap(); +extern void merge_colormap(); #if defined(MICRO) || defined(WIN32) #undef exit # if !defined(MSDOS) && !defined(WIN32) -extern void FDECL(exit, (int)); +extern void exit(int); # endif #endif diff --git a/win/share/tile2bmp.c b/win/share/tile2bmp.c index 9e98fb42c..e7c7435c2 100644 --- a/win/share/tile2bmp.c +++ b/win/share/tile2bmp.c @@ -42,7 +42,7 @@ #define BITCOUNT 8 -extern char *FDECL(tilename, (int, int)); +extern char *tilename(int, int); #define MAGICTILENO (340 + 440 + 231 + 340) @@ -153,9 +153,9 @@ FILE *tibfile2; pixel tilepixels[TILE_Y][TILE_X]; -static void FDECL(build_bmfh,(BITMAPFILEHEADER *)); -static void FDECL(build_bmih,(BITMAPINFOHEADER *)); -static void FDECL(build_bmptile,(pixel (*)[TILE_X])); +static void build_bmfh(BITMAPFILEHEADER *); +static void build_bmih(BITMAPINFOHEADER *); +static void build_bmptile(pixel (*)[TILE_X]); char *tilefiles[] = { #if (TILE_X == 32) diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 713a0e88b..d57d842c7 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -11,16 +11,16 @@ #define Fprintf (void) fprintf -const char * FDECL(tilename, (int, int)); -void NDECL(init_tilemap); -void FDECL(process_substitutions, (FILE *)); -boolean FDECL(acceptable_tilename, (int, const char *, const char *)); +const char * tilename(int, int); +void init_tilemap(); +void process_substitutions(FILE *); +boolean acceptable_tilename(int, const char *, const char *); static int include_obj_class = 0; #if defined(MICRO) || defined(WIN32) #undef exit #if !defined(MSDOS) && !defined(WIN32) -extern void FDECL(exit, (int)); +extern void exit(int); #endif #endif diff --git a/win/share/tiletext.c b/win/share/tiletext.c index d58b75287..d93b9ffc5 100644 --- a/win/share/tiletext.c +++ b/win/share/tiletext.c @@ -23,12 +23,12 @@ static const char *text_sets[] = { "monthin.txt", "objthin.txt", "oththin.txt" } static const char *text_sets[] = { "monsters.txt", "objects.txt", "other.txt" }; #endif -extern const char *FDECL(tilename, (int, int)); -extern boolean FDECL(acceptable_tilename, (int, const char *, const char *)); -static void FDECL(read_text_colormap, (FILE *)); -static boolean FDECL(write_text_colormap, (FILE *)); -static boolean FDECL(read_txttile, (FILE *, pixel(*)[TILE_X])); -static void FDECL(write_txttile, (FILE *, pixel(*)[TILE_X])); +extern const char *tilename(int, int); +extern boolean acceptable_tilename(int, const char *, const char *); +static void read_text_colormap(FILE *); +static boolean write_text_colormap(FILE *); +static boolean read_txttile(FILE *, pixel(*)[TILE_X]); +static void write_txttile(FILE *, pixel(*)[TILE_X]); /* Ugh. DICE doesn't like %[A-Z], so we have to spell it out... */ #define FORMAT_STRING \ diff --git a/win/tty/getline.c b/win/tty/getline.c index 1c95f0edb..b22cfa23f 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -13,20 +13,16 @@ #include "wintty.h" #include "func_tab.h" -#ifdef OVL1 char morc = 0; /* tell the outside world what char you chose */ -#endif /* OVL1 */ -STATIC_DCL boolean FDECL(ext_cmd_getlin_hook, (char *)); +static boolean ext_cmd_getlin_hook(char *); -typedef boolean FDECL ((*getlin_hook_proc), (char *)); +typedef boolean (*getlin_hook_proc)(char *); -STATIC_DCL void FDECL(hooked_tty_getlin, (const char*, char*, getlin_hook_proc)); -extern int NDECL(extcmd_via_menu); /* cmd.c */ +static void hooked_tty_getlin(const char*, char*, getlin_hook_proc); +extern int extcmd_via_menu(); /* cmd.c */ extern char erase_char, kill_char; /* from appropriate tty.c file */ -#ifdef OVL1 - /* * Read a line closed with '\n' into the array char bufp[BUFSZ]. * (The '\n' is not stored. The string is closed with a '\0'.) @@ -41,7 +37,7 @@ register char *bufp; hooked_tty_getlin(query, bufp, (getlin_hook_proc) 0); } -STATIC_OVL void +static void hooked_tty_getlin(query, bufp, hook) const char *query; register char *bufp; @@ -209,9 +205,6 @@ register const char *s; /* chars allowed besides return */ } -#endif /* OVL1 */ -#ifdef OVL2 - /* * Implement extended command completion by using this hook into * tty_getlin. Check the characters already typed, if they uniquely @@ -224,7 +217,7 @@ register const char *s; /* chars allowed besides return */ * + we don't change the characters that are already in base * + base has enough room to hold our string */ -STATIC_OVL boolean +static boolean ext_cmd_getlin_hook(base) char *base; { @@ -297,8 +290,6 @@ tty_get_ext_cmd() return i; } -#endif /* OVL2 */ - #endif /* TTY_GRAPHICS */ /*getline.c*/ diff --git a/win/tty/termcap.c b/win/tty/termcap.c index ff6767d36..f17c9ef72 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -17,48 +17,40 @@ #define Tgetstr(key) (tgetstr(key, &tbufptr)) #endif /* MICROPORT_286_BUG **/ -static char * FDECL(s_atr2str, (int)); -static char * FDECL(e_atr2str, (int)); +static char * s_atr2str(int); +static char * e_atr2str(int); -void FDECL(cmov, (int, int)); -void FDECL(nocmov, (int, int)); +void cmov(int, int); +void nocmov(int, int); #if defined(TEXTCOLOR) && defined(TERMLIB) -# ifdef OVLB -# if !defined(UNIX) || !defined(TERMINFO) -# ifndef TOS -static void FDECL(analyze_seq, (char *, int *, int *)); -# endif +# if !defined(UNIX) || !defined(TERMINFO) +# ifndef TOS +static void analyze_seq(char *, int *, int *); # endif -static void NDECL(init_hilite); -static void NDECL(kill_hilite); -# endif /* OVLB */ +# endif +static void init_hilite(); +static void kill_hilite(); #endif -#ifdef OVLB /* (see tcap.h) -- nh_CM, nh_ND, nh_CD, nh_HI,nh_HE, nh_US,nh_UE, ul_hack */ struct tc_lcl_data tc_lcl_data = { 0, 0, 0, 0, 0, 0, 0, FALSE }; -#endif /* OVLB */ -STATIC_VAR char *HO, *CL, *CE, *UP, *XD, *BC, *SO, *SE, *TI, *TE; -STATIC_VAR char *VS, *VE; -STATIC_VAR char *ME; -STATIC_VAR char *MR; +static char *HO, *CL, *CE, *UP, *XD, *BC, *SO, *SE, *TI, *TE; +static char *VS, *VE; +static char *ME; +static char *MR; #if 0 -STATIC_VAR char *MB, *MH; -STATIC_VAR char *MD; /* may already be in use below */ +static char *MB, *MH; +static char *MD; /* may already be in use below */ #endif #ifdef TERMLIB # ifdef TEXTCOLOR -STATIC_VAR char *MD; +static char *MD; # endif -STATIC_VAR int SG; -#ifdef OVLB -STATIC_OVL char PC = '\0'; -#else /* OVLB */ -STATIC_DCL char PC; -#endif /* OVLB */ -STATIC_VAR char tbuf[512]; +static int SG; +static char PC = '\0'; +static char tbuf[512]; #endif #ifdef TEXTCOLOR @@ -69,17 +61,15 @@ char NEARDATA *hilites[CLR_MAX]; /* terminal escapes for the various colors */ # endif #endif -#ifdef OVLB static char *KS = (char *)0, *KE = (char *)0; /* keypad sequences */ static char nullstr[] = ""; -#endif /* OVLB */ #if defined(ASCIIGRAPH) && !defined(NO_TERMS) extern boolean HE_resets_AS; #endif #ifndef TERMLIB -STATIC_VAR char tgotobuf[20]; +static char tgotobuf[20]; # ifdef TOS #define tgoto(fmt, x, y) (Sprintf(tgotobuf, fmt, y+' ', x+' '), tgotobuf) # else @@ -89,7 +79,7 @@ STATIC_VAR char tgotobuf[20]; #ifndef MSDOS -STATIC_DCL void NDECL(init_ttycolor); +static void init_ttycolor(); boolean colorflag = FALSE; /* colors are initialized */ int ttycolors[CLR_MAX]; @@ -123,7 +113,7 @@ init_ttycolor() } } -static int FDECL(convert_uchars, (char *, uchar *, int)); +static int convert_uchars(char *, uchar *, int); #ifdef VIDEOSHADES /* @@ -199,8 +189,6 @@ int size; } #endif /* !MSDOS */ -#ifdef OVLB - void tty_startup(wid, hgt) int *wid, *hgt; @@ -490,8 +478,8 @@ int state; } #ifdef TERMLIB -extern void NDECL((*decgraphics_mode_callback)); /* defined in drawing.c */ -static void NDECL(tty_decgraphics_termcap_fixup); +extern void (*decgraphics_mode_callback)(void); /* defined in drawing.c */ +static void tty_decgraphics_termcap_fixup(); /* We call this routine whenever DECgraphics mode is enabled, even if it @@ -551,12 +539,12 @@ tty_decgraphics_termcap_fixup() #endif /* TERMLIB */ #if defined(ASCIIGRAPH) && defined(PC9800) -extern void NDECL((*ibmgraphics_mode_callback)); /* defined in drawing.c */ +extern void (*ibmgraphics_mode_callback()); /* defined in drawing.c */ #endif #ifdef PC9800 -extern void NDECL((*ascgraphics_mode_callback)); /* defined in drawing.c */ -static void NDECL(tty_ascgraphics_hilite_fixup); +extern void (*ascgraphics_mode_callback()); /* defined in drawing.c */ +static void tty_ascgraphics_hilite_fixup(); static void tty_ascgraphics_hilite_fixup() @@ -610,15 +598,6 @@ tty_end_screen() /* Cursor movements */ -#endif /* OVLB */ - -#ifdef OVL0 -/* Note to OVLx tinkerers. The placement of this overlay controls the location - of the function xputc(). This function is not currently in trampoli.[ch] - files for what is deemed to be performance reasons. If this define is moved - and or xputc() is taken out of the ROOT overlay, then action must be taken - in trampoli.[ch]. */ - void nocmov(x, y) int x, y; @@ -730,9 +709,6 @@ cl_end() } } -#endif /* OVL0 */ -#ifdef OVLB - void clear_screen() { @@ -745,9 +721,6 @@ clear_screen() } } -#endif /* OVLB */ -#ifdef OVL0 - void home() { @@ -805,9 +778,6 @@ m_end() } #endif -#endif /* OVL0 */ -#ifdef OVLB - void backsp() { @@ -822,9 +792,6 @@ tty_nhbell() (void) fflush(stdout); } -#endif /* OVLB */ -#ifdef OVL0 - #ifdef ASCIIGRAPH void graph_on() { @@ -837,9 +804,6 @@ graph_off() { } #endif -#endif /* OVL0 */ -#ifdef OVL1 - #if !defined(MICRO) # ifdef VMS static const short tmspc10[] = { /* from termcap */ @@ -900,9 +864,6 @@ tty_delay_output() #endif /* MICRO */ } -#endif /* OVL1 */ -#ifdef OVLB - void cl_eos() /* free after Robert Viduya */ { /* must only be called with curx = 1 */ @@ -1703,8 +1664,6 @@ int color; #endif /* TEXTCOLOR */ -#endif /* OVLB */ - #endif /* TTY_GRAPHICS */ /*termcap.c*/ diff --git a/win/tty/topl.c b/win/tty/topl.c index c32539fa7..40fcf0574 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -14,11 +14,9 @@ #define C(c) (0x1f & (c)) #endif -STATIC_DCL void FDECL(redotoplin, (const char*)); -STATIC_DCL void FDECL(topl_putsym, (CHAR_P)); -STATIC_DCL void FDECL(removetopl, (int)); - -#ifdef OVLB +static void redotoplin(const char*); +static void topl_putsym(CHAR_P); +static void removetopl(int); int tty_doprev_message() @@ -116,10 +114,7 @@ tty_doprev_message() return 0; } -#endif /* OVLB */ -#ifdef OVL1 - -STATIC_OVL void +static void redotoplin(str) const char *str; { @@ -197,9 +192,6 @@ const char *s; ttyDisplay->toplin = 1; } -#endif /* OVL1 */ -#ifdef OVL2 - void more() { @@ -286,8 +278,7 @@ register const char *bp; if(!(cw->flags & WIN_STOP)) redotoplin(toplines); } -STATIC_OVL -void +static void topl_putsym(c) char c; { @@ -335,7 +326,7 @@ const char *str; topl_putsym(*str++); } -STATIC_OVL void +static void removetopl(n) register int n; { @@ -495,8 +486,6 @@ char def; return q; } -#endif /* OVL2 */ - #endif /* TTY_GRAPHICS */ /*topl.c*/ diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 1e1421ce7..6d74a1619 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -124,8 +124,8 @@ winid BASE_WINDOW; struct WinDesc *wins[MAXWIN]; struct DisplayDesc *ttyDisplay; /* the tty display descriptor */ -extern void FDECL(cmov, (int, int)); /* from termcap.c */ -extern void FDECL(nocmov, (int, int)); /* from termcap.c */ +extern void cmov(int, int); /* from termcap.c */ +extern void nocmov(int, int); /* from termcap.c */ #if defined(UNIX) || defined(VMS) static char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */ #endif @@ -152,7 +152,7 @@ static int clipy = 0, clipymax = 0; #endif /* CLIPPING */ #if defined(USE_TILES) && defined(MSDOS) -extern void FDECL(adjust_cursor_flags, (struct WinDesc *)); +extern void adjust_cursor_flags(struct WinDesc *); #endif #if defined(ASCIIGRAPH) && !defined(NO_TERMS) @@ -164,28 +164,28 @@ boolean HE_resets_AS; /* see termcap.c */ static const char to_continue[] = "to continue"; #define getret() getreturn(to_continue) #else -STATIC_DCL void NDECL(getret); -#endif -STATIC_DCL void FDECL(erase_menu_or_text, (winid, struct WinDesc *, BOOLEAN_P)); -STATIC_DCL void FDECL(free_window_info, (struct WinDesc *, BOOLEAN_P)); -STATIC_DCL void FDECL(dmore, (struct WinDesc *, const char *)); -STATIC_DCL void FDECL(set_item_state, (winid, int, tty_menu_item *)); -STATIC_DCL void FDECL(set_all_on_page, (winid, tty_menu_item *, tty_menu_item *)); -STATIC_DCL void FDECL(unset_all_on_page, (winid, tty_menu_item *, tty_menu_item *)); -STATIC_DCL void FDECL(invert_all_on_page, (winid, tty_menu_item *, tty_menu_item *, CHAR_P)); -STATIC_DCL void FDECL(invert_all, (winid, tty_menu_item *, tty_menu_item *, CHAR_P)); -STATIC_DCL void FDECL(process_menu_window, (winid, struct WinDesc *)); -STATIC_DCL void FDECL(process_text_window, (winid, struct WinDesc *)); -STATIC_DCL tty_menu_item *FDECL(reverse, (tty_menu_item *)); -const char * FDECL(compress_str, (const char *)); -STATIC_DCL void FDECL(tty_putsym, (winid, int, int, CHAR_P)); -static void FDECL(setup_rolemenu, (winid, BOOLEAN_P, int, int, int)); -static void FDECL(setup_racemenu, (winid, BOOLEAN_P, int, int, int)); -static void FDECL(setup_gendmenu, (winid, BOOLEAN_P, int, int, int)); -static void FDECL(setup_algnmenu, (winid, BOOLEAN_P, int, int, int)); -static boolean NDECL(reset_role_filtering); -static char *FDECL(copy_of, (const char *)); -STATIC_DCL void FDECL(bail, (const char *)); /* __attribute__((noreturn)) */ +static void getret(); +#endif +static void erase_menu_or_text(winid, struct WinDesc *, BOOLEAN_P); +static void free_window_info(struct WinDesc *, BOOLEAN_P); +static void dmore(struct WinDesc *, const char *); +static void set_item_state(winid, int, tty_menu_item *); +static void set_all_on_page(winid, tty_menu_item *, tty_menu_item *); +static void unset_all_on_page(winid, tty_menu_item *, tty_menu_item *); +static void invert_all_on_page(winid, tty_menu_item *, tty_menu_item *, CHAR_P); +static void invert_all(winid, tty_menu_item *, tty_menu_item *, CHAR_P); +static void process_menu_window(winid, struct WinDesc *); +static void process_text_window(winid, struct WinDesc *); +static tty_menu_item *reverse(tty_menu_item *); +const char * compress_str(const char *); +static void tty_putsym(winid, int, int, CHAR_P); +static void setup_rolemenu(winid, BOOLEAN_P, int, int, int); +static void setup_racemenu(winid, BOOLEAN_P, int, int, int); +static void setup_gendmenu(winid, BOOLEAN_P, int, int, int); +static void setup_algnmenu(winid, BOOLEAN_P, int, int, int); +static boolean reset_role_filtering(); +static char *copy_of(const char *); +static void bail(const char *); /* __attribute__((noreturn)) */ /* * A string containing all the default commands -- to add to a list @@ -239,7 +239,7 @@ int i, c; #endif /* USE_TILES */ /* clean up and quit */ -STATIC_OVL void +static void bail(mesg) const char *mesg; { @@ -250,7 +250,7 @@ const char *mesg; } #if defined(SIGWINCH) && defined(CLIPPING) -STATIC_OVL void +static void winch() { int oldLI = LI, oldCO = CO, i; @@ -1377,7 +1377,7 @@ tty_get_nh_event() } #if !defined(MICRO) && !defined(WIN32CON) -STATIC_OVL void +static void getret() { xputs("\n"); @@ -1550,7 +1550,7 @@ int type; return newid; } -STATIC_OVL void +static void erase_menu_or_text(window, cw, clear) winid window; struct WinDesc *cw; @@ -1568,7 +1568,7 @@ boolean clear; docorner((int)cw->offx, cw->maxrow+1); } -STATIC_OVL void +static void free_window_info(cw, free_data) struct WinDesc *cw; boolean free_data; @@ -1672,7 +1672,7 @@ winid window; cw->curx = cw->cury = 0; } -STATIC_OVL void +static void dmore(cw, s) register struct WinDesc *cw; const char *s; /* valid responses */ @@ -1692,7 +1692,7 @@ const char *s; /* valid responses */ xwaitforspace(s); } -STATIC_OVL void +static void set_item_state(window, lineno, item) winid window; int lineno; @@ -1706,7 +1706,7 @@ tty_menu_item *item; term_end_attr(item->attr); } -STATIC_OVL void +static void set_all_on_page(window, page_start, page_end) winid window; tty_menu_item *page_start, *page_end; @@ -1721,7 +1721,7 @@ tty_menu_item *page_start, *page_end; } } -STATIC_OVL void +static void unset_all_on_page(window, page_start, page_end) winid window; tty_menu_item *page_start, *page_end; @@ -1737,7 +1737,7 @@ tty_menu_item *page_start, *page_end; } } -STATIC_OVL void +static void invert_all_on_page(window, page_start, page_end, acc) winid window; tty_menu_item *page_start, *page_end; @@ -1761,7 +1761,7 @@ char acc; /* group accelerator, 0 => all */ * Invert all entries that match the give group accelerator (or all if * zero). */ -STATIC_OVL void +static void invert_all(window, page_start, page_end, acc) winid window; tty_menu_item *page_start, *page_end; @@ -1817,7 +1817,7 @@ int *color, *attr; } #endif /* MENU_COLOR */ -STATIC_OVL void +static void process_menu_window(window, cw) winid window; struct WinDesc *cw; @@ -2176,7 +2176,7 @@ struct WinDesc *cw; free((genericptr_t)morestr); } -STATIC_OVL void +static void process_text_window(window, cw) winid window; struct WinDesc *cw; @@ -2476,7 +2476,7 @@ register int x, y; /* not xchar: perhaps xchar is unsigned and ttyDisplay->cury = y; } -STATIC_OVL void +static void tty_putsym(window, x, y, ch) winid window; int x, y; @@ -2886,7 +2886,7 @@ unsigned int itemflags; /* itemflags such as MENU_ITEMFLAGS_SELECTED */ } /* Invert the given list, can handle NULL as an input. */ -STATIC_OVL tty_menu_item * +static tty_menu_item * reverse(curr) tty_menu_item *curr; { diff --git a/win/unsupported/Qt/tileedit.cpp b/win/unsupported/Qt/tileedit.cpp index faee82f6f..9029d3ca3 100644 --- a/win/unsupported/Qt/tileedit.cpp +++ b/win/unsupported/Qt/tileedit.cpp @@ -26,7 +26,7 @@ tileedit: tileedit.cpp $(TEXT_IO) extern "C" { #include "config.h" #include "tile.h" -extern const char *FDECL(tilename, (int, int)); +extern const char *tilename(int, int); } #define TILES_ACROSS 20 diff --git a/win/unsupported/gem/tile2img.c b/win/unsupported/gem/tile2img.c index fa52fedd8..5ae86ff62 100644 --- a/win/unsupported/gem/tile2img.c +++ b/win/unsupported/gem/tile2img.c @@ -19,8 +19,8 @@ #define COLORS_IN_USE 16 /* 16 colors */ -extern char *FDECL(tilename, (int, int)); -static void FDECL(build_ximgtile,(pixel (*)[TILE_X])); +extern char *tilename(int, int); +static void build_ximgtile(pixel (*)[TILE_X]); void get_color(unsigned int colind, struct RGB *rgb); void get_pixel(int x, int y, unsigned int *colind); diff --git a/win/unsupported/gem/wingem.c b/win/unsupported/gem/wingem.c index 23fdb8fb5..ef8fc17f3 100644 --- a/win/unsupported/gem/wingem.c +++ b/win/unsupported/gem/wingem.c @@ -18,8 +18,8 @@ static char nullstr[] = "", winpanicstr[] = "Bad window id %d"; static int curr_status_line; -static char *FDECL(copy_of, (const char *)); -static void FDECL(bail, (const char *)); /* __attribute__((noreturn)) */ +static char *copy_of(const char *); +static void bail(const char *); /* __attribute__((noreturn)) */ extern int mar_set_tile_mode(int); extern void mar_set_font(int,const char*,int); diff --git a/win/unsupported/gem/wingem1.c b/win/unsupported/gem/wingem1.c index 90be5eb81..633686562 100644 --- a/win/unsupported/gem/wingem1.c +++ b/win/unsupported/gem/wingem1.c @@ -21,8 +21,7 @@ typedef signed char schar; #include "wintype.h" #undef genericptr_t -#define NDECL(f) f(void) -#define FDECL(f,p) f p +#define f() f(void) #define CHAR_P char #define SCHAR_P schar #define UCHAR_P uchar @@ -39,8 +38,6 @@ typedef signed char xchar; #undef SHORT_P #undef BOOLEAN_P #undef ALIGNTYP_P -#undef NDECL -#undef FDECL static char nullstr[]="", md[]="NetHack 3.4.3", strCancel[]="Cancel", strOk[]="Ok", strText[]="Text"; diff --git a/win/win32/mhmenu.c b/win/win32/mhmenu.c index c9bd1dd2b..68eee00a8 100644 --- a/win/win32/mhmenu.c +++ b/win/win32/mhmenu.c @@ -113,7 +113,7 @@ COLORREF nhcolor_to_RGB(int c) } -STATIC_OVL boolean +static boolean get_menu_coloring(str, color, attr) char *str; int *color, *attr; diff --git a/win/win32/winhack.c b/win/win32/winhack.c index e3c6e9a9c..750c2f502 100644 --- a/win/win32/winhack.c +++ b/win/win32/winhack.c @@ -33,11 +33,7 @@ typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *); #endif -#ifdef OVL0 #define SHARED_DCL -#else -#define SHARED_DCL extern -#endif /* Minimal common control library version Version _WIN_32IE Platform/IE @@ -53,7 +49,7 @@ Version _WIN_32IE Platform/IE #define INSTALL_NOTES "http://www.nethack.org/v340/ports/download-win.html#cc" /*#define COMCTL_URL "http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp"*/ -extern void FDECL(nethack_exit,(int)); +extern void nethack_exit(int); static TCHAR* _get_cmd_arg(TCHAR* pCmdLine); static HRESULT GetComCtlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor); @@ -67,7 +63,7 @@ NHWinApp _nethack_app; #endif // Foward declarations of functions included in this code module: -extern void FDECL(pcmain, (int,char **)); +extern void pcmain(int,char **); static void __cdecl mswin_moveloop(void *); #define MAX_CMDLINE_PARAM 255 @@ -137,8 +133,8 @@ int APIENTRY WinMain(HINSTANCE hInstance, InitCtrls.dwSize = sizeof(InitCtrls); InitCtrls.dwICC = ICC_LISTVIEW_CLASSES; InitCommonControlsEx(&InitCtrls); - - /* get command line parameters */ + + /* get command line parameters */ p = _get_cmd_arg(GetCommandLine()); p = _get_cmd_arg(NULL); /* skip first paramter - command name */ for( argc = 1; p && argc Date: Wed, 3 Aug 2022 22:31:47 +0200 Subject: [PATCH 3/7] Change all K&R style function definitions Compiles now on GCC with -Werror=old-style-definition and -Werror=old-style-declaration. --- include/dlb.h | 4 +- include/extern.h | 1932 ++++++++++++++++++------------------ include/system.h | 70 +- include/wincurs.h | 20 +- include/winlisp.h | 42 +- include/winprocs.h | 14 +- include/wintty.h | 90 +- src/allmain.c | 23 +- src/alloc.c | 9 +- src/apply.c | 182 ++-- src/artifact.c | 215 ++-- src/attrib.c | 74 +- src/ball.c | 63 +- src/bones.c | 38 +- src/botl.c | 72 +- src/cmd.c | 403 +++----- src/dbridge.c | 91 +- src/decl.c | 2 +- src/detect.c | 140 +-- src/dig.c | 111 +-- src/display.c | 175 ++-- src/dlb.c | 84 +- src/do.c | 113 +-- src/do_name.c | 211 ++-- src/do_wear.c | 211 ++-- src/dog.c | 62 +- src/dogmove.c | 76 +- src/dokick.c | 87 +- src/dothrow.c | 135 +-- src/drawing.c | 27 +- src/dump.c | 71 +- src/dungeon.c | 336 +++---- src/eat.c | 200 ++-- src/end.c | 119 +-- src/engrave.c | 96 +- src/exper.c | 24 +- src/explode.c | 29 +- src/extralev.c | 17 +- src/files.c | 173 ++-- src/fountain.c | 40 +- src/hack.c | 239 ++--- src/hacklib.c | 246 ++--- src/invent.c | 353 +++---- src/light.c | 83 +- src/livelog.c | 36 +- src/lock.c | 67 +- src/mail.c | 33 +- src/makemon.c | 143 +-- src/mapglyph.c | 25 +- src/mcastu.c | 55 +- src/mhitm.c | 79 +- src/mhitu.c | 122 +-- src/minion.c | 40 +- src/mklev.c | 187 ++-- src/mkmap.c | 72 +- src/mkmaze.c | 140 +-- src/mkobj.c | 295 ++---- src/mkroom.c | 103 +- src/mksheol.c | 20 +- src/mon.c | 343 +++---- src/mondata.c | 145 +-- src/monmove.c | 109 +- src/monst.c | 4 +- src/mplayer.c | 24 +- src/mthrowu.c | 124 +-- src/muse.c | 136 +-- src/music.c | 27 +- src/o_init.c | 58 +- src/objects.c | 4 +- src/objnam.c | 282 ++---- src/options.c | 261 ++--- src/pager.c | 81 +- src/pickup.c | 265 ++--- src/pline.c | 24 +- src/polyself.c | 79 +- src/potion.c | 132 +-- src/pray.c | 107 +- src/priest.c | 95 +- src/quest.c | 66 +- src/questpgr.c | 90 +- src/read.c | 132 +-- src/rect.c | 22 +- src/region.c | 111 +-- src/restore.c | 106 +- src/rip.c | 8 +- src/rnd.c | 25 +- src/role.c | 114 +-- src/rumors.c | 33 +- src/save.c | 97 +- src/shk.c | 457 +++------ src/shknam.c | 49 +- src/sit.c | 14 +- src/sounds.c | 33 +- src/sp_lev.c | 504 +++------- src/spell.c | 87 +- src/steal.c | 57 +- src/steed.c | 49 +- src/sys.c | 4 +- src/teleport.c | 126 +-- src/timeout.c | 187 ++-- src/topten.c | 85 +- src/track.c | 7 +- src/trap.c | 308 ++---- src/tutorial.c | 22 +- src/u_init.c | 11 +- src/uhitm.c | 171 ++-- src/vault.c | 72 +- src/version.c | 27 +- src/vision.c | 92 +- src/weapon.c | 140 +-- src/were.c | 30 +- src/wield.c | 61 +- src/windows.c | 14 +- src/wizard.c | 66 +- src/worm.c | 87 +- src/worn.c | 75 +- src/write.c | 11 +- src/zap.c | 290 ++---- sys/share/ioctl.c | 18 +- sys/share/posixregex.c | 2 +- sys/share/unixtty.c | 44 +- sys/unix/unixmain.c | 39 +- sys/unix/unixunix.c | 65 +- tests/options/mocks.h | 6 +- tests/unicode/mocks.h | 6 +- tests/wishing/mocks.h | 66 +- util/dgn_comp.l | 6 +- util/dgn_comp.y | 35 +- util/dgn_main.c | 12 +- util/dlb_main.c | 42 +- util/lev_comp.l | 45 +- util/lev_comp.y | 8 +- util/lev_main.c | 195 ++-- util/makedefs.c | 162 ++- util/recover.c | 22 +- win/curses/cursdial.c | 14 +- win/curses/cursdial.h | 8 +- win/curses/cursinit.c | 14 +- win/curses/cursinvt.c | 2 +- win/curses/cursmain.c | 42 +- win/curses/cursmesg.c | 10 +- win/curses/cursmisc.c | 8 +- win/curses/cursstat.h | 2 +- win/curses/curswins.c | 4 +- win/dummy/dummy_graphics.c | 44 +- win/dummy/dummy_graphics.h | 12 +- win/lisp/winlisp.c | 228 ++--- win/share/tilemap.c | 16 +- win/tty/getline.c | 21 +- win/tty/termcap.c | 119 +-- win/tty/topl.c | 30 +- win/tty/wintty.c | 299 +++--- 152 files changed, 6153 insertions(+), 9952 deletions(-) diff --git a/include/dlb.h b/include/dlb.h index 9081b74e1..fc8ebc226 100644 --- a/include/dlb.h +++ b/include/dlb.h @@ -72,8 +72,8 @@ typedef struct dlb_handle { #define DLB_P dlb * #endif -boolean dlb_init(); -void dlb_cleanup(); +boolean dlb_init(void); +void dlb_cleanup(void); #ifndef FILE_AREAS dlb *dlb_fopen(const char *, const char *); diff --git a/include/extern.h b/include/extern.h index 188d369ab..9bab54619 100644 --- a/include/extern.h +++ b/include/extern.h @@ -19,146 +19,146 @@ E char *fmt_ptr(const genericptr); /* ### allmain.c ### */ -extern void early_init(); -E void moveloop(BOOLEAN_P); -E void stop_occupation(); -E void display_gamewindows(); -E void newgame(); -E void welcome(BOOLEAN_P); -E boolean can_regenerate(); +extern void early_init(void); +E void moveloop(boolean); +E void stop_occupation(void); +E void display_gamewindows(void); +E void newgame(void); +E void welcome(boolean); +E boolean can_regenerate(void); #if defined(RECORD_REALTIME) || defined(REALTIME_ON_BOTL) -E time_t get_realtime(); +E time_t get_realtime(void); #endif /* ### apply.c ### */ -E int doapply(); -E int dorub(); -E int dojump(); +E int doapply(void); +E int dorub(void); +E int dojump(void); E int jump(int); -E int number_leashed(); +E int number_leashed(void); E void o_unleash(struct obj *); -E void m_unleash(struct monst *, BOOLEAN_P); -E void unleash_all(); +E void m_unleash(struct monst *, boolean); +E void unleash_all(void); E boolean leashable(struct monst *); -E boolean next_to_u(); +E boolean next_to_u(void); E struct obj *get_mleash(struct monst *); -E void check_leash(XCHAR_P, XCHAR_P); -E boolean um_dist(XCHAR_P, XCHAR_P, XCHAR_P); +E void check_leash(xchar, xchar); +E boolean um_dist(xchar, xchar, xchar); E boolean snuff_candle(struct obj *); E boolean snuff_lit(struct obj *); E boolean catch_lit(struct obj *); E void fix_attributes_and_properties(struct obj *, int); E boolean tinnable(struct obj *); -E void reset_trapset(); +E void reset_trapset(void); E void fig_transform(ANY_P *, long); -E int unfixable_trouble_count(BOOLEAN_P); +E int unfixable_trouble_count(boolean); /* ### artifact.c ### */ -E void init_artifacts(); +E void init_artifacts(void); E void save_artifacts(int); E void restore_artifacts(int); E const char *artiname(int); -E struct obj *mk_artifact(struct obj *, ALIGNTYP_P); +E struct obj *mk_artifact(struct obj *, aligntyp); E const char *artifact_name(const char *, short *); E boolean exist_artifact(int, const char *); -E void artifact_exists(struct obj *, const char *, BOOLEAN_P); -E int nartifact_exist(); +E void artifact_exists(struct obj *, const char *, boolean); +E int nartifact_exist(void); E boolean spec_ability(struct obj *, unsigned long); E boolean confers_luck(struct obj *); E boolean arti_reflects(struct obj *); E boolean shade_glare(struct obj *); -E boolean restrict_name(struct obj *, const char *, BOOLEAN_P); +E boolean restrict_name(struct obj *, const char *, boolean); E boolean defends(int, struct obj *); E boolean defends_when_carried(int, struct obj *); -E boolean protects(struct obj *, BOOLEAN_P); -E void set_artifact_intrinsic(struct obj *, BOOLEAN_P, long); +E boolean protects(struct obj *, boolean); +E void set_artifact_intrinsic(struct obj *, boolean, long); E int touch_artifact(struct obj *, struct monst *); E int spec_abon(struct obj *, struct monst *); E int spec_dbon(struct obj *, struct monst *, int); -E void discover_artifact(XCHAR_P); -E boolean undiscovered_artifact(XCHAR_P); +E void discover_artifact(xchar); +E boolean undiscovered_artifact(xchar); E int disp_artifact_discoveries(winid); E boolean artifact_hit(struct monst *, struct monst *, struct obj *, int *, int); -E int doinvoke(); +E int doinvoke(void); E void arti_speak(struct obj *); E boolean artifact_light(struct obj *); E long spec_m2(struct obj *); -E boolean artifact_has_invprop(struct obj *, UCHAR_P); +E boolean artifact_has_invprop(struct obj *, uchar); E long arti_cost(struct obj *); E boolean MATCH_WARN_OF_MON(struct monst *); E struct obj *what_gives(long *); E const char *get_warned_of_monster(struct obj *); E const char *glow_color(int); -E const char *glow_verb(int, BOOLEAN_P); +E const char *glow_verb(int, boolean); E void Sting_effects(int); -E int retouch_object(struct obj **, BOOLEAN_P); +E int retouch_object(struct obj **, boolean); E void retouch_equipment(int); -E void mkot_trap_warn(); +E void mkot_trap_warn(void); E boolean is_magic_key(struct monst *, struct obj *); E struct obj *has_magic_key(struct monst *); /* ### attrib.c ### */ E boolean adjattrib(int, int, int); -E void change_luck(SCHAR_P); -E int stone_luck(BOOLEAN_P); -E boolean has_luckitem(); -E void set_moreluck(); +E void change_luck(schar); +E int stone_luck(boolean); +E boolean has_luckitem(void); +E void set_moreluck(void); E void gainstr(struct obj *, int); E void losestr(int); -E void restore_attrib(); -E void exercise(int, BOOLEAN_P); -E void exerchk(); -E void reset_attribute_clock(); +E void restore_attrib(void); +E void exercise(int, boolean); +E void exerchk(void); +E void reset_attribute_clock(void); E void init_attr(int); -E void redist_attr(); +E void redist_attr(void); E void adjabil(int, int); -E int newhp(); +E int newhp(void); E schar acurr(int); -E schar acurrstr(); +E schar acurrstr(void); E void adjalign(int); -E const char * beautiful(); -E int uhp(); -E int uhpmax(); +E const char * beautiful(void); +E int uhp(void); +E int uhpmax(void); E boolean extremeattr(int); E void uchangealign(int, int); /* ### ball.c ### */ -E void ballrelease(BOOLEAN_P); -E void ballfall(); -E void placebc(); -E void unplacebc(); +E void ballrelease(boolean); +E void ballfall(void); +E void placebc(void); +E void unplacebc(void); E void set_bc(int); -E void move_bc(int, int, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); -E boolean drag_ball(XCHAR_P, XCHAR_P, int *, xchar *, xchar *, xchar *, xchar *, boolean *, BOOLEAN_P); -E void drop_ball(XCHAR_P, XCHAR_P); -E void drag_down(); -E void bc_sanity_check(); +E void move_bc(int, int, xchar, xchar, xchar, xchar); +E boolean drag_ball(xchar, xchar, int *, xchar *, xchar *, xchar *, xchar *, boolean *, boolean); +E void drop_ball(xchar, xchar); +E void drag_down(void); +E void bc_sanity_check(void); /* ### bones.c ### */ E void sanitize_name(char *); E void drop_upon_death(struct monst *, struct obj *, int, int); -E boolean can_make_bones(); +E boolean can_make_bones(void); E void savebones(struct obj *); -E int getbones(); +E int getbones(void); /* ### botl.c ### */ E int xlev_to_rank(int); E int title_to_mon(const char *, int *, int *); -E void max_rank_sz(); +E void max_rank_sz(void); #ifdef SCORE_ON_BOTL -E long botl_score(); +E long botl_score(void); #endif E int describe_level(char *); -E const char *rank(); -E const char *rank_of(int, SHORT_P, BOOLEAN_P); -extern const char* botl_realtime(); -E void bot(); +E const char *rank(void); +E const char *rank_of(int, short, boolean); +extern const char* botl_realtime(void); +E void bot(void); #ifdef DUMP_LOG E void bot1str(char *); E void bot2str(char *); @@ -167,72 +167,72 @@ E void bot3str(char *); /* ### cmd.c ### */ -E char randomkey(); +E char randomkey(void); extern boolean redraw_cmd(char); extern char cmd_from_func(int(*)(void)); #ifdef USE_TRAMPOLI -E int doextcmd(); -E int domonability(); -E int doprev_message(); -E int timed_occupation(); -E int wiz_attributes(); -E int enter_explore_mode(); +E int doextcmd(void); +E int domonability(void); +E int doprev_message(void); +E int timed_occupation(void); +E int wiz_attributes(void); +E int enter_explore_mode(void); # ifdef WIZARD -E int wiz_detect(); -E int wiz_genesis(); -E int wiz_identify(); -E int wiz_level_tele(); -E int wiz_map(); -E int wiz_where(); -E int wiz_wish(); +E int wiz_detect(void); +E int wiz_genesis(void); +E int wiz_identify(void); +E int wiz_level_tele(void); +E int wiz_map(void); +E int wiz_where(void); +E int wiz_wish(void); # endif /* WIZARD */ #endif /* USE_TRAMPOLI */ -E void reset_occupations(); +E void reset_occupations(void); E void set_occupation(int (*)(void), const char *, int); #ifdef REDO -E char pgetchar(); -E void pushch(CHAR_P); -E void savech(CHAR_P); +E char pgetchar(void); +E void pushch(char); +E void savech(char); #endif #ifdef WIZARD -E void add_debug_extended_commands(); +E void add_debug_extended_commands(void); #endif /* WIZARD */ -extern boolean bind_specialkey(UCHAR_P, const char *); +extern boolean bind_specialkey(uchar, const char *); extern char txt2key(char *); -E void parseautocomplete(char *, BOOLEAN_P); -E void reset_commands(BOOLEAN_P); +E void parseautocomplete(char *, boolean); +E void reset_commands(boolean); E void rhack(char *); -E int doextlist(); -E int extcmd_via_menu(); -extern boolean bind_key(UCHAR_P, const char *); -E void enlightenment(int, BOOLEAN_P); -E void show_conduct(int, BOOLEAN_P); -E int xytod(SCHAR_P, SCHAR_P); +E int doextlist(void); +E int extcmd_via_menu(void); +extern boolean bind_key(uchar, const char *); +E void enlightenment(int, boolean); +E void show_conduct(int, boolean); +E int xytod(schar, schar); E void dtoxy(coord *, int); -E int movecmd(CHAR_P); -E int dxdy_moveok(); +E int movecmd(char); +E int dxdy_moveok(void); E int getdir(const char *); -E void confdir(); +E void confdir(void); E const char *directionname(int); E int isok(int, int); -E int get_adjacent_loc(const char *, const char *, XCHAR_P, XCHAR_P, coord *); +E int get_adjacent_loc(const char *, const char *, xchar, xchar, coord *); E const char *click_to_cmd(int, int, int); -E char readchar(); +E char readchar(void); E int do_stair_travel(char); #ifdef WIZARD -E void sanity_check(); -#endif -E char* key2txt(UCHAR_P, char *); -E char yn_function(const char *, const char *, CHAR_P); -E char paranoid_yn(const char *, BOOLEAN_P); -E void sokoban_trickster(); -E void list_vanquished(int, BOOLEAN_P); -E void list_vanquishedonly(); +E void sanity_check(void); +#endif +E char* key2txt(uchar, char *); +E char yn_function(const char *, const char *, char); +E char paranoid_yn(const char *, boolean); +E void sokoban_trickster(void); +E void list_vanquished(char, boolean); +E void list_vanquishedonly(void); #ifdef TTY_GRAPHICS -E int tty_debug_show_colors(); +E int tty_debug_show_colors(void); #endif #ifdef CURSES_GRAPHICS -E int curses_debug_show_colors(); +E int curses_debug_show_colors(void); #endif /* ### dbridge.c ### */ @@ -256,117 +256,117 @@ E void destroy_drawbridge(int, int); /* ### decl.c ### */ -E void decl_init(); +E void decl_init(void); /* ### detect.c ### */ E boolean trapped_chest_at(int, int, int); E boolean trapped_door_at(int, int, int); -E struct obj *o_in(struct obj*, CHAR_P); +E struct obj *o_in(struct obj*, char); E struct obj *o_material(struct obj*, unsigned); E int gold_detect(struct obj *); E int food_detect(struct obj *); -E int object_detect(struct obj *, int, BOOLEAN_P); +E int object_detect(struct obj *, int, boolean); E int monster_detect(struct obj *, int); E int trap_detect(struct obj *); E const char *level_distance(d_level *); E void use_crystal_ball(struct obj **); -E void do_mapping(); -E void do_vicinity_map(); +E void do_mapping(void); +E void do_vicinity_map(void); E void cvt_sdoor_to_door(struct rm *); #ifdef USE_TRAMPOLI E void findone(int, int, genericptr_t); E void openone(int, int, genericptr_t); #endif -E int findit(); -E int openit(); +E int findit(void); +E int openit(void); E boolean detecting(void (*)(int, int, void *)); E void find_trap(struct trap *); E int dosearch0(int); -E int dosearch(); -E void sokoban_detect(); +E int dosearch(void); +E void sokoban_detect(void); extern void reveal_terrain(int, int); /* ### dig.c ### */ -E int dig_typ(struct obj *, XCHAR_P, XCHAR_P); -E boolean is_digging(); +E int dig_typ(struct obj *, xchar, xchar); +E boolean is_digging(void); #ifdef USE_TRAMPOLI -E int dig(); +E int dig(void); #endif -E int holetime(); -E boolean dig_check(struct monst *, BOOLEAN_P, int, int); +E int holetime(void); +E boolean dig_check(struct monst *, boolean, int, int); E void digactualhole(int, int, struct monst *, int); -E boolean dighole(BOOLEAN_P, BOOLEAN_P, coord *); +E boolean dighole(boolean, boolean, coord *); E int use_pick_axe(struct obj *); E int use_pick_axe2(struct obj *); E boolean mdig_tunnel(struct monst *); -E void draft_message(BOOLEAN_P); -E void watch_dig(struct monst *, XCHAR_P, XCHAR_P, BOOLEAN_P); -E void zap_dig(); +E void draft_message(boolean); +E void watch_dig(struct monst *, xchar, xchar, boolean); +E void zap_dig(void); E struct obj *bury_an_obj(struct obj *, boolean *); E void bury_objs(int, int); E void unearth_objs(int, int); E void rot_organic(ANY_P *, long); E void rot_corpse(ANY_P *, long); E struct obj *buried_ball(coord *); -E void buried_ball_to_punishment(); -E void buried_ball_to_freedom(); -E schar fillholetyp(int, int, BOOLEAN_P); -E void liquid_flow(XCHAR_P, XCHAR_P, SCHAR_P, struct trap *, const char *); -E boolean conjoined_pits(struct trap *, struct trap *, BOOLEAN_P); +E void buried_ball_to_punishment(void); +E void buried_ball_to_freedom(void); +E schar fillholetyp(int, int, boolean); +E void liquid_flow(xchar, xchar, schar, struct trap *, const char *); +E boolean conjoined_pits(struct trap *, struct trap *, boolean); #if 0 E void bury_monst(struct monst *); -E void bury_you(); -E void unearth_you(); -E void escape_tomb(); +E void bury_you(void); +E void unearth_you(void); +E void escape_tomb(void); E void bury_obj(struct obj *); #endif /* ### display.c ### */ #ifdef INVISIBLE_OBJECTS -E struct obj * vobj_at(XCHAR_P, XCHAR_P); +E struct obj * vobj_at(xchar, xchar); #endif /* INVISIBLE_OBJECTS */ extern int is_safemon(struct monst *); -E void magic_map_background(XCHAR_P, XCHAR_P, int); -E void map_background(XCHAR_P, XCHAR_P, int); +E void magic_map_background(xchar, xchar, int); +E void map_background(xchar, xchar, int); E void map_trap(struct trap *, int); E void map_object(struct obj *, int); -E void map_invisible(XCHAR_P, XCHAR_P); +E void map_invisible(xchar, xchar); E boolean unmap_invisible(int, int); E void unmap_object(int, int); extern struct obj *vobj_at(int, int); E void map_location(int, int, int); -E void feel_newsym(XCHAR_P, XCHAR_P); -E void feel_location(XCHAR_P, XCHAR_P); +E void feel_newsym(xchar, xchar); +E void feel_location(xchar, xchar); E void newsym(int, int); E void newsym_force(int, int); -E void shieldeff(XCHAR_P, XCHAR_P); +E void shieldeff(xchar, xchar); E void tmp_at(int, int); extern void flash_glyph_at(int, int, int, int); E void swallowed(int); E void under_ground(int); E void under_water(int); -E void see_monsters(); -E void set_mimic_blocking(); -E void see_objects(); -E void see_traps(); -E void curs_on_u(); -E int doredraw(); -E void docrt(); +E void see_monsters(void); +E void set_mimic_blocking(void); +E void see_objects(void); +E void see_traps(void); +E void curs_on_u(void); +E int doredraw(void); +E void docrt(void); E void show_glyph(int, int, int); -E void clear_glyph_buffer(); +E void clear_glyph_buffer(void); E void row_refresh(int, int, int); -E void cls(); +E void cls(void); E void flush_screen(int); #ifdef DUMP_LOG -E void dump_screen(); +E void dump_screen(void); #endif -E int back_to_glyph(XCHAR_P, XCHAR_P); +E int back_to_glyph(xchar, xchar); E int zapdir_to_glyph(int, int, int); -E int glyph_at(XCHAR_P, XCHAR_P); -E void set_wall_state(); +E int glyph_at(xchar, xchar); +E void set_wall_state(void); E void unset_seenv(struct rm *, int, int, int, int); E int warning_of(struct monst *); @@ -374,38 +374,38 @@ E int warning_of(struct monst *); #ifdef USE_TRAMPOLI E int drop(struct obj *); -E int wipeoff(); +E int wipeoff(void); #endif -E int dodrop(); -E boolean boulder_hits_pool(struct obj *, int, int, BOOLEAN_P); +E int dodrop(void); +E boolean boulder_hits_pool(struct obj *, int, int, boolean); E boolean flooreffects(struct obj *, int, int, const char *); E void doaltarobj(struct obj *); E boolean canletgo(struct obj *, const char *); E void dropx(struct obj *); E void dropy(struct obj *); -E void dropz(struct obj *, BOOLEAN_P); +E void dropz(struct obj *, boolean); E void obj_no_longer_held(struct obj *); -E int doddrop(); -E int dodown(); -E int doup(); +E int doddrop(void); +E int dodown(void); +E int doup(void); #ifdef INSURANCE -E void save_currentstate(); +E void save_currentstate(void); #endif -E void goto_level(d_level *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); -E void schedule_goto(d_level *, BOOLEAN_P, BOOLEAN_P, int, const char *, const char *); -E void deferred_goto(); +E void goto_level(d_level *, boolean, boolean, boolean); +E void schedule_goto(d_level *, boolean, boolean, int, const char *, const char *); +E void deferred_goto(void); E boolean revive_corpse(struct obj *); E void revive_mon(ANY_P *, long); extern void zombify_mon(union any *, long); -E int donull(); -E int dowipe(); +E int donull(void); +E int dowipe(void); E void set_wounded_legs(long, int); E void heal_legs(int); /* ### do_name.c ### */ E void do_oname(struct obj *); -E char *coord_desc(int, int, char *, CHAR_P); +E char *coord_desc(int, int, char *, char); E boolean getpos_menu(coord *, int); extern int getpos(coord *, boolean, const char *); E void getpos_sethilite(void (*f)(int), boolean (*d)(int,int)); @@ -415,15 +415,15 @@ E void new_oname(struct obj *, int); E void free_oname(struct obj *); E const char *safe_oname(struct obj *); E struct monst *christen_monst(struct monst *, const char *); -E int do_mname(); +E int do_mname(void); E struct obj *oname(struct obj *, const char *); E boolean objtyp_is_callable(int); -E int ddocall(); +E int ddocall(void); E void docall(struct obj *); E void docall_input(int); void namefloorobj(void); -E const char *rndghostname(); -E char *x_monnam(struct monst *, int, const char *, int, BOOLEAN_P); +E const char *rndghostname(void); +E char *x_monnam(struct monst *, int, const char *, int, boolean); E char *l_monnam(struct monst *); E char *mon_nam(struct monst *); E char *noit_mon_nam(struct monst *); @@ -437,13 +437,13 @@ E char *Amonnam(struct monst *); E char *a_monnam(struct monst *); E char *distant_monnam(struct monst *, int, char *); E char *mon_nam_too(struct monst *, struct monst *); -E char *minimal_monnam(struct monst *, BOOLEAN_P); -E const char *rndmonnam(); +E char *minimal_monnam(struct monst *, boolean); +E const char *rndmonnam(void); E const char *hcolor(const char *); -E const char *rndcolor(); +E const char *rndcolor(void); E const char *hliquid(const char *); #ifdef REINCARNATION -E const char *roguename(); +E const char *roguename(void); #endif E struct obj *realloc_obj(struct obj *, int, genericptr_t, int, const char *); E char *coyotename(struct monst *, char *); @@ -456,80 +456,80 @@ extern void print_mon_wounded(struct monst *, int); /* ### do_wear.c ### */ -E int lucky_fedora(); +E int lucky_fedora(void); #ifdef USE_TRAMPOLI -E int Armor_on(); -E int Boots_on(); -E int Gloves_on(); -E int Helmet_on(); +E int Armor_on(void); +E int Boots_on(void); +E int Gloves_on(void); +E int Helmet_on(void); E int select_off(struct obj *); -E int take_off(); +E int take_off(void); #endif -E const char *fingers_or_gloves(BOOLEAN_P); +E const char *fingers_or_gloves(boolean); E void off_msg(struct obj *); -E void set_wear(); +E void set_wear(void); E boolean donning(struct obj *); E boolean doffing(struct obj *); E void cancel_doff(struct obj *, long); -E void cancel_don(); +E void cancel_don(void); E int stop_donning(struct obj *); -E int Armor_off(); -E int Armor_gone(); -E int Helmet_off(); -E int Gloves_off(); -E int Boots_on(); -E int Boots_off(); -E int Cloak_off(); -E int Shield_off(); -E int Shirt_off(); -E void Amulet_off(); +E int Armor_off(void); +E int Armor_gone(void); +E int Helmet_off(void); +E int Gloves_off(void); +E int Boots_on(void); +E int Boots_off(void); +E int Cloak_off(void); +E int Shield_off(void); +E int Shirt_off(void); +E void Amulet_off(void); E void Ring_on(struct obj *); E void Ring_off(struct obj *); E void Ring_gone(struct obj *); E void Blindf_on(struct obj *); E void Blindf_off(struct obj *); -E int dotakeoff(); -E int doremring(); +E int dotakeoff(void); +E int doremring(void); E int cursed(struct obj *); E int armoroff(struct obj *); -E int canwearobj(struct obj *, long *, BOOLEAN_P); -E int dowear(); -E int doputon(); -E void find_ac(); -E void glibr(); +E int canwearobj(struct obj *, long *, boolean); +E int dowear(void); +E int doputon(void); +E void find_ac(void); +E void glibr(void); E struct obj *some_armor(struct monst *); E void erode_armor(struct monst *, int); E struct obj *stuck_ring(struct obj *, int); -E struct obj *unchanger(); -E void reset_remarm(); -E int doddoremarm(); +E struct obj *unchanger(void); +E void reset_remarm(void); +E int doddoremarm(void); E int destroy_arm(struct obj *); -E void adj_abon(struct obj *, SCHAR_P); -E boolean inaccessible_equipment(struct obj *, const char *, BOOLEAN_P); +E void adj_abon(struct obj *, schar); +E boolean inaccessible_equipment(struct obj *, const char *, boolean); /* ### dog.c ### */ E void newedog(struct monst *); E void free_edog(struct monst *); E void initedog(struct monst *); -E struct monst *make_familiar(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P); -E struct monst *makedog(); -E void update_mlstmv(); -E void losedogs(); -E void mon_arrive(struct monst *, BOOLEAN_P); +E struct monst *make_familiar(struct obj *, xchar, xchar, boolean); +E struct monst *makedog(void); +E void update_mlstmv(void); +E void losedogs(void); +E void mon_arrive(struct monst *, boolean); E void mon_catchup_elapsed_time(struct monst *, long); -E void keepdogs(BOOLEAN_P); -E void migrate_to_level(struct monst *, XCHAR_P, XCHAR_P, coord *); +E void keepdogs(boolean); +E void migrate_to_level(struct monst *, xchar, xchar, coord *); E int dogfood(struct monst *, struct obj *); E boolean tamedog(struct monst *, struct obj *); E void abuse_dog(struct monst *); -E void wary_dog(struct monst *, BOOLEAN_P); +E void wary_dog(struct monst *, boolean); /* ### dogmove.c ### */ E struct obj *droppables(struct monst *); E int dog_nutrition(struct monst *, struct obj *); -E int dog_eat(struct monst *, struct obj *, int, int, BOOLEAN_P); +E int dog_eat(struct monst *, struct obj *, int, int, boolean); E int dog_move(struct monst *, int); #ifdef USE_TRAMPOLI E void wantdoor(int, int, genericptr_t); @@ -540,29 +540,29 @@ E boolean cursed_object_at(int, int); /* ### dokick.c ### */ E boolean ghitm(struct monst *, struct obj *); -E void container_impact_dmg(struct obj *, XCHAR_P, XCHAR_P); -E int dokick(); -E boolean ship_object(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P); -E void obj_delivery(BOOLEAN_P); +E void container_impact_dmg(struct obj *, xchar, xchar); +E int dokick(void); +E boolean ship_object(struct obj *, xchar, xchar, boolean); +E void obj_delivery(boolean); E void deliver_obj_to_mon(struct monst *mtmp, int, unsigned long); -E schar down_gate(XCHAR_P, XCHAR_P); -E void impact_drop(struct obj *, XCHAR_P, XCHAR_P, XCHAR_P); +E schar down_gate(xchar, xchar); +E void impact_drop(struct obj *, xchar, xchar, xchar); /* ### dothrow.c ### */ -E int dothrow(); -E int dofire(); -E void endmultishot(BOOLEAN_P); -E void hitfloor(struct obj *, BOOLEAN_P); -E void hurtle(int, int, int, BOOLEAN_P); +E int dothrow(void); +E int dofire(void); +E void endmultishot(boolean); +E void hitfloor(struct obj *, boolean); +E void hurtle(int, int, int, boolean); E void mhurtle(struct monst *, int, int, int); E boolean throwing_weapon(struct obj *); -E void throwit(struct obj *, long, BOOLEAN_P); -E int omon_adj(struct monst *, struct obj *, BOOLEAN_P); +E void throwit(struct obj *, long, boolean); +E int omon_adj(struct monst *, struct obj *, boolean); E int thitmonst(struct monst *, struct obj *); -E int hero_breaks(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P); -E int breaks(struct obj *, XCHAR_P, XCHAR_P); -E void breakobj(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P, BOOLEAN_P); +E int hero_breaks(struct obj *, xchar, xchar, boolean); +E int breaks(struct obj *, xchar, xchar); +E void breakobj(struct obj *, xchar, xchar, boolean, boolean); E boolean breaktest(struct obj *); E boolean walk_path(coord *, coord *, boolean (*)(genericptr_t, int, int), genericptr_t); E boolean hurtle_jump(void *, int, int); @@ -570,79 +570,79 @@ E boolean hurtle_step(void *, int, int); /* ### drawing.c ### */ #endif /* !MAKEDEFS_C && !LEV_LEX_C */ -E int def_char_to_objclass(CHAR_P); -E int def_char_to_monclass(CHAR_P); +E int def_char_to_objclass(char); +E int def_char_to_monclass(char); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) E void assign_graphics(glyph_t *, int, int, int); E void switch_graphics(int); #ifdef REINCARNATION -E void assign_rogue_graphics(BOOLEAN_P); +E void assign_rogue_graphics(boolean); #endif E void assign_utf8graphics_symbol(int, glyph_t); -E void assign_moria_graphics(BOOLEAN_P); +E void assign_moria_graphics(boolean); /* ### dump.c ### */ E void dump(const char *, const char *); -E void dump_blockquote_start(); -E void dump_blockquote_end(); +E void dump_blockquote_start(void); +E void dump_blockquote_end(void); E void dump_text(const char *, const char *); E void dump_header_html(const char *); E void dump_html(const char *, const char *); -E void dump_init(); -E void dump_exit(); +E void dump_init(void); +E void dump_exit(void); E void dump_object(const char, const struct obj *, const char *); E void dump_title(char *); E void dump_subtitle(const char *); E void dump_line(const char *, const char *); -E void dump_list_start(); +E void dump_list_start(void); E void dump_list_item(const char *); E void dump_list_item_object(struct obj *); E void dump_list_item_link(const char *, const char *); -E void dump_list_end(); -E void dump_definition_list_start(); +E void dump_list_end(void); +E void dump_definition_list_start(void); E void dump_definition_list_dd(const char *); E void dump_definition_list_dt(const char *); -E void dump_definition_list_end(); -E void dump_containerconts(struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +E void dump_definition_list_end(void); +E void dump_containerconts(struct obj *, boolean, boolean, boolean); extern const char* html_escape_character(const char); E char* html_link(const char *, const char *); #ifdef DUMP_LOG -E int dump_screenshot(); -E int dumpoverview(); +E int dump_screenshot(void); +E int dumpoverview(void); #endif /* ### dungeon.c ### */ -E void save_dungeon(int, BOOLEAN_P, BOOLEAN_P); +E void save_dungeon(int, boolean, boolean); E void restore_dungeon(int); -E void insert_branch(branch *, BOOLEAN_P); -E void init_dungeons(); +E void insert_branch(branch *, boolean); +E void init_dungeons(void); E s_level *find_level(const char *); E s_level *Is_special(d_level *); #ifdef RANDOMIZED_PLANES E s_level *get_next_elemental_plane(d_level *); -E d_level *get_first_elemental_plane(); +E d_level *get_first_elemental_plane(void); #endif E branch *Is_branchlev(d_level *); E boolean builds_up(d_level *); E xchar ledger_no(d_level *); -E xchar maxledgerno(); +E xchar maxledgerno(void); E schar depth(d_level *); E xchar dunlev(d_level *); E xchar dunlevs_in_dungeon(d_level *); -E xchar ledger_to_dnum(XCHAR_P); -E xchar ledger_to_dlev(XCHAR_P); -E xchar deepest_lev_reached(BOOLEAN_P); +E xchar ledger_to_dnum(xchar); +E xchar ledger_to_dlev(xchar); +E xchar deepest_lev_reached(boolean); E boolean on_level(d_level *, d_level *); -E void next_level(BOOLEAN_P); -E void prev_level(BOOLEAN_P); +E void next_level(boolean); +E void prev_level(boolean); E void u_on_newpos(int, int); E void u_on_rndspot(int); E void u_on_sstairs(int); -E void u_on_upstairs(); -E void u_on_dnstairs(); -E boolean On_stairs(XCHAR_P, XCHAR_P); +E void u_on_upstairs(void); +E void u_on_dnstairs(void); +E boolean On_stairs(xchar, xchar); E void get_level(d_level *, int); E boolean Is_botlevel(d_level *); E boolean Can_fall_thru(d_level *); @@ -659,22 +659,22 @@ E boolean In_V_tower(d_level *); E boolean On_W_tower_level(d_level *); E boolean In_W_tower(int, int, d_level *); E void find_hell(d_level *); -E void goto_hell(BOOLEAN_P, BOOLEAN_P); +E void goto_hell(boolean, boolean); E void assign_level(d_level *, d_level *); E void assign_rnd_level(d_level *, d_level *, int); E int induced_align(int); E boolean Invocation_lev(d_level *); -E xchar level_difficulty(); +E xchar level_difficulty(void); E schar lev_by_name(const char *); #ifdef WIZARD -E schar print_dungeon(BOOLEAN_P, schar *, xchar *); +E schar print_dungeon(boolean, schar *, xchar *); #endif -E int donamelevel(); -E int dooverview(); +E int donamelevel(void); +E int dooverview(void); E void show_overview(int, int); E void forget_mapseen(int); E void init_mapseen(d_level *); -E void recalc_mapseen(); +E void recalc_mapseen(void); E void mapseen_temple(struct monst *); E void recbranch_mapseen(d_level *, d_level *); E void room_discovered(int); @@ -687,36 +687,36 @@ E const char *endgame_level_name(char *, int); /* ### eat.c ### */ #ifdef USE_TRAMPOLI -E int eatmdone(); -E int eatfood(); -E int opentin(); -E int unfaint(); +E int eatmdone(void); +E int eatfood(void); +E int opentin(void); +E int unfaint(void); #endif E boolean is_edible(struct obj *); -E void init_uhunger(); -E int Hear_again(); -E void reset_eat(); -E int doeat(); -E void gethungry(); +E void init_uhunger(void); +E int Hear_again(void); +E void reset_eat(void); +E int doeat(void); +E void gethungry(void); E void morehungry(int); E void lesshungry(int); -E boolean is_fainted(); -E void reset_faint(); -E void violated_vegetarian(); +E boolean is_fainted(void); +E void reset_faint(void); +E void violated_vegetarian(void); #if 0 -E void sync_hunger(); +E void sync_hunger(void); #endif -E void newuhs(BOOLEAN_P); +E void newuhs(boolean); E struct obj *floorfood(const char *, int); -E void vomit(); +E void vomit(void); E int eaten_stat(int, struct obj *); E void food_disappears(struct obj *); E void food_substitution(struct obj *, struct obj *); E boolean bite_monster(struct monst *mon); -E void fix_petrification(); +E void fix_petrification(void); extern int intrinsic_possible(int, struct permonst *); E void consume_oeaten(struct obj *, int); -E boolean maybe_finished_meal(BOOLEAN_P); +E boolean maybe_finished_meal(boolean); E void set_tin_variety(struct obj *, int); E int tin_variety_txt(char *, int *); E void tin_details(struct obj *, int, char *); @@ -725,7 +725,7 @@ E boolean Popeye(int); /* ### end.c ### */ E void done1(int); -E int done2(); +E int done2(void); #ifdef USE_TRAMPOLI E void done_intr(int); #endif @@ -734,9 +734,9 @@ E void done_in_by(struct monst *); E void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) E void done(int); -E void container_contents(struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +E void container_contents(struct obj *, boolean, boolean, boolean); E void nh_terminate(int) NORETURN; -E int num_genocides(); +E int num_genocides(void); E void delayed_killer(int, int, const char *); E struct kinfo *find_delayed_killer(int); E void dealloc_killer(struct kinfo *); @@ -748,23 +748,23 @@ E char *build_english_list(char *); E char *random_engraving(char *); E void wipeout_text(char *, int, unsigned); -E boolean can_reach_floor(BOOLEAN_P); -E void You_cant_reach_the_floor(int, int, BOOLEAN_P); +E boolean can_reach_floor(boolean); +E void You_cant_reach_the_floor(int, int, boolean); E void You_cant_reach_the_ceiling(int, int); -E void cant_reach_floor(int, int, BOOLEAN_P, BOOLEAN_P); +E void cant_reach_floor(int, int, boolean, boolean); E const char *surface(int, int); E const char *ceiling(int, int); -E struct engr *engr_at(XCHAR_P, XCHAR_P); -E int sengr_at(const char *, XCHAR_P, XCHAR_P); +E struct engr *engr_at(xchar, xchar); +E int sengr_at(const char *, xchar, xchar); E void u_wipe_engr(int); -E void wipe_engr_at(XCHAR_P, XCHAR_P, XCHAR_P); +E void wipe_engr_at(xchar, xchar, xchar); E void read_engr_at(int, int); -E void make_engr_at(int, int, const char *, long, XCHAR_P); +E void make_engr_at(int, int, const char *, long, xchar); E void del_engr_at(int, int); -E int freehand(); -E int doengrave(); -E int doengrave_elbereth(); -E void sanitize_engravings(); +E int freehand(void); +E int doengrave(void); +E int doengrave_elbereth(void); +E void sanitize_engravings(void); E void save_engravings(int, int); E void rest_engravings(int); E void engr_stats(const char *, char *, long *, long *); @@ -775,33 +775,33 @@ E void make_grave(int, int, const char *); /* ### exper.c ### */ E long newuexp(int); -E int newpw(); +E int newpw(void); E int experience(struct monst *, int); E void more_experienced(int, int, int); E void losexp(const char *); -E void newexplevel(); -E void pluslvl(BOOLEAN_P); -E long rndexp(BOOLEAN_P); +E void newexplevel(void); +E void pluslvl(boolean); +E long rndexp(boolean); /* ### explode.c ### */ -E void explode(int, int, int, int, CHAR_P, int); +E void explode(int, int, int, int, char, int); E long scatter(int, int, int, unsigned int, struct obj *); -E void splatter_burning_oil(int, int, BOOLEAN_P); +E void splatter_burning_oil(int, int, boolean); E void explode_oil(struct obj *, int, int); /* ### extralev.c ### */ #ifdef REINCARNATION -E void makeroguerooms(); +E void makeroguerooms(void); E void corr(int, int); -E void makerogueghost(); +E void makerogueghost(void); #endif /* ### files.c ### */ -E char *fname_encode(const char *, CHAR_P, char *, char *, int); -E char *fname_decode(CHAR_P, char *, char *, int); +E char *fname_encode(const char *, char, char *, char *, int); +E char *fname_decode(char, char *, char *, int); E const char *fqname(const char *, int, int); #ifndef FILE_AREAS E FILE *fopen_datafile(const char *, const char *, int); @@ -809,32 +809,32 @@ E FILE *fopen_datafile(const char *, const char *, int); E boolean uptodate(int, const char *); E void store_version(int); #ifdef MFLOPPY -E void set_lock_and_bones(); +E void set_lock_and_bones(void); #endif E void set_levelfile_name(char *, int); E int create_levelfile(int, char *); E int open_levelfile(int, char *); E void delete_levelfile(int); -E void clearlocks(); +E void clearlocks(void); E int create_bonesfile(d_level*, char **, char *); #ifdef MFLOPPY -E void cancel_bonesfile(); +E void cancel_bonesfile(void); #endif E void commit_bonesfile(d_level *); E int open_bonesfile(d_level*, char **); E int delete_bonesfile(d_level*); -E void compress_bonesfile(); -E void set_savefile_name(); +E void compress_bonesfile(void); +E void set_savefile_name(void); #ifdef INSURANCE E void save_savefile_name(int); #endif #if defined(WIZARD) && !defined(MICRO) -E void set_error_savefile(); +E void set_error_savefile(void); #endif -E int create_savefile(); -E int open_savefile(); -E int delete_savefile(); -E int restore_saved_game(); +E int create_savefile(void); +E int open_savefile(void); +E int delete_savefile(void); +E int restore_saved_game(void); E void compress(const char *); E void uncompress(const char *); E void compress_area(const char *, const char *); @@ -849,25 +849,25 @@ E boolean can_read_file(const char *); extern boolean read_config_file(const char *, int); E void check_recordfile(const char *); #if defined(WIZARD) -E void read_wizkit(); +E void read_wizkit(void); #endif E void paniclog(const char *, const char *); E int validate_prefix_locations(char *); -E char** get_saved_games(); +E char** get_saved_games(void); E void free_saved_games(char**); #ifdef SELF_RECOVER -E boolean recover_savefile(); +E boolean recover_savefile(void); #endif #ifdef SYSCF_FILE extern void assure_syscf_file(void); #endif E int nhclose(int); #ifdef HOLD_LOCKFILE_OPEN -E void really_close(); +E void really_close(void); #endif #ifdef WHEREIS_FILE -E void touch_whereis(); -E void delete_whereis(); +E void touch_whereis(void); +E void delete_whereis(void); E void signal_whereis(int); #endif @@ -878,19 +878,19 @@ E void dogushforth(int); # ifdef USE_TRAMPOLI E void gush(int, int, genericptr_t); # endif -E void dryup(XCHAR_P, XCHAR_P, BOOLEAN_P); -E void drinkfountain(); +E void dryup(xchar, xchar, boolean); +E void drinkfountain(void); E void dipfountain(struct obj *); #ifdef SINKS E void breaksink(int, int); -E void drinksink(); +E void drinksink(void); #endif /* ### hack.c ### */ #ifdef DUNGEON_GROWTH E void catchup_dgn_growths(int); -E void dgn_growths(BOOLEAN_P, BOOLEAN_P); +E void dgn_growths(boolean, boolean); #endif extern boolean is_valid_travelpt(int,int); E anything *uint_to_any(unsigned); @@ -898,54 +898,54 @@ E anything *long_to_any(long); E anything *monst_to_any(struct monst *); E anything *obj_to_any(struct obj *); E boolean revive_nasty(int, int, const char*); -E void movobj(struct obj *, XCHAR_P, XCHAR_P); -E boolean may_dig(XCHAR_P, XCHAR_P); -E boolean may_passwall(XCHAR_P, XCHAR_P); -E boolean bad_rock(struct permonst *, XCHAR_P, XCHAR_P); +E void movobj(struct obj *, xchar, xchar); +E boolean may_dig(xchar, xchar); +E boolean may_passwall(xchar, xchar); +E boolean bad_rock(struct permonst *, xchar, xchar); E int cant_squeeze_thru(struct monst *); -E boolean invocation_pos(XCHAR_P, XCHAR_P); +E boolean invocation_pos(xchar, xchar); E boolean test_move(int, int, int, int, int); -E boolean u_rooted(); -E void domove(); +E boolean u_rooted(void); +E void domove(void); extern void runmode_delay_output(void); -E boolean overexertion(); -E void invocation_message(); -E void switch_terrain(); -E boolean pooleffects(BOOLEAN_P); +E boolean overexertion(void); +E void invocation_message(void); +E void switch_terrain(void); +E boolean pooleffects(boolean); E void wounds_message(struct monst *); E char *mon_wounds(struct monst *); -E void spoteffects(BOOLEAN_P); -E char *in_rooms(XCHAR_P, XCHAR_P, int); +E void spoteffects(boolean); +E char *in_rooms(xchar, xchar, int); E boolean in_town(int, int); -E void check_special_room(BOOLEAN_P); -E int dopickup(); -E void lookaround(); +E void check_special_room(boolean); +E int dopickup(void); +E void lookaround(void); E boolean crawl_destination(int, int); -E int monster_nearby(); +E int monster_nearby(void); E void nomul(int, const char *); E void unmul(const char *); -E void showdmg(int, BOOLEAN_P); -E void losehp(int, const char *, BOOLEAN_P); -E void losehp_how(int, const char *, BOOLEAN_P, int); -E void set_uhpmax(int, BOOLEAN_P); -E void check_uhpmax(); -E int weight_cap(); -E int inv_weight(); -E int near_capacity(); +E void showdmg(int, boolean); +E void losehp(int, const char *, boolean); +E void losehp_how(int, const char *, boolean, int); +E void set_uhpmax(int, boolean); +E void check_uhpmax(void); +E int weight_cap(void); +E int inv_weight(void); +E int near_capacity(void); E int calc_capacity(int); -E int max_capacity(); +E int max_capacity(void); E boolean check_capacity(const char *); -E int inv_cnt(BOOLEAN_P); +E int inv_cnt(boolean); E long money_cnt(struct obj *); extern boolean MON_AT(int, int); extern boolean OBJ_AT(int, int); /* ### hacklib.c ### */ -E boolean digit(CHAR_P); -E boolean letter(CHAR_P); -E char highc(CHAR_P); -E char lowc(CHAR_P); +E boolean digit(char); +E boolean letter(char); +E char highc(char); +E char lowc(char); E char *lcase(char *); E char *ucase(char *); E char *upstart(char *); @@ -955,14 +955,14 @@ E char *strip_newline(char *); E char *eos(char *); E void sanitizestr(char *); E boolean str_end_is(const char *, const char *); -E char *strkitten(char *, CHAR_P); +E char *strkitten(char *, char); E void copynchars(char *, const char *, int); E char *strcasecpy(char *, const char *); E char *s_suffix(const char *); E char *xcrypt(const char *, char *); E boolean onlyspace(const char *); E char *tabexpand(char *); -E char *visctrl(CHAR_P); +E char *visctrl(char); E char *strsubst(char *, const char *, const char *); E int strNsubst(char *, const char *, const char *, int); E const char *ordin(int); @@ -982,32 +982,32 @@ E int strncmpi(const char *, const char *, int); #ifndef STRSTRI E char *strstri(const char *, const char *); #endif -E boolean fuzzymatch(const char *, const char *, const char *, BOOLEAN_P); +E boolean fuzzymatch(const char *, const char *, const char *, boolean); E void init_random(unsigned int); -E void reseed_random(); +E void reseed_random(void); E void set_random_state(unsigned int); -E int getyear(); -E int getmonth(); -E int getmday(); +E int getyear(void); +E int getmonth(void); +E int getmday(void); #if 0 E char *yymmdd(time_t); #endif E long yyyymmdd(time_t); -E int phase_of_the_moon(); -E boolean friday_13th(); -E boolean towelday(); -E boolean pirateday(); -E int night(); -E int midnight(); -E boolean piday(); -E boolean aprilfoolsday(); -E boolean discordian_holiday(); -extern boolean is_june(); +E int phase_of_the_moon(void); +E boolean friday_13th(void); +E boolean towelday(void); +E boolean pirateday(void); +E int night(void); +E int midnight(void); +E boolean piday(void); +E boolean aprilfoolsday(void); +E boolean discordian_holiday(void); +extern boolean is_june(void); E char *iso8601(time_t); E char *iso8601_duration(long); extern char* format_duration(long); E char *get_formatted_time(time_t, const char *); -E time_t current_epoch(); +E time_t current_epoch(void); E void strbuf_init(strbuf_t *); E void strbuf_append(strbuf_t *, const char *); E void strbuf_reserve(strbuf_t *, int); @@ -1036,67 +1036,67 @@ E struct obj *addinv(struct obj *); E struct obj *hold_another_object(struct obj *, const char *, const char *, const char *); E void useupall(struct obj *); E void useup(struct obj *); -E void consume_obj_charge(struct obj *, BOOLEAN_P); +E void consume_obj_charge(struct obj *, boolean); E void freeinv_core(struct obj *); E void freeinv(struct obj *); E void delallobj(int, int); E void delobj(struct obj *); E struct obj *sobj_at(int, int, int); -E struct obj *nxtobj(struct obj *, int, BOOLEAN_P); +E struct obj *nxtobj(struct obj *, int, boolean); E struct obj *carrying(int); -E boolean have_lizard(); +E boolean have_lizard(void); E struct obj *o_on(unsigned int, struct obj *); E boolean obj_here(struct obj *, int, int); -E boolean wearing_armor(); +E boolean wearing_armor(void); E boolean is_worn(struct obj *); E struct obj *g_at(int, int); E struct obj *mkgoldobj(long); E struct obj *getobj(const char *, const char *); -E int ggetobj(const char *, int (*)(OBJ_P), int, BOOLEAN_P, unsigned *); +E int ggetobj(const char *, int (*)(OBJ_P), int, boolean, unsigned *); E void fully_identify_obj(struct obj *); E int identify(struct obj *); -E void identify_pack(int, BOOLEAN_P); +E void identify_pack(int, boolean); E int askchain(struct obj **, const char *, int, int (*)(OBJ_P), int (*)(OBJ_P), int, const char *); E void prinv(const char *, struct obj *, long); -E char *xprname(struct obj *, const char *, CHAR_P, BOOLEAN_P, long, long); -E int ddoinv(); -E char display_inventory(const char *, BOOLEAN_P); -E char dump_inventory(const char *, BOOLEAN_P, BOOLEAN_P); -E int display_binventory(int, int, BOOLEAN_P); +E char *xprname(struct obj *, const char *, char, boolean, long, long); +E int ddoinv(void); +E char display_inventory(const char *, boolean); +E char dump_inventory(const char *, boolean, boolean); +E int display_binventory(int, int, boolean); E struct obj *display_cinventory(struct obj *); E struct obj *display_minventory(struct monst *, int, char *); -E int dotypeinv(); +E int dotypeinv(void); E const char *dfeature_at(int, int, char *); -E int look_here(int, BOOLEAN_P); -E int dolook(); -E boolean will_feel_cockatrice(struct obj *, BOOLEAN_P); -E void feel_cockatrice(struct obj *, BOOLEAN_P); +E int look_here(int, boolean); +E int dolook(void); +E boolean will_feel_cockatrice(struct obj *, boolean); +E void feel_cockatrice(struct obj *, boolean); E void stackobj(struct obj *); E boolean mergable(struct obj *, struct obj *); -E int doprgold(); -E int doprwep(); -E int doprarm(); -E int doprring(); -E int dopramulet(); -E int doprtool(); -E int doprinuse(); +E int doprgold(void); +E int doprwep(void); +E int doprarm(void); +E int doprring(void); +E int dopramulet(void); +E int doprtool(void); +E int doprinuse(void); E void useupf(struct obj *, long); -E char *let_to_name(CHAR_P, BOOLEAN_P); -E void free_invbuf(); -E void reassign(); -E int doorganize(); +E char *let_to_name(char, boolean); +E void free_invbuf(void); +E void reassign(void); +E int doorganize(void); E int count_objects(struct obj *); E int count_unidentified(struct obj *); -E void learn_unseen_invent(); -E void update_inventory(); +E void learn_unseen_invent(void); +E void update_inventory(void); E int count_unpaid(struct obj *); E int count_buc(struct obj *, int, boolean (*)(OBJ_P)); -E void tally_BUCX(struct obj *, BOOLEAN_P, int *, int *, int *, int *, int *); -E long count_contents(struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +E void tally_BUCX(struct obj *, boolean, int *, int *, int *, int *, int *); +E long count_contents(struct obj *, boolean, boolean, boolean, boolean); E void carry_obj_effects(struct obj *); E const char *currency(long); E void silly_thing(const char *, struct obj *); -E struct obj *getnextgetobj(); +E struct obj *getnextgetobj(void); #ifdef SORTLOOT E int sortloot_cmp(struct obj *, struct obj *); #endif @@ -1108,29 +1108,29 @@ E void identify_dragon(int); /* ### ioctl.c ### */ #if defined(UNIX) || defined(__BEOS__) -E void getwindowsz(); -E void getioctls(); -E void setioctls(); +E void getwindowsz(void); +E void getioctls(void); +E void setioctls(void); # ifdef SUSPEND -E int dosuspend(); +E int dosuspend(void); # endif /* SUSPEND */ #endif /* UNIX || __BEOS__ */ /* ### light.c ### */ -E void new_light_source(XCHAR_P, XCHAR_P, int, int, ANY_P *); +E void new_light_source(xchar, xchar, int, int, ANY_P *); E void del_light_source(int, ANY_P *); E void do_light_sources(char **); E void show_transient_light(struct obj *, int, int); -E void transient_light_cleanup(); +E void transient_light_cleanup(void); E struct monst *find_mid(unsigned, unsigned); E void save_light_sources(int, int, int); E void restore_light_sources(int); E void light_stats(const char *, char *, long *, long *); -E void relink_light_sources(BOOLEAN_P); -E void light_sources_sanity_check(); +E void relink_light_sources(boolean); +E void light_sources_sanity_check(void); E void obj_move_light_source(struct obj *, struct obj *); -E boolean any_light_source(); +E boolean any_light_source(void); E void snuff_light_source(int, int); E boolean obj_sheds_light(struct obj *); E boolean obj_is_burning(struct obj *); @@ -1141,26 +1141,26 @@ E int candle_light_range(struct obj *); E int arti_light_radius(struct obj *); E const char *arti_light_description(struct obj *); #ifdef WIZARD -E int wiz_light_sources(); +E int wiz_light_sources(void); #endif /* ### lock.c ### */ #ifdef USE_TRAMPOLI -E int forcelock(); -E int picklock(); +E int forcelock(void); +E int picklock(void); #endif E boolean picking_lock(int *, int *); E boolean picking_at(int, int); -E void breakchestlock(struct obj *, BOOLEAN_P); -E void reset_pick(); +E void breakchestlock(struct obj *, boolean); +E void reset_pick(void); E void maybe_reset_pick(struct obj *); -E int pick_lock(struct obj *, int, int, BOOLEAN_P); -E int doforce(); +E int pick_lock(struct obj *, int, int, boolean); +E int doforce(void); E boolean boxlock(struct obj *, struct obj *); E boolean doorlock(struct obj *, int, int); -E int doopen(); -E int doclose(); +E int doopen(void); +E int doclose(void); E int artifact_door(int, int); E boolean stumble_on_door_mimic(int, int); #ifdef AUTO_OPEN @@ -1187,21 +1187,21 @@ E void mac_speaker(struct obj *, char *); /* ### macunix.c ### */ E void regularize(char *); -E void getlock(); +E void getlock(void); /* ### macwin.c ### */ E void lock_mouse_cursor(Boolean); -E int SanePositions(); +E int SanePositions(void); /* ### mttymain.c ### */ E void getreturn(char *); E void VDECL(msmsg, (const char *, ...)); -E void gettty(); -E void setftty(); +E void gettty(void); +E void setftty(void); E void settty(const char *); -E int tgetch(); +E int tgetch(void); E void cmov(int x, int y); E void nocmov(int x, int y); @@ -1211,31 +1211,31 @@ E void nocmov(int x, int y); #ifdef MAIL # ifdef UNIX -E void getmailstatus(); +E void getmailstatus(void); # endif -E void ckmailstatus(); +E void ckmailstatus(void); E void read_hint(struct obj *); E void readmail(struct obj *); -E void maybe_hint(); +E void maybe_hint(void); #endif /* MAIL */ /* ### makemon.c ### */ -E void mon_sanity_check(); +E void mon_sanity_check(void); E void dealloc_monst(struct monst *); E boolean is_home_elemental(struct permonst *); -E struct monst *clone_mon(struct monst *, XCHAR_P, XCHAR_P); +E struct monst *clone_mon(struct monst *, xchar, xchar); E int monhp_per_lvl(struct monst *); E void newmonhp(struct monst *, int); -E struct mextra *newmextra(); +E struct mextra *newmextra(void); E void copy_mextra(struct monst *, struct monst *); E void dealloc_mextra(struct monst *); E struct monst *makemon(struct permonst *, int, int, int); E boolean create_critters(int, struct permonst *); -E struct permonst *rndmonst(); +E struct permonst *rndmonst(void); E void reset_rndmonst(int); -E struct permonst *mkclass(CHAR_P, int); -E struct permonst *mkclass_aligned(CHAR_P, int, ALIGNTYP_P); +E struct permonst *mkclass(char, int); +E struct permonst *mkclass_aligned(char, int, aligntyp); E int mkclass_poly(int); E int adj_lev(struct permonst *); E struct permonst *grow_up(struct monst *, struct monst *); @@ -1247,13 +1247,13 @@ E void newmcorpsenm(struct monst *); E void freemcorpsenm(struct monst *); E void set_mimic_sym(struct monst *); E int mbirth_limit(int); -E void mimic_hit_msg(struct monst *, SHORT_P); +E void mimic_hit_msg(struct monst *, short); E void mkmonmoney(struct monst *, long); E int bagotricks(struct obj *); -E boolean propagate(int, BOOLEAN_P, BOOLEAN_P); +E boolean propagate(int, boolean, boolean); E void create_camera_demon(struct obj *, int, int); -E int min_monster_difficulty(); -E int max_monster_difficulty(); +E int min_monster_difficulty(void); +E int max_monster_difficulty(void); E boolean prohibited_by_generation_flags(struct permonst *); E boolean usmellmon(struct permonst *); @@ -1265,7 +1265,7 @@ extern glyph_t get_monsym(int glyph); /* ### mcastu.c ### */ -E int castmu(struct monst *, struct attack *, BOOLEAN_P, BOOLEAN_P); +E int castmu(struct monst *, struct attack *, boolean, boolean); E int buzzmu(struct monst *, struct attack *); /* ### mhitm.c ### */ @@ -1273,7 +1273,7 @@ E int buzzmu(struct monst *, struct attack *); E int fightm(struct monst *); E int mattackm(struct monst *, struct monst *); E boolean engulf_target(struct monst *, struct monst *); -E int mdisplacem(struct monst *, struct monst *, BOOLEAN_P); +E int mdisplacem(struct monst *, struct monst *, boolean); E void paralyze_monst(struct monst *, int); E int sleep_monst(struct monst *, int, int); E void slept_monst(struct monst *); @@ -1284,13 +1284,13 @@ E void maybe_freeze_m(struct monst *, int, int*); /* ### mhitu.c ### */ E const char *mpoisons_subj(struct monst *, struct attack *); -E void u_slow_down(); -E struct monst *cloneu(); -E void expels(struct monst *, struct permonst *, BOOLEAN_P); +E void u_slow_down(void); +E struct monst *cloneu(void); +E void expels(struct monst *, struct permonst *, boolean); E struct attack *getmattk(struct monst *, struct monst *, int, int *, struct attack *); E int mattacku(struct monst *); E int magic_negation(struct monst *); -E boolean gulp_blnd_check(); +E boolean gulp_blnd_check(void); E int gazemu(struct monst *, struct attack *); E void mdamageu(struct monst *, int); E int could_seduce(struct monst *, struct monst *, struct attack *); @@ -1304,18 +1304,18 @@ E void spore_dies(struct monst *); E void newemin(struct monst *); E void free_emin(struct monst *); -E int monster_census(BOOLEAN_P); +E int monster_census(boolean); E int msummon(struct monst *); -E void summon_minion(ALIGNTYP_P, BOOLEAN_P); +E void summon_minion(aligntyp, boolean); E int demon_talk(struct monst *); E long bribe(struct monst *); -E int dprince(ALIGNTYP_P); -E int dlord(ALIGNTYP_P); -E int llord(); -E int ndemon(ALIGNTYP_P); -E int lminion(); +E int dprince(aligntyp); +E int dlord(aligntyp); +E int llord(void); +E int ndemon(aligntyp); +E int lminion(void); E void lose_guardian_angel(struct monst *); -E void gain_guardian_angel(); +E void gain_guardian_angel(void); /* ### mklev.c ### */ @@ -1323,57 +1323,57 @@ E void mineralize(int, int, int, int, boolean); #ifdef USE_TRAMPOLI E int do_comp(genericptr_t, genericptr_t); #endif -E void sort_rooms(); -E void add_room(int, int, int, int, BOOLEAN_P, SCHAR_P, BOOLEAN_P); -E void add_subroom(struct mkroom *, int, int, int, int, BOOLEAN_P, SCHAR_P, BOOLEAN_P); +E void sort_rooms(void); +E void add_room(int, int, int, int, boolean, schar, boolean); +E void add_subroom(struct mkroom *, int, int, int, int, boolean, schar, boolean); E void makecorridors(int); E void add_door(int, int, struct mkroom *); -E void mkpoolroom(); -E void mklev(); +E void mkpoolroom(void); +E void mklev(void); #ifdef SPECIALIZATION -E void topologize(struct mkroom *, BOOLEAN_P); +E void topologize(struct mkroom *, boolean); #else E void topologize(struct mkroom *); #endif -E void place_branch(branch *, XCHAR_P, XCHAR_P); -E boolean occupied(XCHAR_P, XCHAR_P); -E int okdoor(XCHAR_P, XCHAR_P); +E void place_branch(branch *, xchar, xchar); +E boolean occupied(xchar, xchar); +E int okdoor(xchar, xchar); E void dodoor(int, int, struct mkroom *); E void mktrap(int, int, struct mkroom *, coord*); -E void mkstairs(XCHAR_P, XCHAR_P, CHAR_P, struct mkroom *); -E void mkinvokearea(); -E void wallwalk_right(XCHAR_P, XCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, int); +E void mkstairs(xchar, xchar, char, struct mkroom *); +E void mkinvokearea(void); +E void wallwalk_right(xchar, xchar, schar, schar, schar, int); #ifdef ADVENT_CALENDAR -E boolean mk_advcal_portal(); +E boolean mk_advcal_portal(void); #endif extern void mk_knox_vault(int, int, int, int); extern d_level * get_floating_branch(d_level *, branch *); /* ### mkmap.c ### */ -void flood_fill_rm(int, int, int, BOOLEAN_P, BOOLEAN_P); +void flood_fill_rm(int, int, int, boolean, boolean); void remove_rooms(int, int, int, int); /* ### mkmaze.c ### */ E void wallification(int, int, int, int); E void wall_extends(int, int, int, int); -E void walkfrom(int, int, SCHAR_P); +E void walkfrom(int, int, schar); E void makemaz(const char *); E void mazexy(coord *); extern void get_level_extends(int *, int *, int *, int *); -E void bound_digging(); -E void mkportal(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); -E boolean bad_location(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); -E int place_lregion(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, - XCHAR_P, d_level *); -E void fixup_special(); -E void movebubbles(); -E void water_friction(); +E void bound_digging(void); +E void mkportal(xchar, xchar, xchar, xchar); +E boolean bad_location(xchar, xchar, xchar, xchar, xchar, xchar, xchar); +E int place_lregion(xchar, xchar, xchar, xchar, + xchar, xchar, xchar, xchar, + xchar, d_level *); +E void fixup_special(void); +E void movebubbles(void); +E void water_friction(void); E void save_waterlevel(int, int); E void restore_waterlevel(int); -E const char *waterbody_name(XCHAR_P, XCHAR_P); +E const char *waterbody_name(xchar, xchar); #ifdef ADVENT_CALENDAR E void fill_advent_calendar(boolean); @@ -1381,7 +1381,7 @@ E void fill_advent_calendar(boolean); /* ### mkobj.c ### */ -E struct oextra *newoextra(); +E struct oextra *newoextra(void); E void copy_oextra(struct obj *, struct obj *); E void dealloc_oextra(struct obj *); E void newomonst(struct obj *); @@ -1392,25 +1392,25 @@ E void newolong(struct obj *); E void free_olong(struct obj *); E void new_omailcmd(struct obj *, const char *); E void free_omailcmd(struct obj *); -E struct obj *mkobj_at(CHAR_P, int, int, BOOLEAN_P); +E struct obj *mkobj_at(char, int, int, boolean); E void costly_alteration(struct obj *, int); -E struct obj *mksobj_at(int, int, int, BOOLEAN_P, BOOLEAN_P); -E struct obj *mksobj_migr_to_species(int, unsigned, BOOLEAN_P, BOOLEAN_P); -E struct obj *mkobj(CHAR_P, BOOLEAN_P); -E int rndmonnum(); -E boolean bogon_is_pname(CHAR_P); +E struct obj *mksobj_at(int, int, int, boolean, boolean); +E struct obj *mksobj_migr_to_species(int, unsigned, boolean, boolean); +E struct obj *mkobj(char, boolean); +E int rndmonnum(void); +E boolean bogon_is_pname(char); E struct obj *splitobj(struct obj *, long); E struct obj *unsplitobj(struct obj *); -E void clear_splitobjs(); +E void clear_splitobjs(void); E void replace_object(struct obj *, struct obj *); E void bill_dummy_object(struct obj *); -E struct obj *mksobj(int, BOOLEAN_P, BOOLEAN_P); +E struct obj *mksobj(int, boolean, boolean); E int bcsign(struct obj *); E int weight(struct obj *); E struct obj *mkgold(long, int, int); -E struct obj *mkcorpstat(int, struct monst *, struct permonst *, int, int, BOOLEAN_P); +E struct obj *mkcorpstat(int, struct monst *, struct permonst *, int, int, boolean); E struct obj *obj_attach_mid(struct obj *, unsigned); -E struct monst *get_mtraits(struct obj *, BOOLEAN_P); +E struct monst *get_mtraits(struct obj *, boolean); E struct obj *mk_tt_object(int, int, int); E struct obj *mk_named_object(int, struct permonst *, int, int, const char *); E struct obj *rnd_treefruit_at(int, int); @@ -1436,39 +1436,39 @@ E struct obj *add_to_container(struct obj *, struct obj *); E void add_to_migration(struct obj *); E void add_to_buried(struct obj *); E void dealloc_obj(struct obj *); -E void obj_ice_effects(int, int, BOOLEAN_P); +E void obj_ice_effects(int, int, boolean); E long peek_at_iced_corpse_age(struct obj *); -E int hornoplenty(struct obj *, BOOLEAN_P); +E int hornoplenty(struct obj *, boolean); E int do_stair_travel(char); #ifdef WIZARD -E void obj_sanity_check(); +E void obj_sanity_check(void); #endif E struct obj *obj_nexto(struct obj *); -E struct obj *obj_nexto_xy(struct obj *, int, int, BOOLEAN_P); +E struct obj *obj_nexto_xy(struct obj *, int, int, boolean); E struct obj *obj_absorb(struct obj **, struct obj **); E struct obj *obj_meld(struct obj **, struct obj **); E void pudding_merge_message(struct obj *, struct obj *); -E struct obj *init_dummyobj(struct obj *, SHORT_P, long); +E struct obj *init_dummyobj(struct obj *, short, long); /* ### mkroom.c ### */ -E struct mkroom * pick_room(BOOLEAN_P); +E struct mkroom * pick_room(boolean); E void mkroom(int); E void fill_zoo(struct mkroom *); E boolean nexttodoor(int, int); -E boolean bydoor(int, int); +E boolean bydoor(xchar, xchar); E boolean somexyspace(struct mkroom *, coord *, int); E boolean has_dnstairs(struct mkroom *); E boolean has_upstairs(struct mkroom *); E int somex(struct mkroom *); E int somey(struct mkroom *); -E boolean inside_room(struct mkroom *, XCHAR_P, XCHAR_P); +E boolean inside_room(struct mkroom *, xchar, xchar); E boolean somexy(struct mkroom *, coord *); -E void mkundead(coord *, BOOLEAN_P, int); -E struct permonst *courtmon(); +E void mkundead(coord *, boolean, int); +E struct permonst *courtmon(void); E void save_rooms(int); E void rest_rooms(int); -E struct mkroom *search_special(SCHAR_P); +E struct mkroom *search_special(schar); E int cmap_to_type(int); extern boolean is_rainbow_shop(struct mkroom *); @@ -1487,7 +1487,7 @@ E int undead_to_corpse(int); E int genus(int, int); E int pm_to_cham(int); E int minliquid(struct monst *); -E int movemon(); +E int movemon(void); E int meatmetal(struct monst *); E int meatobj(struct monst *); E void mpickgold(struct monst *); @@ -1498,14 +1498,14 @@ E int max_mon_load(struct monst *); E int can_carry(struct monst *, struct obj *); E int mfndpos(struct monst *, coord *, long *, long); E boolean monnear(struct monst *, int, int); -E void dmonsfree(); +E void dmonsfree(void); E void elemental_clog(struct monst *); E int mcalcmove(struct monst*); -E void mcalcdistress(); +E void mcalcdistress(void); E void replmon(struct monst *, struct monst *); E void relmon(struct monst *, struct monst **); E struct obj *mlifesaver(struct monst *); -E boolean corpse_chance(struct monst *, struct monst *, BOOLEAN_P); +E boolean corpse_chance(struct monst *, struct monst *, boolean); #ifdef WEBB_DISINT E void mondead_helper(struct monst *, uchar); #endif @@ -1521,31 +1521,31 @@ E void mon_to_stone(struct monst*); E void m_into_limbo(struct monst *); E void mnexto(struct monst *); E void maybe_mnexto(struct monst *); -E int mnearto(struct monst *, XCHAR_P, XCHAR_P, BOOLEAN_P); +E int mnearto(struct monst *, xchar, xchar, boolean); E void poisontell(int); E void poisoned(const char *, int, const char *, int); E void m_respond(struct monst *); -E void setmangry(struct monst *, BOOLEAN_P); -E void wakeup(struct monst *, BOOLEAN_P); -E void wake_nearby(); +E void setmangry(struct monst *, boolean); +E void wakeup(struct monst *, boolean); +E void wake_nearby(void); E void wake_nearto(int, int, int); E void seemimic(struct monst *); -E void rescham(); -E void restartcham(); +E void rescham(void); +E void restartcham(void); E void restore_cham(struct monst *); E boolean hideunder(struct monst *); -E void mon_animal_list(BOOLEAN_P); +E void mon_animal_list(boolean); E boolean validvamp(struct monst *, int *, int); E void mgender_from_permonst(struct monst *, struct permonst *); -E int newcham(struct monst *, struct permonst *, BOOLEAN_P, BOOLEAN_P); +E int newcham(struct monst *, struct permonst *, boolean, boolean); E int can_be_hatched(int); -E int egg_type_from_parent(int, BOOLEAN_P); -E boolean dead_species(int, BOOLEAN_P); -E void kill_genocided_monsters(); +E int egg_type_from_parent(int, boolean); +E boolean dead_species(int, boolean); +E void kill_genocided_monsters(void); E void kill_monster_on_level(int); E void golemeffects(struct monst *, int, int); -E boolean angry_guards(BOOLEAN_P); -E void pacify_guards(); +E boolean angry_guards(boolean); +E void pacify_guards(void); E void decide_to_shapeshift(struct monst *, int); /* ### mondata.c ### */ @@ -1558,7 +1558,7 @@ E boolean poly_when_stoned(struct permonst *); E boolean resists_drli(struct monst *); E boolean resists_magm(struct monst *); E boolean resists_blnd(struct monst *); -E boolean can_blnd(struct monst *, struct monst *, UCHAR_P, struct obj *); +E boolean can_blnd(struct monst *, struct monst *, uchar, struct obj *); E boolean ranged_attk(struct permonst *); E boolean hates_silver(struct permonst *); E boolean mon_hates_silver(struct monst *); @@ -1582,7 +1582,7 @@ E int monsndx(struct permonst *); E int name_to_mon(const char *); E int name_to_monclass(const char *, int *); E int gender(struct monst *); -E int pronoun_gender(struct monst *, BOOLEAN_P); +E int pronoun_gender(struct monst *, boolean); E boolean levl_follower(struct monst *); E int little_to_big(int); E int big_to_little(int); @@ -1597,13 +1597,13 @@ extern boolean is_fleshy(const struct permonst *); E boolean itsstuck(struct monst *); E boolean mb_trapped(struct monst *); -E boolean mon_has_key(struct monst *, BOOLEAN_P); -E void mon_regen(struct monst *, BOOLEAN_P); +E boolean mon_has_key(struct monst *, boolean); +E void mon_regen(struct monst *, boolean); E int dochugw(struct monst *); E boolean onscary(int, int, struct monst *); -E void monflee(struct monst *, int, BOOLEAN_P, BOOLEAN_P); +E void monflee(struct monst *, int, boolean, boolean); E int dochug(struct monst *); -E boolean m_digweapon_check(struct monst *, XCHAR_P, XCHAR_P); +E boolean m_digweapon_check(struct monst *, xchar, xchar); E int m_move(struct monst *, int); extern int m_move_aggress(struct monst *, xchar, xchar); E boolean closed_door(int, int); @@ -1611,65 +1611,65 @@ E boolean accessible(int, int); E void set_apparxy(struct monst *); E boolean can_ooze(struct monst *); E boolean can_fog(struct monst *); -E boolean should_displace(struct monst *, coord *, long *, int, XCHAR_P, XCHAR_P); -E boolean undesirable_disp(struct monst *, XCHAR_P, XCHAR_P); +E boolean should_displace(struct monst *, coord *, long *, int, xchar, xchar); +E boolean undesirable_disp(struct monst *, xchar, xchar); /* ### monst.c ### */ -E void monst_init(); +E void monst_init(void); /* ### monstr.c ### */ -E void monstr_init(); +E void monstr_init(void); /* ### mplayer.c ### */ -E struct monst *mk_mplayer(struct permonst *, XCHAR_P, XCHAR_P, BOOLEAN_P); -E void create_mplayers(int, BOOLEAN_P); +E struct monst *mk_mplayer(struct permonst *, xchar, xchar, boolean); +E void create_mplayers(int, boolean); E void mplayer_talk(struct monst *); -extern const char* dev_name(); +extern const char* dev_name(void); #if defined(MICRO) || defined(WIN32) /* ### msdos.c,os2.c,tos.c,winnt.c ### */ # ifndef WIN32 -E int tgetch(); +E int tgetch(void); # endif # ifndef TOS -E char switchar(); +E char switchar(void); # endif # ifndef __GO32__ E long freediskspace(char *); # ifdef MSDOS E int findfirst_file(char *); -E int findnext_file(); +E int findnext_file(void); E long filesize_nh(char *); # else E int findfirst(char *); -E int findnext(); +E int findnext(void); E long filesize(char *); # endif /* MSDOS */ -E char *foundfile_buffer(); +E char *foundfile_buffer(void); # endif /* __GO32__ */ E void chdrive(char *); # ifndef TOS -E void disable_ctrlP(); -E void enable_ctrlP(); +E void disable_ctrlP(void); +E void enable_ctrlP(void); # endif # if defined(MICRO) && !defined(WINNT) -E void get_scr_size(); +E void get_scr_size(void); # ifndef TOS E void gotoxy(int, int); # endif # endif # ifdef TOS E int _copyfile(char *, char *); -E int kbhit(); -E void set_colors(); -E void restore_colors(); +E int kbhit(void); +E void set_colors(void); +E void restore_colors(void); # ifdef SUSPEND -E int dosuspend(); +E int dosuspend(void); # endif # endif /* TOS */ # ifdef WIN32 @@ -1683,11 +1683,11 @@ E void Delay(int); /* ### mthrowu.c ### */ E int thitu(int, int, struct obj **, const char *); -E int ohitmon(struct monst *, struct obj *, int, BOOLEAN_P); +E int ohitmon(struct monst *, struct obj *, int, boolean); E void thrwmu(struct monst *); E int spitmu(struct monst *, struct attack *); E int breamu(struct monst *, struct attack *); -E boolean linedup(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, int); +E boolean linedup(xchar, xchar, xchar, xchar, int); E boolean lined_up(struct monst *); E struct obj *m_carrying(struct monst *, int); E int thrwmm(struct monst *, struct monst *); @@ -1717,9 +1717,9 @@ E int rnd_misc_item(struct monst *); E boolean searches_for_item(struct monst *, struct obj *); E boolean mon_reflects(struct monst *, const char *); E boolean ureflects(const char *, const char *); -E void mcureblindness(struct monst *, BOOLEAN_P); -E boolean munstone(struct monst *, BOOLEAN_P); -E boolean munslime(struct monst *, BOOLEAN_P); +E void mcureblindness(struct monst *, boolean); +E boolean munstone(struct monst *, boolean); +E boolean munslime(struct monst *, boolean); /* ### music.c ### */ @@ -1730,19 +1730,19 @@ E int do_play_instrument(struct obj *); /* ### nhlan.c ### */ #ifdef LAN_FEATURES -E void init_lan_features(); -E char *lan_username(); +E void init_lan_features(void); +E char *lan_username(void); # ifdef LAN_MAIL -E boolean lan_mail_check(); +E boolean lan_mail_check(void); E void lan_mail_read(struct obj *); -E void lan_mail_init(); -E void lan_mail_finish(); -E void lan_mail_terminate(); +E void lan_mail_init(void); +E void lan_mail_finish(void); +E void lan_mail_terminate(void); # endif #endif /* ### nhregex.c ### */ -E struct nhregex *regex_init(); +E struct nhregex *regex_init(void); E boolean regex_compile(const char *, struct nhregex *); E const char *regex_error_desc(struct nhregex *); E boolean regex_match(const char *, struct nhregex *); @@ -1751,34 +1751,34 @@ E void regex_free(struct nhregex *); /* ### nttty.c ### */ #ifdef WIN32CON -E void get_scr_size(); -E int nttty_kbhit(); -E void nttty_open(); -E void nttty_rubout(); -E int tgetch(); +E void get_scr_size(void); +E int nttty_kbhit(void); +E void nttty_open(void); +E void nttty_rubout(void); +E int tgetch(void); E int ntposkey(int *, int *, int *); E void set_output_mode(int); -E void synch_cursor(); +E void synch_cursor(void); #endif /* ### o_init.c ### */ -E void init_objects(); -E int find_skates(); -E void oinit(); +E void init_objects(void); +E int find_skates(void); +E void oinit(void); E void savenames(int, int); E void restnames(int); -E void discover_object(int, BOOLEAN_P, BOOLEAN_P); +E void discover_object(int, boolean, boolean); E void undiscover_object(int); -E int dodiscovered(); -E void dragons_init(); +E int dodiscovered(void); +E void dragons_init(void); E void makeknown_msg(int); -E int doclassdisco(); -E void rename_disco(); +E int doclassdisco(void); +E void rename_disco(void); /* ### objects.c ### */ -E void objects_init(); +E void objects_init(void); /* ### objnam.c ### */ @@ -1788,7 +1788,7 @@ E char *dump_typename(int); E char *safe_typename(int); E boolean obj_is_pname(struct obj *); E char *distant_name(struct obj *, char *(*)(OBJ_P)); -E char *fruitname(BOOLEAN_P); +E char *fruitname(boolean); E struct fruit *fruit_from_indx(int); E char *xname(struct obj *); E char *mshot_xname(struct obj *); @@ -1839,27 +1839,27 @@ E const char *gloves_simple_name(struct obj *); E const char *mimic_obj_name(struct monst *); E char *safe_qbuf(char *, const char *, const char *, struct obj *, char *(*)(OBJ_P), char *(*)(OBJ_P), const char *); -E int shiny_obj(CHAR_P); +E int shiny_obj(char); /* ### options.c ### */ -E boolean match_optname(const char *, const char *, int, BOOLEAN_P); -E void initoptions(); +E boolean match_optname(const char *, const char *, int, boolean); +E void initoptions(void); extern boolean parseoptions(char *, boolean, boolean); E boolean parse_monster_color(char *); E boolean parse_symbol(const char *); E boolean parse_monster_symbol(const char *); E boolean parse_object_symbol(const char *); E boolean parse_color_definition(const char *); -E int doset(); -E int dotogglepickup(); -E void option_help(); +E int doset(void); +E int dotogglepickup(void); +E void option_help(void); E void next_opt(winid, const char *); E int fruitadd(char *); -E int choose_classes_menu(const char *, int, BOOLEAN_P, char *, char *); +E int choose_classes_menu(const char *, int, boolean, char *, char *); extern boolean parsebindings(char *); -E void add_menu_cmd_alias(CHAR_P, CHAR_P); -E char map_menu_cmd(CHAR_P); +E void add_menu_cmd_alias(char, char); +E char map_menu_cmd(char); E void assign_warnings(uchar *); E char *nh_getenv(const char *); E void set_duplicate_opt_detection(int); @@ -1868,54 +1868,54 @@ E void set_wc2_option_mod_status(unsigned long, int); E void set_option_mod_status(const char *, int); #ifdef AUTOPICKUP_EXCEPTIONS E int add_autopickup_exception(const char *); -E void free_autopickup_exceptions(); +E void free_autopickup_exceptions(void); #endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef MENU_COLOR E boolean add_menu_coloring(char *); #endif /* MENU_COLOR */ -E void free_menu_coloring(); +E void free_menu_coloring(void); E const char * clr2colorname(int); E int query_color(const char *); E int query_attr(const char *); #if defined(STATUS_COLORS) && defined(TEXTCOLOR) extern boolean parse_status_color_options(char *); -extern void free_status_colors(); +extern void free_status_colors(void); #endif /* ### pager.c ### */ -E void mhidden_description(struct monst *, BOOLEAN_P, char *); +E void mhidden_description(struct monst *, boolean, char *); E boolean object_from_map(int,int,int,struct obj **); -E int do_screen_description(coord, BOOLEAN_P, glyph_t, char *, const char **, struct permonst **); +E int do_screen_description(coord, boolean, glyph_t, char *, const char **, struct permonst **); extern int do_look(int, coord *); -E int dowhatis(); -E int doquickwhatis(); -E int doidtrap(); -E int dowhatdoes(); -E char *dowhatdoes_core(CHAR_P, char *); -E int dohelp(); -E int dohistory(); -E void checkfile(struct obj *, char *, struct permonst *, BOOLEAN_P, BOOLEAN_P, char *); +E int dowhatis(void); +E int doquickwhatis(void); +E int doidtrap(void); +E int dowhatdoes(void); +E char *dowhatdoes_core(char, char *); +E int dohelp(void); +E int dohistory(void); +E void checkfile(struct obj *, char *, struct permonst *, boolean, boolean, char *); /* ### pcmain.c ### */ #if defined(MICRO) || defined(WIN32) # ifdef CHDIR -E void chdirx(char *, BOOLEAN_P); +E void chdirx(char *, boolean); # endif /* CHDIR */ #endif /* MICRO || WIN32 */ /* ### pcsys.c ### */ #if defined(MICRO) || defined(WIN32) -E void flushout(); -E int dosh(); +E void flushout(void); +E int dosh(void); # ifdef MFLOPPY E void eraseall(const char *, const char *); E void copybones(int); -E void playwoRAMdisk(); +E void playwoRAMdisk(void); E int saveDiskPrompt(int); -E void gameDiskPrompt(); +E void gameDiskPrompt(void); # endif E void append_slash(char *); E void getreturn(const char *); @@ -1928,9 +1928,9 @@ E FILE *fopenp(const char *, const char *); /* ### pctty.c ### */ #if defined(MICRO) || defined(WIN32) -E void gettty(); +E void gettty(void); E void settty(const char *); -E void setftty(); +E void setftty(void); E void VDECL(error, (const char *, ...)); #if defined(TIMED_DELAY) && defined(_MSC_VER) E void msleep(unsigned); @@ -1943,20 +1943,20 @@ E void msleep(unsigned); E void regularize(char *); #endif /* MICRO */ #if defined(PC_LOCKING) -E void getlock(); +E void getlock(void); #endif /* ### pickup.c ### */ -extern int get_most_recently_picked_up_turn(); +extern int get_most_recently_picked_up_turn(void); extern int count_most_recently_picked_up(struct obj *); extern struct obj *find_most_recently_picked_up_obj(struct obj *); E void observe_quantum_cat(struct obj *, boolean); E boolean container_gone(int (*)(OBJ_P)); -E boolean u_handsy(); +E boolean u_handsy(void); E void open_coffin(struct obj *, boolean); extern int collect_obj_classes(char *, struct obj *, boolean, boolean(*)(struct obj *), int *); -E boolean rider_corpse_revival(struct obj *, BOOLEAN_P); +E boolean rider_corpse_revival(struct obj *, boolean); E boolean menu_class_present(int); E void add_valid_menu_class(int); E boolean allow_all(struct obj *); @@ -1968,27 +1968,27 @@ E int in_container(struct obj *); E int out_container(struct obj *); #endif E int pickup(int); -E int pickup_object(struct obj *, long, BOOLEAN_P); +E int pickup_object(struct obj *, long, boolean); extern int query_category(const char *, struct obj *, int, menu_item **, int); extern int query_objlist(const char *, struct obj *, int, menu_item **, int, boolean (*)(OBJ_P)); E struct obj *pick_obj(struct obj *); -E int encumber_msg(); -E int container_at(int, int, BOOLEAN_P); -E int doloot(); -E int dotip(); -E int use_container(struct obj **, int, BOOLEAN_P); +E int encumber_msg(void); +E int container_at(int, int, boolean); +E int doloot(void); +E int dotip(void); +E int use_container(struct obj **, int, boolean); E int loot_mon(struct monst *, int *, boolean *); -E boolean is_autopickup_exception(struct obj *, BOOLEAN_P); -E boolean autopick_testobj(struct obj *, BOOLEAN_P); +E boolean is_autopickup_exception(struct obj *, boolean); +E boolean autopick_testobj(struct obj *, boolean); /* ### pline.c ### */ E void msgpline_add(int, char *); -E void msgpline_free(); +E void msgpline_free(void); E void VDECL(pline, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(custompline, (unsigned, const char *, ...)) PRINTF_F(2, 3); E void VDECL(Norep, (const char *, ...)) PRINTF_F(1, 2); -E void free_youbuf(); +E void free_youbuf(void); E void VDECL(You, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(Your, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(You_feel, (const char *, ...)) PRINTF_F(1, 2); @@ -2001,65 +2001,65 @@ E void VDECL(verbalize, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(raw_printf, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(impossible, (const char *, ...)) PRINTF_F(1, 2); E void VDECL(warning, (const char *, ...)) PRINTF_F(1, 2); -E const char *align_str(ALIGNTYP_P); +E const char *align_str(aligntyp); E void mstatusline(struct monst *); -E void ustatusline(); -E void self_invis_message(); +E void ustatusline(void); +E void self_invis_message(void); /* ### polyself.c ### */ -E void init_uasmon(); -E void set_uasmon(); -E void float_vs_flight(); -E void change_sex(); -E void polyself(BOOLEAN_P); +E void init_uasmon(void); +E void set_uasmon(void); +E void float_vs_flight(void); +E void change_sex(void); +E void polyself(boolean); E int polymon(int); -E void rehumanize(); -E int dobreathe(); -E int dospit(); -E int doremove(); -E int dospinweb(); -E int dosummon(); -E int dogaze(); -E int dohide(); -E int domindblast(); -E void uunstick(); -E void skinback(BOOLEAN_P); +E void rehumanize(void); +E int dobreathe(void); +E int dospit(void); +E int doremove(void); +E int dospinweb(void); +E int dosummon(void); +E int dogaze(void); +E int dohide(void); +E int domindblast(void); +E void uunstick(void); +E void skinback(boolean); E const char *mbodypart(struct monst *, int); E const char *body_part(int); -E int poly_gender(); +E int poly_gender(void); E void ugolemeffects(int, int); -E boolean is_playermon_genocided(); -E boolean ugenocided(); -E const char *udeadinside(); +E boolean is_playermon_genocided(void); +E boolean ugenocided(void); +E const char *udeadinside(void); /* ### potion.c ### */ E void set_itimeout(long *, long); E void incr_itimeout(long *, int); -E void make_confused(long, BOOLEAN_P); -E void make_stunned(long, BOOLEAN_P); -E void make_blinded(long, BOOLEAN_P); -E void make_sick(long, const char *, BOOLEAN_P, int); +E void make_confused(long, boolean); +E void make_stunned(long, boolean); +E void make_blinded(long, boolean); +E void make_sick(long, const char *, boolean, int); E void make_slimed(long, const char *); E void make_stoned(long, const char *, int, const char *); -E void make_vomiting(long, BOOLEAN_P); -E void toggle_blindness(); -E boolean make_hallucinated(long, BOOLEAN_P, long); +E void make_vomiting(long, boolean); +E void toggle_blindness(void); +E boolean make_hallucinated(long, boolean, long); E void make_glib(int); -E int dodrink(); +E int dodrink(void); E int dopotion(struct obj *); E int peffects(struct obj *); -E void healup(int, int, BOOLEAN_P, BOOLEAN_P); +E void healup(int, int, boolean, boolean); E void strange_feeling(struct obj *, const char *); E void potionhit(struct monst *, struct obj *, int); E void potionbreathe(struct obj *); E boolean get_wet(struct obj *); -E int dodip(); +E int dodip(void); E void mongrantswish(struct monst **); E void djinni_from_bottle(struct obj *); E struct monst *split_mon(struct monst *, struct monst *); -E const char *bottlename(); +E const char *bottlename(void); extern boolean is_dark_mix_color(struct obj *); extern boolean is_colorless_mix_potion(struct obj *); extern const char* get_base_mix_color(struct obj *); @@ -2068,63 +2068,63 @@ extern short mixtype(struct obj *, struct obj *); /* ### pray.c ### */ #ifdef USE_TRAMPOLI -E int prayer_done(); +E int prayer_done(void); #endif -E int dosacrifice(); -E boolean can_pray(BOOLEAN_P); -E int dopray(); -E const char *u_gname(); -E int doturn(); +E int dosacrifice(void); +E boolean can_pray(boolean); +E int dopray(void); +E const char *u_gname(void); +E int doturn(void); E int altarmask_at(int, int); -E const char *a_gname(); -E const char *a_gname_at(XCHAR_P x, XCHAR_P y); -E const char *align_gname(ALIGNTYP_P); -E const char *halu_gname(ALIGNTYP_P); +E const char *a_gname(void); +E const char *a_gname_at(xchar x, xchar y); +E const char *align_gname(aligntyp); +E const char *halu_gname(aligntyp); E const char *rnd_gname(int); -E const char *align_gtitle(ALIGNTYP_P); +E const char *align_gtitle(aligntyp); E void altar_wrath(int, int); #ifdef ASTRAL_ESCAPE E int invoke_amulet(struct obj *); #endif -E int in_trouble(); +E int in_trouble(void); extern void msg_luck_change(int change); /* ### priest.c ### */ -E int move_special(struct monst *, BOOLEAN_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); +E int move_special(struct monst *, boolean, schar, boolean, boolean, + xchar, xchar, xchar, xchar); E char temple_occupied(char *); E boolean inhistemple(struct monst *); E int pri_move(struct monst *); -E void priestini(d_level *, struct mkroom *, int, int, BOOLEAN_P); +E void priestini(d_level *, struct mkroom *, int, int, boolean); E aligntyp mon_aligntyp(struct monst *); E char *priestname(struct monst *, char *); E boolean p_coaligned(struct monst *); -E struct monst *findpriest(CHAR_P); +E struct monst *findpriest(char); E void intemple(int); E void forget_temple_entry(struct monst *); E void priest_talk(struct monst *); -E struct monst *mk_roamer(struct permonst *, ALIGNTYP_P, - XCHAR_P, XCHAR_P, BOOLEAN_P); +E struct monst *mk_roamer(struct permonst *, aligntyp, + xchar, xchar, boolean); E void reset_hostility(struct monst *); -E boolean in_your_sanctuary(struct monst *, XCHAR_P, XCHAR_P); +E boolean in_your_sanctuary(struct monst *, xchar, xchar); E void ghod_hitsu(struct monst *); -E void angry_priest(); -E void clearpriests(); -E void restpriest(struct monst *, BOOLEAN_P); +E void angry_priest(void); +E void clearpriests(void); +E void restpriest(struct monst *, boolean); E void newepri(struct monst *); E void free_epri(struct monst *); -E char *piousness(BOOLEAN_P, const char *); +E char *piousness(boolean, const char *); /* ### quest.c ### */ -E void onquest(); -E void nemdead(); -E void artitouch(); -E boolean ok_to_quest(); +E void onquest(void); +E void nemdead(void); +E void artitouch(void); +E boolean ok_to_quest(void); E void leader_speaks(struct monst *); -E void nemesis_speaks(); +E void nemesis_speaks(void); E void quest_chat(struct monst *); E void quest_talk(struct monst *); E void quest_stat_check(struct monst *); @@ -2132,16 +2132,16 @@ E void finish_quest(struct obj *); /* ### questpgr.c ### */ -E void load_qtlist(); -E void unload_qtlist(); +E void load_qtlist(void); +E void unload_qtlist(void); E short quest_info(int); -E const char *ldrname(); +E const char *ldrname(void); E boolean is_quest_artifact(struct obj*); E void com_pager(int); E void qt_pager(int); E char *string_subst(char *); E void qt_com_firstline(int, char*); -E void deliver_splev_message(); +E void deliver_splev_message(void); /* ### random.c ### */ @@ -2149,7 +2149,7 @@ E void deliver_splev_message(); E void srandom(unsigned); E char *initstate(unsigned, char *, int); E char *setstate(char *); -E long random(); +E long random(void); #endif /* RANDOM */ /* ### read.c ### */ @@ -2158,62 +2158,62 @@ E void learn_scroll(struct obj *); E char *tshirt_text(struct obj *, char *); extern char *hawaiian_motif(struct obj *, char *); extern char *apron_text(struct obj *, char *); -E int doread(); +E int doread(void); E boolean is_chargeable(struct obj *); E void recharge(struct obj *, int); E void forget_objects(int); E void forget_levels(int); -E void forget_traps(); +E void forget_traps(void); E void forget_map(int); E int seffects(struct obj *); #ifdef USE_TRAMPOLI E void set_lit(int, int, genericptr_t); #endif -E void litroom(BOOLEAN_P, struct obj *); -E void do_genocide(int, BOOLEAN_P); +E void litroom(boolean, struct obj *); +E void do_genocide(int, boolean); E void punish(struct obj *); -E void unpunish(); -E boolean cant_revive(int *, BOOLEAN_P, struct obj *); +E void unpunish(void); +E boolean cant_revive(int *, boolean, struct obj *); #ifdef WIZARD -E boolean create_particular(); +E boolean create_particular(void); #endif -E void drop_boulder_on_player(BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); -E int drop_boulder_on_monster(int, int, BOOLEAN_P, BOOLEAN_P); +E void drop_boulder_on_player(boolean, boolean, boolean, boolean); +E int drop_boulder_on_monster(int, int, boolean, boolean); extern boolean create_particular_from_buffer(const char*); /* ### rect.c ### */ -E void init_rect(); +E void init_rect(void); E NhRect *get_rect(NhRect *); -E NhRect *rnd_rect(); +E NhRect *rnd_rect(void); E void remove_rect(NhRect *); E void add_rect(NhRect *); E void split_rects(NhRect *, NhRect *); /* ## region.c ### */ -E void clear_regions(); -E void run_regions(); -E boolean in_out_region(XCHAR_P, XCHAR_P); -E boolean m_in_out_region(struct monst *, XCHAR_P, XCHAR_P); -E void update_player_regions(); +E void clear_regions(void); +E void run_regions(void); +E boolean in_out_region(xchar, xchar); +E boolean m_in_out_region(struct monst *, xchar, xchar); +E void update_player_regions(void); E void update_monster_region(struct monst *); -E NhRegion *visible_region_at(XCHAR_P, XCHAR_P); -E void show_region(NhRegion*, XCHAR_P, XCHAR_P); +E NhRegion *visible_region_at(xchar, xchar); +E void show_region(NhRegion*, xchar, xchar); E void save_regions(int, int); -E void rest_regions(int, BOOLEAN_P); -E NhRegion* create_gas_cloud(XCHAR_P, XCHAR_P, int, size_t, int); -E NhRegion* create_cthulhu_death_cloud(XCHAR_P, XCHAR_P, int, size_t, int); -E boolean region_danger(); -E void region_safety(); +E void rest_regions(int, boolean); +E NhRegion* create_gas_cloud(xchar, xchar, int, size_t, int); +E NhRegion* create_cthulhu_death_cloud(xchar, xchar, int, size_t, int); +E boolean region_danger(void); +E void region_safety(void); /* ### restore.c ### */ -E void inven_inuse(BOOLEAN_P); +E void inven_inuse(boolean); E int dorecover(int); E void restcemetery(int, struct cemetery **); E void trickery(char *); -E void getlev(int, int, XCHAR_P, BOOLEAN_P); -E void minit(); +E void getlev(int, int, xchar, boolean); +E void minit(void); E boolean lookup_id_mapping(unsigned, unsigned *); #ifdef ZEROCOMP E int mread(int, genericptr_t, unsigned int); @@ -2241,7 +2241,7 @@ E boolean validrole(int); E boolean validrace(int, int); E boolean validgend(int, int, int); E boolean validalign(int, int, int); -E int randrole(); +E int randrole(void); E int randrace(int); E int randgend(int, int); E int randalign(int, int); @@ -2258,15 +2258,15 @@ E int pick_gend(int, int, int, int); E boolean ok_align(int, int, int, int); E int pick_align(int, int, int, int); E void role_selection_prolog(int, winid); -E void role_menu_extra(int, winid, BOOLEAN_P); -E void role_init(); -E void rigid_role_checks(); +E void role_menu_extra(int, winid, boolean); +E void role_init(void); +E void rigid_role_checks(void); E boolean setrolefilter(const char *); -E boolean gotrolefilter(); -E void clearrolefilter(); -E void plnamesuffix(); +E boolean gotrolefilter(void); +E void clearrolefilter(void); +E void plnamesuffix(void); E const char *Hello(struct monst *); -E const char *Goodbye(); +E const char *Goodbye(void); E char *build_plselection_prompt(char *, int, int, int, int, int); E char *root_plselection_prompt(char *, int, int, int, int, int); E void violated(int); @@ -2277,29 +2277,29 @@ E boolean failed_cdt(int); /* ### rumors.c ### */ -E char *getrumor(int, char *, BOOLEAN_P); +E char *getrumor(int, char *, boolean); E void outrumor(int, int); -E void outoracle(BOOLEAN_P, BOOLEAN_P); +E void outoracle(boolean, boolean); E void save_oracles(int, int); E void restore_oracles(int); E int doconsult(struct monst *); /* ### save.c ### */ -E int dosave(); +E int dosave(void); #if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32) E void hangup(int); #endif -E int dosave0(); +E int dosave0(void); #ifdef INSURANCE -E void savestateinlock(); +E void savestateinlock(void); #endif #ifdef MFLOPPY -E boolean savelev(int, XCHAR_P, int); +E boolean savelev(int, xchar, int); E boolean swapin_file(int); -E void co_false(); +E void co_false(void); #else -E void savelev(int, XCHAR_P, int); +E void savelev(int, xchar, int); #endif E void bufon(int); E void bufoff(int); @@ -2308,8 +2308,8 @@ E void bwrite(int, genericptr_t, unsigned int); E void bclose(int); E void savecemetery(int, int, struct cemetery **); E void savefruitchn(int, int); -E void free_dungeons(); -E void freedynamicdata(); +E void free_dungeons(void); +E void freedynamicdata(void); /* ### shk.c ### */ @@ -2320,97 +2320,97 @@ E void money2u(struct monst *, long); E char *Shknam(struct monst *); E char *shkname(struct monst *); E void shkgone(struct monst *); -E void set_residency(struct monst *, BOOLEAN_P); +E void set_residency(struct monst *, boolean); E void replshk(struct monst *, struct monst *); -E void restshk(struct monst *, BOOLEAN_P); -E char inside_shop(XCHAR_P, XCHAR_P); -E void u_left_shop(char *, BOOLEAN_P); -E void remote_burglary(XCHAR_P, XCHAR_P); +E void restshk(struct monst *, boolean); +E char inside_shop(xchar, xchar); +E void u_left_shop(char *, boolean); +E void remote_burglary(xchar, xchar); E void u_entered_shop(char *); E void pick_pick(struct obj *); E boolean same_price(struct obj *, struct obj *); -E void shopper_financial_report(); +E void shopper_financial_report(void); E int inhishop(struct monst *); -E struct monst *shop_keeper(CHAR_P); +E struct monst *shop_keeper(char); E boolean tended_shop(struct mkroom *); E boolean is_unpaid(struct obj *); E void delete_contents(struct obj *); E void obfree(struct obj *, struct obj *); -E void home_shk(struct monst *, BOOLEAN_P); -E void make_happy_shk(struct monst *, BOOLEAN_P); -E void make_happy_shoppers(BOOLEAN_P); +E void home_shk(struct monst *, boolean); +E void make_happy_shk(struct monst *, boolean); +E void make_happy_shoppers(boolean); E void hot_pursuit(struct monst *); -E void make_angry_shk(struct monst *, XCHAR_P, XCHAR_P); -E int dopay(); -E boolean paybill(int, BOOLEAN_P); -E void finish_paybill(); +E void make_angry_shk(struct monst *, xchar, xchar); +E int dopay(void); +E boolean paybill(int, boolean); +E void finish_paybill(void); E struct obj *find_oid(unsigned); -E long contained_cost(struct obj *, struct monst *, long, BOOLEAN_P, BOOLEAN_P); +E long contained_cost(struct obj *, struct monst *, long, boolean, boolean); E long contained_gold(struct obj *); E void picked_container(struct obj *); E void alter_cost(struct obj *, long); -E long unpaid_cost(struct obj *, BOOLEAN_P); -E boolean billable(struct monst **, struct obj *, CHAR_P, BOOLEAN_P); -E void addtobill(struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); +E long unpaid_cost(struct obj *, boolean); +E boolean billable(struct monst **, struct obj *, char, boolean); +E void addtobill(struct obj *, boolean, boolean, boolean); E void append_honorific(char *); E void splitbill(struct obj *, struct obj *); E void subfrombill(struct obj *, struct monst *); -E long stolen_value(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P, BOOLEAN_P); +E long stolen_value(struct obj *, xchar, xchar, boolean, boolean); E void sellobj_state(int); -E void sellobj(struct obj *, XCHAR_P, XCHAR_P); +E void sellobj(struct obj *, xchar, xchar); E int doinvbill(int); -E struct monst *shkcatch(struct obj *, XCHAR_P, XCHAR_P); -E void add_damage(XCHAR_P, XCHAR_P, long); -E int repair_damage(struct monst *, struct damage *, BOOLEAN_P); +E struct monst *shkcatch(struct obj *, xchar, xchar); +E void add_damage(xchar, xchar, long); +E int repair_damage(struct monst *, struct damage *, boolean); E int shk_move(struct monst *); E void after_shk_move(struct monst *); E boolean is_fshk(struct monst *); E void shopdig(int); -E void pay_for_damage(const char *, BOOLEAN_P); -E boolean costly_spot(XCHAR_P, XCHAR_P); -E struct obj *shop_object(XCHAR_P, XCHAR_P); +E void pay_for_damage(const char *, boolean); +E boolean costly_spot(xchar, xchar); +E struct obj *shop_object(xchar, xchar); E void price_quote(struct obj *); E void shk_chat(struct monst *); -E void check_unpaid_usage(struct obj *, BOOLEAN_P); +E void check_unpaid_usage(struct obj *, boolean); E void check_unpaid(struct obj *); -E void costly_gold(XCHAR_P, XCHAR_P, long); +E void costly_gold(xchar, xchar, long); E long get_cost_of_shop_item(struct obj *); E int oid_price_adjustment(struct obj *, unsigned); -E boolean block_door(XCHAR_P, XCHAR_P); -E boolean block_entry(XCHAR_P, XCHAR_P); +E boolean block_door(xchar, xchar); +E boolean block_entry(xchar, xchar); #ifdef BLACKMARKET E void blkmar_guards(struct monst *); -E void set_black_marketeer_angry(); -E void bars_around_portal(BOOLEAN_P); +E void set_black_marketeer_angry(void); +E void bars_around_portal(boolean); #endif /* BLACKMARKET */ E char *shk_your(char *, struct obj *); E char *Shk_Your(char *, struct obj *); -extern void sanity_check_shopkeepers(); +extern void sanity_check_shopkeepers(void); /* ### shknam.c ### */ E void stock_room(int, struct mkroom *); E boolean saleable(struct monst *, struct obj *); E int get_shop_item(int); -E void shop_selection_init(); -E boolean is_izchak(struct monst *, BOOLEAN_P); +E void shop_selection_init(void); +E boolean is_izchak(struct monst *, boolean); /* ### sit.c ### */ -E void take_gold(); -E int dosit(); -E void rndcurse(); -E void attrcurse(); +E void take_gold(void); +E int dosit(void); +E void rndcurse(void); +E void attrcurse(void); /* ### sounds.c ### */ -E void dosounds(); +E void dosounds(void); E const char *growl_sound(struct monst *); E void growl(struct monst *); E void yelp(struct monst *); E void whimper(struct monst *); E void beg(struct monst *); -E int dotalk(); +E int dotalk(void); #ifdef USER_SOUNDS E int add_sound_mapping(const char *); E void play_sound_for_message(const char *); @@ -2424,37 +2424,37 @@ E int assign_soundcard(char *); /* ### sp_lev.c ### */ -E boolean check_room(xchar *, xchar *, xchar *, xchar *, BOOLEAN_P); -E boolean create_room(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); -E void create_secret_door(struct mkroom *, XCHAR_P); -E boolean dig_corridor(coord *, coord *, BOOLEAN_P, SCHAR_P, SCHAR_P); -E void fill_room(struct mkroom *, BOOLEAN_P); +E boolean check_room(xchar *, xchar *, xchar *, xchar *, boolean); +E boolean create_room(xchar, xchar, xchar, xchar, + xchar, xchar, xchar, xchar); +E void create_secret_door(struct mkroom *, xchar); +E boolean dig_corridor(coord *, coord *, boolean, schar, schar); +E void fill_room(struct mkroom *, boolean); E boolean load_special(const char *); E xchar selection_getpoint(int, int, struct opvar *); E struct opvar *selection_opvar(char *); E void opvar_free_x(struct opvar *); E void set_selection_floodfillchk(int(*)(int,int)); -E void selection_floodfill(struct opvar *, int, int, BOOLEAN_P); +E void selection_floodfill(struct opvar *, int, int, boolean); /* ### spell.c ### */ E void book_cursed(struct obj *); #ifdef USE_TRAMPOLI -E int learn(); +E int learn(void); #endif E int study_book(struct obj *); E void book_disappears(struct obj *); E void book_substitution(struct obj *, struct obj *); -E void age_spells(); -E int docast(); +E void age_spells(void); +E int docast(void); E int spell_skilltype(int); -E int spelleffects(int, BOOLEAN_P); +E int spelleffects(int, boolean); E int tport_spell(int); -E void losespells(); -E int dovspell(); +E void losespells(void); +E int dovspell(void); E void initialspell(struct obj *); -E void dump_spells(); +E void dump_spells(void); E boolean parse_spellorder(char *); extern const char* spelltypemnemonic(int); extern int num_spells(void); @@ -2462,68 +2462,68 @@ extern int num_spells(void); /* ### steal.c ### */ #ifdef USE_TRAMPOLI -E int stealarm(); +E int stealarm(void); #endif E long somegold(long); E void stealgold(struct monst *); -E void remove_worn_item(struct obj *, BOOLEAN_P); +E void remove_worn_item(struct obj *, boolean); E int steal(struct monst *, char *); E int mpickobj(struct monst *, struct obj *); E void stealamulet(struct monst *); E void maybe_absorb_item(struct monst *, struct obj *, int, int); -E void mdrop_obj(struct monst *, struct obj *, BOOLEAN_P); +E void mdrop_obj(struct monst *, struct obj *, boolean); E void mdrop_special_objs(struct monst *); -E void relobj(struct monst *, int, BOOLEAN_P); +E void relobj(struct monst *, int, boolean); E struct obj *findgold(struct obj *); /* ### steed.c ### */ -E void rider_cant_reach(); +E void rider_cant_reach(void); E boolean can_saddle(struct monst *); E int use_saddle(struct obj *); E void put_saddle_on_mon(struct obj *, struct monst *); E boolean can_ride(struct monst *); -E int doride(); -E boolean mount_steed(struct monst *, BOOLEAN_P); -E void exercise_steed(); -E void kick_steed(); +E int doride(void); +E boolean mount_steed(struct monst *, boolean); +E void exercise_steed(void); +E void kick_steed(void); E void dismount_steed(int); E void place_monster(struct monst *, int, int); -E boolean stucksteed(BOOLEAN_P); +E boolean stucksteed(boolean); /* ### sys.c ### */ -extern void sys_early_init(); +extern void sys_early_init(void); /* ### teleport.c ### */ E boolean goodpos(int, int, struct monst *, unsigned); -E boolean enexto(coord *, XCHAR_P, XCHAR_P, struct permonst *); -E boolean enexto_core(coord *, XCHAR_P, XCHAR_P, struct permonst *, unsigned); -E boolean enexto_core_range(coord *, XCHAR_P, XCHAR_P, struct permonst *, unsigned, int); -E int epathto(coord *, int, XCHAR_P, XCHAR_P, struct permonst *); -E void teleds(int, int, BOOLEAN_P); -E boolean safe_teleds(BOOLEAN_P); -E boolean teleport_pet(struct monst *, BOOLEAN_P); -E int dotelecmd(); -E void tele(); -E int dotele(BOOLEAN_P); -E void level_tele(); +E boolean enexto(coord *, xchar, xchar, struct permonst *); +E boolean enexto_core(coord *, xchar, xchar, struct permonst *, unsigned); +E boolean enexto_core_range(coord *, xchar, xchar, struct permonst *, unsigned, int); +E int epathto(coord *, int, xchar, xchar, struct permonst *); +E void teleds(int, int, boolean); +E boolean safe_teleds(boolean); +E boolean teleport_pet(struct monst *, boolean); +E int dotelecmd(void); +E void tele(void); +E int dotele(boolean); +E void level_tele(void); E void domagicportal(struct trap *); E void tele_trap(struct trap *); E void level_tele_trap(struct trap *, unsigned); E void rloc_to(struct monst *, int, int); -E boolean rloc(struct monst *, BOOLEAN_P); +E boolean rloc(struct monst *, boolean); E boolean tele_restrict(struct monst *); E void mtele_trap(struct monst *, struct trap *, int); -E int mlevel_tele_trap(struct monst *, struct trap *, BOOLEAN_P, int); +E int mlevel_tele_trap(struct monst *, struct trap *, boolean, int); E boolean rloco(struct obj *); -E int random_teleport_level(); -E boolean u_teleport_mon(struct monst *, BOOLEAN_P); +E int random_teleport_level(void); +E boolean u_teleport_mon(struct monst *, boolean); /* ### termcap.c ### */ E void term_start_color(int); -E void term_end_color(); +E void term_end_color(void); E void term_start_attr(int); E void term_end_attr(int); @@ -2534,37 +2534,37 @@ E void substitute_tiles(d_level *); /* ### timeout.c ### */ -E void burn_away_slime(); -E void nh_timeout(); -E void fall_asleep(int, BOOLEAN_P); +E void burn_away_slime(void); +E void nh_timeout(void); +E void fall_asleep(int, boolean); E void attach_egg_hatch_timeout(struct obj *, long); E void attach_fig_transform_timeout(struct obj *); E void kill_egg(struct obj *); E void hatch_egg(ANY_P *, long); E void learn_egg_type(int); E void burn_object(ANY_P *, long); -E void begin_burn(struct obj *, BOOLEAN_P); -E void end_burn(struct obj *, BOOLEAN_P); -E void do_storms(); -E boolean start_timer(long, SHORT_P, SHORT_P, ANY_P *); -E long stop_timer(SHORT_P, ANY_P *); -E long peek_timer(SHORT_P, ANY_P *); -E void run_timers(); +E void begin_burn(struct obj *, boolean); +E void end_burn(struct obj *, boolean); +E void do_storms(void); +E boolean start_timer(long, short, short, ANY_P *); +E long stop_timer(short, ANY_P *); +E long peek_timer(short, ANY_P *); +E void run_timers(void); E void obj_move_timers(struct obj *, struct obj *); E void obj_split_timers(struct obj *, struct obj *); E void obj_stop_timers(struct obj *); -E boolean obj_has_timer(struct obj *, SHORT_P); -E void spot_stop_timers(XCHAR_P, XCHAR_P, SHORT_P); -E long spot_time_expires(XCHAR_P, XCHAR_P, SHORT_P); -E long spot_time_left(XCHAR_P, XCHAR_P, SHORT_P); +E boolean obj_has_timer(struct obj *, short); +E void spot_stop_timers(xchar, xchar, short); +E long spot_time_expires(xchar, xchar, short); +E long spot_time_left(xchar, xchar, short); E boolean obj_is_local(struct obj *); E void save_timers(int, int, int); -E void restore_timers(int, int, BOOLEAN_P, long); +E void restore_timers(int, int, boolean, long); E void timer_stats(const char *, char *, long *, long *); -E void relink_timers(BOOLEAN_P); +E void relink_timers(boolean); #ifdef WIZARD -E int wiz_timeout_queue(); -E void timer_sanity_check(); +E int wiz_timeout_queue(void); +E void timer_sanity_check(void); #endif /* ### topten.c ### */ @@ -2578,8 +2578,8 @@ E struct obj *tt_oname(struct obj *); /* ### track.c ### */ -E void initrack(); -E void settrack(); +E void initrack(void); +E void settrack(void); E coord *gettrack(int, int); /* ### trap.c ### */ @@ -2588,70 +2588,70 @@ E boolean burnarmor(struct monst *); E int erode_obj(struct obj *, const char *, int, int); E boolean grease_protect(struct obj *, const char *, struct monst *); E struct trap *maketrap(int, int, int); -E void fall_through(BOOLEAN_P, unsigned); -E struct monst *animate_statue(struct obj *, XCHAR_P, XCHAR_P, int, int *); -E struct monst *activate_statue_trap(struct trap *, XCHAR_P, XCHAR_P, BOOLEAN_P); +E void fall_through(boolean, unsigned); +E struct monst *animate_statue(struct obj *, xchar, xchar, int, int *); +E struct monst *activate_statue_trap(struct trap *, xchar, xchar, boolean); E void set_utrap(unsigned, unsigned); -E void reset_utrap(BOOLEAN_P); +E void reset_utrap(boolean); E void dotrap(struct trap *, unsigned); E void seetrap(struct trap *); E void feeltrap(struct trap *); extern int mintrap(struct monst *, unsigned); E void instapetrify(const char *); -E void minstapetrify(struct monst *, BOOLEAN_P); +E void minstapetrify(struct monst *, boolean); #ifdef WEBB_DISINT E int instadisintegrate(const char *); E int minstadisintegrate(struct monst *); #endif E void selftouch(const char *); -E void mselftouch(struct monst *, const char *, BOOLEAN_P); -E void float_up(); +E void mselftouch(struct monst *, const char *, boolean); +E void float_up(void); E void fill_pit(int, int); E int float_down(long, long); -E void climb_pit(); -E boolean fire_damage(struct obj *, BOOLEAN_P, XCHAR_P, XCHAR_P); -E int fire_damage_chain(struct obj *, BOOLEAN_P, BOOLEAN_P, XCHAR_P, XCHAR_P); -E boolean lava_damage(struct obj *, XCHAR_P, XCHAR_P); +E void climb_pit(void); +E boolean fire_damage(struct obj *, boolean, xchar, xchar); +E int fire_damage_chain(struct obj *, boolean, boolean, xchar, xchar); +E boolean lava_damage(struct obj *, xchar, xchar); E void acid_damage(struct obj *); -E int water_damage(struct obj *, const char *, BOOLEAN_P); -E void water_damage_chain(struct obj *, BOOLEAN_P); -E boolean drown(); +E int water_damage(struct obj *, const char *, boolean); +E void water_damage_chain(struct obj *, boolean); +E boolean drown(void); E void drain_en(int); -E int dountrap(); -E void cnv_trap_obj(int, int, struct trap *, BOOLEAN_P); -E int untrap(BOOLEAN_P); +E int dountrap(void); +E void cnv_trap_obj(int, int, struct trap *, boolean); +E int untrap(boolean); E boolean openholdingtrap(struct monst *, boolean *); E boolean closeholdingtrap(struct monst *, boolean *); -E boolean openfallingtrap(struct monst *, BOOLEAN_P, boolean *); -E boolean chest_trap(struct obj *, int, BOOLEAN_P); +E boolean openfallingtrap(struct monst *, boolean, boolean *); +E boolean chest_trap(struct obj *, int, boolean); E void deltrap(struct trap *); E boolean delfloortrap(struct trap *); E struct trap *t_at(int, int); E void b_trapped(const char *, int); -E boolean unconscious(); +E boolean unconscious(void); E boolean uteetering_at_seen_pit(struct trap *); E boolean uescaped_shaft(struct trap *); -E boolean lava_effects(); -E boolean swamp_effects(); +E boolean lava_effects(void); +E boolean swamp_effects(void); E void blow_up_landmine(struct trap *); -E int launch_obj(SHORT_P, int, int, int, int, int); +E int launch_obj(short, int, int, int, int, int); /* ### u_init.c ### */ -E void u_init(); +E void u_init(void); /* ### uhitm.c ### */ E void hurtmarmor(struct monst *, int); E boolean attack_checks(struct monst *, struct obj *); E void check_caitiff(struct monst *); -E int find_roll_to_hit(struct monst *, UCHAR_P, struct obj *, int *, int *); +E int find_roll_to_hit(struct monst *, uchar, struct obj *, int *, int *); E boolean attack(struct monst *); E boolean hmon(struct monst *, struct obj *, int, int); E boolean shade_miss(struct monst *, struct monst *, struct obj *, boolean, boolean); E int damageum(struct monst *, struct attack *, int); -E void missum(struct monst *, struct attack *, BOOLEAN_P); -E int passive(struct monst *, struct obj *, BOOLEAN_P, int, UCHAR_P, BOOLEAN_P); +E void missum(struct monst *, struct attack *, boolean); +E int passive(struct monst *, struct obj *, boolean, int, uchar, boolean); E void passive_obj(struct monst *, struct obj *, struct attack *); E void stumble_onto_mimic(struct monst *); E int flash_hits_mon(struct monst *, struct obj *); @@ -2661,7 +2661,7 @@ E void light_hits_gremlin(struct monst *, int); #ifdef UNIX # ifdef PORT_HELP -E void port_help(); +E void port_help(void); # endif #endif /* UNIX */ @@ -2669,31 +2669,31 @@ E void port_help(); /* ### unixtty.c ### */ #if defined(UNIX) || defined(__BEOS__) -E void gettty(); +E void gettty(void); E void settty(const char *); -E void setftty(); -E void intron(); -E void introff(); +E void setftty(void); +E void intron(void); +E void introff(void); E void VDECL(error, (const char *, ...)) PRINTF_F(1, 2); #endif /* UNIX || __BEOS__ */ /* ### unixunix.c ### */ #ifdef UNIX -E void getlock(); +E void getlock(void); E void regularize(char *); # if defined(TIMED_DELAY) && !defined(msleep) && defined(SYSV) E void msleep(unsigned); # endif # ifdef SHELL -E int dosh(); +E int dosh(void); # endif /* SHELL */ # if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER) E int child(int); # endif #ifdef FILE_AREAS E char *make_file_name(const char *, const char *); -E FILE *fopen_datafile_area(const char *, const char *, const char *, BOOLEAN_P); +E FILE *fopen_datafile_area(const char *, const char *, const char *, boolean); E FILE *freopen_area(const char *, const char *, const char *, FILE *); E int chmod_area(const char *, const char *, int); E int open_area(const char *, const char *, int, int); @@ -2709,7 +2709,7 @@ E int remove_area(const char *, const char *); #ifdef UNIX # ifdef GNOME_GRAPHICS -E int hide_privileges(BOOLEAN_P); +E int hide_privileges(boolean); # endif #endif /* UNIX */ @@ -2718,29 +2718,29 @@ E int hide_privileges(BOOLEAN_P); E void newegd(struct monst *); E void free_egd(struct monst *); E boolean grddead(struct monst *); -E struct monst *findgd(); -E void vault_summon_gd(); +E struct monst *findgd(void); +E void vault_summon_gd(void); E char vault_occupied(char *); E void uleftvault(struct monst *); -E void invault(); +E void invault(void); E int gd_move(struct monst *); -E void paygd(BOOLEAN_P); -E long hidden_gold(); -E boolean gd_sound(); +E void paygd(boolean); +E long hidden_gold(void); +E boolean gd_sound(void); E void vault_gd_watching(unsigned int); /* ### version.c ### */ E char *version_string(char *); E char *getversionstring(char *); -E int doversion(); -E int doextversion(); +E int doversion(void); +E int doextversion(void); #ifdef MICRO E boolean comp_times(long); #endif -E boolean check_version(struct version_info *, const char *, BOOLEAN_P); +E boolean check_version(struct version_info *, const char *, boolean); E unsigned long get_feature_notice_ver(char *); -E unsigned long get_current_feature_ver(); +E unsigned long get_current_feature_ver(void); #ifdef RUNTIME_PORT_ID E void append_port_id(char *); #endif @@ -2750,10 +2750,10 @@ E void append_port_id(char *); #ifdef MSDOS E int assign_video(char *); # ifdef NO_TERMS -E void gr_init(); -E void gr_finish(); +E void gr_init(void); +E void gr_finish(void); # endif -E void tileview(BOOLEAN_P); +E void tileview(boolean); #endif #ifdef VIDEOSHADES E int assign_videoshades(char *); @@ -2763,14 +2763,14 @@ E int assign_videocolors(char *); /* ### vis_tab.c ### */ #ifdef VISION_TABLES -E void vis_tab_init(); +E void vis_tab_init(void); #endif /* ### vision.c ### */ -E void vision_init(); +E void vision_init(void); E int does_block(int, int, struct rm*); -E void vision_reset(); +E void vision_reset(void); E void vision_recalc(int); E void block_point(int, int); E void unblock_point(int, int); @@ -2792,34 +2792,34 @@ E char *vms_basename(const char *); /* ### vmsmail.c ### */ -E unsigned long init_broadcast_trapping(); -E unsigned long enable_broadcast_trapping(); -E unsigned long disable_broadcast_trapping(); +E unsigned long init_broadcast_trapping(void); +E unsigned long enable_broadcast_trapping(void); +E unsigned long disable_broadcast_trapping(void); # if 0 -E struct mail_info *parse_next_broadcast(); +E struct mail_info *parse_next_broadcast(void); # endif /*0*/ /* ### vmsmain.c ### */ E int main(int, char **); # ifdef CHDIR -E void chdirx(const char *, BOOLEAN_P); +E void chdirx(const char *, boolean); # endif /* CHDIR */ /* ### vmsmisc.c ### */ -E void vms_abort(); +E void vms_abort(void); E void vms_exit(int); /* ### vmstty.c ### */ -E int vms_getchar(); -E void gettty(); +E int vms_getchar(void); +E void gettty(void); E void settty(const char *); E void shuttty(const char *); -E void setftty(); -E void intron(); -E void introff(); +E void setftty(void); +E void intron(void); +E void introff(void); E void VDECL(error, (const char *, ...)) PRINTF_F(1, 2); #ifdef TIMED_DELAY E void msleep(unsigned); @@ -2827,25 +2827,25 @@ E void msleep(unsigned); /* ### vmsunix.c ### */ -E void getlock(); +E void getlock(void); E void regularize(char *); -E int vms_getuid(); +E int vms_getuid(void); E boolean file_is_stmlf(int); E int vms_define(const char *, const char *, int); E int vms_putenv(const char *); -E char *verify_termcap(); +E char *verify_termcap(void); # if defined(CHDIR) || defined(SHELL) || defined(SECURE) -E void privoff(); -E void privon(); +E void privoff(void); +E void privon(void); # endif # ifdef SHELL -E int dosh(); +E int dosh(void); # endif # if defined(SHELL) || defined(MAIL) -E int vms_doshell(const char *, BOOLEAN_P); +E int vms_doshell(const char *, boolean); # endif # ifdef SUSPEND -E int dosuspend(); +E int dosuspend(void); # endif #endif /* VMS */ @@ -2861,28 +2861,28 @@ E void silver_sears(struct monst *, struct monst *, long); E struct obj *select_rwep(struct monst *); E boolean mon_might_throw_wep(struct obj *); E struct obj *select_hwep(struct monst *); -E void possibly_unwield(struct monst *, BOOLEAN_P); +E void possibly_unwield(struct monst *, boolean); E int mon_wield_item(struct monst *); E void mwepgone(struct monst *); -E int abon(); -E int dbon(); -E void wet_a_towel(struct obj *, int, BOOLEAN_P); -E void dry_a_towel(struct obj *, int, BOOLEAN_P); +E int abon(void); +E int dbon(void); +E void wet_a_towel(struct obj *, int, boolean); +E void dry_a_towel(struct obj *, int, boolean); extern const char* skill_name(int); -E int enhance_weapon_skill(); +E int enhance_weapon_skill(void); #ifdef DUMP_LOG -E void dump_weapon_skill(); +E void dump_weapon_skill(void); #endif E void unrestrict_weapon_skill(int); E void use_skill(int, int); E void add_weapon_skill(int); E void lose_weapon_skill(int); E int weapon_type(struct obj *); -E int uwep_skill_type(); +E int uwep_skill_type(void); E int weapon_hit_bonus(struct obj *); E int weapon_dam_bonus(struct obj *); E void skill_init(const struct def_skill *); -E boolean can_advance_something(); +E boolean can_advance_something(void); /* ### were.c ### */ @@ -2890,9 +2890,9 @@ E void were_change(struct monst *); E int counter_were(int); E int were_beastie(int); E void new_were(struct monst *); -E int were_summon(struct permonst *, BOOLEAN_P, int *, char *); -E void you_were(); -E void you_unwere(BOOLEAN_P); +E int were_summon(struct permonst *, boolean, int *, char *); +E void you_were(void); +E void you_unwere(boolean); E void set_ulycn(int); /* ### wield.c ### */ @@ -2900,64 +2900,64 @@ E void set_ulycn(int); E void setuwep(struct obj *); E void setuqwep(struct obj *); E void setuswapwep(struct obj *); -E int dowield(); -E int doswapweapon(); -E int dowieldquiver(); -E int dounwield(); +E int dowield(void); +E int doswapweapon(void); +E int dowieldquiver(void); +E int dounwield(void); E boolean wield_tool(struct obj *, const char *); -E int can_twoweapon(); -E void drop_uswapwep(); -E int dotwoweapon(); -E void uwepgone(); -E void uswapwepgone(); -E void uqwepgone(); -E void untwoweapon(); +E int can_twoweapon(void); +E void drop_uswapwep(void); +E int dotwoweapon(void); +E void uwepgone(void); +E void uswapwepgone(void); +E void uqwepgone(void); +E void untwoweapon(void); E int chwepon(struct obj *, int); E int welded(struct obj *); E void weldmsg(struct obj *); E void setmnotwielded(struct monst *, struct obj *); E boolean mwelded(struct obj *); -E void unwield_weapons_silently(); +E void unwield_weapons_silently(void); /* ### windows.c ### */ E void choose_windows(const char *); -E char genl_message_menu(CHAR_P, int, const char *); +E char genl_message_menu(char, int, const char *); E void genl_preference_update(const char *); /* ### wizard.c ### */ -E void amulet(); +E void amulet(void); E int mon_has_amulet(struct monst *); E int mon_has_special(struct monst *); E int tactics(struct monst *); E boolean has_aggravatables(struct monst *); -E void aggravate(); -E void clonewiz(); -E int pick_nasty(); +E void aggravate(void); +E void clonewiz(void); +E int pick_nasty(void); E int nasty(struct monst*); -E void resurrect(); -E void intervene(); -E void wizdead(); +E void resurrect(void); +E void intervene(void); +E void wizdead(void); E void cuss(struct monst *); /* ### worm.c ### */ -E int get_wormno(); +E int get_wormno(void); E void initworm(struct monst *, int); E void worm_move(struct monst *); E void worm_nomove(struct monst *); E void wormgone(struct monst *); E void wormhitu(struct monst *); -E void cutworm(struct monst *, XCHAR_P, XCHAR_P, struct obj *); +E void cutworm(struct monst *, xchar, xchar, struct obj *); E void see_wsegs(struct monst *); -E void detect_wsegs(struct monst *, BOOLEAN_P); +E void detect_wsegs(struct monst *, boolean); E void save_worm(int, int); E void rest_worm(int); E void place_wsegs(struct monst *, struct monst *); E void sanity_check_worm(struct monst *); E void remove_worm(struct monst *); -E void place_worm_tail_randomly(struct monst *, XCHAR_P, XCHAR_P); +E void place_worm_tail_randomly(struct monst *, xchar, xchar); E int size_wseg(struct monst *); E int count_wsegs(struct monst *); E boolean worm_known(struct monst *); @@ -2973,14 +2973,14 @@ E struct obj *wearmask_to_obj(long); E long wearslot(struct obj *); E void mon_set_minvis(struct monst *); E void mon_adjust_speed(struct monst *, int, struct obj *); -E void update_mon_intrinsics(struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P); +E void update_mon_intrinsics(struct monst *, struct obj *, boolean, boolean); E int find_mac(struct monst *); -E void m_dowear(struct monst *, BOOLEAN_P); +E void m_dowear(struct monst *, boolean); E struct obj *which_armor(struct monst *, long); -E void mon_break_armor(struct monst *, BOOLEAN_P); +E void mon_break_armor(struct monst *, boolean); E void bypass_obj(struct obj *); -E void clear_bypasses(); -E void bypass_objlist(struct obj *, BOOLEAN_P); +E void clear_bypasses(void); +E void bypass_objlist(struct obj *, boolean); E struct obj *nxt_unbypassed_obj(struct obj *); E int racial_exception(struct monst *, struct obj *); @@ -2997,27 +2997,27 @@ E void probe_monster(struct monst *); E boolean get_obj_location(struct obj *, xchar *, xchar *, int); E boolean get_mon_location(struct monst *, xchar *, xchar *, int); E struct monst *get_container_location(struct obj *obj, int *, int *); -E struct monst *montraits(struct obj *, coord *, BOOLEAN_P); -E struct monst *revive(struct obj *, BOOLEAN_P); +E struct monst *montraits(struct obj *, coord *, boolean); +E struct monst *revive(struct obj *, boolean); E int unturn_dead(struct monst *); E void cancel_item(struct obj *); -E boolean drain_item(struct obj *, BOOLEAN_P); +E boolean drain_item(struct obj *, boolean); E struct obj *poly_obj(struct obj *, int); E boolean obj_resists(struct obj *, int, int); E boolean obj_shudders(struct obj *); E void do_osshock(struct obj *); E int bhito(struct obj *, struct obj *); -E int bhitpile(struct obj *, int (*)(OBJ_P, OBJ_P), int, int, SCHAR_P); +E int bhitpile(struct obj *, int (*)(OBJ_P, OBJ_P), int, int, schar); E int zappable(struct obj *); E void zapnodir(struct obj *); -E int dozap(); -E int zapyourself(struct obj *, BOOLEAN_P); +E int dozap(void); +E int zapyourself(struct obj *, boolean); E void ubreatheu(struct attack *); -E int lightdamage(struct obj *, BOOLEAN_P, int); +E int lightdamage(struct obj *, boolean, int); E boolean flashburn(long); -E boolean cancel_monst(struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); -E void zapsetup(); -E void zapwrapup(); +E boolean cancel_monst(struct monst *, struct obj *, boolean, boolean, boolean); +E void zapsetup(void); +E void zapwrapup(void); E void weffects(struct obj *); E int spell_damage_bonus(int); E const char *exclam(int force); @@ -3027,27 +3027,27 @@ E struct monst *bhit(int, int, int, int, int (*)(MONST_P, OBJ_P), int (*)(OBJ_P, OBJ_P), struct obj *, boolean *); E struct monst *boomhit(struct obj *, int, int); E int zhitm(struct monst *, int, int, struct obj **); -E int burn_floor_objects(int, int, BOOLEAN_P, BOOLEAN_P); -E void buzz(int, int, XCHAR_P, XCHAR_P, int, int); -E void dobuzz(int, int, XCHAR_P, XCHAR_P, int, int, BOOLEAN_P); -E void melt_ice(XCHAR_P, XCHAR_P, const char *); +E int burn_floor_objects(int, int, boolean, boolean); +E void buzz(int, int, xchar, xchar, int, int); +E void dobuzz(int, int, xchar, xchar, int, int, boolean); +E void melt_ice(xchar, xchar, const char *); E void melt_ice_away(ANY_P *, long); -E int zap_over_floor(XCHAR_P, XCHAR_P, int, boolean *, SHORT_P); +E int zap_over_floor(xchar, xchar, int, boolean *, short); E void fracture_rock(struct obj *); E boolean break_statue(struct obj *); E void destroy_item(int, int); E int destroy_mitem(struct monst *, int, int); -E int resist(struct monst *, CHAR_P, int, int); -E void makewish(BOOLEAN_P); +E int resist(struct monst *, char, int, int); +E void makewish(boolean); E void remove_corpse(struct obj *); /* ### livelog.c ### */ #ifdef LIVELOGFILE -E boolean livelog_start(); -E void livelog_achieve_update(); +E boolean livelog_start(void); +E void livelog_achieve_update(void); E void livelog_wish(char*); # ifdef LIVELOG_SHOUT -E int doshout(); +E int doshout(void); # endif # ifdef LIVELOG_BONES_KILLER E void livelog_bones_killed(struct monst *); @@ -3064,12 +3064,12 @@ extern void livelog_printf(unsigned int, const char *, ...) PRINTF_F(2, 3); /* ### tutorial.c ### */ E boolean check_tutorial_message(int); -E void maybe_tutorial(); -E int tutorial_redisplay(); -E void tutorial_redisplay_message(); +E void maybe_tutorial(void); +E int tutorial_redisplay(void); +E void tutorial_redisplay_message(void); E void check_tutorial_farlook(int, int); E void check_tutorial_command(char); -E int check_tutorial_location(int, int, BOOLEAN_P); +E int check_tutorial_location(int, int, boolean); E int check_tutorial_oclass(int); /* ### base32.c ### */ diff --git a/include/system.h b/include/system.h index 40b049935..623e6030b 100644 --- a/include/system.h +++ b/include/system.h @@ -73,7 +73,11 @@ typedef long off_t; #endif #ifndef SIG_RET_TYPE # if defined(NHSTDC) || defined(POSIX_TYPES) || defined(OS2) || defined(__DECC) -# define SIG_RET_TYPE void (*)() +# ifdef LINUX +# define SIG_RET_TYPE sighandler_t +# else +# define SIG_RET_TYPE void (*)() +# endif # endif #endif #ifndef SIG_RET_TYPE @@ -93,7 +97,7 @@ typedef long off_t; # undef random # endif # if !defined(__SC__) && !defined(LINUX) -E long random(); +E long random(void); # endif # if (!defined(SUNOS4) && !defined(bsdi) && !defined(__FreeBSD__) && !defined(__NetBSD__)) || defined(RANDOM) E void srandom(unsigned int); @@ -102,9 +106,6 @@ E void srandom(unsigned int); E int srandom(unsigned int); # endif # endif -#else -E long lrand48(); -E void srand48(); #endif /* BSD || ULTRIX || RANDOM */ #ifdef LEGACY_CODE @@ -151,7 +152,7 @@ E void qsort(genericptr_t, size_t, size_t, int (*)(const genericptr, const genericptr)); #else # if defined(BSD) || defined(ULTRIX) -E int qsort(); +E int qsort(void); # else # if !defined(LATTICE) && !defined(AZTEC_50) E void qsort(genericptr_t, size_t, size_t, @@ -222,7 +223,7 @@ E int read(int, genericptr_t, unsigned int); E int open(const char *, int, ...); E int dup2(int, int); E int setmode(int, int); -E int kbhit(); +E int kbhit(void); # if !defined(_DCC) # if defined(__TURBOC__) E int chdir(const char *); @@ -253,9 +254,9 @@ E int ioctl(int, int, char*); E int isatty(int); /* 1==yes, 0==no, -1==error */ #include # if defined(ULTRIX_PROTO) || defined(__GNUC__) -E int fork(); +E int fork(void); # else -E long fork(); +E long fork(void); # endif #endif /* ULTRIX */ @@ -292,8 +293,8 @@ E int write(int, const genericptr, unsigned); /* both old & new versions of Ultrix want these, but real BSD does not */ #ifdef ultrix -E void abort(); -E void bcopy(); +E void abort(void); +E void bcopy(void); # ifdef ULTRIX E int system(const char *); # ifndef _UNISTD_H_ @@ -302,12 +303,12 @@ E int execl(const char *, ...); # endif #endif #ifdef MICRO -E void abort(); +E void abort(void); E void _exit(int); E int system(const char *); #endif #if defined(HPUX) && !defined(_POSIX_SOURCE) -E long fork(); +E long fork(void); #endif #ifdef POSIX_TYPES @@ -324,13 +325,13 @@ E void *memset(void *, int, size_t); # endif # else # ifndef memcmp /* some systems seem to macro these back to b*() */ -E int memcmp(); +E int memcmp(void); # endif # ifndef memcpy -E char *memcpy(); +E char *memcpy(void); # endif # ifndef memset -E char *memset(); +E char *memset(void); # endif # endif #else @@ -361,10 +362,7 @@ E char *memset(char*, int, int); #endif /* MICRO */ #if defined(BSD) && defined(ultrix) /* i.e., old versions of Ultrix */ -E void sleep(); -#endif -#if defined(ULTRIX) || defined(SYSV) -E unsigned sleep(); +E void sleep(void); #endif #if defined(HPUX) E unsigned int sleep(unsigned int); @@ -374,31 +372,31 @@ E int sleep(unsigned); #endif E char *getenv(const char *); -E char *getlogin(); +E char *getlogin(void); #if defined(HPUX) && !defined(_POSIX_SOURCE) -E long getuid(); -E long getgid(); -E long getpid(); +E long getuid(void); +E long getgid(void); +E long getpid(void); #else # ifdef POSIX_TYPES -E pid_t getpid(); -E uid_t getuid(); -E gid_t getgid(); +E pid_t getpid(void); +E uid_t getuid(void); +E gid_t getgid(void); # ifdef VMS -E pid_t getppid(); +E pid_t getppid(void); # endif # else /*!POSIX_TYPES*/ # ifndef getpid /* Borland C defines getpid() as a macro */ -E int getpid(); +E int getpid(void); # endif # ifdef VMS -E int getppid(); -E unsigned getuid(); -E unsigned getgid(); +E int getppid(void); +E unsigned getuid(void); +E unsigned getgid(void); # endif # if defined(ULTRIX) && !defined(_UNISTD_H_) -E unsigned getuid(); -E unsigned getgid(); +E unsigned getuid(void); +E unsigned getgid(void); E int setgid(int); E int setuid(int); # endif @@ -481,7 +479,7 @@ E char *rindex(const char *, int); E int sprintf(char *, const char *, ...); # else # define OLD_SPRINTF -E char *sprintf(); +E char *sprintf(void); # endif #endif #ifdef SPRINTF_PROTO @@ -519,7 +517,7 @@ E char *tgoto(const char *, int, int); #else # if !(defined(HPUX) && defined(_POSIX_SOURCE)) E int tgetent(char *, const char *); -E void tputs(const char *, int, int (*)()); +E void tputs(const char *, int, int (*)(int)); # endif E int tgetnum(const char *); E int tgetflag(const char *); diff --git a/include/wincurs.h b/include/wincurs.h index d63bf971e..6077dd032 100644 --- a/include/wincurs.h +++ b/include/wincurs.h @@ -75,7 +75,7 @@ extern winid curses_create_nhwindow(int type); extern void curses_clear_nhwindow(winid wid); -extern void curses_display_nhwindow(winid wid, BOOLEAN_P block); +extern void curses_display_nhwindow(winid wid, boolean block); extern void curses_destroy_nhwindow(winid wid); @@ -84,15 +84,15 @@ extern void curses_curs(winid wid, int x, int y); extern void curses_putstr(winid wid, int attr, const char *text); #ifdef FILE_AREAS -extern void curses_display_file(const char *filearea, const char *filename, BOOLEAN_P must_exist); +extern void curses_display_file(const char *filearea, const char *filename, boolean must_exist); #else -extern void curses_display_file(const char *filename, BOOLEAN_P must_exist); +extern void curses_display_file(const char *filename, boolean must_exist); #endif extern void curses_start_menu(winid wid); extern void curses_add_menu(winid wid, int glyph, int cnt, const ANY_P * identifier, - CHAR_P accelerator, CHAR_P group_accel, int attr, + char accelerator, char group_accel, int attr, const char *str, unsigned int presel); extern void curses_end_menu(winid wid, const char *prompt); @@ -107,7 +107,7 @@ extern void curses_wait_synch(void); extern void curses_cliparound(int x, int y); -extern void curses_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph, int bg_glyph); +extern void curses_print_glyph(winid wid, xchar x, xchar y, int glyph, int bg_glyph); extern void curses_raw_print(const char *str); @@ -121,7 +121,7 @@ extern void curses_nhbell(void); extern int curses_doprev_message(void); -extern char curses_yn_function(const char *question, const char *choices, CHAR_P def); +extern char curses_yn_function(const char *question, const char *choices, char def); extern void curses_getlin(const char *question, char *input); @@ -229,7 +229,7 @@ extern int curses_get_mouse(int *mousex, int *mousey, int *mod); extern void curses_line_input_dialog(const char *prompt, char *answer, int buffer); -extern int curses_character_input_dialog(const char *prompt, const char *choices, CHAR_P def); +extern int curses_character_input_dialog(const char *prompt, const char *choices, char def); extern int curses_ext_cmd(void); @@ -238,8 +238,8 @@ extern void curses_create_nhmenu(winid wid); extern boolean get_menu_coloring(char *, int *, int *); #endif extern void curses_add_nhmenu_item(winid wid, int glyph, const ANY_P *identifier, - CHAR_P accelerator, CHAR_P group_accel, int attr, const char *str, - BOOLEAN_P presel); + char accelerator, char group_accel, int attr, const char *str, + boolean presel); extern void curses_finalize_nhmenu(winid wid, const char *prompt); @@ -259,7 +259,7 @@ extern void curses_decrement_highlight(void); /* cursinvt.c */ extern void curses_update_inv(void); -extern void curses_add_inv(int, int, CHAR_P, attr_t, const char *); +extern void curses_add_inv(int, int, char, attr_t, const char *); /* cursinit.c */ diff --git a/include/winlisp.h b/include/winlisp.h index 0dc7a40fc..d59ffb20d 100644 --- a/include/winlisp.h +++ b/include/winlisp.h @@ -18,56 +18,56 @@ extern struct window_procs tty_procs; /* ### winlisp.c ### */ -E void win_lisp_init(); +E void win_lisp_init(void); E void lisp_init_nhwindows(int *, char **); -E void lisp_player_selection(); -E void lisp_askname(); -E void lisp_get_nh_event(); +E void lisp_player_selection(void); +E void lisp_askname(void); +E void lisp_get_nh_event(void); E void lisp_exit_nhwindows(const char *); E void lisp_suspend_nhwindows(const char *); -E void lisp_resume_nhwindows(); +E void lisp_resume_nhwindows(void); E winid lisp_create_nhwindow(int); E void lisp_clear_nhwindow(winid); -E void lisp_display_nhwindow(winid, BOOLEAN_P); +E void lisp_display_nhwindow(winid, boolean); E void lisp_destroy_nhwindow(winid); E void lisp_curs(winid, int, int); E void lisp_putstr(winid, int, const char *); #ifdef FILE_AREAS -E void lisp_display_file(const char *, const char *, BOOLEAN_P); +E void lisp_display_file(const char *, const char *, boolean); #else -E void lisp_display_file(const char *, BOOLEAN_P); +E void lisp_display_file(const char *, boolean); #endif E void lisp_start_menu(winid); E void lisp_add_menu(winid, int, int, const ANY_P *, - CHAR_P, CHAR_P, int, const char *, unsigned int); + char, char, int, const char *, unsigned int); E void lisp_end_menu(winid, const char *); E int lisp_select_menu(winid, int, MENU_ITEM_P **); E char lisp_message_menu(char, int, const char *mesg); -E void lisp_update_inventory(); -E void lisp_mark_synch(); -E void lisp_wait_synch(); +E void lisp_update_inventory(void); +E void lisp_mark_synch(void); +E void lisp_wait_synch(void); #ifdef CLIPPING E void lisp_cliparound(int, int); #endif #ifdef POSITIONBAR E void lisp_update_positionbar(char *); #endif -E void lisp_print_glyph(winid, XCHAR_P, XCHAR_P, int, int); +E void lisp_print_glyph(winid, xchar, xchar, int, int); E void lisp_raw_print(const char *); E void lisp_raw_print_bold(const char *); -E int lisp_nhgetch(); +E int lisp_nhgetch(void); E int lisp_nh_poskey(int *, int *, int *); -E void lisp_nhbell(); -E int lisp_doprev_message(); -E char lisp_yn_function(const char *, const char *, CHAR_P); +E void lisp_nhbell(void); +E int lisp_doprev_message(void); +E char lisp_yn_function(const char *, const char *, char); E void lisp_getlin(const char *, char *); -E int lisp_get_ext_cmd(); +E int lisp_get_ext_cmd(void); E void lisp_number_pad(int); -E void lisp_delay_output(); +E void lisp_delay_output(void); /* other defs that really should go away (they're tty specific) */ -E void lisp_start_screen(); -E void lisp_end_screen(); +E void lisp_start_screen(void); +E void lisp_end_screen(void); E void lisp_outrip(winid, int); diff --git a/include/winprocs.h b/include/winprocs.h index 8c2fa39c3..9523682ce 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -18,21 +18,21 @@ struct window_procs { void (*win_resume_nhwindows)(void); winid (*win_create_nhwindow)(int); void (*win_clear_nhwindow)(winid); - void (*win_display_nhwindow)(winid, BOOLEAN_P); + void (*win_display_nhwindow)(winid, boolean); void (*win_destroy_nhwindow)(winid); void (*win_curs)(winid, int, int); void (*win_putstr)(winid, int, const char *); #ifdef FILE_AREAS - void (*win_display_file)(const char *, const char *, BOOLEAN_P); + void (*win_display_file)(const char *, const char *, boolean); #else - void (*win_display_file)(const char *, BOOLEAN_P); + void (*win_display_file)(const char *, boolean); #endif void (*win_start_menu)(winid); void (*win_add_menu)(winid, int, int, const ANY_P *, - CHAR_P, CHAR_P, int, const char *, unsigned int); + char, char, int, const char *, unsigned int); void (*win_end_menu)(winid, const char *); int (*win_select_menu)(winid, int, MENU_ITEM_P **); - char (*win_message_menu)(CHAR_P, int, const char *); + char (*win_message_menu)(char, int, const char *); void (*win_update_inventory)(void); void (*win_mark_synch)(void); void (*win_wait_synch)(void); @@ -42,14 +42,14 @@ struct window_procs { #ifdef POSITIONBAR void (*win_update_positionbar)(char *); #endif - void (*win_print_glyph)(winid, XCHAR_P, XCHAR_P, int, int); + void (*win_print_glyph)(winid, xchar, xchar, int, int); void (*win_raw_print)(const char *); void (*win_raw_print_bold)(const char *); int (*win_nhgetch)(void); int (*win_nh_poskey)(int *, int *, int *); void (*win_nhbell)(void); int (*win_doprev_message)(void); - char (*win_yn_function)(const char *, const char *, CHAR_P); + char (*win_yn_function)(const char *, const char *, char); void (*win_getlin)(const char *, char *); int (*win_get_ext_cmd)(void); void (*win_number_pad)(int); diff --git a/include/wintty.h b/include/wintty.h index f8add5700..4a2a9f9a8 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -107,29 +107,29 @@ E void xwaitforspace(const char *); E void tty_startup(int*, int*); #ifndef NO_TERMS -E void tty_shutdown(); +E void tty_shutdown(void); #endif extern int xputc(int); E void xputs(const char *); #if defined(SCREEN_VGA) || defined(SCREEN_8514) E void xputg(int, int, unsigned); #endif -E void cl_end(); -E void clear_screen(); -E void home(); -E void standoutbeg(); -E void standoutend(); +E void cl_end(void); +E void clear_screen(void); +E void home(void); +E void standoutbeg(void); +E void standoutend(void); # if 0 -E void revbeg(); -E void boldbeg(); -E void blinkbeg(); -E void dimbeg(); -E void m_end(); +E void revbeg(void); +E void boldbeg(void); +E void blinkbeg(void); +E void dimbeg(void); +E void m_end(void); # endif -E void backsp(); -E void graph_on(); -E void graph_off(); -E void cl_eos(); +E void backsp(void); +E void graph_on(void); +E void graph_off(void); +E void cl_eos(void); /* * termcap.c (or facsimiles in other ports) is the right place for doing @@ -139,11 +139,11 @@ E void cl_eos(); */ E void term_start_attr(int attr); E void term_end_attr(int attr); -E void term_start_raw_bold(); -E void term_end_raw_bold(); +E void term_start_raw_bold(void); +E void term_end_raw_bold(void); #ifdef TEXTCOLOR -E void term_end_color(); +E void term_end_color(void); E void term_start_color(int color); E int has_color(int color); #endif /* TEXTCOLOR */ @@ -157,79 +157,79 @@ E boolean parse_status_color_options(char *); extern void show_topl(const char *); extern void remember_topl(void); E void addtopl(const char *); -E void more(); +E void more(void); E void update_topl(const char *); E void putsyms(const char*); /* ### wintty.c ### */ #ifdef CLIPPING -E void setclipped(); +E void setclipped(void); #endif E void docorner(int, int); -E void end_glyphout(); +E void end_glyphout(void); E void g_putch(int); -E void win_tty_init(); +E void win_tty_init(void); /* external declarations */ E void tty_init_nhwindows(int *, char **); -E void tty_player_selection(); -E void tty_askname(); -E void tty_get_nh_event(); +E void tty_player_selection(void); +E void tty_askname(void); +E void tty_get_nh_event(void); E void tty_exit_nhwindows(const char *); E void tty_suspend_nhwindows(const char *); -E void tty_resume_nhwindows(); +E void tty_resume_nhwindows(void); E winid tty_create_nhwindow(int); E void tty_clear_nhwindow(winid); -E void tty_display_nhwindow(winid, BOOLEAN_P); +E void tty_display_nhwindow(winid, boolean); E void tty_dismiss_nhwindow(winid); E void tty_destroy_nhwindow(winid); E void tty_curs(winid, int, int); E void tty_putstr(winid, int, const char *); #ifdef FILE_AREAS -E void tty_display_file(const char *, const char *, BOOLEAN_P); +E void tty_display_file(const char *, const char *, boolean); #else -E void tty_display_file(const char *, BOOLEAN_P); +E void tty_display_file(const char *, boolean); #endif E void tty_start_menu(winid); E void tty_add_menu(winid, int, int, const ANY_P *, - CHAR_P, CHAR_P, int, const char *, unsigned int); + char, char, int, const char *, unsigned int); E void tty_end_menu(winid, const char *); E int tty_select_menu(winid, int, MENU_ITEM_P **); -E char tty_message_menu(CHAR_P, int, const char *); -E void tty_update_inventory(); -E void tty_mark_synch(); -E void tty_wait_synch(); +E char tty_message_menu(char, int, const char *); +E void tty_update_inventory(void); +E void tty_mark_synch(void); +E void tty_wait_synch(void); #ifdef CLIPPING E void tty_cliparound(int, int); #endif #ifdef POSITIONBAR E void tty_update_positionbar(char *); #endif -E void tty_print_glyph(winid, XCHAR_P, XCHAR_P, int, int); +E void tty_print_glyph(winid, xchar, xchar, int, int); E void tty_raw_print(const char *); E void tty_raw_print_bold(const char *); -E int tty_nhgetch(); +E int tty_nhgetch(void); E int tty_nh_poskey(int *, int *, int *); -E void tty_nhbell(); -E int tty_doprev_message(); -E char tty_yn_function(const char *, const char *, CHAR_P); +E void tty_nhbell(void); +E int tty_doprev_message(void); +E char tty_yn_function(const char *, const char *, char); E void tty_getlin(const char *, char *); -E int tty_get_ext_cmd(); +E int tty_get_ext_cmd(void); E void tty_number_pad(int); -E void tty_delay_output(); +E void tty_delay_output(void); #ifdef CHANGE_COLOR E void tty_change_color(int color, long rgb, int reverse); #ifdef MAC E void tty_change_background(int white_or_black); E short set_tty_font_name(winid, char *); #endif -E char * tty_get_color_string(); +E char * tty_get_color_string(void); #endif -E int tty_debug_show_colors(); +E int tty_debug_show_colors(void); /* other defs that really should go away (they're tty specific) */ -E void tty_start_screen(); -E void tty_end_screen(); +E void tty_start_screen(void); +E void tty_end_screen(void); E void genl_outrip(winid, int); diff --git a/src/allmain.c b/src/allmain.c index ca54e0159..c59f9a7e9 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -12,7 +12,7 @@ #endif void -early_init() +early_init(void) { #if 0 decl_globals_init(); @@ -106,7 +106,7 @@ hpnotify_format_str(char *str) * It is also not possible to hold artifacts as secondary weapons. */ boolean -can_regenerate() +can_regenerate(void) { if (marathon_mode) { return 0; @@ -140,8 +140,7 @@ can_regenerate() } void -moveloop(resuming) -boolean resuming; +moveloop(boolean resuming) { #if defined(MICRO) || defined(WIN32) char ch; @@ -665,7 +664,7 @@ boolean resuming; } void -stop_occupation() +stop_occupation(void) { if(occupation) { if (!maybe_finished_meal(TRUE)) @@ -683,7 +682,7 @@ stop_occupation() } void -display_gamewindows() +display_gamewindows(void) { curses_stupid_hack = 0; WIN_MESSAGE = create_nhwindow(NHW_MESSAGE); @@ -714,7 +713,7 @@ display_gamewindows() static void -init_level_seeds() +init_level_seeds(void) { int i; if (is_game_pre_seeded) { @@ -729,7 +728,7 @@ init_level_seeds() void -newgame() +newgame(void) { int i; @@ -816,8 +815,7 @@ newgame() /* show "welcome [back] to unnethack" message at program startup */ void -welcome(new_game) -boolean new_game; /* false => restoring an old game */ +welcome(boolean new_game) /**< FALSE => restoring an old game */ { char buf[BUFSZ]; boolean currentgend = Upolyd ? u.mfemale : flags.female; @@ -935,10 +933,7 @@ get_realtime(void) /** Interrupt a multiturn action if current_points is equal to max_points. */ static void -interrupt_multi(points, current_points, max_points) -const char *points; -int current_points; -int max_points; +interrupt_multi(const char *points, int current_points, int max_points) { if (multi > 0 && current_points == max_points) { diff --git a/src/alloc.c b/src/alloc.c index 33ee53a61..5403acc37 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -28,8 +28,7 @@ extern void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2); long * -alloc(lth) -register unsigned int lth; +alloc(register unsigned int lth) { void *ptr; @@ -65,8 +64,7 @@ static int ptrbufidx = 0; /* format a pointer for display purposes; returns a static buffer */ char * -fmt_ptr(ptr) -const genericptr ptr; +fmt_ptr(const void *ptr) { char *buf; @@ -137,8 +135,7 @@ int line; not used when MONITOR_HEAP is enabled, but included unconditionally in case utility programs get built using a different setting for that */ char * -dupstr(string) -const char *string; +dupstr(const char *string) { return strcpy((char *) alloc(strlen(string) + 1), string); } diff --git a/src/apply.c b/src/apply.c index 4bc03816d..ce2a0b271 100644 --- a/src/apply.c +++ b/src/apply.c @@ -25,16 +25,16 @@ static void use_figurine(struct obj **); static void use_grease(struct obj *); static void use_trap(struct obj *); static void use_stone(struct obj *); -static int set_trap(); /* occupation callback */ +static int set_trap(void); /* occupation callback */ static int use_whip(struct obj *); static int use_pole(struct obj *); static int use_cream_pie(struct obj *); static int use_grapple(struct obj *); static int do_break_wand(struct obj *); static int do_flip_coin(struct obj *); -static boolean figurine_location_checks(struct obj *, coord *, BOOLEAN_P); -static boolean uhave_graystone(); -static void add_class(char *, CHAR_P); +static boolean figurine_location_checks(struct obj *, coord *, boolean); +static boolean uhave_graystone(void); +static void add_class(char *, char); #ifdef AMIGA void amii_speaker( struct obj *, char *, int ) ; @@ -43,8 +43,7 @@ void amii_speaker( struct obj *, char *, int ) ; static const char no_elbow_room[] = "don't have enough elbow-room to maneuver."; static int -use_camera(obj) -struct obj *obj; +use_camera(struct obj *obj) { struct monst *mtmp; @@ -83,8 +82,7 @@ struct obj *obj; } static int -use_towel(obj) -struct obj *obj; +use_towel(struct obj *obj) { boolean drying_feedback = (obj == uwep); @@ -175,9 +173,7 @@ struct obj *obj; /* maybe give a stethoscope message based on floor objects */ static boolean -its_dead(rx, ry, resp, tobj) -int rx, ry, *resp; -struct obj* tobj; +its_dead(int rx, int ry, int *resp, struct obj *tobj) { char buf[BUFSZ]; struct permonst *mptr; @@ -327,8 +323,7 @@ static const char hollow_str[] = "a hollow sound. This must be a secret %s!"; almost useless. As a compromise, one use per turn is free, another uses up the turn; this makes curse status have a tangible effect. */ static int -use_stethoscope(obj) -register struct obj *obj; +use_stethoscope(register struct obj *obj) { static long last_used_move = -1; static short last_used_movement = 0; @@ -486,8 +481,7 @@ static const char whistle_str[] = "produce a %s whistling sound."; static const char alt_whistle_str[] = "produce a %s, sharp vibration."; static void -use_whistle(obj) -struct obj *obj; +use_whistle(struct obj *obj) { if (!can_blow(&youmonst)) { You("are incapable of using this whistle."); @@ -508,8 +502,7 @@ struct obj *obj; } static void -use_magic_whistle(obj) -struct obj *obj; +use_magic_whistle(struct obj *obj) { struct monst *mtmp, *nextmon; @@ -571,14 +564,13 @@ struct obj *obj; } boolean -um_dist(x, y, n) -register xchar x, y, n; +um_dist(register xchar x, register xchar y, register xchar n) { return((boolean)(abs(u.ux - x) > n || abs(u.uy - y) > n)); } int -number_leashed() +number_leashed(void) { register int i = 0; register struct obj *obj; @@ -590,8 +582,7 @@ number_leashed() /* otmp is about to be destroyed or stolen */ void -o_unleash(otmp) -register struct obj *otmp; +o_unleash(register struct obj *otmp) { register struct monst *mtmp; @@ -603,9 +594,7 @@ register struct obj *otmp; /* mtmp is about to die, or become untame */ void -m_unleash(mtmp, feedback) -register struct monst *mtmp; -boolean feedback; +m_unleash(register struct monst *mtmp, boolean feedback) { register struct obj *otmp; @@ -624,7 +613,7 @@ boolean feedback; /* player is about to die (for bones) */ void -unleash_all() +unleash_all(void) { register struct obj *otmp; register struct monst *mtmp; @@ -638,8 +627,7 @@ unleash_all() #define MAXLEASHED 2 boolean -leashable(mtmp) -struct monst *mtmp; +leashable(struct monst *mtmp) { return (boolean)(mtmp->mnum != PM_LONG_WORM && !unsolid(mtmp->data) && @@ -648,8 +636,7 @@ struct monst *mtmp; /* ARGSUSED */ static int -use_leash(obj) -struct obj *obj; +use_leash(struct obj *obj) { coord cc; struct monst *mtmp; @@ -739,8 +726,7 @@ struct obj *obj; /* assuming mtmp->mleashed has been checked */ struct obj * -get_mleash(mtmp) -struct monst *mtmp; +get_mleash(struct monst *mtmp) { struct obj *otmp; @@ -755,7 +741,7 @@ struct monst *mtmp; } boolean -next_to_u() +next_to_u(void) { register struct monst *mtmp; register struct obj *otmp; @@ -786,8 +772,7 @@ next_to_u() } void -check_leash(x, y) -register xchar x, y; +check_leash(register xchar x, register xchar y) { register struct obj *otmp; register struct monst *mtmp; @@ -850,8 +835,7 @@ register xchar x, y; static const char look_str[] = "look %s."; static int -use_mirror(obj) -struct obj *obj; +use_mirror(struct obj *obj) { const char *mirror; struct monst *mtmp; @@ -1037,8 +1021,7 @@ struct obj *obj; } static void -use_bell(optr) -struct obj **optr; +use_bell(struct obj **optr) { register struct obj *obj = *optr; struct monst *mtmp; @@ -1159,8 +1142,7 @@ struct obj **optr; } static void -use_candelabrum(obj) -register struct obj *obj; +use_candelabrum(register struct obj *obj) { const char *s = (obj->spe != 1) ? "candles" : "candle"; @@ -1219,8 +1201,7 @@ register struct obj *obj; } static void -use_candle(optr) -struct obj **optr; +use_candle(struct obj **optr) { register struct obj *obj = *optr; register struct obj *otmp; @@ -1292,8 +1273,7 @@ struct obj **optr; /* call in drop, throw, and put in box, etc. */ boolean -snuff_candle(otmp) -register struct obj *otmp; +snuff_candle(register struct obj *otmp) { boolean candle = Is_candle(otmp); @@ -1319,8 +1299,7 @@ register struct obj *otmp; you've been swallowed by a monster; obj might be in transit while being thrown or dropped so don't assume that its location is valid */ boolean -snuff_lit(obj) -struct obj *obj; +snuff_lit(struct obj *obj) { xchar x, y; @@ -1341,8 +1320,7 @@ struct obj *obj; /* Called when potentially lightable object is affected by fire_damage(). Return TRUE if object was lit and FALSE otherwise --ALI */ boolean -catch_lit(obj) -struct obj *obj; +catch_lit(struct obj *obj) { xchar x, y; @@ -1377,8 +1355,7 @@ struct obj *obj; } static void -use_lamp(obj) -struct obj *obj; +use_lamp(struct obj *obj) { char buf[BUFSZ]; @@ -1431,8 +1408,7 @@ struct obj *obj; } static void -light_cocktail(optr) -struct obj **optr; +light_cocktail(struct obj **optr) { struct obj *obj = *optr; /* obj is a potion of oil */ char buf[BUFSZ]; @@ -1493,7 +1469,7 @@ struct obj **optr; static NEARDATA const char cuddly[] = { TOOL_CLASS, GEM_CLASS, 0 }; int -dorub() +dorub(void) { struct obj *obj = getobj(cuddly, "rub"); @@ -1544,7 +1520,7 @@ dorub() } int -dojump() +dojump(void) { /* Physical jump */ return jump(0); @@ -1559,9 +1535,7 @@ enum jump_trajectory { /* callback routine for walk_path() */ static boolean -check_jump(arg, x, y) -void *arg; -int x, y; +check_jump(void *arg, int x, int y) { int traj = *(int *) arg; struct rm *lev = &levl[x][y]; @@ -1597,9 +1571,7 @@ int x, y; } static boolean -is_valid_jump_pos(x, y, magic, showmsg) -int x, y, magic; -boolean showmsg; +is_valid_jump_pos(int x, int y, int magic, boolean showmsg) { if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && distu(x, y) != 5) { /* The Knight jumping restriction still applies when riding a @@ -1676,8 +1648,7 @@ boolean showmsg; static int jumping_is_magic; static boolean -get_valid_jump_position(x,y) -int x,y; +get_valid_jump_position(int x, int y) { return (isok(x, y) && (ACCESSIBLE(levl[x][y].typ) || Passes_walls) && @@ -1685,8 +1656,7 @@ int x,y; } static void -display_jump_positions(state) -int state; +display_jump_positions(int state) { if (state == 0) { tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos)); @@ -1708,8 +1678,7 @@ int state; } int -jump(magic) -int magic; /* 0=Physical, otherwise skill level */ +jump(int magic) /**< 0=Physical, otherwise skill level */ { coord cc; @@ -1877,8 +1846,7 @@ int magic; /* 0=Physical, otherwise skill level */ } boolean -tinnable(corpse) -struct obj *corpse; +tinnable(struct obj *corpse) { if (corpse->otyp != CORPSE) return 0; if (corpse->oeaten) return 0; @@ -1888,8 +1856,7 @@ struct obj *corpse; } static void -use_tinning_kit(obj) -register struct obj *obj; +use_tinning_kit(register struct obj *obj) { struct obj *corpse, *can; @@ -1960,9 +1927,9 @@ register struct obj *obj; } void -fix_attributes_and_properties(obj, attr_point) -struct obj *obj; -int attr_point; /* number of attribute points per attribute we might fix */ +fix_attributes_and_properties( + struct obj *obj, + int attr_point) /**< number of attribute points per attribute we might fix */ { #define PROP_COUNT 6 /* number of properties we're dealing with */ int attr_count = A_MAX*attr_point; @@ -2111,9 +2078,7 @@ int attr_point; /* number of attribute points per attribute we might fix */ * Timer callback routine: turn figurine into monster */ void -fig_transform(arg, timeout) -anything *arg; -long timeout; +fig_transform(anything *arg, long int timeout) { struct obj *figurine = arg->a_obj; struct monst *mtmp; @@ -2233,10 +2198,7 @@ long timeout; } static boolean -figurine_location_checks(obj, cc, quietly) -struct obj *obj; -coord *cc; -boolean quietly; +figurine_location_checks(struct obj *obj, coord *cc, boolean quietly) { xchar x, y; @@ -2269,8 +2231,7 @@ boolean quietly; } static void -use_figurine(optr) -struct obj **optr; +use_figurine(struct obj **optr) { register struct obj *obj = *optr; xchar x, y; @@ -2312,8 +2273,7 @@ struct obj **optr; static NEARDATA const char lubricables[] = { ALL_CLASSES, ALLOW_NONE, 0 }; static void -use_grease(obj) -struct obj *obj; +use_grease(struct obj *obj) { struct obj *otmp; @@ -2374,7 +2334,7 @@ static struct trapinfo { } trapinfo; void -reset_trapset() +reset_trapset(void) { trapinfo.tobj = 0; trapinfo.force_bungle = 0; @@ -2382,8 +2342,7 @@ reset_trapset() /* touchstones - by Ken Arnold */ static void -use_stone(tstone) -struct obj *tstone; +use_stone(struct obj *tstone) { struct obj *obj; boolean do_scratch; @@ -2516,8 +2475,7 @@ struct obj *tstone; /* Place a landmine/bear trap. Helge Hafting */ static void -use_trap(otmp) -struct obj *otmp; +use_trap(struct obj *otmp) { int ttyp, tmp; const char *what = (char *)0; @@ -2612,7 +2570,7 @@ struct obj *otmp; } static int -set_trap() +set_trap(void) { struct obj *otmp = trapinfo.tobj; struct trap *ttmp; @@ -2651,8 +2609,7 @@ set_trap() } static int -use_whip(obj) -struct obj *obj; +use_whip(struct obj *obj) { char buf[BUFSZ]; struct monst *mtmp; @@ -2915,9 +2872,7 @@ static const char /* find pos of monster in range, if only one monster */ static boolean -find_poleable_mon(pos, min_range, max_range) -coord *pos; -int min_range, max_range; +find_poleable_mon(coord *pos, int min_range, int max_range) { struct monst *mtmp; coord mpos; @@ -2969,8 +2924,7 @@ static int polearm_range_min = -1; static int polearm_range_max = -1; static boolean -get_valid_polearm_position(x, y) -int x, y; +get_valid_polearm_position(int x, int y) { return (isok(x, y) && ACCESSIBLE(levl[x][y].typ) && @@ -2979,8 +2933,7 @@ int x, y; } static void -display_polearm_positions(state) -int state; +display_polearm_positions(int state) { if (state == 0) { tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos)); @@ -3003,8 +2956,7 @@ int state; /* Distance attacks by pole-weapons */ static int -use_pole(obj) -struct obj *obj; +use_pole(struct obj *obj) { int res = 0, typ, max_range = 4, min_range = 4; coord cc; @@ -3128,8 +3080,7 @@ struct obj *obj; } static int -use_cream_pie(obj) -struct obj *obj; +use_cream_pie(struct obj *obj) { boolean wasblind = Blind; boolean wascreamed = u.ucreamed; @@ -3171,8 +3122,7 @@ struct obj *obj; } static int -use_grapple (obj) -struct obj *obj; +use_grapple (struct obj *obj) { int res = 0, typ, max_range = 4, tohit; coord cc; @@ -3319,8 +3269,7 @@ struct obj *obj; /* return 1 if the wand is broken, hence some time elapsed */ static int -do_break_wand(obj) -struct obj *obj; +do_break_wand(struct obj *obj) { static const char nothing_else_happens[] = "But nothing else happens..."; register int i, x, y; @@ -3706,7 +3655,7 @@ struct obj *obj; } static boolean -uhave_graystone() +uhave_graystone(void) { register struct obj *otmp; @@ -3717,8 +3666,7 @@ uhave_graystone() } static int -do_flip_coin(obj) -struct obj *obj; +do_flip_coin(struct obj *obj) { if (nohands(youmonst.data)) { pline("And how would you flip the coin without hands?"); @@ -3760,9 +3708,7 @@ struct obj *obj; } static void -add_class(cl, class) -char *cl; -char class; +add_class(char *cl, char class) { char tmp[2]; @@ -3773,8 +3719,7 @@ char class; /* augment tools[] if various items are carried */ static void -setapplyclasses(class_list) -char class_list[]; +setapplyclasses(char *class_list) { struct obj *otmp; int otyp; @@ -3820,7 +3765,7 @@ char class_list[]; /** the 'a' command */ int -doapply() +doapply(void) { struct obj *obj; register int res = 1; @@ -4126,8 +4071,7 @@ doapply() * great. */ int -unfixable_trouble_count(is_horn) -boolean is_horn; +unfixable_trouble_count(boolean is_horn) { int unfixable_trbl = 0; diff --git a/src/artifact.c b/src/artifact.c index 427e33b73..ae3bbc1a1 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -20,7 +20,7 @@ static boolean bane_applies(const struct artifact *, struct monst *); static int spec_applies(const struct artifact *, struct monst *); static int arti_invoke(struct obj*); static boolean Mb_hit(struct monst *magr, struct monst *mdef, - struct obj *, int *, int, BOOLEAN_P, char *); + struct obj *, int *, int, boolean, char *); /* The amount added to the victim's total hit points to insure that the victim will be killed even after damage bonus/penalty adjustments. @@ -40,12 +40,12 @@ static boolean artiexist[1+NROFARTIFACTS+1]; /* and a discovery list for them (no dummy first entry here) */ static xchar artidisco[NROFARTIFACTS]; -static void hack_artifacts(); +static void hack_artifacts(void); static boolean attacks(int, struct obj *); /* handle some special cases; must be called after u_init() */ static void -hack_artifacts() +hack_artifacts(void) { struct artifact *art; int alignmnt = aligns[flags.initalign].value; @@ -69,7 +69,7 @@ hack_artifacts() /* zero out the artifact existence list */ void -init_artifacts() +init_artifacts(void) { (void) memset((genericptr_t) artiexist, 0, sizeof artiexist); (void) memset((genericptr_t) artidisco, 0, sizeof artidisco); @@ -77,16 +77,14 @@ init_artifacts() } void -save_artifacts(fd) -int fd; +save_artifacts(int fd) { bwrite(fd, (genericptr_t) artiexist, sizeof artiexist); bwrite(fd, (genericptr_t) artidisco, sizeof artidisco); } void -restore_artifacts(fd) -int fd; +restore_artifacts(int fd) { mread(fd, (genericptr_t) artiexist, sizeof artiexist); mread(fd, (genericptr_t) artidisco, sizeof artidisco); @@ -94,8 +92,7 @@ int fd; } const char * -artiname(artinum) -int artinum; +artiname(int artinum) { if (artinum <= 0 || artinum > NROFARTIFACTS) return(""); return(artilist[artinum].name); @@ -113,9 +110,9 @@ int artinum; for the 1st, ``obj = mk_artifact((struct obj *)0, some_alignment);''. */ struct obj * -mk_artifact(otmp, alignment) -struct obj *otmp; /* existing object; ignored if alignment specified */ -aligntyp alignment; /* target alignment, or A_NONE */ +mk_artifact( + struct obj *otmp, /**< existing object; ignored if alignment specified */ + aligntyp alignment) /**< target alignment, or A_NONE */ { const struct artifact *a; int n, m; @@ -164,9 +161,7 @@ make_artif: if (by_align) otmp = mksobj((int)a->otyp, TRUE, FALSE); * is non-NULL. */ const char* -artifact_name(name, otyp) -const char *name; -short *otyp; +artifact_name(const char *name, short int *otyp) { register const struct artifact *a; register const char *aname; @@ -186,9 +181,7 @@ short *otyp; } boolean -exist_artifact(otyp, name) -register int otyp; -register const char *name; +exist_artifact(register int otyp, register const char *name) { register const struct artifact *a; register boolean *arex; @@ -201,10 +194,7 @@ register const char *name; } void -artifact_exists(otmp, name, mod) -struct obj *otmp; -const char *name; -boolean mod; +artifact_exists(struct obj *otmp, const char *name, boolean mod) { register const struct artifact *a; @@ -223,7 +213,7 @@ boolean mod; } int -nartifact_exist() +nartifact_exist(void) { int a = 0; int n = SIZE(artiexist); @@ -235,9 +225,7 @@ nartifact_exist() } boolean -spec_ability(otmp, abil) -struct obj *otmp; -unsigned long abil; +spec_ability(struct obj *otmp, long unsigned int abil) { const struct artifact *arti = get_artifact(otmp); @@ -246,8 +234,7 @@ unsigned long abil; /* used so that callers don't need to known about SPFX_ codes */ boolean -confers_luck(obj) -struct obj *obj; +confers_luck(struct obj *obj) { /* might as well check for this too */ if (obj->otyp == LUCKSTONE) return TRUE; @@ -257,8 +244,7 @@ struct obj *obj; /* used to check whether a monster is getting reflection from an artifact */ boolean -arti_reflects(obj) -struct obj *obj; +arti_reflects(struct obj *obj) { const struct artifact *arti = get_artifact(obj); @@ -275,8 +261,7 @@ struct obj *obj; /* decide whether this obj is effective when attacking against shades; does not consider the bonus for blessed objects versus undead */ boolean -shade_glare(obj) -struct obj *obj; +shade_glare(struct obj *obj) { const struct artifact *arti; @@ -295,11 +280,12 @@ struct obj *obj; return FALSE; } +/** returns 1 if name is restricted */ boolean -restrict_name(otmp, name, restrict_typ) /* returns 1 if name is restricted */ -register struct obj *otmp; -register const char *name; -register boolean restrict_typ; /* restrict for otmp->otyp? */ +restrict_name( + struct obj *otmp, + const char *name, + boolean restrict_typ) /**< restrict for otmp->otyp? */ { register const struct artifact *a; register const char *aname; @@ -324,9 +310,7 @@ register boolean restrict_typ; /* restrict for otmp->otyp? */ } static boolean -attacks(adtyp, otmp) -register int adtyp; -register struct obj *otmp; +attacks(register int adtyp, register struct obj *otmp) { register const struct artifact *weap; @@ -336,9 +320,7 @@ register struct obj *otmp; } boolean -defends(adtyp, otmp) -int adtyp; -struct obj *otmp; +defends(int adtyp, struct obj *otmp) { register const struct artifact *weap; unsigned long mask; @@ -402,9 +384,7 @@ struct obj *otmp; /* used for monsters */ boolean -defends_when_carried(adtyp, otmp) -int adtyp; -struct obj *otmp; +defends_when_carried(int adtyp, struct obj *otmp) { register const struct artifact *weap; @@ -416,9 +396,7 @@ struct obj *otmp; /* determine whether an item confers Protection */ boolean -protects(otmp, being_worn) -struct obj *otmp; -boolean being_worn; +protects(struct obj *otmp, boolean being_worn) { const struct artifact *arti; @@ -437,10 +415,7 @@ boolean being_worn; * unworn/unwielded/dropped. Pickup/drop only set/reset the W_ART mask. */ void -set_artifact_intrinsic(otmp, on, wp_mask) -struct obj *otmp; -boolean on; -long wp_mask; +set_artifact_intrinsic(struct obj *otmp, boolean on, long int wp_mask) { long *mask = 0; const struct artifact *art; @@ -664,9 +639,7 @@ static boolean touch_blasted; /* for retouch_object() */ * fooled by such trappings. */ int -touch_artifact(obj, mon) -struct obj *obj; -struct monst *mon; +touch_artifact(struct obj *obj, struct monst *mon) { register const struct artifact *oart = get_artifact(obj); boolean badclass, badalign, self_willed, yours; @@ -751,9 +724,7 @@ struct monst *mon; /* decide whether an artifact itself is vulnerable to a particular type of erosion damage, independent of the properties of its bearer */ boolean -arti_immune(obj, dtyp) -struct obj *obj; -int dtyp; +arti_immune(struct obj *obj, int dtyp) { register const struct artifact *weap = get_artifact(obj); @@ -769,9 +740,7 @@ int dtyp; } static boolean -bane_applies(oart, mon) -const struct artifact *oart; -struct monst *mon; +bane_applies(const struct artifact *oart, struct monst *mon) { struct artifact atmp; @@ -787,9 +756,7 @@ struct monst *mon; /* decide whether an artifact's special attacks apply against mtmp */ static int -spec_applies(weap, mtmp) -register const struct artifact *weap; -struct monst *mtmp; +spec_applies(register const struct artifact *weap, struct monst *mtmp) { struct permonst *ptr; boolean yours; @@ -844,8 +811,7 @@ struct monst *mtmp; /* return the M2 flags of monster that an artifact's special attacks apply against */ long -spec_m2(otmp) -struct obj *otmp; +spec_m2(struct obj *otmp) { const struct artifact *artifact = get_artifact(otmp); @@ -857,9 +823,7 @@ struct obj *otmp; /* special attack bonus */ int -spec_abon(otmp, mon) -struct obj *otmp; -struct monst *mon; +spec_abon(struct obj *otmp, struct monst *mon) { const struct artifact *weap = get_artifact(otmp); @@ -873,10 +837,7 @@ struct monst *mon; /* special damage bonus */ int -spec_dbon(otmp, mon, tmp) -struct obj *otmp; -struct monst *mon; -int tmp; +spec_dbon(struct obj *otmp, struct monst *mon, int tmp) { register const struct artifact *weap = get_artifact(otmp); @@ -897,8 +858,7 @@ int tmp; /* add identified artifact to discoveries list */ void -discover_artifact(m) -xchar m; +discover_artifact(xchar m) { int i; @@ -916,8 +876,7 @@ xchar m; /* used to decide whether an artifact has been fully identified */ boolean -undiscovered_artifact(m) -xchar m; +undiscovered_artifact(xchar m) { int i; @@ -933,8 +892,7 @@ xchar m; /* display a list of discovered artifacts; return their count */ int -disp_artifact_discoveries(tmpwin) -winid tmpwin; /* supplied by dodiscover() */ +disp_artifact_discoveries(winid tmpwin) /**< supplied by dodiscover() */ { int i, m, otyp; char buf[BUFSZ]; @@ -997,13 +955,13 @@ static const char *const mb_verb[2][NUM_MB_INDICES] = { /* called when someone is being hit by Magicbane */ static boolean -Mb_hit(magr, mdef, mb, dmgptr, dieroll, vis, hittee) -struct monst *magr, *mdef; /* attacker and defender */ -struct obj *mb; /* Magicbane */ -int *dmgptr; /* extra damage target will suffer */ -int dieroll; /* d20 that has already scored a hit */ -boolean vis; /* whether the action can be seen */ -char *hittee; /* target's name: "you" or mon_nam(mdef) */ +Mb_hit(struct monst *magr, /**< attacker */ + struct monst *mdef, /**< defender */ + struct obj *mb, /**< Magicbane */ + int *dmgptr, /**< extra damage target will suffer */ + int dieroll, /**< d20 that has already scored a hit */ + boolean vis, /**< whether the action can be seen */ + char *hittee) /**< target's name: "you" or mon_nam(mdef) */ { struct permonst *old_uasmon; const char *verb; @@ -1177,11 +1135,9 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */ * Stormbringer it's "killed by Stormbringer" instead of "killed by an orc". */ boolean -artifact_hit(magr, mdef, otmp, dmgptr, dieroll) -struct monst *magr, *mdef; -struct obj *otmp; -int *dmgptr; -int dieroll; /* needed for Magicbane and vorpal blades */ +artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp, + int *dmgptr, + int dieroll) /**< needed for Magicbane and vorpal blades */ { boolean youattack = (magr == &youmonst); boolean youdefend = (mdef == &youmonst); @@ -1579,7 +1535,7 @@ static NEARDATA const char invoke_types[] = { ALL_CLASSES, 0 }; /** the #invoke command */ int -doinvoke() +doinvoke(void) { struct obj *obj; @@ -1592,8 +1548,7 @@ doinvoke() } static int -arti_invoke(obj) -struct obj *obj; +arti_invoke(struct obj *obj) { register const struct artifact *oart = get_artifact(obj); @@ -1872,16 +1827,14 @@ struct obj *obj; /* WAC return TRUE if artifact is always lit */ boolean -artifact_light(obj) -struct obj *obj; +artifact_light(struct obj *obj) { return (get_artifact(obj) && obj->oartifact == ART_SUNSWORD); } /* KMH -- Talking artifacts are finally implemented */ void -arti_speak(obj) -struct obj *obj; +arti_speak(struct obj *obj) { register const struct artifact *oart = get_artifact(obj); const char *line; @@ -1900,9 +1853,7 @@ struct obj *obj; } boolean -artifact_has_invprop(otmp, inv_prop) -struct obj *otmp; -uchar inv_prop; +artifact_has_invprop(struct obj *otmp, uchar inv_prop) { const struct artifact *arti = get_artifact(otmp); @@ -1911,8 +1862,7 @@ uchar inv_prop; /* Return the price sold to the hero of a given artifact or unique item */ long -arti_cost(otmp) -struct obj *otmp; +arti_cost(struct obj *otmp) { if (!otmp->oartifact) return ((long)objects[otmp->otyp].oc_cost); @@ -1923,8 +1873,7 @@ struct obj *otmp; } static uchar -abil_to_adtyp(abil) -long *abil; +abil_to_adtyp(long int *abil) { struct abil2adtyp_tag { long *abil; @@ -1949,8 +1898,7 @@ long *abil; } static unsigned long -abil_to_spfx(abil) -long *abil; +abil_to_spfx(long int *abil) { static const struct abil2spfx_tag { long *abil; @@ -1982,8 +1930,7 @@ long *abil; * Return the first item that is conveying a particular intrinsic. */ struct obj * -what_gives(abil) -long *abil; +what_gives(long int *abil) { struct obj *obj; uchar dtyp; @@ -2034,8 +1981,7 @@ long *abil; } boolean -MATCH_WARN_OF_MON(mon) -struct monst *mon; +MATCH_WARN_OF_MON(struct monst *mon) { /* warned of S_MONSTER? */ if (uwep && uwep->oartifact) { @@ -2054,8 +2000,7 @@ struct monst *mon; * Returns the plural name of the monster the player is warned * about with SPFX_WARN_S */ const char * -get_warned_of_monster(otmp) -struct obj *otmp; +get_warned_of_monster(struct obj *otmp) { if (otmp && otmp->oartifact) { const struct artifact *arti = get_artifact(otmp); @@ -2074,8 +2019,7 @@ struct obj *otmp; } const char * -glow_color(arti_indx) -int arti_indx; +glow_color(int arti_indx) { int colornum = artilist[arti_indx].acolor; const char *colorstr = clr2colorname(colornum); @@ -2090,8 +2034,7 @@ static const char *glow_verbs[] = { /* relative strength that Sting is glowing (0..3), to select verb */ static int -glow_strength(count) -int count; +glow_strength(int count) { /* glow strength should also be proportional to proximity and probably difficulty, but we don't have that information and @@ -2100,9 +2043,9 @@ int count; } const char * -glow_verb(count, ingsfx) -int count; /* 0 means blind rather than no applicable creatures */ -boolean ingsfx; +glow_verb(int count, boolean ingsfx) + /* 0 means blind rather than no applicable creatures */ + { static char resbuf[20]; @@ -2117,8 +2060,7 @@ boolean ingsfx; /* use for warning "glow" for Sting, Orcrist, and Grimtooth */ void -Sting_effects(orc_count) -int orc_count; /* new count (warn_obj_cnt is old count); -1 is a flag value */ +Sting_effects(int orc_count) /**< new count (warn_obj_cnt is old count); -1 is a flag value */ { if (uwep && (uwep->oartifact == ART_STING || uwep->oartifact == ART_ORCRIST || @@ -2151,9 +2093,9 @@ int orc_count; /* new count (warn_obj_cnt is old count); -1 is a flag value */ after undergoing a transformation (alignment change, lycanthropy, polymorph) which might affect item access */ int -retouch_object(objp, loseit) -struct obj **objp; /* might be destroyed or unintentionally dropped */ -boolean loseit; /* whether to drop it if hero can longer touch it */ +retouch_object( + struct obj **objp, /**< might be destroyed or unintentionally dropped */ + boolean loseit) /**< whether to drop it if hero can longer touch it */ { struct obj *obj = *objp; @@ -2230,9 +2172,7 @@ boolean loseit; /* whether to drop it if hero can longer touch it */ currently in operation undergoes a touch test; if it fails, it will be unworn/unwielded and revoked but not dropped */ static boolean -untouchable(obj, drop_untouchable) -struct obj *obj; -boolean drop_untouchable; +untouchable(struct obj *obj, boolean drop_untouchable) { struct artifact *art; boolean beingworn, carryeffect, invoked; @@ -2272,8 +2212,7 @@ boolean drop_untouchable; /* check all items currently in use (mostly worn) for touchability */ void -retouch_equipment(dropflag) -int dropflag; /* 0==don't drop, 1==drop all, 2==drop weapon */ +retouch_equipment(int dropflag) /**< 0==don't drop, 1==drop all, 2==drop weapon */ { static int nesting = 0; /* recursion control */ struct obj *obj; @@ -2348,8 +2287,7 @@ int dropflag; /* 0==don't drop, 1==drop all, 2==drop weapon */ static int mkot_trap_warn_count = 0; static int -count_surround_traps(x, y) -int x, y; +count_surround_traps(int x, int y) { struct rm *levp; struct obj *otmp; @@ -2398,7 +2336,7 @@ int x, y; /* sense adjacent traps if wielding MKoT without wearing gloves */ void -mkot_trap_warn() +mkot_trap_warn(void) { static const char *const heat[7] = { "cool", "slightly warm", "warm", "very warm", "hot", "very hot", "like fire" @@ -2420,9 +2358,9 @@ mkot_trap_warn() /* Master Key is magic key if its bless/curse state meets our criteria: not cursed for rogues or blessed for non-rogues */ boolean -is_magic_key(mon, obj) -struct monst *mon; /* if null, non-rogue is assumed */ -struct obj *obj; +is_magic_key(struct monst *mon, struct obj *obj) + /* if null, non-rogue is assumed */ + { if (!obj || obj->oartifact != ART_MASTER_KEY_OF_THIEVERY) { return FALSE; @@ -2436,8 +2374,7 @@ struct obj *obj; /* figure out whether 'mon' (usually youmonst) is carrying the magic key */ struct obj * -has_magic_key(mon) -struct monst *mon; /* if null, hero assumed */ +has_magic_key(struct monst *mon) /**< if null, hero assumed */ { struct obj *o; short key = artilist[ART_MASTER_KEY_OF_THIEVERY].otyp; diff --git a/src/attrib.c b/src/attrib.c index 32593f959..e27106042 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -116,14 +116,14 @@ hea_abil[] = { { 1, &(HPoison_resistance), "", "" }, hum_abil[] = { { 0, 0, 0, 0 } }; static long next_check = 600L; /* arbitrary first setting */ -static void exerper(); +static void exerper(void); static void postadjabil(long *); /* adjust an attribute; return TRUE if change is made, FALSE otherwise */ boolean -adjattrib(ndx, incr, msgflg) -int ndx, incr; -int msgflg; /* positive => no message, zero => message, and */ +adjattrib(int ndx, int incr, int msgflg) + + /* positive => no message, zero => message, and */ { /* negative => conditional (msg if change made) */ if (Fixed_abil || !incr) return FALSE; @@ -180,9 +180,7 @@ int msgflg; /* positive => no message, zero => message, and */ } void -gainstr(otmp, incr) -register struct obj *otmp; -register int incr; +gainstr(register struct obj *otmp, register int incr) { int num = 1; @@ -195,8 +193,8 @@ register int incr; } void -losestr(num) /* may kill you; cause may be poison or monster like 'a' */ -register int num; +losestr(register int num) /* may kill you; cause may be poison or monster like 'a' */ + { int ustr = ABASE(A_STR) - num; @@ -215,8 +213,7 @@ register int num; } void -change_luck(n) -register schar n; +change_luck(register schar n) { u.uluck += n; if (u.uluck < 0 && u.uluck < LUCKMIN) u.uluck = LUCKMIN; @@ -224,8 +221,7 @@ register schar n; } int -stone_luck(parameter) -boolean parameter; /* So I can't think up of a good name. So sue me. --KAA */ +stone_luck(boolean parameter) /* So I can't think up of a good name. So sue me. --KAA */ { register struct obj *otmp; register long bonchance = 0; @@ -241,7 +237,7 @@ boolean parameter; /* So I can't think up of a good name. So sue me. --KAA */ } boolean -has_luckitem() +has_luckitem(void) { register struct obj *otmp; @@ -252,7 +248,7 @@ has_luckitem() /* there has just been an inventory change affecting a luck-granting item */ void -set_moreluck() +set_moreluck(void) { if (!has_luckitem()) u.moreluck = 0; else if (stone_luck(TRUE) >= 0) u.moreluck = LUCKADD; @@ -260,7 +256,7 @@ set_moreluck() } void -restore_attrib() +restore_attrib(void) { int i; @@ -281,9 +277,7 @@ restore_attrib() #define AVAL 50 /* tune value for exercise gains */ void -exercise(i, inc_or_dec) -int i; -boolean inc_or_dec; +exercise(int i, boolean inc_or_dec) { #ifdef DEBUG pline("Exercise:"); @@ -316,7 +310,7 @@ boolean inc_or_dec; } static void -exerper() +exerper(void) { if(!(moves % 10)) { /* Hunger Checks */ @@ -377,7 +371,7 @@ exerper() } void -exerchk() +exerchk(void) { int i, mod_val; @@ -465,15 +459,14 @@ exerchk() /* next_check will otherwise have its initial 600L after a game restore */ void -reset_attribute_clock() +reset_attribute_clock(void) { if (moves > 600L) next_check = moves + rn1(50, 800); } void -init_attr(np) -register int np; +init_attr(register int np) { register int i, x, tryct; @@ -522,7 +515,7 @@ register int np; } void -redist_attr() +redist_attr(void) { register int i, tmp; @@ -541,8 +534,7 @@ redist_attr() } static void -postadjabil(ability) -long *ability; +postadjabil(long int *ability) { if (!ability) return; if (ability == &(HWarning) || ability == &(HSee_invisible)) @@ -550,8 +542,7 @@ long *ability; } void -adjabil(oldlevel, newlevel) -int oldlevel, newlevel; +adjabil(int oldlevel, int newlevel) { register const struct innate *abil, *rabil; long mask = FROMEXPER; @@ -635,7 +626,7 @@ int oldlevel, newlevel; int -newhp() +newhp(void) { int hp, conplus; @@ -683,8 +674,7 @@ newhp() } schar -acurr(x) -int x; +acurr(int x) { register int tmp = (u.abon.a[x] + u.atemp.a[x] + u.acurr.a[x]); @@ -721,7 +711,7 @@ int x; /* condense clumsy ACURR(A_STR) value into value that fits into game formulas */ schar -acurrstr() +acurrstr(void) { register int str = ACURR(A_STR); @@ -734,8 +724,7 @@ acurrstr() * location for any future alignment limits */ void -adjalign(n) -register int n; +adjalign(register int n) { register int newalign = u.ualign.record + n; @@ -754,7 +743,7 @@ register int n; * according to gender and charisma. */ const char * -beautiful() +beautiful(void) { return (ACURR(A_CHA) > 14 ? (poly_gender()==1 ? "beautiful" : "handsome") : @@ -763,14 +752,14 @@ beautiful() /** Returns the hitpoints of your current form. */ int -uhp() +uhp(void) { return (Upolyd ? u.mh : u.uhp); } /** Returns the maximal hitpoints of your current form. */ int -uhpmax() +uhpmax(void) { return (Upolyd ? u.mhmax : u.uhpmax); } @@ -779,8 +768,8 @@ uhpmax() to distinguish between observable +0 result and no-visible-effect due to an attribute not being able to exceed maximum or minimum */ boolean -extremeattr(attrindx) /* does attrindx's value match its max or min? */ -int attrindx; +extremeattr(int attrindx) /* does attrindx's value match its max or min? */ + { /* Fixed_abil and racial MINATTR/MAXATTR aren't relevant here */ int lolimit = 3, hilimit = 25, curval = ACURR(attrindx); @@ -811,9 +800,8 @@ int attrindx; /* change hero's alignment type, possibly losing use of artifacts */ void -uchangealign(newalign, reason) -int newalign; -int reason; /* 0==conversion, 1==helm-of-OA on, 2==helm-of-OA off */ +uchangealign(int newalign, + int reason) /**< 0==conversion, 1==helm-of-OA on, 2==helm-of-OA off */ { aligntyp oldalign = u.ualign.type; diff --git a/src/ball.c b/src/ball.c index cb786adf1..ff1c0bb9f 100644 --- a/src/ball.c +++ b/src/ball.c @@ -5,10 +5,10 @@ #include "hack.h" -static int bc_order(); -static void litter(); -static void placebc_core(); -static void unplacebc_core(); +static int bc_order(void); +static void litter(void); +static void placebc_core(void); +static void unplacebc_core(void); static boolean check_restriction(int); static int bcrestriction = 0; @@ -17,8 +17,7 @@ static struct breadcrumbs bcpbreadcrumbs = {0}, bcubreadcrumbs = {0}; #endif void -ballrelease(showmsg) -boolean showmsg; +ballrelease(boolean showmsg) { if (carried(uball)) { if (showmsg) { @@ -39,7 +38,7 @@ boolean showmsg; /* ball&chain might hit hero when falling through a trap door */ void -ballfall() +ballfall(void) { boolean gets_hit; @@ -114,7 +113,7 @@ ballfall() * Should not be called while swallowed except on waterlevel. */ static void -placebc_core() +placebc_core(void) { if (!uchain || !uball) { impossible("Where are your ball and chain?"); @@ -141,7 +140,7 @@ placebc_core() } static void -unplacebc_core() +unplacebc_core(void) { if (u.uswallow) { if (Is_waterlevel(&u.uz)) { @@ -174,8 +173,7 @@ unplacebc_core() } static boolean -check_restriction(restriction) -int restriction; +check_restriction(int restriction) { boolean ret = FALSE; @@ -189,7 +187,7 @@ int restriction; #ifndef BREADCRUMBS void -placebc() +placebc(void) { if (!check_restriction(0)) { #if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) @@ -208,7 +206,7 @@ placebc() } void -unplacebc() +unplacebc(void) { if (bcrestriction) { impossible("unplacebc denied, restriction in place"); @@ -218,7 +216,7 @@ unplacebc() } int -unplacebc_and_covet_placebc() +unplacebc_and_covet_placebc(void) { int restriction = 0; @@ -232,8 +230,7 @@ unplacebc_and_covet_placebc() } void -lift_covet_and_placebc(pin) -int pin; +lift_covet_and_placebc(int pin) { if (!check_restriction(pin)) { #if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) @@ -359,7 +356,7 @@ int linenum; * hero is being punished. */ static int -bc_order() +bc_order(void) { struct obj *obj; @@ -382,8 +379,7 @@ bc_order() * Set up the ball and chain variables so that the ball and chain are "felt". */ void -set_bc(already_blind) -int already_blind; +set_bc(int already_blind) { int ball_on_floor = !carried(uball); @@ -439,9 +435,10 @@ int already_blind; * Should not be called while swallowed. */ void -move_bc(before, control, ballx, bally, chainx, chainy) -int before, control; -xchar ballx, bally, chainx, chainy; /* only matter !before */ +move_bc( + int before, + int control, + xchar ballx, xchar bally, xchar chainx, xchar chainy) /* only matter !before */ { if (Blind) { /* @@ -556,13 +553,12 @@ xchar ballx, bally, chainx, chainy; /* only matter !before */ /** return TRUE if the caller needs to place the ball and chain down again */ boolean -drag_ball(x, y, bc_control, ballx, bally, chainx, chainy, cause_delay, - allow_drag) -xchar x, y; -int *bc_control; -xchar *ballx, *bally, *chainx, *chainy; -boolean *cause_delay; -boolean allow_drag; +drag_ball( + xchar x, xchar y, + int *bc_control, + xchar *ballx, xchar *bally, xchar *chainx, xchar *chainy, + boolean *cause_delay, + boolean allow_drag) { struct trap *t = (struct trap *)0; boolean already_in_rock; @@ -877,8 +873,7 @@ boolean allow_drag; * Should not be called while swallowed. */ void -drop_ball(x, y) -xchar x, y; +drop_ball(xchar x, xchar y) { if (Blind) { /* get the order */ @@ -967,7 +962,7 @@ xchar x, y; /* ball&chain cause hero to randomly lose stuff from inventory */ static void -litter() +litter(void) { struct obj *otmp, *nextobj = 0; int capacity = weight_cap(); @@ -988,7 +983,7 @@ litter() } void -drag_down() +drag_down(void) { boolean forward; uchar dragchance = 3; @@ -1033,7 +1028,7 @@ drag_down() } void -bc_sanity_check() +bc_sanity_check(void) { int otyp, freeball, freechain; const char *onam; diff --git a/src/bones.c b/src/bones.c index e517cb6a4..9f27261c4 100644 --- a/src/bones.c +++ b/src/bones.c @@ -11,12 +11,11 @@ extern long bytes_counted; static boolean no_bones_level(d_level *); static void goodfruit(int); -static void resetobjs(struct obj *, BOOLEAN_P); +static void resetobjs(struct obj *, boolean); static boolean fixuporacle(struct monst *); static boolean -no_bones_level(lev) -d_level *lev; +no_bones_level(d_level *lev) { extern d_level save_dlevel; /* in do.c */ s_level *sptr; @@ -39,8 +38,7 @@ d_level *lev; * chain of fruit types, we know to only save the types that exist. */ static void -goodfruit(id) -int id; +goodfruit(int id) { struct fruit *f = fruit_from_indx(-id); @@ -50,9 +48,7 @@ int id; } static void -resetobjs(ochain, restore) -struct obj *ochain; -boolean restore; +resetobjs(struct obj *ochain, boolean restore) { struct obj *otmp, *nobj; @@ -197,10 +193,7 @@ boolean restore; /** Removes objects recursively from a container with a probability of prob1/prob2. */ static void -trim_contents(container, prob1, prob2) -struct obj *container; -int prob1; -int prob2; +trim_contents(struct obj *container, int prob1, int prob2) { struct obj *otmp; struct obj *onext; @@ -238,8 +231,7 @@ int prob2; /* while loading bones, strip out text possibly supplied by old player that might accidentally or maliciously disrupt new player's display */ void -sanitize_name(namebuf) -char *namebuf; +sanitize_name(char *namebuf) { int c; boolean strip_8th_bit = (WINDOWPORT("tty") @@ -265,10 +257,10 @@ char *namebuf; /* called by savebones(); also by finish_paybill(shk.c) */ void -drop_upon_death(mtmp, cont, x, y) -struct monst *mtmp; /* monster if hero turned into one (other than ghost) */ -struct obj *cont; /* container if hero is turned into a statue */ -int x, y; +drop_upon_death(struct monst *mtmp, struct obj *cont, int x, int y) + /* monster if hero turned into one (other than ghost) */ + /* container if hero is turned into a statue */ + { struct obj *otmp; int inventory_count=count_objects(invent); @@ -307,8 +299,7 @@ int x, y; /* possibly restore oracle's room and/or put her back inside it; returns False if she's on the wrong level and should be removed, True otherwise */ static boolean -fixuporacle(oracle) -struct monst *oracle; +fixuporacle(struct monst *oracle) { coord cc; int ridx, o_ridx; @@ -362,7 +353,7 @@ struct monst *oracle; /* check whether bones are feasible */ boolean -can_make_bones() +can_make_bones(void) { register struct trap *ttmp; @@ -393,8 +384,7 @@ can_make_bones() /* save bones and possessions of a deceased adventurer */ void -savebones(corpse) -struct obj *corpse; +savebones(struct obj *corpse) { int fd, x, y; struct trap *ttmp; @@ -602,7 +592,7 @@ struct obj *corpse; } int -getbones() +getbones(void) { register int fd; register int ok; diff --git a/src/botl.c b/src/botl.c index b29b0f5c3..0a5941a4c 100644 --- a/src/botl.c +++ b/src/botl.c @@ -14,9 +14,9 @@ const char * const enc_stat[] = { "Overloaded" }; -static void bot1(); -static void bot2(); -static void bot3(); +static void bot1(void); +static void bot2(void); +static void bot3(void); #if defined(STATUS_COLORS) && defined(TEXTCOLOR) @@ -25,9 +25,7 @@ extern const struct percent_color_option *pw_colors; extern const struct text_color_option *text_colors; struct color_option -text_color_of(text, color_options) -const char *text; -const struct text_color_option *color_options; +text_color_of(const char *text, const struct text_color_option *color_options) { if (color_options == NULL) { struct color_option result = {NO_COLOR, 0}; @@ -40,9 +38,7 @@ const struct text_color_option *color_options; } struct color_option -percentage_color_of(value, max, color_options) -int value, max; -const struct percent_color_option *color_options; +percentage_color_of(int value, int max, const struct percent_color_option *color_options) { if (color_options == NULL) { struct color_option result = {NO_COLOR, 0}; @@ -71,8 +67,7 @@ const struct percent_color_option *color_options; } void -start_color_option(color_option) -struct color_option color_option; +start_color_option(struct color_option color_option) { #ifdef TTY_GRAPHICS int i; @@ -85,8 +80,7 @@ struct color_option color_option; } void -end_color_option(color_option) -struct color_option color_option; +end_color_option(struct color_option color_option) { #ifdef TTY_GRAPHICS int i; @@ -100,10 +94,10 @@ struct color_option color_option; static void -apply_color_option(color_option, newbot2, statusline) -struct color_option color_option; -const char *newbot2; -int statusline; /* apply color on this statusline: 1 or 2 */ +apply_color_option( + struct color_option color_option, + const char *newbot2, + int statusline) /**< apply color on this statusline: 1 or 2 */ { if (!iflags.use_status_colors || !iflags.use_color) return; curs(WIN_STATUS, 1, statusline-1); @@ -113,10 +107,7 @@ int statusline; /* apply color on this statusline: 1 or 2 */ } void -add_colored_text(text, newbot2, statusline) -const char *text; -char *newbot2; -int statusline; +add_colored_text(const char *text, char *newbot2, int statusline) { char *nb; struct color_option color_option; @@ -157,8 +148,7 @@ static NEARDATA int mrank_sz = 0; /* loaded by max_rank_sz (from u_init) */ /* convert experience level (1..30) to rank index (0..8) */ int -xlev_to_rank(xlev) -int xlev; +xlev_to_rank(int xlev) { return (xlev <= 2) ? 0 : (xlev <= 30) ? ((xlev + 2) / 4) : 8; } @@ -174,10 +164,7 @@ int rank; #endif const char * -rank_of(lev, monnum, female) -int lev; -short monnum; -boolean female; +rank_of(int lev, short int monnum, boolean female) { register const struct Role *role; register int i; @@ -206,15 +193,13 @@ boolean female; const char * -rank() +rank(void) { return(rank_of(u.ulevel, Role_switch, flags.female)); } int -title_to_mon(str, rank_indx, title_length) -const char *str; -int *rank_indx, *title_length; +title_to_mon(const char *str, int *rank_indx, int *title_length) { register int i, j; @@ -240,7 +225,7 @@ int *rank_indx, *title_length; } void -max_rank_sz() +max_rank_sz(void) { register int i, r, maxr = 0; for (i = 0; i < 9; i++) { @@ -253,7 +238,7 @@ max_rank_sz() #ifdef SCORE_ON_BOTL long -botl_score() +botl_score(void) { int deepest = deepest_lev_reached(FALSE); long umoney = money_cnt(invent) + hidden_gold(); @@ -369,7 +354,7 @@ bot1() #ifdef DUMP_LOG } static void -bot1() +bot1(void) { char newbot1[MAXCO]; @@ -383,8 +368,7 @@ bot1() /* provide the name of the current level for display by various ports */ int -describe_level(buf) -char *buf; +describe_level(char *buf) { int ret = 1; @@ -440,7 +424,7 @@ botl_text_or_blanks(int condition, const char *text, char *botl, int statusline) } const char* -botl_realtime() +botl_realtime(void) { time_t currenttime; @@ -473,11 +457,11 @@ botl_realtime() } #ifdef DUMP_LOG -void bot2str(newbot2) -char* newbot2; +void bot2str(char *newbot2) + #else -static void -bot2() + + #endif { #ifndef DUMP_LOG @@ -587,7 +571,7 @@ bot2() #ifdef DUMP_LOG } static void -bot2() +bot2(void) { char newbot2[MAXCO]; bot2str(newbot2); @@ -636,7 +620,7 @@ bot3str(char *newbot3) } static void -bot3() +bot3(void) { char newbot3[MAXCO]; @@ -651,7 +635,7 @@ bot3() } void -bot() +bot(void) { bot1(); bot2(); diff --git a/src/cmd.c b/src/cmd.c index 59e479a5c..37173710e 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -136,66 +136,66 @@ extern int doshout(); /**/ static int (*timed_occ_fn)(void); -static int doprev_message(); -static int timed_occupation(); -static int doextcmd(); -static int domonability(); -static int dooverview_or_wiz_where(); -static int dotravel(); -static int doautoexplore(); -static int doautofight(); +static int doprev_message(void); +static int timed_occupation(void); +static int doextcmd(void); +static int domonability(void); +static int dooverview_or_wiz_where(void); +static int dotravel(void); +static int doautoexplore(void); +static int doautofight(void); # ifdef WIZARD -int wiz_show_rooms(); -static int wiz_wish(); -static int wiz_identify(); -static int wiz_map(); -static int wiz_genesis(); -static int wiz_where(); -static int wiz_detect(); -static int wiz_panic(); -static int wiz_polyself(); -static int wiz_level_tele(); -static int wiz_level_change(); -static int wiz_show_seenv(); -static int wiz_show_vision(); -static int wiz_mon_polycontrol(); -static int wiz_show_wmodes(); -static int wiz_mazewalkmap(); +int wiz_show_rooms(void); +static int wiz_wish(void); +static int wiz_identify(void); +static int wiz_map(void); +static int wiz_genesis(void); +static int wiz_where(void); +static int wiz_detect(void); +static int wiz_panic(void); +static int wiz_polyself(void); +static int wiz_level_tele(void); +static int wiz_level_change(void); +static int wiz_show_seenv(void); +static int wiz_show_vision(void); +static int wiz_mon_polycontrol(void); +static int wiz_show_wmodes(void); +static int wiz_mazewalkmap(void); extern char SpLev_Map[COLNO][ROWNO]; -static int wiz_showkills(); /* showborn patch */ -static void wiz_map_levltyp(); -static void wiz_levltyp_legend(); +static int wiz_showkills(void); /* showborn patch */ +static void wiz_map_levltyp(void); +static void wiz_levltyp_legend(void); #if defined(__BORLANDC__) && !defined(_WIN32) extern void show_borlandc_stats(winid); #endif #ifdef DEBUG_MIGRATING_MONS static int wiz_migrate_mons(); #endif -static int size_monst(struct monst *, BOOLEAN_P); +static int size_monst(struct monst *, boolean); static int size_obj(struct obj *); -static void count_obj(struct obj *, long *, long *, BOOLEAN_P, BOOLEAN_P); -static void obj_chain(winid, const char *, struct obj *, BOOLEAN_P, long *, long *); +static void count_obj(struct obj *, long *, long *, boolean, boolean); +static void obj_chain(winid, const char *, struct obj *, boolean, long *, long *); static void mon_invent_chain(winid, const char *, struct monst *, long *, long *); -static void mon_chain(winid, const char *, struct monst *, BOOLEAN_P, long *, long *); +static void mon_chain(winid, const char *, struct monst *, boolean, long *, long *); static void contained_stats(winid, const char *, long *, long *); static void misc_stats(winid, long *, long *); -static int wiz_show_stats(); -static boolean accept_menu_prefix(int (*)()); +static int wiz_show_stats(void); +static boolean accept_menu_prefix(int (*)(void)); # ifdef PORT_DEBUG static int wiz_port_debug(); # endif # else extern int tutorial_redisplay(); # endif -static int enter_explore_mode(); -static int doattributes(); -static int doconduct(); /**/ -static boolean minimal_enlightenment(); +static int enter_explore_mode(void); +static int doattributes(void); +static int doconduct(void); /**/ +static boolean minimal_enlightenment(void); static void enlght_line(const char *, const char *, const char *); static char *enlght_combatinc(const char *, int, int, char *); #ifdef UNIX -static void end_of_input(); +static void end_of_input(void); #endif static const char* readchar_queue=""; @@ -206,26 +206,26 @@ static const char unavailcmd[] = "Unavailable command '%s'."; /* for rejecting #if !SHELL, !SUSPEND */ static const char cmdnotavail[] = "'%s' command not available."; -static char here_cmd_menu(BOOLEAN_P); -static char there_cmd_menu(BOOLEAN_P, int, int); -static char *parse(); -static boolean help_dir(CHAR_P, int, const char *); -static int dosuspend_core(); +static char here_cmd_menu(boolean); +static char there_cmd_menu(boolean, int, int); +static char *parse(void); +static boolean help_dir(char, uchar, const char *); +static int dosuspend_core(void); /* allmain.c */ extern int monclock; -static int debug_show_colors(); +static int debug_show_colors(void); static int -doprev_message() +doprev_message(void) { return nh_doprev_message(); } /* Count down by decrementing multi */ static int -timed_occupation() +timed_occupation(void) { (*timed_occ_fn)(); if (multi > 0) @@ -248,7 +248,7 @@ timed_occupation() * Setting traps. */ void -reset_occupations() +reset_occupations(void) { reset_remarm(); reset_pick(); @@ -259,10 +259,7 @@ reset_occupations() * function times out by its own means. */ void -set_occupation(fn, txt, xtime) -int (*fn)(void); -const char *txt; -int xtime; +set_occupation(int (*fn) (void), const char *txt, int xtime) { if (xtime) { occupation = timed_occupation; @@ -276,7 +273,7 @@ int xtime; #ifdef REDO -static char popch(); +static char popch(void); /* Provide a means to redo the last command. The flag `in_doagain' is set * to true while redoing the command. This flag is tested in commands that @@ -289,7 +286,7 @@ static char pushq[BSIZE], saveq[BSIZE]; static NEARDATA int phead, ptail, shead, stail; static char -popch() { +popch(void) { /* If occupied, return '\0', letting tgetch know a character should * be read from the keyboard. If the character read is not the * ABORT character (as checked in pcmain.c), that character will be @@ -301,7 +298,7 @@ popch() { } char -pgetchar() { /* curtesy of aeb@cwi.nl */ +pgetchar(void) { /* curtesy of aeb@cwi.nl */ register int ch; if (iflags.debug_fuzzer) { @@ -314,8 +311,7 @@ pgetchar() { /* curtesy of aeb@cwi.nl */ /* A ch == 0 resets the pushq */ void -pushch(ch) -char ch; +pushch(char ch) { if (!ch) phead = ptail = 0; @@ -328,8 +324,7 @@ char ch; * replaying a previous command. */ void -savech(ch) -char ch; +savech(char ch) { if (!in_doagain) { if (!ch) @@ -343,7 +338,7 @@ char ch; /** here after # - now read a full-word command */ static int -doextcmd() +doextcmd(void) { int idx, retval; int (*func)(void); @@ -374,7 +369,7 @@ doextcmd() /** here after #? - now list all full-word commands and provid some navigation capability through the long list */ int -doextlist() +doextlist(void) { const struct ext_func_tab *efp; char buf[BUFSZ], searchbuf[BUFSZ], promptbuf[QBUFSZ]; @@ -571,7 +566,7 @@ doextlist() * Here after # - now show pick-list of possible commands. */ int -extcmd_via_menu() /* here after # - now show pick-list of possible commands */ +extcmd_via_menu(void) { const struct ext_func_tab *efp; menu_item *pick_list = (menu_item *)0; @@ -711,7 +706,7 @@ extcmd_via_menu() /* here after # - now show pick-list of possible commands */ /* #monster command - use special monster ability while polymorphed */ static int -domonability() +domonability(void) { if (can_breathe(youmonst.data)) return dobreathe(); else if (attacktype(youmonst.data, AT_SPIT)) return dospit(); @@ -741,7 +736,7 @@ domonability() } static int -enter_explore_mode() +enter_explore_mode(void) { if(!discover && !wizard) { pline("Beware! From explore mode there will be no return to normal game."); @@ -759,14 +754,14 @@ enter_explore_mode() } /* #vanquished command */ -static int dovanquished() +static int dovanquished(void) { list_vanquishedonly(); return 0; } static int -dooverview_or_wiz_where() +dooverview_or_wiz_where(void) { /* #ifdef WIZARD @@ -781,7 +776,7 @@ dooverview_or_wiz_where() #ifdef WIZARD int -wiz_show_rooms() +wiz_show_rooms(void) { winid win; int x, y; @@ -812,7 +807,7 @@ wiz_show_rooms() /* ^W command - wish for something */ static int -wiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */ +wiz_wish(void) /* Unlimited wishes for debug mode by Paul Polderman */ { if (wizard) { boolean save_verbose = flags.verbose; @@ -828,7 +823,7 @@ wiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */ /* ^I command - identify hero's inventory */ static int -wiz_identify() +wiz_identify(void) { if (wizard) { identify_pack(0, FALSE); @@ -840,7 +835,7 @@ wiz_identify() /* ^F command - reveal the level map and any traps on it */ static int -wiz_map() +wiz_map(void) { if (wizard) { struct trap *t; @@ -862,7 +857,7 @@ wiz_map() /* ^G command - generate monster(s); a count prefix will be honored */ static int -wiz_genesis() +wiz_genesis(void) { if (wizard) (void) create_particular(); else pline("Unavailable command '^G'."); @@ -871,7 +866,7 @@ wiz_genesis() /* ^O command - display dungeon layout */ static int -wiz_where() +wiz_where(void) { if (wizard) { (void) print_dungeon(FALSE, (schar *)0, (xchar *)0); @@ -883,7 +878,7 @@ wiz_where() /* ^E command - detect unseen (secret doors, traps, hidden monsters) */ static int -wiz_detect() +wiz_detect(void) { if (wizard) { (void) findit(); @@ -895,7 +890,7 @@ wiz_detect() /* ^V command - level teleport, or tutorial review */ static int -wiz_level_tele() +wiz_level_tele(void) { if (wizard) level_tele(); else if(flags.tutorial) @@ -905,7 +900,7 @@ wiz_level_tele() /* #monpolycontrol command - choose new form for shapechangers, polymorphees */ static int -wiz_mon_polycontrol() +wiz_mon_polycontrol(void) { iflags.mon_polycontrol = !iflags.mon_polycontrol; pline("Monster polymorph control is %s.", @@ -915,7 +910,7 @@ wiz_mon_polycontrol() /* #levelchange command - adjust hero's experience level */ static int -wiz_level_change() +wiz_level_change(void) { char buf[BUFSZ]; int newlevel; @@ -955,7 +950,7 @@ wiz_level_change() /* #panic command - test program's panic handling */ static int -wiz_panic() +wiz_panic(void) { if (iflags.debug_fuzzer) { u.uhp = u.uhpmax = 1000; @@ -970,7 +965,7 @@ wiz_panic() /* #polyself command - change hero's form */ static int -wiz_polyself() +wiz_polyself(void) { polyself(TRUE); return 0; @@ -978,7 +973,7 @@ wiz_polyself() /* #seenv command */ static int -wiz_show_seenv() +wiz_show_seenv(void) { winid win; int x, y, v, startx, stopx, curx; @@ -1020,7 +1015,7 @@ wiz_show_seenv() /* #vision command */ static int -wiz_show_vision() +wiz_show_vision(void) { winid win; int x, y, v; @@ -1057,7 +1052,7 @@ wiz_show_vision() /* #wmode command */ static int -wiz_show_wmodes() +wiz_show_wmodes(void) { winid win; int x, y; @@ -1088,7 +1083,7 @@ wiz_show_wmodes() } /* #showkills command */ -static int wiz_showkills() /* showborn patch */ +static int wiz_showkills(void) /* showborn patch */ { list_vanquished('y', FALSE); return 0; @@ -1443,8 +1438,7 @@ static const char static int want_display = FALSE; static void -enlght_line(start, middle, end) -const char *start, *middle, *end; +enlght_line(const char *start, const char *middle, const char *end) { char buf[BUFSZ]; @@ -1457,10 +1451,7 @@ const char *start, *middle, *end; /* format increased damage or chance to hit */ static char * -enlght_combatinc(inctyp, incamt, final, outbuf) -const char *inctyp; -int incamt, final; -char *outbuf; +enlght_combatinc(const char *inctyp, int incamt, int final, char *outbuf) { char numbuf[24]; const char *modif, *bonus; @@ -1493,9 +1484,9 @@ char *outbuf; } void -enlightenment(final, want_disp) -int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */ -boolean want_disp; +enlightenment(int final, boolean want_disp) + /* 0 => still in progress; 1 => over, survived; 2 => dead */ + { int ltmp; char buf[BUFSZ]; @@ -1859,7 +1850,7 @@ boolean want_disp; * Returns FALSE if menu cancelled (dismissed with ESC), TRUE otherwise. */ static boolean -minimal_enlightenment() +minimal_enlightenment(void) { winid tmpwin; menu_item *selected; @@ -1965,8 +1956,7 @@ minimal_enlightenment() } int -do_naming(typ) -int typ; +do_naming(int typ) { winid win; anything any; @@ -2101,20 +2091,20 @@ int typ; } int -do_naming_mname() +do_naming_mname(void) { if (iflags.vanilla_ui_behavior) return do_naming(1); return do_naming(0); } int -do_naming_ddocall() +do_naming_ddocall(void) { return do_naming(0); } static int -doattributes() +doattributes(void) { if (!minimal_enlightenment()) return 0; @@ -2127,16 +2117,14 @@ doattributes() * (shares enlightenment's tense handling) */ static int -doconduct() +doconduct(void) { show_conduct(0, TRUE); return 0; } void -show_conduct(final, want_disp) -int final; -boolean want_disp; +show_conduct(int final, boolean want_disp) { char buf[BUFSZ]; int ngenocided; @@ -2523,8 +2511,7 @@ struct ext_func_tab extcmdlist[] = { }; const char * -key2extcmddesc(key) -uchar key; +key2extcmddesc(uchar key) { static char key2cmdbuf[48]; const struct movcmd *mov; @@ -2578,9 +2565,7 @@ uchar key; } boolean -bind_key(key, command) -uchar key; -const char *command; +bind_key(uchar key, const char *command) { struct ext_func_tab *extcmd; @@ -2611,7 +2596,7 @@ const char *command; /* initialize all keyboard commands */ void -commands_init() +commands_init(void) { struct ext_func_tab *extcmd; @@ -2645,8 +2630,7 @@ commands_init() } char -cmd_from_func(fn) -int (*fn)(void); +cmd_from_func(int (*fn) (void)) { int i; @@ -2668,8 +2652,7 @@ static const char stats_hdr[] = " count bytes"; static const char stats_sep[] = "--------------------------- ----- -------"; static int -size_obj(otmp) -struct obj *otmp; +size_obj(struct obj *otmp) { int sz = (int) sizeof (struct obj); @@ -2690,12 +2673,7 @@ struct obj *otmp; } static void -count_obj(chain, total_count, total_size, top, recurse) -struct obj *chain; -long *total_count; -long *total_size; -boolean top; -boolean recurse; +count_obj(struct obj *chain, long int *total_count, long int *total_size, boolean top, boolean recurse) { long count, size; struct obj *obj; @@ -2714,13 +2692,7 @@ boolean recurse; } static void -obj_chain(win, src, chain, force, total_count, total_size) -winid win; -const char *src; -struct obj *chain; -boolean force; -long *total_count; -long *total_size; +obj_chain(winid win, const char *src, struct obj *chain, boolean force, long int *total_count, long int *total_size) { char buf[BUFSZ]; long count = 0L, size = 0L; @@ -2736,12 +2708,7 @@ long *total_size; } static void -mon_invent_chain(win, src, chain, total_count, total_size) -winid win; -const char *src; -struct monst *chain; -long *total_count; -long *total_size; +mon_invent_chain(winid win, const char *src, struct monst *chain, long int *total_count, long int *total_size) { char buf[BUFSZ]; long count = 0, size = 0; @@ -2756,11 +2723,7 @@ long *total_size; } static void -contained_stats(win, src, total_count, total_size) -winid win; -const char *src; -long *total_count; -long *total_size; +contained_stats(winid win, const char *src, long int *total_count, long int *total_size) { char buf[BUFSZ]; long count = 0, size = 0; @@ -2786,9 +2749,7 @@ long *total_size; } static int -size_monst(mtmp, incl_wsegs) -struct monst *mtmp; -boolean incl_wsegs; +size_monst(struct monst *mtmp, boolean incl_wsegs) { int sz = (int) sizeof (struct monst); @@ -2816,13 +2777,7 @@ boolean incl_wsegs; } static void -mon_chain(win, src, chain, force, total_count, total_size) -winid win; -const char *src; -struct monst *chain; -boolean force; -long *total_count; -long *total_size; +mon_chain(winid win, const char *src, struct monst *chain, boolean force, long int *total_count, long int *total_size) { char buf[BUFSZ]; long count, size; @@ -2844,10 +2799,7 @@ long *total_size; } static void -misc_stats(win, total_count, total_size) -winid win; -long *total_count; -long *total_size; +misc_stats(winid win, long int *total_count, long int *total_size) { char buf[BUFSZ], hdrbuf[QBUFSZ]; long count, size; @@ -2965,7 +2917,7 @@ long *total_size; } static int -wiz_mazewalkmap() +wiz_mazewalkmap(void) { winid win; int x, y; @@ -2991,7 +2943,7 @@ wiz_mazewalkmap() * Display memory usage of all monsters and objects on the level. */ static int -wiz_show_stats() +wiz_show_stats(void) { char buf[BUFSZ]; winid win; @@ -3070,7 +3022,7 @@ wiz_show_stats() } void -trap_sanity_check() +trap_sanity_check(void) { struct trap *trap = ftrap; while (trap) { @@ -3085,7 +3037,7 @@ trap_sanity_check() } void -sanity_check() +sanity_check(void) { obj_sanity_check(); timer_sanity_check(); @@ -3179,9 +3131,7 @@ struct { }; boolean -bind_specialkey(key, command) -uchar key; -const char *command; +bind_specialkey(uchar key, const char *command) { int i; for (i = 0; i < SIZE(spkeys_binds); i++) { @@ -3197,8 +3147,7 @@ const char *command; /* returns a one-byte character from the text (it may massacre the txt * buffer) */ char -txt2key(txt) -char *txt; +txt2key(char *txt) { txt = trimspaces(txt); if (!*txt) { @@ -3266,9 +3215,7 @@ char *txt; /* returns the text for a one-byte encoding; * must be shorter than a tab for proper formatting */ char * -key2txt(c, txt) -uchar c; -char *txt; /* sufficiently long buffer */ +key2txt(uchar c, char *txt) /**< sufficiently long buffer */ { /* should probably switch to "SPC", "ESC", "RET" since nethack's documentation uses ESC for */ @@ -3287,9 +3234,7 @@ char *txt; /* sufficiently long buffer */ } void -parseautocomplete(autocomplete, condition) -char *autocomplete; -boolean condition; +parseautocomplete(char *autocomplete, boolean condition) { struct ext_func_tab *efp; register char *autoc; @@ -3336,8 +3281,7 @@ boolean condition; /* called at startup and after number_pad is twiddled */ void -reset_commands(initial) -boolean initial; +reset_commands(boolean initial) { static const char sdir[] = "hykulnjb><", sdir_swap_yz[] = "hzkulnjb><", @@ -3452,8 +3396,7 @@ boolean initial; /* non-movement commands which accept 'm' prefix to request menu operation */ static boolean -accept_menu_prefix(cmd_func) -int (*cmd_func)(void); +accept_menu_prefix(int (*cmd_func) (void)) { if (cmd_func == dopickup || cmd_func == dotip || /* eat, #offer, and apply tinning-kit all use floorfood() to pick @@ -3475,7 +3418,7 @@ int (*cmd_func)(void); } char -randomkey() +randomkey(void) { static unsigned i = 0; char c; @@ -3537,9 +3480,7 @@ randomkey() } void -random_response(buf, sz) -char *buf; -int sz; +random_response(char *buf, int sz) { char c; int count = 0; @@ -3559,7 +3500,7 @@ int sz; } int -rnd_extcmd_idx() +rnd_extcmd_idx(void) { #ifdef NEXT_VERSION return rn2(extcmdlist_length + 1) - 1; @@ -3585,8 +3526,7 @@ ch2spkeys(char c, int start, int end) } void -rhack(cmd) -register char *cmd; +rhack(register char *cmd) { int spkey = -1; boolean do_walk, do_rush, prefix_seen, bad_command, @@ -3740,7 +3680,7 @@ register char *cmd; if (prefix_seen && cmd[0] == Cmd.spkeys[NHKF_REQMENU]) { /* (for func_tab cast, see below) */ const struct ext_func_tab *ft = Cmd.commands[cmd[1] & 0xff]; - int (*func)() = ft ? ((struct ext_func_tab *) ft)->ef_funct : 0; + int (*func)(void) = ft ? ((struct ext_func_tab *) ft)->ef_funct : 0; if (func && accept_menu_prefix(func)) { iflags.menu_requested = TRUE; @@ -3773,7 +3713,7 @@ register char *cmd; /* handle all other commands */ } else { const struct ext_func_tab *tlist; - int res, (*func)(); + int res, (*func)(void); /* current - use *cmd to directly index cmdlist array */ if ((tlist = Cmd.commands[*cmd & 0xff]) != 0) { @@ -3834,8 +3774,7 @@ register char *cmd; /* convert an x,y pair into a direction code */ int -xytod(x, y) -schar x, y; +xytod(schar x, schar y) { register int dd; @@ -3847,9 +3786,7 @@ schar x, y; /* convert a direction code into an x,y pair */ void -dtoxy(cc, dd) -coord *cc; -register int dd; +dtoxy(coord *cc, register int dd) { cc->x = xdir[dd]; cc->y = ydir[dd]; @@ -3858,8 +3795,7 @@ register int dd; /* also sets u.dz, but returns false for <> */ int -movecmd(sym) -char sym; +movecmd(char sym) { // TODO const char *dp; @@ -3883,7 +3819,7 @@ char sym; /* grid bug handling which used to be in movecmd() */ int -dxdy_moveok() +dxdy_moveok(void) { if (u.dx && u.dy && NODIAG(u.umonnum)) u.dx = u.dy = 0; @@ -3892,16 +3828,14 @@ dxdy_moveok() /* decide whether a character (user input keystroke) requests screen repaint */ boolean -redraw_cmd(c) -char c; +redraw_cmd(char c) { return (c == Cmd.spkeys[NHKF_REDRAW] || (Cmd.num_pad && c == Cmd.spkeys[NHKF_REDRAW2])); } boolean -prefix_cmd(c) -char c; +prefix_cmd(char c) { return (c == Cmd.spkeys[NHKF_RUSH] || c == Cmd.spkeys[NHKF_RUN] || @@ -3923,10 +3857,7 @@ char c; * Returns non-zero if coordinates in cc are valid. */ int -get_adjacent_loc(prompt, emsg, x, y, cc) -const char *prompt, *emsg; -xchar x, y; -coord *cc; +get_adjacent_loc(const char *prompt, const char *emsg, xchar x, xchar y, coord *cc) { xchar new_x, new_y; if (!getdir(prompt)) { @@ -3946,8 +3877,7 @@ coord *cc; } int -getdir(s) -const char *s; +getdir(const char *s) { char dirsym; int is_mov; @@ -4009,10 +3939,10 @@ const char *s; } static void -show_direction_keys(win, centerchar, nodiag) -winid win; /* should specify a window which is using a fixed-width font... */ -char centerchar; /* '.' or '@' or ' ' */ -boolean nodiag; +show_direction_keys(winid win, char centerchar, boolean nodiag) + /* should specify a window which is using a fixed-width font... */ + /* '.' or '@' or ' ' */ + { char buf[BUFSZ]; @@ -4045,10 +3975,10 @@ boolean nodiag; an invalid direction after a prefix key ('F', 'g', 'm', &c), which might be bogus but could be up, down, or self when not applicable */ static boolean -help_dir(sym, spkey, msg) -char sym; -int spkey; /* NHKF_ code for prefix key, if one was used, or for ESC */ -const char *msg; +help_dir( + char sym, + uchar spkey, /* actual key; either prefix or ESC */ + const char *msg) { char ctrl; winid win; @@ -4194,7 +4124,7 @@ const char *msg; } void -confdir() +confdir(void) { int x = NODIAG(u.umonnum) ? 2 * rn2(4) : rn2(8); @@ -4204,8 +4134,7 @@ confdir() } const char * -directionname(dir) -int dir; +directionname(int dir) { static NEARDATA const char *const dirnames[] = { "west", "northwest", "north", "northeast", "east", @@ -4219,8 +4148,7 @@ int dir; } int -isok(x, y) -register int x, y; +isok(register int x, register int y) { /* x corresponds to curx, so x==1 is the first column. Ach. %% */ return x >= 1 && x <= COLNO-1 && y >= 0 && y <= ROWNO-1; @@ -4228,7 +4156,7 @@ register int x, y; /* #herecmdmenu command */ static int -doherecmdmenu() +doherecmdmenu(void) { char ch = here_cmd_menu(TRUE); @@ -4237,7 +4165,7 @@ doherecmdmenu() /* #therecmdmenu command, a way to test there_cmd_menu without mouse */ static int -dotherecmdmenu() +dotherecmdmenu(void) { char ch; @@ -4255,10 +4183,7 @@ dotherecmdmenu() } static void -add_herecmd_menuitem(win, func, text) -winid win; -int (*func)(); -const char *text; +add_herecmd_menuitem(winid win, int (*func)(void), const char *text) { char ch; anything any; @@ -4271,9 +4196,7 @@ const char *text; } static char -there_cmd_menu(doit, x, y) -boolean doit; -int x, y; +there_cmd_menu(boolean doit, int x, int y) { winid win; char ch; @@ -4354,7 +4277,7 @@ int x, y; destroy_nhwindow(win); ch = '\0'; if (npick > 0) { - int (*func)() = picks->item.a_nfunc; + int (*func)(void) = picks->item.a_nfunc; free(picks); if (doit) { @@ -4369,8 +4292,7 @@ int x, y; } static char -here_cmd_menu(doit) -boolean doit; +here_cmd_menu(boolean doit) { winid win; char ch; @@ -4451,7 +4373,7 @@ boolean doit; destroy_nhwindow(win); ch = '\0'; if (npick > 0) { - int (*func)() = picks->item.a_nfunc; + int (*func)(void) = picks->item.a_nfunc; free(picks); if (doit) { @@ -4471,8 +4393,7 @@ static NEARDATA int last_multi; * convert a MAP window position into a movecmd */ const char * -click_to_cmd(x, y, mod) -int x, y, mod; +click_to_cmd(int x, int y, int mod) { int dir; static char cmd[4]; @@ -4599,12 +4520,12 @@ int x, y, mod; } char -get_count(allowchars, inkey, maxcount, count, historical) -char *allowchars; -char inkey; -long maxcount; -long *count; -boolean historical; /* whether to include in message history: True => yes */ +get_count( + const char *allowchars, /**< what comes after digits; if NULL, anything */ + char inkey, /**< if caller already got first digit, this is it */ + long maxcount, /**< if user tries to enter a bigger count, use this */ + long int *count, /**< primary output */ + boolean historical) /**< whether to include in message history: TRUE => yes */ { char qbuf[QBUFSZ]; int key; @@ -4663,7 +4584,7 @@ boolean historical; /* whether to include in message history: True => yes */ } static char * -parse() +parse(void) { #ifdef LINT /* static char in_line[COLNO]; */ char in_line[COLNO]; @@ -4760,7 +4681,7 @@ parse() #ifdef UNIX static void -end_of_input() +end_of_input(void) { #ifdef NOSAVEONHANGUP #ifdef INSURANCE @@ -4790,7 +4711,7 @@ end_of_input() #endif /* HANGUPHANDLING */ char -readchar() +readchar(void) { register int sym; int x = u.ux, y = u.uy, mod = 0; @@ -4917,7 +4838,7 @@ do_stair_travel(char up_or_down) /** '_' command, #travel, via keyboard rather than mouse click */ static int -dotravel() +dotravel(void) { /* Keyboard travel command */ static char cmd[2]; @@ -4970,7 +4891,7 @@ dotravel() } static int -doautoexplore() +doautoexplore(void) { static char cmd[2]; iflags.autoexplore = TRUE; @@ -4981,7 +4902,7 @@ doautoexplore() /** Chooses a suitable monster and fights it. */ static int -doautofight() +doautofight(void) { int i, j; struct monst *mtmp; @@ -5061,9 +4982,7 @@ wiz_port_debug() * window port causing a buffer overflow there. */ char -yn_function(query, resp, def) -const char *query, *resp; -char def; +yn_function(const char *query, const char *resp, char def) { char res, qbuf[QBUFSZ]; @@ -5087,9 +5006,7 @@ char def; * @return 'y' or 'n' */ char -paranoid_yn(query, paranoid) -const char *query; -boolean paranoid; +paranoid_yn(const char *query, boolean paranoid) { if (paranoid) { char buf[BUFSZ]; @@ -5106,7 +5023,7 @@ boolean paranoid; /* ^Z command, #suspend */ static int -dosuspend_core() +dosuspend_core(void) { #if NEXT_VERSION #ifdef SUSPEND @@ -5130,7 +5047,7 @@ dosuspend_core() * Stops tracking after the player found the sokoban prize. */ void -sokoban_trickster() +sokoban_trickster(void) { #ifdef RECORD_ACHIEVE if (In_sokoban(&u.uz)) { @@ -5147,7 +5064,7 @@ sokoban_trickster() } static int -debug_show_colors() +debug_show_colors(void) { // TODO should be (*windowprocs.tty_debug_show_colors)(); #ifdef TTY_GRAPHICS diff --git a/src/dbridge.c b/src/dbridge.c index 1bcd32618..72bb00f6e 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -28,13 +28,12 @@ static const char *E_phrase(struct entity *, const char *); static boolean e_survives_at(struct entity *, int, int); static void e_died(struct entity *, int, int); static boolean automiss(struct entity *); -static boolean e_missed(struct entity *, BOOLEAN_P); +static boolean e_missed(struct entity *, boolean); static boolean e_jumps(struct entity *); static void do_entity(struct entity *); boolean -is_pool(x, y) -int x, y; +is_pool(int x, int y) { schar ltyp; @@ -50,8 +49,7 @@ int x, y; } boolean -is_lava(x, y) -int x, y; +is_lava(int x, int y) { schar ltyp; @@ -64,8 +62,7 @@ int x, y; } boolean -is_pool_or_lava(x, y) -int x, y; +is_pool_or_lava(int x, int y) { if (is_pool(x, y) || is_lava(x, y)) { return TRUE; @@ -75,8 +72,7 @@ int x, y; } boolean -is_any_icewall(x, y) -int x, y; +is_any_icewall(int x, int y) { if (!isok(x, y)) return FALSE; if (IS_ANY_ICEWALL(levl[x][y].typ)) @@ -85,8 +81,7 @@ int x, y; } boolean -is_ice(x, y) -int x, y; +is_ice(int x, int y) { schar ltyp; @@ -99,8 +94,7 @@ int x, y; } boolean -is_swamp(x, y) -int x, y; +is_swamp(int x, int y) { schar ltyp; @@ -114,8 +108,7 @@ int x, y; } boolean -is_moat(x, y) -int x, y; +is_moat(int x, int y) { schar ltyp; @@ -156,8 +149,7 @@ db_under_typ(struct rm *lev) */ int -is_drawbridge_wall(x, y) -int x, y; +is_drawbridge_wall(int x, int y) { struct rm *lev; @@ -187,8 +179,7 @@ int x, y; * (instead of UP or DOWN, as with is_drawbridge_wall). */ boolean -is_db_wall(x, y) -int x, y; +is_db_wall(int x, int y) { return((boolean)( levl[x][y].typ == DBWALL )); } @@ -198,8 +189,7 @@ int x, y; * a drawbridge or drawbridge wall. */ boolean -find_drawbridge(x, y) -int *x, *y; +find_drawbridge(int *x, int *y) { int dir; @@ -222,8 +212,7 @@ int *x, *y; * Find the drawbridge wall associated with a drawbridge. */ static void -get_wall_for_db(x, y) -int *x, *y; +get_wall_for_db(int *x, int *y) { switch (levl[*x][*y].drawbridgemask & DB_DIR) { case DB_NORTH: (*y)--; break; @@ -239,9 +228,7 @@ int *x, *y; * flag must be put to TRUE if we want the drawbridge to be opened. */ boolean -create_drawbridge(x, y, dir, flag) -int x, y, dir; -int flag; +create_drawbridge(int x, int y, int dir, int flag) { int x2, y2; boolean horiz; @@ -300,8 +287,7 @@ struct entity { static NEARDATA struct entity occupants[ENTITIES]; static struct entity * -e_at(x, y) -int x, y; +e_at(int x, int y) { int entitycnt; @@ -319,10 +305,7 @@ int x, y; } static void -m_to_e(mtmp, x, y, etmp) -struct monst *mtmp; -int x, y; -struct entity *etmp; +m_to_e(struct monst *mtmp, int x, int y, struct entity *etmp) { etmp->emon = mtmp; if (mtmp) { @@ -337,8 +320,7 @@ struct entity *etmp; } static void -u_to_e(etmp) -struct entity *etmp; +u_to_e(struct entity *etmp) { etmp->emon = &youmonst; etmp->ex = u.ux; @@ -347,9 +329,7 @@ struct entity *etmp; } static void -set_entity(x, y, etmp) -int x, y; -struct entity *etmp; +set_entity(int x, int y, struct entity *etmp) { if ((x == u.ux) && (y == u.uy)) u_to_e(etmp); @@ -370,8 +350,7 @@ struct entity *etmp; /* #define e_strg(etmp, func) (is_u(etmp)? (char *)0 : func(etmp->emon)) */ static const char * -e_nam(etmp) -struct entity *etmp; +e_nam(struct entity *etmp) { return(is_u(etmp) ? "you" : mon_nam(etmp->emon)); } @@ -381,9 +360,7 @@ struct entity *etmp; * verb, where necessary. */ static const char * -E_phrase(etmp, verb) -struct entity *etmp; -const char *verb; +E_phrase(struct entity *etmp, const char *verb) { static char wholebuf[80]; @@ -403,9 +380,7 @@ const char *verb; * Simple-minded "can it be here?" routine */ static boolean -e_survives_at(etmp, x, y) -struct entity *etmp; -int x, y; +e_survives_at(struct entity *etmp, int x, int y) { if (noncorporeal(etmp->edata)) return(TRUE); @@ -426,9 +401,7 @@ int x, y; } static void -e_died(etmp, xkill_flags, how) -struct entity *etmp; -int xkill_flags, how; +e_died(struct entity *etmp, int xkill_flags, int how) { if (is_u(etmp)) { if (how == DROWNING) { @@ -489,8 +462,7 @@ int xkill_flags, how; * These are never directly affected by a bridge or portcullis. */ static boolean -automiss(etmp) -struct entity *etmp; +automiss(struct entity *etmp) { return (boolean)((is_u(etmp) ? Passes_walls : passes_walls(etmp->edata)) || noncorporeal(etmp->edata)); @@ -500,9 +472,7 @@ struct entity *etmp; * Does falling drawbridge or portcullis miss etmp? */ static boolean -e_missed(etmp, chunks) -struct entity *etmp; -boolean chunks; +e_missed(struct entity *etmp, boolean chunks) { int misses; @@ -537,8 +507,7 @@ boolean chunks; * Can etmp jump from death? */ static boolean -e_jumps(etmp) -struct entity *etmp; +e_jumps(struct entity *etmp) { int tmp = 4; /* out of 10 */ @@ -562,8 +531,7 @@ struct entity *etmp; } static void -do_entity(etmp) -struct entity *etmp; +do_entity(struct entity *etmp) { int newx, newy, at_portcullis, oldx, oldy; boolean must_jump = FALSE, relocates = FALSE, e_inview; @@ -777,8 +745,7 @@ struct entity *etmp; * @return TRUE when drawbridge got closed, FALSE otherwise */ boolean -close_drawbridge(x, y) -int x, y; +close_drawbridge(int x, int y) { register struct rm *lev1, *lev2; struct trap *t; @@ -848,8 +815,7 @@ int x, y; * Open the drawbridge located at x,y */ void -open_drawbridge(x, y) -int x, y; +open_drawbridge(int x, int y) { register struct rm *lev1, *lev2; struct trap *t; @@ -893,8 +859,7 @@ int x, y; * Let's destroy the drawbridge located at x,y */ void -destroy_drawbridge(x, y) -int x, y; +destroy_drawbridge(int x, int y) { register struct rm *lev1, *lev2; struct trap *t; diff --git a/src/decl.c b/src/decl.c index 5b20bcb47..be2dec33d 100644 --- a/src/decl.c +++ b/src/decl.c @@ -343,7 +343,7 @@ boolean curses_stupid_hack = 1; /* dummy routine used to force linkage */ void -decl_init() +decl_init(void) { return; } diff --git a/src/detect.c b/src/detect.c index 17f849f57..f1ac3c763 100644 --- a/src/detect.c +++ b/src/detect.c @@ -12,9 +12,9 @@ extern boolean known; /* from read.c */ static void do_dknown_of(struct obj *); -static boolean check_map_spot(int, int, CHAR_P, unsigned); -static boolean clear_stale_map(CHAR_P, unsigned); -static void sense_trap(struct trap *, XCHAR_P, XCHAR_P, int); +static boolean check_map_spot(int, int, char, unsigned); +static boolean clear_stale_map(char, unsigned); +static void sense_trap(struct trap *, xchar, xchar, int); static void show_map_spot(int, int); static void findone(int, int, genericptr_t); static void openone(int, int, genericptr_t); @@ -22,7 +22,7 @@ static void openone(int, int, genericptr_t); /* bring hero out from underwater or underground or being engulfed; return True iff any change occurred */ static boolean -unconstrain_map() +unconstrain_map(void) { boolean res = u.uinwater || u.uburied || u.uswallow; @@ -36,7 +36,7 @@ unconstrain_map() /* put hero back underwater or underground or engulfed */ static void -reconstrain_map() +reconstrain_map(void) { u.uinwater = iflags.save_uinwater, iflags.save_uinwater = 0; u.uburied = iflags.save_uburied, iflags.save_uburied = 0; @@ -45,9 +45,7 @@ reconstrain_map() /* use getpos()'s 'autodescribe' to view whatever is currently shown on map */ static void -browse_map(ter_typ, ter_explain) -int ter_typ; -const char *ter_explain; +browse_map(int ter_typ, const char *ter_explain) { coord dummy_pos; /* don't care whether player actually picks a spot */ boolean save_autodescribe; @@ -63,9 +61,7 @@ const char *ter_explain; /* extracted from monster_detection() so can be shared by do_vicinity_map() */ static void -map_monst(mtmp, showtail) -struct monst *mtmp; -boolean showtail; +map_monst(struct monst *mtmp, boolean showtail) { if (def_monsyms[(int) mtmp->data->mlet] == ' ') { show_glyph(mtmp->mx, mtmp->my, detected_mon_to_glyph(mtmp)); @@ -82,9 +78,7 @@ boolean showtail; /* this is checking whether a trap symbol represents a trapped chest, not whether a trapped chest is actually present */ boolean -trapped_chest_at(ttyp, x, y) -int ttyp; -int x, y; +trapped_chest_at(int ttyp, int x, int y) { struct monst *mtmp; struct obj *otmp; @@ -138,9 +132,7 @@ int x, y; /* this is checking whether a trap symbol represents a trapped door, not whether the door here is actually trapped */ boolean -trapped_door_at(ttyp, x, y) -int ttyp; -int x, y; +trapped_door_at(int ttyp, int x, int y) { struct rm *lev; @@ -162,9 +154,7 @@ int x, y; /* Recursively search obj for an object in class oclass and return 1st found */ struct obj * -o_in(obj, oclass) -struct obj* obj; -char oclass; +o_in(struct obj *obj, char oclass) { register struct obj* otmp; struct obj *temp; @@ -189,9 +179,7 @@ char oclass; /* Recursively search obj for an object made of specified material and return 1st found */ struct obj * -o_material(obj, material) -struct obj* obj; -unsigned material; +o_material(struct obj *obj, unsigned int material) { register struct obj* otmp; struct obj *temp; @@ -208,8 +196,7 @@ unsigned material; } static void -do_dknown_of(obj) -struct obj *obj; +do_dknown_of(struct obj *obj) { struct obj *otmp; @@ -222,10 +209,7 @@ struct obj *obj; /* Check whether the location has an outdated object displayed on it. */ static boolean -check_map_spot(x, y, oclass, material) -int x, y; -char oclass; -unsigned material; +check_map_spot(int x, int y, char oclass, unsigned int material) { int glyph; register struct obj *otmp; @@ -276,9 +260,7 @@ unsigned material; change occurs. */ static boolean -clear_stale_map(oclass, material) -char oclass; -unsigned material; +clear_stale_map(char oclass, unsigned int material) { register int zx, zy; boolean change_made = FALSE; @@ -295,8 +277,7 @@ unsigned material; /* look for gold, on the floor or in monsters' possession */ int -gold_detect(sobj) -register struct obj *sobj; +gold_detect(register struct obj *sobj) { register struct obj *obj; register struct monst *mtmp; @@ -449,8 +430,7 @@ register struct obj *sobj; /* returns 1 if nothing was detected */ /* returns 0 if something was detected */ int -food_detect(sobj) -register struct obj *sobj; +food_detect(register struct obj *sobj) { register struct obj *obj; register struct monst *mtmp; @@ -577,10 +557,10 @@ register struct obj *sobj; * 0 - something was detected */ int -object_detect(detector, class, quiet) -struct obj *detector; /* object doing the detecting */ -int class; /* an object class, 0 for all */ -boolean quiet; /* don't output any message */ +object_detect( + struct obj *detector, /**< object doing the detecting */ + int class, /**< an object class, 0 for all */ + boolean quiet) /**< don't output any message */ { register int x, y; char stuff[BUFSZ]; @@ -765,9 +745,9 @@ boolean quiet; /* don't output any message */ * Returns 0 if something was detected. */ int -monster_detect(otmp, mclass) -register struct obj *otmp; /* detecting object (if any) */ -int mclass; /* monster class, 0 for all */ +monster_detect( + struct obj *otmp, /**< detecting object (if any) */ + int mclass) /**< monster class, 0 for all */ { register struct monst *mtmp; int mcnt = 0; @@ -837,10 +817,7 @@ int mclass; /* monster class, 0 for all */ } static void -sense_trap(trap, x, y, src_cursed) -struct trap *trap; -xchar x, y; -int src_cursed; +sense_trap(struct trap *trap, xchar x, xchar y, int src_cursed) { if (Hallucination || src_cursed) { struct obj obj; /* fake object */ @@ -882,10 +859,10 @@ int src_cursed; 2 if found at some other spot, 3 if both, 0 otherwise; optionally update the map to show where such traps were found */ static int -detect_obj_traps(objlist, show_them, how) -struct obj *objlist; -boolean show_them; -int how; /* 1 for misleading map feedback */ +detect_obj_traps( + struct obj *objlist, + boolean show_them, + int how) /**< 1 for misleading map feedback */ { struct obj *otmp; xchar x, y; @@ -916,8 +893,7 @@ int how; /* 1 for misleading map feedback */ /* returns 1 if nothing was detected */ /* returns 0 if something was detected */ int -trap_detect(sobj) -struct obj *sobj; /**< sobj is null if crystal ball, *scroll if gold detection scroll */ +trap_detect(struct obj *sobj) /**< sobj is null if crystal ball, *scroll if gold detection scroll */ { register struct trap *ttmp; struct monst *mon; @@ -1031,8 +1007,7 @@ struct obj *sobj; /**< sobj is null if crystal ball, *scroll if gold detection s } const char * -level_distance(where) -d_level *where; +level_distance(d_level *where) { register schar ll = depth(&u.uz) - depth(where); register boolean indun = (u.uz.dnum == where->dnum); @@ -1073,8 +1048,7 @@ static const struct { }; void -use_crystal_ball(optr) -struct obj **optr; +use_crystal_ball(struct obj **optr) { char ch; int oops; @@ -1196,8 +1170,7 @@ struct obj **optr; } static void -show_map_spot(x, y) -register int x, y; +show_map_spot(register int x, register int y) { struct rm *lev; struct trap *t; @@ -1241,7 +1214,7 @@ register int x, y; } void -do_mapping() +do_mapping(void) { register int zx, zy; boolean unconstrained; @@ -1264,7 +1237,7 @@ do_mapping() /* clairvoyance */ void -do_vicinity_map() +do_vicinity_map(void) { register int zx, zy; int lo_y = (u.uy-5 < 0 ? 0 : u.uy-5), @@ -1285,8 +1258,7 @@ do_vicinity_map() /* convert a secret door into a normal door */ void -cvt_sdoor_to_door(lev) -struct rm *lev; +cvt_sdoor_to_door(struct rm *lev) { int newmask = lev->doormask & ~WM_MASK; @@ -1306,9 +1278,7 @@ struct rm *lev; /* find something at one location; it should find all somethings there since it is used for magical detection rather than physical searching */ static void -findone(zx, zy, num) -int zx, zy; -genericptr_t num; +findone(int zx, int zy, genericptr_t num) { register struct trap *ttmp; register struct monst *mtmp; @@ -1364,9 +1334,7 @@ genericptr_t num; } static void -openone(zx, zy, num) -int zx, zy; -genericptr_t num; +openone(int zx, int zy, genericptr_t num) { register struct trap *ttmp; register struct obj *otmp; @@ -1418,7 +1386,7 @@ genericptr_t num; /* returns number of things found */ int -findit() +findit(void) { int num = 0; @@ -1429,7 +1397,7 @@ findit() /* returns number of things found and opened */ int -openit() +openit(void) { int num = 0; @@ -1448,15 +1416,13 @@ openit() /* callback hack for overriding vision in do_clear_area() */ boolean -detecting(func) -void (*func)(int, int, void *); +detecting(void (*func) (int, int, void *)) { return (func == findone || func == openone); } void -find_trap(trap) -struct trap *trap; +find_trap(struct trap *trap) { int tt = what_trap(trap->ttyp); boolean cleared = FALSE; @@ -1482,9 +1448,7 @@ struct trap *trap; } static int -mfind0(mtmp, via_warning) -struct monst *mtmp; -boolean via_warning; +mfind0(struct monst *mtmp, boolean via_warning) { int x = mtmp->mx, y = mtmp->my; boolean found_something = FALSE; @@ -1534,8 +1498,7 @@ boolean via_warning; } int -dosearch0(aflag) -int aflag; /* intrinsic autosearch vs explicit searching */ +dosearch0(int aflag) /**< intrinsic autosearch vs explicit searching */ { #ifdef GCC_BUG /* some versions of gcc seriously muck up nested loops. if you get strange @@ -1619,13 +1582,13 @@ int aflag; /* intrinsic autosearch vs explicit searching */ /* the 's' command -- explicit searching */ int -dosearch() +dosearch(void) { return(dosearch0(0)); } void -warnreveal() +warnreveal(void) { int x, y; struct monst *mtmp; @@ -1644,7 +1607,7 @@ warnreveal() /* Pre-map the sokoban levels */ void -sokoban_detect() +sokoban_detect(void) { register int x, y; register struct trap *ttmp; @@ -1676,10 +1639,7 @@ sokoban_detect() } static int -reveal_terrain_getglyph(x, y, full, swallowed, default_glyph, which_subset) -int x, y, full; -unsigned swallowed; -int default_glyph, which_subset; +reveal_terrain_getglyph(int x, int y, int full, unsigned int swallowed, int default_glyph, int which_subset) { int glyph, levl_glyph; uchar seenv; @@ -1758,9 +1718,9 @@ int default_glyph, which_subset; /* idea from crawl; show known portion of map without any monsters, objects, or traps occluding the view of the underlying terrain */ void -reveal_terrain(full, which_subset) -int full; /* wizard|explore modes allow player to request full map */ -int which_subset; /* when not full, whether to suppress objs and/or traps */ +reveal_terrain( + int full, /**< wizard|explore modes allow player to request full map */ + int which_subset) /**< if not full, whether to suppress objs and/or traps */ { if ((Hallucination || Stunned || Confusion) && !full) { You("are too disoriented for this."); diff --git a/src/dig.c b/src/dig.c index 6226db74d..3918f68c8 100644 --- a/src/dig.c +++ b/src/dig.c @@ -5,12 +5,12 @@ static NEARDATA boolean did_dig_msg; -static boolean rm_waslit(); -static void mkcavepos(XCHAR_P, XCHAR_P, int, BOOLEAN_P, BOOLEAN_P); -static void mkcavearea(BOOLEAN_P); -static int dig(); +static boolean rm_waslit(void); +static void mkcavepos(xchar, xchar, int, boolean, boolean); +static void mkcavearea(boolean); +static int dig(void); static int adj_pit_checks(coord *, char *); -static void pit_flow(struct trap *, SCHAR_P); +static void pit_flow(struct trap *, schar); enum grave_type { GRAVE_NORMAL = 0, @@ -32,7 +32,7 @@ enum dig_types { }; static boolean -rm_waslit() +rm_waslit(void) { register xchar x, y; @@ -53,10 +53,7 @@ rm_waslit() * immediately after the effect is complete. */ static void -mkcavepos(x, y, dist, waslit, rockit) -xchar x, y; -int dist; -boolean waslit, rockit; +mkcavepos(xchar x, xchar y, int dist, boolean waslit, boolean rockit) { register struct rm *lev; @@ -105,8 +102,7 @@ boolean waslit, rockit; } static void -mkcavearea(rockit) -register boolean rockit; +mkcavearea(register boolean rockit) { int dist; xchar xmin = u.ux, xmax = u.ux; @@ -159,9 +155,7 @@ register boolean rockit; /* When digging into location , what are you actually digging into? */ int -dig_typ(otmp, x, y) -struct obj *otmp; -xchar x, y; +dig_typ(struct obj *otmp, xchar x, xchar y) { boolean ispick; @@ -187,7 +181,7 @@ xchar x, y; } boolean -is_digging() +is_digging(void) { if (occupation == dig) { return TRUE; @@ -199,10 +193,7 @@ is_digging() #define BY_OBJECT ((struct monst *)0) boolean -dig_check(madeby, verbose, x, y) -struct monst *madeby; -boolean verbose; -int x, y; +dig_check(struct monst *madeby, boolean verbose, int x, int y) { struct trap *ttmp = t_at(x, y); const char *verb = (madeby == BY_YOU && uwep && is_axe(uwep)) ? "chop" : "dig in"; @@ -273,7 +264,7 @@ int x, y; } static int -dig() +dig(void) { register struct rm *lev; register xchar dpx = digging.pos.x, dpy = digging.pos.y; @@ -583,7 +574,7 @@ dig() /* When will hole be finished? Very rough indication used by shopkeeper. */ int -holetime() +holetime(void) { if (occupation != dig || !*u.ushops) { return -1; @@ -593,9 +584,10 @@ holetime() /* Return typ of liquid to fill a hole with, or ROOM, if no liquid nearby */ schar -fillholetyp(x, y, fill_if_any) -int x, y; -boolean fill_if_any; /* force filling if it exists at all */ +fillholetyp( + int x, + int y, + boolean fill_if_any) /**< force filling if it exists at all */ { register int x1, y1; int lo_x = max(1, x-1), hi_x = min(x+1, COLNO-1), @@ -638,10 +630,7 @@ boolean fill_if_any; /* force filling if it exists at all */ } void -digactualhole(x, y, madeby, ttyp) -register int x, y; -struct monst *madeby; -int ttyp; +digactualhole(register int x, register int y, struct monst *madeby, int ttyp) { struct obj *oldobjs, *newobjs; register struct trap *ttmp; @@ -863,11 +852,7 @@ int ttyp; * in apply.c. */ void -liquid_flow(x, y, typ, ttmp, fillmsg) -xchar x, y; -schar typ; -struct trap *ttmp; -const char *fillmsg; +liquid_flow(xchar x, xchar y, schar typ, struct trap *ttmp, const char *fillmsg) { boolean u_spot = (x == u.ux && y == u.uy); @@ -891,9 +876,7 @@ const char *fillmsg; /* return TRUE if digging succeeded, FALSE otherwise */ boolean -dighole(pit_only, by_magic, cc) -boolean pit_only, by_magic; -coord *cc; +dighole(boolean pit_only, boolean by_magic, coord *cc) { register struct trap *ttmp; struct rm *lev; @@ -1135,8 +1118,7 @@ dig_up_grave(coord *cc, enum grave_type type) } int -use_pick_axe(obj) -struct obj *obj; +use_pick_axe(struct obj *obj) { const char *sdp, *verb; char *dsp, dirsyms[12], qbuf[BUFSZ]; @@ -1207,8 +1189,7 @@ struct obj *obj; /* use_pick_axe2() uses the existing u.dx, u.dy and u.dz */ int -use_pick_axe2(obj) -struct obj *obj; +use_pick_axe2(struct obj *obj) { register int rx, ry; register struct rm *lev; @@ -1404,10 +1385,7 @@ struct obj *obj; * zap == TRUE if wand/spell of digging, FALSE otherwise (chewing) */ void -watch_dig(mtmp, x, y, zap) -struct monst *mtmp; -xchar x, y; -boolean zap; +watch_dig(struct monst *mtmp, xchar x, xchar y, boolean zap) { struct rm *lev = &levl[x][y]; @@ -1461,8 +1439,7 @@ boolean zap; /* Return TRUE if monster died, FALSE otherwise. Called from m_move(). */ boolean -mdig_tunnel(mtmp) -register struct monst *mtmp; +mdig_tunnel(register struct monst *mtmp) { register struct rm *here; int pile = rnd(12); @@ -1567,8 +1544,7 @@ register struct monst *mtmp; /* draft refers to air currents, but can be a pun on "draft" as conscription for military service (probably not a good pun if it has to be explained) */ void -draft_message(unexpected) -boolean unexpected; +draft_message(boolean unexpected) { /* * [Bug or TODO? Have caller pass coordinates and use the travel @@ -1613,7 +1589,7 @@ boolean unexpected; /* digging via wand zap or spell cast */ void -zap_dig() +zap_dig(void) { struct rm *room; struct monst *mtmp; @@ -1865,9 +1841,7 @@ zap_dig() * down in the pit. */ static int -adj_pit_checks(cc, msg) -coord *cc; -char *msg; +adj_pit_checks(coord *cc, char *msg) { int ltyp; struct rm *room; @@ -1960,9 +1934,7 @@ char *msg; * Ensure that all conjoined pits fill up. */ static void -pit_flow(trap, filltyp) -struct trap *trap; -schar filltyp; +pit_flow(struct trap *trap, schar filltyp) { if (trap && filltyp != ROOM && is_pit(trap->ttyp)) { struct trap t; @@ -1998,8 +1970,7 @@ schar filltyp; } struct obj * -buried_ball(cc) -coord *cc; +buried_ball(coord *cc) { int odist, bdist = COLNO; struct obj *otmp, *ball = 0; @@ -2048,7 +2019,7 @@ coord *cc; } void -buried_ball_to_punishment() +buried_ball_to_punishment(void) { coord cc; struct obj *ball; @@ -2072,7 +2043,7 @@ buried_ball_to_punishment() } void -buried_ball_to_freedom() +buried_ball_to_freedom(void) { coord cc; struct obj *ball; @@ -2099,9 +2070,9 @@ buried_ball_to_freedom() /* move objects from fobj/nexthere lists to buriedobjlist, keeping position information */ struct obj * -bury_an_obj(otmp, dealloced) -struct obj *otmp; -boolean *dealloced; /* return TRUE if otmp was freed */ +bury_an_obj( + struct obj *otmp, + boolean *dealloced) /**< return TRUE if otmp was freed */ { struct obj *otmp2; boolean under_ice; @@ -2165,8 +2136,7 @@ boolean *dealloced; /* return TRUE if otmp was freed */ } void -bury_objs(x, y) -int x, y; +bury_objs(int x, int y) { struct obj *otmp, *otmp2; struct monst *shkp; @@ -2201,8 +2171,7 @@ int x, y; /* move objects from buriedobjlist to fobj/nexthere lists */ void -unearth_objs(x, y) -int x, y; +unearth_objs(int x, int y) { struct obj *otmp, *otmp2, *bball; coord cc; @@ -2242,9 +2211,7 @@ int x, y; */ /* ARGSUSED */ void -rot_organic(arg, timeout) -anything *arg; -long timeout UNUSED; +rot_organic(anything *arg, long int timeout UNUSED) { struct obj *obj = arg->a_obj; @@ -2265,9 +2232,7 @@ long timeout UNUSED; * Called when a corpse has rotted completely away. */ void -rot_corpse(arg, timeout) -anything *arg; -long timeout; /* unused */ +rot_corpse(anything *arg, long int timeout UNUSED) { xchar x = 0, y = 0; struct obj *obj = arg->a_obj; diff --git a/src/display.c b/src/display.c index d9904ca59..d7e9946a7 100644 --- a/src/display.c +++ b/src/display.c @@ -123,12 +123,12 @@ #include "hack.h" static void show_mon_or_warn(int, int, int); -static void display_monster(XCHAR_P, XCHAR_P, struct monst *, int, XCHAR_P); +static void display_monster(xchar, xchar, struct monst *, int, xchar); static int swallow_to_glyph(int, int); static void display_warning(struct monst *); static int check_pos(int, int, int); -static int get_bk_glyph(XCHAR_P, XCHAR_P); +static int get_bk_glyph(xchar, xchar); static int tether_glyph(int, int); #ifdef WA_VERBOSE static boolean more_than_one(int, int, int, int, int); @@ -155,9 +155,7 @@ is_safemon(struct monst *mon) * attention to and correct unexplored, lit ROOM and CORR spots. */ void -magic_map_background(x, y, show) -xchar x, y; -int show; +magic_map_background(xchar x, xchar y, int show) { int glyph = back_to_glyph(x, y); /* assumes hero can see x,y */ struct rm *lev = &levl[x][y]; @@ -201,9 +199,7 @@ int show; * the hero can physically see the location. Update the screen if directed. */ void -map_background(x, y, show) -register xchar x, y; -register int show; +map_background(register xchar x, register xchar y, register int show) { register int glyph = back_to_glyph(x, y); @@ -219,9 +215,7 @@ register int show; * hero can physically see the location. */ void -map_trap(trap, show) -register struct trap *trap; -register int show; +map_trap(register struct trap *trap, register int show) { register int x = trap->tx, y = trap->ty; register int glyph = trap_to_glyph(trap); @@ -240,9 +234,7 @@ register int show; * see the location of the object. Update the screen if directed. */ void -map_object(obj, show) -register struct obj *obj; -register int show; +map_object(register struct obj *obj, register int show) { register int x = obj->ox, y = obj->oy; register int glyph = obj_to_glyph(obj); @@ -272,8 +264,7 @@ register int show; * by newsym() if necessary. */ void -map_invisible(x, y) -register xchar x, y; +map_invisible(register xchar x, register xchar y) { assert_valid_coordinates(x, y); @@ -285,8 +276,7 @@ register xchar x, y; } boolean -unmap_invisible(x, y) -int x, y; +unmap_invisible(int x, int y) { if (isok(x,y) && glyph_is_invisible(levl[x][y].glyph)) { unmap_object(x, y); @@ -306,8 +296,7 @@ int x, y; * to call newsym(). */ void -unmap_object(x, y) -register int x, y; +unmap_object(register int x, register int y) { register struct trap *trap; @@ -367,8 +356,7 @@ vobj_at(int x, int y) } void -map_location(x, y, show) -int x, y, show; +map_location(int x, int y, int show) { assert_valid_coordinates(x, y); _map_location(x, y, show); @@ -376,8 +364,7 @@ int x, y, show; /* display something on monster layer; may need to fixup object layer */ static void -show_mon_or_warn(x, y, monglyph) -int x, y, monglyph; +show_mon_or_warn(int x, int y, int monglyph) { struct obj *o; @@ -410,12 +397,11 @@ int x, y, monglyph; * */ static void -display_monster(x, y, mon, sightflags, worm_tail) -register xchar x, y; /* display position */ -register struct monst *mon; /* monster to display */ -int sightflags; /* 1 if the monster is physically seen - 2 if detected using Detect_monsters */ -xchar worm_tail; /* mon is actually a worm tail */ +display_monster(xchar x, xchar y, /**< display position */ + struct monst *mon, /**< monster to display */ + int sightflags, /**< 1 if the monster is physically seen; + 2 if detected using Detect_monsters */ + boolean worm_tail) /**< mon is actually a worm tail */ { boolean mon_mimic = (M_AP_TYPE(mon) != M_AP_NOTHING); int sensed = mon_mimic && @@ -528,8 +514,7 @@ xchar worm_tail; /* mon is actually a worm tail */ * Do not call for worm tails. */ static void -display_warning(mon) -register struct monst *mon; +display_warning(register struct monst *mon) { int x = mon->mx, y = mon->my; int wl = (int) (mon->m_lev / 4); @@ -555,8 +540,7 @@ register struct monst *mon; } int -warning_of(mon) -struct monst *mon; +warning_of(struct monst *mon) { int wl = 0, tmp = 0; @@ -573,8 +557,7 @@ struct monst *mon; * When hero knows what happened to location, even when blind. */ void -feel_newsym(x, y) -xchar x, y; +feel_newsym(xchar x, xchar y) { if (Blind) { feel_location(x, y); @@ -594,8 +577,7 @@ xchar x, y; * searching only finds one monster per turn so we must check that separately. */ void -feel_location(x, y) -xchar x, y; +feel_location(xchar x, xchar y) { struct rm *lev; struct obj *boulder; @@ -762,8 +744,7 @@ xchar x, y; * Possibly put a new glyph at the given location. */ void -newsym(x, y) -register int x, y; +newsym(register int x, register int y) { register struct monst *mon; register struct rm *lev = &(levl[x][y]); @@ -928,8 +909,7 @@ register int x, y; * pulled into a platform dependent routine for fancier graphics if desired. */ void -shieldeff(x, y) -xchar x, y; +shieldeff(xchar x, xchar y) { register int i; @@ -945,8 +925,7 @@ xchar x, y; } static int -tether_glyph(x, y) -int x, y; +tether_glyph(int x, int y) { int tdx, tdy; tdx = u.ux - x; @@ -991,8 +970,7 @@ static struct tmp_glyph { } tgfirst; void -tmp_at(x, y) -int x, y; +tmp_at(int x, int y) { static struct tmp_glyph *tglyph = (struct tmp_glyph *)0; struct tmp_glyph *tmp; @@ -1123,9 +1101,7 @@ int x, y; * meant to be at the location. */ void -flash_glyph_at(x, y, tg, rpt) -int x, y; -int tg, rpt; +flash_glyph_at(int x, int y, int tg, int rpt) { int i, glyph[2]; @@ -1151,8 +1127,7 @@ int tg, rpt; * being swallowed. */ void -swallowed(first) -int first; +swallowed(int first) { static xchar lastx, lasty; /* last swallowed position */ int swallower, left_ok, rght_ok; @@ -1210,8 +1185,7 @@ int first; * except when in water level. Special routines exist for that. */ void -under_water(mode) -int mode; +under_water(int mode) { static xchar lastx, lasty; static boolean dela; @@ -1265,8 +1239,7 @@ int mode; * Very restricted display. You can only see yourself. */ void -under_ground(mode) -int mode; +under_ground(int mode) { static boolean dela; @@ -1306,7 +1279,7 @@ int mode; * sit.c] */ void -see_monsters() +see_monsters(void) { register struct monst *mon; int new_warn_obj_cnt = 0; @@ -1348,7 +1321,7 @@ see_monsters() * changes. */ void -set_mimic_blocking() +set_mimic_blocking(void) { register struct monst *mon; @@ -1368,7 +1341,7 @@ set_mimic_blocking() * + hallucinating. */ void -see_objects() +see_objects(void) { register struct obj *obj; for(obj = fobj; obj; obj = obj->nobj) @@ -1379,7 +1352,7 @@ see_objects() * Update hallucinated traps. */ void -see_traps() +see_traps(void) { struct trap *trap; int glyph; @@ -1395,20 +1368,20 @@ see_traps() * Put the cursor on the hero. Flush all accumulated glyphs before doing it. */ void -curs_on_u() +curs_on_u(void) { flush_screen(1); /* Flush waiting glyphs & put cursor on hero */ } int -doredraw() +doredraw(void) { docrt(); return 0; } void -docrt() +docrt(void) { register int x, y; register struct rm *lev; @@ -1463,7 +1436,7 @@ docrt() /* for panning beyond a clipped region; resend the current map data to the interface rather than use docrt()'s regeneration of that data */ void -redraw_map() +redraw_map(void) { int x, y, glyph; @@ -1509,8 +1482,7 @@ static char gbuf_stop[ROWNO]; * between object piles and single objects, it doesn't mark the location * for update. */ void -newsym_force(x, y) -register int x, y; +newsym_force(register int x, register int y) { newsym(x,y); gbuf[y][x].new = 1; @@ -1525,8 +1497,7 @@ register int x, y; * Store the glyph in the 3rd screen for later flushing. */ void -show_glyph(x, y, glyph) -int x, y, glyph; +show_glyph(int x, int y, int glyph) { /* * Check for bad positions and glyphs. @@ -1620,7 +1591,7 @@ static gbuf_entry nul_gbuf = { 0, cmap_to_glyph(S_stone) }; * Turn the 3rd screen into stone. */ void -clear_glyph_buffer() +clear_glyph_buffer(void) { register int x, y; register gbuf_entry *gptr; @@ -1638,8 +1609,7 @@ clear_glyph_buffer() * Assumes that the indicated positions are filled with S_stone glyphs. */ void -row_refresh(start, stop, y) -int start, stop, y; +row_refresh(int start, int stop, int y) { register int x; @@ -1650,7 +1620,7 @@ int start, stop, y; } void -cls() +cls(void) { static boolean in_cls = 0; @@ -1670,8 +1640,7 @@ cls() * Synch the third screen with the display. */ void -flush_screen(cursor_on_u) -int cursor_on_u; +flush_screen(int cursor_on_u) { /* Prevent infinite loops on errors: * flush_screen->print_glyph->impossible->pline->flush_screen @@ -1716,9 +1685,7 @@ int cursor_on_u; #ifdef DUMP_LOG /* D: Added to dump screen to output file */ -static uchar get_glyph_char(glyph, oclass) -int glyph; -int *oclass; +static uchar get_glyph_char(int glyph, int *oclass) { uchar ch; int offset; @@ -1792,7 +1759,7 @@ const char *str; /** Take a screen dump */ void -dump_screen() +dump_screen(void) { register int x, y; int lastc = -1; @@ -1947,8 +1914,7 @@ dump_screen() * variables. */ int -back_to_glyph(x, y) -xchar x, y; +back_to_glyph(xchar x, xchar y) { assert_valid_coordinates(x, y); @@ -2053,9 +2019,7 @@ xchar x, y; * a random monster in swallowed() and don't use what_mon() here. */ static int -swallow_to_glyph(mnum, loc) -int mnum; -int loc; +swallow_to_glyph(int mnum, int loc) { if (loc < S_sw_tl || S_sw_br < loc) { impossible("swallow_to_glyph: bad swallow location"); @@ -2079,9 +2043,7 @@ int loc; * / S_rslant (-1, 1) or ( 1,-1) */ int -zapdir_to_glyph(dx, dy, beam_type) -register int dx, dy; -int beam_type; +zapdir_to_glyph(register int dx, register int dy, int beam_type) { if (beam_type >= NUM_ZAP) { warning("zapdir_to_glyph: illegal beam type"); @@ -2099,8 +2061,7 @@ int beam_type; * structure, so we must check the "third screen". */ int -glyph_at(x, y) -xchar x, y; +glyph_at(xchar x, xchar y) { if(x < 0 || y < 0 || x >= COLNO || y >= ROWNO) return cmap_to_glyph(S_room); /* XXX */ @@ -2121,8 +2082,7 @@ xchar x, y; */ static int -get_bk_glyph(x, y) -xchar x, y; +get_bk_glyph(xchar x, xchar y) { assert_valid_coordinates(x, y); @@ -2237,8 +2197,7 @@ int x, y, a, b, c, dd; * Things that are ambigious: lava */ static int -check_pos(x, y, which) -int x, y, which; +check_pos(int x, int y, int which) { int type; if (!isok(x, y)) return which; @@ -2266,8 +2225,7 @@ int x, y, a, b, c; /* Return the wall mode for a T wall. */ static int -set_twall(x0, y0, x1, y1, x2, y2, x3, y3) -int x0, y0, x1, y1, x2, y2, x3, y3; +set_twall(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) { int wmode, is_1, is_2, is_3; @@ -2290,8 +2248,7 @@ int x0, y0, x1, y1, x2, y2, x3, y3; /* Return wall mode for a horizontal or vertical wall. */ static int -set_wall(x, y, horiz) -int x, y, horiz; +set_wall(int x, int y, int horiz) { int wmode, is_1, is_2; @@ -2313,8 +2270,7 @@ int x, y, horiz; /* Return a wall mode for a corner wall. (x4,y4) is the "inner" position. */ static int -set_corn(x1, y1, x2, y2, x3, y3, x4, y4) -int x1, y1, x2, y2, x3, y3, x4, y4; +set_corn(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { int wmode, is_1, is_2, is_3, is_4; @@ -2342,8 +2298,7 @@ int x1, y1, x2, y2, x3, y3, x4, y4; /* Return mode for a crosswall. */ static int -set_crosswall(x, y) -int x, y; +set_crosswall(int x, int y) { int wmode, is_1, is_2, is_3, is_4; @@ -2378,7 +2333,7 @@ int x, y; /* Called from mklev. Scan the level and set the wall modes. */ void -set_wall_state() +set_wall_state(void) { int x, y; int wmode; @@ -2460,9 +2415,10 @@ unsigned char seenv_matrix[3][3] = { {SV2, SV1, SV0}, /* Set the seen vector of lev as if seen from (x0,y0) to (x,y). */ static void -set_seenv(lev, x0, y0, x, y) -struct rm *lev; -int x0, y0, x, y; /* from, to */ +set_seenv( + struct rm *lev, + int x0, int y0, /**< from */ + int x, int y) /**< to */ { int dx = x-x0, dy = y0-y; lev->seenv |= seenv_matrix[sign(dy)+1][sign(dx)+1]; @@ -2471,9 +2427,10 @@ int x0, y0, x, y; /* from, to */ /* Called by blackout(vault.c) when vault guard removes temporary corridor, turning spot back into stone; is an adjacent spot. */ void -unset_seenv(lev, x0, y0, x1, y1) -struct rm *lev; /* &levl[x1][y1] */ -int x0, y0, x1, y1; /* from, to; abs(x1-x0)==1 && abs(y0-y1)==1 */ +unset_seenv( + struct rm *lev, /**< &levl[x1][y1] */ + int x0, int y0, /**< from */ + int x1, int y1) /**< to; abs(x1-x0)==1 && abs(y0-y1)==1 */ { int dx = x1 - x0, dy = y0 - y1; @@ -2539,8 +2496,7 @@ static const int cross_matrix[4][6] = { /* Print out a T wall warning and all interesting info. */ static void -t_warn(lev) -struct rm *lev; +t_warn(struct rm *lev) { static const char warn_str[] = "wall_angle: %s: case %d: seenv = 0x%x"; const char *wname; @@ -2568,8 +2524,7 @@ struct rm *lev; * seen vector (SV). */ static int -wall_angle(lev) -struct rm *lev; +wall_angle(struct rm *lev) { register unsigned int seenv = lev->seenv & 0xff; const int *row; diff --git a/src/dlb.c b/src/dlb.c index b050790dc..1f1892202 100644 --- a/src/dlb.c +++ b/src/dlb.c @@ -63,8 +63,8 @@ static library dlb_libs[MAX_LIBS]; static boolean readlibdir(library *lp); static boolean find_file(const char *name, library **lib, long *startp, long *sizep); -static boolean lib_dlb_init(); -static void lib_dlb_cleanup(); +static boolean lib_dlb_init(void); +static void lib_dlb_cleanup(void); static boolean lib_dlb_fopen(dlb *, const char *, const char *); static int lib_dlb_fclose(dlb *); static int lib_dlb_fread(char *, int, int, dlb *); @@ -125,8 +125,7 @@ extern char *eos(char *); * Return TRUE on success, FALSE on failure. */ static boolean -readlibdir(lp) -library *lp; /* library pointer to fill in */ +readlibdir(library *lp) /**< library pointer to fill in */ { int i; char *sp; @@ -173,10 +172,7 @@ library *lp; /* library pointer to fill in */ * 0 if not found. Fill in the size and starting position. */ static boolean -find_file(name, lib, startp, sizep) -const char *name; -library **lib; -long *startp, *sizep; +find_file(const char *name, library **lib, long int *startp, long int *sizep) { int i, j; library *lp; @@ -202,9 +198,7 @@ long *startp, *sizep; * structure. Return TRUE if successful, FALSE otherwise. */ boolean -open_library(lib_area, lib_name, lp) -const char *lib_area, *lib_name; -library *lp; +open_library(const char *lib_area, const char *lib_name, library *lp) { boolean status = FALSE; @@ -221,8 +215,7 @@ library *lp; } void -close_library(lp) -library *lp; +close_library(library *lp) { (void) fclose(lp->fdata); free((genericptr_t) lp->dir); @@ -236,7 +229,7 @@ library *lp; * keep track of the file position. */ static boolean -lib_dlb_init() +lib_dlb_init(void) { /* zero out array */ (void) memset((char *)&dlb_libs[0], 0, sizeof(dlb_libs)); @@ -253,7 +246,7 @@ lib_dlb_init() } static void -lib_dlb_cleanup() +lib_dlb_cleanup(void) { int i; @@ -263,10 +256,7 @@ lib_dlb_cleanup() } static boolean -lib_dlb_fopen(dp, name, mode) -dlb *dp; -const char *name; -const char *mode UNUSED; +lib_dlb_fopen(dlb *dp, const char *name, const char *mode UNUSED) { long start, size; library *lp; @@ -284,18 +274,14 @@ const char *mode UNUSED; } static int -lib_dlb_fclose(dp) -dlb *dp UNUSED; +lib_dlb_fclose(dlb *dp UNUSED) { /* nothing needs to be done */ return 0; } static int -lib_dlb_fread(buf, size, quan, dp) -char *buf; -int size, quan; -dlb *dp; +lib_dlb_fread(char *buf, int size, int quan, dlb *dp) { long pos, nread, nbytes; @@ -319,10 +305,7 @@ dlb *dp; } static int -lib_dlb_fseek(dp, pos, whence) -dlb *dp; -long pos; -int whence; +lib_dlb_fseek(dlb *dp, long int pos, int whence) { long curpos; @@ -339,10 +322,7 @@ int whence; } static char * -lib_dlb_fgets(buf, len, dp) -char *buf; -int len; -dlb *dp; +lib_dlb_fgets(char *buf, int len, dlb *dp) { int i; char *bp, c = 0; @@ -371,8 +351,7 @@ dlb *dp; } static int -lib_dlb_fgetc(dp) -dlb *dp; +lib_dlb_fgetc(dlb *dp) { char c; @@ -382,8 +361,7 @@ dlb *dp; static long -lib_dlb_ftell(dp) -dlb *dp; +lib_dlb_ftell(dlb *dp) { return dp->mark; } @@ -432,7 +410,7 @@ static const dlb_procs_t *dlb_procs; static boolean dlb_initialized = FALSE; boolean -dlb_init() +dlb_init(void) { if (!dlb_initialized) { #ifdef DLBLIB @@ -450,7 +428,7 @@ dlb_init() } void -dlb_cleanup() +dlb_cleanup(void) { if (dlb_initialized) { do_dlb_cleanup(); @@ -463,8 +441,8 @@ dlb * dlb_fopen(name, mode) const char *name, *mode; #else -dlb_fopen_area(area, name, mode) -const char *area, *name, *mode; +dlb_fopen_area(const char *area, const char *name, const char *mode) + #endif { FILE *fp; @@ -496,8 +474,7 @@ const char *area, *name, *mode; } int -dlb_fclose(dp) -dlb *dp; +dlb_fclose(dlb *dp) { int ret = 0; @@ -511,10 +488,7 @@ dlb *dp; } int -dlb_fread(buf, size, quan, dp) -char *buf; -int size, quan; -dlb *dp; +dlb_fread(char *buf, int size, int quan, dlb *dp) { if (!dlb_initialized || size <= 0 || quan <= 0) return 0; if (dp->fp) return (int) fread(buf, size, quan, dp->fp); @@ -522,10 +496,7 @@ dlb *dp; } int -dlb_fseek(dp, pos, whence) -dlb *dp; -long pos; -int whence; +dlb_fseek(dlb *dp, long int pos, int whence) { if (!dlb_initialized) return EOF; if (dp->fp) return fseek(dp->fp, pos, whence); @@ -533,10 +504,7 @@ int whence; } char * -dlb_fgets(buf, len, dp) -char *buf; -int len; -dlb *dp; +dlb_fgets(char *buf, int len, dlb *dp) { if (!dlb_initialized) return (char *) 0; if (dp->fp) return fgets(buf, len, dp->fp); @@ -544,8 +512,7 @@ dlb *dp; } int -dlb_fgetc(dp) -dlb *dp; +dlb_fgetc(dlb *dp) { if (!dlb_initialized) return EOF; if (dp->fp) return fgetc(dp->fp); @@ -553,8 +520,7 @@ dlb *dp; } long -dlb_ftell(dp) -dlb *dp; +dlb_ftell(dlb *dp) { if (!dlb_initialized) return 0; if (dp->fp) return ftell(dp->fp); diff --git a/src/do.c b/src/do.c index 9b274c856..caf53abf2 100644 --- a/src/do.c +++ b/src/do.c @@ -9,27 +9,27 @@ #include #ifdef SINKS -static void polymorph_sink(); -static boolean teleport_sink(); +static void polymorph_sink(void); +static boolean teleport_sink(void); static void dosinkring(struct obj *); #endif /* SINKS */ static int drop(struct obj *); -static int wipeoff(); +static int wipeoff(void); static int menu_drop(int); -static int currentlevel_rewrite(); -static void final_level(); -/* static boolean badspot(XCHAR_P,XCHAR_P); */ -static boolean unique_item_check(); -static void levelport_monsters(); +static int currentlevel_rewrite(void); +static void final_level(void); +/* static boolean badspot(xchar,xchar); */ +static boolean unique_item_check(void); +static void levelport_monsters(void); static NEARDATA const char drop_types[] = { ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, 0 }; /* 'd' command: drop one inventory item */ int -dodrop() +dodrop(void) { int result, i = (invent) ? 0 : (SIZE(drop_types) - 1); @@ -48,10 +48,7 @@ dodrop() * it's gone for good... If the destination is not a pool, returns FALSE. */ boolean -boulder_hits_pool(otmp, rx, ry, pushing) -struct obj *otmp; -register int rx, ry; -boolean pushing; +boulder_hits_pool(struct obj *otmp, register int rx, register int ry, boolean pushing) { if (!otmp || otmp->otyp != BOULDER) warning("Not a boulder?"); @@ -136,10 +133,7 @@ boolean pushing; * away. */ boolean -flooreffects(obj, x, y, verb) -struct obj *obj; -int x, y; -const char *verb; +flooreffects(struct obj *obj, int x, int y, const char *verb) { struct trap *t; struct monst *mtmp; @@ -291,8 +285,7 @@ const char *verb; /** obj is an object dropped on an altar */ void -doaltarobj(obj) -register struct obj *obj; +doaltarobj(register struct obj *obj) { if (Blind) return; @@ -393,7 +386,7 @@ register struct obj *obj; /** Transforms the sink at the player's position into * a fountain, throne, altar or grave. */ static void -polymorph_sink() +polymorph_sink(void) { if (levl[u.ux][u.uy].typ != SINK) { return; } @@ -438,7 +431,7 @@ polymorph_sink() /** Teleports the sink at the player's position. * @return TRUE if sink teleported */ static boolean -teleport_sink() +teleport_sink(void) { int cx, cy; int cnt = 0; @@ -467,8 +460,8 @@ teleport_sink() } static void -dosinkring(obj) /* obj is a ring being dropped over a kitchen sink */ -register struct obj *obj; +dosinkring(register struct obj *obj) /* obj is a ring being dropped over a kitchen sink */ + { struct obj *otmp, *otmp2; boolean ideed = TRUE; @@ -629,9 +622,7 @@ register struct obj *obj; /* some common tests when trying to drop or throw items */ boolean -canletgo(obj, word) -struct obj *obj; -const char *word; +canletgo(struct obj *obj, const char *word) { if (obj->owornmask & (W_ARMOR | W_ACCESSORY)) { if (*word) @@ -673,8 +664,7 @@ const char *word; } static int -drop(obj) -register struct obj *obj; +drop(register struct obj *obj) { if(!obj) return(0); if(!canletgo(obj, "drop")) @@ -732,8 +722,7 @@ register struct obj *obj; /* Called in several places - may produce output */ /* eg ship_object() and dropy() -> sellobj() both produce output */ void -dropx(obj) -register struct obj *obj; +dropx(register struct obj *obj) { /* Tipped objects aren't considered carried, even if * their container is, so don't freeinv() it. */ @@ -752,17 +741,14 @@ register struct obj *obj; /* dropy - put dropped object at destination; called from lots of places */ void -dropy(obj) -struct obj *obj; +dropy(struct obj *obj) { dropz(obj, FALSE); } /* dropz - really put dropped object at its destination... */ void -dropz(obj, with_impact) -struct obj *obj; -boolean with_impact; +dropz(struct obj *obj, boolean with_impact) { if (obj == uwep) setuwep((struct obj *)0); if (obj == uquiver) setuqwep((struct obj *)0); @@ -828,8 +814,7 @@ boolean with_impact; /* things that must change when not held; recurse into containers. Called for both player and monsters */ void -obj_no_longer_held(obj) -struct obj *obj; +obj_no_longer_held(struct obj *obj) { if (!obj) { return; @@ -855,7 +840,7 @@ struct obj *obj; /* 'D' command: drop several things */ int -doddrop() +doddrop(void) { int result = 0; @@ -878,8 +863,7 @@ doddrop() /* Drop things from the hero's inventory, using a menu. */ static int -menu_drop(retry) -int retry; +menu_drop(int retry) { int n, i, n_dropped = 0; long cnt; @@ -999,7 +983,7 @@ static NEARDATA boolean at_ladder = FALSE; /** the '>' command */ int -dodown() +dodown(void) { struct trap *trap = 0; boolean stairs_down = ((u.ux == xdnstair && u.uy == ydnstair) || @@ -1154,7 +1138,7 @@ dodown() /** the '<' command */ int -doup() +doup(void) { if (u_rooted()) { return 1; @@ -1216,7 +1200,7 @@ d_level save_dlevel = {0, 0}; /* check that we can write out the current level */ static int -currentlevel_rewrite() +currentlevel_rewrite(void) { register int fd; char whynot[BUFSZ]; @@ -1252,7 +1236,7 @@ currentlevel_rewrite() #ifdef INSURANCE void -save_currentstate() +save_currentstate(void) { int fd; @@ -1283,8 +1267,7 @@ save_currentstate() /* when arriving on a level, if hero and a monster are trying to share same spot, move one; extracted from goto_level(); also used by wiz_makemap() */ void -u_collide_m(mtmp) -struct monst *mtmp; +u_collide_m(struct monst *mtmp) { coord cc; @@ -1325,9 +1308,7 @@ d_level new_dlevel = {0, 0}; #endif void -goto_level(newlevel, at_stairs, falling, portal) -d_level *newlevel; -boolean at_stairs, falling, portal; +goto_level(d_level *newlevel, boolean at_stairs, boolean falling, boolean portal) { int fd, l_idx; xchar new_ledger; @@ -1850,7 +1831,7 @@ boolean at_stairs, falling, portal; } static void -final_level() +final_level(void) { struct monst *mtmp; struct obj *otmp; @@ -1918,11 +1899,7 @@ static char *dfr_pre_msg = 0, /* pline() before level change */ /* change levels at the end of this turn, after monsters finish moving */ void -schedule_goto(tolev, at_stairs, falling, portal_flag, pre_msg, post_msg) -d_level *tolev; -boolean at_stairs, falling; -int portal_flag; -const char *pre_msg, *post_msg; +schedule_goto(d_level *tolev, boolean at_stairs, boolean falling, int portal_flag, const char *pre_msg, const char *post_msg) { int typmask = 0100; /* non-zero triggers `deferred_goto' */ @@ -1945,7 +1922,7 @@ const char *pre_msg, *post_msg; /* handle something like portal ejection */ void -deferred_goto() +deferred_goto(void) { if (!on_level(&u.uz, &u.utolev)) { d_level dest; @@ -1977,8 +1954,7 @@ deferred_goto() * Returns TRUE if the corpse is gone afterwards. */ boolean -revive_corpse(corpse) -struct obj *corpse; +revive_corpse(struct obj *corpse) { struct monst *mtmp = 0, *mcarry; boolean is_uwep, chewed; @@ -2104,9 +2080,7 @@ struct obj *corpse; /* Revive the corpse via a timeout. */ /*ARGSUSED*/ void -revive_mon(arg, timeout) -anything *arg; -long timeout UNUSED; +revive_mon(anything *arg, long int timeout UNUSED) { struct obj *body = arg->a_obj; struct permonst *mptr = &mons[body->corpsenm]; @@ -2161,13 +2135,13 @@ zombify_mon(anything *arg, long timeout) } int -donull() +donull(void) { return(1); /* Do nothing, but let other things happen */ } static int -wipeoff() +wipeoff(void) { if(u.ucreamed < 4) u.ucreamed = 0; else u.ucreamed -= 4; @@ -2189,7 +2163,7 @@ wipeoff() } int -dowipe() +dowipe(void) { if(u.ucreamed) { static NEARDATA char buf[39]; @@ -2206,9 +2180,7 @@ dowipe() } void -set_wounded_legs(side, timex) -register long side; -register int timex; +set_wounded_legs(register long int side, register int timex) { /* KMH -- STEED * If you are riding, your steed gets the wounded legs instead. @@ -2228,8 +2200,7 @@ register int timex; } void -heal_legs(how) -int how; /* 0: ordinary, 1: dismounting steed, 2: limbs turn to stone */ +heal_legs(int how) /**< 0: ordinary, 1: dismounting steed, 2: limbs turn to stone */ { if (Wounded_legs) { if (ATEMP(A_DEX) < 0) { @@ -2271,7 +2242,7 @@ int how; /* 0: ordinary, 1: dismounting steed, 2: limbs turn to stone */ /* return true if any unique item is on the floor or in monsters' possession */ boolean -unique_item_check() +unique_item_check(void) { register struct obj *obj; register struct monst *mtmp; @@ -2290,7 +2261,7 @@ unique_item_check() /* prevent monsters from "poofing" -- disappearing due to non-persistent levels */ void -levelport_monsters() +levelport_monsters(void) { register struct monst *mtmp, *mtmp2; int nlev; diff --git a/src/do_name.c b/src/do_name.c index a99c5b329..b24fcd72e 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -2,8 +2,8 @@ /* NetHack may be freely redistributed. See license for details. */ #include "hack.h" -static char *nextmbuf(); -static void getpos_help(BOOLEAN_P, const char *); +static char *nextmbuf(void); +static void getpos_help(boolean, const char *); static void gather_locs(coord **, int *, int); static void auto_describe(int, int); static void call_object(int, char *); @@ -15,7 +15,7 @@ extern const char what_is_an_unknown_object[]; /* from pager.c */ /* manage a pool of BUFSZ buffers, so callers don't have to */ static char * -nextmbuf() +nextmbuf(void) { static char NEARDATA bufs[NUMMBUF][BUFSZ]; static int bufidx = 0; @@ -31,9 +31,7 @@ static void (*getpos_hilitefunc)(int) = (void (*)(int)) 0; static boolean (*getpos_getvalid)(int, int) = (boolean (*)(int, int)) 0; void -getpos_sethilite(gp_hilitef, gp_getvalidf) -void (*gp_hilitef)(int); -boolean (*gp_getvalidf)(int, int); +getpos_sethilite(void (*gp_hilitef) (int), boolean (*gp_getvalidf) (int, int)) { getpos_hilitefunc = gp_hilitef; getpos_getvalid = gp_getvalidf; @@ -56,11 +54,7 @@ static const char *const gloc_filtertxt[NUM_GFILTER] = { }; void -getpos_help_keyxhelp(tmpwin, k1, k2, gloc) -winid tmpwin; -const char *k1; -const char *k2; -int gloc; +getpos_help_keyxhelp(winid tmpwin, const char *k1, const char *k2, int gloc) { char sbuf[BUFSZ]; @@ -74,9 +68,7 @@ int gloc; /* the response for '?' help request in getpos() */ static void -getpos_help(force, goal) -boolean force; -const char *goal; +getpos_help(boolean force, const char *goal) { static const char *const fastmovemode[2] = { "8 units at a time", "skipping same glyphs", @@ -216,7 +208,7 @@ static int getpos_monarr_idx = 0; static struct _getpos_monarr *getpos_monarr_pos = NULL; void -getpos_freemons() +getpos_freemons(void) { if (getpos_monarr_pos) free(getpos_monarr_pos); getpos_monarr_pos = NULL; @@ -224,9 +216,7 @@ getpos_freemons() } static int -getpos_monarr_cmp(a, b) -const void *a; -const void *b; +getpos_monarr_cmp(const void *a, const void *b) { const struct _getpos_monarr *m1 = (const struct _getpos_monarr *)a; const struct _getpos_monarr *m2 = (const struct _getpos_monarr *)b; @@ -234,7 +224,7 @@ const void *b; } void -getpos_initmons() +getpos_initmons(void) { struct monst *mtmp = fmon; if (getpos_monarr_pos) getpos_freemons(); @@ -260,7 +250,7 @@ getpos_initmons() } struct monst * -getpos_nextmon() +getpos_nextmon(void) { if (!getpos_monarr_pos) { getpos_initmons(); @@ -278,7 +268,7 @@ getpos_nextmon() } struct monst * -getpos_prevmon() +getpos_prevmon(void) { if (!getpos_monarr_pos) { getpos_initmons(); @@ -297,9 +287,7 @@ getpos_prevmon() } static int -cmp_coord_distu(a, b) -const void *a; -const void *b; +cmp_coord_distu(const void *a, const void *b) { const coord *c1 = a; const coord *c2 = b; @@ -334,8 +322,7 @@ static struct opvar *gloc_filter_map = (struct opvar *) 0; static int gloc_filter_floodfill_match_glyph; int -gloc_filter_classify_glyph(glyph) -int glyph; +gloc_filter_classify_glyph(int glyph) { int c; @@ -360,8 +347,7 @@ int glyph; } static int -gloc_filter_floodfill_matcharea(x, y) -int x, y; +gloc_filter_floodfill_matcharea(int x, int y) { int glyph = back_to_glyph(x, y); @@ -381,8 +367,7 @@ int x, y; } void -gloc_filter_floodfill(x, y) -int x, y; +gloc_filter_floodfill(int x, int y) { gloc_filter_floodfill_match_glyph = back_to_glyph(x, y); @@ -391,7 +376,7 @@ int x, y; } void -gloc_filter_init() +gloc_filter_init(void) { if (iflags.getloc_filter == GFILTER_AREA) { if (!gloc_filter_map) { @@ -414,7 +399,7 @@ gloc_filter_init() } void -gloc_filter_done() +gloc_filter_done(void) { if (gloc_filter_map) { opvar_free_x(gloc_filter_map); @@ -423,8 +408,7 @@ gloc_filter_done() } static boolean -gather_locs_interesting(x, y, gloc) -int x, y, gloc; +gather_locs_interesting(int x, int y, int gloc) { /* TODO: if glyph is a pile glyph, convert to ordinary one * in order to keep tail/boulder/rock check simple. @@ -510,10 +494,7 @@ int x, y, gloc; /* gather locations for monsters or objects shown on the map */ static void -gather_locs(arr_p, cnt_p, gloc) -coord **arr_p; -int *cnt_p; -int gloc; +gather_locs(coord **arr_p, int *cnt_p, int gloc) { int x, y, pass, idx; @@ -560,9 +541,7 @@ int gloc; } char * -dxdy_to_dist_descr(dx, dy, fulldir) -int dx, dy; -boolean fulldir; +dxdy_to_dist_descr(int dx, int dy, boolean fulldir) { static char buf[30]; int dst; @@ -598,9 +577,7 @@ boolean fulldir; /* coordinate formatting for 'whatis_coord' option */ char * -coord_desc(x, y, outbuf, cmode) -int x, y; -char *outbuf, cmode; +coord_desc(int x, int y, char *outbuf, char cmode) { static char screen_fmt[16]; /* [12] suffices: "[%02d,%02d]" */ int dx, dy; @@ -663,9 +640,7 @@ auto_describe(int cx, int cy) } boolean -getpos_menu(ccp, gloc) -coord *ccp; -int gloc; +getpos_menu(coord *ccp, int gloc) { coord *garr = DUMMY; int gcount = 0; @@ -1136,9 +1111,9 @@ free_mgivenname(struct monst *mon) /* allocate space for an object's name; removes old name if there is one */ void -new_oname(obj, lth) -struct obj *obj; -int lth; /* desired length (caller handles adding 1 for terminator) */ +new_oname( + struct obj *obj, + int lth) /**< desired length (caller handles adding 1 for terminator) */ { if (lth) { /* allocate oextra if necessary; otherwise get rid of old name */ @@ -1156,8 +1131,7 @@ int lth; /* desired length (caller handles adding 1 for terminator) */ /* release an object's name; retains oextra even if all fields are now null */ void -free_oname(obj) -struct obj *obj; +free_oname(struct obj *obj) { if (has_oname(obj)) { free((genericptr_t) ONAME(obj)); @@ -1171,8 +1145,7 @@ struct obj *obj; * if it doesn't. */ const char * -safe_oname(obj) -struct obj *obj; +safe_oname(struct obj *obj) { if (has_oname(obj)) { return ONAME(obj); @@ -1183,9 +1156,7 @@ struct obj *obj; /* historical note: this returns a monster pointer because it used to allocate a new bigger block of memory to hold the monster and its name */ struct monst * -christen_monst(mtmp, name) -struct monst *mtmp; -const char *name; +christen_monst(struct monst *mtmp, const char *name) { int lth; char buf[PL_PSIZ]; @@ -1205,7 +1176,7 @@ const char *name; } int -do_mname() +do_mname(void) { char buf[BUFSZ]; coord cc; @@ -1267,8 +1238,7 @@ static int via_naming = 0; * when obj is in the inventory. */ void -do_oname(obj) -register struct obj *obj; +do_oname(register struct obj *obj) { char *bufp, buf[BUFSZ], bufcpy[BUFSZ], qbuf[QBUFSZ]; const char *aname; @@ -1334,9 +1304,7 @@ register struct obj *obj; } struct obj * -oname(obj, name) -struct obj *obj; -const char *name; +oname(struct obj *obj, const char *name) { int lth; char buf[PL_PSIZ]; @@ -1399,15 +1367,14 @@ static NEARDATA const char callable[] = { }; boolean -objtyp_is_callable(i) -int i; +objtyp_is_callable(int i) { return (objects[i].oc_uname || (OBJ_DESCR(objects[i]) && index(callable, objects[i].oc_class))); } int -ddocall() +ddocall(void) { register struct obj *obj; #ifdef REDO @@ -1454,8 +1421,7 @@ ddocall() /* for use by safe_qbuf() */ static char * -docall_xname(obj) -struct obj *obj; +docall_xname(struct obj *obj) { struct obj otemp; @@ -1486,8 +1452,7 @@ struct obj *obj; } void -docall(obj) -struct obj *obj; +docall(struct obj *obj) { char qbuf[QBUFSZ]; @@ -1563,7 +1528,7 @@ call_object(int obj_otyp, char *buf) } void -namefloorobj() +namefloorobj(void) { coord cc; int glyph; @@ -1650,7 +1615,7 @@ static const char * const ghostnames[] = { /* ghost names formerly set by x_monnam(), now by makemon() instead */ const char * -rndghostname() +rndghostname(void) { return rn2(7) ? ghostnames[rn2(SIZE(ghostnames))] : (const char *)plname; } @@ -1674,9 +1639,9 @@ rndghostname() * options works, since those are special cases. */ char * -x_monnam(mtmp, article, adjective, suppress, called) -register struct monst *mtmp; -int article; +x_monnam(register struct monst *mtmp, int article, const char *adjective, int suppress, boolean called) + + /* ARTICLE_NONE, ARTICLE_THE, ARTICLE_A: obvious * ARTICLE_YOUR: "your" on pets, "the" on everything else * @@ -1684,13 +1649,13 @@ int article; * _and_ there is no adjective, "invisible", "saddled", etc., override this * and always use no article. */ -const char *adjective; -int suppress; + + /* SUPPRESS_IT, SUPPRESS_INVISIBLE, SUPPRESS_HALLUCINATION, SUPPRESS_SADDLE. * EXACT_NAME: combination of all the above * SUPPRESS_NAME: omit monster's assigned name (unless uniq w/ pname). */ -boolean called; + { char *buf = nextmbuf(); struct permonst *mdat = mtmp->data; @@ -1873,16 +1838,14 @@ boolean called; } char * -l_monnam(mtmp) -struct monst *mtmp; +l_monnam(struct monst *mtmp) { return x_monnam(mtmp, ARTICLE_NONE, (char *) 0, (has_mgivenname(mtmp)) ? SUPPRESS_SADDLE : 0, TRUE); } char * -mon_nam(mtmp) -struct monst *mtmp; +mon_nam(struct monst *mtmp) { return x_monnam(mtmp, ARTICLE_THE, (char *) 0, (has_mgivenname(mtmp)) ? SUPPRESS_SADDLE : 0, FALSE); @@ -1893,8 +1856,7 @@ struct monst *mtmp; * the player with a cursed potion of invisibility */ char * -noit_mon_nam(mtmp) -struct monst *mtmp; +noit_mon_nam(struct monst *mtmp) { return x_monnam(mtmp, ARTICLE_THE, (char *) 0, (has_mgivenname(mtmp)) ? (SUPPRESS_SADDLE | SUPPRESS_IT) @@ -1903,8 +1865,7 @@ struct monst *mtmp; } char * -Monnam(mtmp) -struct monst *mtmp; +Monnam(struct monst *mtmp) { register char *bp = mon_nam(mtmp); @@ -1913,8 +1874,7 @@ struct monst *mtmp; } char * -noit_Monnam(mtmp) -struct monst *mtmp; +noit_Monnam(struct monst *mtmp) { register char *bp = noit_mon_nam(mtmp); @@ -1924,9 +1884,7 @@ struct monst *mtmp; /* return "a dog" rather than "Fido", honoring hallucination and visibility */ char * -noname_monnam(mtmp, article) -struct monst *mtmp; -int article; +noname_monnam(struct monst *mtmp, int article) { return x_monnam(mtmp, article, (char *) 0, SUPPRESS_NAME, FALSE); } @@ -1934,16 +1892,14 @@ int article; /* monster's own name -- overrides hallucination and [in]visibility so shouldn't be used in ordinary messages (mainly for disclosure) */ char * -m_monnam(mtmp) -struct monst *mtmp; +m_monnam(struct monst *mtmp) { return x_monnam(mtmp, ARTICLE_NONE, (char *)0, EXACT_NAME, FALSE); } /* pet name: "your little dog" */ char * -y_monnam(mtmp) -struct monst *mtmp; +y_monnam(struct monst *mtmp) { int prefix, suppression_flag; @@ -1956,9 +1912,7 @@ struct monst *mtmp; } char * -Adjmonnam(mtmp, adj) -struct monst *mtmp; -const char *adj; +Adjmonnam(struct monst *mtmp, const char *adj) { char *bp = x_monnam(mtmp, ARTICLE_THE, adj, has_mgivenname(mtmp) ? SUPPRESS_SADDLE : 0, FALSE); @@ -1968,16 +1922,14 @@ const char *adj; } char * -a_monnam(mtmp) -register struct monst *mtmp; +a_monnam(register struct monst *mtmp) { return x_monnam(mtmp, ARTICLE_A, (char *)0, has_mgivenname(mtmp) ? SUPPRESS_SADDLE : 0, FALSE); } char * -Amonnam(mtmp) -struct monst *mtmp; +Amonnam(struct monst *mtmp) { char *bp = a_monnam(mtmp); @@ -1988,10 +1940,10 @@ struct monst *mtmp; /* used for monster ID by the '/', ';', and 'C' commands to block remote identification of the endgame altars via their attending priests */ char * -distant_monnam(mon, article, outbuf) -struct monst *mon; -int article; /* only ARTICLE_NONE and ARTICLE_THE are handled here */ -char *outbuf; +distant_monnam(struct monst *mon, int article, char *outbuf) + + /* only ARTICLE_NONE and ARTICLE_THE are handled here */ + { /* high priest(ess)'s identity is concealed on the Astral Plane, unless you're adjacent (overridden for hallucination which does @@ -2009,8 +1961,7 @@ char *outbuf; /* returns mon_nam(mon) relative to other_mon; normal name unless they're the same, in which case the reference is to {him|her|it} self */ char * -mon_nam_too(mon, other_mon) -struct monst *mon, *other_mon; +mon_nam_too(struct monst *mon, struct monst *other_mon) { char *outbuf; @@ -2036,9 +1987,7 @@ struct monst *mon, *other_mon; /* for debugging messages, where data might be suspect and we aren't taking what the hero does or doesn't know into consideration */ char * -minimal_monnam(mon, ckloc) -struct monst *mon; -boolean ckloc; +minimal_monnam(struct monst *mon, boolean ckloc) { struct permonst *ptr; char *outbuf = nextmbuf(); @@ -2344,7 +2293,7 @@ static const char * const bogusmons[] = { * with this without radically modifying the calling functions. */ const char * -rndmonnam() +rndmonnam(void) { int name; @@ -2359,8 +2308,7 @@ rndmonnam() /* check bogusmon prefix to decide whether it's a personal name */ boolean -bogon_is_pname(code) -char code; +bogon_is_pname(char code) { if (!code) return FALSE; @@ -2370,7 +2318,7 @@ char code; #ifdef REINCARNATION /* Name of a Rogue player */ const char * -roguename() +roguename(void) { char *i, *opts; @@ -2402,8 +2350,7 @@ static NEARDATA const char * const hcolors[] = { }; const char * -hcolor(colorpref) -const char *colorpref; +hcolor(const char *colorpref) { return (Hallucination || !colorpref) ? hcolors[rn2(SIZE(hcolors))] : colorpref; @@ -2411,7 +2358,7 @@ const char *colorpref; /* return a random real color unless hallucinating */ const char * -rndcolor() +rndcolor(void) { int k = rn2(CLR_MAX); @@ -2430,8 +2377,7 @@ static NEARDATA const char *const hliquids[] = { }; const char * -hliquid(liquidpref) -const char *liquidpref; +hliquid(const char *liquidpref) { return (Hallucination || !liquidpref) ? hliquids[rn2(SIZE(hliquids))] : liquidpref; @@ -2454,9 +2400,7 @@ static const char * const coynames[] = { }; char * -coyotename(mtmp, buf) -struct monst *mtmp; -char *buf; +coyotename(struct monst *mtmp, char *buf) { if (mtmp && buf) { Sprintf(buf, "%s - %s", @@ -2468,8 +2412,7 @@ char *buf; } char * -rndorcname(s) -char *s; +rndorcname(char *s) { static const char *v[] = { "a", "ai", "og", "u" }; static const char *snd[] = { "gor", "gris", "un", "bane", "ruk", @@ -2488,9 +2431,7 @@ char *s; } struct monst * -christen_orc(mtmp, gang, other) -struct monst *mtmp; -const char *gang, *other; +christen_orc(struct monst *mtmp, const char *gang, const char *other) { int sz = 0; char buf[BUFSZ], buf2[BUFSZ], *orcname; @@ -2538,8 +2479,7 @@ static const char *const sir_Terry_novels[] = { }; const char * -noveltitle(novidx) -int *novidx; +noveltitle(int *novidx) { int j, k = SIZE(sir_Terry_novels); @@ -2554,9 +2494,7 @@ int *novidx; } const char * -lookup_novel(lookname, idx) -const char *lookname; -int *idx; +lookup_novel(const char *lookname, int *idx) { int k; @@ -2583,8 +2521,7 @@ int *idx; * This is in do_name.c only because it gives us access to nextmbuf(). */ char * -mon_wounds(mon) -struct monst *mon; +mon_wounds(struct monst *mon) { char *outbuf; const struct permonst *mdat = mon->data; @@ -2643,9 +2580,7 @@ struct monst *mon; * function; the caller must save its initial HP to pass through to this. */ void -print_mon_wounded(mon, pre_wound_hp) -struct monst *mon; -int pre_wound_hp; +print_mon_wounded(struct monst *mon, int pre_wound_hp) { int mcurrhp; char *m_old_wounds, *m_curr_wounds; diff --git a/src/do_wear.c b/src/do_wear.c index b924ad661..86a0a2ffd 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -31,26 +31,25 @@ static NEARDATA const long takeoff_order[] = { WORN_BLINDF, W_WEP, WORN_BOOTS, W_SWAPWEP, W_QUIVER, 0L }; static void on_msg(struct obj *); -static int Armor_on(); -static int Cloak_on(); -static int Helmet_on(); -static int Gloves_on(); -static int Shield_on(); -static int Shirt_on(); -static void Amulet_on(); -static void learnring(struct obj *, BOOLEAN_P); -static void Ring_off_or_gone(struct obj *, BOOLEAN_P); +static int Armor_on(void); +static int Cloak_on(void); +static int Helmet_on(void); +static int Gloves_on(void); +static int Shield_on(void); +static int Shirt_on(void); +static void Amulet_on(void); +static void learnring(struct obj *, boolean); +static void Ring_off_or_gone(struct obj *, boolean); static int select_off(struct obj *); -static struct obj *do_takeoff(); -static int take_off(); +static struct obj *do_takeoff(void); +static int take_off(void); static int menu_remarm(int); static void already_wearing(const char*); static void already_wearing2(const char*, const char*); /* plural "fingers" or optionally "gloves" */ const char * -fingers_or_gloves(check_gloves) -boolean check_gloves; +fingers_or_gloves(boolean check_gloves) { return ((check_gloves && uarmg) ? gloves_simple_name(uarmg) : /* "gloves" or "gauntlets" */ @@ -58,8 +57,7 @@ boolean check_gloves; } void -off_msg(otmp) -struct obj *otmp; +off_msg(struct obj *otmp) { if(flags.verbose) You("were wearing %s.", doname(otmp)); @@ -67,8 +65,7 @@ struct obj *otmp; /* for items that involve no delay */ static void -on_msg(otmp) -register struct obj *otmp; +on_msg(register struct obj *otmp) { if (flags.verbose) { char how[BUFSZ]; @@ -91,10 +88,10 @@ static boolean initial_don = FALSE; /* manipulated in set_wear() */ /* putting on or taking off an item which confers stealth; give feedback and discover it iff stealth state is changing */ static void -toggle_stealth(obj, oldprop, on) -struct obj *obj; -long oldprop; /* prop[].extrinsic, with obj->owornmask stripped by caller */ -boolean on; +toggle_stealth(struct obj *obj, long int oldprop, boolean on) + + /* prop[].extrinsic, with obj->owornmask stripped by caller */ + { if (on ? initial_don : cancelled_don) { return; @@ -127,10 +124,10 @@ boolean on; give feedback and discover it iff displacement state is changing *and* hero is able to see self (or sense monsters) */ static void -toggle_displacement(obj, oldprop, on) -struct obj *obj; -long oldprop; /* prop[].extrinsic, with obj->owornmask stripped by caller */ -boolean on; +toggle_displacement(struct obj *obj, long int oldprop, boolean on) + + /* prop[].extrinsic, with obj->owornmask stripped by caller */ + { if (on ? initial_don : cancelled_don) { return; @@ -164,7 +161,7 @@ boolean on; */ int -Boots_on() +Boots_on(void) { if (!uarmf) { return 0; @@ -238,7 +235,7 @@ Boots_on() } int -Boots_off() +Boots_off(void) { struct obj *otmp = uarmf; int otyp = uarmf->otyp; @@ -309,7 +306,7 @@ Boots_off() } static int -Cloak_on() +Cloak_on(void) { long oldprop; if (!uarmc) return 0; @@ -391,7 +388,7 @@ Cloak_on() } int -Cloak_off() +Cloak_off(void) { struct obj *otmp = uarmc; int otyp = uarmc->otyp; @@ -457,7 +454,7 @@ Cloak_off() } static int -Helmet_on() +Helmet_on(void) { if (!uarmh) { return 0; @@ -540,7 +537,7 @@ Helmet_on() } int -Helmet_off() +Helmet_off(void) { takeoff_mask &= ~W_ARMH; @@ -598,7 +595,7 @@ Helmet_off() } static int -Gloves_on() +Gloves_on(void) { if (!uarmg) { return 0; @@ -637,9 +634,9 @@ Gloves_on() } static void -wielding_corpse(obj, voluntary) -struct obj *obj; -boolean voluntary; /* taking gloves off on purpose? */ +wielding_corpse( + struct obj *obj, + boolean voluntary) /**< taking gloves off on purpose? */ { char kbuf[BUFSZ]; @@ -663,7 +660,7 @@ boolean voluntary; /* taking gloves off on purpose? */ } int -Gloves_off() +Gloves_off(void) { long oldprop = u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES; boolean on_purpose = !flags.mon_moving && !uarmg->in_use; @@ -720,7 +717,7 @@ Gloves_off() } static int -Shield_on() +Shield_on(void) { /* no shield currently requires special handling when put on, but we keep this uncommented in case somebody adds a new one which does @@ -750,7 +747,7 @@ Shield_on() } int -Shield_off() +Shield_off(void) { takeoff_mask &= ~W_ARMS; @@ -774,7 +771,7 @@ Shield_off() } static int -Shirt_on() +Shirt_on(void) { /* no shirt currently requires special handling when put on, but we keep this uncommented in case somebody adds a new one which does */ @@ -797,7 +794,7 @@ Shirt_on() } int -Shirt_off() +Shirt_off(void) { takeoff_mask &= ~W_ARMU; @@ -816,13 +813,13 @@ Shirt_off() } int -lucky_fedora() +lucky_fedora(void) { return 1; } static int -Armor_on() +Armor_on(void) { if (uarm && Is_glowing_dragon_armor(uarm->otyp)) { begin_burn(uarm, FALSE); @@ -856,7 +853,7 @@ Armor_on() return 0; } static void -Armor_off_sub() +Armor_off_sub(void) { switch (uarm->otyp) { case CHROMATIC_DRAGON_SCALES: @@ -878,7 +875,7 @@ Armor_off_sub() } int -Armor_off() +Armor_off(void) { if (uarm && Is_glowing_dragon_armor(uarm->otyp)) { end_burn(uarm, FALSE); @@ -900,7 +897,7 @@ Armor_off() * repeating.] */ int -Armor_gone() +Armor_gone(void) { if (uarm && Is_glowing_dragon_armor(uarm->otyp)) end_burn(uarm, FALSE); @@ -912,7 +909,7 @@ Armor_gone() } static void -Amulet_on() +Amulet_on(void) { if (!uamul) { return; @@ -1014,7 +1011,7 @@ Amulet_on() } void -Amulet_off() +Amulet_off(void) { takeoff_mask &= ~W_AMUL; @@ -1088,9 +1085,7 @@ Amulet_off() /* handle ring discovery; comparable to learnwand() */ static void -learnring(ring, observed) -struct obj *ring; -boolean observed; +learnring(struct obj *ring, boolean observed) { int ringtype = ring->otyp; @@ -1122,8 +1117,7 @@ boolean observed; } void -Ring_on(obj) -register struct obj *obj; +Ring_on(register struct obj *obj) { long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic; int old_attrib, which; @@ -1275,9 +1269,7 @@ register struct obj *obj; } static void -Ring_off_or_gone(obj, gone) -register struct obj *obj; -boolean gone; +Ring_off_or_gone(register struct obj *obj, boolean gone) { long mask = (obj->owornmask & W_RING); int old_attrib, which; @@ -1416,22 +1408,19 @@ boolean gone; } void -Ring_off(obj) -struct obj *obj; +Ring_off(struct obj *obj) { Ring_off_or_gone(obj, FALSE); } void -Ring_gone(obj) -struct obj *obj; +Ring_gone(struct obj *obj) { Ring_off_or_gone(obj, TRUE); } void -Blindf_on(otmp) -register struct obj *otmp; +Blindf_on(register struct obj *otmp) { boolean already_blind = Blind, changed = FALSE; @@ -1458,8 +1447,7 @@ register struct obj *otmp; } void -Blindf_off(otmp) -register struct obj *otmp; +Blindf_off(register struct obj *otmp) { boolean was_blind = Blind, changed = FALSE; @@ -1499,7 +1487,7 @@ register struct obj *otmp; /* called in main to set intrinsics of worn start-up items */ void -set_wear() +set_wear(void) { if (uarmu) (void) Shirt_on(); if (uarm) (void) Armor_on(); @@ -1512,8 +1500,8 @@ set_wear() /* check whether the target object is currently being put on (or taken off) */ boolean -donning(otmp) /* also checks for doffing */ -register struct obj *otmp; +donning(register struct obj *otmp) /* also checks for doffing */ + { /* long what = (occupation == take_off) ? taking_off : 0L; */ long what = taking_off; /* if nonzero, occupation is implied */ @@ -1548,8 +1536,7 @@ register struct obj *otmp; so that stop_donning() and steal() can vary messages and doname() can vary "(being worn)" suffix */ boolean -doffing(otmp) -struct obj *otmp; +doffing(struct obj *otmp) { long what = taking_off; boolean result = FALSE; @@ -1591,9 +1578,7 @@ struct obj *otmp; /* despite their names, cancel_don() and cancel_doff() both apply to both donning and doffing... */ void -cancel_doff(obj, slotmask) -struct obj *obj; -long slotmask; +cancel_doff(struct obj *obj, long int slotmask) { /* Called by setworn() for old item in specified slot or by setnotworn() * for specified item. We don't want to call cancel_don() if we got @@ -1613,7 +1598,7 @@ long slotmask; /* despite their names, cancel_don() and cancel_doff() both apply to both donning and doffing... */ void -cancel_don() +cancel_don(void) { /* the piece of armor we were donning/doffing has vanished, so stop * wasting time on it (and don't dereference it when donning would @@ -1630,8 +1615,7 @@ cancel_don() /* called by steal() during theft from hero; interrupt donning/doffing */ int -stop_donning(stolenobj) -struct obj *stolenobj; /* no message if stolenobj is already being doffing */ +stop_donning(struct obj *stolenobj) /**< no message if stolenobj is already being doffing */ { char buf[BUFSZ]; struct obj *otmp; @@ -1683,9 +1667,9 @@ static NEARDATA int Narmorpieces, Naccessories; /* assign values to Narmorpieces and Naccessories */ static void -count_worn_stuff(which, accessorizing) -struct obj **which; /* caller wants this when count is 1 */ -boolean accessorizing; +count_worn_stuff(struct obj **which, boolean accessorizing) + /* caller wants this when count is 1 */ + { struct obj *otmp; @@ -1724,8 +1708,7 @@ boolean accessorizing; /* take off one piece or armor or one accessory; shared by dotakeoff('T') and doremring('R') */ static int -armor_or_accessory_off(obj) -struct obj *obj; +armor_or_accessory_off(struct obj *obj) { if (!(obj->owornmask & (W_ARMOR | W_ACCESSORY))) { You("are not wearing that."); @@ -1790,7 +1773,7 @@ struct obj *obj; /* the 'T' command */ int -dotakeoff() +dotakeoff(void) { struct obj *otmp = (struct obj *)0; int armorpieces = 0; @@ -1818,7 +1801,7 @@ dotakeoff() /* the 'R' command */ int -doremring() +doremring(void) { struct obj *otmp = 0; @@ -1839,8 +1822,7 @@ doremring() /* Check if something worn is cursed _and_ unremovable. */ int -cursed(otmp) -struct obj *otmp; +cursed(struct obj *otmp) { if (!otmp) { impossible("cursed without otmp"); @@ -1867,8 +1849,7 @@ struct obj *otmp; } int -armoroff(otmp) -struct obj *otmp; +armoroff(struct obj *otmp) { static char offdelaybuf[60]; int delay = -objects[otmp->otyp].oc_delay; @@ -1953,15 +1934,13 @@ struct obj *otmp; } static void -already_wearing(cc) -const char *cc; +already_wearing(const char *cc) { You("are already wearing %s%c", cc, (cc == c_that_) ? '!' : '.'); } static void -already_wearing2(cc1, cc2) -const char *cc1, *cc2; +already_wearing2(const char *cc1, const char *cc2) { You_cant("wear %s because you're wearing %s there already.", cc1, cc2); } @@ -1974,10 +1953,7 @@ const char *cc1, *cc2; * output: mask (otmp's armor type) */ int -canwearobj(otmp, mask, noisy) -struct obj *otmp; -long *mask; -boolean noisy; +canwearobj(struct obj *otmp, long int *mask, boolean noisy) { int err = 0; const char *which; @@ -2140,8 +2116,7 @@ boolean noisy; } static int -accessory_or_armor_on(obj) -struct obj *obj; +accessory_or_armor_on(struct obj *obj) { long mask = 0L; boolean armor, ring, eyewear; @@ -2348,7 +2323,7 @@ struct obj *obj; /* the 'W' command */ int -dowear() +dowear(void) { struct obj *otmp; @@ -2371,7 +2346,7 @@ dowear() } int -doputon() +doputon(void) { struct obj *otmp; @@ -2389,7 +2364,7 @@ doputon() /* calculate current armor class */ void -find_ac() +find_ac(void) { int uac = mons[u.umonnum].ac; @@ -2429,7 +2404,7 @@ find_ac() } void -glibr() +glibr(void) { register struct obj *otmp; int xfl = 0; @@ -2523,8 +2498,7 @@ glibr() } struct obj * -some_armor(victim) -struct monst *victim; +some_armor(struct monst *victim) { register struct obj *otmph, *otmp; @@ -2547,9 +2521,7 @@ struct monst *victim; /* used for praying to check and fix levitation trouble */ struct obj * -stuck_ring(ring, otyp) -struct obj *ring; -int otyp; +stuck_ring(struct obj *ring, int otyp) { if (ring != uleft && ring != uright) { warning("stuck_ring: neither left nor right?"); @@ -2577,7 +2549,7 @@ int otyp; /* also for praying; find worn item that confers "Unchanging" attribute */ struct obj * -unchanger() +unchanger(void) { if (uamul && uamul->otyp == AMULET_OF_UNCHANGING) return uamul; return 0; @@ -2585,8 +2557,7 @@ unchanger() /* occupation callback for 'A' */ static int -select_off(otmp) -register struct obj *otmp; +select_off(register struct obj *otmp) { struct obj *why; char buf[BUFSZ]; @@ -2689,7 +2660,7 @@ register struct obj *otmp; } static struct obj * -do_takeoff() +do_takeoff(void) { struct obj *otmp = (struct obj *) 0; @@ -2750,7 +2721,7 @@ static const char *disrobing = ""; /* occupation callback for 'A' */ static int -take_off() +take_off(void) { register int i; register struct obj *otmp; @@ -2833,7 +2804,7 @@ take_off() /* clear saved context to avoid inappropriate resumption of interrupted 'A' */ void -reset_remarm() +reset_remarm(void) { taking_off = takeoff_mask = 0L; disrobing = nul; @@ -2841,7 +2812,7 @@ reset_remarm() /* the 'A' command -- remove multiple worn items */ int -doddoremarm() +doddoremarm(void) { int result = 0; @@ -2877,8 +2848,7 @@ doddoremarm() } static int -menu_remarm(retry) -int retry; +menu_remarm(int retry) { int n, i = 0; menu_item *pick_list; @@ -2932,8 +2902,7 @@ int retry; /* hit by destroy armor scroll/black dragon breath/monster spell */ int -destroy_arm(atmp) -register struct obj *atmp; +destroy_arm(register struct obj *atmp) { register struct obj *otmp; #define DESTROY_ARM(o) ((otmp = (o)) != 0 && \ @@ -2989,9 +2958,7 @@ register struct obj *atmp; } void -adj_abon(otmp, delta) -register struct obj *otmp; -register schar delta; +adj_abon(register struct obj *otmp, register schar delta) { if (uarmg && uarmg == otmp && otmp->otyp == GAUNTLETS_OF_DEXTERITY) { if (delta) { @@ -3014,10 +2981,10 @@ register schar delta; used for dipping into liquid and applying grease; some criteria are different than select_off()'s */ boolean -inaccessible_equipment(obj, verb, only_if_known_cursed) -struct obj *obj; -const char *verb; /* "dip" or "grease", or null to avoid messages */ -boolean only_if_known_cursed; /* ignore covering unless known to be cursed */ +inaccessible_equipment( + struct obj *obj, + const char *verb, /**< "dip" or "grease", or null to avoid messages */ + boolean only_if_known_cursed) /**< ignore covering unless known to be cursed */ { static NEARDATA const char need_to_take_off_outer_armor[] = "need to take off %s to %s %s."; char buf[BUFSZ]; diff --git a/src/dog.c b/src/dog.c index eb7e0c315..950b773fa 100644 --- a/src/dog.c +++ b/src/dog.c @@ -3,11 +3,10 @@ #include "hack.h" -static int pet_type(); +static int pet_type(void); void -newedog(mtmp) -struct monst *mtmp; +newedog(struct monst *mtmp) { if (!mtmp->mextra) { mtmp->mextra = newmextra(); @@ -19,8 +18,7 @@ struct monst *mtmp; } void -free_edog(mtmp) -struct monst *mtmp; +free_edog(struct monst *mtmp) { if (mtmp->mextra && EDOG(mtmp)) { free((genericptr_t) EDOG(mtmp)); @@ -30,8 +28,7 @@ struct monst *mtmp; } void -initedog(mtmp) -register struct monst *mtmp; +initedog(register struct monst *mtmp) { mtmp->mtame = is_domestic(mtmp->data) ? 10 : 5; mtmp->mpeaceful = 1; @@ -53,7 +50,7 @@ register struct monst *mtmp; } static int -pet_type() +pet_type(void) { if (urole.petnum != NON_PM) return (urole.petnum); @@ -77,10 +74,7 @@ pet_type() } struct monst * -make_familiar(otmp, x, y, quietly) -register struct obj *otmp; -xchar x, y; -boolean quietly; +make_familiar(register struct obj *otmp, xchar x, xchar y, boolean quietly) { struct permonst *pm; struct monst *mtmp = 0; @@ -162,7 +156,7 @@ boolean quietly; } struct monst * -makedog() +makedog(void) { register struct monst *mtmp; register struct obj *otmp; @@ -248,7 +242,7 @@ makedog() /* record `last move time' for all monsters prior to level save so that mon_arrive() can catch up for lost time when they're restored later */ void -update_mlstmv() +update_mlstmv(void) { struct monst *mon; @@ -263,7 +257,7 @@ update_mlstmv() } void -losedogs() +losedogs(void) { struct monst *mtmp, *mtmp0, *mtmp2; int dismissKops = 0; @@ -346,9 +340,7 @@ losedogs() /* called from resurrect() in addition to losedogs() */ void -mon_arrive(mtmp, with_you) -struct monst *mtmp; -boolean with_you; +mon_arrive(struct monst *mtmp, boolean with_you) { struct trap *t; xchar xlocale, ylocale, xyloc, xyflags, wander; @@ -515,9 +507,9 @@ boolean with_you; /* heal monster for time spent elsewhere */ void -mon_catchup_elapsed_time(mtmp, nmv) -struct monst *mtmp; -long nmv; /* number of moves */ +mon_catchup_elapsed_time( + struct monst *mtmp, + long int nmv) /**< number of moves */ { int imv = 0; /* avoid zillions of casts and lint warnings */ @@ -619,8 +611,7 @@ long nmv; /* number of moves */ /* called when you move to another level */ void -keepdogs(pets_only) -boolean pets_only; /* true for ascension or final escape */ +keepdogs(boolean pets_only) /**< TRUE for ascension or final escape */ { register struct monst *mtmp, *mtmp2; register struct obj *obj; @@ -745,11 +736,11 @@ boolean pets_only; /* true for ascension or final escape */ } void -migrate_to_level(mtmp, tolev, xyloc, cc) -register struct monst *mtmp; -xchar tolev; /* destination level */ -xchar xyloc; /* MIGR_xxx destination xy location: */ -coord *cc; /* optional destination coordinates */ +migrate_to_level( + struct monst *mtmp, + xchar tolev, /**< destination level */ + xchar xyloc, /**< MIGR_xxx destination xy location: */ + coord *cc) /**< optional destination coordinates */ { struct obj *obj; d_level new_lev; @@ -807,9 +798,7 @@ coord *cc; /* optional destination coordinates */ /* return quality of food; the lower the better */ /* fungi will eat even tainted food */ int -dogfood(mon, obj) -struct monst *mon; -register struct obj *obj; +dogfood(struct monst *mon, register struct obj *obj) { struct permonst *mptr = mon->data, *fptr = 0; boolean carni = carnivorous(mptr); @@ -958,9 +947,7 @@ register struct obj *obj; * succeeded. */ boolean -tamedog(mtmp, obj) -struct monst *mtmp; -struct obj *obj; +tamedog(struct monst *mtmp, struct obj *obj) { /* The Wiz, Medusa and the quest nemeses aren't even made peaceful. */ if (mtmp->iswiz || mtmp->data == &mons[PM_MEDUSA] @@ -1076,9 +1063,7 @@ struct obj *obj; * If the pet wasn't abused and was very tame, it might revive tame. */ void -wary_dog(mtmp, was_dead) -struct monst *mtmp; -boolean was_dead; +wary_dog(struct monst *mtmp, boolean was_dead) { struct edog *edog; boolean quietly = was_dead; @@ -1156,8 +1141,7 @@ boolean was_dead; } void -abuse_dog(mtmp) -struct monst *mtmp; +abuse_dog(struct monst *mtmp) { if (!mtmp->mtame) { return; diff --git a/src/dogmove.c b/src/dogmove.c index 474c802ef..ed86a7eb9 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -16,14 +16,13 @@ static int find_friends(struct monst *, struct monst *, int); static struct monst *best_target(struct monst *); static long score_targ(struct monst *, struct monst *); -static boolean can_reach_location(struct monst *, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); -static boolean could_reach_item(struct monst *, XCHAR_P, XCHAR_P); +static boolean can_reach_location(struct monst *, xchar, xchar, xchar, xchar); +static boolean could_reach_item(struct monst *, xchar, xchar); static void quickmimic(struct monst *); /* pick a carried item for pet to drop */ struct obj * -droppables(mon) -struct monst *mon; +droppables(struct monst *mon) { struct obj *obj, *wep, *pickaxe, *unihorn, *key; static struct obj dummy; @@ -142,8 +141,7 @@ static xchar gtyp, gx, gy; /* type and position of dog's current goal */ static void wantdoor(int, int, genericptr_t); boolean -cursed_object_at(x, y) -int x, y; +cursed_object_at(int x, int y) { struct obj *otmp; @@ -153,9 +151,7 @@ int x, y; } int -dog_nutrition(mtmp, obj) -struct monst *mtmp; -struct obj *obj; +dog_nutrition(struct monst *mtmp, struct obj *obj) { int nutrit; @@ -203,11 +199,11 @@ struct obj *obj; /* returns 2 if pet dies, otherwise 1 */ int -dog_eat(mtmp, obj, x, y, devour) -struct monst *mtmp; -struct obj *obj; /* if unpaid, then thrown or kicked by hero */ -int x, y; /* dog's starting location, might be different from current */ -boolean devour; +dog_eat(struct monst *mtmp, struct obj *obj, int x, int y, boolean devour) + + /* if unpaid, then thrown or kicked by hero */ + /* dog's starting location, might be different from current */ + { register struct edog *edog = EDOG(mtmp); boolean poly, grow, heal, eyes, slimer, deadmimic; @@ -386,9 +382,7 @@ boolean devour; /* hunger effects -- returns TRUE on starvation */ static boolean -dog_hunger(mtmp, edog) -struct monst *mtmp; -struct edog *edog; +dog_hunger(struct monst *mtmp, struct edog *edog) { if (monstermoves > edog->hungrytime + 500) { if (!carnivorous(mtmp->data) && !herbivorous(mtmp->data)) { @@ -433,10 +427,7 @@ struct edog *edog; * returns 1 if object eaten (since that counts as dog's move), 2 if died */ static int -dog_invent(mtmp, edog, udist) -struct monst *mtmp; -struct edog *edog; -int udist; +dog_invent(struct monst *mtmp, struct edog *edog, int udist) { register int omx, omy, carryamt = 0; struct obj *obj, *otmp; @@ -505,10 +496,7 @@ int udist; * returns -1/0/1 (dog's desire to approach player) or -2 (abort move) */ static int -dog_goal(mtmp, edog, after, udist, whappr) -register struct monst *mtmp; -struct edog *edog; -int after, udist, whappr; +dog_goal(register struct monst *mtmp, struct edog *edog, int after, int udist, int whappr) { register int omx, omy; boolean in_masters_sight, dog_has_minvent; @@ -648,10 +636,7 @@ int after, udist, whappr; } static struct monst * -find_targ(mtmp, dx, dy, maxdist) -register struct monst *mtmp; -int dx, dy; -int maxdist; +find_targ(register struct monst *mtmp, int dx, int dy, int maxdist) { struct monst *targ = 0; int curx = mtmp->mx, cury = mtmp->my; @@ -694,9 +679,7 @@ int maxdist; } static int -find_friends(mtmp, mtarg, maxdist) -struct monst *mtmp, *mtarg; -int maxdist; +find_friends(struct monst *mtmp, struct monst *mtarg, int maxdist) { struct monst *pal; int dx = sgn(mtarg->mx - mtmp->mx); @@ -745,8 +728,7 @@ int maxdist; } static long -score_targ(mtmp, mtarg) -struct monst *mtmp, *mtarg; +score_targ(struct monst *mtmp, struct monst *mtarg) { long score = 0L; @@ -855,8 +837,7 @@ struct monst *mtmp, *mtarg; } static struct monst * -best_target(mtmp) -struct monst *mtmp; /* Pet */ +best_target(struct monst *mtmp) /**< Pet */ { int dx, dy; long bestscore = -40000L, currscore; @@ -912,9 +893,8 @@ struct monst *mtmp; /* Pet */ /* return 0 (no move), 1 (move) or 2 (dead) */ int -dog_move(mtmp, after) -register struct monst *mtmp; -int after; /* this is extra fast monster movement */ +dog_move(struct monst *mtmp, + int after) /**< this is extra fast monster movement */ { int appr, whappr, udist; int i, j, k; @@ -1323,9 +1303,7 @@ nxti: ; /* check if a monster could pick up objects from a location */ static boolean -could_reach_item(mon, nx, ny) -struct monst *mon; -xchar nx, ny; +could_reach_item(struct monst *mon, xchar nx, xchar ny) { if ((!is_pool(nx, ny) || is_swimmer(mon->data)) && (!is_lava(nx, ny) || likes_lava(mon->data)) && @@ -1342,9 +1320,7 @@ xchar nx, ny; * deep. */ static boolean -can_reach_location(mon, mx, my, fx, fy) -struct monst *mon; -xchar mx, my, fx, fy; +can_reach_location(struct monst *mon, xchar mx, xchar my, xchar fx, xchar fy) { int i, j; int dist; @@ -1376,9 +1352,7 @@ xchar mx, my, fx, fy; /* do_clear_area client */ static void -wantdoor(x, y, distance) -int x, y; -genericptr_t distance; +wantdoor(int x, int y, genericptr_t distance) { int ndist; @@ -1408,8 +1382,7 @@ static struct qmchoices { }; void -finish_meating(mtmp) -struct monst *mtmp; +finish_meating(struct monst *mtmp) { mtmp->meating = 0; if (M_AP_TYPE(mtmp) && mtmp->mappearance && mtmp->cham == NON_PM) { @@ -1421,8 +1394,7 @@ struct monst *mtmp; } static void -quickmimic(mtmp) -struct monst *mtmp; +quickmimic(struct monst *mtmp) { int idx = 0, trycnt = 5, spotted; char buf[BUFSZ]; diff --git a/src/dokick.c b/src/dokick.c index c72688b30..773a0b078 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -12,23 +12,21 @@ static NEARDATA const char *gate_str; extern boolean notonhead; /* for long worms */ -static void kickdmg(struct monst *, BOOLEAN_P); -static boolean maybe_kick_monster(struct monst *, XCHAR_P, XCHAR_P); -static void kick_monster(struct monst *, XCHAR_P, XCHAR_P); -static void lawful_bribery_alignment(SCHAR_P); -static int kick_object(XCHAR_P, XCHAR_P, char *); -static int kick_object_core(XCHAR_P, XCHAR_P); +static void kickdmg(struct monst *, boolean); +static boolean maybe_kick_monster(struct monst *, xchar, xchar); +static void kick_monster(struct monst *, xchar, xchar); +static void lawful_bribery_alignment(schar); +static int kick_object(xchar, xchar, char *); +static int kick_object_core(xchar, xchar); static char *kickstr(char *, const char *); -static void otransit_msg(struct obj *, BOOLEAN_P, long); -static void drop_to(coord *, SCHAR_P); +static void otransit_msg(struct obj *, boolean, long); +static void drop_to(coord *, schar); static const char kick_passes_thru[] = "kick passes harmlessly through"; /* kicking damage when not poly'd into a form with a kick attack */ static void -kickdmg(mon, clumsy) -struct monst *mon; -boolean clumsy; +kickdmg(struct monst *mon, boolean clumsy) { int mdx, mdy; int dmg = ( ACURRSTR + ACURR(A_DEX) + ACURR(A_CON) )/ 15; @@ -120,9 +118,7 @@ boolean clumsy; } static boolean -maybe_kick_monster(mon, x, y) -struct monst *mon; -xchar x, y; +maybe_kick_monster(struct monst *mon, xchar x, xchar y) { if (mon) { boolean save_forcefight = flags.forcefight; @@ -144,9 +140,7 @@ xchar x, y; } static void -kick_monster(mon, x, y) -struct monst *mon; -xchar x, y; +kick_monster(struct monst *mon, xchar x, xchar y) { boolean clumsy = FALSE; int i, j; @@ -291,9 +285,7 @@ xchar x, y; * The gold object is *not* attached to the fobj chain! */ boolean -ghitm(mtmp, gold) -register struct monst *mtmp; -register struct obj *gold; +ghitm(register struct monst *mtmp, register struct obj *gold) { boolean msg_given = FALSE; #ifdef WEBB_DISINT @@ -418,8 +410,7 @@ register struct obj *gold; } void -lawful_bribery_alignment(penalty) -register schar penalty; +lawful_bribery_alignment(register schar penalty) { if ((u.ualign.type == A_LAWFUL) && (u.ualign.record > -10)) { adjalign(penalty); @@ -431,9 +422,9 @@ register schar penalty; /* container is kicked, dropped, thrown or otherwise impacted by player. * Assumes container is on floor. Checks contents for possible damage. */ void -container_impact_dmg(obj, x, y) -struct obj *obj; -xchar x, y; /* coordinates where object was before the impact, not after */ +container_impact_dmg( + struct obj *obj, + xchar x, xchar y) /**< coordinates where object was before the impact, not after */ { struct monst *shkp; struct obj *otmp, *otmp2; @@ -500,9 +491,7 @@ xchar x, y; /* coordinates where object was before the impact, not after */ /* jacket around kick_object_core */ static int -kick_object(x, y, kickobjnam) -xchar x, y; -char *kickobjnam; +kick_object(xchar x, xchar y, char *kickobjnam) { int res = 0; @@ -520,8 +509,7 @@ char *kickobjnam; /* guts of kick_object */ static int -kick_object_core(x, y) -xchar x, y; +kick_object_core(xchar x, xchar y) { int range; struct monst *mon, *shkp = 0; @@ -789,9 +777,7 @@ xchar x, y; } static char * -kickstr(buf, kickobjnam) -char *buf; -const char *kickobjnam; +kickstr(char *buf, const char *kickobjnam) { const char *what; @@ -821,7 +807,7 @@ const char *kickobjnam; } int -dokick() +dokick(void) { int x, y; int avrg_attrib; @@ -1416,9 +1402,7 @@ dokick() } static void -drop_to(cc, loc) -coord *cc; -schar loc; +drop_to(coord *cc, schar loc) { /* cover all the MIGR_xxx choices generated by down_gate() */ switch (loc) { @@ -1454,10 +1438,10 @@ schar loc; /* player or missile impacts location, causing objects to fall down */ void -impact_drop(missile, x, y, dlev) -struct obj *missile; /* caused impact, won't drop itself */ -xchar x, y; /* location affected */ -xchar dlev; /* if !0 send to dlev near player */ +impact_drop( + struct obj *missile, /**< caused impact, won't drop itself */ + xchar x, xchar y, /**< location affected */ + xchar dlev) /**< if !0 send to dlev near player */ { schar toloc; register struct obj *obj, *obj2; @@ -1583,10 +1567,7 @@ xchar dlev; /* if !0 send to dlev near player */ * otmp is either a kicked, dropped, or thrown object. */ boolean -ship_object(otmp, x, y, shop_floor_obj) -xchar x, y; -struct obj *otmp; -boolean shop_floor_obj; +ship_object(struct obj *otmp, xchar x, xchar y, boolean shop_floor_obj) { schar toloc; xchar ox, oy; @@ -1698,8 +1679,7 @@ boolean shop_floor_obj; } void -obj_delivery(near_hero) -boolean near_hero; +obj_delivery(boolean near_hero) { register struct obj *otmp, *otmp2; register int nx, ny; @@ -1773,10 +1753,7 @@ boolean near_hero; } void -deliver_obj_to_mon(mtmp, cnt, deliverflags) -int cnt; -struct monst *mtmp; -unsigned long deliverflags; +deliver_obj_to_mon(struct monst *mtmp, int cnt, long unsigned int deliverflags) { struct obj *otmp, *otmp2; int where, maxobj = 1; @@ -1824,10 +1801,7 @@ unsigned long deliverflags; } static void -otransit_msg(otmp, nodrop, num) -register struct obj *otmp; -register boolean nodrop; -long num; +otransit_msg(register struct obj *otmp, register boolean nodrop, long int num) { char *optr = 0, obuf[BUFSZ], xbuf[BUFSZ]; @@ -1859,8 +1833,7 @@ long num; /* migration destination for objects which fall down to next level */ schar -down_gate(x, y) -xchar x, y; +down_gate(xchar x, xchar y) { struct trap *ttmp; diff --git a/src/dothrow.c b/src/dothrow.c index ad6b80cdc..a5b399528 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -7,13 +7,13 @@ static int throw_obj(struct obj *, int); static boolean ok_to_throw(int *); -static void autoquiver(); +static void autoquiver(void); static int gem_accept(struct monst *, struct obj *); -static void tmiss(struct obj *, struct monst *, BOOLEAN_P); +static void tmiss(struct obj *, struct monst *, boolean); static int throw_gold(struct obj *); -static void check_shop_obj(struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P); -static void breakmsg(struct obj *, BOOLEAN_P); -static boolean toss_up(struct obj *, BOOLEAN_P); +static void check_shop_obj(struct obj *, xchar, xchar, boolean); +static void breakmsg(struct obj *, boolean); +static boolean toss_up(struct obj *, boolean); static void sho_obj_return_to_u(struct obj *obj); static boolean mhurtle_step(genericptr_t, int, int); @@ -27,9 +27,7 @@ extern boolean notonhead; /* for long worms */ /* Throw the selected object, asking for direction */ static int -throw_obj(obj, shotlimit) -struct obj *obj; -int shotlimit; +throw_obj(struct obj *obj, int shotlimit) { struct obj *otmp; int multishot = 1; @@ -262,8 +260,7 @@ int shotlimit; /* common to dothrow() and dofire() */ static boolean -ok_to_throw(shotlimit_p) -int *shotlimit_p; /* (see dothrow()) */ +ok_to_throw(int *shotlimit_p) /**< (see dothrow()) */ { /* kludge to work around parse()'s pre-decrement of `multi' */ *shotlimit_p = (multi || save_cm) ? multi + 1 : 0; @@ -285,7 +282,7 @@ int *shotlimit_p; /* (see dothrow()) */ /* t command - throw */ int -dothrow() +dothrow(void) { register struct obj *obj; int shotlimit; @@ -317,7 +314,7 @@ dothrow() /* KMH -- Automatically fill quiver */ /* Suggested by Jeffrey Bay */ static void -autoquiver() +autoquiver(void) { struct obj *otmp, *oammo = 0, *omissile = 0, *omisc = 0, *altammo = 0; struct obj *oquiver = NULL; @@ -393,7 +390,7 @@ autoquiver() /* f command -- fire: throw from the quiver */ int -dofire() +dofire(void) { int shotlimit; struct obj *obj; @@ -469,8 +466,7 @@ dofire() /* if in midst of multishot shooting/throwing, stop early */ void -endmultishot(verbose) -boolean verbose; +endmultishot(boolean verbose) { if (m_shot.i < m_shot.n) { if (verbose && !flags.mon_moving) { @@ -487,9 +483,9 @@ boolean verbose; * Object hits floor at hero's feet. Called from drop() and throwit(). */ void -hitfloor(obj, verbosely) -struct obj *obj; -boolean verbosely; /* usually True; False if caller has given drop message */ +hitfloor( + struct obj *obj, + boolean verbosely) /* usually TRUE; FALSE if caller has given drop mesg */ { if (IS_SOFT(levl[u.ux][u.uy].typ) || u.uinwater || u.uswallow) { dropy(obj); @@ -515,11 +511,7 @@ boolean verbosely; /* usually True; False if caller has given drop message */ * before the failed callback. */ boolean -walk_path(src_cc, dest_cc, check_proc, arg) -coord *src_cc; -coord *dest_cc; -boolean (*check_proc)(genericptr_t, int, int); -genericptr_t arg; +walk_path(coord *src_cc, coord *dest_cc, boolean (*check_proc) (genericptr_t, int, int), genericptr_t arg) { int x, y, dx, dy, x_change, y_change, err, i, prev_x, prev_y; boolean keep_going = TRUE; @@ -600,9 +592,7 @@ genericptr_t arg; vs drag-to-dest; original callers use first mode, jumping wants second, grappling hook backfire and thrown chained ball need third */ boolean -hurtle_jump(arg, x, y) -genericptr_t arg; -int x, y; +hurtle_jump(genericptr_t arg, int x, int y) { boolean res; long save_EWwalking = EWwalking; @@ -633,9 +623,7 @@ int x, y; * o let jumps go over boulders */ boolean -hurtle_step(arg, x, y) -genericptr_t arg; -int x, y; +hurtle_step(genericptr_t arg, int x, int y) { int ox, oy, *range = (int *)arg; struct obj *obj; @@ -837,9 +825,7 @@ int x, y; } static boolean -mhurtle_step(arg, x, y) -genericptr_t arg; -int x, y; +mhurtle_step(genericptr_t arg, int x, int y) { struct monst *mon = (struct monst *)arg; @@ -866,9 +852,7 @@ int x, y; * kick or throw and be only. */ void -hurtle(dx, dy, range, verbose) -int dx, dy, range; -boolean verbose; +hurtle(int dx, int dy, int range, boolean verbose) { coord uc, cc; @@ -925,9 +909,7 @@ boolean verbose; /* Move a monster through the air for a few squares. */ void -mhurtle(mon, dx, dy, range) -struct monst *mon; -int dx, dy, range; +mhurtle(struct monst *mon, int dx, int dy, int range) { coord mc, cc; @@ -961,10 +943,7 @@ int dx, dy, range; } static void -check_shop_obj(obj, x, y, broken) -struct obj *obj; -xchar x, y; -boolean broken; +check_shop_obj(struct obj *obj, xchar x, xchar y, boolean broken) { boolean costly_xy; struct monst *shkp = shop_keeper(*u.ushops); @@ -1001,9 +980,7 @@ boolean broken; * Returns FALSE if the object is gone. */ static boolean -toss_up(obj, hitsroof) -struct obj *obj; -boolean hitsroof; +toss_up(struct obj *obj, boolean hitsroof) { const char *action; boolean petrifier = ((obj->otyp == EGG || obj->otyp == CORPSE) && @@ -1121,8 +1098,7 @@ boolean hitsroof; /* return true for weapon meant to be thrown; excludes ammo */ boolean -throwing_weapon(obj) -struct obj *obj; +throwing_weapon(struct obj *obj) { return (is_missile(obj) || is_spear(obj) || /* daggers and knife (excludes scalpel) */ @@ -1134,8 +1110,7 @@ struct obj *obj; /* the currently thrown object is returning to you (not for boomerangs) */ static void -sho_obj_return_to_u(obj) -struct obj *obj; +sho_obj_return_to_u(struct obj *obj) { /* might already be our location (bounced off a wall) */ if ((u.dx || u.dy) && (bhitpos.x != u.ux || bhitpos.y != u.uy)) { @@ -1153,10 +1128,11 @@ struct obj *obj; /* throw an object, NB: obj may be consumed in the process */ void -throwit(obj, wep_mask, twoweap) -struct obj *obj; -long wep_mask; /* used to re-equip returning boomerang */ -boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ +throwit( + struct obj *obj, + long wep_mask, /**< used to re-equip returning boomerang */ + boolean twoweap) /**< used to restore twoweapon mode if + wielded weapon returns */ { register struct monst *mon; register int range, urange; @@ -1551,10 +1527,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ /* an object may hit a monster; various factors adjust the chance of hitting */ int -omon_adj(mon, obj, mon_notices) -struct monst *mon; -struct obj *obj; -boolean mon_notices; +omon_adj(struct monst *mon, struct obj *obj, boolean mon_notices) { int tmp = 0; @@ -1592,10 +1565,7 @@ boolean mon_notices; /* thrown object misses target monster */ static void -tmiss(obj, mon, maybe_wakeup) -struct obj *obj; -struct monst *mon; -boolean maybe_wakeup; +tmiss(struct obj *obj, struct monst *mon, boolean maybe_wakeup) { const char *missile = mshot_xname(obj); @@ -1668,9 +1638,9 @@ befriend_with_obj(struct permonst *data, struct obj *obj) * Also used for kicked objects and for polearms/grapnel applied at range. */ int -thitmonst(mon, obj) -struct monst *mon; -struct obj *obj; /* thrownobj or kickedobj or uwep */ +thitmonst( + struct monst *mon, + struct obj *obj) /**< thrownobj or kickedobj or uwep */ { register int tmp; /* Base chance to hit */ register int disttmp; /* distance modifier */ @@ -1978,9 +1948,7 @@ struct obj *obj; /* thrownobj or kickedobj or uwep */ } static int -gem_accept(mon, obj) -register struct monst *mon; -register struct obj *obj; +gem_accept(register struct monst *mon, register struct obj *obj) { char buf[BUFSZ]; boolean is_buddy = sgn(mon->data->maligntyp) == sgn(u.ualign.type); @@ -2086,10 +2054,9 @@ register struct obj *obj; * Return 0 if the object didn't break, 1 if the object broke. */ int -hero_breaks(obj, x, y, from_invent) -struct obj *obj; -xchar x, y; /* object location (ox, oy may not be right) */ -boolean from_invent; /* thrown or dropped by player; maybe on shop bill */ +hero_breaks(struct obj *obj, + xchar x, xchar y, /**< object location (ox, oy may not be right) */ + boolean from_invent) /**< thrown or dropped by player; maybe on shop bill */ { boolean in_view = Blind ? FALSE : (from_invent || cansee(x, y)); @@ -2105,9 +2072,9 @@ boolean from_invent; /* thrown or dropped by player; maybe on shop bill */ * Return 0 if the object doesn't break, 1 if the object broke. */ int -breaks(obj, x, y) -struct obj *obj; -xchar x, y; /* object location (ox, oy may not be right) */ +breaks(struct obj *obj, xchar x, xchar y) + + /* object location (ox, oy may not be right) */ { boolean in_view = Blind ? FALSE : cansee(x, y); @@ -2122,11 +2089,11 @@ xchar x, y; /* object location (ox, oy may not be right) */ * and break messages have been delivered prior to getting here. */ void -breakobj(obj, x, y, hero_caused, from_invent) -struct obj *obj; -xchar x, y; /* object location (ox, oy may not be right) */ -boolean hero_caused; /* is this the hero's fault? */ -boolean from_invent; +breakobj(struct obj *obj, xchar x, xchar y, boolean hero_caused, boolean from_invent) + + /* object location (ox, oy may not be right) */ + /* is this the hero's fault? */ + { boolean fracture = FALSE; flags.last_broken_otyp = obj->otyp; @@ -2246,8 +2213,7 @@ boolean from_invent; * Return 0 if the object isn't going to break, 1 if it is. */ boolean -breaktest(obj) -struct obj *obj; +breaktest(struct obj *obj) { if (obj_resists(obj, 1, 99)) return 0; if (objects[obj->otyp].oc_material == GLASS && !obj->oartifact && @@ -2269,9 +2235,7 @@ struct obj *obj; } static void -breakmsg(obj, in_view) -struct obj *obj; -boolean in_view; +breakmsg(struct obj *obj, boolean in_view) { const char *to_pieces; @@ -2312,8 +2276,7 @@ boolean in_view; } static int -throw_gold(obj) -struct obj *obj; +throw_gold(struct obj *obj) { int range, odx, ody; register struct monst *mon; diff --git a/src/drawing.c b/src/drawing.c index 0eb4f93b3..2bcf6e366 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -769,8 +769,7 @@ void (*ascgraphics_mode_callback)(void) = 0; /* set in tty_start_screen() */ * options.c, pickup.c, sp_lev.c, and lev_main.c. */ int -def_char_to_objclass(ch) -char ch; +def_char_to_objclass(char ch) { int i; for (i = 1; i < MAXOCLASSES; i++) @@ -783,8 +782,7 @@ char ch; * match made. If there are are no matches, return MAXMCLASSES. */ int -def_char_to_monclass(ch) -char ch; +def_char_to_monclass(char ch) { int i; for (i = 1; i < MAXMCLASSES; i++) @@ -793,9 +791,7 @@ char ch; } void -assign_graphics(graph_chars, glth, maxlen, offset) -register glyph_t *graph_chars; -int glth, maxlen, offset; +assign_graphics(register glyph_t *graph_chars, int glth, int maxlen, int offset) { register int i; @@ -805,8 +801,7 @@ int glth, maxlen, offset; } void -switch_graphics(gr_set_flag) -int gr_set_flag; +switch_graphics(int gr_set_flag) { iflags.IBMgraphics = FALSE; iflags.DECgraphics = FALSE; @@ -882,9 +877,7 @@ int gr_set_flag; /** Change the UTF8graphics symbol at position with codepoint "value". */ void -assign_utf8graphics_symbol(position, value) -int position; -glyph_t value; +assign_utf8graphics_symbol(int position, glyph_t value) { #ifdef UTF8_GLYPHS if (position < MAXPCHARS) { @@ -905,7 +898,7 @@ static glyph_t save_showsyms[MAXPCHARS] = DUMMY; static uchar save_monsyms[MAXPCHARS] = DUMMY; void -save_syms() +save_syms(void) { (void) memcpy((genericptr_t)save_showsyms, (genericptr_t)showsyms, sizeof showsyms); @@ -916,7 +909,7 @@ save_syms() } void -restore_syms() +restore_syms(void) { (void) memcpy((genericptr_t)showsyms, (genericptr_t)save_showsyms, sizeof showsyms); @@ -994,8 +987,7 @@ static const uchar IBM_r_oc_syms[MAXOCLASSES] = { /* a la EPYX Rogue */ # endif /* ASCIIGRAPH */ void -assign_rogue_graphics(is_rlevel) -boolean is_rlevel; +assign_rogue_graphics(boolean is_rlevel) { /* Adjust graphics display characters on Rogue levels */ @@ -1067,8 +1059,7 @@ boolean is_rlevel; #endif /* REINCARNATION */ void -assign_moria_graphics(is_moria) -boolean is_moria; +assign_moria_graphics(boolean is_moria) { /* Adjust graphics display characters on Moria levels */ diff --git a/src/dump.c b/src/dump.c index 7e0e31309..01bb0ab67 100644 --- a/src/dump.c +++ b/src/dump.c @@ -19,7 +19,7 @@ extern char msgs[][BUFSZ]; extern int lastmsg; -void do_vanquished(int, BOOLEAN_P); +void do_vanquished(int, boolean); #endif #ifdef DUMP_LOG @@ -34,7 +34,7 @@ char html_dump_path[BUFSIZ]; static char* -get_dump_filename() +get_dump_filename(void) { static char buf[BUFSIZ+1+5]; char *f, *p, *end; @@ -94,7 +94,7 @@ get_dump_filename() } void -dump_init() +dump_init(void) { if (dump_fn[0]) { #ifdef UNIX @@ -135,8 +135,7 @@ dump_init() #ifdef DUMP_LOG /** Set a file's access and modify time to u.udeathday. */ static void -adjust_file_timestamp(fpath) -const char* fpath; +adjust_file_timestamp(const char *fpath) { # ifdef HAVE_UTIME_H if (u.udeathday > 0) { @@ -152,7 +151,7 @@ const char* fpath; #endif void -dump_exit() +dump_exit(void) { #ifdef DUMP_LOG if (dump_fp) { @@ -170,8 +169,7 @@ dump_exit() } void -dump(pre, str) -const char *pre, *str; +dump(const char *pre, const char *str) { #ifdef DUMP_LOG if (dump_fp) @@ -183,8 +181,7 @@ const char *pre, *str; /** Outputs a string only into the html dump. */ void -dump_html(format, str) -const char *format, *str; +dump_html(const char *format, const char *str) { #ifdef DUMP_LOG if (html_dump_fp) @@ -194,8 +191,7 @@ const char *format, *str; /** Outputs a string only into the text dump. */ void -dump_text(format, str) -const char *format, *str; +dump_text(const char *format, const char *str) { #ifdef DUMP_LOG if (dump_fp) @@ -205,8 +201,7 @@ const char *format, *str; /** Dumps one line as is. */ void -dump_line(pre, str) -const char *pre, *str; +dump_line(const char *pre, const char *str) { #ifdef DUMP_LOG if (dump_fp) @@ -229,9 +224,7 @@ static char tmp_html_link[4*BUFSZ]; static char tmp_html_link_name[2*BUFSZ]; /** Return a link to nethackwiki . */ char * -html_link(link_name, name) -const char *link_name; -const char *name; +html_link(const char *link_name, const char *name) { tmp_html_link_name[0] = '\0'; while (*name != '\0' && strlen(tmp_html_link_name) < BUFSZ - 10) { @@ -247,10 +240,7 @@ const char *name; /** Dumps an object from the inventory. */ void -dump_object(c, obj, str) -const char c; -const struct obj *obj; -const char *str; +dump_object(const char c, const struct obj *obj, const char *str) { #ifdef DUMP_LOG const char *starting_inventory = obj->was_in_starting_inventory ? "*" : ""; @@ -275,8 +265,7 @@ const char *str; /** Dumps a secondary title. */ void -dump_subtitle(str) -const char *str; +dump_subtitle(const char *str) { #ifdef DUMP_LOG dump_text(" %s\n", str); @@ -286,8 +275,7 @@ const char *str; /** Dump a title. Strips : from the end of str. */ void -dump_title(str) -char *str; +dump_title(char *str) { #ifdef DUMP_LOG int len = strlen(str); @@ -303,7 +291,7 @@ char *str; /** Starts a list in the dump. */ void -dump_list_start() +dump_list_start(void) { #ifdef DUMP_LOG if (html_dump_fp) @@ -313,9 +301,7 @@ dump_list_start() /** Dumps a linked list item. */ void -dump_list_item_link(link, str) -const char *link; -const char *str; +dump_list_item_link(const char *link, const char *str) { #ifdef DUMP_LOG if (dump_fp) @@ -327,8 +313,7 @@ const char *str; /** Dumps an object as list item. */ void -dump_list_item_object(obj) -struct obj *obj; +dump_list_item_object(struct obj *obj) { #ifdef DUMP_LOG if (dump_fp) @@ -353,8 +338,7 @@ struct obj *obj; /** Dumps a list item. */ void -dump_list_item(str) -const char *str; +dump_list_item(const char *str) { #ifdef DUMP_LOG if (dump_fp) @@ -366,14 +350,14 @@ const char *str; /** Ends a list in the dump. */ void -dump_list_end() +dump_list_end(void) { dump_html("\n", ""); } /** Starts a blockquote in the dump. */ void -dump_blockquote_start() +dump_blockquote_start(void) { #ifdef DUMP_LOG if (html_dump_fp) @@ -383,7 +367,7 @@ dump_blockquote_start() /** Ends a blockquote in the dump. */ void -dump_blockquote_end() +dump_blockquote_end(void) { #ifdef DUMP_LOG dump_text("\n", ""); @@ -393,7 +377,7 @@ dump_blockquote_end() /** Starts a definition list in the dump. */ void -dump_definition_list_start() +dump_definition_list_start(void) { #ifdef DUMP_LOG if (html_dump_fp) @@ -403,8 +387,7 @@ dump_definition_list_start() /** Dumps a definition list item. */ void -dump_definition_list_dt(str) -const char *str; +dump_definition_list_dt(const char *str) { #ifdef DUMP_LOG if (dump_fp) @@ -420,8 +403,7 @@ const char *str; /** Dumps a definition list item. */ void -dump_definition_list_dd(str) -const char *str; +dump_definition_list_dd(const char *str) { #ifdef DUMP_LOG if (dump_fp) @@ -433,7 +415,7 @@ const char *str; /** Ends a list in the dump. */ void -dump_definition_list_end() +dump_definition_list_end(void) { dump_html("\n", ""); } @@ -464,8 +446,7 @@ dump_html_css_file(const char *filename) /** Dumps the HTML header. */ void -dump_header_html(title) -const char *title; +dump_header_html(const char *title) { dump_html("\n", ""); dump_html("\n", ""); @@ -510,7 +491,7 @@ const char* html_escape_character(const char c) { #ifdef DUMP_LOG /** Screenshot of the HTML map. */ int -dump_screenshot() +dump_screenshot(void) { char screenshot[BUFSZ]; char *filename = get_dump_filename(); diff --git a/src/dungeon.c b/src/dungeon.c index 2e1599c89..516987c90 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -42,7 +42,7 @@ static xchar dname_to_dnum(const char *); static int find_branch(const char *, struct proto_dungeon *); static mapseen* find_level_by_custom_name(const char *); static xchar parent_dnum(const char *, struct proto_dungeon *); -static int level_range(XCHAR_P, int, int, int, struct proto_dungeon *, int *); +static int level_range(xchar, int, int, int, struct proto_dungeon *, int *); static xchar parent_dlevel(const char *, struct proto_dungeon *); static int correct_branch_type(struct tmpbranch *); static branch *add_branch(int, int, struct proto_dungeon *); @@ -53,10 +53,10 @@ static xchar pick_level(boolean *, int); static boolean place_level(int, struct proto_dungeon *); #ifdef WIZARD static const char *br_string(int); -static void print_branch(winid, int, int, int, BOOLEAN_P, struct lchoice *); +static void print_branch(winid, int, int, int, boolean, struct lchoice *); #endif #ifdef RANDOMIZED_PLANES -static void shuffle_planes(); +static void shuffle_planes(void); #endif mapseen *mapseenchn = (struct mapseen *)0; @@ -129,9 +129,7 @@ dumpit() /* Save the dungeon structures. */ void -save_dungeon(fd, perform_write, free_data) -int fd; -boolean perform_write, free_data; +save_dungeon(int fd, boolean perform_write, boolean free_data) { branch *curr, *next; mapseen *curr_ms, *next_ms; @@ -185,8 +183,7 @@ boolean perform_write, free_data; /* Restore the dungeon structures. */ void -restore_dungeon(fd) -int fd; +restore_dungeon(int fd) { branch *curr, *last; mapseen *curr_ms, *last_ms; @@ -231,10 +228,7 @@ int fd; } static void -Fread(ptr, size, nitems, stream) -genericptr_t ptr; -int size, nitems; -dlb *stream; +Fread(genericptr_t ptr, int size, int nitems, dlb *stream) { int cnt; @@ -247,8 +241,7 @@ dlb *stream; } static xchar -dname_to_dnum(s) -const char *s; +dname_to_dnum(const char *s) { xchar i; @@ -261,8 +254,7 @@ const char *s; } s_level * -find_level(s) -const char *s; +find_level(const char *s) { s_level *curr; for(curr = sp_levchn; curr; curr = curr->next) @@ -271,8 +263,7 @@ const char *s; } mapseen * -find_level_by_custom_name(s) -const char *s; +find_level_by_custom_name(const char *s) { mapseen *mptr; for (mptr = mapseenchn; mptr; mptr = mptr->next) @@ -287,8 +278,7 @@ const char *s; * Returns NULL if on Astral Plane or not in endgame. */ s_level * -get_next_elemental_plane(lev) -d_level *lev; +get_next_elemental_plane(d_level *lev) { if (!In_endgame(lev)) { pline("get_next_elemental_plane not in Endgame."); @@ -310,7 +300,7 @@ d_level *lev; * Returns the first elemental plane of the endgame. */ d_level * -get_first_elemental_plane() +get_first_elemental_plane(void) { s_level *curr, *dummy = find_level("dummy"); @@ -325,9 +315,9 @@ get_first_elemental_plane() /* Find the branch that links the named dungeon. */ static int -find_branch(s, pd) -const char *s; /* dungeon name */ -struct proto_dungeon *pd; +find_branch(const char *s, struct proto_dungeon *pd) + /* dungeon name */ + { int i; @@ -357,9 +347,9 @@ struct proto_dungeon *pd; * listing, then figuring out to which dungeon it belongs. */ static xchar -parent_dnum(s, pd) -const char *s; /* dungeon name */ -struct proto_dungeon *pd; +parent_dnum(const char *s, struct proto_dungeon *pd) + /* dungeon name */ + { int i; xchar pdnum; @@ -389,11 +379,7 @@ struct proto_dungeon *pd; * end of the dungeon. */ static int -level_range(dgn, base, rand, chain, pd, adjusted_base) -xchar dgn; -int base, rand, chain; -struct proto_dungeon *pd; -int *adjusted_base; +level_range(xchar dgn, int base, int rand, int chain, struct proto_dungeon *pd, int *adjusted_base) { int lmax = dungeons[dgn].num_dunlevs; @@ -422,9 +408,7 @@ int *adjusted_base; } static xchar -parent_dlevel(s, pd) -const char *s; -struct proto_dungeon *pd; +parent_dlevel(const char *s, struct proto_dungeon *pd) { int i, j, num, base, dnum = parent_dnum(s, pd); branch *curr; @@ -449,8 +433,7 @@ struct proto_dungeon *pd; /* Convert from the temporary branch type to the dungeon branch type. */ static int -correct_branch_type(tbr) -struct tmpbranch *tbr; +correct_branch_type(struct tmpbranch *tbr) { switch (tbr->type) { case TBR_STAIR: return BR_STAIR; @@ -469,9 +452,7 @@ struct tmpbranch *tbr; * but needs to be repositioned. */ void -insert_branch(new_branch, extract_first) -branch *new_branch; -boolean extract_first; +insert_branch(branch *new_branch, boolean extract_first) { branch *curr, *prev; long new_val, curr_val, prev_val; @@ -516,10 +497,7 @@ boolean extract_first; /* Add a dungeon branch to the branch list. */ static branch * -add_branch(dgn, child_entry_level, pd) -int dgn; -int child_entry_level; -struct proto_dungeon *pd; +add_branch(int dgn, int child_entry_level, struct proto_dungeon *pd) { static int branch_id = 0; int branch_num; @@ -548,8 +526,7 @@ struct proto_dungeon *pd; * last entry. */ static void -add_level(new_lev) -s_level *new_lev; +add_level(s_level *new_lev) { s_level *prev, *curr; @@ -570,9 +547,7 @@ s_level *new_lev; } static void -init_level(dgn, proto_index, pd) -int dgn, proto_index; -struct proto_dungeon *pd; +init_level(int dgn, int proto_index, struct proto_dungeon *pd) { s_level *new_level; struct tmplevel *tlevel = &pd->tmplevel[proto_index]; @@ -603,10 +578,10 @@ struct proto_dungeon *pd; } static int -possible_places(idx, map, pd) -int idx; /* prototype index */ -boolean *map; /* array MAXLEVEL+1 in length */ -struct proto_dungeon *pd; +possible_places(int idx, boolean *map, struct proto_dungeon *pd) + /* prototype index */ + /* array MAXLEVEL+1 in length */ + { int i, start, count; s_level *lev = pd->final_lev[idx]; @@ -635,9 +610,9 @@ struct proto_dungeon *pd; /* Pick the nth TRUE entry in the given boolean array. */ static xchar -pick_level(map, nth) -boolean *map; /* an array MAXLEVEL+1 in size */ -int nth; +pick_level(boolean *map, int nth) + /* an array MAXLEVEL+1 in size */ + { int i; for (i = 1; i <= MAXLEVEL; i++) @@ -665,9 +640,7 @@ int d; * been exhausted, return false. */ static boolean -place_level(proto_index, pd) -int proto_index; -struct proto_dungeon *pd; +place_level(int proto_index, struct proto_dungeon *pd) { boolean map[MAXLEVEL+1]; /* valid levels are 1..MAXLEVEL inclusive */ s_level *lev; @@ -752,7 +725,7 @@ struct level_map { /* initialize the "dungeon" structs */ void -init_dungeons() +init_dungeons(void) { dlb *dgn_file; register int i, cl = 0, cb = 0; @@ -1034,8 +1007,9 @@ init_dungeons() } #ifdef RANDOMIZED_PLANES +/** Randomizes order of elemental planes */ void -shuffle_planes() /* randomizes order of elemental planes */ +shuffle_planes(void) { /* original order */ s_level *dummy = find_level("dummy"), @@ -1065,24 +1039,21 @@ shuffle_planes() /* randomizes order of elemental planes */ /* return the lowest level number for *this* dungeon */ xchar -dunlev(lev) -d_level *lev; +dunlev(d_level *lev) { return(lev->dlevel); } /* return the lowest level number for *this* dungeon */ xchar -dunlevs_in_dungeon(lev) -d_level *lev; +dunlevs_in_dungeon(d_level *lev) { return(dungeons[lev->dnum].num_dunlevs); } /* return the lowest level explored in the game*/ xchar -deepest_lev_reached(noquest) -boolean noquest; +deepest_lev_reached(boolean noquest) { /* this function is used for three purposes: to provide a factor * of difficulty in monster generation; to provide a factor of @@ -1116,8 +1087,7 @@ boolean noquest; /* return a bookkeeping level number for purpose of comparisons and * save/restore */ xchar -ledger_no(lev) -d_level *lev; +ledger_no(d_level *lev) { return((xchar)(lev->dlevel + dungeons[lev->dnum].ledger_start)); } @@ -1133,7 +1103,7 @@ d_level *lev; * depth visited by the player. */ xchar -maxledgerno() +maxledgerno(void) { return (xchar) (dungeons[n_dgns-1].ledger_start + dungeons[n_dgns-1].num_dunlevs); @@ -1141,8 +1111,7 @@ maxledgerno() /* return the dungeon that this ledgerno exists in */ xchar -ledger_to_dnum(ledgerno) -xchar ledgerno; +ledger_to_dnum(xchar ledgerno) { register int i; @@ -1159,8 +1128,7 @@ xchar ledgerno; /* return the level of the dungeon this ledgerno exists in */ xchar -ledger_to_dlev(ledgerno) -xchar ledgerno; +ledger_to_dlev(xchar ledgerno) { return((xchar)(ledgerno - dungeons[ledger_to_dnum(ledgerno)].ledger_start)); } @@ -1168,24 +1136,21 @@ xchar ledgerno; /* returns the depth of a level, in floors below the surface */ /* (note levels in different dungeons can have the same depth). */ schar -depth(lev) -d_level *lev; +depth(d_level *lev) { return((schar)( dungeons[lev->dnum].depth_start + lev->dlevel - 1)); } /* are "lev1" and "lev2" actually the same? */ boolean -on_level(lev1, lev2) -d_level *lev1, *lev2; +on_level(d_level *lev1, d_level *lev2) { return((boolean)((lev1->dnum == lev2->dnum) && (lev1->dlevel == lev2->dlevel))); } /* is this level referenced in the special level chain? */ s_level * -Is_special(lev) -d_level *lev; +Is_special(d_level *lev) { s_level *levtmp; @@ -1200,8 +1165,7 @@ d_level *lev; * branch. Otherwise, return null. */ branch * -Is_branchlev(lev) -d_level *lev; +Is_branchlev(d_level *lev) { branch *curr; @@ -1214,8 +1178,7 @@ d_level *lev; /* returns TRUE iff the branch 'lev' is in a branch which builds up */ boolean -builds_up(lev) -d_level *lev; +builds_up(d_level *lev) { dungeon *dptr = &dungeons[lev->dnum]; /* @@ -1228,8 +1191,7 @@ d_level *lev; /* goto the next level (or appropriate dungeon) */ void -next_level(at_stairs) -boolean at_stairs; +next_level(boolean at_stairs) { if (at_stairs && u.ux == sstairs.sx && u.uy == sstairs.sy) { /* Taking a down dungeon branch. */ @@ -1246,8 +1208,7 @@ boolean at_stairs; /* goto the previous level (or appropriate dungeon) */ void -prev_level(at_stairs) -boolean at_stairs; +prev_level(boolean at_stairs) { if (at_stairs && u.ux == sstairs.sx && u.uy == sstairs.sy) { /* Taking an up dungeon branch. */ @@ -1265,8 +1226,7 @@ boolean at_stairs; } void -u_on_newpos(x, y) -int x, y; +u_on_newpos(int x, int y) { /* validate location */ if (!isok(x, y)) { @@ -1295,8 +1255,7 @@ int x, y; /* place you on a random location when arriving on a level */ void -u_on_rndspot(upflag) -int upflag; +u_on_rndspot(int upflag) { int up = (upflag & 1), was_in_W_tower = (upflag & 2); @@ -1329,8 +1288,7 @@ int upflag; /* place you on the special staircase */ void -u_on_sstairs(upflag) -int upflag; +u_on_sstairs(int upflag) { if (sstairs.sx) { u_on_newpos(sstairs.sx, sstairs.sy); @@ -1341,7 +1299,7 @@ int upflag; /* place you on upstairs (or special equivalent) */ void -u_on_upstairs() +u_on_upstairs(void) { if (xupstair) { u_on_newpos(xupstair, yupstair); @@ -1352,7 +1310,7 @@ u_on_upstairs() /* place you on dnstairs (or special equivalent) */ void -u_on_dnstairs() +u_on_dnstairs(void) { if (xdnstair) { u_on_newpos(xdnstair, ydnstair); @@ -1362,8 +1320,7 @@ u_on_dnstairs() } boolean -On_stairs(x, y) -xchar x, y; +On_stairs(xchar x, xchar y) { return((boolean)((x == xupstair && y == yupstair) || (x == xdnstair && y == ydnstair) || @@ -1373,15 +1330,13 @@ xchar x, y; } boolean -Is_botlevel(lev) -d_level *lev; +Is_botlevel(d_level *lev) { return((boolean)(lev->dlevel == dungeons[lev->dnum].num_dunlevs)); } boolean -Can_dig_down(lev) -d_level *lev; +Can_dig_down(d_level *lev) { return((boolean)(!level.flags.hardfloor && !Is_botlevel(lev) && !Invocation_lev(lev))); @@ -1393,8 +1348,7 @@ d_level *lev; * both digging and falling. */ boolean -Can_fall_thru(lev) -d_level *lev; +Can_fall_thru(d_level *lev) { return((boolean)(Can_dig_down(lev) || Is_stronghold(lev))); } @@ -1406,9 +1360,7 @@ d_level *lev; * Checks for amulets and such must be done elsewhere. */ boolean -Can_rise_up(x, y, lev) -int x, y; -d_level *lev; +Can_rise_up(int x, int y, d_level *lev) { /* can't rise up from inside the top of the Wizard's tower */ /* KMH -- or in sokoban */ @@ -1421,8 +1373,7 @@ d_level *lev; } boolean -has_ceiling(lev) -d_level *lev UNUSED; +has_ceiling(d_level *lev UNUSED) { return !level.flags.sky; } @@ -1439,9 +1390,7 @@ d_level *lev UNUSED; * in dungeons that build up is confined within them. */ void -get_level(newlevel, levnum) -d_level *newlevel; -int levnum; +get_level(d_level *newlevel, int levnum) { branch *br; xchar dgn = u.uz.dnum; @@ -1488,23 +1437,21 @@ int levnum; /* are you in the quest dungeon? */ boolean -In_quest(lev) -d_level *lev; +In_quest(d_level *lev) { return((boolean)(lev->dnum == quest_dnum)); } /* are you in the mines dungeon? */ boolean -In_mines(lev) -d_level *lev; +In_mines(d_level *lev) { return((boolean)(lev->dnum == mines_dnum)); } boolean -In_sheol(lev) /* are you in Sheol? */ -d_level *lev; +In_sheol(d_level *lev) /* are you in Sheol? */ + { return((boolean)(lev->dnum == sheol_dnum)); } @@ -1518,8 +1465,7 @@ d_level *lev; * + Field end2 is the "child" dungeon. */ branch * -dungeon_branch(s) -const char *s; +dungeon_branch(const char *s) { branch *br; xchar dnum; @@ -1544,8 +1490,7 @@ const char *s; * Assumes that end1 is always the "parent". */ boolean -at_dgn_entrance(s) -const char *s; +at_dgn_entrance(const char *s) { branch *br; @@ -1555,16 +1500,15 @@ const char *s; /* is `lev' part of Vlad's tower? */ boolean -In_V_tower(lev) -d_level *lev; +In_V_tower(d_level *lev) { return((boolean)(lev->dnum == tower_dnum)); } /* is `lev' a level containing the Wizard's tower? */ boolean -On_W_tower_level(lev) /* is `lev' a level containing the Wizard's tower? */ -d_level *lev; +On_W_tower_level(d_level *lev) /* is `lev' a level containing the Wizard's tower? */ + { return (boolean)(Is_wiz1_level(lev) || Is_wiz2_level(lev) || @@ -1573,9 +1517,7 @@ d_level *lev; /* is of `lev' inside the Wizard's tower? */ boolean -In_W_tower(x, y, lev) -int x, y; -d_level *lev; +In_W_tower(int x, int y, d_level *lev) { if (!On_W_tower_level(lev)) return FALSE; /* @@ -1593,15 +1535,13 @@ d_level *lev; /* are you in one of the Hell levels? */ boolean -In_hell(lev) -d_level *lev; +In_hell(d_level *lev) { return((boolean)(dungeons[lev->dnum].flags.hellish)); } /* sets *lev to be the gateway to Gehennom... */ void -find_hell(lev) -d_level *lev; +find_hell(d_level *lev) { lev->dnum = valley_level.dnum; lev->dlevel = 1; @@ -1609,8 +1549,7 @@ d_level *lev; /* go directly to hell... */ void -goto_hell(at_stairs, falling) -boolean at_stairs, falling; +goto_hell(boolean at_stairs, boolean falling) { d_level lev; @@ -1620,8 +1559,7 @@ boolean at_stairs, falling; /* equivalent to dest = source */ void -assign_level(dest, src) -d_level *dest, *src; +assign_level(d_level *dest, d_level *src) { dest->dnum = src->dnum; dest->dlevel = src->dlevel; @@ -1629,9 +1567,7 @@ d_level *dest, *src; /* dest = src + rn1(range) */ void -assign_rnd_level(dest, src, range) -d_level *dest, *src; -int range; +assign_rnd_level(d_level *dest, d_level *src, int range) { dest->dnum = src->dnum; dest->dlevel = src->dlevel + ((range > 0) ? rnd(range) : -rnd(-range)); @@ -1643,8 +1579,7 @@ int range; } int -induced_align(pct) -int pct; +induced_align(int pct) { s_level *lev = Is_special(&u.uz); aligntyp al; @@ -1660,8 +1595,7 @@ int pct; } boolean -Invocation_lev(lev) -d_level *lev; +Invocation_lev(d_level *lev) { return((boolean)(In_hell(lev) && !In_sheol(lev) && lev->dlevel == (dungeons[lev->dnum].num_dunlevs - 1))); @@ -1671,7 +1605,7 @@ d_level *lev; * dependent on the location in the dungeon (eg. monster creation). */ xchar -level_difficulty() +level_difficulty(void) { if (In_sokoban(&u.uz)) { return (xchar)depth(&oracle_level)+1; @@ -1690,8 +1624,7 @@ level_difficulty() * Recognized levels are as shown by print_dungeon(). */ schar -lev_by_name(nam) -const char *nam; +lev_by_name(const char *nam) { schar lev = 0; s_level *slev = NULL; @@ -1768,8 +1701,7 @@ const char *nam; #ifdef WIZARD static boolean -unplaced_floater(dptr) -struct dungeon *dptr; +unplaced_floater(struct dungeon *dptr) { branch *br; int idx = (int) (dptr - dungeons); @@ -1792,9 +1724,7 @@ struct dungeon *dptr; } static boolean -unreachable_level(lvl_p, unplaced) -d_level *lvl_p; -boolean unplaced; +unreachable_level(d_level *lvl_p, boolean unplaced) { s_level *dummy; @@ -1812,12 +1742,7 @@ boolean unplaced; static void -tport_menu(win, entry, lchoices, lvl_p, unreachable) -winid win; -char *entry; -struct lchoice *lchoices; -d_level *lvl_p; -boolean unreachable; +tport_menu(winid win, char *entry, struct lchoice *lchoices, d_level *lvl_p, boolean unreachable) { char tmpbuf[BUFSZ]; anything any; @@ -1854,8 +1779,7 @@ boolean unreachable; /* Convert a branch type to a string usable by print_dungeon(). */ static const char * -br_string(type) -int type; +br_string(int type) { switch (type) { case BR_PORTAL: return "Portal"; @@ -1867,21 +1791,14 @@ int type; } static char -chr_u_on_lvl(dlev) -d_level *dlev; +chr_u_on_lvl(d_level *dlev) { return u.uz.dnum == dlev->dnum && u.uz.dlevel == dlev->dlevel ? '*' : ' '; } /* Print all child branches between the lower and upper bounds. */ static void -print_branch(win, dnum, lower_bound, upper_bound, bymenu, lchoices) -winid win; -int dnum; -int lower_bound; -int upper_bound; -boolean bymenu; -struct lchoice *lchoices; +print_branch(winid win, int dnum, int lower_bound, int upper_bound, boolean bymenu, struct lchoice *lchoices) { branch *br; char buf[BUFSZ]; @@ -1907,10 +1824,7 @@ struct lchoice *lchoices; /* Print available dungeon information. */ schar -print_dungeon(bymenu, rlev, rdgn) -boolean bymenu; -schar *rlev; -xchar *rdgn; +print_dungeon(boolean bymenu, schar *rlev, xchar *rdgn) { int i, last_level, nlev; char buf[BUFSZ]; @@ -2056,9 +1970,7 @@ xchar *rdgn; * teleport or via the Eye. */ void -recbranch_mapseen(source, dest) -d_level *source; -d_level *dest; +recbranch_mapseen(d_level *source, d_level *dest) { mapseen *mptr; branch* br; @@ -2087,7 +1999,7 @@ d_level *dest; /* #annotate command - add a custom name to the current level */ int -donamelevel() +donamelevel(void) { mapseen *mptr; char qbuf[QBUFSZ]; /* Buffer for query text */ @@ -2132,8 +2044,7 @@ donamelevel() /* find the particular mapseen object in the chain */ /* may return 0 */ static mapseen * -find_mapseen(lev) -d_level *lev; +find_mapseen(d_level *lev) { mapseen *mptr; @@ -2144,8 +2055,7 @@ d_level *lev; } void -forget_mapseen(ledger_no) -int ledger_no; +forget_mapseen(int ledger_no) { mapseen *mptr; struct cemetery *bp; @@ -2173,8 +2083,7 @@ int ledger_no; } void -rm_mapseen(ledger_num) -int ledger_num; +rm_mapseen(int ledger_num) { mapseen *mptr, *mprev = (mapseen *)0; struct cemetery *bp, *bpnext; @@ -2210,9 +2119,7 @@ int ledger_num; } static void -save_mapseen(fd, mptr) -int fd; -mapseen *mptr; +save_mapseen(int fd, mapseen *mptr) { branch *curr; int count; @@ -2235,8 +2142,7 @@ mapseen *mptr; } static mapseen * -load_mapseen(fd) -int fd; +load_mapseen(int fd) { int branchnum, count; mapseen *load; @@ -2269,10 +2175,7 @@ int fd; /* to support '#stats' wizard-mode command */ void -overview_stats(win, statsfmt, total_count, total_size) -winid win; -const char *statsfmt; -long *total_count, *total_size; +overview_stats(winid win, const char *statsfmt, long int *total_count, long int *total_size) { char buf[BUFSZ], hdrbuf[QBUFSZ]; long ocount, osize, bcount, bsize, acount, asize; @@ -2320,8 +2223,7 @@ long *total_count, *total_size; * ignore such levels, end of game disclosure will include them.] */ void -remdun_mapseen(dnum) -int dnum; +remdun_mapseen(int dnum) { mapseen *mptr, **mptraddr; @@ -2335,8 +2237,7 @@ int dnum; } void -init_mapseen(lev) -d_level *lev; +init_mapseen(d_level *lev) { /* Create a level and insert in "sorted" order. This is an insertion * sort first by dungeon (in order of discovery) and then by level number. @@ -2391,9 +2292,9 @@ d_level *lev; /* returns true if this level has something interesting to print out */ static boolean -interest_mapseen(mptr, final) -mapseen *mptr; -boolean final; /**< if game is finished */ +interest_mapseen( + mapseen *mptr, + boolean final) /**< if game is finished */ { /* bones level by itself is interesting, even if nothing else on it is */ if (wizard || final) { @@ -2449,7 +2350,7 @@ boolean final; /**< if game is finished */ /* recalculate mapseen for the current level */ void -recalc_mapseen() +recalc_mapseen(void) { mapseen *mptr; struct monst *shkp; @@ -2687,8 +2588,8 @@ recalc_mapseen() /*ARGUSED*/ /* valley and sanctum levels get automatic annotation once temple is entered */ void -mapseen_temple(priest) -struct monst *priest UNUSED; /* currently unused; might be useful someday */ +mapseen_temple( + struct monst *priest UNUSED) /**< currently unused; might be useful someday */ { mapseen *mptr = find_mapseen(&u.uz); @@ -2701,8 +2602,7 @@ struct monst *priest UNUSED; /* currently unused; might be useful someday */ /* room entry message has just been delivered so learn room even if blind */ void -room_discovered(roomno) -int roomno; +room_discovered(int roomno) { mapseen *mptr = find_mapseen(&u.uz); @@ -2711,17 +2611,17 @@ int roomno; /* #overview command */ int -dooverview() +dooverview(void) { show_overview(0, 0); return 0; } /* called for #overview or for end of game disclosure */ void -show_overview(why, reason) -int why UNUSED; /* 0 => #overview command, - 1 or 2 => final disclosure (1: hero lived, 2: hero died) */ -int reason UNUSED; /* how hero died; used when disclosing end-of-game level */ +show_overview(int why UNUSED, /**< 0 => #overview command, + 1 or 2 => final disclosure + (1: hero lived, 2: hero died) */ + int reason UNUSED) /* how hero died; used when disclosing end-of-game level */ { winid win; mapseen *mptr; @@ -2757,7 +2657,7 @@ int reason UNUSED; /* how hero died; used when disclosing end-of-game level */ #ifdef DUMP_LOG int -dumpoverview() +dumpoverview(void) { mapseen *mptr; boolean printdun; @@ -2822,8 +2722,7 @@ seen_string(xchar x, const char *obj) /* better br_string */ static const char * -br_string2(br) -branch *br; +br_string2(branch *br) { /* Special case: quest portal says closed if kicked from quest */ boolean closed_portal = @@ -2842,9 +2741,7 @@ branch *br; /* get the name of an endgame level; topten.c does something similar */ const char * -endgame_level_name(outbuf, indx) -char *outbuf; -int indx; +endgame_level_name(char *outbuf, int indx) { const char *planename = 0; @@ -2875,8 +2772,7 @@ int indx; } static const char* -shop_string(rtype) -int rtype; +shop_string(int rtype) { /* Yuck, redundancy...but shclass.name doesn't cut it as a noun */ switch (rtype) { @@ -3109,8 +3005,7 @@ print_mapseen( /** Get annotation for a specific level. */ char * -get_annotation(lev) -d_level *lev; +get_annotation(d_level *lev) { mapseen *mptr; @@ -3124,8 +3019,7 @@ d_level *lev; /** Return a generic description of the current level like "plane" for the * planes, "tower" for Vlad's tower, or "dungeon" for a normal level. */ const char * -get_generic_level_description(lev) -d_level *lev; +get_generic_level_description(d_level *lev) { if (Is_astralevel(lev)) { return "astral plane"; diff --git a/src/eat.c b/src/eat.c index b35fcee76..1b8b65be7 100644 --- a/src/eat.c +++ b/src/eat.c @@ -12,17 +12,17 @@ # endif #endif -static int eatmdone(); -static int eatfood(); -static int opentin(); -static int unfaint(); +static int eatmdone(void); +static int eatfood(void); +static int opentin(void); +static int unfaint(void); -static const char *food_xname(struct obj *, BOOLEAN_P); +static const char *food_xname(struct obj *, boolean); static void choke(struct obj *); -static void recalc_wt(); +static void recalc_wt(void); static struct obj *touchfood(struct obj *); -static void do_reset_eat(); -static void done_eating(BOOLEAN_P); +static void do_reset_eat(void); +static void done_eating(boolean); static void cprefx(int); static void givit(int, struct permonst *); static void cpostfx(int); @@ -32,14 +32,14 @@ static int eatcorpse(struct obj *); static void fprefx(struct obj *); static void accessory_has_effect(struct obj *); static void fpostfx(struct obj *); -static int bite(); +static int bite(void); static int edibility_prompts(struct obj *); static int rottenfood(struct obj *); -static void eatspecial(); +static void eatspecial(void); static void eataccessory(struct obj *); static const char *foodword(struct obj *); -static boolean maybe_cannibal(int, BOOLEAN_P); -static int tin_variety(struct obj *, BOOLEAN_P); +static boolean maybe_cannibal(int, boolean); +static int tin_variety(struct obj *, boolean); char msgbuf[BUFSZ]; @@ -89,8 +89,7 @@ const char *hu_stat[] = { * polymorphed character. Not used for monster checks. */ boolean -is_edible(obj) -register struct obj *obj; +is_edible(register struct obj *obj) { /* protect invocation tools but not Rider corpses (handled elsewhere)*/ /* if (obj->oclass != FOOD_CLASS && obj_resists(obj, 0, 0)) */ @@ -136,7 +135,7 @@ register struct obj *obj; /* used for hero init, life saving (if choking), and prayer results of fix starving, fix weak from hunger, or golden glow boon (if u.uhunger < 900) */ void -init_uhunger() +init_uhunger(void) { flags.botl = (u.uhs != NOT_HUNGRY || ATEMP(A_STR) < 0); u.uhunger = 900; @@ -201,9 +200,9 @@ static NEARDATA struct { static char *eatmbuf = 0; /* set by cpostfx() */ -/* called after mimicing is over */ +/** called after mimicing is over */ static int -eatmdone() /* called after mimicing is over */ +eatmdone(void) { /* release `eatmbuf' */ if (eatmbuf) { @@ -220,7 +219,7 @@ eatmdone() /* called after mimicing is over */ /* called when hallucination is toggled */ void -eatmupdate() +eatmupdate(void) { const char *altmsg = 0; int altapp = 0; /* lint suppression */ @@ -256,9 +255,7 @@ eatmupdate() /* ``[the(] singular(food, xname) [)]'' with awareness of unique monsters */ static const char * -food_xname(food, the_pfx) -struct obj *food; -boolean the_pfx; +food_xname(struct obj *food, boolean the_pfx) { const char *result; @@ -287,8 +284,7 @@ boolean the_pfx; * To a full belly all food is bad. (It.) */ static void -choke(food) -struct obj *food; +choke(struct obj *food) { /* only happens if you were satiated */ if (u.uhs != SATIATED) { @@ -336,7 +332,7 @@ struct obj *food; /* modify object wt. depending on time spent consuming it */ static void -recalc_wt() +recalc_wt(void) { struct obj *piece = victual.piece; if (!piece) { @@ -356,7 +352,7 @@ recalc_wt() /* called when eating interrupted by an event */ void -reset_eat() +reset_eat(void) { /* we only set a flag here - the actual reset process is done after * the round is spent eating. @@ -372,8 +368,7 @@ reset_eat() /* base nutrition of a food-class object */ static unsigned -obj_nutrition(otmp) -struct obj *otmp; +obj_nutrition(struct obj *otmp) { unsigned nut; if (otmp->otyp == CORPSE) { @@ -410,8 +405,7 @@ struct obj *otmp; } static struct obj * -touchfood(otmp) -struct obj *otmp; +touchfood(struct obj *otmp) { if (otmp->quan > 1L) { if(!carried(otmp)) @@ -448,8 +442,7 @@ struct obj *otmp; * in do_reset_eat(). */ void -food_disappears(obj) -struct obj *obj; +food_disappears(struct obj *obj) { if (obj == victual.piece) { victual.piece = (struct obj *) 0; @@ -464,8 +457,7 @@ struct obj *obj; so the sequence start eating/opening, get interrupted, name the food, resume eating/opening would restart from scratch */ void -food_substitution(old_obj, new_obj) -struct obj *old_obj, *new_obj; +food_substitution(struct obj *old_obj, struct obj *new_obj) { if (old_obj == victual.piece) { victual.piece = new_obj; @@ -478,7 +470,7 @@ struct obj *old_obj, *new_obj; } static void -do_reset_eat() +do_reset_eat(void) { #ifdef DEBUG debugpline("do_reset_eat..."); @@ -503,7 +495,7 @@ do_reset_eat() /* called each move during eating process */ static int -eatfood() +eatfood(void) { if (!victual.piece || (!carried(victual.piece) && !obj_here(victual.piece, u.ux, u.uy))) { @@ -534,8 +526,7 @@ eatfood() } static void -done_eating(message) -boolean message; +done_eating(boolean message) { victual.piece->in_use = TRUE; @@ -568,9 +559,7 @@ boolean message; /* eating a corpse or egg of one's own species is usually naughty */ static boolean -maybe_cannibal(pm, allowmsg) -int pm; -boolean allowmsg; +maybe_cannibal(int pm, boolean allowmsg) { static NEARDATA long ate_brains = 0L; struct permonst *fptr = &mons[pm]; /* food type */ @@ -609,8 +598,7 @@ boolean allowmsg; } static void -cprefx(pm) -register int pm; +cprefx(register int pm) { (void) maybe_cannibal(pm, TRUE); if (flesh_petrifies(&mons[pm])) { @@ -691,8 +679,7 @@ register int pm; */ boolean -bite_monster(mon) -struct monst *mon; +bite_monster(struct monst *mon) { switch(monsndx(mon->data)) { case PM_LIZARD: @@ -724,7 +711,7 @@ struct monst *mon; } void -fix_petrification() +fix_petrification(void) { char buf[BUFSZ]; @@ -748,9 +735,7 @@ fix_petrification() /* intrinsic_possible() returns TRUE iff a monster can give an intrinsic. */ int -intrinsic_possible(type, ptr) -int type; -register struct permonst *ptr; +intrinsic_possible(int type, register struct permonst *ptr) { switch (type) { case FIRE_RES: @@ -844,9 +829,7 @@ register struct permonst *ptr; * and what type of intrinsic it is trying to give you. */ static void -givit(type, ptr) -int type; -register struct permonst *ptr; +givit(int type, register struct permonst *ptr) { register int chance; @@ -992,8 +975,7 @@ register struct permonst *ptr; /* called after completely consuming a corpse */ static void -cpostfx(pm) -int pm; +cpostfx(int pm) { int tmp = 0; int catch_lycanthropy = NON_PM; @@ -1250,7 +1232,7 @@ int pm; /** * @deprecated violated(CONDUCT_VEGETARIAN) replaces violated_vegetarian() */ void -violated_vegetarian() +violated_vegetarian(void) { violated(CONDUCT_VEGETARIAN); } @@ -1258,8 +1240,7 @@ violated_vegetarian() /* common code to check and possibly charge for 1 context.tin.tin, * will split() context.tin.tin if necessary */ static struct obj * -costly_tin(alter_type) -int alter_type; /* COST_xxx */ +costly_tin(int alter_type) /**< COST_xxx */ { if (carried(tin.tin) ? tin.tin->unpaid : (costly_spot(tin.tin->ox, tin.tin->oy) && !tin.tin->no_charge)) { @@ -1272,9 +1253,7 @@ int alter_type; /* COST_xxx */ } int -tin_variety_txt(s, tinvariety) -char *s; -int *tinvariety; +tin_variety_txt(char *s, int *tinvariety) { int k, l; @@ -1296,10 +1275,7 @@ int *tinvariety; * as is the case with caller xname(). */ void -tin_details(obj, mnum, buf) -struct obj *obj; -int mnum; -char *buf; +tin_details(struct obj *obj, int mnum, char *buf) { char buf2[BUFSZ]; int r = tin_variety(obj, TRUE); @@ -1331,9 +1307,7 @@ char *buf; } void -set_tin_variety(obj, forcetype) -struct obj *obj; -int forcetype; +set_tin_variety(struct obj *obj, int forcetype) { register int r; @@ -1364,9 +1338,8 @@ int forcetype; } static int -tin_variety(obj, disp) -struct obj *obj; -boolean disp; /* we're just displaying so leave things alone */ +tin_variety(struct obj *obj, + boolean disp) /**< we're just displaying so leave things alone */ { register int r; @@ -1399,7 +1372,7 @@ boolean disp; /* we're just displaying so leave things alone */ /* called during each move whilst opening a tin */ static int -opentin() +opentin(void) { register int r; const char *what; @@ -1423,8 +1396,7 @@ opentin() } static void -consume_tin(mesg) -const char *mesg; +consume_tin(const char *mesg) { const char *what; int mnum, which, r; @@ -1570,8 +1542,7 @@ const char *mesg; /* called when starting to open a tin */ static void -start_tin(otmp) -register struct obj *otmp; +start_tin(register struct obj *otmp) { const char *mesg = 0; register int tmp; @@ -1637,7 +1608,7 @@ register struct obj *otmp; /* called when waking up after fainting */ int -Hear_again() +Hear_again(void) { flags.soundok = 1; flags.botl = TRUE; @@ -1646,8 +1617,7 @@ Hear_again() /* called on the "first bite" of rotten food */ static int -rottenfood(obj) -struct obj *obj; +rottenfood(struct obj *obj) { pline("Blecch! Rotten %s!", maybe_polyd(is_vampire(youmonst.data), @@ -1687,8 +1657,7 @@ struct obj *obj; /* called when a corpse is selected as food */ static int -eatcorpse(otmp) -struct obj *otmp; +eatcorpse(struct obj *otmp) { int tp = 0, mnum = otmp->corpsenm; long rotted = 0L; @@ -1842,9 +1811,7 @@ struct obj *otmp; /* called as you start to eat */ static void -start_eating(otmp, already_partly_eaten) -struct obj *otmp; -boolean already_partly_eaten; +start_eating(struct obj *otmp, boolean already_partly_eaten) { #ifdef DEBUG debugpline("start_eating: %lx (victual = %lx)", otmp, victual.piece); @@ -1902,8 +1869,7 @@ boolean already_partly_eaten; * finishing at the time they're issued. */ static void -fprefx(otmp) -struct obj *otmp; +fprefx(struct obj *otmp) { switch (otmp->otyp) { case FOOD_RATION: @@ -2016,8 +1982,7 @@ struct obj *otmp; /* increment a combat intrinsic with limits on its growth */ static int -bounded_increase(old, inc, typ) -int old, inc, typ; +bounded_increase(int old, int inc, int typ) { int absold, absinc, sgnold, sgninc; @@ -2060,16 +2025,14 @@ int old, inc, typ; } static void -accessory_has_effect(otmp) -struct obj *otmp; +accessory_has_effect(struct obj *otmp) { pline("Magic spreads through your body as you digest the %s.", otmp->oclass == RING_CLASS ? "ring" : "amulet"); } static void -eataccessory(otmp) -struct obj *otmp; +eataccessory(struct obj *otmp) { int typ = otmp->otyp; long oldprop; @@ -2225,7 +2188,7 @@ struct obj *otmp; } /* called after eating non-food */ static void -eatspecial() +eatspecial(void) { struct obj *otmp = victual.piece; @@ -2306,8 +2269,7 @@ static const char *foodwords[] = { }; static const char * -foodword(otmp) -register struct obj *otmp; +foodword(register struct obj *otmp) { if (otmp->oclass == FOOD_CLASS) return "food"; if (otmp->oclass == GEM_CLASS && @@ -2319,8 +2281,7 @@ register struct obj *otmp; /* called after consuming (non-corpse) food */ static void -fpostfx(otmp) -struct obj *otmp; +fpostfx(struct obj *otmp) { switch (otmp->otyp) { case SPRIG_OF_WOLFSBANE: @@ -2412,8 +2373,7 @@ struct obj *otmp; * return 2 if the food was dangerous and you chose to eat it anyway. */ static int -edibility_prompts(otmp) -struct obj *otmp; +edibility_prompts(struct obj *otmp) { /* blessed food detection granted you a one-use ability to detect food that is unfit for consumption @@ -2545,7 +2505,7 @@ struct obj *otmp; /* 'e' command */ int -doeat() +doeat(void) { struct obj *otmp; int basenutrit; /* nutrition of full item */ @@ -2862,8 +2822,7 @@ doeat() } int -use_tin_opener(obj) -struct obj *obj; +use_tin_opener(struct obj *obj) { struct obj *otmp; int res = 0; @@ -2900,7 +2859,7 @@ struct obj *obj; * modifying usedtime. Returns 1 if they choked and survived, 0 otherwise. */ static int -bite() +bite(void) { if (victual.canchoke && u.uhunger >= 2000) { choke(victual.piece); @@ -2925,7 +2884,7 @@ bite() /* as time goes by - called by moveloop(every move) & domove(melee attack) */ void -gethungry() +gethungry(void) { if (u.uinvulnerable) return; /* you don't feel hungrier */ @@ -2977,8 +2936,7 @@ gethungry() /* called after vomiting and after performing feats of magic */ void -morehungry(num) -int num; +morehungry(int num) { u.uhunger -= num; newuhs(TRUE); @@ -2986,8 +2944,7 @@ int num; /* called after eating (and after drinking fruit juice) */ void -lesshungry(num) -int num; +lesshungry(int num) { /* See comments in newuhs() for discussion on force_save_hs */ boolean iseating = (occupation == eatfood) || force_save_hs; @@ -3031,7 +2988,7 @@ int num; } static int -unfaint() +unfaint(void) { (void) Hear_again(); if(u.uhs > FAINTING) @@ -3047,14 +3004,14 @@ unfaint() } boolean -is_fainted() +is_fainted(void) { return((boolean)(u.uhs == FAINTED)); } /* call when a faint must be prematurely terminated */ void -reset_faint() +reset_faint(void) { if (is_fainted()) { nomul(0, 0); @@ -3066,8 +3023,7 @@ reset_faint() /* compute and comment on your (new?) hunger status */ void -newuhs(incr) -boolean incr; +newuhs(boolean incr) { unsigned newhs; static unsigned save_hs; @@ -3223,9 +3179,9 @@ boolean incr; * in inventory. */ struct obj * -floorfood(verb, corpsecheck) /* get food from floor or pack */ -const char *verb; -int corpsecheck; /* 0, no check, 1, corpses, 2, tinnable corpses */ +floorfood( + const char *verb, + int corpsecheck) /**< 0, no check, 1, corpses, 2, tinnable corpses */ { register struct obj *otmp; char qbuf[QBUFSZ]; @@ -3351,7 +3307,7 @@ int corpsecheck; /* 0, no check, 1, corpses, 2, tinnable corpses */ /* Side effects of vomiting */ /* added nomul (MRS) - it makes sense, you're too busy being sick! */ void -vomit() /* A good idea from David Neves */ +vomit(void) /* A good idea from David Neves */ { if (cantvomit(youmonst.data)) { /* doesn't cure food poisoning; message assumes that we aren't @@ -3380,9 +3336,7 @@ vomit() /* A good idea from David Neves */ } int -eaten_stat(base, obj) -register int base; -register struct obj *obj; +eaten_stat(register int base, register struct obj *obj) { long uneaten_amt, full_amount; @@ -3402,9 +3356,7 @@ register struct obj *obj; /* reduce obj's oeaten field, making sure it never hits or passes 0 */ void -consume_oeaten(obj, amt) -struct obj *obj; -int amt; +consume_oeaten(struct obj *obj, int amt) { /* * This is a hack to try to squelch several long standing mystery @@ -3453,8 +3405,7 @@ int amt; /* called when eatfood occupation has been interrupted, or in the case of theft, is about to be interrupted */ boolean -maybe_finished_meal(stopping) -boolean stopping; +maybe_finished_meal(boolean stopping) { /* in case consume_oeaten() has decided that the food is all gone */ if (occupation == eatfood && victual.usedtime >= victual.reqtime) { @@ -3471,8 +3422,7 @@ boolean stopping; effects there take place on first bite rather than at end of occupation. [Popeye the Sailor gets out of trouble by eating tins of spinach. :-] */ boolean -Popeye(threat) -int threat; +Popeye(int threat) { struct obj *otin; int mndx; diff --git a/src/end.c b/src/end.c index ff233cd03..0e753a743 100644 --- a/src/end.c +++ b/src/end.c @@ -35,19 +35,19 @@ static void done_intr(int); static void done_hangup(int); # endif #endif -static int heaven_or_hell_lifesave_end(); -static void disclose(int, BOOLEAN_P); +static int heaven_or_hell_lifesave_end(void); +static void disclose(int, boolean); static void get_valuables(struct obj *); static void sort_valuables(struct valuable_data *, int); -static void artifact_score(struct obj *, BOOLEAN_P, winid); +static void artifact_score(struct obj *, boolean, winid); static void savelife(int); #ifdef DUMP_LOG extern char msgs[][BUFSZ]; extern int msgs_count[]; extern int lastmsg; -void do_vanquished(int, BOOLEAN_P); +void do_vanquished(int, boolean); #endif /* DUMP_LOG */ -static void list_genocided(int, BOOLEAN_P, BOOLEAN_P); +static void list_genocided(int, boolean, boolean); static boolean should_query_disclose_option(int, char *); #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2) @@ -105,10 +105,10 @@ static NEARDATA const char *ends[] = { /* "when you..." */ extern const char * const killed_by_prefix[]; /* from topten.c */ +/* called as signal() handler, so sent at least one arg */ /*ARGSUSED*/ void -done1(sig_unused) /* called as signal() handler, so sent at least one arg */ -int sig_unused UNUSED; +done1(int sig_unused UNUSED) { #ifndef NO_SIGNAL (void) signal(SIGINT, SIG_IGN); @@ -129,7 +129,7 @@ int sig_unused UNUSED; /* "#quit" command or keyboard interrupt */ int -done2() +done2(void) { if (iflags.debug_fuzzer) { return 0; @@ -177,8 +177,8 @@ done2() #ifndef NO_SIGNAL /*ARGSUSED*/ static void -done_intr(sig_unused) /* called as signal() handler, so sent at least one arg */ -int sig_unused UNUSED; +done_intr(int sig_unused UNUSED) /* called as signal() handler, so sent at least one arg */ + { done_stopprint++; (void) signal(SIGINT, SIG_IGN); @@ -190,8 +190,8 @@ int sig_unused UNUSED; # if defined(UNIX) || defined(VMS) || defined(__EMX__) static void -done_hangup(sig) /* signal() handler */ -int sig; +done_hangup(int sig) /* signal() handler */ + { program_state.done_hup++; (void)signal(SIGHUP, SIG_IGN); @@ -202,8 +202,7 @@ int sig; #endif /* NO_SIGNAL */ void -done_in_by(mtmp) -register struct monst *mtmp; +done_in_by(register struct monst *mtmp) { char buf[BUFSZ]; struct permonst *mptr = mtmp->data; @@ -361,9 +360,7 @@ panic VA_DECL(const char *, str) } static boolean -should_query_disclose_option(category, defquery) -int category; -char *defquery; +should_query_disclose_option(int category, char *defquery) { int idx; char *dop = index(disclosure_options, category); @@ -399,9 +396,7 @@ char *defquery; } static void -disclose(how, taken) -int how; -boolean taken; +disclose(int how, boolean taken) { char c = 0, defquery; char qbuf[QBUFSZ]; @@ -463,8 +458,7 @@ boolean taken; /* try to get the player back in a viable state after being killed */ static void -savelife(how) -int how; +savelife(int how) { u.uswldtim = 0; u.uhp = u.uhpmax; @@ -493,8 +487,7 @@ int how; * intact. */ static void -get_valuables(list) -struct obj *list; /* inventory or container contents */ +get_valuables(struct obj *list) /**< inventory or container contents */ { register struct obj *obj; register int i; @@ -526,9 +519,9 @@ struct obj *list; /* inventory or container contents */ * as easily use qsort, but we don't care about efficiency here. */ static void -sort_valuables(list, size) -struct valuable_data list[]; -int size; /* max value is less than 20 */ +sort_valuables( + struct valuable_data *list, + int size) /**< max value is less than 20 */ { register int i, j; struct valuable_data ltmp; @@ -549,10 +542,10 @@ int size; /* max value is less than 20 */ /* called twice; first to calculate total, then to list relevant items */ static void -artifact_score(list, counting, endwin) -struct obj *list; -boolean counting; /* true => add up points; false => display them */ -winid endwin; +artifact_score(struct obj *list, boolean counting, winid endwin) + + /* true => add up points; false => display them */ + { char pbuf[BUFSZ]; struct obj *otmp; @@ -591,8 +584,7 @@ winid endwin; /* Be careful not to call panic from here! */ void -done(how) -int how; +done(int how) { boolean taken; char kilbuf[BUFSZ], pbuf[BUFSZ]; @@ -810,10 +802,10 @@ int how; } if (have_windows) wait_synch(); /* flush screen output */ #ifndef NO_SIGNAL - (void) signal(SIGINT, (SIG_RET_TYPE) done_intr); + (void)signal(SIGINT, (SIG_RET_TYPE) done_intr); # if defined(UNIX) || defined(VMS) || defined (__EMX__) - (void) signal(SIGQUIT, (SIG_RET_TYPE) done_intr); - (void) signal(SIGHUP, (SIG_RET_TYPE) done_hangup); + (void)signal(SIGQUIT, (SIG_RET_TYPE) done_intr); + (void)signal(SIGHUP, (SIG_RET_TYPE) done_hangup); # endif #endif /* NO_SIGNAL */ @@ -1150,7 +1142,7 @@ int how; } static int -heaven_or_hell_lifesave_end() +heaven_or_hell_lifesave_end(void) { u.uinvulnerable = FALSE; return(1); @@ -1158,9 +1150,7 @@ heaven_or_hell_lifesave_end() void -container_contents(list, identified, all_containers, want_disp) -struct obj *list; -boolean identified, all_containers, want_disp; +container_contents(struct obj *list, boolean identified, boolean all_containers, boolean want_disp) { register struct obj *box, *obj; #ifdef SORTLOOT @@ -1268,8 +1258,7 @@ boolean identified, all_containers, want_disp; /* should be called with either EXIT_SUCCESS or EXIT_FAILURE */ void -nh_terminate(status) -int status; +nh_terminate(int status) { #ifdef MAC getreturn("to exit"); @@ -1287,7 +1276,7 @@ int status; /* #vanquished extended command, based on showborn. There is probably a much better place to put this. */ void -list_vanquishedonly() +list_vanquishedonly(void) { register int i, lev; int ntypes = 0, max_lev = 0, nkilled; @@ -1356,19 +1345,15 @@ list_vanquishedonly() } } -void /* showborn patch */ -list_vanquished(defquery, ask) -char defquery; -boolean ask; +void /* showborn patch */ +list_vanquished(char defquery, boolean ask) #ifdef DUMP_LOG { do_vanquished(defquery, ask); } void -do_vanquished(defquery, ask) -int defquery; -boolean ask; +do_vanquished(int defquery, boolean ask) #endif { register int i, lev; @@ -1457,7 +1442,7 @@ boolean ask; /* number of monster species which have been genocided */ int -num_genocides() +num_genocides(void) { int i, n = 0; @@ -1468,10 +1453,7 @@ num_genocides() } static void -list_genocided(defquery, ask, want_disp) -int defquery; -boolean ask; -boolean want_disp UNUSED; +list_genocided(int defquery, boolean ask, boolean want_disp UNUSED) { register int i; int ngenocided=0; @@ -1575,10 +1557,7 @@ boolean want_disp UNUSED; /* set a delayed killer, ensure non-delayed killer is cleared out */ void -delayed_killer(id, format, killername) -int id; -int format; -const char *killername; +delayed_killer(int id, int format, const char *killername) { struct kinfo *k = find_delayed_killer(id); @@ -1597,8 +1576,7 @@ const char *killername; } struct kinfo * -find_delayed_killer(id) -int id; +find_delayed_killer(int id) { struct kinfo *k; @@ -1611,8 +1589,7 @@ int id; } void -dealloc_killer(kptr) -struct kinfo *kptr; +dealloc_killer(struct kinfo *kptr) { struct kinfo *prev = &killer, *k; @@ -1636,9 +1613,7 @@ struct kinfo *kptr; } void -save_killers(fd, mode) -int fd; -int mode; +save_killers(int fd, int mode) { struct kinfo *kptr; @@ -1657,8 +1632,7 @@ int mode; } void -restore_killers(fd) -int fd; +restore_killers(int fd) { struct kinfo *kptr; @@ -1671,8 +1645,7 @@ int fd; } static int -wordcount(p) -char *p; +wordcount(char *p) { int words = 0; @@ -1691,8 +1664,7 @@ char *p; } static void -bel_copy1(inp, out) -char **inp, *out; +bel_copy1(char **inp, char *out) { char *in = *inp; @@ -1708,8 +1680,7 @@ char **inp, *out; } char * -build_english_list(in) -char *in; +build_english_list(char *in) { char *out, *p = in; int len = (int) strlen(p), words = wordcount(p); diff --git a/src/engrave.c b/src/engrave.c index e94e3e618..0570d78fe 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -108,11 +108,10 @@ static const char *random_mesg[] = { "Our coil is broken, and we don't have a replacement. It's useless. It's so useless.", }; -static const char *blengr(); +static const char *blengr(void); char * -random_engraving(outbuf) -char *outbuf; +random_engraving(char *outbuf) { const char *rumor; @@ -147,10 +146,10 @@ static const struct { }; void -wipeout_text(engr, cnt, seed) -char *engr; -int cnt; -unsigned seed; /* for semi-controlled randomization */ +wipeout_text( + char *engr, /**< engraving text */ + int cnt, /**< number of chars to degrade */ + unsigned int seed) /**< for semi-controlled randomization */ { char *s; int i, j, nxt, use_rubout, lth = (int)strlen(engr); @@ -208,8 +207,7 @@ unsigned seed; /* for semi-controlled randomization */ /* check whether hero can reach something at ground level */ boolean -can_reach_floor(check_pit) -boolean check_pit; +can_reach_floor(boolean check_pit) { struct trap *t; @@ -234,26 +232,21 @@ boolean check_pit; } void -You_cant_reach_the_floor(x, y, check_pit) -int x, y; -boolean check_pit; +You_cant_reach_the_floor(int x, int y, boolean check_pit) { You("can't reach the %s.", (check_pit && can_reach_floor(FALSE)) ? "bottom of the pit" : surface(x, y)); } void -You_cant_reach_the_ceiling(x, y) -int x, y; +You_cant_reach_the_ceiling(int x, int y) { You("can't reach the %s.", ceiling(x, y)); } /* give a message after caller has determined that hero can't reach */ void -cant_reach_floor(x, y, up, check_pit) -int x, y; -boolean up, check_pit; +cant_reach_floor(int x, int y, boolean up, boolean check_pit) { You("can't reach the %s.", up ? ceiling(x, y) @@ -263,8 +256,7 @@ boolean up, check_pit; } const char * -surface(x, y) -register int x, y; +surface(register int x, register int y) { register struct rm *lev = &levl[x][y]; @@ -297,8 +289,7 @@ register int x, y; } const char * -ceiling(x, y) -register int x, y; +ceiling(register int x, register int y) { register struct rm *lev = &levl[x][y]; const char *what; @@ -326,8 +317,7 @@ register int x, y; } struct engr * -engr_at(x, y) -xchar x, y; +engr_at(xchar x, xchar y) { register struct engr *ep = head_engr; @@ -346,9 +336,7 @@ xchar x, y; * Returns the type of engraving. */ int -sengr_at(s, x, y) -const char *s; -xchar x, y; +sengr_at(const char *s, xchar x, xchar y) { register struct engr *ep = engr_at(x, y); @@ -370,8 +358,7 @@ xchar x, y; */ static unsigned -nengr_at(x, y) -xchar x, y; +nengr_at(xchar x, xchar y) { const char *s = "Elbereth"; register struct engr *ep = engr_at(x, y); @@ -392,16 +379,14 @@ xchar x, y; #endif /* ELBERETH_CONDUCT */ void -u_wipe_engr(cnt) -register int cnt; +u_wipe_engr(register int cnt) { if (can_reach_floor(TRUE)) wipe_engr_at(u.ux, u.uy, cnt); } void -wipe_engr_at(x, y, cnt) -register xchar x, y, cnt; +wipe_engr_at(register xchar x, register xchar y, register xchar cnt) { register struct engr *ep = engr_at(x, y); @@ -420,8 +405,7 @@ register xchar x, y, cnt; } void -read_engr_at(x, y) -int x, y; +read_engr_at(int x, int y) { register struct engr *ep = engr_at(x, y); int sensed = 0; @@ -500,11 +484,7 @@ int x, y; } void -make_engr_at(x, y, s, e_time, e_type) -int x, y; -const char *s; -long e_time; -xchar e_type; +make_engr_at(int x, int y, const char *s, long int e_time, xchar e_type) { struct engr *ep; size_t smem = strlen(s) + 1; @@ -530,8 +510,7 @@ xchar e_type; /* delete any engraving at location */ void -del_engr_at(x, y) -int x, y; +del_engr_at(int x, int y) { register struct engr *ep = engr_at(x, y); @@ -542,7 +521,7 @@ int x, y; * freehand - returns true if player has a free hand */ int -freehand() +freehand(void) { return(!uwep || !welded(uwep) || (!bimanual(uwep) && (!uarms || !uarms->cursed))); @@ -583,13 +562,13 @@ static int engrave(const char *, boolean); /** return 1 if action took 1 (or more) moves, 0 if error or aborted */ int -doengrave() +doengrave(void) { return engrave(NULL, FALSE); } int -doengrave_elbereth() +doengrave_elbereth(void) { if (flags.elberethignore) { You_feel("Varda would not appreciate that."); @@ -601,9 +580,7 @@ doengrave_elbereth() static int -engrave(engraving, fingers) -const char *engraving; -boolean fingers; +engrave(const char *engraving, boolean fingers) { boolean dengr = FALSE; /* TRUE if we wipe out the current engraving */ boolean doblind = FALSE;/* TRUE if engraving blinds the player */ @@ -1401,7 +1378,7 @@ boolean fingers; /* while loading bones, clean up text which might accidentally or maliciously disrupt player's terminal when displayed */ void -sanitize_engravings() +sanitize_engravings(void) { struct engr *ep; @@ -1411,8 +1388,7 @@ sanitize_engravings() } void -save_engravings(fd, mode) -int fd, mode; +save_engravings(int fd, int mode) { struct engr *ep = head_engr; struct engr *ep2; @@ -1435,8 +1411,7 @@ int fd, mode; } void -rest_engravings(fd) -int fd; +rest_engravings(int fd) { struct engr *ep; unsigned lth; @@ -1459,10 +1434,7 @@ int fd; /* to support '#stats' wizard-mode command */ void -engr_stats(hdrfmt, hdrbuf, count, size) -const char *hdrfmt; -char *hdrbuf; -long *count, *size; +engr_stats(const char *hdrfmt, char *hdrbuf, long int *count, long int *size) { struct engr *ep; @@ -1476,8 +1448,7 @@ long *count, *size; void -del_engr(ep) -register struct engr *ep; +del_engr(register struct engr *ep) { if (ep == head_engr) { head_engr = ep->nxt_engr; @@ -1499,8 +1470,7 @@ register struct engr *ep; /* randomly relocate an engraving */ void -rloc_engr(ep) -struct engr *ep; +rloc_engr(struct engr *ep) { int tx, ty, tryct = 200; @@ -1643,9 +1613,7 @@ static const char *epitaphs[] = { * The caller is responsible for newsym(x, y). */ void -make_grave(x, y, str) -int x, y; -const char *str; +make_grave(int x, int y, const char *str) { /* Can we put a grave here? */ if ((levl[x][y].typ != ROOM && levl[x][y].typ != GRAVE) || t_at(x, y)) return; @@ -1682,7 +1650,7 @@ static const char blind_writing[][21] = { }; static const char * -blengr() +blengr(void) { return blind_writing[rn2(SIZE(blind_writing))]; } diff --git a/src/exper.c b/src/exper.c index 457f43dce..a942ca8dc 100644 --- a/src/exper.c +++ b/src/exper.c @@ -61,8 +61,7 @@ newuexp(int lev) } static int -enermod(en) -int en; +enermod(int en) { switch (Role_switch) { case PM_PRIEST: @@ -81,7 +80,7 @@ int en; /* calculate spell power/energy points for new level */ int -newpw() +newpw(void) { int en = 0, enrnd, enfix; @@ -115,9 +114,7 @@ newpw() /* return # of exp points for mtmp after nk killed */ int -experience(mtmp, nk) -register struct monst *mtmp; -int nk UNUSED; +experience(struct monst *mtmp, int nk UNUSED) { register struct permonst *ptr = mtmp->data; int i, tmp, tmp2; @@ -180,8 +177,7 @@ int nk UNUSED; * Adds to Experience and Scoring counter */ void -more_experienced(exp, score, rexp) -register int exp, score, rexp; +more_experienced(register int exp, register int score, register int rexp) { u.uexp += exp; u.urexp += 4*exp + rexp; @@ -210,8 +206,7 @@ register int exp, score, rexp; /* e.g., hit by drain life attack */ void -losexp(drainer) -const char *drainer; /* cause of death, if drain should be fatal */ +losexp(const char *drainer) /**< cause of death, if drain should be fatal */ { register int num; @@ -277,15 +272,15 @@ const char *drainer; /* cause of death, if drain should be fatal */ * at a dragon created with a wand of polymorph?? */ void -newexplevel() +newexplevel(void) { if (u.ulevel < MAXULEV && u.uexp >= newuexp(u.ulevel)) pluslvl(TRUE); } void -pluslvl(incr) -boolean incr; /* true iff via incremental experience growth */ +pluslvl(boolean incr) + /* true iff via incremental experience growth */ { /* (false for potion of gain level) */ register int num; @@ -342,8 +337,7 @@ boolean incr; /* true iff via incremental experience growth */ experience level: base number of points needed to reach the current level plus a random portion of what it takes to get to the next level */ long -rndexp(gaining) -boolean gaining; /* gaining XP via potion vs setting XP for polyself */ +rndexp(boolean gaining) /**< gaining XP via potion vs setting XP for polyself */ { long minexp, maxexp, diff, factor, result; diff --git a/src/explode.c b/src/explode.c index 95b38e053..caf98af49 100644 --- a/src/explode.c +++ b/src/explode.c @@ -26,12 +26,12 @@ static int expl[3][3] = { * that Half_physical_damage only affects the damage applied to the hero. */ void -explode(x, y, type, dam, olet, expltype) -int x, y; -int type; /* the same as in zap.c; passes -(wand typ) for some WAND_CLASS */ -int dam; -char olet; -int expltype; +explode(int x, int y, int type, int dam, char olet, int expltype) + + /* the same as in zap.c; passes -(wand typ) for some WAND_CLASS */ + + + { int i, j, k, damu = dam; boolean starting = 1; @@ -574,11 +574,10 @@ struct scatter_chain { /* returns number of scattered objects */ long -scatter(sx, sy, blastforce, scflags, obj) -int sx, sy; /* location of objects to scatter */ -int blastforce; /* force behind the scattering */ -unsigned int scflags; -struct obj *obj; /* only scatter this obj */ +scatter(int sx, int sy, /**< location of objects to scatter */ + int blastforce, /**< force behind the scattering */ + unsigned int scflags, + struct obj *obj) /**< only scatter this obj */ { register struct obj *otmp; register int tmp; @@ -769,9 +768,7 @@ struct obj *obj; /* only scatter this obj */ * For now, just perform a "regular" explosion. */ void -splatter_burning_oil(x, y, diluted_oil) -int x, y; -boolean diluted_oil; +splatter_burning_oil(int x, int y, boolean diluted_oil) { int dmg = d(diluted_oil ? 3 : 4, 4); @@ -783,9 +780,7 @@ boolean diluted_oil; /* lit potion of oil is exploding; extinguish it as a light source before possibly killing the hero and attempting to save bones */ void -explode_oil(obj, x, y) -struct obj *obj; -int x, y; +explode_oil(struct obj *obj, int x, int y) { boolean diluted_oil = obj->odiluted; diff --git a/src/extralev.c b/src/extralev.c index 118a42a18..7173aa56c 100644 --- a/src/extralev.c +++ b/src/extralev.c @@ -27,9 +27,7 @@ static void roguecorr(int, int, int); static void miniwalk(int, int); static void -roguejoin(x1, y1, x2, y2, horiz) -int x1, y1, x2, y2; -int horiz; +roguejoin(int x1, int y1, int x2, int y2, int horiz) { int x, y, middle; if (horiz) { @@ -58,8 +56,7 @@ int horiz; } static void -roguecorr(x, y, dir) -int x, y, dir; +roguecorr(int x, int y, int dir) { register int fromx, fromy, tox, toy; @@ -156,8 +153,7 @@ int x, y, dir; /* Modified walkfrom() from mkmaze.c */ static void -miniwalk(x, y) -int x, y; +miniwalk(int x, int y) { register int q, dir; int dirs[4]; @@ -205,7 +201,7 @@ int x, y; } void -makeroguerooms() { +makeroguerooms(void) { register int x, y; /* Rogue levels are structured 3 by 3, with each section containing * a room or an intersection. The minimum width is 2 each way. @@ -289,14 +285,13 @@ makeroguerooms() { } void -corr(x, y) -int x, y; +corr(int x, int y) { levl[x][y].typ = CORR; } void -makerogueghost() +makerogueghost(void) { register struct monst *ghost; struct obj *ghostobj; diff --git a/src/files.c b/src/files.c index 81cd2fdc8..f6c550384 100644 --- a/src/files.c +++ b/src/files.c @@ -121,7 +121,7 @@ struct level_ftrack { #ifdef WIZARD #define WIZKIT_MAX 128 static char wizkit[WIZKIT_MAX]; -static FILE *fopen_wizkit_file(); +static FILE *fopen_wizkit_file(void); #endif #ifdef AMIGA @@ -158,16 +158,16 @@ extern char *sounddir; extern int n_dgns; /* from dungeon.c */ static char *set_bonesfile_name(char *, d_level*); -static char *set_bonestemp_name(); +static char *set_bonestemp_name(void); #ifdef COMPRESS -static void redirect(const char *, const char *, const char *, FILE *, BOOLEAN_P); -static void docompress_file(const char *, const char *, BOOLEAN_P); +static void redirect(const char *, const char *, const char *, FILE *, boolean); +static void docompress_file(const char *, const char *, boolean); #endif #ifndef FILE_AREAS static char *make_lockname(const char *, char *); #endif static FILE *fopen_config_file(const char *, int); -static int get_uchars(FILE *, char *, char *, uchar *, BOOLEAN_P, int, const char *); +static int get_uchars(FILE *, char *, char *, uchar *, boolean, int, const char *); int parse_config_line(FILE *, char *, char *, char *, boolean , int ); #ifdef NOCWD_ASSUMPTIONS static void adjust_prefix(char *, int); @@ -179,7 +179,7 @@ static boolean copy_bytes(int, int); static int open_levelfile_exclusively(const char *, int, int); #endif #ifdef WHEREIS_FILE -static void write_whereis(int); +static void write_whereis(boolean); #endif /* @@ -204,11 +204,7 @@ static void write_whereis(int); * "This%20is%20a%20%25%20test%21" */ char * -fname_encode(legal, quotechar, s, callerbuf, bufsz) -const char *legal; -char quotechar; -char *s, *callerbuf; -int bufsz; +fname_encode(const char *legal, char quotechar, char *s, char *callerbuf, int bufsz) { char *sp, *op; int cnt = 0; @@ -250,10 +246,7 @@ int bufsz; * bufsz size of callerbuf */ char * -fname_decode(quotechar, s, callerbuf, bufsz) -char quotechar; -char *s, *callerbuf; -int bufsz; +fname_decode(char quotechar, char *s, char *callerbuf, int bufsz) { char *sp, *op; int k, calc, cnt = 0; @@ -292,9 +285,7 @@ int bufsz; /*ARGSUSED*/ #endif const char * -fqname(basename, whichprefix, buffnum) -const char *basename; -int whichprefix, buffnum; +fqname(const char *basename, int whichprefix, int buffnum) { #ifndef PREFIXES_IN_USE nhUse(whichprefix); @@ -324,8 +315,7 @@ int whichprefix, buffnum; /* reasonbuf must be at least BUFSZ, supplied by caller */ /*ARGSUSED*/ int -validate_prefix_locations(reasonbuf) -char *reasonbuf; +validate_prefix_locations(char *reasonbuf) { nhUse(reasonbuf); #if defined(NOCWD_ASSUMPTIONS) @@ -369,9 +359,7 @@ char *reasonbuf; /* fopen a file, with OS-dependent bells and whistles */ /* NOTE: a simpler version of this routine also exists in util/dlb_main.c */ FILE * -fopen_datafile(filename, mode, prefix) -const char *filename, *mode; -int prefix; +fopen_datafile(const char *filename, const char *mode, int prefix) { FILE *fp; @@ -424,9 +412,7 @@ set_lock_and_bones() * but be careful if you use it for other things -dgk */ void -set_levelfile_name(file, lev) -char *file; -int lev; +set_levelfile_name(char *file, int lev) { char *tf; @@ -440,9 +426,7 @@ int lev; } int -create_levelfile(lev, errbuf) -int lev; -char errbuf[]; +create_levelfile(int lev, char *errbuf) { int fd; #ifndef FILE_AREAS @@ -495,9 +479,7 @@ char errbuf[]; int -open_levelfile(lev, errbuf) -int lev; -char errbuf[]; +open_levelfile(int lev, char *errbuf) { int fd; #ifndef FILE_AREAS @@ -542,8 +524,7 @@ char errbuf[]; void -delete_levelfile(lev) -int lev; +delete_levelfile(int lev) { /* * Level 0 might be created by port specific code that doesn't @@ -565,7 +546,7 @@ int lev; void -clearlocks() +clearlocks(void) { #if !defined(PC_LOCKING) && defined(MFLOPPY) && !defined(AMIGA) eraseall(levels, alllevels); @@ -655,7 +636,7 @@ int nhclose(int fd) #ifdef WHEREIS_FILE /** Set the filename for the whereis file. */ void -set_whereisfile() +set_whereisfile(void) { char *p = (char *) strstr(whereis_file, "%n"); if (p) { @@ -678,8 +659,9 @@ set_whereisfile() /** Write out information about current game to plname.whereis. */ void -write_whereis(playing) -boolean playing; /**< True if game is running. */ +write_whereis( + boolean playing /**< TRUE if game is running. */ +) { FILE* fp; char whereis_work[511]; @@ -727,20 +709,19 @@ boolean playing; /**< True if game is running. */ /** Signal handler to update whereis information. */ void -signal_whereis(sig_unused) -int sig_unused UNUSED; +signal_whereis(int sig_unused UNUSED) { touch_whereis(); } void -touch_whereis() +touch_whereis(void) { write_whereis(TRUE); } void -delete_whereis() +delete_whereis(void) { write_whereis(FALSE); } @@ -755,9 +736,7 @@ delete_whereis() * bonesid to be read/written in the bones file. */ static char * -set_bonesfile_name(file, lev) -char *file; -d_level *lev; +set_bonesfile_name(char *file, d_level *lev) { s_level *sptr; char *dptr; @@ -790,7 +769,7 @@ d_level *lev; * the same array may be used instead of copying.) */ static char * -set_bonestemp_name() +set_bonestemp_name(void) { char *tf; @@ -804,10 +783,7 @@ set_bonestemp_name() } int -create_bonesfile(lev, bonesid, errbuf) -d_level *lev; -char **bonesid; -char errbuf[]; +create_bonesfile(d_level *lev, char **bonesid, char *errbuf) { const char *file; int fd; @@ -883,8 +859,7 @@ cancel_bonesfile() /* move completed bones file to proper name */ void -commit_bonesfile(lev) -d_level *lev; +commit_bonesfile(d_level *lev) { #ifndef FILE_AREAS const char *fq_bones; @@ -927,9 +902,7 @@ d_level *lev; int -open_bonesfile(lev, bonesid) -d_level *lev; -char **bonesid; +open_bonesfile(d_level *lev, char **bonesid) { #ifndef FILE_AREAS const char *fq_bones; @@ -954,8 +927,7 @@ char **bonesid; int -delete_bonesfile(lev) -d_level *lev; +delete_bonesfile(d_level *lev) { (void) set_bonesfile_name(bones, lev); #ifdef FILE_AREAS @@ -969,7 +941,7 @@ d_level *lev; /* assume we're compressing the recently read or created bonesfile, so the * file name is already set properly */ void -compress_bonesfile() +compress_bonesfile(void) { #ifdef FILE_AREAS compress_area(FILE_AREA_BONES, bones); @@ -986,7 +958,7 @@ compress_bonesfile() /* set savefile name in OS-dependent manner from pre-existing plname, * avoiding troublesome characters */ void -set_savefile_name() +set_savefile_name(void) { #if defined(WIN32) char fnamebuf[BUFSZ], encodedfnamebuf[BUFSZ]; @@ -1040,8 +1012,7 @@ set_savefile_name() #ifdef INSURANCE void -save_savefile_name(fd) -int fd; +save_savefile_name(int fd) { (void) write(fd, (genericptr_t) SAVEF, sizeof(SAVEF)); } @@ -1051,7 +1022,7 @@ int fd; #if defined(WIZARD) && !defined(MICRO) /* change pre-existing savefile name to indicate an error savefile */ void -set_error_savefile() +set_error_savefile(void) { # ifdef VMS { @@ -1072,7 +1043,7 @@ set_error_savefile() /* create save file, overwriting one if it already exists */ int -create_savefile() +create_savefile(void) { #ifndef FILE_AREAS const char *fq_save; @@ -1121,7 +1092,7 @@ create_savefile() /* open savefile for reading */ int -open_savefile() +open_savefile(void) { int fd; @@ -1142,7 +1113,7 @@ open_savefile() /* delete savefile */ int -delete_savefile() +delete_savefile(void) { #ifdef FILE_AREAS (void) remove_area(FILE_AREA_SAVE, SAVEF); @@ -1155,7 +1126,7 @@ delete_savefile() /* try to open up a save file and prepare to restore it */ int -restore_saved_game() +restore_saved_game(void) { #ifndef FILE_AREAS const char *fq_save; @@ -1243,7 +1214,7 @@ const char* filename; #endif /* defined(UNIX) && defined(QT_GRAPHICS) */ char** -get_saved_games() +get_saved_games(void) { #if defined(UNIX) && defined(QT_GRAPHICS) int myuid=getuid(); @@ -1276,8 +1247,7 @@ get_saved_games() } void -free_saved_games(saved) -char** saved; +free_saved_games(char **saved) { if ( saved ) { int i=0; @@ -1295,10 +1265,7 @@ char** saved; #ifdef COMPRESS static void -redirect(filearea, filename, mode, stream, uncomp) -const char *filearea, *filename, *mode; -FILE *stream; -boolean uncomp; +redirect(const char *filearea, const char *filename, const char *mode, FILE *stream, boolean uncomp) { #ifndef FILE_AREAS if (freopen(filename, mode, stream) == (FILE *)0) { @@ -1319,9 +1286,7 @@ boolean uncomp; * cf. child() in unixunix.c. */ static void -docompress_file(filearea, filename, uncomp) -const char *filearea, *filename; -boolean uncomp; +docompress_file(const char *filearea, const char *filename, boolean uncomp) { char cfn[80]; FILE *cf; @@ -1470,8 +1435,7 @@ boolean uncomp; /* compress file */ void -compress_area(filearea, filename) -const char *filearea, *filename; +compress_area(const char *filearea, const char *filename) { #ifndef COMPRESS #if (defined(macintosh) && (defined(__SC__) || defined(__MRC__))) || defined(__MWERKS__) @@ -1485,8 +1449,7 @@ const char *filearea, *filename; /* uncompress file if it exists */ void -uncompress_area(filearea, filename) -const char *filearea, *filename; +uncompress_area(const char *filearea, const char *filename) { #ifndef COMPRESS #if (defined(macintosh) && (defined(__SC__) || defined(__MRC__))) || defined(__MWERKS__) @@ -1553,15 +1516,9 @@ char *lockname; /* lock a file */ boolean #ifdef FILE_AREAS -lock_file(filearea, filename, retryct) -const char *filearea; -const char *filename; -int retryct; +lock_file(const char *filearea, const char *filename, int retryct) #else -lock_file(filename, whichprefix, retryct) -const char *filename; -int whichprefix; -int retryct; +lock_file(const char *filename, int whichprefix, int retryct) #endif { #if (defined(macintosh) && (defined(__SC__) || defined(__MRC__))) || defined(__MWERKS__) @@ -1720,9 +1677,7 @@ int retryct; * lock a file */ boolean -lock_file_area(filearea, filename, retryct) -const char *filearea, *filename; -int retryct; +lock_file_area(const char *filearea, const char *filename, int retryct) { return lock_file(filearea, filename, retryct); } @@ -1738,8 +1693,8 @@ int retryct; /* unlock file, which must be currently locked by lock_file */ void -unlock_file(filename) -const char *filename; +unlock_file(const char *filename) + #if defined(macintosh) && (defined(__SC__) || defined(__MRC__)) # pragma unused(filename) #endif @@ -1785,8 +1740,7 @@ const char *filename; #ifdef FILE_AREAS /* unlock file, which must be currently locked by lock_file_area */ void -unlock_file_area(filearea, filename) -const char *filearea, *filename; +unlock_file_area(const char *filearea, const char *filename) { nhUse(filearea); unlock_file(filename); @@ -1981,14 +1935,14 @@ fopen_config_file(const char *filename, int src) * location is unchanged. Callers must handle zeros if modlist is FALSE. */ static int -get_uchars(fp, buf, bufp, list, modlist, size, name) -FILE *fp; /* input file pointer */ -char *buf; /* read buffer, must be of size BUFSZ */ -char *bufp; /* current pointer */ -uchar *list; /* return list */ -boolean modlist; /* TRUE: list is being modified in place */ -int size; /* return list size */ -const char *name; /* name of option for error message */ +get_uchars( + FILE *fp, /**< input file pointer */ + char *buf, /**< read buffer, must be of size BUFSZ */ + char *bufp, /**< current pointer */ + uchar *list, /**< return list */ + boolean modlist, /**< TRUE: list is being modified in place */ + int size, /**< return list size */ + const char *name) /**< name of option for error message */ { unsigned int num = 0; int count = 0; @@ -2556,7 +2510,7 @@ read_config_file(const char *filename, int src) #ifdef WIZARD static FILE * -fopen_wizkit_file() +fopen_wizkit_file(void) { FILE *fp; #if defined(VMS) || defined(UNIX) @@ -2626,7 +2580,7 @@ fopen_wizkit_file() } void -read_wizkit() +read_wizkit(void) { FILE *fp; char *ep, buf[BUFSZ]; @@ -2670,8 +2624,7 @@ read_wizkit() /* verify that we can write to the scoreboard file; if not, try to create one */ void -check_recordfile(dir) -const char *dir; +check_recordfile(const char *dir) { nhUse(dir); #if (defined(macintosh) && (defined(__SC__) || defined(__MRC__))) || defined(__MWERKS__) @@ -2789,9 +2742,9 @@ const char *dir; /*ARGSUSED*/ void -paniclog(type, reason) -const char *type; /* panic, impossible, trickery */ -const char *reason; /* explanation */ +paniclog( + const char *type, /**< panic, impossible, trickery */ + const char *reason) /**< explanation */ { #ifdef PANICLOG FILE *lfile; diff --git a/src/fountain.c b/src/fountain.c index f7abe6536..ac102b50f 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -5,17 +5,16 @@ #include "hack.h" -static void dowatersnakes(); -static void dowaterdemon(); -static void dowaternymph(); +static void dowatersnakes(void); +static void dowaterdemon(void); +static void dowaternymph(void); static void gush(int, int, genericptr_t); -static void dofindgem(); +static void dofindgem(void); /* used when trying to dip in or drink from fountain or sink or pool while levitating above it, or when trying to move downwards in that state */ void -floating_above(what) -const char *what; +floating_above(const char *what) { const char *umsg = "are floating high above the %s."; @@ -30,7 +29,7 @@ const char *what; /* Fountain of snakes! */ static void -dowatersnakes() +dowatersnakes(void) { register int num = rn1(5, 2); struct monst *mtmp; @@ -51,7 +50,7 @@ dowatersnakes() /* Water demon */ static void -dowaterdemon() +dowaterdemon(void) { struct monst *mtmp; @@ -78,7 +77,7 @@ dowaterdemon() /* Water Nymph */ static void -dowaternymph() +dowaternymph(void) { register struct monst *mtmp; @@ -101,8 +100,7 @@ dowaternymph() /* Gushing forth along LOS from (u.ux, u.uy) */ void -dogushforth(drinking) -int drinking; +dogushforth(int drinking) { int madepool = 0; @@ -116,9 +114,7 @@ int drinking; } static void -gush(x, y, poolcnt) -int x, y; -genericptr_t poolcnt; +gush(int x, int y, genericptr_t poolcnt) { register struct monst *mtmp; register struct trap *ttmp; @@ -150,7 +146,7 @@ genericptr_t poolcnt; /* Find a gem in the sparkling waters. */ static void -dofindgem() +dofindgem(void) { if (!Blind) You("spot a gem in the sparkling waters!"); else You_feel("a gem here!"); @@ -162,9 +158,7 @@ dofindgem() } void -dryup(x, y, isyou) -xchar x, y; -boolean isyou; +dryup(xchar x, xchar y, boolean isyou) { if (IS_FOUNTAIN(levl[x][y].typ) && (!rn2(3) || FOUNTAIN_IS_WARNED(x, y))) { @@ -217,7 +211,7 @@ boolean isyou; } void -drinkfountain() +drinkfountain(void) { /* What happens when you drink from a fountain? */ register boolean mgkftn = (levl[u.ux][u.uy].blessedftn == 1); @@ -364,8 +358,7 @@ drinkfountain() } void -dipfountain(obj) -register struct obj *obj; +dipfountain(register struct obj *obj) { int er = ER_NOTHING; @@ -526,8 +519,7 @@ register struct obj *obj; #ifdef SINKS void -breaksink(x, y) -int x, y; +breaksink(int x, int y) { if(cansee(x, y) || (x == u.ux && y == u.uy)) pline_The("pipes break! Water spurts out!"); @@ -542,7 +534,7 @@ int x, y; } void -drinksink() +drinksink(void) { struct obj *otmp; struct monst *mtmp; diff --git a/src/hack.c b/src/hack.c index b0d2a6a38..3bae014a9 100644 --- a/src/hack.c +++ b/src/hack.c @@ -7,17 +7,17 @@ /* #define DEBUG */ /* uncomment for debugging */ -static void maybe_wail(); -static int moverock(); -static int still_chewing(XCHAR_P, XCHAR_P); +static void maybe_wail(void); +static int moverock(void); +static int still_chewing(xchar, xchar); #ifdef SINKS -static void dosinkfall(); +static void dosinkfall(void); #endif static boolean findtravelpath(boolean (*)(int, int)); static boolean trapmove(int, int, struct trap *); static struct monst *monstinroom(struct permonst *, int); static boolean doorless_door(int, int); -static void move_update(BOOLEAN_P); +static void move_update(boolean); static void check_buried_zombies(xchar, xchar); static boolean domove_swap_with_pet(struct monst *, xchar, xchar); static void struggle_sub(const char *); @@ -35,9 +35,9 @@ static anything tmp_anything; #ifdef DUNGEON_GROWTH void -rndmappos(x, y) /* guaranteed to return a valid coord */ -xchar *x; -xchar *y; +rndmappos(xchar *x, xchar *y) /* guaranteed to return a valid coord */ + + { if (*x >= COLNO) *x = COLNO; else if (*x == -1) *x = rn2(COLNO-1)+1; @@ -61,9 +61,7 @@ static const struct herb_info { }; long -count_herbs_at(x, y, watery) -xchar x, y; -boolean watery; +count_herbs_at(xchar x, xchar y, boolean watery) { register int dd; register long count = 0; @@ -82,9 +80,7 @@ boolean watery; /* returns TRUE if a herb can grow at (x,y) */ boolean -herb_can_grow_at(x, y, watery) -xchar x, y; -boolean watery; +herb_can_grow_at(xchar x, xchar y, boolean watery) { register struct rm *lev = &levl[x][y]; if (inside_shop(x, y)) return FALSE; @@ -101,9 +97,7 @@ boolean watery; /* grow herbs in water. return true if did something. */ boolean -grow_water_herbs(herb, x, y) -int herb; -xchar x, y; +grow_water_herbs(int herb, xchar x, xchar y) { struct obj *otmp; @@ -123,10 +117,7 @@ xchar x, y; /* grow herb on ground at (x,y), or maybe spread out. return true if did something. */ boolean -grow_herbs(herb, x, y, showmsg, update) -int herb; -xchar x, y; -boolean showmsg, update; +grow_herbs(int herb, xchar x, xchar y, boolean showmsg, boolean update) { struct obj *otmp; @@ -183,11 +174,11 @@ boolean showmsg, update; /* moves topmost object in water at (x,y) to dir. return true if did something. */ boolean -water_current(x, y, dir, waterforce, showmsg, update) -xchar x, y; -int dir; -unsigned waterforce; /* strength of the water current */ -boolean showmsg, update; +water_current(xchar x, xchar y, int dir, unsigned int waterforce, boolean showmsg, boolean update) + + + /* strength of the water current */ + { struct obj *otmp; coord pos; @@ -228,9 +219,7 @@ boolean showmsg, update; /* a tree at (x,y) spontaneously drops a ripe fruit */ boolean -drop_ripe_treefruit(x, y, showmsg, update) -xchar x, y; -boolean showmsg, update; +drop_ripe_treefruit(xchar x, xchar y, boolean showmsg, boolean update) { register struct rm *lev; @@ -283,8 +272,7 @@ boolean showmsg, update; * Creates a kind of forest, with (hopefully) most places available. */ boolean -seed_tree(x, y) -xchar x, y; +seed_tree(xchar x, xchar y) { coord pos, pos2; struct rm *lev; @@ -327,9 +315,9 @@ xchar x, y; } void -dgn_growths(showmsg, update) -boolean showmsg; /* show messages */ -boolean update; /* do newsym() */ +dgn_growths( + boolean showmsg, /**< show messages */ + boolean update) /**< do newsym() */ { int herbnum = rn2(SIZE(herb_info)); (void) seed_tree(-1, -1); @@ -345,8 +333,7 @@ boolean update; /* do newsym() */ /* catch up with growths when returning to a previously visited level */ void -catchup_dgn_growths(mvs) -int mvs; +catchup_dgn_growths(int mvs) { if (mvs < 0) mvs = 0; else if (mvs > LARGEST_INT) mvs = LARGEST_INT; @@ -356,8 +343,7 @@ int mvs; #endif /* DUNGEON_GROWTH */ anything * -uint_to_any(ui) -unsigned ui; +uint_to_any(unsigned int ui) { tmp_anything = zeroany; tmp_anything.a_uint = ui; @@ -365,8 +351,7 @@ unsigned ui; } anything * -long_to_any(lng) -long lng; +long_to_any(long int lng) { tmp_anything = zeroany; tmp_anything.a_long = lng; @@ -374,8 +359,7 @@ long lng; } anything * -monst_to_any(mtmp) -struct monst *mtmp; +monst_to_any(struct monst *mtmp) { tmp_anything = zeroany; tmp_anything.a_monst = mtmp; @@ -383,8 +367,7 @@ struct monst *mtmp; } anything * -obj_to_any(obj) -struct obj *obj; +obj_to_any(struct obj *obj) { tmp_anything = zeroany; tmp_anything.a_obj = obj; @@ -392,9 +375,7 @@ struct obj *obj; } boolean -revive_nasty(x, y, msg) -int x, y; -const char *msg; +revive_nasty(int x, int y, const char *msg) { register struct obj *otmp, *otmp2; struct monst *mtmp; @@ -431,7 +412,7 @@ const char *msg; } static int -moverock() +moverock(void) { register xchar rx, ry, sx, sy; register struct obj *otmp; @@ -727,8 +708,7 @@ moverock() * Returns TRUE if still eating, FALSE when done. */ static int -still_chewing(x, y) -xchar x, y; +still_chewing(xchar x, xchar y) { struct rm *lev = &levl[x][y]; struct obj *boulder = sobj_at(BOULDER, x, y); @@ -874,9 +854,7 @@ xchar x, y; } void -movobj(obj, ox, oy) -register struct obj *obj; -register xchar ox, oy; +movobj(register struct obj *obj, register xchar ox, register xchar oy) { /* optimize by leaving on the fobj chain? */ remove_object(obj); @@ -889,7 +867,7 @@ register xchar ox, oy; static NEARDATA const char fell_on_sink[] = "fell onto a sink"; static void -dosinkfall() +dosinkfall(void) { register struct obj *obj; int dmg; @@ -975,8 +953,7 @@ dosinkfall() /* intended to be called only on ROCKs */ boolean -may_dig(x, y) -register xchar x, y; +may_dig(register xchar x, register xchar y) { struct rm *lev = &levl[x][y]; @@ -987,17 +964,14 @@ register xchar x, y; } boolean -may_passwall(x, y) -register xchar x, y; +may_passwall(register xchar x, register xchar y) { return (boolean)(!((IS_STWALL(levl[x][y].typ) || IS_TREES(levl[x][y].typ)) && (levl[x][y].wall_info & W_NONPASSWALL))); } boolean -bad_rock(mdat, x, y) -struct permonst *mdat; -register xchar x, y; +bad_rock(struct permonst *mdat, register xchar x, register xchar y) { return((boolean) ((Sokoban && sobj_at(BOULDER, x, y)) || (IS_ROCK(levl[x][y].typ) @@ -1010,8 +984,7 @@ register xchar x, y; the reason why: 1: can't fit, 2: possessions won't fit, 3: sokoban returns 0 if we can squeeze through */ int -cant_squeeze_thru(mon) -struct monst *mon; +cant_squeeze_thru(struct monst *mon) { int amt; struct permonst *ptr = mon->data; @@ -1038,16 +1011,13 @@ struct monst *mon; } boolean -invocation_pos(x, y) -xchar x, y; +invocation_pos(xchar x, xchar y) { return((boolean)(Invocation_lev(&u.uz) && x == inv_pos.x && y == inv_pos.y)); } static void -autoexplore_msg(text, mode) -const char *text; -int mode UNUSED; +autoexplore_msg(const char *text, int mode UNUSED) { if (iflags.autoexplore) { char tmp[BUFSZ]; @@ -1060,9 +1030,7 @@ int mode UNUSED; * mode is one of DO_MOVE, TEST_MOVE, TEST_TRAV or TEST_TRAP */ boolean -test_move(ux, uy, dx, dy, mode) -int ux, uy, dx, dy; -int mode; +test_move(int ux, int uy, int dx, int dy, int mode) { int x = ux+dx; int y = uy+dy; @@ -1313,8 +1281,7 @@ int mode; avoid treating traps and doors known to be locked as valid explore targets (although they are still valid travel intermediates). */ static boolean -unexplored(x, y) -int x, y; +unexplored(int x, int y) { int i, j, k, l; struct trap *ttmp = t_at(x, y); @@ -1361,9 +1328,7 @@ int x, y; /** Returns a distance modified by a constant factor. * The lower the value the better.*/ int -autotravel_weighting(x, y, distance) -int x, y; -unsigned distance; +autotravel_weighting(int x, int y, unsigned int distance) { int glyph = levl[x][y].glyph; @@ -1406,8 +1371,7 @@ unsigned distance; * Returns TRUE if a path was found. */ static boolean -findtravelpath(guess) -boolean (*guess)(int, int); +findtravelpath(boolean (*guess) (int, int)) { /* if travel to adjacent, reachable location, use normal movement rules */ if (!guess && iflags.travel1 && distmin(u.ux, u.uy, u.tx, u.ty) == 1) { @@ -1577,8 +1541,7 @@ boolean (*guess)(int, int); } boolean -is_valid_travelpt(x,y) -int x,y; +is_valid_travelpt(int x, int y) { int tx = u.tx; int ty = u.ty; @@ -1601,8 +1564,7 @@ int x,y; /* A function version of couldsee, so we can take a pointer to it. */ static boolean -couldsee_func(x, y) -int x, y; +couldsee_func(int x, int y) { return couldsee(x, y); } @@ -1615,8 +1577,7 @@ int x, y; * It should only leak information about "obvious" coordinates, e.g. * unexplored rooms or big areas not reachable by the player. */ static boolean -interesting_to_explore(x, y) -int x, y; +interesting_to_explore(int x, int y) { if (!goodpos(x, y, &youmonst, 0)) return FALSE; @@ -1640,9 +1601,9 @@ int x, y; return true iff moving should continue to intended destination (all failures and most successful escapes leave hero at original spot) */ static boolean -trapmove(x, y, desttrap) -int x, y; /* targetted destination, */ -struct trap *desttrap; /* nonnull if another trap at */ +trapmove( + int x, int y, /**< targetted destination, */ + struct trap *desttrap) /**< nonnull if another trap at */ { boolean anchored = FALSE; const char *predicament, *culprit; @@ -1789,7 +1750,7 @@ struct trap *desttrap; /* nonnull if another trap at */ } boolean -u_rooted() +u_rooted(void) { if (!youmonst.data->mmove) { You("are rooted %s.", @@ -1948,7 +1909,7 @@ domove_swap_with_pet(struct monst *mtmp, xchar x, xchar y) } void -domove() +domove(void) { register struct monst *mtmp; register struct rm *tmpr; @@ -2702,7 +2663,7 @@ runmode_delay_output(void) /* combat increases metabolism */ boolean -overexertion() +overexertion(void) { /* this used to be part of domove() when moving to a monster's position, but is now called by attack() so that it doesn't @@ -2723,8 +2684,7 @@ overexertion() } void -struggle_sub(predicament) -const char *predicament; +struggle_sub(const char *predicament) { if (flags.verbose) { if (u.usteed) @@ -2736,7 +2696,7 @@ const char *predicament; } void -invocation_message() +invocation_message(void) { /* mark the square as stepped on, whether it's the VS or not; don't do so when blind, though, because it would misleadingly @@ -2791,7 +2751,7 @@ invocation_message() might be going into solid rock, inhibiting levitation or flight, or coming back out of such, reinstating levitation/flying */ void -switch_terrain() +switch_terrain(void) { struct rm *lev = &levl[u.ux][u.uy]; boolean blocklev = (IS_ROCK(lev->typ) || @@ -2838,8 +2798,7 @@ switch_terrain() leaving a pool of water/lava, and by moveloop to check for staying on one; returns true to skip rest of spoteffects */ boolean -pooleffects(newspot) -boolean newspot; /* true if called by spoteffects */ +pooleffects(boolean newspot) /**< TRUE if called by spoteffects */ { /* check for leaving water */ if (u.uinwater) { @@ -2947,8 +2906,7 @@ boolean newspot; /* true if called by spoteffects */ } void -spoteffects(pick) -boolean pick; +spoteffects(boolean pick) { static int inspoteffects = 0; static coord spotloc; @@ -3103,9 +3061,7 @@ boolean pick; /* returns first matching monster */ static struct monst * -monstinroom(mdat, roomno) -struct permonst *mdat; -int roomno; +monstinroom(struct permonst *mdat, int roomno) { register struct monst *mtmp; @@ -3122,9 +3078,7 @@ int roomno; } char * -in_rooms(x, y, typewanted) -register xchar x, y; -register int typewanted; +in_rooms(register xchar x, register xchar y, register int typewanted) { static char buf[5]; char rno, *ptr = &buf[4]; @@ -3190,8 +3144,7 @@ register int typewanted; /* is (x,y) in a town? */ boolean -in_town(x, y) -register int x, y; +in_town(register int x, register int y) { s_level *slev = Is_special(&u.uz); register struct mkroom *sroom; @@ -3230,8 +3183,7 @@ register int x, y; } static void -move_update(newlev) -register boolean newlev; +move_update(register boolean newlev) { char *ptr1, *ptr2, *ptr3, *ptr4; @@ -3272,7 +3224,7 @@ register boolean newlev; } static boolean -u_in_mine_town() +u_in_mine_town(void) { if (!In_mines(&u.uz)) { return FALSE; @@ -3282,8 +3234,7 @@ u_in_mine_town() /* possibly deliver a one-time room entry message */ void -check_special_room(newlev) -register boolean newlev; +check_special_room(register boolean newlev) { register struct monst *mtmp; char *ptr; @@ -3449,7 +3400,7 @@ register boolean newlev; -1 = do normal pickup -2 = loot the monster */ int -pickup_checks() +pickup_checks(void) { /* uswallow case added by GAN 01/29/87 */ if (u.uswallow) { @@ -3529,7 +3480,7 @@ pickup_checks() /* the ',' command */ int -dopickup() +dopickup(void) { int count, tmpcount, ret; @@ -3551,7 +3502,7 @@ dopickup() /* turn around a corner if that is the only way we can proceed */ /* do not turn left or right twice */ void -lookaround() +lookaround(void) { int x, y; int i, x0 = 0, y0 = 0, m0 = 1, i0 = 9; @@ -3740,8 +3691,7 @@ lookaround() /* check for a doorway which lacks its door (NODOOR or BROKEN) */ static boolean -doorless_door(x, y) -int x, y; +doorless_door(int x, int y) { struct rm *lev_p = &levl[x][y]; @@ -3776,8 +3726,7 @@ check_interrupt(struct monst *mtmp) /* used by drown() to check whether hero can crawl from water to */ boolean -crawl_destination(x, y) -int x, y; +crawl_destination(int x, int y) { /* is location ok in general? */ if (!goodpos(x, y, &youmonst, 0)) @@ -3803,7 +3752,7 @@ int x, y; /* something like lookaround, but we are not running */ /* react only to monsters that might hit us */ int -monster_nearby() +monster_nearby(void) { int x, y; struct monst *mtmp; @@ -3826,9 +3775,7 @@ monster_nearby() } void -nomul(nval, txt) -register int nval; -const char *txt; +nomul(register int nval, const char *txt) { if (multi < nval) return; /* This is a bug fix by ab@unido */ u.uinvulnerable = FALSE; /* Kludge to avoid ctrl-C bug -dlc */ @@ -3843,8 +3790,7 @@ const char *txt; /* called when a non-movement, multi-turn action has completed */ void -unmul(msg_override) -const char *msg_override; +unmul(const char *msg_override) { multi = 0; /* caller will usually have done this already */ (void) memset(multi_txt, 0, BUFSZ); @@ -3879,7 +3825,7 @@ const char *msg_override; } static void -maybe_wail() +maybe_wail(void) { static short powers[] = { TELEPORT, SEE_INVIS, POISON_RES, COLD_RES, SHOCK_RES, FIRE_RES, SLEEP_RES, DISINT_RES, @@ -3914,9 +3860,9 @@ maybe_wail() * Wizard mode. */ void -showdmg(n, you) -int n; /**< amount of damage inflicted */ -boolean you; /**< true, if you are hit */ +showdmg( + int n, /**< amount of damage inflicted */ + boolean you) /**< TRUE, if you are hit */ { #ifdef WIZARD if (iflags.showdmg && wizard && n > 0) { @@ -3929,7 +3875,7 @@ boolean you; /**< true, if you are hit */ } void -check_uhpmax() +check_uhpmax(void) { if (!heaven_or_hell_mode) return; @@ -3944,9 +3890,7 @@ check_uhpmax() } void -set_uhpmax(new_hpmax, poly) -int new_hpmax; -boolean poly; +set_uhpmax(int new_hpmax, boolean poly) { if (!heaven_or_hell_mode || new_hpmax < 1) { if (!poly) u.uhpmax = new_hpmax; @@ -3959,20 +3903,13 @@ boolean poly; } void -losehp(n, knam, k_format) -int n; -const char *knam; -boolean k_format; +losehp(int n, const char *knam, boolean k_format) { losehp_how(n, knam, k_format, DIED); } void -losehp_how(n, knam, k_format, how) -int n; -const char *knam; -int how; -boolean k_format; +losehp_how(int n, const char *knam, boolean k_format, int how) { showdmg(n, TRUE); @@ -4007,7 +3944,7 @@ boolean k_format; } int -weight_cap() +weight_cap(void) { long carrcap, save_ELev = ELevitation, save_BLev = BLevitation; @@ -4062,7 +3999,7 @@ static int wc; /* current weight_cap(); valid after call to inv_weight() */ /* returns how far beyond the normal capacity the player is currently. */ /* inv_weight() is negative if the player is below normal capacity. */ int -inv_weight() +inv_weight(void) { register struct obj *otmp = invent; register int wt = 0; @@ -4096,8 +4033,7 @@ inv_weight() * over the normal capacity the player is loaded. Max is 5. */ int -calc_capacity(xtra_wt) -int xtra_wt; +calc_capacity(int xtra_wt) { int cap, wt = inv_weight() + xtra_wt; @@ -4108,13 +4044,13 @@ int xtra_wt; } int -near_capacity() +near_capacity(void) { return calc_capacity(0); } int -max_capacity() +max_capacity(void) { int wt = inv_weight(); @@ -4122,8 +4058,7 @@ max_capacity() } boolean -check_capacity(str) -const char *str; +check_capacity(const char *str) { if (near_capacity() >= EXT_ENCUMBER) { if (str) @@ -4136,8 +4071,7 @@ const char *str; } int -inv_cnt(incl_gold) -boolean incl_gold; +inv_cnt(boolean incl_gold) { register struct obj *otmp = invent; register int ct = 0; @@ -4156,8 +4090,7 @@ boolean incl_gold; /* now that u.gold/m.gold is gone.*/ /* Counting money in a container might be possible too. */ long -money_cnt(otmp) -struct obj *otmp; +money_cnt(struct obj *otmp) { while(otmp) { if (otmp->oclass == COIN_CLASS) { diff --git a/src/hacklib.c b/src/hacklib.c index 2fec10eaa..99def4130 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -13,44 +13,39 @@ # define Static static #endif -static boolean pmatch_internal(const char *, const char *, BOOLEAN_P, const char *); +static boolean pmatch_internal(const char *, const char *, boolean, const char *); /* is 'c' a digit? */ boolean -digit(c) -char c; +digit(char c) { return((boolean)('0' <= c && c <= '9')); } /* is 'c' a letter? note: '@' classed as letter */ boolean -letter(c) -char c; +letter(char c) { return((boolean)(('@' <= c && c <= 'Z') || ('a' <= c && c <= 'z'))); } /* force 'c' into uppercase */ char -highc(c) -char c; +highc(char c) { return((char)(('a' <= c && c <= 'z') ? (c & ~040) : c)); } /* force 'c' into lowercase */ char -lowc(c) -char c; +lowc(char c) { return((char)(('A' <= c && c <= 'Z') ? (c | 040) : c)); } /* convert a string into all lowercase */ char * -lcase(s) -char *s; +lcase(char *s) { register char *p; @@ -61,8 +56,7 @@ char *s; /* convert a string into all uppercase */ char * -ucase(s) -char *s; +ucase(char *s) { register char *p; @@ -74,8 +68,7 @@ char *s; /* convert first character of a string to uppercase */ char * -upstart(s) -char *s; +upstart(char *s) { if (s) *s = highc(*s); return s; @@ -83,8 +76,7 @@ char *s; /* remove excess whitespace from a string buffer (in place) */ char * -mungspaces(bp) -char *bp; +mungspaces(char *bp) { register char c, *p, *p2; boolean was_space = TRUE; @@ -110,8 +102,7 @@ char *bp; /* skip leading whitespace; remove trailing whitespace, in place */ char * -trimspaces(txt) -char *txt; +trimspaces(char *txt) { char *end; @@ -127,8 +118,7 @@ char *txt; /* remove \n from end of line; remove \r too if one is there */ char * -strip_newline(str) -char *str; +strip_newline(char *str) { char *p = rindex(str, '\n'); @@ -142,8 +132,7 @@ char *str; /* return the end of a string (pointing at '\0') */ char * -eos(s) -register char *s; +eos(register char *s) { while (*s) s++; /* s += strlen(s); */ return s; @@ -151,8 +140,7 @@ register char *s; /* determine whether 'str' ends in 'chkstr' */ boolean -str_end_is(str, chkstr) -const char *str, *chkstr; +str_end_is(const char *str, const char *chkstr) { int clen = (int) strlen(chkstr); @@ -163,8 +151,7 @@ const char *str, *chkstr; /* return the max line length from buffer comprising of newline-separated strings */ int -str_lines_maxlen(str) -const char *str; +str_lines_maxlen(const char *str) { const char *s1, *s2; int len, max_len = 0; @@ -188,9 +175,7 @@ const char *str; /* append a character to a string (in place): strcat(s, {c,'\0'}); */ char * -strkitten(s, c) -char *s; -char c; +strkitten(char *s, char c) { char *p = eos(s); @@ -201,10 +186,7 @@ char c; /* truncating string copy */ void -copynchars(dst, src, n) -char *dst; -const char *src; -int n; +copynchars(char *dst, const char *src, int n) { /* copies at most n characters, stopping sooner if terminator reached; treats newline as input terminator; unlike strncpy, always supplies @@ -218,8 +200,7 @@ int n; /* convert char nc into oc's case; mostly used by strcasecpy */ char -chrcasecpy(oc, nc) -int oc, nc; +chrcasecpy(int oc, int nc) { #if 0 /* this will be necessary if we switch to */ oc = (int) (unsigned char) oc; @@ -241,9 +222,7 @@ int oc, nc; for case-insensitive editions of makeplural() and makesingular(); src might be shorter, same length, or longer than dst */ char * -strcasecpy(dst, src) -char *dst; -const char *src; +strcasecpy(char *dst, const char *src) { char *result = dst; int ic, oc, dst_exhausted = 0; @@ -265,8 +244,7 @@ const char *src; /* replace (in place) characters below space in the string */ void -sanitizestr(s) -char *s; +sanitizestr(char *s) { if (!s) return; while (*s) { @@ -278,8 +256,7 @@ char *s; /* return a name converted to possessive */ char * -s_suffix(s) -const char *s; +s_suffix(const char *s) { Static char buf[BUFSZ]; @@ -297,8 +274,7 @@ const char *s; /* construct a gerund (a verb formed by appending "ing" to a noun) */ char * -ing_suffix(s) -const char *s; +ing_suffix(const char *s) { static const char vowel[] = "aeiouwy"; static char buf[BUFSZ]; @@ -332,9 +308,7 @@ const char *s; } /* trivial text encryption routine (see makedefs) */ char * -xcrypt(str, buf) -const char *str; -char *buf; +xcrypt(const char *str, char *buf) { register const char *p; register char *q; @@ -351,8 +325,7 @@ char *buf; /* is a string entirely whitespace? */ boolean -onlyspace(s) -const char *s; +onlyspace(const char *s) { for (; *s; s++) if (*s != ' ' && *s != '\t') return FALSE; @@ -361,8 +334,7 @@ const char *s; /* expand tabs into proper number of spaces */ char * -tabexpand(sbuf) -char *sbuf; +tabexpand(char *sbuf) { char buf[BUFSZ]; register char *bp, *s = sbuf; @@ -385,8 +357,7 @@ char *sbuf; #define VISCTRL_NBUF 5 /* make a displayable string from a character */ char * -visctrl(c) -char c; +visctrl(char c) { Static char visctrl_bufs[VISCTRL_NBUF][5]; static int nbuf = 0; @@ -416,9 +387,7 @@ char c; /* caller is responsible for ensuring that bp is a valid pointer to a BUFSZ buffer */ char * -stripchars(bp, stuff_to_strip, orig) -char *bp; -const char *stuff_to_strip, *orig; +stripchars(char *bp, const char *stuff_to_strip, const char *orig) { int i = 0; char *s = bp; @@ -439,8 +408,7 @@ const char *stuff_to_strip, *orig; /* remove digits from string */ char * -stripdigits(s) -char *s; +stripdigits(char *s) { char *s1, *s2; @@ -455,9 +423,7 @@ char *s; /* substitute a word or phrase in a string (in place) */ /* caller is responsible for ensuring that bp points to big enough buffer */ char * -strsubst(bp, orig, replacement) -char *bp; -const char *orig, *replacement; +strsubst(char *bp, const char *orig, const char *replacement) { char *found, buf[BUFSZ]; @@ -477,11 +443,11 @@ const char *orig, *replacement; if N is 0, substitute all occurrences; returns the number of subsitutions; maximum output length is BUFSZ (BUFSZ-1 chars + terminating '\0') */ int -strNsubst(inoutbuf, orig, replacement, n) -char *inoutbuf; /* current string, and result buffer */ -const char *orig, /* old substring; if "" then insert in front of Nth char */ - *replacement; /* new substring; if "" then delete old substring */ -int n; /* which occurrence to replace; 0 => all */ +strNsubst( + char *inoutbuf, /**< current string, and result buffer */ + const char *orig, /**< old substring; if "", insert in front of Nth char */ + const char *replacement, /**< new substring; if "", delete old substring */ + int n) /**< which occurrence to replace; 0 => all */ { char *bp, *op, workbuf[BUFSZ]; const char *rp; @@ -521,8 +487,7 @@ int n; /* which occurrence to replace; 0 => all */ /* return the ordinal suffix of a number */ const char * -ordin(n) -int n; /* note: should be non-negative */ +ordin(int n) /**< note: should be non-negative */ { register int dd = n % 10; @@ -532,8 +497,7 @@ int n; /* note: should be non-negative */ /* make a signed digit string from a number */ char * -sitoa(n) -int n; +sitoa(int n) { Static char buf[13]; @@ -543,17 +507,14 @@ int n; /* return the sign of a number: -1, 0, or 1 */ int -sgn(n) -int n; +sgn(int n) { return (n < 0) ? -1 : (n != 0); } /* calculate x/y, rounding as appropriate */ int -rounddiv(x, y) -long x; -int y; +rounddiv(long int x, int y) { int r, m; int divsgn = 1; @@ -575,8 +536,8 @@ int y; /* distance between two points, in moves */ int -distmin(x0, y0, x1, y1) /* distance between two points, in moves */ -int x0, y0, x1, y1; +distmin(int x0, int y0, int x1, int y1) /* distance between two points, in moves */ + { register int dx = x0 - x1, dy = y0 - y1; if (dx < 0) dx = -dx; @@ -589,8 +550,7 @@ int x0, y0, x1, y1; /* square of euclidean distance between pair of pts */ int -dist2(x0, y0, x1, y1) -int x0, y0, x1, y1; +dist2(int x0, int y0, int x1, int y1) { register int dx = x0 - x1, dy = y0 - y1; return dx * dx + dy * dy; @@ -598,8 +558,7 @@ int x0, y0, x1, y1; /* integer square root function without using floating point */ int -isqrt(val) -int val; +isqrt(int val) { int rt = 0; int odd = 1; @@ -624,8 +583,7 @@ int val; * @returns rounded down log2 value, or -1 if value <= 0 */ int -ilog2(value) -int value; +ilog2(int value) { if (value <= 0) { return -1; @@ -641,8 +599,7 @@ int value; /* are two points lined up (on a straight line)? */ boolean -online2(x0, y0, x1, y1) -int x0, y0, x1, y1; +online2(int x0, int y0, int x1, int y1) { int dx = x0 - x1, dy = y0 - y1; /* If either delta is zero then they're on an orthogonal line, @@ -654,10 +611,11 @@ int x0, y0, x1, y1; /* guts of pmatch(), pmatchi(), and pmatchz(); match a string against a pattern */ static boolean -pmatch_internal(patrn, strng, ci, sk) -const char *patrn, *strng; -boolean ci; /* True => case-insensitive, False => case-sensitive */ -const char *sk; /* set of characters to skip */ +pmatch_internal(const char *patrn, + const char *strng, + boolean ci, /**< TRUE => case-insensitive, + FALSE => case-sensitive */ + const char *sk) /**< set of characters to skip */ { char s, p; /* @@ -694,24 +652,21 @@ const char *sk; /* set of characters to skip */ /* case-sensitive wildcard match */ boolean -pmatch(patrn, strng) -const char *patrn, *strng; +pmatch(const char *patrn, const char *strng) { return pmatch_internal(patrn, strng, FALSE, (const char *) 0); } /* case-insensitive wildcard match */ boolean -pmatchi(patrn, strng) -const char *patrn, *strng; +pmatchi(const char *patrn, const char *strng) { return pmatch_internal(patrn, strng, TRUE, (const char *) 0); } /* case-insensitive wildcard fuzzymatch */ boolean -pmatchz(patrn, strng) -const char *patrn, *strng; +pmatchz(const char *patrn, const char *strng) { /* ignore spaces, tabs (just in case), dashes, and underscores */ static const char fuzzychars[] = " \t-_"; @@ -721,10 +676,12 @@ const char *patrn, *strng; #ifndef STRNCMPI /* case insensitive counted string comparison */ +/*{ aka strncasecmp }*/ int -strncmpi(s1, s2, n) /*{ aka strncasecmp }*/ -register const char *s1, *s2; -register int n; /*(should probably be size_t, which is usually unsigned)*/ +strncmpi( + const char *s1, + const char *s2, + int n) /*(should probably be size_t, which is unsigned)*/ { register char t1, t2; @@ -743,9 +700,9 @@ register int n; /*(should probably be size_t, which is usually unsigned)*/ /* case insensitive substring search */ char * -strstri(str, sub) /* case insensitive substring search */ -const char *str; -const char *sub; +strstri(const char *str, const char *sub) /* case insensitive substring search */ + + { register const char *s1, *s2; register int i, k; @@ -783,10 +740,7 @@ const char *sub; /* compare two strings for equality, ignoring the presence of specified characters (typically whitespace) and possibly ignoring case */ boolean -fuzzymatch(s1, s2, ignore_chars, caseblind) -const char *s1, *s2; -const char *ignore_chars; -boolean caseblind; +fuzzymatch(const char *s1, const char *s2, const char *ignore_chars, boolean caseblind) { register char c1, c2; @@ -818,10 +772,10 @@ boolean caseblind; #if defined(AMIGA) && !defined(AZTEC_C) && !defined(__SASC_60) && !defined(_DCC) && !defined(__GNUC__) extern struct tm *localtime(time_t *); #endif -static struct tm *getlt(); +static struct tm *getlt(void); static int -get_int_from_dev_random() +get_int_from_dev_random(void) { unsigned int random_seed=0; #ifdef DEV_RANDOM @@ -856,7 +810,7 @@ init_random(unsigned int seed) } void -reseed_random() +reseed_random(void) { unsigned int random_seed=0; random_seed = (unsigned int)(time((time_t *)0)) + get_int_from_dev_random(); @@ -864,7 +818,7 @@ reseed_random() } time_t -getnow() +getnow(void) { time_t datetime = 0; @@ -873,7 +827,7 @@ getnow() } static struct tm * -getlt() +getlt(void) { time_t date = current_epoch(); @@ -885,29 +839,28 @@ getlt() } int -getyear() +getyear(void) { return(1900 + getlt()->tm_year); } /** Returns current month (1-12, 1 = January) */ int -getmonth() +getmonth(void) { return(1 + getlt()->tm_mon); } /** Returns current day of month (1-31) */ int -getmday() +getmday(void) { return(getlt()->tm_mday); } long -yyyymmdd(date) -time_t date; +yyyymmdd(time_t date) { long datenum; struct tm *lt; @@ -933,8 +886,7 @@ time_t date; } long -hhmmss(date) -time_t date; +hhmmss(time_t date) { long timenum; struct tm *lt; @@ -950,8 +902,7 @@ time_t date; } char * -yyyymmddhhmmss(date) -time_t date; +yyyymmddhhmmss(time_t date) { long datenum; static char datestr[BUFSZ]; @@ -977,8 +928,7 @@ time_t date; } time_t -time_from_yyyymmddhhmmss(buf) -char *buf; +time_from_yyyymmddhhmmss(char *buf) { int k; time_t timeresult = (time_t) 0; @@ -1046,7 +996,7 @@ char *buf; * + 11/22 for rounding */ int -phase_of_the_moon() /* 0-7, with 0: new, 4: full */ +phase_of_the_moon(void) /* 0-7, with 0: new, 4: full */ { register struct tm *lt = getlt(); register int epact, diy, goldn; @@ -1061,7 +1011,7 @@ phase_of_the_moon() /* 0-7, with 0: new, 4: full */ } boolean -is_june() +is_june(void) { int month = getlt()->tm_mon; @@ -1069,7 +1019,7 @@ is_june() } boolean -friday_13th() +friday_13th(void) { register struct tm *lt = getlt(); @@ -1077,7 +1027,7 @@ friday_13th() } int -night() +night(void) { register int hour = getlt()->tm_hour; @@ -1085,19 +1035,19 @@ night() } int -midnight() +midnight(void) { return(getlt()->tm_hour == 0); } boolean -towelday() +towelday(void) { return (boolean)((getmday()==25) && (getmonth()==5)); } boolean -piday() +piday(void) { return (boolean)( ((getmonth()==3) && (getmday()==14)) || /* Pi Day */ @@ -1106,19 +1056,19 @@ piday() } boolean -aprilfoolsday() +aprilfoolsday(void) { return (boolean)((getmonth()==4) && (getmday()==1)); } boolean -pirateday() +pirateday(void) { return (boolean)((getmday()==19) && (getmonth()==9)); } boolean -discordian_holiday() +discordian_holiday(void) { return (boolean)((getmday()==23) && (getmonth()==5)); } @@ -1128,9 +1078,7 @@ static char buf_fmt_time[BUFSZ]; /** Returns a date formatted by strftime. * Returns current time if time is 0. */ char * -get_formatted_time(time, fmt) -time_t time; -const char *fmt; +get_formatted_time(time_t time, const char *fmt) { strftime(buf_fmt_time, BUFSZ, fmt, (time == 0) ? getlt() : localtime(&time)); @@ -1139,8 +1087,7 @@ const char *fmt; /** Returns a iso-8601 formatted date (e.g. 2010-03-19T08:46:23+0100). */ char * -iso8601(date) -time_t date; +iso8601(time_t date) { return get_formatted_time(date, "%Y-%m-%dT%H:%M:%S%z"); } @@ -1148,8 +1095,7 @@ time_t date; static char buf_fmt_duration[BUFSZ]; /** Returns a iso-8601 formatted duration (e.g. PThh:mm:ss). */ char * -iso8601_duration(seconds) -long seconds; +iso8601_duration(long int seconds) { /* currently no days, months and years, as the conversion * is non-trivial */ @@ -1171,8 +1117,7 @@ long seconds; /** Returns a human readable formatted duration (e.g. 2h:03m:ss). */ char * -format_duration(seconds) -long seconds; +format_duration(long int seconds) { long minutes = seconds / 60; long hours = minutes / 60; @@ -1194,7 +1139,7 @@ long seconds; /** Returns epoch time. */ time_t -current_epoch() +current_epoch(void) { if (iflags.debug_fuzzer) { /* 100_000 moves makes the game run from 2020-01-01 to 2020-04-25 */ @@ -1213,8 +1158,7 @@ current_epoch() /* strbuf_init() initializes strbuf state for use */ void -strbuf_init(strbuf) -strbuf_t *strbuf; +strbuf_init(strbuf_t *strbuf) { strbuf->str = NULL; strbuf->len = 0; @@ -1222,9 +1166,7 @@ strbuf_t *strbuf; /* strbuf_append() appends given str to strbuf->str */ void -strbuf_append(strbuf, str) -strbuf_t *strbuf; -const char *str; +strbuf_append(strbuf_t *strbuf, const char *str) { int len = (int) strlen(str) + 1; @@ -1235,9 +1177,7 @@ const char *str; /* strbuf_reserve() ensure strbuf->str has storage for len characters */ void -strbuf_reserve(strbuf, len) -strbuf_t *strbuf; -int len; +strbuf_reserve(strbuf_t *strbuf, int len) { if (strbuf->str == NULL) { strbuf->str = strbuf->buf; @@ -1258,8 +1198,7 @@ int len; /* strbuf_empty() frees allocated memory and set strbuf to initial state */ void -strbuf_empty(strbuf) -strbuf_t *strbuf; +strbuf_empty(strbuf_t *strbuf) { if (strbuf->str != NULL && strbuf->str != strbuf->buf) free((genericptr_t) strbuf->str); @@ -1268,8 +1207,7 @@ strbuf_t *strbuf; /* strbuf_nl_to_crlf() converts all occurences of \n to \r\n */ void -strbuf_nl_to_crlf(strbuf) -strbuf_t *strbuf; +strbuf_nl_to_crlf(strbuf_t *strbuf) { if (strbuf->str) { int len = (int) strlen(strbuf->str); diff --git a/src/invent.c b/src/invent.c index 70f392762..4ec59fb25 100644 --- a/src/invent.c +++ b/src/invent.c @@ -7,8 +7,8 @@ #define CONTAINED_SYM '>' /* designator for inside a container */ #define HANDS_SYM '-' -static void reorder_invent(); -static void noarmor(BOOLEAN_P); +static void reorder_invent(void); +static void noarmor(boolean); static void invdisp_nothing(const char *, const char *); static boolean worn_wield_only(struct obj *); static boolean only_here(struct obj *); @@ -18,9 +18,9 @@ static boolean putting_on(const char *); static int ckunpaid(struct obj *); static int ckvalidcat(struct obj *); static char display_pickinv(const char *, const char *, - const char *, BOOLEAN_P, long *, BOOLEAN_P, BOOLEAN_P); + const char *, boolean, long *, boolean, boolean); static boolean this_type_only(struct obj *); -static void dounpaid(); +static void dounpaid(void); static struct obj *find_unpaid(struct obj *, struct obj **); static void menu_identify(int); static boolean tool_in_use(struct obj *); @@ -41,8 +41,7 @@ static char venom_inv[] = { VENOM_CLASS, 0 }; /* (constant) */ #endif void -assigninvlet(otmp) -register struct obj *otmp; +assigninvlet(register struct obj *otmp) { boolean inuse[52]; register int i; @@ -93,7 +92,7 @@ register struct obj *otmp; /* sort the inventory; used by addinv() and doorganize() */ static void -reorder_invent() +reorder_invent(void) { struct obj *otmp, *prev, *next; boolean need_more_sorting; @@ -127,8 +126,7 @@ reorder_invent() one of them; used in pickup.c when all 52 inventory slots are in use, to figure out whether another object could still be picked up */ struct obj * -merge_choice(objlist, obj) -struct obj *objlist, *obj; +merge_choice(struct obj *objlist, struct obj *obj) { struct monst *shkp; int save_nocharge; @@ -161,8 +159,7 @@ struct obj *objlist, *obj; /* merge obj with otmp and delete obj if types agree */ int -merged(potmp, pobj) -struct obj **potmp, **pobj; +merged(struct obj **potmp, struct obj **pobj) { register struct obj *otmp = *potmp, *obj = *pobj; @@ -252,8 +249,7 @@ struct obj **potmp, **pobj; It may be valid to merge this code with with addinv_core2(). */ void -addinv_core1(obj) -struct obj *obj; +addinv_core1(struct obj *obj) { if (obj->oclass == COIN_CLASS) { flags.botl = 1; @@ -335,8 +331,7 @@ struct obj *obj; in-place. */ void -addinv_core2(obj) -struct obj *obj; +addinv_core2(struct obj *obj) { if (confers_luck(obj)) { /* new luckstone must be in inventory by this point @@ -350,8 +345,7 @@ struct obj *obj; Adjust hero attributes as necessary. */ struct obj * -addinv(obj) -struct obj *obj; +addinv(struct obj *obj) { struct obj *otmp, *prev; int saved_otyp = (int) obj->otyp; /* for panic */ @@ -437,8 +431,7 @@ struct obj *obj; * and after hero's intrinsics have been updated. */ void -carry_obj_effects(obj) -struct obj *obj; +carry_obj_effects(struct obj *obj) { /* Cursed figurines can spontaneously transform when carried. */ if (obj->otyp == FIGURINE) { @@ -458,9 +451,7 @@ struct obj *obj; * touch_artifact will print its own messages if they are warranted. */ struct obj * -hold_another_object(obj, drop_fmt, drop_arg, hold_msg) -struct obj *obj; -const char *drop_fmt, *drop_arg, *hold_msg; +hold_another_object(struct obj *obj, const char *drop_fmt, const char *drop_arg, const char *hold_msg) { char buf[BUFSZ]; @@ -540,8 +531,7 @@ const char *drop_fmt, *drop_arg, *hold_msg; /* useup() all of an item regardless of its quantity */ void -useupall(obj) -struct obj *obj; +useupall(struct obj *obj) { setnotworn(obj); freeinv(obj); @@ -549,8 +539,7 @@ struct obj *obj; } void -useup(obj) -register struct obj *obj; +useup(register struct obj *obj) { /* Note: This works correctly for containers because they */ /* (containers) don't merge. */ @@ -566,9 +555,9 @@ register struct obj *obj; /* use one charge from an item and possibly incur shop debt for it */ void -consume_obj_charge(obj, maybe_unpaid) -struct obj *obj; -boolean maybe_unpaid; /* false if caller handles shop billing */ +consume_obj_charge( + struct obj *obj, + boolean maybe_unpaid) /**< false if caller handles shop billing */ { if (maybe_unpaid) check_unpaid(obj); obj->spe -= 1; @@ -583,8 +572,7 @@ boolean maybe_unpaid; /* false if caller handles shop billing */ Should think of a better name... */ void -freeinv_core(obj) -struct obj *obj; +freeinv_core(struct obj *obj) { if (obj->oclass == COIN_CLASS) { flags.botl = 1; @@ -622,8 +610,7 @@ struct obj *obj; /* remove an object from the hero's inventory */ void -freeinv(obj) -register struct obj *obj; +freeinv(register struct obj *obj) { extract_nobj(obj, &invent); freeinv_core(obj); @@ -631,8 +618,7 @@ register struct obj *obj; } void -delallobj(x, y) -int x, y; +delallobj(int x, int y) { struct obj *otmp, *otmp2; @@ -649,8 +635,7 @@ int x, y; /* destroy object in fobj chain (if unpaid, it remains on the bill) */ void -delobj(obj) -register struct obj *obj; +delobj(register struct obj *obj) { boolean update_map; @@ -673,8 +658,7 @@ register struct obj *obj; /* try to find a particular type of object at designated map location */ struct obj * -sobj_at(otyp, x, y) -int otyp, x, y; +sobj_at(int otyp, int x, int y) { register struct obj *otmp; @@ -688,10 +672,7 @@ int otyp, x, y; /* sobj_at(&c) traversal -- find next object of specified type */ struct obj * -nxtobj(obj, type, by_nexthere) -struct obj *obj; -int type; -boolean by_nexthere; +nxtobj(struct obj *obj, int type, boolean by_nexthere) { register struct obj *otmp; @@ -707,8 +688,7 @@ boolean by_nexthere; } struct obj * -carrying(type) -register int type; +carrying(register int type) { register struct obj *otmp; @@ -746,8 +726,7 @@ static const char * const currencies[] = { /** Returns the currency according to amount given. */ const char * -currency(amount) -long amount; +currency(long int amount) { if (Hallucination) { int c = rn2(SIZE(currencies)); @@ -759,7 +738,7 @@ long amount; } boolean -have_lizard() +have_lizard(void) { register struct obj *otmp; @@ -770,9 +749,7 @@ have_lizard() } struct obj * -o_on(id, objchn) -unsigned int id; -register struct obj *objchn; +o_on(unsigned int id, register struct obj *objchn) { struct obj *temp; @@ -786,9 +763,7 @@ register struct obj *objchn; } boolean -obj_here(obj, x, y) -register struct obj *obj; -int x, y; +obj_here(register struct obj *obj, int x, int y) { register struct obj *otmp; @@ -798,8 +773,7 @@ int x, y; } struct obj * -g_at(x, y) -register int x, y; +g_at(register int x, register int y) { register struct obj *obj = level.objects[x][y]; @@ -812,8 +786,7 @@ register int x, y; /* compact a string of inventory letters by dashing runs of letters */ static void -compactify(buf) -register char *buf; +compactify(register char *buf) { register int i1 = 1, i2 = 1; register char ilet, ilet1, ilet2; @@ -851,24 +824,21 @@ register char *buf; /* some objects shouldn't be split when count given to getobj or askchain */ boolean -splittable(obj) -struct obj *obj; +splittable(struct obj *obj) { return !((obj->otyp == LOADSTONE && obj->cursed) || (obj == uwep && welded(uwep))); } /* match the prompt for either 'T' or 'R' command */ static boolean -taking_off(action) -const char *action; +taking_off(const char *action) { return !strcmp(action, "take off") || !strcmp(action, "remove"); } /* match the prompt for either 'W' or 'P' command */ static boolean -putting_on(action) -const char *action; +putting_on(const char *action) { return !strcmp(action, "wear") || !strcmp(action, "put on"); } @@ -878,7 +848,7 @@ static struct obj *nextgetobj = 0; /** Returns the object to use in the inventory usage menu. * nextgetobj is set to NULL before the pointer of the item is returned. */ struct obj* -getnextgetobj() +getnextgetobj(void) { if (nextgetobj) { struct obj* ptr = nextgetobj; @@ -897,8 +867,7 @@ getnextgetobj() !!!! may be able to remove "usegold" */ struct obj * -getobj(let, word) -register const char *let, *word; +getobj(register const char *let, register const char *word) { struct obj *otmp; char ilet = 0; @@ -1272,9 +1241,7 @@ register const char *let, *word; } void -silly_thing(word, otmp) -const char *word; -struct obj *otmp; +silly_thing(const char *word, struct obj *otmp) { #if 1 /* 'P','R' vs 'W','T' handling is obsolete */ nhUse(otmp); @@ -1313,29 +1280,26 @@ struct obj *otmp; } static int -ckvalidcat(otmp) -register struct obj *otmp; +ckvalidcat(register struct obj *otmp) { /* use allow_category() from pickup.c */ return((int)allow_category(otmp)); } static int -ckunpaid(otmp) -register struct obj *otmp; +ckunpaid(register struct obj *otmp) { return (otmp->unpaid || (Has_contents(otmp) && count_unpaid(otmp->cobj))); } boolean -wearing_armor() +wearing_armor(void) { return (boolean) (uarm || uarmc || uarmf || uarmg || uarmh || uarms || uarmu); } boolean -is_worn(otmp) -struct obj *otmp; +is_worn(struct obj *otmp) { return ((boolean)(!!(otmp->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE | W_WEAPONS)))); } @@ -1348,16 +1312,14 @@ static struct xprnctx { /* safe_qbuf() -> short_oname() callback */ static char * -safeq_xprname(obj) -struct obj *obj; +safeq_xprname(struct obj *obj) { return xprname(obj, (char *) 0, safeq_xprn_ctx.let, safeq_xprn_ctx.dot, 0L, 0L); } /* alternate safe_qbuf() -> short_oname() callback */ static char * -safeq_shortxprname(obj) -struct obj *obj; +safeq_shortxprname(struct obj *obj) { return xprname(obj, ansimpleoname(obj), safeq_xprn_ctx.let, safeq_xprn_ctx.dot, 0L, 0L); } @@ -1369,11 +1331,11 @@ static NEARDATA const char removeables[] = /* Takeoff (A). Return the number of times fn was called successfully */ /* If combo is TRUE, we just use this to get a category list */ int -ggetobj(word, fn, mx, combo, resultflags) -const char *word; -int (*fn) (OBJ_P), mx; -boolean combo; /* combination menu flag */ -unsigned *resultflags; +ggetobj(const char *word, int (*fn) (struct obj *), int mx, boolean combo, unsigned int *resultflags) + + + /* combination menu flag */ + { int (*ckfn) (OBJ_P) = (int (*) (OBJ_P)) 0; boolean (*filter) (OBJ_P) = (boolean (*) (OBJ_P)) 0; @@ -1555,11 +1517,11 @@ unsigned *resultflags; * objects to be treated. Return the number of objects treated. */ int -askchain(objchn, olets, allflag, fn, ckfn, mx, word) -struct obj **objchn; /* *objchn might change */ -int allflag, mx; -const char *olets, *word; /* olets is an Obj Class char array */ -int (*fn)(OBJ_P), (*ckfn)(OBJ_P); +askchain(struct obj **objchn, const char *olets, int allflag, int (*fn) (struct obj *), int (*ckfn) (struct obj *), int mx, const char *word) + /* *objchn might change */ + + /* olets is an Obj Class char array */ + { struct obj *otmp, *otmp2, *otmpo; register char sym, ilet; @@ -1780,8 +1742,7 @@ identify_dragon(int number) /* make an object actually be identified; no display updating */ void -fully_identify_obj(otmp) -struct obj *otmp; +fully_identify_obj(struct obj *otmp) { makeknown(otmp->otyp); if (otmp->oartifact) discover_artifact((xchar)otmp->oartifact); @@ -1799,8 +1760,7 @@ struct obj *otmp; /* ggetobj callback routine; identify an object and give immediate feedback */ int -identify(otmp) -struct obj *otmp; +identify(struct obj *otmp) { fully_identify_obj(otmp); prinv((char *)0, otmp, 0L); @@ -1809,8 +1769,7 @@ struct obj *otmp; /* menu of unidentified objects; select and identify up to id_limit of them */ static void -menu_identify(id_limit) -int id_limit; +menu_identify(int id_limit) { menu_item *pick_list; int n, i, first = 1; @@ -1848,9 +1807,10 @@ int id_limit; /* dialog with user to identify a given number of items; 0 means all */ void -identify_pack(id_limit, learning_id) -int id_limit; -boolean learning_id UNUSED; /* true if we just read unknown identify scroll */ +identify_pack( + int id_limit, + boolean learning_id UNUSED /**< TRUE if we just read unknown identify scroll */ +) { struct obj *obj; int n, unid_cnt = count_unidentified(invent); @@ -1885,7 +1845,7 @@ boolean learning_id UNUSED; /* true if we just read unknown identify scroll */ /* called when regaining sight; mark inventory objects which were picked up while blind as now having been seen */ void -learn_unseen_invent() +learn_unseen_invent(void) { struct obj *otmp; @@ -1913,7 +1873,7 @@ learn_unseen_invent() (*windowprocs.win_update_inventory) but the restore hackery was getting out of hand; this is now a central call point */ void -update_inventory() +update_inventory(void) { if (restoring) { return; @@ -1930,8 +1890,8 @@ update_inventory() } static char -obj_to_let(obj) /* should of course only be called for things in invent */ -register struct obj *obj; +obj_to_let(register struct obj *obj) /* should of course only be called for things in invent */ + { if (!flags.invlet_constant) { obj->invlet = NOINVSYM; @@ -1945,10 +1905,7 @@ register struct obj *obj; * the current quantity. */ void -prinv(prefix, obj, quan) -const char *prefix; -struct obj *obj; -long quan; +prinv(const char *prefix, struct obj *obj, long int quan) { if (!prefix) prefix = ""; pline("%s%s%s", @@ -1957,13 +1914,12 @@ long quan; } char * -xprname(obj, txt, let, dot, cost, quan) -struct obj *obj; -const char *txt; /* text to print instead of obj */ -char let; /* inventory letter */ -boolean dot; /* append period; (dot && cost => Iu) */ -long cost; /* cost (for inventory of unpaid or expended items) */ -long quan; /* if non-0, print this quantity, not obj->quan */ +xprname(struct obj *obj, + const char *txt, /**< text to print instead of obj */ + char let, /**< inventory letter */ + boolean dot, /**< append period; (dot && cost => Iu) */ + long cost, /**< cost (for inventory of unpaid or expended items) */ + long quan) /**< if non-0, print this quantity, not obj->quan */ { #ifdef LINT /* handle static char li[BUFSZ]; */ char li[BUFSZ]; @@ -2019,7 +1975,7 @@ long quan; /* if non-0, print this quantity, not obj->quan */ /* the 'i' command */ int -ddoinv() +ddoinv(void) { char c; struct obj *otmp; @@ -2037,8 +1993,7 @@ ddoinv() out of a set of synonyms is given. Returns 1 if it consumes time, 0 otherwise. */ int -itemactions(obj) -struct obj *obj; +itemactions(struct obj *obj) { winid win; int n; @@ -2382,8 +2337,7 @@ struct obj *obj; * containers. */ static struct obj * -find_unpaid(list, last_found) -struct obj *list, **last_found; +find_unpaid(struct obj *list, struct obj **last_found) { struct obj *obj; @@ -2407,9 +2361,7 @@ struct obj *list, **last_found; #ifdef SORTLOOT int -sortloot_cmp(obj1, obj2) -struct obj *obj1; -struct obj *obj2; +sortloot_cmp(struct obj *obj1, struct obj *obj2) { int val1 = 0; int val2 = 0; @@ -2489,7 +2441,7 @@ struct obj *obj2; static winid cached_pickinv_win = WIN_ERR; void -free_pickinv_cache() +free_pickinv_cache(void) { if (cached_pickinv_win != WIN_ERR) { destroy_nhwindow(cached_pickinv_win); @@ -2503,14 +2455,14 @@ free_pickinv_cache() * any count returned from the menu selection is placed here. */ static char -display_pickinv(lets, xtra_choice, query, want_reply, out_cnt, want_dump, want_disp) -const char *lets; -const char *xtra_choice; /* "fingers", pick hands rather than an object */ -const char *query; -boolean want_reply; -long* out_cnt; -boolean want_disp; -boolean want_dump; +display_pickinv(const char *lets, const char *xtra_choice, const char *query, boolean want_reply, long int *out_cnt, boolean want_dump, boolean want_disp) + + /* "fingers", pick hands rather than an object */ + + + + + { struct obj *otmp; #ifdef SORTLOOT @@ -2798,18 +2750,14 @@ boolean want_dump; * was selected. */ char -display_inventory(lets, want_reply) -const char *lets; -boolean want_reply; +display_inventory(const char *lets, boolean want_reply) { return display_pickinv(lets, NULL, NULL, want_reply, (long *)0, FALSE, TRUE); } /** See display_inventory. This is the same thing WITH dumpfile creation */ char -dump_inventory(lets, want_reply, want_disp) -register const char *lets; -boolean want_reply, want_disp; +dump_inventory(register const char *lets, boolean want_reply, boolean want_disp) { return display_pickinv(lets, NULL, NULL, want_reply, (long *)0, TRUE, want_disp); } @@ -2818,8 +2766,7 @@ boolean want_reply, want_disp; * Show what is current using inventory letters. */ static char -display_used_invlets(avoidlet) -char avoidlet; +display_used_invlets(char avoidlet) { struct obj *otmp; char ilet, ret = 0; @@ -2879,8 +2826,7 @@ char avoidlet; * contained objects. */ int -count_unpaid(list) -struct obj *list; +count_unpaid(struct obj *list) { int count = 0; @@ -2897,8 +2843,7 @@ struct obj *list; * Returns the number of unidentified items within the given list. */ int -count_unidentified(list) -struct obj *list; +count_unidentified(struct obj *list) { int count = 0; @@ -2914,8 +2859,7 @@ struct obj *list; * contained objects. */ int -count_objects(list) -struct obj *list; +count_objects(struct obj *list) { int count = 0; @@ -2936,10 +2880,7 @@ struct obj *list; * at some point: bknown is forced for priest[ess], like in xname(). */ int -count_buc(list, type, filterfunc) -struct obj *list; -int type; -boolean (*filterfunc)(OBJ_P); +count_buc(struct obj *list, int type, boolean (*filterfunc) (struct obj *)) { int count = 0; @@ -2972,10 +2913,7 @@ boolean (*filterfunc)(OBJ_P); /* similar to count_buc(), but tallies all states at once rather than looking for a specific type */ void -tally_BUCX(list, by_nexthere, bcp, ucp, ccp, xcp, ocp) -struct obj *list; -boolean by_nexthere; -int *bcp, *ucp, *ccp, *xcp, *ocp; +tally_BUCX(struct obj *list, boolean by_nexthere, int *bcp, int *ucp, int *ccp, int *xcp, int *ocp) { /* Future extensions: * Skip current_container when list is invent, uchain when @@ -3014,12 +2952,12 @@ int *bcp, *ucp, *ccp, *xcp, *ocp; /* count everything inside a container, or just shop-owned items inside */ long -count_contents(container, nested, quantity, everything, newdrop) -struct obj *container; -boolean nested, /* include contents of any nested containers */ - quantity, /* count all vs count separate stacks */ - everything, /* all objects vs only unpaid objects */ - newdrop; /* on floor, but hero-owned items haven't been marked +count_contents(struct obj *container, boolean nested, boolean quantity, boolean everything, boolean newdrop) + + /* include contents of any nested containers */ + /* count all vs count separate stacks */ + /* all objects vs only unpaid objects */ + /* on floor, but hero-owned items haven't been marked * no_charge yet and shop-owned items are still marked * unpaid -- used when asking the player whether to sell */ { @@ -3049,7 +2987,7 @@ boolean nested, /* include contents of any nested containers */ } static void -dounpaid() +dounpaid(void) { winid win; struct obj *otmp, *marker; @@ -3140,8 +3078,7 @@ dounpaid() static int this_type; static boolean -this_type_only(obj) -struct obj *obj; +this_type_only(struct obj *obj) { boolean res = (obj->oclass == this_type); @@ -3174,7 +3111,7 @@ struct obj *obj; /* the 'I' command */ int -dotypeinv() +dotypeinv(void) { char c = '\0'; int n, i = 0; @@ -3326,9 +3263,7 @@ dotypeinv() /* return a string describing the dungeon feature at if there is one worth mentioning at that location; otherwise null */ const char * -dfeature_at(x, y, buf) -int x, y; -char *buf; +dfeature_at(int x, int y, char *buf) { struct rm *lev = &levl[x][y]; int ltyp = lev->typ, cmap = -1; @@ -3396,9 +3331,9 @@ char *buf; /* look at what is here; if there are many objects (5 or more), don't show them unless obj_cnt is 0 */ int -look_here(obj_cnt, picked_some) -int obj_cnt; /* obj_cnt > 0 implies that autopickup is in progess */ -boolean picked_some; +look_here(int obj_cnt, boolean picked_some) + /* obj_cnt > 0 implies that autopickup is in progess */ + { struct obj *otmp; struct trap *trap; @@ -3544,15 +3479,13 @@ boolean picked_some; /* explicilty look at what is here, including all objects */ int -dolook() +dolook(void) { return look_here(0, FALSE); } boolean -will_feel_cockatrice(otmp, force_touch) -struct obj *otmp; -boolean force_touch; +will_feel_cockatrice(struct obj *otmp, boolean force_touch) { if ((Blind || force_touch) && !uarmg && !Stone_resistance && (otmp->otyp == CORPSE && touch_petrifies(&mons[otmp->corpsenm]))) @@ -3561,9 +3494,7 @@ boolean force_touch; } void -feel_cockatrice(otmp, force_touch) -struct obj *otmp; -boolean force_touch; +feel_cockatrice(struct obj *otmp, boolean force_touch) { char kbuf[BUFSZ]; @@ -3584,8 +3515,7 @@ boolean force_touch; } void -stackobj(obj) -struct obj *obj; +stackobj(struct obj *obj) { struct obj *otmp; @@ -3597,8 +3527,8 @@ struct obj *obj; /* returns TRUE if obj & otmp can be merged; used in invent.c and mkobj.c */ boolean -mergable(otmp, obj) /* returns TRUE if obj & otmp can be merged */ -struct obj *otmp, *obj; +mergable(struct obj *otmp, struct obj *obj) /* returns TRUE if obj & otmp can be merged */ + { int objnamelth = 0, otmpnamelth = 0; @@ -3694,7 +3624,7 @@ struct obj *otmp, *obj; /** The '$' command */ int -doprgold() +doprgold(void) { /* the messages used to refer to "carrying gold", but that didn't take containers into account */ @@ -3717,7 +3647,7 @@ doprgold() /** The ')' command */ int -doprwep() +doprwep(void) { if (!uwep) { You("are empty %s.", body_part(HANDED)); @@ -3730,8 +3660,7 @@ doprwep() /* caller is responsible for checking !wearing_armor() */ static void -noarmor(report_uskin) -boolean report_uskin; +noarmor(boolean report_uskin) { if (!uskin || !report_uskin) { You("are not wearing any armor."); @@ -3756,7 +3685,7 @@ boolean report_uskin; /* The '[' command */ int -doprarm() +doprarm(void) { if (!wearing_armor()) { noarmor(TRUE); @@ -3779,7 +3708,7 @@ doprarm() /** The '=' command */ int -doprring() +doprring(void) { if(!uleft && !uright) You("are not wearing any rings."); @@ -3797,7 +3726,7 @@ doprring() /** The '"' command */ int -dopramulet() +dopramulet(void) { if (!uamul) You("are not wearing an amulet."); @@ -3807,8 +3736,7 @@ dopramulet() } static boolean -tool_in_use(obj) -struct obj *obj; +tool_in_use(struct obj *obj) { if ((obj->owornmask & (W_TOOL | W_SADDLE)) != 0L) { return TRUE; @@ -3820,7 +3748,7 @@ struct obj *obj; /* the '(' command */ int -doprtool() +doprtool(void) { struct obj *otmp; int ct = 0; @@ -3838,7 +3766,7 @@ doprtool() /** '*' command; combines the ')' + '[' + '=' + '"' + '(' commands; show inventory of all currently wielded, worn, or used objects */ int -doprinuse() +doprinuse(void) { struct obj *otmp; int ct = 0; @@ -3857,9 +3785,7 @@ doprinuse() * uses up an object that's on the floor, charging for it as necessary */ void -useupf(obj, numused) -register struct obj *obj; -long numused; +useupf(register struct obj *obj, long int numused) { register struct obj *otmp; boolean at_u = (obj->ox == u.ux && obj->oy == u.uy); @@ -3903,9 +3829,7 @@ static NEARDATA char *invbuf = (char *)0; static NEARDATA unsigned invbufsiz = 0; char * -let_to_name(let, unpaid) -char let; -boolean unpaid; +let_to_name(char let, boolean unpaid) { const char *ocsymfmt = " ('%c')"; const int invbuf_sympadding = 8; /* arbitrary */ @@ -3950,7 +3874,7 @@ boolean unpaid; /* release the static buffer used by let_to_name() */ void -free_invbuf() +free_invbuf(void) { if (invbuf) free((genericptr_t)invbuf), invbuf = (char *)0; invbufsiz = 0; @@ -3959,7 +3883,7 @@ free_invbuf() /* give consecutive letters to every item in inventory (for !fixinv mode); gold is always forced to '$' slot at head of list */ void -reassign() +reassign(void) { int i; struct obj *obj, *prevobj, *goldobj; @@ -4035,7 +3959,7 @@ reassign() * is unnamed and source is named. */ int -doorganize() /* inventory organizer by Del Lamb */ +doorganize(void) /* inventory organizer by Del Lamb */ { struct obj *obj, *otmp; int ix, cur; @@ -4213,8 +4137,7 @@ doorganize() /* inventory organizer by Del Lamb */ /* common to display_minventory and display_cinventory */ static void -invdisp_nothing(hdr, txt) -const char *hdr, *txt; +invdisp_nothing(const char *hdr, const char *txt) { winid win; anything any; @@ -4235,8 +4158,7 @@ const char *hdr, *txt; /* query_objlist callback: return things that could possibly be worn/wielded */ static boolean -worn_wield_only(obj) -struct obj *obj; +worn_wield_only(struct obj *obj) { /* check for things that *are* worn or wielded (only used for monsters, so we don't worry about excluding W_CHAIN, W_ARTI and the like) */ @@ -4257,10 +4179,7 @@ struct obj *obj; * MINV_ALL - display all inventory */ struct obj * -display_minventory(mon, dflags, title) -register struct monst *mon; -int dflags; -char *title; +display_minventory(register struct monst *mon, int dflags, char *title) { struct obj *ret; char tmp[QBUFSZ]; @@ -4310,8 +4229,7 @@ char *title; * Currently, this is only used for statues, via wand of probing. */ struct obj * -display_cinventory(obj) -register struct obj *obj; +display_cinventory(register struct obj *obj) { struct obj *ret; char tmp[QBUFSZ]; @@ -4342,8 +4260,7 @@ register struct obj *obj; static coord only; static boolean -only_here(obj) -struct obj *obj; +only_here(struct obj *obj) { return (obj->ox == only.x && obj->oy == only.y); } @@ -4355,9 +4272,7 @@ struct obj *obj; * Currently, this is only used with a wand of probing zapped downwards. */ int -display_binventory(x, y, as_if_seen) -int x, y; -boolean as_if_seen; +display_binventory(int x, int y, boolean as_if_seen) { struct obj *obj; menu_item *selected = 0; @@ -4383,8 +4298,7 @@ boolean as_if_seen; } boolean -is_racial_armor(obj) -struct obj *obj; +is_racial_armor(struct obj *obj) { if (Race_if(PM_DWARF)) { return is_dwarvish_armor(obj); @@ -4400,8 +4314,7 @@ struct obj *obj; } boolean -is_racial_weapon(obj) -struct obj *obj; +is_racial_weapon(struct obj *obj) { /* don't use is_race_weapon(), we don't want to break the racial * conduct just because the player is wielding armor */ diff --git a/src/light.c b/src/light.c index 760b5db26..e5317ae0f 100644 --- a/src/light.c +++ b/src/light.c @@ -45,7 +45,7 @@ static light_source *light_base = 0; static void write_ls(int, light_source *); -static int maybe_write_ls(int, int, BOOLEAN_P); +static int maybe_write_ls(int, int, boolean); /* imported from vision.c, for small circles */ extern char circle_data[]; @@ -54,10 +54,7 @@ extern char circle_start[]; /* Create a new light source. */ void -new_light_source(x, y, range, type, id) -xchar x, y; -int range, type; -anything *id; +new_light_source(xchar x, xchar y, int range, int type, anything *id) { light_source *ls; @@ -85,9 +82,7 @@ anything *id; * to an object at a time. */ void -del_light_source(type, id) -int type; -anything *id; +del_light_source(int type, anything *id) { light_source *curr, *prev; anything tmp_id; @@ -129,8 +124,7 @@ anything *id; /* Mark locations that are temporarily lit via mobile light sources. */ void -do_light_sources(cs_rows) -char **cs_rows; +do_light_sources(char **cs_rows) { int x, y, min_x, max_x, max_y, offset; char *limits; @@ -213,9 +207,7 @@ char **cs_rows; way to its destination; show its light so that hero has a chance to remember terrain, objects, and monsters being revealed */ void -show_transient_light(obj, x, y) -struct obj *obj; -int x, y; +show_transient_light(struct obj *obj, int x, int y) { light_source *ls; struct monst *mon; @@ -267,7 +259,7 @@ int x, y; was flagged for being visible during transient light movement but can't be seen now */ void -transient_light_cleanup() +transient_light_cleanup(void) { struct monst *mon; int mtempcount = 0; @@ -294,9 +286,7 @@ transient_light_cleanup() #define mon_is_local(mon) ((mon)->mx > 0) struct monst * -find_mid(nid, fmflags) -unsigned nid; -unsigned fmflags; +find_mid(unsigned int nid, unsigned int fmflags) { struct monst *mtmp; @@ -316,8 +306,7 @@ unsigned fmflags; /* Save all light sources of the given range. */ void -save_light_sources(fd, mode, range) -int fd, mode, range; +save_light_sources(int fd, int mode, int range) { int count, actual, is_global; light_source **prev, *curr; @@ -366,8 +355,7 @@ int fd, mode, range; * pointers. */ void -restore_light_sources(fd) -int fd; +restore_light_sources(int fd) { int count; light_source *ls; @@ -385,10 +373,7 @@ int fd; /* to support '#stats' wizard-mode command */ void -light_stats(hdrfmt, hdrbuf, count, size) -const char *hdrfmt; -char *hdrbuf; -long *count, *size; +light_stats(const char *hdrfmt, char *hdrbuf, long int *count, long int *size) { light_source *ls; @@ -402,8 +387,7 @@ long *count, *size; /* Relink all lights that are so marked. */ void -relink_light_sources(ghostly) -boolean ghostly; +relink_light_sources(boolean ghostly) { char which; unsigned nid; @@ -444,9 +428,7 @@ boolean ghostly; * the light source out. */ static int -maybe_write_ls(fd, range, write_it) -int fd, range; -boolean write_it; +maybe_write_ls(int fd, int range, boolean write_it) { int count = 0, is_global; light_source *ls; @@ -480,7 +462,7 @@ boolean write_it; } void -light_sources_sanity_check() +light_sources_sanity_check(void) { light_source *ls; struct monst *mtmp; @@ -511,9 +493,7 @@ light_sources_sanity_check() /* Write a light source structure to disk. */ static void -write_ls(fd, ls) -int fd; -light_source *ls; +write_ls(int fd, light_source *ls) { anything arg_save; struct obj *otmp; @@ -556,8 +536,7 @@ light_source *ls; /* Change light source's ID from src to dest. */ void -obj_move_light_source(src, dest) -struct obj *src, *dest; +obj_move_light_source(struct obj *src, struct obj *dest) { light_source *ls; @@ -572,7 +551,7 @@ struct obj *src, *dest; /* return true if there exist any light sources */ boolean -any_light_source() +any_light_source(void) { return (boolean) (light_base != (light_source *) 0); } @@ -582,8 +561,7 @@ any_light_source() * only for burning light sources. */ void -snuff_light_source(x, y) -int x, y; +snuff_light_source(int x, int y) { light_source *ls; struct obj *obj; @@ -616,8 +594,7 @@ int x, y; /* Return TRUE if object sheds any light at all. */ boolean -obj_sheds_light(obj) -struct obj *obj; +obj_sheds_light(struct obj *obj) { /* so far, only burning objects shed light */ return obj_is_burning(obj); @@ -625,8 +602,7 @@ struct obj *obj; /* Return TRUE if sheds light AND will be snuffed by end_burn(). */ boolean -obj_is_burning(obj) -struct obj *obj; +obj_is_burning(struct obj *obj) { return (obj->lamplit && (obj->otyp == MAGIC_LAMP || ignitable(obj) || artifact_light(obj))); @@ -634,8 +610,7 @@ struct obj *obj; /* copy the light source(s) attachted to src, and attach it/them to dest */ void -obj_split_light_source(src, dest) -struct obj *src, *dest; +obj_split_light_source(struct obj *src, struct obj *dest) { light_source *ls, *new_ls; @@ -664,8 +639,7 @@ struct obj *src, *dest; /* light source `src' has been folded into light source `dest'; used for merging lit candles and adding candle(s) to lit candelabrum */ void -obj_merge_light_sources(src, dest) -struct obj *src, *dest; +obj_merge_light_sources(struct obj *src, struct obj *dest) { light_source *ls; @@ -682,9 +656,7 @@ struct obj *src, *dest; /* light source `obj' is being made brighter or dimmer */ void -obj_adjust_light_radius(obj, new_radius) -struct obj *obj; -int new_radius; +obj_adjust_light_radius(struct obj *obj, int new_radius) { light_source *ls; @@ -702,8 +674,7 @@ int new_radius; /* Candlelight is proportional to the number of candles; minimum range is 2 rather than 1 for playability. */ int -candle_light_range(obj) -struct obj *obj; +candle_light_range(struct obj *obj) { int radius; @@ -741,8 +712,7 @@ struct obj *obj; /* light emitting artifact's range depends upon its curse/bless state */ int -arti_light_radius(obj) -struct obj *obj; +arti_light_radius(struct obj *obj) { /* * Used by begin_burn() when setting up a new light source @@ -764,8 +734,7 @@ struct obj *obj; /* adverb describing lit artifact's light; depends on curse/bless state */ const char * -arti_light_description(obj) -struct obj *obj; +arti_light_description(struct obj *obj) { switch (arti_light_radius(obj)) { case 3: @@ -782,7 +751,7 @@ struct obj *obj; #ifdef WIZARD int -wiz_light_sources() +wiz_light_sources(void) { winid win; char buf[BUFSZ]; diff --git a/src/livelog.c b/src/livelog.c index 75a810da7..73bc8a89b 100644 --- a/src/livelog.c +++ b/src/livelog.c @@ -64,7 +64,7 @@ char strbuf[STRBUF_LEN]; char prefixbuf[STRBUF_LEN]; /* Open the live log file */ -boolean livelog_start() { +boolean livelog_start(void) { last_achieve_int = encodeachieve(); return TRUE; @@ -90,7 +90,7 @@ void livelog_write_string(char* buffer) { } static -char *livelog_prefix() { +char *livelog_prefix(void) { s_level *lev = Is_special(&u.uz); snprintf(prefixbuf, STRBUF_LEN, "version=%s-%d.%d.%d" SEP @@ -144,7 +144,7 @@ char *livelog_prefix() { /* Writes changes in the achieve structure to the live log. * Called from various places in the NetHack source, * usually where xlog's achieve is set. */ -void livelog_achieve_update() { +void livelog_achieve_update(void) { long achieve_int, achieve_diff; achieve_int = encodeachieve(); @@ -168,8 +168,7 @@ void livelog_achieve_update() { /* Reports wishes */ void -livelog_wish(item) -char *item; +livelog_wish(char *item) { snprintf(strbuf, STRBUF_LEN, "%s" SEP "type=wish" SEP "wish=%s" SEP "wish_count=%ld\n", @@ -183,7 +182,7 @@ char *item; /* Shout */ #ifdef LIVELOG_SHOUT int -doshout() +doshout(void) { char buf[BUFSZ], qbuf[QBUFSZ]; char* p; @@ -214,8 +213,7 @@ doshout() #ifdef LIVELOG_BONES_KILLER void -livelog_bones_killed(mtmp) -struct monst *mtmp; +livelog_bones_killed(struct monst *mtmp) { char *name = (char *)0; @@ -248,10 +246,7 @@ struct monst *mtmp; /** Reports shoplifting */ void -livelog_shoplifting(shk_name, shop_name, total) -const char* shk_name; -const char* shop_name; -long total; +livelog_shoplifting(const char *shk_name, const char *shop_name, long int total) { /* shopkeeper: Name of the shopkeeper (e.g. Kopasker) shop: Name of the shop (e.g. general store) @@ -267,11 +262,7 @@ long total; /** Livelog method for reporting the starting/resuming of a game. */ void -livelog_game_started(verb, alignment_sex, race, role) -const char* verb; -const char* alignment_sex; -const char* race; -const char* role; +livelog_game_started(const char *verb, const char *alignment_sex, const char *race, const char *role) { snprintf(strbuf, STRBUF_LEN, "%s" SEP @@ -290,8 +281,7 @@ const char* role; /** Livelog method for reporting saving, quitting, etc. */ void -livelog_game_action(verb) -const char* verb; +livelog_game_action(const char *verb) { snprintf(strbuf, STRBUF_LEN, "%s" SEP "type=%s" SEP "game_action=%s\n", @@ -303,9 +293,7 @@ const char* verb; /** Livelog method for reporting generic events with one customizable field. */ void -livelog_generic(field, text) -const char* field; -const char* text; +livelog_generic(const char *field, const char *text) { snprintf(strbuf, STRBUF_LEN, "%s" SEP "type=%s" SEP "%s=%s\n", @@ -318,9 +306,7 @@ const char* text; /** Livelog method for reporting monster genocides. */ void -livelog_genocide(genocided_monster, level_wide) -const char* genocided_monster; -int level_wide; +livelog_genocide(const char *genocided_monster, int level_wide) { if (level_wide) { livelog_printf(LL_GENOCIDE, "genocided %s on a level in %s", diff --git a/src/lock.c b/src/lock.c index 6a72ab56d..6d8fa36f6 100644 --- a/src/lock.c +++ b/src/lock.c @@ -13,16 +13,15 @@ static NEARDATA struct xlock_s { } xlock; /* occupation callbacks */ -static int picklock(); -static int forcelock(); +static int picklock(void); +static int forcelock(void); -static const char *lock_action(); -static boolean obstructed(int, int, BOOLEAN_P); +static const char *lock_action(void); +static boolean obstructed(int, int, boolean); static void chest_shatter_msg(struct obj *); boolean -picking_lock(x, y) -int *x, *y; +picking_lock(int *x, int *y) { if (occupation == picklock) { *x = u.ux + u.dx; @@ -35,15 +34,14 @@ int *x, *y; } boolean -picking_at(x, y) -int x, y; +picking_at(int x, int y) { return (boolean)(occupation == picklock && xlock.door == &levl[x][y]); } /* produce an occupation string appropriate for the current activity */ static const char * -lock_action() +lock_action(void) { /* "unlocking"+2 == "locking" */ static const char *actions[] = { @@ -74,7 +72,7 @@ lock_action() /* try to open/close a lock */ static int -picklock() +picklock(void) { if (xlock.box) { if(((xlock.box->ox != u.ux) || (xlock.box->oy != u.uy)) && @@ -164,9 +162,7 @@ picklock() } void -breakchestlock(box, destroyit) -struct obj *box; -boolean destroyit; +breakchestlock(struct obj *box, boolean destroyit) { if (!destroyit) { /* bill for the box but not for its contents */ @@ -227,7 +223,7 @@ boolean destroyit; /* try to force a locked chest */ static int -forcelock() +forcelock(void) { if((xlock.box->ox != u.ux) || (xlock.box->oy != u.uy)) return((xlock.usedtime = 0)); /* you or it moved */ @@ -274,7 +270,7 @@ forcelock() } void -reset_pick() +reset_pick(void) { xlock.usedtime = xlock.chance = xlock.picktyp = 0; xlock.magic_key = FALSE; @@ -284,8 +280,7 @@ reset_pick() /* level change or object deletion; context may no longer be valid */ void -maybe_reset_pick(container) -struct obj *container; /* passed from obfree() */ +maybe_reset_pick(struct obj *container) /**< passed from obfree() */ { /* * If a specific container, only clear context if it is for that @@ -313,10 +308,10 @@ struct obj *container; /* passed from obfree() */ /* pick a lock with a given object */ int -pick_lock(pick, rx, ry, explicit) -register struct obj *pick; -int rx, ry; -boolean explicit; /**< Mentioning tool when (un)locking doors? */ +pick_lock( + struct obj *pick, + int rx, int ry, + boolean explicit) /**< Mentioning tool when (un)locking doors? */ { /* rx and ry are passed only from the use-stethoscope stuff */ int picktyp, c, ch; @@ -572,7 +567,7 @@ boolean explicit; /**< Mentioning tool when (un)locking doors? */ /* try to force a chest with your weapon */ int -doforce() +doforce(void) { register struct obj *otmp; register int c, picktyp; @@ -655,8 +650,7 @@ doforce() } boolean -stumble_on_door_mimic(x, y) -int x, y; +stumble_on_door_mimic(int x, int y) { struct monst *mtmp = m_at(x, y); @@ -669,7 +663,7 @@ int x, y; /* the 'O' command - try to open a door */ int -doopen() +doopen(void) { #ifdef AUTO_OPEN return doopen_indir(0, 0); @@ -677,8 +671,7 @@ doopen() /* try to open a door in direction u.dx/u.dy */ int -doopen_indir(x, y) -int x, y; +doopen_indir(int x, int y) { #endif /* AUTO_OPEN */ coord cc; @@ -790,9 +783,7 @@ int x, y; } static boolean -obstructed(x, y, quietly) -register int x, y; -boolean quietly; +obstructed(register int x, register int y, boolean quietly) { struct monst *mtmp = m_at(x, y); @@ -828,7 +819,7 @@ boolean quietly; /* the 'C' command - try to close a door */ int -doclose() +doclose(void) { register int x, y; register struct rm *door; @@ -932,8 +923,7 @@ doclose() /* box obj was hit with spell or wand effect otmp; returns true if something happened */ boolean -boxlock(obj, otmp) -struct obj *obj, *otmp; /* obj *is* a box */ +boxlock(struct obj *obj, struct obj *otmp) /* obj *is* a box */ { boolean res = 0; @@ -972,9 +962,7 @@ struct obj *obj, *otmp; /* obj *is* a box */ /* Door/secret door was hit with spell or wand effect otmp; returns true if something happened */ boolean -doorlock(otmp, x, y) -struct obj *otmp; -int x, y; +doorlock(struct obj *otmp, int x, int y) { register struct rm *door = &levl[x][y]; boolean res = TRUE; @@ -1139,8 +1127,7 @@ int x, y; } static void -chest_shatter_msg(otmp) -struct obj *otmp; +chest_shatter_msg(struct obj *otmp) { const char *disposition; const char *thing; @@ -1187,9 +1174,7 @@ struct obj *otmp; */ int -artifact_door(x, y) -int x UNUSED; -int y UNUSED; +artifact_door(int x UNUSED, int y UNUSED) { #ifdef ADVENT_CALENDAR /* on the advent calendar level all doors are indestructible */ diff --git a/src/mail.c b/src/mail.c index 6a43b36c8..bb86768c9 100644 --- a/src/mail.c +++ b/src/mail.c @@ -85,7 +85,7 @@ static long laststattime; # endif void -free_maildata() +free_maildata(void) { if (mailbox) { free(mailbox); @@ -94,7 +94,7 @@ free_maildata() } void -getmailstatus() +getmailstatus(void) { if(!mailbox && !(mailbox = nh_getenv("MAIL"))) { # ifdef MAILPATH @@ -136,8 +136,7 @@ getmailstatus() * from newmail() and newphone(). */ static boolean -md_start(startp) -coord *startp; +md_start(coord *startp) { coord testcc; /* scratch coordinates */ int row; /* current row we are checking */ @@ -237,9 +236,9 @@ coord *startp; * its point randomly, which is not what we want. */ static boolean -md_stop(stopp, startp) -coord *stopp; /* stopping position (we fill it in) */ -coord *startp; /* starting position (read only) */ +md_stop( + coord *stopp, /**< stopping position (we fill it in) */ + coord *startp) /**< starting position (read only) */ { int x, y, distance, min_distance = -1; @@ -281,9 +280,10 @@ static NEARDATA const char *mail_text[] = { * TRUE otherwise. */ static boolean -md_rush(md, tx, ty) -struct monst *md; -register int tx, ty; /* destination of mail daemon */ +md_rush( + struct monst *md, + int tx, + int ty) /**< destination of mail daemon */ { struct monst *mon; /* displaced monster */ register int dx, dy; /* direction counters */ @@ -382,8 +382,7 @@ register int tx, ty; /* destination of mail daemon */ /* Deliver a scroll of mail. */ /*ARGSUSED*/ static void -newmail(info) -struct mail_info *info; +newmail(struct mail_info *info) { struct monst *md; coord start, stop; @@ -493,7 +492,7 @@ struct obj *otmp; # ifdef UNIX void -ckmailstatus() +ckmailstatus(void) { #ifdef SIMPLE_MAIL if (mailckfreq == 0) @@ -533,8 +532,7 @@ ckmailstatus() /*ARGSUSED*/ void -readmail(otmp) -struct obj *otmp; +readmail(struct obj *otmp) { nhUse(otmp); #ifdef DEF_MAILREADER @@ -725,8 +723,7 @@ struct obj *otmp; # endif /* LAN_MAIL */ void -read_hint(otmp) -struct obj *otmp UNUSED; +read_hint(struct obj *otmp UNUSED) { /* TODO: option for beginner, general changes, public server hints? */ static const char *hint[] = { @@ -754,7 +751,7 @@ struct obj *otmp UNUSED; } void -maybe_hint() +maybe_hint(void) { if (u.uswallow || !flags.biff || !flags.hint) return; diff --git a/src/makemon.c b/src/makemon.c index 02fab5537..dc5a15936 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -31,8 +31,7 @@ extern const int monstr[]; #define tooweak(monindx, lev) (monstr[monindx] < lev) boolean -is_home_elemental(ptr) -register struct permonst *ptr; +is_home_elemental(register struct permonst *ptr) { if (ptr->mlet == S_ELEMENTAL) switch (monsndx(ptr)) { @@ -48,8 +47,7 @@ register struct permonst *ptr; * Return true if the given monster cannot exist on this elemental level. */ static boolean -wrong_elem_type(ptr) -struct permonst *ptr; +wrong_elem_type(struct permonst *ptr) { if (ptr->mlet == S_ELEMENTAL) { return((boolean)(!is_home_elemental(ptr))); @@ -73,9 +71,7 @@ struct permonst *ptr; } /* make a group just like mtmp */ static void -m_initgrp(mtmp, x, y, n, mmflags) -struct monst *mtmp; -int x, y, n, mmflags; +m_initgrp(struct monst *mtmp, int x, int y, int n, int mmflags) { coord mm; register int cnt = rnd(n); @@ -140,9 +136,7 @@ int x, y, n, mmflags; } static void -m_initthrow(mtmp, otyp, oquan) -struct monst *mtmp; -int otyp, oquan; +m_initthrow(struct monst *mtmp, int otyp, int oquan) { register struct obj *otmp; @@ -154,9 +148,7 @@ int otyp, oquan; } static void -m_inityour(mtmp, obj) -struct monst *mtmp; -struct obj *obj; +m_inityour(struct monst *mtmp, struct obj *obj) { register struct obj *otmp; @@ -172,8 +164,7 @@ struct obj *obj; } static void -m_initweap(mtmp) -register struct monst *mtmp; +m_initweap(register struct monst *mtmp) { register struct permonst *ptr = mtmp->data; register int mm = monsndx(ptr); @@ -595,9 +586,7 @@ register struct monst *mtmp; * Makes up money for monster's inventory. */ void -mkmonmoney(mtmp, amount) -struct monst *mtmp; -long amount; +mkmonmoney(struct monst *mtmp, long int amount) { struct obj *gold = mksobj(GOLD_PIECE, FALSE, FALSE); @@ -606,8 +595,7 @@ long amount; } static void -m_initinv(mtmp) -register struct monst *mtmp; +m_initinv(register struct monst *mtmp) { register int cnt; register struct obj *otmp; @@ -895,9 +883,8 @@ register struct monst *mtmp; /* Note: for long worms, always call cutworm (cutworm calls clone_mon) */ struct monst * -clone_mon(mon, x, y) -struct monst *mon; -xchar x, y; /* clone's preferred location or 0 (near mon) */ +clone_mon(struct monst *mon, + xchar x, xchar y) /**< clone's preferred location or 0 (near mon) */ { coord mm; struct monst *m2; @@ -1015,10 +1002,7 @@ xchar x, y; /* clone's preferred location or 0 (near mon) */ * TRUE propagation successful */ boolean -propagate(mndx, tally, ghostly) -int mndx; -boolean tally; -boolean ghostly; +propagate(int mndx, boolean tally, boolean ghostly) { boolean result; uchar lim = mbirth_limit(mndx); @@ -1045,8 +1029,7 @@ boolean ghostly; /* amount of HP to lose from level drain (or gain from Stormbringer) */ int -monhp_per_lvl(mon) -struct monst *mon; +monhp_per_lvl(struct monst *mon) { struct permonst *ptr = mon->data; int hp = rnd(8); /* default is d8 */ @@ -1070,10 +1053,7 @@ struct monst *mon; } static boolean -makemon_rnd_goodpos(mon, gpflags, cc) -struct monst *mon; -unsigned gpflags; -coord *cc; +makemon_rnd_goodpos(struct monst *mon, unsigned int gpflags, coord *cc) { int tryct = 0; int nx,ny; @@ -1140,10 +1120,7 @@ coord *cc; static struct monst * -_makemon(ptr, x, y, mmflags) -register struct permonst *ptr; -register int x, y; -register int mmflags; +_makemon(register struct permonst *ptr, register int x, register int y, register int mmflags) { register struct monst *mtmp; int mndx, mcham, ct, mitem, xlth, mhitdie; @@ -1478,9 +1455,7 @@ register int mmflags; /* set up a new monster's initial level and hit points; used by newcham() as well as by makemon() */ void -newmonhp(mtmp, mndx) -struct monst *mtmp; -int mndx; +newmonhp(struct monst *mtmp, int mndx) { struct permonst *ptr = &mons[mndx]; @@ -1531,7 +1506,7 @@ int mndx; } struct mextra * -newmextra() +newmextra(void) { struct mextra *mextra; @@ -1554,10 +1529,7 @@ newmextra() * In case we make a monster group, only return the one at [x,y]. */ struct monst * -makemon(ptr, x, y, mmflags) -register struct permonst *ptr; -register int x, y; -register int mmflags; +makemon(register struct permonst *ptr, register int x, register int y, register int mmflags) { use_mon_rng++; struct monst *mtmp = _makemon(ptr, x, y, mmflags); @@ -1566,8 +1538,7 @@ register int mmflags; } int -mbirth_limit(mndx) -int mndx; +mbirth_limit(int mndx) { /* assert(MAXMONNO < 255); */ return (mndx == PM_NAZGUL ? 9 : mndx == PM_ERINYS ? 3 : @@ -1577,9 +1548,9 @@ int mndx; /* used for wand/scroll/spell of create monster */ /* returns TRUE iff you know monsters have been created */ boolean -create_critters(cnt, mptr) -int cnt; -struct permonst *mptr; /* usually null; used for confused reading */ +create_critters( + int cnt, + struct permonst *mptr) /**< usually NULL; used for confused reading */ { coord c; int x, y; @@ -1612,8 +1583,7 @@ struct permonst *mptr; /* usually null; used for confused reading */ } static boolean -uncommon(mndx) -int mndx; +uncommon(int mndx) { if (mons[mndx].geno & (G_NOGEN | G_UNIQ)) return TRUE; if (mvitals[mndx].mvflags & G_GONE) return TRUE; @@ -1671,8 +1641,7 @@ prohibited_by_generation_flags(struct permonst *ptr) * return an integer in the range of 0-5. */ static int -align_shift(ptr) -register struct permonst *ptr; +align_shift(register struct permonst *ptr) { static NEARDATA long oldmoves = 0L; /* != 1, starting value of moves */ static NEARDATA s_level *lev; @@ -1698,7 +1667,7 @@ register struct permonst *ptr; /** Returns the level of the weakest monster to make. */ int -min_monster_difficulty() +min_monster_difficulty(void) { int zlevel = level_difficulty(); if (u.uevent.udemigod) { @@ -1711,7 +1680,7 @@ min_monster_difficulty() /** Returns the level of the strongest monster to make. */ int -max_monster_difficulty() +max_monster_difficulty(void) { int zlevel = level_difficulty(); if (u.uevent.udemigod) { @@ -1724,8 +1693,7 @@ max_monster_difficulty() struct permonst * -get_override_mon(override) -struct mon_gen_override *override; +get_override_mon(struct mon_gen_override *override) { int chance, try = 100; struct mon_gen_tuple *mt; @@ -1754,7 +1722,7 @@ static NEARDATA struct { static struct permonst * -_rndmonst() +_rndmonst(void) { register struct permonst *ptr; register int mndx, ct; @@ -1848,7 +1816,7 @@ _rndmonst() /* select a random monster type */ struct permonst * -rndmonst() +rndmonst(void) { use_mon_rng++; struct permonst *tmp = _rndmonst(); @@ -1859,8 +1827,7 @@ rndmonst() /* called when you change level (experience or dungeon depth) or when monster species can no longer be created (genocide or extinction) */ void -reset_rndmonst(mndx) -int mndx; /* particular species that can no longer be created */ +reset_rndmonst(int mndx) /**< particular species that can no longer be created */ { /* cached selection info is out of date */ if (mndx == NON_PM) { @@ -1873,8 +1840,7 @@ int mndx; /* particular species that can no longer be created */ /* decide whether it's ok to generate a candidate monster by mkclass() */ static boolean -mk_gen_ok(mndx, mvflagsmask, genomask) -int mndx, mvflagsmask, genomask; +mk_gen_ok(int mndx, int mvflagsmask, int genomask) { struct permonst *ptr = &mons[mndx]; @@ -1899,19 +1865,14 @@ int mndx, mvflagsmask, genomask; * in that class can be made. */ struct permonst * -mkclass(class, spc) -char class; -int spc; +mkclass(char class, int spc) { return mkclass_aligned(class, spc, A_NONE); } /* mkclass() with alignment restrictions; used by ndemon() */ struct permonst * -mkclass_aligned(class, spc, atyp) -char class; -int spc; -aligntyp atyp; +mkclass_aligned(char class, int spc, aligntyp atyp) { register int first, last, num = 0; int k, nums[SPECIAL_PM + 1]; /* +1: insurance for final return value */ @@ -1990,8 +1951,7 @@ aligntyp atyp; genocided types are avoided but extinct ones are acceptable; we don't check polyok() here--caller accepts some choices !polyok() would reject */ int -mkclass_poly(class) -int class; +mkclass_poly(int class) { register int first, last, num = 0; @@ -2024,8 +1984,8 @@ int class; } int -adj_lev(ptr) /* adjust strength of monsters based on u.uz and u.ulevel */ -register struct permonst *ptr; +adj_lev(register struct permonst *ptr) /* adjust strength of monsters based on u.uz and u.ulevel */ + { int tmp, tmp2; @@ -2054,8 +2014,7 @@ register struct permonst *ptr; /* monster earned experience and will gain some hit points; it might also grow into a bigger monster (baby to adult, soldier to officer, etc) */ struct permonst * -grow_up(mtmp, victim) -struct monst *mtmp, *victim; +grow_up(struct monst *mtmp, struct monst *victim) { int oldtype, newtype, max_increase, cur_increase, lev_limit, hp_threshold; @@ -2168,9 +2127,7 @@ struct monst *mtmp, *victim; } int -mongets(mtmp, otyp) -struct monst *mtmp; -int otyp; +mongets(struct monst *mtmp, int otyp) { register struct obj *otmp; int spe; @@ -2217,8 +2174,7 @@ int otyp; } int -golemhp(type) -int type; +golemhp(int type) { switch(type) { case PM_STRAW_GOLEM: return 20; @@ -2244,8 +2200,7 @@ int type; * ( some "animal" types are co-aligned, but also hungry ) */ boolean -peace_minded(ptr) -register struct permonst *ptr; +peace_minded(register struct permonst *ptr) { aligntyp mal = ptr->maligntyp, ual = u.ualign.type; @@ -2287,8 +2242,7 @@ register struct permonst *ptr; * it's never bad to kill a hostile monster, although it may not be good */ void -set_malign(mtmp) -struct monst *mtmp; +set_malign(struct monst *mtmp) { schar mal = mtmp->data->maligntyp; boolean coaligned; @@ -2339,8 +2293,7 @@ struct monst *mtmp; /* allocate a new mcorpsenm field for a monster; only need mextra itself */ void -newmcorpsenm(mtmp) -struct monst *mtmp; +newmcorpsenm(struct monst *mtmp) { if (!mtmp->mextra) { mtmp->mextra = newmextra(); @@ -2350,8 +2303,7 @@ struct monst *mtmp; /* release monster's mcorpsenm field; basically a no-op */ void -freemcorpsenm(mtmp) -struct monst *mtmp; +freemcorpsenm(struct monst *mtmp) { if (has_mcorpsenm(mtmp)) { MCORPSENM(mtmp) = NON_PM; @@ -2366,8 +2318,8 @@ static NEARDATA char syms[] = { }; void -set_mimic_sym(mtmp) /* KAA, modified by ERS */ -register struct monst *mtmp; +set_mimic_sym(register struct monst *mtmp) /* KAA, modified by ERS */ + { int typ, roomno, rt; unsigned appear, ap_type; @@ -2511,8 +2463,7 @@ register struct monst *mtmp; /* Release a monster from a bag of tricks or * produce an interesting effect ... nda 5/13/2003 */ int -bagotricks(bag) -struct obj *bag; +bagotricks(struct obj *bag) { if (!bag || bag->otyp != BAG_OF_TRICKS) { warning("bad bag o' tricks"); @@ -2641,9 +2592,7 @@ struct obj *bag; /** May create a camera demon emerging from camera around position x,y. */ void -create_camera_demon(camera, x, y) -struct obj *camera; -int x, y; +create_camera_demon(struct obj *camera, int x, int y) { struct monst *mtmp; diff --git a/src/mapglyph.c b/src/mapglyph.c index 6704b6797..0b1c6fcd3 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -62,8 +62,7 @@ int explcolors[] = { /** Returns the correct monster glyph. * Returns a Unicode codepoint in UTF8graphics and an ASCII character otherwise. */ glyph_t -get_monsym(glyph) -int glyph; +get_monsym(int glyph) { if (iflags.UTF8graphics && mons[glyph].unicode_codepoint) { @@ -77,8 +76,7 @@ int glyph; /** Returns the correct object glyph. * Returns a Unicode codepoint in UTF8graphics and an ASCII character otherwise. */ static glyph_t -get_objsym(glyph) -int glyph; +get_objsym(int glyph) { if (iflags.UTF8graphics && objects[glyph].unicode_codepoint) { @@ -91,11 +89,8 @@ int glyph; /*ARGSUSED*/ void -mapglyph(glyph, ochar, ocolor, ospecial, x, y, mgflags) -int glyph, *ocolor, x, y; -glyph_t *ochar; -unsigned *ospecial; -unsigned mgflags UNUSED; +mapglyph(int glyph, glyph_t *ochar, int *ocolor, unsigned int *ospecial, int x, int y, + unsigned int mgflags UNUSED) { register int offset; #if defined(TEXTCOLOR) || defined(ROGUE_COLOR) @@ -325,8 +320,7 @@ unsigned mgflags UNUSED; } char * -encglyph(glyph) -int glyph; +encglyph(int glyph) { static char encbuf[20]; /* 10+1 would suffice */ @@ -335,9 +329,7 @@ int glyph; } char * -decode_mixed(buf, str) -char *buf; -const char *str; +decode_mixed(char *buf, const char *str) { static const char hex[] = "00112233445566778899aAbBcCdDeEfF"; char *put = buf; @@ -438,10 +430,7 @@ const char *str; */ void -genl_putmixed(window, attr, str) -winid window; -int attr; -const char *str; +genl_putmixed(winid window, int attr, const char *str) { char buf[BUFSZ]; diff --git a/src/mcastu.c b/src/mcastu.c index 94072581b..62309d21e 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -48,7 +48,7 @@ enum mcast_cleric_spells { #define NUM_PUN_SPELLS 10 -static void cursetxt(struct monst *, BOOLEAN_P); +static void cursetxt(struct monst *, boolean); static int choose_magic_spell(int); static int choose_clerical_spell(int); static int choose_punisher_spell(void); @@ -64,9 +64,7 @@ extern const char * const flash_types[]; /* from zap.c */ /* feedback when frustrated monster couldn't cast a spell */ static void -cursetxt(mtmp, undirected) -struct monst *mtmp; -boolean undirected; +cursetxt(struct monst *mtmp, boolean undirected) { /* silent monsters don't curse. */ if (is_silent(mtmp->data)) return; @@ -97,8 +95,7 @@ boolean undirected; /* convert a level based random selection into a specific mage spell; inappropriate choices will be screened out by spell_would_be_useless() */ static int -choose_magic_spell(spellval) -int spellval; +choose_magic_spell(int spellval) { /* for 3.4.3 and earlier, val greater than 22 selected the default spell */ @@ -154,8 +151,7 @@ int spellval; /* convert a level based random selection into a specific cleric spell */ static int -choose_clerical_spell(spellnum) -int spellnum; +choose_clerical_spell(int spellnum) { /* for 3.4.3 and earlier, num greater than 13 selected the default spell */ while (spellnum > 15 && rn2(16)) { @@ -217,11 +213,7 @@ choose_punisher_spell(void) * 0: unsuccessful spell */ int -castmu(mtmp, mattk, thinks_it_foundyou, foundyou) -register struct monst *mtmp; -register struct attack *mattk; -boolean thinks_it_foundyou; -boolean foundyou; +castmu(register struct monst *mtmp, register struct attack *mattk, boolean thinks_it_foundyou, boolean foundyou) { int dmg, ml = mtmp->m_lev; int ret; @@ -388,9 +380,7 @@ boolean foundyou; } static int -m_cure_self(mtmp, dmg) -struct monst *mtmp; -int dmg; +m_cure_self(struct monst *mtmp, int dmg) { if (mtmp->mhp < mtmp->mhpmax) { if (canseemon(mtmp)) { @@ -415,10 +405,7 @@ int dmg; and spell_would_be_useless(). */ static void -cast_wizard_spell(mtmp, dmg, spellnum) -struct monst *mtmp; -int dmg; -int spellnum; +cast_wizard_spell(struct monst *mtmp, int dmg, int spellnum) { if (dmg == 0 && !is_undirected_spell(AD_SPEL, spellnum)) { warning("cast directed wizard spell (%d) with dmg=0?", spellnum); @@ -585,10 +572,7 @@ int spellnum; } static void -cast_punisher_spell(mtmp, dmg, spellnum) -struct monst* mtmp UNUSED; -int dmg UNUSED; -int spellnum; +cast_punisher_spell(struct monst *mtmp UNUSED, int dmg UNUSED, int spellnum) { switch(spellnum) { case PUN_PUNISHMENT: @@ -598,10 +582,7 @@ int spellnum; } static void -cast_cleric_spell(mtmp, dmg, spellnum) -struct monst *mtmp; -int dmg; -int spellnum; +cast_cleric_spell(struct monst *mtmp, int dmg, int spellnum) { if (dmg == 0 && !is_undirected_spell(AD_CLRC, spellnum)) { warning("cast directed cleric spell (%d) with dmg=0?", spellnum); @@ -810,10 +791,7 @@ int spellnum; } static void -map_punisher_spell(spellnum, padtyp, pspellnum) -int spellnum; -unsigned int* padtyp; -int* pspellnum; +map_punisher_spell(int spellnum, unsigned int *padtyp, int *pspellnum) { switch(spellnum) { case PUN_OPEN_WOUNDS: @@ -859,9 +837,7 @@ int* pspellnum; } static boolean -is_undirected_spell(adtyp, spellnum) -unsigned int adtyp; -int spellnum; +is_undirected_spell(unsigned int adtyp, int spellnum) { if (adtyp == AD_SPEL) { switch (spellnum) { @@ -900,10 +876,7 @@ int spellnum; /* Some spells are useless under some circumstances. */ static boolean -spell_would_be_useless(mtmp, adtyp, spellnum) -struct monst *mtmp; -unsigned int adtyp; -int spellnum; +spell_would_be_useless(struct monst *mtmp, unsigned int adtyp, int spellnum) { /* Some spells don't require the player to really be there and can be cast * by the monster when you're invisible, yet still shouldn't be cast when @@ -979,9 +952,7 @@ int spellnum; /* monster uses spell (ranged) */ int -buzzmu(mtmp, mattk) -register struct monst *mtmp; -register struct attack *mattk; +buzzmu(register struct monst *mtmp, register struct attack *mattk) { /* don't print constant stream of curse messages for 'normal' spellcasting monsters at range */ diff --git a/src/mhitm.c b/src/mhitm.c index 8b760e0ff..592961de8 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -24,7 +24,7 @@ static int defdisintagr(struct monst *, struct monst *, struct attack *); static void mswingsm(struct monst *, struct monst *, struct obj *); static void noises(struct monst *, struct attack *); static void missmm(struct monst *, struct monst *, struct attack *); -static int passivemm(struct monst *, struct monst *, BOOLEAN_P, int); +static int passivemm(struct monst *, struct monst *, boolean, int); /* Needed for the special case of monsters wielding vorpal blades (rare). * If we use this a lot it should probably be a parameter to mdamagem() @@ -33,9 +33,7 @@ static int passivemm(struct monst *, struct monst *, BOOLEAN_P, int); static int dieroll; static void -noises(magr, mattk) -register struct monst *magr; -register struct attack *mattk; +noises(register struct monst *magr, register struct attack *mattk) { boolean farq = (distu(magr->mx, magr->my) > 15); @@ -49,9 +47,7 @@ register struct attack *mattk; } static void -missmm(magr, mdef, mattk) -register struct monst *magr, *mdef; -struct attack *mattk; +missmm(register struct monst *magr, register struct monst *mdef, struct attack *mattk) { const char *fmt; char buf[BUFSZ], mdef_name[BUFSZ]; @@ -105,8 +101,7 @@ struct attack *mattk; */ /* have monsters fight each other */ int -fightm(mtmp) -register struct monst *mtmp; +fightm(register struct monst *mtmp) { register struct monst *mon, *nmon; int result, has_u_swallowed; @@ -177,9 +172,7 @@ register struct monst *mtmp; * returns same results as mattackm(). */ int -mdisplacem(magr, mdef, quietly) -register struct monst *magr, *mdef; -boolean quietly; +mdisplacem(register struct monst *magr, register struct monst *mdef, boolean quietly) { struct permonst *pa, *pd; int tx, ty, fx, fy; @@ -285,8 +278,7 @@ boolean quietly; * In the case of exploding monsters, the monster dies as well. */ int -mattackm(magr, mdef) -register struct monst *magr, *mdef; +mattackm(register struct monst *magr, register struct monst *mdef) { int i, /* loop counter */ tmp, /* amour class difference */ @@ -576,9 +568,7 @@ register struct monst *magr, *mdef; /* Returns the result of mdamagem(). */ static int -hitmm(magr, mdef, mattk) -register struct monst *magr, *mdef; -struct attack *mattk; +hitmm(register struct monst *magr, register struct monst *mdef, struct attack *mattk) { boolean weaponhit = ((mattk->aatyp == AT_WEAP || (mattk->aatyp == AT_CLAW && otmp))); boolean silverhit = (weaponhit && otmp && objects[otmp->otyp].oc_material == SILVER); @@ -697,9 +687,7 @@ struct attack *mattk; /* Returns the same values as mdamagem(). */ static int -gazemm(magr, mdef, mattk) -register struct monst *magr, *mdef; -struct attack *mattk; +gazemm(register struct monst *magr, register struct monst *mdef, struct attack *mattk) { char buf[BUFSZ]; @@ -762,8 +750,7 @@ struct attack *mattk; /* return True if magr is allowed to swallow mdef, False otherwise */ boolean -engulf_target(magr, mdef) -struct monst *magr, *mdef; +engulf_target(struct monst *magr, struct monst *mdef) { struct rm *lev; int dx, dy; @@ -797,9 +784,7 @@ struct monst *magr, *mdef; /* Returns the same values as mattackm(). */ static int -gulpmm(magr, mdef, mattk) -register struct monst *magr, *mdef; -register struct attack *mattk; +gulpmm(register struct monst *magr, register struct monst *mdef, register struct attack *mattk) { xchar ax, ay, dx, dy; int status; @@ -894,9 +879,7 @@ register struct attack *mattk; } static int -explmm(magr, mdef, mattk) -struct monst *magr, *mdef; -struct attack *mattk; +explmm(struct monst *magr, struct monst *mdef, struct attack *mattk) { int result; @@ -935,9 +918,7 @@ struct attack *mattk; #ifdef WEBB_DISINT static int -defdisintagr(magr, mdef, mattk) -register struct monst *magr, *mdef; -register struct attack *mattk; +defdisintagr(register struct monst *magr, register struct monst *mdef, register struct attack *mattk) { int tmp=-1; /* -1 a miss, -MM_AGR_DIED aggre died, @@ -1068,9 +1049,7 @@ register struct attack *mattk; * See comment at top of mattackm(), for return values. */ static int -mdamagem(magr, mdef, mattk) -register struct monst *magr, *mdef; -register struct attack *mattk; +mdamagem(register struct monst *magr, register struct monst *mdef, register struct attack *mattk) { struct obj *obj; char buf[BUFSZ]; @@ -1898,9 +1877,7 @@ post_stone: if (mdef->mhp > 0) return 0; } void -paralyze_monst(mon, amt) -struct monst *mon; -int amt; +paralyze_monst(struct monst *mon, int amt) { if (amt > 127) { amt = 127; @@ -1914,9 +1891,7 @@ int amt; /* `mon' is hit by a sleep attack; return 1 if it's affected, 0 otherwise */ int -sleep_monst(mon, amt, how) -struct monst *mon; -int amt, how; +sleep_monst(struct monst *mon, int amt, int how) { if (resists_sleep(mon) || (how >= 0 && resist(mon, (char)how, 0, NOTELL))) { @@ -1937,8 +1912,7 @@ int amt, how; /* sleeping grabber releases, engulfer doesn't; don't use for paralysis! */ void -slept_monst(mon) -struct monst *mon; +slept_monst(struct monst *mon) { if ((mon->msleeping || !mon->mcanmove) && mon == u.ustuck && !sticks(youmonst.data) && !u.uswallow) { @@ -1948,9 +1922,7 @@ struct monst *mon; } void -rustm(mdef, obj) -struct monst *mdef; -struct obj *obj; +rustm(struct monst *mdef, struct obj *obj) { int dmgtyp = -1, chance = 1; @@ -1975,9 +1947,7 @@ struct obj *obj; } static void -mswingsm(magr, mdef, otemp) -struct monst *magr, *mdef; -struct obj *otemp; +mswingsm(struct monst *magr, struct monst *mdef, struct obj *otemp) { if (flags.verbose && !Blind && mon_visible(magr)) { pline("%s %s %s%s %s at %s.", Monnam(magr), @@ -1992,10 +1962,7 @@ struct obj *otemp; * handled above. Returns same values as mattackm. */ static int -passivemm(magr, mdef, mhit, mdead) -register struct monst *magr, *mdef; -boolean mhit; -int mdead; +passivemm(register struct monst *magr, register struct monst *mdef, boolean mhit, int mdead) { register struct permonst *mddat = mdef->data; register struct permonst *madat = magr->data; @@ -2146,8 +2113,7 @@ int mdead; /* "aggressive defense"; what type of armor prevents specified attack from touching its target? */ long -attk_protection(aatyp) -int aatyp; +attk_protection(int aatyp) { long w_mask = 0L; @@ -2187,10 +2153,7 @@ int aatyp; } void -maybe_freeze_m(mdef, vis, pdmg) -struct monst* mdef; -int vis; -int* pdmg; +maybe_freeze_m(struct monst *mdef, int vis, int *pdmg) { if (flaming(mdef->data)) { pline("%s burns the ice away.", Monnam(mdef)); diff --git a/src/mhitu.c b/src/mhitu.c index 21a9072bb..fae7df321 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -17,24 +17,22 @@ static void mayberem(struct monst *, const char *, struct obj *, const char *); static boolean diseasemu(struct permonst *); static int hitmu(struct monst *, struct attack *); static int gulpmu(struct monst *, struct attack *); -static int explmu(struct monst *, struct attack *, BOOLEAN_P); -static void missmu(struct monst *, BOOLEAN_P, struct attack *); +static int explmu(struct monst *, struct attack *, boolean); +static void missmu(struct monst *, boolean, struct attack *); static void mswings(struct monst *, struct obj *); static void wildmiss(struct monst *, struct attack *); static int mon_scream(struct monst*, struct attack*); static void hitmsg(struct monst *, struct attack *); -static void invulnerability_messages(struct monst *, BOOLEAN_P, BOOLEAN_P); +static void invulnerability_messages(struct monst *, boolean, boolean); /* See comment in mhitm.c. If we use this a lot it probably should be */ /* changed to a parameter to mhitu. */ static int dieroll; static void -hitmsg(mtmp, mattk) -struct monst *mtmp; -struct attack *mattk; +hitmsg(struct monst *mtmp, struct attack *mattk) { int compat; @@ -85,10 +83,7 @@ struct attack *mattk; /* monster missed you */ static void -missmu(mtmp, nearmiss, mattk) -struct monst *mtmp; -boolean nearmiss; -struct attack *mattk; +missmu(struct monst *mtmp, boolean nearmiss, struct attack *mattk) { if (!canspotmon(mtmp)) map_invisible(mtmp->mx, mtmp->my); @@ -105,9 +100,9 @@ struct attack *mattk; } static void -mswings(mtmp, otemp) /* monster swings obj */ -register struct monst *mtmp; -register struct obj *otemp; +mswings(register struct monst *mtmp, register struct obj *otemp) /* monster swings obj */ + + { if (!flags.verbose || Blind || !mon_visible(mtmp)) return; @@ -118,9 +113,7 @@ register struct obj *otemp; /* return how a poison attack was delivered */ const char * -mpoisons_subj(mtmp, mattk) -struct monst *mtmp; -struct attack *mattk; +mpoisons_subj(struct monst *mtmp, struct attack *mattk) { if (mattk->aatyp == AT_WEAP) { struct obj *mwep = (mtmp == &youmonst) ? uwep : MON_WEP(mtmp); @@ -136,7 +129,7 @@ struct attack *mattk; /* called when your intrinsic speed is taken away */ void -u_slow_down() +u_slow_down(void) { HFast = 0L; if (!Fast) @@ -147,9 +140,9 @@ u_slow_down() } static void -wildmiss(mtmp, mattk) /* monster attacked your displaced image */ -register struct monst *mtmp; -register struct attack *mattk; +wildmiss(register struct monst *mtmp, register struct attack *mattk) /* monster attacked your displaced image */ + + { int compat; @@ -220,10 +213,10 @@ register struct attack *mattk; } void -expels(mtmp, mdat, message) -struct monst *mtmp; -struct permonst *mdat; /* if mtmp is polymorphed, mdat != mtmp->data */ -boolean message; +expels(struct monst *mtmp, struct permonst *mdat, boolean message) + + /* if mtmp is polymorphed, mdat != mtmp->data */ + { if (message) { if (is_animal(mdat)) @@ -266,11 +259,7 @@ boolean message; /* select a monster's next attack, possibly substituting for its usual one */ struct attack * -getmattk(magr, mdef, indx, prev_result, alt_attk_buf) -struct monst *magr; -struct monst *mdef UNUSED; -int indx, prev_result[]; -struct attack *alt_attk_buf; +getmattk(struct monst *magr, struct monst *mdef, int indx, int *prev_result, struct attack *alt_attk_buf) { struct permonst *mptr = magr->data; struct attack *attk = &mptr->mattk[indx]; @@ -375,8 +364,7 @@ struct attack *alt_attk_buf; * take care of it... */ int -mattacku(mtmp) -register struct monst *mtmp; +mattacku(register struct monst *mtmp) { struct attack *mattk, alt_attk; int i, j=0, tmp, sum[NATTK]; @@ -838,8 +826,7 @@ register struct monst *mtmp; } static boolean -diseasemu(mdat) -struct permonst *mdat; +diseasemu(struct permonst *mdat) { if (Sick_resistance) { You_feel("a slight illness."); @@ -853,9 +840,7 @@ struct permonst *mdat; /* check whether slippery clothing protects from hug or wrap attack */ static boolean -u_slip_free(mtmp, mattk) -struct monst *mtmp; -struct attack *mattk; +u_slip_free(struct monst *mtmp, struct attack *mattk) { struct obj *obj = (uarmc ? uarmc : uarm); @@ -888,8 +873,7 @@ struct attack *mattk; /* armor that sufficiently covers the body might be able to block magic */ int -magic_negation(mon) -struct monst *mon; +magic_negation(struct monst *mon) { struct obj *armor; int armpro = 0; @@ -934,9 +918,7 @@ struct monst *mon; * attacking you */ static int -hitmu(mtmp, mattk) -register struct monst *mtmp; -register struct attack *mattk; +hitmu(register struct monst *mtmp, register struct attack *mattk) { struct permonst *mdat = mtmp->data; int uncancelled, ptmp; @@ -1944,7 +1926,7 @@ register struct attack *mattk; * to see if an engulfing attack should immediately take affect, like * a passive attack. TRUE if engulfing blindness occurred */ boolean -gulp_blnd_check() +gulp_blnd_check(void) { struct attack *mattk; @@ -1961,9 +1943,7 @@ gulp_blnd_check() /* monster swallows you, or damage if u.uswallow */ static int -gulpmu(mtmp, mattk) -struct monst *mtmp; -struct attack *mattk; +gulpmu(struct monst *mtmp, struct attack *mattk) { struct trap *t = t_at(u.ux, u.uy); int tmp = d((int)mattk->damn, (int)mattk->damd); @@ -2257,10 +2237,7 @@ struct attack *mattk; /* monster explodes in your face */ static int -explmu(mtmp, mattk, ufound) -struct monst *mtmp; -struct attack *mattk; -boolean ufound; +explmu(struct monst *mtmp, struct attack *mattk, boolean ufound) { boolean physical_damage = TRUE, kill_agr = TRUE; @@ -2363,9 +2340,7 @@ boolean ufound; /* monster gazes at you */ int -gazemu(mtmp, mattk) -struct monst *mtmp; -struct attack *mattk; +gazemu(struct monst *mtmp, struct attack *mattk) { static const char *const reactions[] = { "confused", /* [0] */ @@ -2652,9 +2627,7 @@ struct attack *mattk; /* mtmp hits you for n points damage */ void -mdamageu(mtmp, n) -struct monst *mtmp; -int n; +mdamageu(struct monst *mtmp, int n) { showdmg(n, TRUE); flags.botl = 1; @@ -2672,9 +2645,10 @@ int n; * 2 if wrong gender for nymph */ int -could_seduce(magr, mdef, mattk) -struct monst *magr, *mdef; -struct attack *mattk; /* non NULL: current attack; NULL: general capability */ +could_seduce( + struct monst *magr, + struct monst *mdef, + struct attack *mattk) /**< non NULL: current attack; NULL: general capability */ { struct permonst *pagr; boolean agrinvis, defperc; @@ -2727,8 +2701,7 @@ struct attack *mattk; /* non NULL: current attack; NULL: general capability */ #ifdef SEDUCE /* returns 1 if monster teleported (or hero leaves monster's vicinity) */ int -doseduce(mon) -struct monst *mon; +doseduce(struct monst *mon) { struct obj *ring, *nring; boolean fem = (mon->data == &mons[PM_SUCCUBUS]); /* otherwise incubus */ @@ -3035,8 +3008,7 @@ struct monst *mon; #endif /* SEDUCE */ void -maybe_freeze_u(pdmg) -int* pdmg; +maybe_freeze_u(int *pdmg) { if (Levitation || Flying) { if (pdmg) (*pdmg) = 0; @@ -3074,11 +3046,11 @@ int* pdmg; #ifdef SEDUCE static void -mayberem(mon, seducer, obj, str) -struct monst *mon; -const char *seducer; /* only used for alternate message */ -struct obj *obj; -const char *str; +mayberem(struct monst *mon, const char *seducer, struct obj *obj, const char *str) + + /* only used for alternate message */ + + { char qbuf[QBUFSZ]; @@ -3116,9 +3088,7 @@ const char *str; #endif /* SEDUCE */ static int -mon_scream(mtmp, mattk) -struct monst* mtmp; -struct attack* mattk; +mon_scream(struct monst *mtmp, struct attack *mattk) { int effect = 0; int dmg = d(mattk->damn, mattk->damd); @@ -3166,10 +3136,7 @@ struct attack* mattk; * damage applies. */ static int -passiveum(olduasmon, mtmp, mattk) -struct permonst *olduasmon; -struct monst *mtmp; -struct attack *mattk; +passiveum(struct permonst *olduasmon, struct monst *mtmp, struct attack *mattk) { int i, tmp; struct attack *oldu_mattk = 0; @@ -3359,10 +3326,7 @@ struct attack *mattk; } static void -invulnerability_messages(mtmp, range2, youseeit) -struct monst *mtmp; -boolean range2; -boolean youseeit; +invulnerability_messages(struct monst *mtmp, boolean range2, boolean youseeit) { /* monsters won't attack you */ if(mtmp == u.ustuck) @@ -3377,7 +3341,7 @@ boolean youseeit; } struct monst * -cloneu() +cloneu(void) { struct monst *mon; int mndx = monsndx(youmonst.data); diff --git a/src/minion.c b/src/minion.c index bd51f0537..0ad99a712 100644 --- a/src/minion.c +++ b/src/minion.c @@ -4,8 +4,7 @@ #include "hack.h" void -newemin(mtmp) -struct monst *mtmp; +newemin(struct monst *mtmp) { if (!mtmp->mextra) mtmp->mextra = newmextra(); @@ -16,8 +15,7 @@ struct monst *mtmp; } void -free_emin(mtmp) -struct monst *mtmp; +free_emin(struct monst *mtmp) { if (mtmp->mextra && EMIN(mtmp)) { free((genericptr_t) EMIN(mtmp)); @@ -28,8 +26,7 @@ struct monst *mtmp; /* count the number of monsters on the level */ int -monster_census(spotted) -boolean spotted; /* seen|sensed vs all */ +monster_census(boolean spotted) /**< seen|sensed vs all */ { struct monst *mtmp; int count = 0; @@ -46,8 +43,7 @@ boolean spotted; /* seen|sensed vs all */ /* mon summons a monster */ int -msummon(mon) -struct monst *mon; +msummon(struct monst *mon) { struct permonst *ptr; int dtype = NON_PM, cnt = 0, result = 0, census; @@ -157,9 +153,7 @@ struct monst *mon; } void -summon_minion(alignment, talk) -aligntyp alignment; -boolean talk; +summon_minion(aligntyp alignment, boolean talk) { register struct monst *mon; int mnum; @@ -233,8 +227,7 @@ boolean talk; /* returns 1 if it won't attack. */ int -demon_talk(mtmp) -register struct monst *mtmp; +demon_talk(register struct monst *mtmp) { long cash, demand, offer; @@ -342,8 +335,7 @@ register struct monst *mtmp; } long -bribe(mtmp) -struct monst *mtmp; +bribe(struct monst *mtmp) { char buf[BUFSZ] = DUMMY; long offer; @@ -376,8 +368,7 @@ struct monst *mtmp; } int -dprince(atyp) -aligntyp atyp; +dprince(aligntyp atyp) { int tryct, pm; @@ -391,8 +382,7 @@ aligntyp atyp; } int -dlord(atyp) -aligntyp atyp; +dlord(aligntyp atyp) { int tryct, pm; @@ -407,7 +397,7 @@ aligntyp atyp; /* create lawful (good) lord */ int -llord() +llord(void) { if (!(mvitals[PM_ARCHON].mvflags & G_GONE)) return(PM_ARCHON); @@ -416,7 +406,7 @@ llord() } int -lminion() +lminion(void) { int tryct; struct permonst *ptr; @@ -431,8 +421,7 @@ lminion() } int -ndemon(atyp) -aligntyp atyp; /* A_NONE is used for 'any alignment' */ +ndemon(aligntyp atyp) /**< A_NONE is used for 'any alignment' */ { struct permonst *ptr; @@ -457,8 +446,7 @@ aligntyp atyp; /* A_NONE is used for 'any alignment' */ /* guardian angel has been affected by conflict so is abandoning hero */ void -lose_guardian_angel(mon) -struct monst *mon; /* if null, angel hasn't been created yet */ +lose_guardian_angel(struct monst *mon) /**< if null, angel hasn't been created yet */ { coord mm; int i; @@ -486,7 +474,7 @@ struct monst *mon; /* if null, angel hasn't been created yet */ /* just entered the Astral Plane; receive tame guardian angel if worthy */ void -gain_guardian_angel() +gain_guardian_angel(void) { struct monst *mtmp; struct obj *otmp; diff --git a/src/mklev.c b/src/mklev.c index 71902a70e..a5436f6bc 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -25,27 +25,27 @@ static void mksink(struct mkroom *); #endif static void mkaltar(struct mkroom *); static void mkgrave(struct mkroom *); -static void makevtele(); -static void clear_level_structures(); -static void makelevel(); +static void makevtele(void); +static void clear_level_structures(void); +static void makelevel(void); static struct mkroom *find_branch_room(coord *); -static struct mkroom *pos_to_room(XCHAR_P, XCHAR_P); +static struct mkroom *pos_to_room(xchar, xchar); static boolean place_niche(struct mkroom *, int*, int*, int*); static void makeniche(int); -static void make_niches(); +static void make_niches(void); static int CFDECLSPEC do_comp(const genericptr, const genericptr); -static void dosdoor(XCHAR_P, XCHAR_P, struct mkroom *, int); -static void join(int, int, BOOLEAN_P); +static void dosdoor(xchar, xchar, struct mkroom *, int); +static void join(int, int, boolean); static void do_room_or_subroom(struct mkroom *, int, int, int, int, - BOOLEAN_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P); -static void makerooms(); -static void finddpos(coord *, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); -static void mkinvpos(XCHAR_P, XCHAR_P, int); -static void mk_knox_portal(XCHAR_P, XCHAR_P); + boolean, schar, boolean, boolean); +static void makerooms(void); +static void finddpos(coord *, xchar, xchar, xchar, xchar); +static void mkinvpos(xchar, xchar, int); +static void mk_knox_portal(xchar, xchar); -static void place_random_engravings(); +static void place_random_engravings(void); #define create_vault() create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE) #define init_vault() vault_x = -1 @@ -57,9 +57,7 @@ static boolean made_branch; /* used only during level creation */ /* Args must be (const genericptr) so that qsort will always be happy. */ static int CFDECLSPEC -do_comp(vx, vy) -const genericptr vx; -const genericptr vy; +do_comp(const void *vx, const void *vy) { #ifdef LINT /* lint complains about possible pointer alignment problems, but we know @@ -78,9 +76,7 @@ const genericptr vy; } static void -finddpos(cc, xl, yl, xh, yh) -coord *cc; -xchar xl, yl, xh, yh; +finddpos(coord *cc, xchar xl, xchar yl, xchar xh, xchar yh) { register xchar x, y; @@ -106,7 +102,7 @@ xchar xl, yl, xh, yh; } void -sort_rooms() +sort_rooms(void) { #if defined(SYSV) || defined(DGUX) qsort((genericptr_t) rooms, (unsigned)nroom, sizeof(struct mkroom), do_comp); @@ -116,14 +112,7 @@ sort_rooms() } static void -do_room_or_subroom(croom, lowx, lowy, hix, hiy, lit, rtype, special, is_room) -register struct mkroom *croom; -int lowx, lowy; -register int hix, hiy; -boolean lit; -schar rtype; -boolean special; -boolean is_room; +do_room_or_subroom(register struct mkroom *croom, int lowx, int lowy, register int hix, register int hiy, boolean lit, schar rtype, boolean special, boolean is_room) { register int x, y; struct rm *lev; @@ -190,11 +179,7 @@ boolean is_room; void -add_room(lowx, lowy, hix, hiy, lit, rtype, special) -register int lowx, lowy, hix, hiy; -boolean lit; -schar rtype; -boolean special; +add_room(register int lowx, register int lowy, register int hix, register int hiy, boolean lit, schar rtype, boolean special) { register struct mkroom *croom; @@ -207,12 +192,7 @@ boolean special; } void -add_subroom(proom, lowx, lowy, hix, hiy, lit, rtype, special) -struct mkroom *proom; -register int lowx, lowy, hix, hiy; -boolean lit; -schar rtype; -boolean special; +add_subroom(struct mkroom *proom, register int lowx, register int lowy, register int hix, register int hiy, boolean lit, schar rtype, boolean special) { register struct mkroom *croom; @@ -238,7 +218,7 @@ struct _rndvault_gen { struct _rndvault_gen *rndvault_gen = NULL; void -rndvault_gen_load() +rndvault_gen_load(void) { if (!rndvault_gen) { dlb *fd; @@ -276,7 +256,7 @@ rndvault_gen_load() } char * -rndvault_getname() +rndvault_getname(void) { if (!rndvault_gen) rndvault_gen_load(); if (rndvault_gen) { @@ -290,7 +270,7 @@ rndvault_getname() } static void -makerooms() +makerooms(void) { boolean tried_vault = FALSE; @@ -325,9 +305,7 @@ makerooms() } static void -join(a, b, nxcor) -register int a, b; -boolean nxcor; +join(register int a, register int b, boolean nxcor) { coord cc, tt, org, dest; register xchar tx, ty, xx, yy; @@ -399,8 +377,7 @@ boolean nxcor; } void -makecorridors(style) -int style; +makecorridors(int style) { int a, b, i; boolean any = TRUE; @@ -479,9 +456,7 @@ int style; } void -add_door(x, y, aroom) -register int x, y; -register struct mkroom *aroom; +add_door(register int x, register int y, register struct mkroom *aroom) { register struct mkroom *broom; register int tmp; @@ -500,10 +475,7 @@ register struct mkroom *aroom; } static void -dosdoor(x, y, aroom, type) -register xchar x, y; -register struct mkroom *aroom; -register int type; +dosdoor(register xchar x, register xchar y, register struct mkroom *aroom, register int type) { boolean shdoor = ((*in_rooms(x, y, SHOPBASE)) ? TRUE : FALSE); @@ -558,9 +530,7 @@ register int type; } static boolean -place_niche(aroom, dy, xx, yy) -register struct mkroom *aroom; -int *dy, *xx, *yy; +place_niche(register struct mkroom *aroom, int *dy, int *xx, int *yy) { coord dd; @@ -617,8 +587,7 @@ static const char * const hhgtg_engravings[] = { }; static void -makeniche(trap_type) -int trap_type; +makeniche(int trap_type) { register struct mkroom *aroom; register struct rm *rm; @@ -681,8 +650,7 @@ int trap_type; iff there's no door next to the place, and there's space on the other side of the wall */ void -make_ironbarwalls(chance) -int chance; +make_ironbarwalls(int chance) { xchar x, y; @@ -710,7 +678,7 @@ int chance; static void -make_niches() +make_niches(void) { register int ct = rnd((nroom>>1) + 1), dep = depth(&u.uz); @@ -729,7 +697,7 @@ make_niches() } static void -makevtele() +makevtele(void) { makeniche(TELEP_TRAP); } @@ -740,7 +708,7 @@ makevtele() * each type initializes what it needs to separately. */ static void -clear_level_structures() +clear_level_structures(void) { static struct rm zerorm = { cmap_to_glyph(S_stone), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int x, y; @@ -816,7 +784,7 @@ mk_knox_vault(int x, int y, int w, int h) } static void -makelevel() +makelevel(void) { register struct mkroom *croom, *troom; register int tryct; @@ -1094,9 +1062,7 @@ makelevel() * mineralize(-1, -1, -1, -1, 0); => "default" behaviour */ void -mineralize(kelp_pool, kelp_moat, goldprob, gemprob, skip_lvl_checks) -int kelp_pool, kelp_moat, goldprob, gemprob; -boolean skip_lvl_checks; +mineralize(int kelp_pool, int kelp_moat, int goldprob, int gemprob, boolean skip_lvl_checks) { s_level *sp; struct obj *otmp; @@ -1181,10 +1147,7 @@ boolean skip_lvl_checks; void -wallwalk_right(x, y, fgtyp, fglit, bgtyp, chance) -xchar x, y; -schar fgtyp, fglit, bgtyp; -int chance; +wallwalk_right(xchar x, xchar y, schar fgtyp, schar fglit, schar bgtyp, int chance) { int sx, sy, nx, ny, dir, cnt; schar tmptyp; @@ -1225,7 +1188,7 @@ int chance; void -mkpoolroom() +mkpoolroom(void) { struct mkroom *sroom; schar typ; @@ -1241,7 +1204,7 @@ mkpoolroom() } static void -place_axe() +place_axe(void) { /* add a random axe to a level with trees */ int trees = 0, x, y; @@ -1275,14 +1238,14 @@ place_axe() } static void -post_process_level() +post_process_level(void) { place_random_engravings(); place_axe(); } void -mklev() +mklev(void) { struct mkroom *croom; @@ -1331,8 +1294,8 @@ topologize(croom, do_ordinary) register struct mkroom *croom; boolean do_ordinary; #else -topologize(croom) -register struct mkroom *croom; +topologize(register struct mkroom *croom) + #endif { register int x, y, roomno = (croom - rooms) + ROOMOFFSET; @@ -1394,8 +1357,7 @@ register struct mkroom *croom; /* Find an unused room for a branch location. */ static struct mkroom * -find_branch_room(mp) -coord *mp; +find_branch_room(coord *mp) { struct mkroom *croom = 0; @@ -1425,8 +1387,7 @@ coord *mp; /* Find the room for (x,y). Return null if not in a room. */ static struct mkroom * -pos_to_room(x, y) -xchar x, y; +pos_to_room(xchar x, xchar y) { int i; struct mkroom *curr; @@ -1439,9 +1400,9 @@ xchar x, y; /* If given a branch, randomly place a special stair or portal. */ void -place_branch(br, x, y) -branch *br; /* branch to place */ -xchar x, y; /* location */ +place_branch( + branch *br, /**< branch to place */ + xchar x, xchar y) /**< location */ { coord m; d_level *dest; @@ -1497,8 +1458,7 @@ xchar x, y; /* location */ } boolean -bydoor(x, y) -register xchar x, y; +bydoor(register xchar x, register xchar y) { register int typ; @@ -1523,8 +1483,7 @@ register xchar x, y; /* see whether it is allowable to create a door at [x,y] */ int -okdoor(x, y) -register xchar x, y; +okdoor(register xchar x, register xchar y) { register boolean near_door = bydoor(x, y); @@ -1533,9 +1492,7 @@ register xchar x, y; } void -dodoor(x, y, aroom) -register int x, y; -register struct mkroom *aroom; +dodoor(register int x, register int y, register struct mkroom *aroom) { if(doorindex >= DOORMAX) { impossible("DOORMAX exceeded?"); @@ -1546,8 +1503,7 @@ register struct mkroom *aroom; } boolean -occupied(x, y) -register xchar x, y; +occupied(register xchar x, register xchar y) { return((boolean)(t_at(x, y) || IS_FURNITURE(levl[x][y].typ) @@ -1560,10 +1516,7 @@ register xchar x, y; /* make a trap somewhere (in croom if mazeflag = 0 && !tm) */ /* if tm != null, make trap at that location */ void -mktrap(num, mazeflag, croom, tm) -register int num, mazeflag; -register struct mkroom *croom; -coord *tm; +mktrap(register int num, register int mazeflag, register struct mkroom *croom, coord *tm) { int kind; coord m; @@ -1687,10 +1640,7 @@ coord *tm; } void -mkstairs(x, y, up, croom) -xchar x, y; -char up; -struct mkroom *croom; +mkstairs(xchar x, xchar y, char up, struct mkroom *croom) { if (!x) { impossible("mkstairs: bogus stair attempt at <%d,%d>", x, y); @@ -1721,9 +1671,7 @@ struct mkroom *croom; } static void -mkfount(mazeflag, croom) -register int mazeflag; -register struct mkroom *croom; +mkfount(register int mazeflag, register struct mkroom *croom) { coord m; @@ -1742,8 +1690,7 @@ register struct mkroom *croom; #ifdef SINKS static void -mksink(croom) -register struct mkroom *croom; +mksink(register struct mkroom *croom) { coord m; @@ -1759,8 +1706,7 @@ register struct mkroom *croom; static void -mkaltar(croom) -register struct mkroom *croom; +mkaltar(register struct mkroom *croom) { coord m; aligntyp al; @@ -1779,8 +1725,7 @@ register struct mkroom *croom; } static void -mkgrave(croom) -struct mkroom *croom; +mkgrave(struct mkroom *croom) { coord m; register int tryct = 0; @@ -1833,7 +1778,7 @@ struct mkroom *croom; * to read the Book of the Dead. */ void -mkinvokearea() +mkinvokearea(void) { int dist; xchar xmin = inv_pos.x, xmax = inv_pos.x; @@ -1885,9 +1830,7 @@ mkinvokearea() * Temporarily overrides vision in the name of a nice effect. */ static void -mkinvpos(x, y, dist) -xchar x, y; -int dist; +mkinvpos(xchar x, xchar y, int dist) { struct trap *ttmp; struct obj *otmp; @@ -1991,8 +1934,7 @@ get_floating_branch(d_level *target, branch *br) * Ludios will remain isolated until the branch is corrected by this function. */ static void -mk_knox_portal(x, y) -xchar x, y; +mk_knox_portal(xchar x, xchar y) { extern int n_dgns; /* from dungeon.c */ d_level *source; @@ -2028,9 +1970,10 @@ xchar x, y; * a random room on the current level. */ void -place_random_engraving(engravings, size) -const char * const engravings[]; -const int size; /* number of engravings in array */ +place_random_engraving( + const char *const *engravings, + const int size /* number of engravings in array */ +) { struct mkroom *some_room; xchar sx, sy; @@ -2065,7 +2008,7 @@ const int size; /* number of engravings in array */ * Places dungeon level dependent engravings on the current level. */ void -place_random_engravings() +place_random_engravings(void) { switch (depth(&u.uz)) { case 23: place_random_engraving(illuminati_engravings, SIZE(illuminati_engravings)); break; @@ -2081,7 +2024,7 @@ place_random_engravings() * right time of the year. */ boolean -mk_advcal_portal() +mk_advcal_portal(void) { extern int n_dgns; /* from dungeon.c */ d_level *source; diff --git a/src/mkmap.c b/src/mkmap.c index 919701658..c249494ab 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -8,17 +8,17 @@ #define HEIGHT (ROWNO - 1) #define WIDTH (COLNO - 2) -static void init_map(SCHAR_P); -static void init_fill(SCHAR_P, SCHAR_P); -static schar get_map(int, int, SCHAR_P); -static void pass_one(SCHAR_P, SCHAR_P); -static void pass_two(SCHAR_P, SCHAR_P); -static void pass_three(SCHAR_P, SCHAR_P); -static void wallify_map(); -static void join_map(SCHAR_P, SCHAR_P); -static void finish_map(SCHAR_P, SCHAR_P, XCHAR_P, XCHAR_P); +static void init_map(schar); +static void init_fill(schar, schar); +static schar get_map(int, int, schar); +static void pass_one(schar, schar); +static void pass_two(schar, schar); +static void pass_three(schar, schar); +static void wallify_map(void); +static void join_map(schar, schar); +static void finish_map(schar, schar, xchar, xchar); static void remove_room(unsigned); -static void backfill(SCHAR_P, SCHAR_P); +static void backfill(schar, schar); void mkmap(lev_init *); char *new_locations; @@ -26,8 +26,7 @@ int min_rx, max_rx, min_ry, max_ry; /* rectangle bounds for regions */ static int n_loc_filled; static void -init_map(bg_typ) -schar bg_typ; +init_map(schar bg_typ) { register int i, j; @@ -42,8 +41,7 @@ schar bg_typ; static void -backfill(bg_typ, filler) -schar bg_typ, filler; +backfill(schar bg_typ, schar filler) { int x, y; @@ -64,8 +62,7 @@ schar bg_typ, filler; static void -init_fill(bg_typ, fg_typ) -schar bg_typ, fg_typ; +init_fill(schar bg_typ, schar fg_typ) { register int i, j; long limit, count; @@ -85,9 +82,7 @@ schar bg_typ, fg_typ; } static schar -get_map(col, row, bg_typ) -int col, row; -schar bg_typ; +get_map(int col, int row, schar bg_typ) { if (col <= 0 || row < 0 || col > WIDTH || row >= HEIGHT) return bg_typ; @@ -101,8 +96,7 @@ static int dirs[16] = { }; static void -pass_one(bg_typ, fg_typ) -schar bg_typ, fg_typ; +pass_one(schar bg_typ, schar fg_typ) { register int i, j; short count, dr; @@ -137,8 +131,7 @@ schar bg_typ, fg_typ; #define new_loc(i, j) *(new_locations+ ((j)*(WIDTH+1)) + (i)) static void -pass_two(bg_typ, fg_typ) -schar bg_typ, fg_typ; +pass_two(schar bg_typ, schar fg_typ) { register int i, j; short count, dr; @@ -162,8 +155,7 @@ schar bg_typ, fg_typ; } static void -pass_three(bg_typ, fg_typ) -schar bg_typ, fg_typ; +pass_three(schar bg_typ, schar fg_typ) { register int i, j; short count, dr; @@ -187,10 +179,7 @@ schar bg_typ, fg_typ; } boolean -check_flood_anyroom(x, y, fg_typ, anyroom) -int x, y; -schar fg_typ; -boolean anyroom; +check_flood_anyroom(int x, int y, schar fg_typ, boolean anyroom) { if (!isok(x, y)) return FALSE; return (anyroom ? IS_ROOM(levl[x][y].typ) : levl[x][y].typ == fg_typ); @@ -203,12 +192,7 @@ boolean anyroom; * exactly matching levl[sx][sy].typ and walls are included as well. */ void -flood_fill_rm(sx, sy, rmno, lit, anyroom) -int sx; -register int sy; -register int rmno; -boolean lit; -boolean anyroom; +flood_fill_rm(int sx, register int sy, register int rmno, boolean lit, boolean anyroom) { register int i; int nx; @@ -292,7 +276,7 @@ boolean anyroom; * auto-magically wallify it. Taken from lev_main.c. */ static void -wallify_map() +wallify_map(void) { int x, y, xx, yy; @@ -310,8 +294,7 @@ wallify_map() } static void -join_map(bg_typ, fg_typ) -schar bg_typ, fg_typ; +join_map(schar bg_typ, schar fg_typ) { register struct mkroom *croom, *croom2; @@ -381,9 +364,7 @@ schar bg_typ, fg_typ; } static void -finish_map(fg_typ, bg_typ, lit, walled) -schar fg_typ, bg_typ; -boolean lit, walled; +finish_map(schar fg_typ, schar bg_typ, boolean lit, boolean walled) { int i, j; @@ -417,8 +398,7 @@ boolean lit, walled; * region are all set. */ void -remove_rooms(lx, ly, hx, hy) -int lx, ly, hx, hy; +remove_rooms(int lx, int ly, int hx, int hy) { int i; struct mkroom *croom; @@ -447,8 +427,7 @@ int lx, ly, hx, hy; * Currently handles only the removal of rooms that have no subrooms. */ static void -remove_room(roomno) -unsigned roomno; +remove_room(unsigned int roomno) { struct mkroom *croom = &rooms[roomno]; struct mkroom *maxroom = &rooms[--nroom]; @@ -480,8 +459,7 @@ unsigned roomno; #define N_P3_ITER 2 /* tune map smoothing via this value */ void -mkmap(init_lev) -lev_init *init_lev; +mkmap(lev_init *init_lev) { schar bg_typ = init_lev->bg, fg_typ = init_lev->fg; diff --git a/src/mkmaze.c b/src/mkmaze.c index 5cc93b77d..6c6f6a205 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -18,16 +18,16 @@ static boolean is_solid(int, int); static int extend_spine(int [3][3], int, int, int); static boolean okay(int, int, int); static void maze0xy(coord *); -static boolean put_lregion_here(XCHAR_P, XCHAR_P, XCHAR_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, BOOLEAN_P, d_level *, XCHAR_P); +static boolean put_lregion_here(xchar, xchar, xchar, + xchar, xchar, xchar, xchar, boolean, d_level *, xchar); static void move(int *, int *, int); -static void setup_waterlevel(); -static void unsetup_waterlevel(); +static void setup_waterlevel(void); +static void unsetup_waterlevel(void); static void check_ransacked(char *); static void migr_booty_item(int, const char *); static void migrate_orc(struct monst *, unsigned long); -static void stolen_booty(); +static void stolen_booty(void); /* adjust a coordinate one step in the specified direction */ #define mz_move(X, Y, dir) \ @@ -42,8 +42,7 @@ static void stolen_booty(); } while (0) static int -iswall(x, y) -int x, y; +iswall(int x, int y) { int type; @@ -56,8 +55,7 @@ int x, y; } static int -iswall_or_stone(x, y) -int x, y; +iswall_or_stone(int x, int y) { /* out of bounds = stone */ if (!isok(x, y)) { @@ -69,8 +67,7 @@ int x, y; /* return TRUE if out of bounds, wall or rock */ static boolean -is_solid(x, y) -int x, y; +is_solid(int x, int y) { return (!isok(x, y) || IS_STWALL(levl[x][y].typ)); } @@ -94,9 +91,7 @@ int x, y; * . W W */ static int -extend_spine(locale, wall_there, dx, dy) -int locale[3][3]; -int wall_there, dx, dy; +extend_spine(int (*locale)[3], int wall_there, int dx, int dy) { int spine, nx, ny; @@ -133,8 +128,7 @@ int wall_there, dx, dy; * the types so that they extend and connect to each other. */ void -wallification(x1, y1, x2, y2) -int x1, y1, x2, y2; +wallification(int x1, int y1, int x2, int y2) { uchar type; int x, y; @@ -167,8 +161,7 @@ int x1, y1, x2, y2; } void -wall_extends(x1, y1, x2, y2) -int x1, y1, x2, y2; +wall_extends(int x1, int y1, int x2, int y2) { uchar type; int x, y; @@ -224,9 +217,7 @@ int x1, y1, x2, y2; } static boolean -okay(x, y, dir) -int x, y; -int dir; +okay(int x, int y, int dir) { move(&x, &y, dir); move(&x, &y, dir); @@ -238,8 +229,7 @@ int dir; /* find random starting point for maze generation */ static void -maze0xy(cc) -coord *cc; +maze0xy(coord *cc) { cc->x = 3 + 2*rn2((x_maze_max>>1) - 1); cc->y = 3 + 2*rn2((y_maze_max>>1) - 1); @@ -247,10 +237,7 @@ coord *cc; } boolean -bad_location(x, y, lx, ly, hx, hy, lax) -xchar x, y; -xchar lx, ly, hx, hy; -xchar lax; +bad_location(xchar x, xchar y, xchar lx, xchar ly, xchar hx, xchar hy, xchar lax) { return((boolean)(t_at(x, y) || invocation_pos(x, y) || within_bounded_area(x, y, lx, ly, hx, hy) || @@ -272,11 +259,7 @@ xchar lax; * * Returns TRUE if it could place the location. */ int -place_lregion(lx, ly, hx, hy, nlx, nly, nhx, nhy, rtype, lev) -xchar lx, ly, hx, hy; -xchar nlx, nly, nhx, nhy; -xchar rtype; -d_level *lev; +place_lregion(xchar lx, xchar ly, xchar hx, xchar hy, xchar nlx, xchar nly, xchar nhx, xchar nhy, xchar rtype, d_level *lev) { int trycnt; boolean oneshot; @@ -321,13 +304,7 @@ d_level *lev; } static boolean -put_lregion_here(x, y, nlx, nly, nhx, nhy, rtype, oneshot, lev, lax) -xchar x, y; -xchar nlx, nly, nhx, nhy; -xchar rtype; -boolean oneshot; -d_level *lev; -xchar lax; +put_lregion_here(xchar x, xchar y, xchar nlx, xchar nly, xchar nhx, xchar nhy, xchar rtype, boolean oneshot, d_level *lev, xchar lax) { struct monst *mtmp; @@ -385,7 +362,7 @@ static boolean was_waterlevel; /* ugh... this shouldn't be needed */ its legs are walls within solid rock--regular wallification classifies them as superfluous and gets rid of them */ static void -baalz_fixup() +baalz_fixup(void) { struct monst *mtmp; int x, y, lastx, lasty; @@ -487,7 +464,7 @@ baalz_fixup() /* this is special stuff that the level compiler cannot (yet) handle */ void -fixup_special() +fixup_special(void) { lev_region *r = lregions; struct d_level lev; @@ -753,8 +730,7 @@ fixup_special() #ifdef ADVENT_CALENDAR void -fill_advent_calendar(init) -boolean init; +fill_advent_calendar(boolean init) { int door_nr=1; char buf[BUFSZ]; @@ -817,8 +793,7 @@ boolean init; #endif static void -check_ransacked(s) -char *s; +check_ransacked(char *s) { /* this kludge only works as long as orctown is minetn-1 */ ransacked = (u.uz.dnum == mines_dnum && !strcmp(s, "minetn-1")); @@ -828,9 +803,7 @@ char *s; static const char *orcfruit[] = { "paddle cactus", "dwarven root" }; static void -migrate_orc(mtmp, mflags) -struct monst *mtmp; -unsigned long mflags; +migrate_orc(struct monst *mtmp, long unsigned int mflags) { int nlev, max_depth, cur_depth; d_level dest; @@ -863,8 +836,7 @@ unsigned long mflags; } void -shiny_orc_stuff(mtmp) -struct monst *mtmp; +shiny_orc_stuff(struct monst *mtmp) { int gemprob, goldprob, otyp; struct obj *otmp; @@ -897,9 +869,7 @@ struct monst *mtmp; } } static void -migr_booty_item(otyp, gang) -int otyp; -const char *gang; +migr_booty_item(int otyp, const char *gang) { struct obj *otmp; @@ -918,7 +888,7 @@ const char *gang; } static void -stolen_booty() +stolen_booty(void) { char *gang, gang_name[BUFSZ]; struct monst *mtmp; @@ -1015,8 +985,7 @@ stolen_booty() #undef ORC_LEADER boolean -maze_inbounds(x, y) -int x, y; +maze_inbounds(int x, int y) { return (x >= 2 && y >= 2 && x < x_maze_max && y < y_maze_max && @@ -1024,8 +993,7 @@ int x, y; } void -maze_remove_deadends(typ) -xchar typ; +maze_remove_deadends(xchar typ) { char dirok[4]; int x, y, dir, idx, idx2, dx, dy, dx2, dy2; @@ -1072,9 +1040,7 @@ xchar typ; * TODO: rewrite walkfrom so it works on temp space, not levl */ void -create_maze(corrwid, wallthick) -int corrwid; -int wallthick; +create_maze(int corrwid, int wallthick) { int x,y; coord mm; @@ -1172,8 +1138,7 @@ int wallthick; } void -makemaz(s) -const char *s; +makemaz(const char *s) { int x, y; char protofile[20]; @@ -1402,9 +1367,7 @@ schar typ; #else void -walkfrom(x, y, typ) -int x, y; -schar typ; +walkfrom(int x, int y, schar typ) { int q, a, dir; int dirs[4]; @@ -1441,9 +1404,7 @@ schar typ; #endif /* MICRO */ static void -move(x, y, dir) -register int *x, *y; -register int dir; +move(register int *x, register int *y, register int dir) { switch(dir) { case 0: --(*y); break; @@ -1457,8 +1418,7 @@ register int dir; /* find random point in generated corridors, so we don't create items in moats, bunkers, or walls */ void -mazexy(cc) -coord *cc; +mazexy(coord *cc) { int cpt=0; @@ -1577,7 +1537,7 @@ get_level_extends(int *left, int *top, int *right, int *bottom) * that provides a window of abuse for WALLIFIED_MAZE special levels */ void -bound_digging() +bound_digging(void) { int x, y; int xmin, xmax, ymin, ymax; @@ -1598,8 +1558,7 @@ bound_digging() } void -mkportal(x, y, todnum, todlevel) -xchar x, y, todnum, todlevel; +mkportal(xchar x, xchar y, xchar todnum, xchar todlevel) { /* a portal "trap" must be matched by a */ /* portal in the destination dungeon/dlevel */ @@ -1619,7 +1578,7 @@ xchar x, y, todnum, todlevel; } void -fumaroles() +fumaroles(void) { xchar n; boolean snd = FALSE, loud = FALSE; @@ -1668,12 +1627,12 @@ static int xmin, ymin, xmax, ymax; /* level boundaries */ #define bxmax (xmax - 1) #define bymax (ymax - 1) -static void set_wportal(); +static void set_wportal(void); static void mk_bubble(int, int, int); -static void mv_bubble(struct bubble *, int, int, BOOLEAN_P); +static void mv_bubble(struct bubble *, int, int, boolean); void -movebubbles() +movebubbles(void) { static boolean up = FALSE; struct bubble *b; @@ -1797,7 +1756,7 @@ movebubbles() /* when moving in water, possibly (1 in 3) alter the intended destination */ void -water_friction() +water_friction(void) { int x, y, dx, dy; boolean eff = FALSE; @@ -1830,8 +1789,7 @@ water_friction() } void -save_waterlevel(fd, mode) -int fd, mode; +save_waterlevel(int fd, int mode) { struct bubble *b; @@ -1853,8 +1811,7 @@ int fd, mode; } void -restore_waterlevel(fd) -int fd; +restore_waterlevel(int fd) { struct bubble *b = (struct bubble *)0, *btmp; int i, n; @@ -1886,8 +1843,7 @@ int fd; } const char * -waterbody_name(x, y) -xchar x, y; +waterbody_name(xchar x, xchar y) { struct rm *lev; schar ltyp; @@ -1921,7 +1877,7 @@ xchar x, y; } static void -set_wportal() +set_wportal(void) { /* there better be only one magic portal on water level... */ for (wportal = ftrap; wportal; wportal = wportal->ntrap) @@ -1930,7 +1886,7 @@ set_wportal() } static void -setup_waterlevel() +setup_waterlevel(void) { int x, y; int xskip, yskip; @@ -1963,7 +1919,7 @@ setup_waterlevel() } static void -unsetup_waterlevel() +unsetup_waterlevel(void) { struct bubble *b, *bb; @@ -1976,8 +1932,7 @@ unsetup_waterlevel() } static void -mk_bubble(x, y, n) -int x, y, n; +mk_bubble(int x, int y, int n) { /* * These bit masks make visually pleasing bubbles on a normal aspect @@ -2037,10 +1992,7 @@ int x, y, n; * This property also makes leaving a bubble slightly difficult. */ static void -mv_bubble(b, dx, dy, ini) -struct bubble *b; -int dx, dy; -boolean ini; +mv_bubble(struct bubble *b, int dx, int dy, boolean ini) { int x, y, i, j, colli = 0; struct container *cons, *ctemp; diff --git a/src/mkobj.c b/src/mkobj.c index 8cbcde81c..bb3652071 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -6,7 +6,7 @@ static void mkbox_cnts(struct obj *); static unsigned nextoid(struct obj *, struct obj *); static void maybe_adjust_light(struct obj *, int); -static void obj_timer_checks(struct obj *, XCHAR_P, XCHAR_P, int); +static void obj_timer_checks(struct obj *, xchar, xchar, int); static void container_weight(struct obj *); static struct obj *save_mtraits(struct obj *, struct monst *); static void objlist_sanity(struct obj *, int, const char *); @@ -80,7 +80,7 @@ const struct icp hellprobs[] = { }; struct oextra * -newoextra() +newoextra(void) { struct oextra *oextra; @@ -94,8 +94,7 @@ newoextra() } void -dealloc_oextra(o) -struct obj *o; +dealloc_oextra(struct obj *o) { struct oextra *x = o->oextra; @@ -117,8 +116,7 @@ struct obj *o; } void -newomonst(otmp) -struct obj *otmp; +newomonst(struct obj *otmp) { if (!otmp->oextra) otmp->oextra = newoextra(); @@ -132,8 +130,7 @@ struct obj *otmp; } void -free_omonst(otmp) -struct obj *otmp; +free_omonst(struct obj *otmp) { if (otmp->oextra) { struct monst *m = OMONST(otmp); @@ -148,8 +145,7 @@ struct obj *otmp; } void -newomid(otmp) -struct obj *otmp; +newomid(struct obj *otmp) { if (!otmp->oextra) otmp->oextra = newoextra(); @@ -160,8 +156,7 @@ struct obj *otmp; } void -free_omid(otmp) -struct obj *otmp; +free_omid(struct obj *otmp) { if (otmp->oextra && OMID(otmp)) { free((genericptr_t) OMID(otmp)); @@ -170,8 +165,7 @@ struct obj *otmp; } void -newolong(otmp) -struct obj *otmp; +newolong(struct obj *otmp) { if (!otmp->oextra) otmp->oextra = newoextra(); @@ -182,8 +176,7 @@ struct obj *otmp; } void -free_olong(otmp) -struct obj *otmp; +free_olong(struct obj *otmp) { if (otmp->oextra && OLONG(otmp)) { free((genericptr_t) OLONG(otmp)); @@ -192,9 +185,7 @@ struct obj *otmp; } void -new_omailcmd(otmp, response_cmd) -struct obj *otmp; -const char *response_cmd; +new_omailcmd(struct obj *otmp, const char *response_cmd) { if (!otmp->oextra) otmp->oextra = newoextra(); @@ -204,8 +195,7 @@ const char *response_cmd; } void -free_omailcmd(otmp) -struct obj *otmp; +free_omailcmd(struct obj *otmp) { if (otmp->oextra && OMAILCMD(otmp)) { free((genericptr_t) OMAILCMD(otmp)); @@ -214,10 +204,7 @@ struct obj *otmp; } struct obj * -mkobj_at(let, x, y, artif) -char let; -int x, y; -boolean artif; +mkobj_at(char let, int x, int y, boolean artif) { struct obj *otmp; @@ -227,9 +214,7 @@ boolean artif; } struct obj * -mksobj_at(otyp, x, y, init, artif) -int otyp, x, y; -boolean init, artif; +mksobj_at(int otyp, int x, int y, boolean init, boolean artif) { struct obj *otmp; @@ -239,10 +224,7 @@ boolean init, artif; } struct obj * -mksobj_migr_to_species(otyp, mflags2, init, artif) -int otyp; -unsigned mflags2; -boolean init, artif; +mksobj_migr_to_species(int otyp, unsigned int mflags2, boolean init, boolean artif) { struct obj *otmp; @@ -256,9 +238,7 @@ boolean init, artif; /* mkobj(): select a type of item from a class, use mksobj() to create it; result is always non-Null */ struct obj * -mkobj(oclass, artif) -char oclass; -boolean artif; +mkobj(char oclass, boolean artif) { int tprob, i, prob = rnd(1000); @@ -287,8 +267,7 @@ boolean artif; } static void -mkbox_cnts(box) -struct obj *box; +mkbox_cnts(struct obj *box) { register int n; register struct obj *otmp; @@ -372,7 +351,7 @@ struct obj *box; /* select a random, common monster type */ int -rndmonnum() +rndmonnum(void) { register struct permonst *ptr; register int i; @@ -399,8 +378,7 @@ rndmonnum() } void -copy_oextra(obj2, obj1) -struct obj *obj2, *obj1; +copy_oextra(struct obj *obj2, struct obj *obj1) { if (!obj2 || !obj1 || !obj1->oextra) return; @@ -448,9 +426,7 @@ struct obj *obj2, *obj1; * in the nobj chain (and nexthere chain when on the floor). */ struct obj * -splitobj(obj, num) -struct obj *obj; -long num; +splitobj(struct obj *obj, long int num) { struct obj *otmp; @@ -494,8 +470,7 @@ long num; /* when splitting a stack that has o_id-based shop prices, pick an o_id value for the new stack that will maintain the same price */ static unsigned -nextoid(oldobj, newobj) -struct obj *oldobj, *newobj; +nextoid(struct obj *oldobj, struct obj *newobj) { int olddif, newdif, trylimit = 256; /* limit of 4 suffices at present */ unsigned oid = flags.ident - 1; /* loop increment will reverse -1 */ @@ -515,8 +490,7 @@ struct obj *oldobj, *newobj; /* try to find the stack obj was split from, then merge them back together; returns the combined object if unsplit is successful, null otherwise */ struct obj * -unsplitobj(obj) -struct obj *obj; +unsplitobj(struct obj *obj) { unsigned target_oid = 0; struct obj *oparent = 0, *ochild = 0, *list = 0; @@ -586,7 +560,7 @@ struct obj *obj; /* reset splitobj()/unsplitobj() context */ void -clear_splitobjs() +clear_splitobjs(void) { context_objsplit.parent_oid = context_objsplit.child_oid = 0; } @@ -601,9 +575,7 @@ clear_splitobjs() * not actually moving something. */ void -replace_object(obj, otmp) -struct obj *obj; -struct obj *otmp; +replace_object(struct obj *obj, struct obj *otmp) { otmp->where = obj->where; switch (obj->where) { @@ -646,8 +618,7 @@ struct obj *otmp; /* is 'obj' inside a container whose contents aren't known? if so, return the outermost container meeting that criterium */ struct obj * -unknwn_contnr_contents(obj) -struct obj *obj; +unknwn_contnr_contents(struct obj *obj) { struct obj *result = 0, *parent; @@ -676,8 +647,7 @@ struct obj *obj; * usage of an object. */ void -bill_dummy_object(otmp) -register struct obj *otmp; +bill_dummy_object(register struct obj *otmp) { register struct obj *dummy; long cost = 0L; @@ -722,9 +692,7 @@ static const char *const alteration_verbs[] = { /* possibly bill for an object which the player has just modified */ void -costly_alteration(obj, alter_type) -struct obj *obj; -int alter_type; +costly_alteration(struct obj *obj, int alter_type) { xchar ox, oy; char objroom; @@ -806,10 +774,7 @@ static const char dknowns[] = { /* mksobj(): create a specific type of object; result it always non-Null */ struct obj * -mksobj(otyp, init, artif) -int otyp; -boolean init; -boolean artif; +mksobj(int otyp, boolean init, boolean artif) { int mndx, tryct; struct obj *otmp; @@ -1181,9 +1146,7 @@ boolean artif; * */ void -set_corpsenm(obj, id) -struct obj *obj; -int id; +set_corpsenm(struct obj *obj, int id) { int old_id = obj->corpsenm; long when = 0L; @@ -1237,8 +1200,7 @@ int id; * This takes the age of the corpse into consideration as of 3.4.0. */ void -start_corpse_timeout(body) -struct obj *body; +start_corpse_timeout(struct obj *body) { long when; /* rot away when this old */ long corpse_age; /* age of corpse */ @@ -1291,9 +1253,7 @@ struct obj *body; } static void -maybe_adjust_light(obj, old_range) -struct obj *obj; -int old_range; +maybe_adjust_light(struct obj *obj, int old_range) { char buf[BUFSZ]; xchar ox, oy; @@ -1334,8 +1294,7 @@ int old_range; * these routines to make the actual curse/bless state change. */ void -bless(otmp) -register struct obj *otmp; +bless(register struct obj *otmp) { int old_light = 0; @@ -1359,8 +1318,7 @@ register struct obj *otmp; } void -unbless(otmp) -register struct obj *otmp; +unbless(register struct obj *otmp) { int old_light = 0; @@ -1379,8 +1337,7 @@ register struct obj *otmp; } void -curse(otmp) -register struct obj *otmp; +curse(register struct obj *otmp) { unsigned already_cursed; int old_light = 0; @@ -1423,8 +1380,7 @@ register struct obj *otmp; } void -uncurse(otmp) -register struct obj *otmp; +uncurse(register struct obj *otmp) { int old_light = 0; @@ -1445,9 +1401,7 @@ register struct obj *otmp; } void -blessorcurse(otmp, chance) -register struct obj *otmp; -register int chance; +blessorcurse(register struct obj *otmp, register int chance) { if(otmp->blessed || otmp->cursed) return; @@ -1462,17 +1416,16 @@ register int chance; } int -bcsign(otmp) -register struct obj *otmp; +bcsign(register struct obj *otmp) { return(!!otmp->blessed - !!otmp->cursed); } /* set the object's bless/curse-state known flag */ void -set_bknown(obj, onoff) -struct obj *obj; -unsigned onoff; /* 1 or 0 */ +set_bknown( + struct obj *obj, + unsigned int onoff) /**< 1 or 0 */ { if (obj->bknown != onoff) { obj->bknown = onoff; @@ -1491,8 +1444,7 @@ unsigned onoff; /* 1 or 0 */ * container's weight. */ int -weight(obj) -register struct obj *obj; +weight(register struct obj *obj) { int wt = objects[obj->otyp].oc_weight; @@ -1560,15 +1512,13 @@ static int treefruits[] = { APPLE, ORANGE, PEAR, BANANA, EUCALYPTUS_LEAF }; /* called when a tree is kicked; never returns Null */ struct obj * -rnd_treefruit_at(x, y) -int x, y; +rnd_treefruit_at(int x, int y) { return mksobj_at(treefruits[rn2(SIZE(treefruits))], x, y, TRUE, FALSE); } void -rnd_treesticks_at(x, y) -int x, y; +rnd_treesticks_at(int x, int y) { int num = rnd(3); while(num--) @@ -1577,9 +1527,7 @@ int x, y; /* create a stack of N gold pieces; never returns Null */ struct obj * -mkgold(amount, x, y) -long amount; -int x, y; +mkgold(long int amount, int x, int y) { register struct obj *gold = g_at(x, y); @@ -1613,12 +1561,12 @@ int x, y; * resurrection. */ struct obj * -mkcorpstat(objtype, mtmp, ptr, x, y, init) -int objtype; /* CORPSE or STATUE */ -struct monst *mtmp; -struct permonst *ptr; -int x, y; -boolean init; +mkcorpstat(int objtype, struct monst *mtmp, struct permonst *ptr, int x, int y, boolean init) + /* CORPSE or STATUE */ + + + + { struct obj *otmp; @@ -1668,8 +1616,7 @@ boolean init; * The return value is an index into mons[]. */ int -corpse_revive_type(obj) -struct obj *obj; +corpse_revive_type(struct obj *obj) { int revivetype = obj->corpsenm; struct monst *mtmp; @@ -1687,9 +1634,7 @@ struct obj *obj; * a lasting association between the two. */ struct obj * -obj_attach_mid(obj, mid) -struct obj *obj; -unsigned mid; +obj_attach_mid(struct obj *obj, unsigned int mid) { if (!mid || !obj) { return (struct obj *) 0; @@ -1700,9 +1645,7 @@ unsigned mid; } static struct obj * -save_mtraits(obj, mtmp) -struct obj *obj; -struct monst *mtmp; +save_mtraits(struct obj *obj, struct monst *mtmp) { if (mtmp->ispriest) { forget_temple_entry(mtmp); /* EPRI() */ @@ -1733,9 +1676,7 @@ struct monst *mtmp; * the one contained within the obj. */ struct monst * -get_mtraits(obj, copyof) -struct obj *obj; -boolean copyof; +get_mtraits(struct obj *obj, boolean copyof) { struct monst *mtmp = (struct monst *)0; struct monst *mnew = (struct monst *)0; @@ -1760,9 +1701,9 @@ boolean copyof; /* make an object named after someone listed in the scoreboard file */ struct obj * -mk_tt_object(objtype, x, y) -int objtype; /* CORPSE or STATUE */ -int x, y; +mk_tt_object(int objtype, int x, int y) + /* CORPSE or STATUE */ + { struct obj *otmp, *otmp2; boolean initialize_it; @@ -1781,11 +1722,11 @@ int x, y; /* make a new corpse or statue, uninitialized if a statue (i.e. no books); never returns Null */ struct obj * -mk_named_object(objtype, ptr, x, y, nm) -int objtype; /* CORPSE or STATUE */ -struct permonst *ptr; -int x, y; -const char *nm; +mk_named_object(int objtype, struct permonst *ptr, int x, int y, const char *nm) + /* CORPSE or STATUE */ + + + { struct obj *otmp; unsigned corpstatflags = (objtype != STATUE) ? CORPSTAT_INIT : CORPSTAT_NONE; @@ -1797,8 +1738,7 @@ const char *nm; } boolean -is_flammable(otmp) -register struct obj *otmp; +is_flammable(register struct obj *otmp) { int otyp = otmp->otyp; int omat = objects[otyp].oc_material; @@ -1817,8 +1757,7 @@ register struct obj *otmp; } boolean -is_rottable(otmp) -register struct obj *otmp; +is_rottable(register struct obj *otmp) { int otyp = otmp->otyp; @@ -1833,9 +1772,7 @@ register struct obj *otmp; /* put the object at the given location */ void -place_object(otmp, x, y) -register struct obj *otmp; -int x, y; +place_object(register struct obj *otmp, int x, int y) { register struct obj *otmp2 = level.objects[x][y]; @@ -1895,9 +1832,7 @@ int x, y; * Also used for starting ice effects too. [zap.c] */ void -obj_ice_effects(x, y, do_buried) -int x, y; -boolean do_buried; +obj_ice_effects(int x, int y, boolean do_buried) { struct obj *otmp; @@ -1921,8 +1856,7 @@ boolean do_buried; * restarted etc. */ long -peek_at_iced_corpse_age(otmp) -struct obj *otmp; +peek_at_iced_corpse_age(struct obj *otmp) { long age, retval = otmp->age; @@ -1941,10 +1875,10 @@ struct obj *otmp; } static void -obj_timer_checks(otmp, x, y, force) -struct obj *otmp; -xchar x, y; -int force; /* 0 = no force so do checks, <0 = force off, >0 force on */ +obj_timer_checks( + struct obj *otmp, + xchar x, xchar y, + int force) /**< 0 = no force so do checks, <0 = force off, >0 force on */ { long tleft = 0L; short action = ROT_CORPSE; @@ -2011,8 +1945,7 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */ #undef ROT_ICE_ADJUSTMENT void -remove_object(otmp) -register struct obj *otmp; +remove_object(register struct obj *otmp) { xchar x = otmp->ox; xchar y = otmp->oy; @@ -2032,8 +1965,7 @@ register struct obj *otmp; /* throw away all of a monster's inventory */ void -discard_minvent(mtmp) -struct monst *mtmp; +discard_minvent(struct monst *mtmp) { struct obj *otmp, *mwep = MON_WEP(mtmp); boolean keeping_mon = (!DEADMONSTER(mtmp)); @@ -2072,8 +2004,7 @@ struct monst *mtmp; * OBJ_FREE not on any list */ void -obj_extract_self(obj) -struct obj *obj; +obj_extract_self(struct obj *obj) { switch (obj->where) { case OBJ_FREE: @@ -2110,8 +2041,7 @@ struct obj *obj; /* Extract the given object from the chain, following nobj chain. */ void -extract_nobj(obj, head_ptr) -struct obj *obj, **head_ptr; +extract_nobj(struct obj *obj, struct obj **head_ptr) { struct obj *curr, *prev; @@ -2137,8 +2067,7 @@ struct obj *obj, **head_ptr; * in tandem with extract_nobj, which does set it. */ void -extract_nexthere(obj, head_ptr) -struct obj *obj, **head_ptr; +extract_nexthere(struct obj *obj, struct obj **head_ptr) { struct obj *curr, *prev; @@ -2162,9 +2091,7 @@ struct obj *obj, **head_ptr; * Otherwise 0 is returned. */ int -add_to_minv(mon, obj) -struct monst *mon; -struct obj *obj; +add_to_minv(struct monst *mon, struct obj *obj) { struct obj *otmp; @@ -2188,8 +2115,7 @@ struct obj *obj; * The input obj may be deleted in the process. */ struct obj * -add_to_container(container, obj) -struct obj *container, *obj; +add_to_container(struct obj *container, struct obj *obj) { struct obj *otmp; @@ -2210,8 +2136,7 @@ struct obj *container, *obj; } void -add_to_migration(obj) -struct obj *obj; +add_to_migration(struct obj *obj) { if (obj->where != OBJ_FREE) panic("add_to_migration: obj not free (%d,%d,%d)", obj->where, obj->otyp, obj->invlet); @@ -2227,8 +2152,7 @@ struct obj *obj; } void -add_to_buried(obj) -struct obj *obj; +add_to_buried(struct obj *obj) { if (obj->where != OBJ_FREE) panic("add_to_buried: obj not free (%d,%d,%d)", obj->where, obj->otyp, obj->invlet); @@ -2240,8 +2164,7 @@ struct obj *obj; /* Recalculate the weight of this container and all of _its_ containers. */ static void -container_weight(container) -struct obj *container; +container_weight(struct obj *container) { container->owt = weight(container); if (container->where == OBJ_CONTAINED) @@ -2257,8 +2180,7 @@ struct obj *container; * them to be deallocated. */ void -dealloc_obj(obj) -struct obj *obj; +dealloc_obj(struct obj *obj) { if (obj->where != OBJ_FREE) panic("dealloc_obj: obj not free (%d,%d,%d)", obj->where, obj->otyp, obj->invlet); @@ -2297,9 +2219,9 @@ struct obj *obj; /* create an object from a horn of plenty; mirrors bagotricks(makemon.c) */ int -hornoplenty(horn, tipping) -struct obj *horn; -boolean tipping; /* caller emptying entire contents; affects shop handling */ +hornoplenty( + struct obj *horn, + boolean tipping) /**< caller emptying entire contents; affects shop mesgs */ { int objcount = 0; @@ -2391,7 +2313,7 @@ static const char NEARDATA /* pline formats for insane_object() */ /* Check all object lists for consistency. */ void -obj_sanity_check() +obj_sanity_check(void) { int x, y; struct obj *obj; @@ -2453,10 +2375,7 @@ obj_sanity_check() /* sanity check for objects on specified list (fobj, &c) */ static void -objlist_sanity(objlist, wheretype, mesg) -struct obj *objlist; -int wheretype; -const char *mesg; +objlist_sanity(struct obj *objlist, int wheretype, const char *mesg) { struct obj *obj; @@ -2504,9 +2423,7 @@ const char *mesg; /* sanity check for objects carried by all monsters in specified list */ static void -mon_obj_sanity(monlist, mesg) -struct monst *monlist; -const char *mesg; +mon_obj_sanity(struct monst *monlist, const char *mesg) { struct monst *mon; struct obj *obj, *mwep; @@ -2543,8 +2460,7 @@ static const char *obj_state_names[NOBJ_STATES] = { }; static const char * -where_name(obj) -struct obj *obj; +where_name(struct obj *obj) { static char unknown[32]; /* big enough to handle rogue 64-bit int */ int where; @@ -2562,10 +2478,7 @@ struct obj *obj; } static void -insane_object(obj, fmt, mesg, mon) -struct obj *obj; -const char *fmt, *mesg; -struct monst *mon; +insane_object(struct obj *obj, const char *fmt, const char *mesg, struct monst *mon) { const char *objnm, *monnm; char altfmt[BUFSZ]; @@ -2594,10 +2507,7 @@ struct monst *mon; * take an obj pointer to work. */ struct obj * -init_dummyobj(obj, otyp, oquan) -struct obj *obj; -short otyp; -long oquan; +init_dummyobj(struct obj *obj, short int otyp, long int oquan) { if (obj) { *obj = zeroobj; @@ -2620,9 +2530,7 @@ long oquan; /* obj sanity check: check objects inside container */ static void -check_contained(container, mesg) -struct obj *container; -const char *mesg; +check_contained(struct obj *container, const char *mesg) { struct obj *obj; /* big enough to work with, not too big to blow out stack in recursion */ @@ -2670,8 +2578,7 @@ const char *mesg; /* check an object in hero's or monster's inventory which has worn mask set */ static void -sanity_check_worn(obj) -struct obj *obj; +sanity_check_worn(struct obj *obj) { #if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) || defined(DEBUG) static unsigned long wearbits[] = { @@ -2892,8 +2799,7 @@ struct obj *obj; * wrapper to make "near this object" convenient */ struct obj * -obj_nexto(otmp) -struct obj *otmp; +obj_nexto(struct obj *otmp) { if (!otmp) { impossible("obj_nexto: wasn't given an object to check"); @@ -2911,10 +2817,7 @@ struct obj *otmp; * reliably predict which one we want to 'find' first */ struct obj * -obj_nexto_xy(obj, x, y, recurs) -struct obj *obj; -int x, y; -boolean recurs; +obj_nexto_xy(struct obj *obj, int x, int y, boolean recurs) { struct obj *otmp; int fx, fy, ex, ey, otyp = obj->otyp; @@ -2959,8 +2862,7 @@ boolean recurs; * is returned. */ struct obj * -obj_absorb(obj1, obj2) -struct obj **obj1, **obj2; +obj_absorb(struct obj **obj1, struct obj **obj2) { struct obj *otmp1, *otmp2; int o1wt, o2wt; @@ -3014,8 +2916,7 @@ struct obj **obj1, **obj2; * cleanly (since we don't know which we want to stay around) */ struct obj * -obj_meld(obj1, obj2) -struct obj **obj1, **obj2; +obj_meld(struct obj **obj1, struct obj **obj2) { struct obj *otmp1, *otmp2, *result = 0; int ox, oy; @@ -3062,9 +2963,7 @@ struct obj **obj1, **obj2; /* give a message if hero notices two globs merging [used to be in pline.c] */ void -pudding_merge_message(otmp, otmp2) -struct obj *otmp; -struct obj *otmp2; +pudding_merge_message(struct obj *otmp, struct obj *otmp2) { boolean visible = (cansee(otmp->ox, otmp->oy) || cansee(otmp2->ox, otmp2->oy)), diff --git a/src/mkroom.c b/src/mkroom.c index 033eb922b..e24aec797 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -17,13 +17,13 @@ static boolean isbig(struct mkroom *); static void mkshop(void), mkzoo(int), mkswamp(void); -static void mktemple(); +static void mktemple(void); static void mkgarden(struct mkroom *); static coord * shrine_pos(int); -static struct permonst * morguemon(); -static struct permonst * antholemon(); -static struct permonst * squadmon(); -static struct permonst * armorymon(); +static struct permonst * morguemon(void); +static struct permonst * antholemon(void); +static struct permonst * squadmon(void); +static struct permonst * armorymon(void); static void save_room(int, struct mkroom *); static void rest_room(int, struct mkroom *); @@ -32,8 +32,7 @@ static void rest_room(int, struct mkroom *); extern const struct shclass shtypes[]; /* defined in shknam.c */ static boolean -isbig(sroom) -register struct mkroom *sroom; +isbig(register struct mkroom *sroom) { register int area = (sroom->hx - sroom->lx + 1) * (sroom->hy - sroom->ly + 1); @@ -43,8 +42,7 @@ register struct mkroom *sroom; /* make and stock a room of a given type */ void -mkroom(roomtype) -int roomtype; +mkroom(int roomtype) { if (roomtype >= SHOPBASE) mkshop(); /* someday, we should be able to specify shop type */ @@ -68,7 +66,7 @@ int roomtype; } static void -mkshop() +mkshop(void) { register struct mkroom *sroom; int i = -1; @@ -210,8 +208,7 @@ mkshop() /* pick an unused room, preferably with only one door */ struct mkroom * -pick_room(strict) -boolean strict; +pick_room(boolean strict) { struct mkroom *sroom; int i = nroom; @@ -238,8 +235,7 @@ boolean strict; } static void -mkzoo(type) -int type; +mkzoo(int type) { register struct mkroom *sroom; @@ -250,8 +246,7 @@ int type; } void -mk_zoo_thronemon(x,y) -int x,y; +mk_zoo_thronemon(int x, int y) { int i = rnd(level_difficulty()); int pm = (i > 9) ? PM_OGRE_KING : @@ -269,8 +264,7 @@ int x,y; } void -fill_zoo(sroom) -struct mkroom *sroom; +fill_zoo(struct mkroom *sroom) { struct monst *mon; register int sx, sy, i; @@ -495,10 +489,7 @@ struct mkroom *sroom; /* make a swarm of undead around mm */ void -mkundead(mm, revive_corpses, mm_flags) -coord *mm; -boolean revive_corpses; -int mm_flags; +mkundead(coord *mm, boolean revive_corpses, int mm_flags) { int cnt = (level_difficulty() + 1)/10 + rnd(5); struct permonst *mdat; @@ -517,7 +508,7 @@ int mm_flags; } static struct permonst * -morguemon() +morguemon(void) { register int i = rn2(100), hd = rn2(level_difficulty()); @@ -542,7 +533,7 @@ morguemon() } static struct permonst * -antholemon() +antholemon(void) { int mtyp; @@ -558,7 +549,7 @@ antholemon() } static struct permonst * -armorymon() +armorymon(void) { return (rnf(1, 5) ? mkclass(S_RUSTMONST, 0) : &mons[PM_BROWN_PUDDING]); } @@ -567,8 +558,7 @@ armorymon() * @author Pasi Kallinen */ static void -mkgarden(croom) -struct mkroom *croom; /* NULL == choose random room */ +mkgarden(struct mkroom *croom) /**< NULL == choose random room */ { register int tryct = 0; boolean maderoom = FALSE; @@ -614,7 +604,7 @@ struct mkroom *croom; /* NULL == choose random room */ } static void -mkswamp() /* Michiel Huisjes & Fred de Wilde */ +mkswamp(void) /* Michiel Huisjes & Fred de Wilde */ { register struct mkroom *sroom; register int sx, sy, i, eelct = 0; @@ -656,8 +646,7 @@ mkswamp() /* Michiel Huisjes & Fred de Wilde */ } static coord * -shrine_pos(roomno) -int roomno; +shrine_pos(int roomno) { static coord buf; int delta; @@ -680,7 +669,7 @@ int roomno; } static void -mktemple() +mktemple(void) { register struct mkroom *sroom; coord *shrine_spot; @@ -704,8 +693,7 @@ mktemple() } boolean -nexttodoor(sx, sy) -register int sx, sy; +nexttodoor(register int sx, register int sy) { register int dx, dy; register struct rm *lev; @@ -719,8 +707,7 @@ register int sx, sy; } boolean -has_dnstairs(sroom) -register struct mkroom *sroom; +has_dnstairs(register struct mkroom *sroom) { if (sroom == dnstairs_room) return TRUE; @@ -730,8 +717,7 @@ register struct mkroom *sroom; } boolean -has_upstairs(sroom) -register struct mkroom *sroom; +has_upstairs(register struct mkroom *sroom) { if (sroom == upstairs_room) return TRUE; @@ -741,32 +727,26 @@ register struct mkroom *sroom; } int -somex(croom) -register struct mkroom *croom; +somex(register struct mkroom *croom) { return rn1(croom->hx - croom->lx + 1, croom->lx); } int -somey(croom) -register struct mkroom *croom; +somey(register struct mkroom *croom) { return rn1(croom->hy - croom->ly + 1, croom->ly); } boolean -inside_room(croom, x, y) -struct mkroom *croom; -xchar x, y; +inside_room(struct mkroom *croom, xchar x, xchar y) { return((boolean)(x >= croom->lx-1 && x <= croom->hx+1 && y >= croom->ly-1 && y <= croom->hy+1)); } boolean -somexy(croom, c) -struct mkroom *croom; -coord *c; +somexy(struct mkroom *croom, coord *c) { int try_cnt = 0; int i; @@ -815,10 +795,7 @@ you_lose:; } boolean -somexyspace(croom, pos, flags) -struct mkroom *croom; -coord *pos; -int flags; +somexyspace(struct mkroom *croom, coord *pos, int flags) { int tryct = 0; boolean isok; @@ -844,8 +821,7 @@ int flags; */ struct mkroom * -search_special(type) -schar type; +search_special(schar type) { register struct mkroom *croom; @@ -863,7 +839,7 @@ schar type; } struct permonst * -courtmon() +courtmon(void) { int i = rn2(60) + rn2(3*level_difficulty()); if (i > 100) return(mkclass(S_DRAGON, 0)); @@ -887,7 +863,7 @@ static struct { }; static struct permonst * -squadmon() /* return soldier types. */ +squadmon(void) /* return soldier types. */ { int sel_prob, i, cpro, mndx; @@ -913,9 +889,7 @@ squadmon() /* return soldier types. */ */ static void -save_room(fd, r) -int fd; -struct mkroom *r; +save_room(int fd, struct mkroom *r) { short i; /* @@ -933,8 +907,7 @@ struct mkroom *r; */ void -save_rooms(fd) -int fd; +save_rooms(int fd) { short i; @@ -945,9 +918,7 @@ int fd; } static void -rest_room(fd, r) -int fd; -struct mkroom *r; +rest_room(int fd, struct mkroom *r) { short i; @@ -965,8 +936,7 @@ struct mkroom *r; */ void -rest_rooms(fd) -int fd; +rest_rooms(int fd) { short i; @@ -983,8 +953,7 @@ int fd; /* convert a display symbol for terrain into topology type; used for remembered terrain when mimics pose as furniture */ int -cmap_to_type(sym) -int sym; +cmap_to_type(int sym) { int typ = STONE; /* catchall */ diff --git a/src/mksheol.c b/src/mksheol.c index 2b3274dc2..9d55594cc 100644 --- a/src/mksheol.c +++ b/src/mksheol.c @@ -73,8 +73,7 @@ static void place_clouds(void); static void shake_position(int* x, int* y); void -mksheol(init_lev_par) -void *init_lev_par; +mksheol(void *init_lev_par) { lev_init* init_lev = (lev_init*) init_lev_par; @@ -189,10 +188,7 @@ init_level_base_voronoi(schar* vtyps, int numtyps, int numpoints) } static int -check_voronoi_winner(coords, num_coords, x, y) -patchcoord* coords; -int num_coords; -int x, y; +check_voronoi_winner(patchcoord *coords, int num_coords, int x, int y) { int i1; int winner = 0, winner_distance; @@ -218,8 +214,7 @@ typedef struct sbezcoord } bezcoord; static void -carve_path(floorprobs) -floorprob* floorprobs; +carve_path(floorprob *floorprobs) { /* * We'll draw a bezier curve from the left of the level to the right. @@ -330,10 +325,7 @@ floorprob* floorprobs; * After that, linearly makes it less likely that a passable square is * made. This makes a sort of "rough" edge. */ static void -fuzzy_circle(x, y, guaranteed_passage_radius, fallout, floorprobs) -int x, y; -int guaranteed_passage_radius, fallout; -floorprob* floorprobs; +fuzzy_circle(int x, int y, int guaranteed_passage_radius, int fallout, floorprob *floorprobs) { int i1, i2; int fallout_2 = fallout * fallout; @@ -624,9 +616,7 @@ place_clouds(void) { } static void -shake_position(x, y) -int* x; -int* y; +shake_position(int *x, int *y) { int i1; int old_x, old_y; diff --git a/src/mon.c b/src/mon.c index 94b87f2f0..0a9bdbd73 100644 --- a/src/mon.c +++ b/src/mon.c @@ -12,12 +12,12 @@ static boolean vamp_rise_msg, disintegested; -static void sanity_check_single_mon(struct monst *, BOOLEAN_P, const char *); +static void sanity_check_single_mon(struct monst *, boolean, const char *); static boolean restrap(struct monst *); static long mm_2way_aggression(struct monst *, struct monst *); static long mm_aggression(struct monst *, struct monst *); static long mm_displacement(struct monst *, struct monst *); -static int pick_animal(); +static int pick_animal(void); static void kill_eggs(struct obj *); static int pickvampshape(struct monst *); static boolean isspecmon(struct monst *); @@ -30,7 +30,7 @@ static void lifesaved_monster(struct monst *, uchar); #else static void lifesaved_monster(struct monst *); #endif -static void migrate_mon(struct monst *, XCHAR_P, XCHAR_P); +static void migrate_mon(struct monst *, xchar, xchar); static boolean ok_to_obliterate(struct monst *); static void deal_with_overcrowding(struct monst *); @@ -58,10 +58,7 @@ static void warn_effects(); #endif /* 0 */ static void -sanity_check_single_mon(mtmp, chk_geno, msg) -struct monst *mtmp; -boolean chk_geno; -const char *msg; +sanity_check_single_mon(struct monst *mtmp, boolean chk_geno, const char *msg) { if (mtmp->data < &mons[LOW_PM] || mtmp->data >= &mons[NUMMONS]) { impossible("illegal mon data %s; mnum=%d (%s)", fmt_ptr((genericptr_t) mtmp->data), mtmp->mnum, msg); @@ -104,7 +101,7 @@ const char *msg; } void -mon_sanity_check() +mon_sanity_check(void) { int x, y; struct monst *mtmp, *m; @@ -164,8 +161,7 @@ mon_sanity_check() } void -remove_monster(x, y) -int x, y; +remove_monster(int x, int y) { if (level.monsters[x][y] && (level.monsters[x][y]->data == &mons[PM_GIANT_TURTLE] && @@ -243,8 +239,7 @@ zombie_form(struct permonst *pm) /* convert the monster index of an undead to its living counterpart */ int -undead_to_corpse(mndx) -int mndx; +undead_to_corpse(int mndx) { switch (mndx) { case PM_KOBOLD_ZOMBIE: @@ -280,8 +275,7 @@ int mndx; * if mode is 1. */ int -genus(mndx, mode) -int mndx, mode; +genus(int mndx, int mode) { switch (mndx) { /* Quest guardians */ @@ -314,8 +308,7 @@ int mndx, mode; /* return monster index if chameleon, or NON_PM if not */ int -pm_to_cham(mndx) -int mndx; +pm_to_cham(int mndx) { int mcham = NON_PM; @@ -346,9 +339,7 @@ int mndx; * etc.... */ static struct obj * -make_corpse(mtmp, corpseflags) -register struct monst *mtmp; -unsigned corpseflags; +make_corpse(register struct monst *mtmp, unsigned int corpseflags) { register struct permonst *mdat = mtmp->data; int num; @@ -561,8 +552,7 @@ unsigned corpseflags; /* check mtmp and water/lava for compatibility, 0 (survived), 1 (died) */ int -minliquid(mtmp) -register struct monst *mtmp; +minliquid(register struct monst *mtmp) { boolean inpool, inlava, inswamp, infountain, grounded; @@ -716,8 +706,7 @@ register struct monst *mtmp; } int -mcalcmove(mon) -struct monst *mon; +mcalcmove(struct monst *mon) { int mmove = mon->data->mmove; @@ -746,7 +735,7 @@ struct monst *mon; individual monster's metabolism; some of these might need to be reclassified to occur more in proportion with movement rate */ void -mcalcdistress() +mcalcdistress(void) { struct monst *mtmp; @@ -784,7 +773,7 @@ mcalcdistress() } int -movemon() +movemon(void) { register struct monst *mtmp, *nmtmp; register boolean somebody_can_move = FALSE; @@ -948,8 +937,7 @@ movemon() * has young and old forms). */ int -meatmetal(mtmp) -register struct monst *mtmp; +meatmetal(register struct monst *mtmp) { register struct obj *otmp; struct permonst *ptr; @@ -1040,8 +1028,8 @@ register struct monst *mtmp; /* monster eats a pile of objects */ int -meatobj(mtmp) /* for gelatinous cubes */ -struct monst *mtmp; +meatobj(struct monst *mtmp) /* for gelatinous cubes */ + { struct obj *otmp, *otmp2; struct permonst *ptr, *original_ptr = mtmp->data; @@ -1135,8 +1123,7 @@ struct monst *mtmp; } void -mpickgold(mtmp) -register struct monst *mtmp; +mpickgold(register struct monst *mtmp) { register struct obj *gold; int mat_idx; @@ -1155,9 +1142,7 @@ register struct monst *mtmp; } boolean -mpickstuff(mtmp, str) -register struct monst *mtmp; -register const char *str; +mpickstuff(register struct monst *mtmp, register const char *str) { struct obj *otmp, *otmp2, *otmp3; @@ -1195,9 +1180,7 @@ register const char *str; } void -mpickup_obj(mtmp, otmp) -struct monst *mtmp; -struct obj *otmp; +mpickup_obj(struct monst *mtmp, struct obj *otmp) { struct obj *otmp3 = otmp; if (otmp->otyp == BOULDER && is_rockbreaker(mtmp->data)) { @@ -1231,8 +1214,7 @@ struct obj *otmp; } int -curr_mon_load(mtmp) -register struct monst *mtmp; +curr_mon_load(register struct monst *mtmp) { int curload = 0; struct obj *obj; @@ -1247,8 +1229,7 @@ register struct monst *mtmp; } int -max_mon_load(mtmp) -register struct monst *mtmp; +max_mon_load(register struct monst *mtmp) { register long maxload; @@ -1288,9 +1269,7 @@ register struct monst *mtmp; * likesgold handling m_move results in picking up the whole stack. */ int -can_carry(mtmp, otmp) -struct monst *mtmp; -struct obj *otmp; +can_carry(struct monst *mtmp, struct obj *otmp) { int otyp = otmp->otyp, newload = otmp->owt; struct permonst *mdat = mtmp->data; @@ -1387,11 +1366,11 @@ struct obj *otmp; /* return number of acceptable neighbour positions */ int -mfndpos(mon, poss, info, flag) -struct monst *mon; -coord *poss; /* coord poss[9] */ -long *info; /* long info[9] */ -long flag; +mfndpos(struct monst *mon, coord *poss, long int *info, long int flag) + + /* coord poss[9] */ + /* long info[9] */ + { struct permonst *mdat = mon->data; register xchar x, y, nx, ny; @@ -1642,8 +1621,7 @@ long flag; having to code each case twice, this function contains those cases that ought to happen twice, and mm_aggression will call it twice. */ static long -mm_2way_aggression(magr, mdef) -struct monst *magr, *mdef; +mm_2way_aggression(struct monst *magr, struct monst *mdef) { /* zombies vs things that can be zombified */ if (zombie_maker(magr) && zombie_form(mdef->data) != NON_PM) { @@ -1659,9 +1637,9 @@ struct monst *magr, *mdef; other monsters; just hand to hand fighting when they happen to be next to each other. */ static long -mm_aggression(magr, mdef) -struct monst *magr, /* monster that is currently deciding where to move */ - *mdef; /* another monster which is next to it */ +mm_aggression( + struct monst *magr, /**< monster that is currently deciding where to move */ + struct monst *mdef) /**< another monster which is next to it */ { struct permonst *ma, *md; @@ -1742,9 +1720,9 @@ struct monst *magr, /* monster that is currently deciding where to move */ /* Monster displacing another monster out of the way */ static long -mm_displacement(magr, mdef) -struct monst *magr, /* monster that is currently deciding where to move */ - *mdef; /* another monster which is next to it */ +mm_displacement( + struct monst *magr, /**< monster that is currently deciding where to move */ + struct monst *mdef) /**< another monster which is next to it */ { struct permonst *pa = magr->data, *pd = mdef->data; @@ -1766,9 +1744,7 @@ struct monst *magr, /* monster that is currently deciding where to move */ /* Is the square close enough for the monster to move or attack into? */ boolean -monnear(mon, x, y) -struct monst *mon; -int x, y; +monnear(struct monst *mon, int x, int y) { int distance = dist2(mon->mx, mon->my, x, y); @@ -1780,7 +1756,7 @@ int x, y; /* really free dead monsters */ void -dmonsfree() +dmonsfree(void) { struct monst **mtmp, *freetmp; int count = 0; @@ -1815,8 +1791,7 @@ dmonsfree() /* called when monster is moved to larger structure */ void -replmon(mtmp, mtmp2) -struct monst *mtmp, *mtmp2; +replmon(struct monst *mtmp, struct monst *mtmp2) { struct obj *otmp; @@ -1861,9 +1836,7 @@ struct monst *mtmp, *mtmp2; /* release mon from the display and the map's monster list, maybe transfer it to one of the other monster lists */ void -relmon(mon, monst_list) -struct monst *mon; -struct monst **monst_list; /* &migrating_mons or &mydogs or null */ +relmon(struct monst *mon, struct monst **monst_list) /**< &migrating_mons or &mydogs or null */ { struct monst *mtmp; int mx = mon->mx, my = mon->my; @@ -1922,8 +1895,7 @@ struct monst **monst_list; /* &migrating_mons or &mydogs or null */ } void -copy_mextra(mtmp2, mtmp1) -struct monst *mtmp2, *mtmp1; +copy_mextra(struct monst *mtmp2, struct monst *mtmp1) { if (!mtmp2 || !mtmp1 || !mtmp1->mextra) return; @@ -1964,8 +1936,7 @@ struct monst *mtmp2, *mtmp1; } void -dealloc_mextra(m) -struct monst *m; +dealloc_mextra(struct monst *m) { struct mextra *x = m->mextra; @@ -1997,8 +1968,7 @@ struct monst *m; } void -dealloc_monst(mon) -struct monst *mon; +dealloc_monst(struct monst *mon) { char buf[QBUFSZ]; @@ -2014,9 +1984,7 @@ struct monst *mon; /* remove effects of mtmp from other data structures */ static void -m_detach(mtmp, mptr) -struct monst *mtmp; -struct permonst *mptr; /* reflects mtmp->data _prior_ to mtmp's death */ +m_detach(struct monst *mtmp, struct permonst *mptr) /**< reflects mtmp->data _prior_ to mtmp's death */ { boolean onmap = (mtmp->mx > 0); @@ -2063,8 +2031,7 @@ struct permonst *mptr; /* reflects mtmp->data _prior_ to mtmp's death */ /* find the worn amulet of life saving which will save a monster */ struct obj * -mlifesaver(mon) -struct monst *mon; +mlifesaver(struct monst *mon) { if (!nonliving(mon->data) || is_vampshifter(mon)) { struct obj *otmp = which_armor(mon, W_AMUL); @@ -2077,12 +2044,12 @@ struct monst *mon; static void #ifdef WEBB_DISINT -lifesaved_monster(mtmp, adtyp) -struct monst *mtmp; -uchar adtyp; +lifesaved_monster(struct monst *mtmp, uchar adtyp) + + #else -lifesaved_monster(mtmp) -struct monst *mtmp; + + #endif { struct obj *lifesave = mlifesaver(mtmp); @@ -2144,16 +2111,15 @@ mondead(mtmp) register struct monst *mtmp; #else void -mondead(mtmp) -register struct monst *mtmp; +mondead(register struct monst *mtmp) { mondead_helper(mtmp, 0); /* mmm... default parameter values */ } void -mondead_helper(mtmp, adtyp) -register struct monst * mtmp; -uchar adtyp; +mondead_helper(register struct monst *mtmp, uchar adtyp) + + #endif { struct permonst *mptr; @@ -2333,10 +2299,10 @@ uchar adtyp; /** TRUE if corpse might be dropped, magr may die if mon was swallowed */ boolean -corpse_chance(mon, magr, was_swallowed) -struct monst *mon; -struct monst *magr; /* killer, if swallowed */ -boolean was_swallowed; /* digestion */ +corpse_chance( + struct monst *mon, + struct monst *magr, /**< killer, if swallowed */ + boolean was_swallowed) /**< digestion */ { struct permonst *mdat = mon->data; int i, tmp; @@ -2416,8 +2382,7 @@ boolean was_swallowed; /* digestion */ /** Creates Cthulhu's death message and death cloud. */ void -cthulhu_dies(mon) -struct monst *mon; /**< Cthulhu's struct */ +cthulhu_dies(struct monst *mon) /**< Cthulhu's struct */ { /* really dead? */ if (mon->mhp <= 0) { @@ -2442,8 +2407,7 @@ struct monst *mon; /**< Cthulhu's struct */ } void -spore_dies(mon) -struct monst *mon; +spore_dies(struct monst *mon) { if (mon->mhp <= 0) { int sporetype; @@ -2522,8 +2486,7 @@ struct monst *mon; /** drop (perhaps) a cadaver and remove monster */ void -mondied(mdef) -register struct monst *mdef; +mondied(register struct monst *mdef) { mondead(mdef); if (!DEADMONSTER(mdef)) { @@ -2537,8 +2500,7 @@ register struct monst *mdef; /** monster disappears, not dies */ void -mongone(mdef) -struct monst *mdef; +mongone(struct monst *mdef) { mdef->mhp = 0; /* can skip some inventory bookkeeping */ @@ -2564,8 +2526,7 @@ struct monst *mdef; /** drop a statue or rock and remove monster */ void -monstone(mdef) -struct monst *mdef; +monstone(struct monst *mdef) { struct obj *otmp, *obj, *oldminvent; xchar x = mdef->mx, y = mdef->my; @@ -2651,10 +2612,7 @@ struct monst *mdef; /* another monster has killed the monster mdef */ void -monkilled(mdef, fltxt, how) -register struct monst *mdef; -const char *fltxt; -int how; +monkilled(register struct monst *mdef, const char *fltxt, int how) { boolean be_sad = FALSE; /* true if unseen pet is killed */ boolean kenny = (!strcmp(m_monnam(mdef), "Kenny")); @@ -2701,8 +2659,7 @@ int how; } void -unstuck(mtmp) -register struct monst *mtmp; +unstuck(register struct monst *mtmp) { if (u.ustuck == mtmp) { if (u.uswallow) { @@ -2726,17 +2683,16 @@ register struct monst *mtmp; } void -killed(mtmp) -register struct monst *mtmp; +killed(register struct monst *mtmp) { xkilled(mtmp, XKILL_GIVEMSG); } /* the player has killed the monster mtmp */ void -xkilled(mtmp, xkill_flags) -struct monst *mtmp; -int xkill_flags; /* 1: suppress message, 2: suppress corpse, 4: pacifist */ +xkilled( + struct monst *mtmp, + int xkill_flags) /**< 1: suppress message, 2: suppress corpse, 4: pacifist */ { int tmp, x = mtmp->mx, y = mtmp->my; struct permonst *mdat; @@ -2955,8 +2911,7 @@ int xkill_flags; /* 1: suppress message, 2: suppress corpse, 4: pacifist */ /* changes the monster into a stone monster of the same type */ /* this should only be called when poly_when_stoned() is true */ void -mon_to_stone(mtmp) -register struct monst *mtmp; +mon_to_stone(register struct monst *mtmp) { if (mtmp->data->mlet == S_GOLEM) { /* it's a golem, and not a stone golem */ @@ -2978,8 +2933,7 @@ register struct monst *mtmp; } boolean -vamp_stone(mtmp) -struct monst *mtmp; +vamp_stone(struct monst *mtmp) { if (is_vampshifter(mtmp)) { int mndx = mtmp->cham; @@ -3051,8 +3005,7 @@ struct monst *mtmp; /* drop monster into "limbo" - that is, migrate to the current level */ void -m_into_limbo(mtmp) -struct monst *mtmp; +m_into_limbo(struct monst *mtmp) { xchar target_lev = ledger_no(&u.uz), xyloc = MIGR_APPROX_XY; @@ -3061,9 +3014,7 @@ struct monst *mtmp; } static void -migrate_mon(mtmp, target_lev, xyloc) -struct monst *mtmp; -xchar target_lev, xyloc; +migrate_mon(struct monst *mtmp, xchar target_lev, xchar xyloc) { unstuck(mtmp); mdrop_special_objs(mtmp); @@ -3072,8 +3023,7 @@ xchar target_lev, xyloc; } static boolean -ok_to_obliterate(mtmp) -struct monst *mtmp; +ok_to_obliterate(struct monst *mtmp) { /* * Add checks for monsters that should not be obliterated @@ -3092,8 +3042,7 @@ struct monst *mtmp; } void -elemental_clog(mon) -struct monst *mon; +elemental_clog(struct monst *mon) { int m_lev = 0; static long msgmv = 0L; @@ -3174,8 +3123,7 @@ struct monst *mon; /* make monster mtmp next to you (if possible); might place monst on far side of a wall or boulder */ void -mnexto(mtmp) -struct monst *mtmp; +mnexto(struct monst *mtmp) { coord mm; boolean couldspot = canspotmon(mtmp); @@ -3202,8 +3150,7 @@ struct monst *mtmp; } static void -deal_with_overcrowding(mtmp) -struct monst *mtmp; +deal_with_overcrowding(struct monst *mtmp) { if (In_endgame(&u.uz)) { debugpline1("overcrowding: elemental_clog on %s", m_monnam(mtmp)); @@ -3216,8 +3163,7 @@ struct monst *mtmp; /* like mnexto() but requires destination to be directly accessible */ void -maybe_mnexto(mtmp) -struct monst *mtmp; +maybe_mnexto(struct monst *mtmp) { coord mm; struct permonst *ptr = mtmp->data; @@ -3249,10 +3195,11 @@ struct monst *mtmp; * will be False on the nested call so there won't be any further recursion. */ int -mnearto(mtmp, x, y, move_other) -register struct monst *mtmp; -xchar x, y; -boolean move_other; /* make sure mtmp gets to x, y! so move m_at(x, y) */ +mnearto( + struct monst *mtmp, + xchar x, + xchar y, + boolean move_other) /**< make sure mtmp gets to x, y! so move m_at(x, y) */ { struct monst *othermon = (struct monst *)0; xchar newx, newy; @@ -3317,19 +3264,17 @@ static const char *poiseff[] = { }; void -poisontell(typ) - -int typ; +poisontell(int typ) { pline("You%s.", poiseff[typ]); } /** Called when an attack or trap has poisoned hero */ void -poisoned(const char *reason, /* controls what messages we display */ +poisoned(const char *reason, /**< controls what messages we display */ int typ, - const char *pkiller, /* for score+log file if fatal */ - int fatal) /* if fatal is 0, limit damage to adjattrib */ + const char *pkiller, /**< for score+log file if fatal */ + int fatal) /**< if fatal is 0, limit damage to adjattrib */ { int i, loss, plural, kprefix = KILLED_BY_AN; boolean thrown_weapon = (fatal < 0); @@ -3414,8 +3359,7 @@ poisoned(const char *reason, /* controls what messages we display */ /* monster responds to player action; not the same as a passive attack */ /* assumes reason for response has been tested, and response _must_ be made */ void -m_respond(mtmp) -struct monst *mtmp; +m_respond(struct monst *mtmp) { if (mtmp->data->msound == MS_SHRIEK) { if (!Deaf) { @@ -3448,9 +3392,7 @@ struct monst *mtmp; where mtmp was already hostile; it checks for situations where the player shouldn't be attacking and any ramifications /that/ might have. */ void -setmangry(mtmp, via_attack) -struct monst *mtmp; -boolean via_attack UNUSED; +setmangry(struct monst *mtmp, boolean via_attack UNUSED) { mtmp->mstrategy &= ~STRAT_WAITMASK; #ifdef BLACKMARKET @@ -3509,9 +3451,7 @@ boolean via_attack UNUSED; /* wake up a monster, possibly making it angry in the process */ void -wakeup(mtmp, via_attack) -struct monst *mtmp; -boolean via_attack; +wakeup(struct monst *mtmp, boolean via_attack) { mtmp->msleeping = 0; if (M_AP_TYPE(mtmp)) { @@ -3528,15 +3468,14 @@ boolean via_attack; /* Wake up nearby monsters. */ void -wake_nearby() +wake_nearby(void) { wake_nearto(u.ux, u.uy, u.ulevel * 20); } /* Wake up monsters near some particular location. */ void -wake_nearto(x, y, distance) -int x, y, distance; +wake_nearto(int x, int y, int distance) { struct monst *mtmp; @@ -3568,8 +3507,7 @@ int x, y, distance; /* NOTE: we must check for mimicry before calling this routine */ void -seemimic(mtmp) -register struct monst *mtmp; +seemimic(register struct monst *mtmp) { boolean is_blocker_appear = (is_lightblocker_mappear(mtmp)); @@ -3593,7 +3531,7 @@ register struct monst *mtmp; /* force all chameleons to become normal */ void -rescham() +rescham(void) { register struct monst *mtmp; int mcham; @@ -3620,7 +3558,7 @@ rescham() /* Let the chameleons change again -dgk */ void -restartcham() +restartcham(void) { struct monst *mtmp; @@ -3641,8 +3579,7 @@ restartcham() against shape-changing might be different now than it was at the time the level was saved. */ void -restore_cham(mon) -struct monst *mon; +restore_cham(struct monst *mon) { int mcham; @@ -3661,8 +3598,7 @@ struct monst *mon; /* unwatched hiders may hide again; if so, returns True */ static boolean -restrap(mtmp) -register struct monst *mtmp; +restrap(register struct monst *mtmp) { struct trap *t; @@ -3688,8 +3624,7 @@ register struct monst *mtmp; /* monster/hero tries to hide under something at the current location */ boolean -hideunder(mtmp) -struct monst *mtmp; +hideunder(struct monst *mtmp) { struct trap *t; boolean undetected = FALSE, is_u = (mtmp == &youmonst); @@ -3723,8 +3658,7 @@ struct monst *mtmp; /* called when returning to a previously visited level */ void -hide_monst(mon) -struct monst *mon; +hide_monst(struct monst *mon) { boolean hider_under = hides_under(mon->data) || mon->data->mlet == S_EEL; @@ -3753,8 +3687,7 @@ short *animal_list = 0; /* list of PM values for animal monsters */ int animal_list_count; void -mon_animal_list(construct) -boolean construct; +mon_animal_list(boolean construct) { if (construct) { short animal_temp[SPECIAL_PM]; @@ -3778,7 +3711,7 @@ boolean construct; } static int -pick_animal() +pick_animal(void) { if (!animal_list) { mon_animal_list(TRUE); @@ -3795,9 +3728,7 @@ pick_animal() } void -decide_to_shapeshift(mon, shiftflags) -struct monst *mon; -int shiftflags; +decide_to_shapeshift(struct monst *mon, int shiftflags) { struct permonst *ptr = 0; int mndx; @@ -3859,8 +3790,7 @@ int shiftflags; } static int -pickvampshape(mon) -struct monst *mon; +pickvampshape(struct monst *mon) { int mndx = mon->cham, wolfchance = 10; /* avoid picking monsters with lowercase display symbols ('d' for wolf @@ -3889,8 +3819,7 @@ struct monst *mon; /* nonshapechangers who warrant special polymorph handling */ static boolean -isspecmon(mon) -struct monst *mon; +isspecmon(struct monst *mon) { return (mon->isshk || mon->ispriest || @@ -3902,9 +3831,7 @@ struct monst *mon; vault guards) to forms that allow them to behave sensibly (catching gold, speaking?) so that they don't need too much extra code */ static boolean -validspecmon(mon, mndx) -struct monst *mon; -int mndx; +validspecmon(struct monst *mon, int mndx) { if (mndx == NON_PM) { return TRUE; /* caller wants random */ @@ -3929,9 +3856,7 @@ int mndx; /* prevent wizard mode user from specifying invalid vampshifter shape */ boolean -validvamp(mon, mndx_p, monclass) -struct monst *mon; -int *mndx_p, monclass; +validvamp(struct monst *mon, int *mndx_p, int monclass) { /* simplify caller's usage */ if (!is_vampshifter(mon)) { @@ -3983,8 +3908,7 @@ int *mndx_p, monclass; } int -select_newcham_form(mon) -struct monst *mon; +select_newcham_form(struct monst *mon) { int mndx = NON_PM; int tryct; @@ -4120,9 +4044,7 @@ struct monst *mon; /* this used to be inline within newcham() but monpolycontrol needs it too */ static struct permonst * -accept_newcham_form(mon, mndx) -struct monst *mon; -int mndx; +accept_newcham_form(struct monst *mon, int mndx) { struct permonst *mdat; @@ -4152,9 +4074,7 @@ int mndx; } void -mgender_from_permonst(mtmp, mdat) -struct monst *mtmp; -struct permonst *mdat; +mgender_from_permonst(struct monst *mtmp, struct permonst *mdat) { if (is_male(mdat)) { if (mtmp->female) { @@ -4175,11 +4095,11 @@ struct permonst *mdat; (possibly self-inflicted) become a different monster; returns 1 if it actually changes form */ int -newcham(mtmp, mdat, polyspot, msg) -struct monst *mtmp; -struct permonst *mdat; -boolean polyspot; /* change is the result of wand or spell of polymorph */ -boolean msg; /* "The oldmon turns into a newmon!" */ +newcham( + struct monst *mtmp, + struct permonst *mdat, + boolean polyspot, /**< change is the result of wand or spell of polymorph */ + boolean msg) /**< "The oldmon turns into a newmon!" */ { int mhp, hpn, hpd; int mndx, tryct; @@ -4427,8 +4347,7 @@ boolean msg; /* "The oldmon turns into a newmon!" */ * NON_PM if the given monster can't be hatched. */ int -can_be_hatched(mnum) -int mnum; +can_be_hatched(int mnum) { /* ranger quest nemesis has the oviparous bit set, making it be possible to wish for eggs of that unique monster; turn @@ -4449,9 +4368,9 @@ int mnum; /* type of egg laid by #sit; usually matches parent */ int -egg_type_from_parent(mnum, force_ordinary) -int mnum; /* parent monster; caller must handle lays_eggs() check */ -boolean force_ordinary; +egg_type_from_parent(int mnum, boolean force_ordinary) + /* parent monster; caller must handle lays_eggs() check */ + { if (force_ordinary || !BREEDER_EGG) { if (mnum == PM_QUEEN_BEE) mnum = PM_KILLER_BEE; @@ -4463,9 +4382,7 @@ boolean force_ordinary; /* decide whether an egg of the indicated monster type is viable; */ /* also used to determine whether an egg or tin can be created... */ boolean -dead_species(m_idx, egg) -int m_idx; -boolean egg; +dead_species(int m_idx, boolean egg) { /* generic eggs are unhatchable and have corpsenm of NON_PM */ if (m_idx < LOW_PM) { @@ -4485,8 +4402,7 @@ boolean egg; /* kill off any eggs of genocided monsters */ static void -kill_eggs(obj_list) -struct obj *obj_list; +kill_eggs(struct obj *obj_list) { struct obj *otmp; @@ -4516,7 +4432,7 @@ struct obj *obj_list; /** kill all members of genocided species */ void -kill_genocided_monsters() +kill_genocided_monsters(void) { struct monst *mtmp, *mtmp2; boolean kill_cham; @@ -4560,8 +4476,7 @@ kill_genocided_monsters() * level. */ void -kill_monster_on_level(mndx) -int mndx; /**< Monster index number */ +kill_monster_on_level(int mndx) /**< Monster index number */ { struct monst *mtmp; struct monst *mtmp2; @@ -4578,9 +4493,7 @@ int mndx; /**< Monster index number */ } void -golemeffects(mon, damtype, dam) -register struct monst *mon; -int damtype, dam; +golemeffects(register struct monst *mon, int damtype, int dam) { int heal = 0, slow = 0; @@ -4611,8 +4524,7 @@ int damtype, dam; } boolean -angry_guards(silent) -boolean silent; +angry_guards(boolean silent) { struct monst *mtmp; int ct = 0, nct = 0, sct = 0, slct = 0; @@ -4654,7 +4566,7 @@ boolean silent; } void -pacify_guards() +pacify_guards(void) { register struct monst *mtmp; @@ -4667,9 +4579,7 @@ pacify_guards() } void -mimic_hit_msg(mtmp, otyp) -struct monst *mtmp; -short otyp; +mimic_hit_msg(struct monst *mtmp, short int otyp) { short ap = mtmp->mappearance; @@ -4689,8 +4599,7 @@ short otyp; } boolean -usmellmon(mdat) -struct permonst *mdat; +usmellmon(struct permonst *mdat) { int mndx; boolean nonspecific = FALSE; diff --git a/src/mondata.c b/src/mondata.c index d8cc2fd8b..7a19b4a09 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -9,9 +9,7 @@ /* set up an individual monster's base type (initial creation, shapechange) */ void -set_mon_data(mon, ptr) -struct monst *mon; -struct permonst *ptr; +set_mon_data(struct monst *mon, struct permonst *ptr) { int new_speed, old_speed = mon->data ? mon->data->mmove : 0; @@ -39,9 +37,7 @@ struct permonst *ptr; /* does monster-type have any attack for a specific type of damage? */ struct attack * -attacktype_fordmg(ptr, atyp, dtyp) -struct permonst *ptr; -int atyp, dtyp; +attacktype_fordmg(struct permonst *ptr, int atyp, int dtyp) { struct attack *a; @@ -54,17 +50,14 @@ int atyp, dtyp; /* does monster-type have a particular type of attack */ boolean -attacktype(ptr, atyp) -struct permonst *ptr; -int atyp; +attacktype(struct permonst *ptr, int atyp) { return attacktype_fordmg(ptr, atyp, AD_ANY) ? TRUE : FALSE; } /* returns True if monster doesn't attack, False if it does */ boolean -noattacks(ptr) -struct permonst *ptr; +noattacks(struct permonst *ptr) { int i; struct attack *mattk = ptr->mattk; @@ -84,8 +77,7 @@ struct permonst *ptr; } /* does monster-type transform into something else when petrified? */ boolean -poly_when_stoned(ptr) -struct permonst *ptr; +poly_when_stoned(struct permonst *ptr) { /* non-stone golems turn into stone golems unless latter is genocided */ return((boolean)(is_golem(ptr) && ptr != &mons[PM_STONE_GOLEM] && @@ -95,8 +87,7 @@ struct permonst *ptr; /* returns True if monster is drain-life resistant */ boolean -resists_drli(mon) -struct monst *mon; +resists_drli(struct monst *mon) { struct permonst *ptr = mon->data; @@ -113,8 +104,7 @@ struct monst *mon; /* TRUE if monster is magic-missile (actually, general magic) resistant */ boolean -resists_magm(mon) -struct monst *mon; +resists_magm(struct monst *mon) { struct permonst *ptr = mon->data; boolean is_you = (mon == &youmonst); @@ -150,8 +140,7 @@ struct monst *mon; /* TRUE iff monster is resistant to light-induced blindness */ boolean -resists_blnd(mon) -struct monst *mon; +resists_blnd(struct monst *mon) { struct permonst *ptr = mon->data; boolean is_you = (mon == &youmonst); @@ -191,11 +180,11 @@ struct monst *mon; /* TRUE iff monster can be blinded by the given attack; note: may return TRUE when mdef is blind (e.g. new cream-pie attack) */ boolean -can_blnd(magr, mdef, aatyp, obj) -struct monst *magr; /* NULL == no specific aggressor */ -struct monst *mdef; -uchar aatyp; -struct obj *obj; /* aatyp == AT_WEAP, AT_SPIT */ +can_blnd( + struct monst *magr, /**< NULL == no specific aggressor */ + struct monst *mdef, + uchar aatyp, + struct obj *obj) /**< aatyp == AT_WEAP, AT_SPIT */ { boolean is_you = (mdef == &youmonst); boolean check_visor = FALSE; @@ -275,8 +264,7 @@ struct obj *obj; /* aatyp == AT_WEAP, AT_SPIT */ /* returns TRUE if monster can attack at range */ boolean -ranged_attk(ptr) -struct permonst *ptr; +ranged_attk(struct permonst *ptr) { register int i, atyp; long atk_mask = (1L << AT_BREA) | (1L << AT_SPIT) | (1L << AT_GAZE); @@ -298,16 +286,14 @@ struct permonst *ptr; /* TRUE if specific monster is especially affected by silver weapons */ boolean -mon_hates_silver(mon) -struct monst *mon; +mon_hates_silver(struct monst *mon) { return (boolean) (is_vampshifter(mon) || hates_silver(mon->data)); } /* returns TRUE if monster is especially affected by silver weapons */ boolean -hates_silver(ptr) -register struct permonst *ptr; +hates_silver(register struct permonst *ptr) { return((boolean)(is_were(ptr) || is_vampire(ptr) || is_demon(ptr) || ptr == &mons[PM_SHADE] || @@ -316,16 +302,14 @@ register struct permonst *ptr; /* True if specific monster is especially affected by light-emitting weapons */ boolean -mon_hates_light(mon) -struct monst *mon; +mon_hates_light(struct monst *mon) { return (boolean) (hates_light(mon->data)); } /** TRUE iff the type of monster pass through iron bars */ boolean -passes_bars(mptr) -struct permonst *mptr; +passes_bars(struct permonst *mptr) { return (boolean) (passes_walls(mptr) || amorphous(mptr) || unsolid(mptr) || is_whirly(mptr) || verysmall(mptr) || @@ -336,8 +320,7 @@ struct permonst *mptr; /** returns TRUE if monster can blow (whistle, etc.) */ boolean -can_blow(mtmp) -struct monst *mtmp; +can_blow(struct monst *mtmp) { if ((is_silent(mtmp->data) || mtmp->data->msound == MS_BUZZ) && (breathless(mtmp->data) || @@ -354,8 +337,7 @@ struct monst *mtmp; /* for casting spells and reading scrolls while blind */ boolean -can_chant(mtmp) -struct monst *mtmp; +can_chant(struct monst *mtmp) { if ((mtmp == &youmonst && Strangled) || is_silent(mtmp->data) || @@ -369,8 +351,7 @@ struct monst *mtmp; /** TRUE if mon is vulnerable to strangulation */ boolean -can_be_strangled(mon) -struct monst *mon; +can_be_strangled(struct monst *mon) { /* For amulet of strangulation support: here we're considering strangulation to be loss of blood flow to the brain due to @@ -403,8 +384,7 @@ struct monst *mon; /** returns TRUE if monster can track well */ boolean -can_track(ptr) -register struct permonst *ptr; +can_track(register struct permonst *ptr) { if (uwep && uwep->oartifact == ART_EXCALIBUR) return TRUE; @@ -414,8 +394,7 @@ register struct permonst *ptr; /** creature will slide out of armor */ boolean -sliparm(ptr) -register struct permonst *ptr; +sliparm(register struct permonst *ptr) { return((boolean)(is_whirly(ptr) || ptr->msize <= MZ_SMALL || noncorporeal(ptr))); @@ -423,8 +402,7 @@ register struct permonst *ptr; /** creature will break out of armor */ boolean -breakarm(ptr) -register struct permonst *ptr; +breakarm(register struct permonst *ptr) { if (sliparm(ptr)) { return FALSE; @@ -439,8 +417,7 @@ register struct permonst *ptr; /** creature sticks other creatures it hits */ boolean -sticks(ptr) -register struct permonst *ptr; +sticks(register struct permonst *ptr) { return((boolean)(dmgtype(ptr, AD_STCK) || dmgtype(ptr, AD_WRAP) || attacktype(ptr, AT_HUGS))); @@ -448,8 +425,7 @@ register struct permonst *ptr; /* some monster-types can't vomit */ boolean -cantvomit(ptr) -struct permonst *ptr; +cantvomit(struct permonst *ptr) { /* rats and mice are incapable of vomiting; which other creatures have the same limitation? */ @@ -461,8 +437,7 @@ struct permonst *ptr; /* number of horns this type of monster has on its head */ int -num_horns(ptr) -struct permonst *ptr; +num_horns(struct permonst *ptr) { switch (monsndx(ptr)) { case PM_HORNED_DEVIL: /* ? "more than one" */ @@ -484,9 +459,7 @@ struct permonst *ptr; /** does monster-type deal out a particular type of damage from a particular type of attack? */ struct attack * -dmgtype_fromattack(ptr, dtyp, atyp) -struct permonst *ptr; -int dtyp, atyp; +dmgtype_fromattack(struct permonst *ptr, int dtyp, int atyp) { struct attack *a; @@ -499,9 +472,7 @@ int dtyp, atyp; /* does monster-type deal out a particular type of damage from any attack */ boolean -dmgtype(ptr, dtyp) -struct permonst *ptr; -int dtyp; +dmgtype(struct permonst *ptr, int dtyp) { return dmgtype_fromattack(ptr, dtyp, AT_ANY) ? TRUE : FALSE; } @@ -509,8 +480,7 @@ int dtyp; /* returns the maximum damage a defender can do to the attacker via * a passive defense */ int -max_passive_dmg(mdef, magr) -register struct monst *mdef, *magr; +max_passive_dmg(register struct monst *mdef, register struct monst *magr) { int i, dmg = 0, multi2 = 0; uchar adtyp; @@ -557,8 +527,7 @@ register struct monst *mdef, *magr; /* determine whether two monster types are from the same species */ boolean -same_race(pm1, pm2) -struct permonst *pm1, *pm2; +same_race(struct permonst *pm1, struct permonst *pm2) { char let1 = pm1->mlet, let2 = pm2->mlet; @@ -662,8 +631,7 @@ struct permonst *pm1, *pm2; /* return an index into the mons array */ int -monsndx(ptr) -struct permonst *ptr; +monsndx(struct permonst *ptr) { register int i; @@ -688,8 +656,7 @@ struct alt_spl { /* figure out what type of monster a user-supplied string is specifying */ int -name_to_mon(in_str) -const char *in_str; +name_to_mon(const char *in_str) { /* Be careful. We must check the entire string in case it was * something such as "ettin zombie corpse". The calling routine @@ -833,9 +800,7 @@ const char *in_str; /** monster class from user input; used for genocide and controlled polymorph; returns 0 rather than MAXMCLASSES if no match is found */ int -name_to_monclass(in_str, mndx_p) -const char *in_str; -int *mndx_p; +name_to_monclass(const char *in_str, int *mndx_p) { /* Single letters are matched against def_monsyms[].sym; words or phrases are first matched against def_monsyms[].explain @@ -944,8 +909,7 @@ int *mndx_p; /* returns 3 values (0=male, 1=female, 2=none) */ int -gender(mtmp) -register struct monst *mtmp; +gender(register struct monst *mtmp) { if (is_neuter(mtmp->data)) return 2; return mtmp->female; @@ -954,9 +918,9 @@ register struct monst *mtmp; /* Like gender(), but lower animals and such are still "it". */ /* This is the one we want to use when printing messages. */ int -pronoun_gender(mtmp, override_vis) -register struct monst *mtmp; -boolean override_vis; /* if True then 'no it' unless neuter */ +pronoun_gender( + struct monst *mtmp, + boolean override_vis) /**< if True then 'no it' unless neuter */ { if (!override_vis && !canspotmon(mtmp)) { return 2; @@ -970,8 +934,7 @@ boolean override_vis; /* if True then 'no it' unless neuter */ /* used for nearby monsters when you go to another level */ boolean -levl_follower(mtmp) -struct monst *mtmp; +levl_follower(struct monst *mtmp) { if (mtmp == u.usteed) { return TRUE; @@ -1064,8 +1027,7 @@ static const short grownups[][2] = { }; int -little_to_big(montype) -int montype; +little_to_big(int montype) { register int i; @@ -1075,8 +1037,7 @@ int montype; } int -big_to_little(montype) -int montype; +big_to_little(int montype) { register int i; @@ -1088,8 +1049,7 @@ int montype; /* determine whether two permonst indices are part of the same progression; existence of progressions with more than one step makes it a bit tricky */ boolean -big_little_match(montyp1, montyp2) -int montyp1, montyp2; +big_little_match(int montyp1, int montyp2) { int l, b; @@ -1123,8 +1083,7 @@ int montyp1, montyp2; * player. It does not return a pointer to player role character. */ const struct permonst * -raceptr(mtmp) -struct monst *mtmp; +raceptr(struct monst *mtmp) { if (mtmp == &youmonst && !Upolyd) return(&mons[urace.malenum]); else return(mtmp->data); @@ -1139,9 +1098,7 @@ static const char *immobile[4] = { "wiggle", "Wiggle", "pulsate", "Pulsate" }; static const char *crawl[4] = { "crawl", "Crawl", "falter", "Falter" }; const char * -locomotion(ptr, def) -const struct permonst *ptr; -const char *def; +locomotion(const struct permonst *ptr, const char *def) { int capitalize = (*def == highc(*def)); @@ -1159,9 +1116,7 @@ const char *def; } const char * -stagger(ptr, def) -const struct permonst *ptr; -const char *def; +stagger(const struct permonst *ptr, const char *def) { int capitalize = 2 + (*def == highc(*def)); @@ -1180,9 +1135,7 @@ const char *def; /* return a phrase describing the effect of fire attack on a type of monster */ const char * -on_fire(mptr, mattk) -struct permonst *mptr; -struct attack *mattk; +on_fire(struct permonst *mptr, struct attack *mattk) { const char *what; @@ -1228,8 +1181,7 @@ struct attack *mattk; * We're assuming all insects can smell at a distance too. */ boolean -olfaction(mdat) -struct permonst *mdat; +olfaction(struct permonst *mdat) { if (is_golem(mdat) || mdat->mlet == S_EYE /* spheres */ @@ -1244,8 +1196,7 @@ struct permonst *mdat; /** Return TRUE if the monster has flesh. */ boolean -is_fleshy(ptr) -const struct permonst *ptr; +is_fleshy(const struct permonst *ptr) { if (vegetarian(ptr)) { /* vegetarian monsters generally don't have flesh */ diff --git a/src/monmove.c b/src/monmove.c index f52603355..33cf291b5 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -11,15 +11,14 @@ static int disturb(struct monst *); static void distfleeck(struct monst *, int *, int *, int *); static int m_arrival(struct monst *); static void watch_on_duty(struct monst *); -static int vamp_shift(struct monst *, struct permonst *, BOOLEAN_P); +static int vamp_shift(struct monst *, struct permonst *, boolean); static void make_group_attackers_flee(struct monst* mtmp); static void share_hp(struct monst* mon1, struct monst* mon2); /* TRUE if mtmp died */ boolean -mb_trapped(mtmp) -register struct monst *mtmp; +mb_trapped(register struct monst *mtmp) { if (flags.verbose) { if (cansee(mtmp->mx, mtmp->my) && !Unaware) { @@ -43,9 +42,9 @@ register struct monst *mtmp; /* check whether a monster is carrying a locking/unlocking tool */ boolean -mon_has_key(mon, for_unlocking) -struct monst *mon; -boolean for_unlocking; /* true => credit card ok, false => not ok */ +mon_has_key( + struct monst *mon, + boolean for_unlocking) /**< TRUE => credit card ok, FALSE => not ok */ { if (for_unlocking && m_carrying(mon, CREDIT_CARD)) { return TRUE; @@ -54,9 +53,7 @@ boolean for_unlocking; /* true => credit card ok, false => not ok */ } void -mon_yells(mon, shout) -struct monst *mon; -const char *shout; +mon_yells(struct monst *mon, const char *shout) { if (Deaf) { if (canspotmon(mon)) { @@ -80,8 +77,7 @@ const char *shout; } static void -watch_on_duty(mtmp) -register struct monst *mtmp; +watch_on_duty(register struct monst *mtmp) { int x, y; @@ -117,8 +113,7 @@ register struct monst *mtmp; } int -dochugw(mtmp) -register struct monst *mtmp; +dochugw(register struct monst *mtmp) { int x = mtmp->mx, y = mtmp->my; boolean already_saw_mon = !occupation ? 0 : canspotmon(mtmp); @@ -144,9 +139,7 @@ register struct monst *mtmp; } boolean -onscary(x, y, mtmp) -int x, y; -struct monst *mtmp; +onscary(int x, int y, struct monst *mtmp) { /* creatures who are directly resistant to magical scaring: * @@ -188,9 +181,7 @@ struct monst *mtmp; /* regenerate lost hit points */ void -mon_regen(mon, digest_meal) -struct monst *mon; -boolean digest_meal; +mon_regen(struct monst *mon, boolean digest_meal) { /* regeneration not relevant in heaven or hell mode */ if (heaven_or_hell_mode && !hell_and_hell_mode) { @@ -222,8 +213,7 @@ boolean digest_meal; * jolted awake. */ static int -disturb(mtmp) -register struct monst *mtmp; +disturb(register struct monst *mtmp) { /* * + Ettins are hard to surprise. @@ -259,8 +249,7 @@ register struct monst *mtmp; /* ungrab/expel held/swallowed hero */ static void -release_hero(mon) -struct monst *mon; +release_hero(struct monst *mon) { if (mon == u.ustuck) { if (u.uswallow) { @@ -282,11 +271,7 @@ struct monst *mon; * if first, only adds fleetime if monster isn't already fleeing * if fleemsg, prints a message about new flight, otherwise, caller should */ void -monflee(mtmp, fleetime, first, fleemsg) -struct monst *mtmp; -int fleetime; -boolean first; -boolean fleemsg; +monflee(struct monst *mtmp, int fleetime, boolean first, boolean fleemsg) { /* shouldn't happen; maybe warrants impossible()? */ if (DEADMONSTER(mtmp)) { @@ -337,9 +322,7 @@ boolean fleemsg; } static void -distfleeck(mtmp, inrange, nearby, scared) -register struct monst *mtmp; -int *inrange, *nearby, *scared; +distfleeck(register struct monst *mtmp, int *inrange, int *nearby, int *scared) { int seescaryx, seescaryy; boolean sawscary = FALSE, bravegremlin = (rn2(5) == 0); @@ -383,8 +366,7 @@ int *inrange, *nearby, *scared; /* perform a special one-time action for a monster; returns -1 if nothing special happened, 0 if monster uses up its turn, 1 if monster is killed */ static int -m_arrival(mon) -struct monst *mon; +m_arrival(struct monst *mon) { mon->mstrategy &= ~STRAT_ARRIVE;/* always reset */ @@ -396,8 +378,7 @@ struct monst *mon; * code. --KAA */ int -dochug(mtmp) -register struct monst *mtmp; +dochug(register struct monst *mtmp) { register struct permonst *mdat; register int tmp=0; @@ -796,8 +777,7 @@ static NEARDATA const char boulder_class[] = { ROCK_CLASS, 0 }; static NEARDATA const char gem_class[] = { GEM_CLASS, 0 }; boolean -itsstuck(mtmp) -register struct monst *mtmp; +itsstuck(register struct monst *mtmp) { if (sticks(youmonst.data) && mtmp == u.ustuck && !u.uswallow) { pline("%s cannot escape from you!", Monnam(mtmp)); @@ -814,12 +794,12 @@ register struct monst *mtmp; * those should be used instead. This function does that evaluation. */ boolean -should_displace(mtmp, poss, info, cnt, gx, gy) -struct monst *mtmp; -coord *poss; /* coord poss[9] */ -long *info; /* long info[9] */ -int cnt; -xchar gx, gy; +should_displace(struct monst *mtmp, coord *poss, long int *info, int cnt, xchar gx, xchar gy) + + /* coord poss[9] */ + /* long info[9] */ + + { int shortest_with_displacing = -1; int shortest_without_displacing = -1; @@ -853,9 +833,7 @@ xchar gx, gy; } boolean -m_digweapon_check(mtmp, nix, niy) -struct monst *mtmp; -xchar nix,niy; +m_digweapon_check(struct monst *mtmp, xchar nix, xchar niy) { boolean can_tunnel = 0; struct obj *mw_tmp = MON_WEP(mtmp); @@ -896,9 +874,7 @@ xchar nix,niy; * 3: did not move, and can't do anything else either. */ int -m_move(mtmp, after) -register struct monst *mtmp; -register int after; +m_move(register struct monst *mtmp, register int after) { register int appr; xchar gx, gy, nix, niy, chcnt; @@ -1689,16 +1665,14 @@ m_move_aggress(struct monst* mtmp, xchar x, xchar y) } boolean -closed_door(x, y) -register int x, y; +closed_door(register int x, register int y) { return((boolean)(IS_DOOR(levl[x][y].typ) && (levl[x][y].doormask & (D_LOCKED | D_CLOSED)))); } boolean -accessible(x, y) -register int x, y; +accessible(register int x, register int y) { int levtyp = levl[x][y].typ; @@ -1711,8 +1685,7 @@ register int x, y; /* decide where the monster thinks you are standing */ void -set_apparxy(mtmp) -register struct monst *mtmp; +set_apparxy(register struct monst *mtmp) { boolean notseen, gotu; register int disp, mx = mtmp->mux, my = mtmp->muy; @@ -1780,9 +1753,9 @@ register struct monst *mtmp; * location however. */ boolean -undesirable_disp(mtmp, x, y) -struct monst *mtmp; /* barging creature */ -xchar x, y; /* spot 'mtmp' is considering moving to */ +undesirable_disp( + struct monst *mtmp, /**< barging creature */ + xchar x, xchar y) /**< spot 'mtmp' is considering moving to */ { boolean is_pet = (mtmp && mtmp->mtame && !mtmp->isminion); struct trap *trap = t_at(x, y); @@ -1824,8 +1797,7 @@ xchar x, y; /* spot 'mtmp' is considering moving to */ * Used by can_ooze() and can_fog(). */ static boolean -stuff_prevents_passage(mtmp) -struct monst *mtmp; +stuff_prevents_passage(struct monst *mtmp) { struct obj *chain, *obj; @@ -1885,8 +1857,7 @@ struct monst *mtmp; } boolean -can_ooze(mtmp) -struct monst *mtmp; +can_ooze(struct monst *mtmp) { if (!amorphous(mtmp->data) || stuff_prevents_passage(mtmp)) { return FALSE; @@ -1896,8 +1867,7 @@ struct monst *mtmp; /* monster can change form into a fog if necessary */ boolean -can_fog(mtmp) -struct monst *mtmp; +can_fog(struct monst *mtmp) { if (!(mvitals[PM_FOG_CLOUD].mvflags & G_GENOD) && is_vampshifter(mtmp) && @@ -1909,10 +1879,7 @@ struct monst *mtmp; } static int -vamp_shift(mon, ptr, domsg) -struct monst *mon; -struct permonst *ptr; -boolean domsg; +vamp_shift(struct monst *mon, struct permonst *ptr, boolean domsg) { int reslt = 0; char oldmtype[BUFSZ]; @@ -1941,8 +1908,7 @@ boolean domsg; } static void -make_group_attackers_flee(mtmp) -struct monst *mtmp; +make_group_attackers_flee(struct monst *mtmp) { struct monst* currmon; @@ -1959,8 +1925,7 @@ struct monst *mtmp; } static void -share_hp(mon1, mon2) -struct monst *mon1, *mon2; +share_hp(struct monst *mon1, struct monst *mon2) { struct monst *tmp; char nam[BUFSZ]; diff --git a/src/monst.c b/src/monst.c index 3a1f6cc37..1b9eb9ad9 100644 --- a/src/monst.c +++ b/src/monst.c @@ -25,7 +25,7 @@ #define C(color) #endif -void monst_init(); +void monst_init(void); /* * Entry Format: (from permonst.h) * @@ -3939,7 +3939,7 @@ struct permonst _mons2[] = { #ifndef SPLITMON_1 /* dummy routine used to force linkage */ void -monst_init() +monst_init(void) { return; } diff --git a/src/mplayer.c b/src/mplayer.c index 150d535ee..80eb79c3c 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -4,7 +4,7 @@ #include "hack.h" static void get_mplname(struct monst *, char *); -static void mk_mplayer_armor(struct monst *, SHORT_P); +static void mk_mplayer_armor(struct monst *, short); /* These are the names of those who * contributed to the development of NetHack 3.2/3.3/3.4/3.6. @@ -37,7 +37,7 @@ static const char *developers[] = { /* return a randomly chosen developer name */ const char * -dev_name() +dev_name(void) { register int i, m = 0, n = SIZE(developers); register struct monst *mtmp; @@ -62,9 +62,7 @@ dev_name() } static void -get_mplname(mtmp, nam) -register struct monst *mtmp; -char *nam; +get_mplname(register struct monst *mtmp, char *nam) { boolean fmlkind = is_female(mtmp->data); const char *devnam; @@ -87,9 +85,7 @@ char *nam; } static void -mk_mplayer_armor(mon, typ) -struct monst *mon; -short typ; +mk_mplayer_armor(struct monst *mon, short int typ) { struct obj *obj; @@ -107,10 +103,7 @@ short typ; } struct monst * -mk_mplayer(ptr, x, y, special) -register struct permonst *ptr; -xchar x, y; -register boolean special; +mk_mplayer(register struct permonst *ptr, xchar x, xchar y, register boolean special) { register struct monst *mtmp; char nam[PL_NSIZ]; @@ -296,9 +289,7 @@ register boolean special; * fill up the overflow. */ void -create_mplayers(num, special) -register int num; -boolean special; +create_mplayers(register int num, boolean special) { int pm, x, y; struct monst fakemon; @@ -326,8 +317,7 @@ boolean special; } void -mplayer_talk(mtmp) -register struct monst *mtmp; +mplayer_talk(register struct monst *mtmp) { static const char *same_class_msg[3] = { "I can't win, and neither will you!", diff --git a/src/mthrowu.c b/src/mthrowu.c index 031e52ac4..9ce3a598c 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -5,7 +5,7 @@ static int monmulti(struct monst *, struct obj *, struct obj *); static void monshoot(struct monst *, struct obj *, struct obj *); -static int drop_throw(struct obj *, BOOLEAN_P, int, int); +static int drop_throw(struct obj *, boolean, int, int); static boolean m_lined_up(struct monst *, struct monst *); #define URETREATING(x, y) (distmin(u.ux, u.uy, x, y) > distmin(u.ux0, u.uy0, x, y)) @@ -35,10 +35,11 @@ static int mesg_given; /* for m_throw()/thitu() 'miss' message */ /* hero is hit by something other than a monster */ int -thitu(tlev, dam, objp, name) -int tlev, dam; -struct obj **objp; -const char *name; /* if null, then format `*objp' */ +thitu( + int tlev, /**< pseudo-level used when deciding whether to hit hero's AC */ + int dam, + struct obj **objp, + const char *name) /**< if NULL, then format `*objp' */ { struct obj *obj = objp ? *objp : 0; const char *onm, *knm; @@ -111,10 +112,7 @@ const char *name; /* if null, then format `*objp' */ */ static int -drop_throw(obj, ohit, x, y) -register struct obj *obj; -boolean ohit; -int x, y; +drop_throw(register struct obj *obj, boolean ohit, int x, int y) { int retvalu = 1; int create; @@ -158,9 +156,7 @@ static struct monst *archer = 0; /* calculate multishot volley count for mtmp throwing otmp (if not ammo) or shooting otmp with mwep (if otmp is ammo and mwep appropriate launcher) */ static int -monmulti(mtmp, otmp, mwep) -struct monst *mtmp; -struct obj *otmp, *mwep; +monmulti(struct monst *mtmp, struct obj *otmp, struct obj *mwep) { int skill = (int) objects[otmp->otyp].oc_skill; int multishot = 1; @@ -254,9 +250,7 @@ struct obj *otmp, *mwep; /* mtmp throws otmp, or shoots otmp with mwep, at hero or at monster mtarg */ static void -monshoot(mtmp, otmp, mwep) -struct monst *mtmp; -struct obj *otmp, *mwep; +monshoot(struct monst *mtmp, struct obj *otmp, struct obj *mwep) { struct monst *mtarg = target; int dm = distmin(mtmp->mx, mtmp->my, @@ -313,13 +307,13 @@ struct obj *otmp, *mwep; /* an object launched by someone/thing other than player attacks a monster; return 1 if the object has stopped moving (hit or its range used up) */ int -ohitmon(mtmp, otmp, range, verbose) -struct monst *mtmp; /* accidental target, located at */ -struct obj *otmp; /* missile; might be destroyed by drop_throw */ -int range; /* how much farther will object travel if it misses - * Use -1 to signify to keep going even after hit, - * unless it's gone (used for rolling_boulder_traps) */ -boolean verbose; /* give message(s) even when you can't see what happened */ +ohitmon( + struct monst *mtmp, /**< accidental target, located at */ + struct obj *otmp, /**< missile; might be destroyed by drop_throw */ + int range, /**< how much farther will object travel if it misses; + * use -1 to signify to keep going even after hit, + * unless it's gone (used for rolling_boulder_traps) */ + boolean verbose) /**< give message(s) even when you can't see what happened */ { int damage, tmp; boolean vis, ismimic; @@ -494,10 +488,12 @@ boolean verbose; /* give message(s) even when you can't see what happened */ (!(pre) && IS_SINK(levl[bhitpos.x][bhitpos.y].typ))) void -m_throw(mon, x, y, dx, dy, range, obj) -struct monst *mon; /* launching monster */ -int x, y, dx, dy, range; /* launch point, direction, and range */ -struct obj *obj; /* missile (or stack providing it) */ +m_throw( + struct monst *mon, /**< launching monster */ + int x, int y, /**< launch point */ + int dx, int dy, /**< direction */ + int range, /**< maximum distance */ + struct obj *obj) /**< missile (or stack providing it) */ { struct monst *mtmp; struct obj *singleobj; @@ -720,8 +716,7 @@ struct obj *obj; /* missile (or stack providing it) */ /* Monster throws item at another monster */ int -thrwmm(mtmp, mtarg) -struct monst *mtmp, *mtarg; +thrwmm(struct monst *mtmp, struct monst *mtarg) { struct obj *otmp, *mwep; register xchar x, y; @@ -770,9 +765,7 @@ struct monst *mtmp, *mtarg; /* monster spits substance at monster */ int -spitmm(mtmp, mattk, mtarg) -struct monst *mtmp, *mtarg; -struct attack *mattk; +spitmm(struct monst *mtmp, struct attack *mattk, struct monst *mtarg) { struct obj *otmp; @@ -829,9 +822,7 @@ struct attack *mattk; /* monster breathes at monster (ranged) */ int -breamm(mtmp, mattk, mtarg) -struct monst *mtmp, *mtarg; -struct attack *mattk; +breamm(struct monst *mtmp, struct attack *mattk, struct monst *mtarg) { /* if new breath types are added, change AD_ACID to max type */ int typ = (mattk->adtyp == AD_RBRE) ? rnd(AD_ACID) : mattk->adtyp ; @@ -885,9 +876,7 @@ struct attack *mattk; /* remove an entire item from a monster's inventory; destroy that item */ void -m_useupall(mon, obj) -struct monst *mon; -struct obj *obj; +m_useupall(struct monst *mon, struct obj *obj) { obj_extract_self(obj); if (obj->owornmask) { @@ -903,9 +892,7 @@ struct obj *obj; /* remove one instance of an item from a monster's inventory */ void -m_useup(mon, obj) -struct monst *mon; -struct obj *obj; +m_useup(struct monst *mon, struct obj *obj) { if (obj->quan > 1L) { obj->quan--; @@ -917,8 +904,7 @@ struct obj *obj; /* monster attempts ranged weapon attack against player */ void -thrwmu(mtmp) -struct monst *mtmp; +thrwmu(struct monst *mtmp) { struct obj *otmp, *mwep; xchar x, y; @@ -983,9 +969,7 @@ struct monst *mtmp; /* monster spits substance at you */ int -spitmu(mtmp, mattk) -register struct monst *mtmp; -register struct attack *mattk; +spitmu(register struct monst *mtmp, register struct attack *mattk) { struct obj *otmp; @@ -1033,9 +1017,9 @@ register struct attack *mattk; /* monster breathes at you (ranged) */ int -breamu(mtmp, mattk) /* monster breathes at you (ranged) */ -register struct monst *mtmp; -register struct attack *mattk; +breamu(register struct monst *mtmp, register struct attack *mattk) /* monster breathes at you (ranged) */ + + { /* if new breath types are added, change AD_ACID to max type */ int typ = (mattk->adtyp == AD_RBRE) ? rnd(AD_ACID) : mattk->adtyp; @@ -1076,9 +1060,12 @@ register struct attack *mattk; } boolean -linedup(ax, ay, bx, by, boulderhandling) -xchar ax, ay, bx, by; -int boulderhandling; /* 0=block, 1=ignore, 2=conditionally block */ +linedup( + xchar ax, + xchar ay, + xchar bx, + xchar by, + int boulderhandling) /**< 0=block, 1=ignore, 2=conditionally block */ { int dx, dy, boulderspots; @@ -1123,15 +1110,14 @@ int boulderhandling; /* 0=block, 1=ignore, 2=conditionally block */ } static boolean -m_lined_up(mtarg, mtmp) -struct monst *mtarg, *mtmp; +m_lined_up(struct monst *mtarg, struct monst *mtmp) { return (linedup(mtarg->mx, mtarg->my, mtmp->mx, mtmp->my, 0)); } boolean -lined_up(mtmp) /* is mtmp in position to use ranged attack? */ -register struct monst *mtmp; +lined_up(register struct monst *mtmp) /* is mtmp in position to use ranged attack? */ + { boolean ignore_boulders; @@ -1150,9 +1136,7 @@ register struct monst *mtmp; /* Check if a monster is carrying a particular item. */ struct obj * -m_carrying(mtmp, type) -struct monst *mtmp; -int type; +m_carrying(struct monst *mtmp, int type) { register struct obj *otmp; @@ -1165,11 +1149,14 @@ int type; /* TRUE iff thrown/kicked/rolled object doesn't pass through iron bars */ boolean -hits_bars(obj_p, x, y, barsx, barsy, always_hit, whodidit) -struct obj **obj_p; /* *obj_p will be set to NULL if object breaks */ -int x, y, barsx, barsy; -int always_hit; /* caller can force a hit for items which would fit through */ -int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */ +hits_bars( + struct obj **obj_p, /**< *obj_p will be set to NULL if object breaks */ + int x, + int y, /**< hero's spot (when wielded) or missile's spot */ + int barsx, + int barsy, /**< adjacent spot where bars are located */ + int always_hit, /**< caller can force a hit for items which would fit through */ + int whodidit) /**< 1==hero, 0=other, -1==just check whether it'll pass thru */ { struct obj *otmp = *obj_p; int obj_type = otmp->otyp; @@ -1229,10 +1216,10 @@ int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */ } void -hit_bars(obj_p, objx, objy, barsx, barsy, your_fault, from_invent) -struct obj **obj_p; /* *obj_p will be set to NULL if object breaks */ -int objx, objy, barsx, barsy; -boolean your_fault, from_invent; +hit_bars(struct obj **obj_p, int objx, int objy, int barsx, int barsy, boolean your_fault, boolean from_invent) + /* *obj_p will be set to NULL if object breaks */ + + { struct obj *otmp = *obj_p; int obj_type = otmp->otyp; @@ -1268,8 +1255,7 @@ boolean your_fault, from_invent; } void -dissolve_bars(x, y) -register int x, y; +dissolve_bars(register int x, register int y) { levl[x][y].typ = (Is_special(&u.uz) || *in_rooms(x, y, 0)) ? ROOM : CORR; levl[x][y].flags = 0; diff --git a/src/muse.c b/src/muse.c index 485b0a138..9c8d6e763 100644 --- a/src/muse.c +++ b/src/muse.c @@ -19,17 +19,17 @@ boolean m_using = FALSE; static struct permonst *muse_newcham_mon(struct monst *); static int precheck(struct monst *, struct obj *); -static void mzapwand(struct monst *, struct obj *, BOOLEAN_P); +static void mzapwand(struct monst *, struct obj *, boolean); static void mreadmsg(struct monst *, struct obj *); static void mquaffmsg(struct monst *, struct obj *); static int mbhitm(struct monst *, struct obj *); static void mbhit(struct monst *, int, int (*) (MONST_P, OBJ_P), int (*)(OBJ_P, OBJ_P), struct obj *); static void you_aggravate(struct monst *); -static void mon_consume_unstone(struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P); +static void mon_consume_unstone(struct monst *, struct obj *, boolean, boolean); static boolean mcould_eat_tin(struct monst *); -static boolean muse_unslime(struct monst *, struct obj *, struct trap *, BOOLEAN_P); -static boolean cures_stoning(struct monst *, struct obj *, BOOLEAN_P); +static boolean muse_unslime(struct monst *, struct obj *, struct trap *, boolean); +static boolean cures_stoning(struct monst *, struct obj *, boolean); static int cures_sliming(struct monst *, struct obj *); static boolean green_mon(struct monst *); @@ -55,9 +55,7 @@ static boolean zap_oseen; * (i.e. it teleported) and 1 if it's dead. */ static int -precheck(mon, obj) -struct monst *mon; -struct obj *obj; +precheck(struct monst *mon, struct obj *obj) { boolean vis; @@ -153,10 +151,7 @@ struct obj *obj; /* when a monster zaps a wand give a message, deduct a charge, and if it isn't directly seen, remove hero's memory of the number of charges */ static void -mzapwand(mtmp, otmp, self) -struct monst *mtmp; -struct obj *otmp; -boolean self; +mzapwand(struct monst *mtmp, struct obj *otmp, boolean self) { if (!canseemon(mtmp)) { /* 9 or 5 */ @@ -178,10 +173,7 @@ boolean self; /* similar to mzapwand() but for magical horns (only instrument mons play) */ static void -mplayhorn(mtmp, otmp, self) -struct monst *mtmp; -struct obj *otmp; -boolean self; +mplayhorn(struct monst *mtmp, struct obj *otmp, boolean self) { if (!canseemon(mtmp)) { /* 9 or 5 */ @@ -203,9 +195,7 @@ boolean self; } static void -mreadmsg(mtmp, otmp) -struct monst *mtmp; -struct obj *otmp; +mreadmsg(struct monst *mtmp, struct obj *otmp) { boolean vismon = canseemon(mtmp); char onambuf[BUFSZ]; @@ -243,9 +233,7 @@ struct obj *otmp; } static void -mquaffmsg(mtmp, otmp) -struct monst *mtmp; -struct obj *otmp; +mquaffmsg(struct monst *mtmp, struct obj *otmp) { if (canseemon(mtmp)) { otmp->dknown = 1; @@ -289,8 +277,7 @@ struct obj *otmp; */ static boolean -m_use_healing(mtmp) -struct monst *mtmp; +m_use_healing(struct monst *mtmp) { struct obj *obj = 0; if ((obj = m_carrying(mtmp, POT_FULL_HEALING))) { @@ -321,8 +308,7 @@ struct monst *mtmp; * found. */ boolean -find_defensive(mtmp) -struct monst *mtmp; +find_defensive(struct monst *mtmp) { struct obj *obj; struct trap *t; @@ -650,8 +636,7 @@ botm: return((boolean)(!!m.has_defense)); * 2: did something and can't attack again (i.e. teleported). */ int -use_defensive(mtmp) -struct monst *mtmp; +use_defensive(struct monst *mtmp) { int i, fleetim, how = 0; struct obj *otmp = m.defensive; @@ -1044,8 +1029,7 @@ struct monst *mtmp; } int -rnd_defensive_item(mtmp) -struct monst *mtmp; +rnd_defensive_item(struct monst *mtmp) { struct permonst *pm = mtmp->data; int difficulty = monstr[(monsndx(pm))]; @@ -1114,8 +1098,7 @@ struct monst *mtmp; * found. */ boolean -find_offensive(mtmp) -struct monst *mtmp; +find_offensive(struct monst *mtmp) { register struct obj *obj; boolean ranged_stuff = lined_up(mtmp); @@ -1250,9 +1233,7 @@ struct monst *mtmp; } static int -mbhitm(mtmp, otmp) -register struct monst *mtmp; -register struct obj *otmp; +mbhitm(register struct monst *mtmp, register struct obj *otmp) { int tmp; boolean reveal_invis = FALSE; @@ -1329,12 +1310,12 @@ register struct obj *otmp; * to merge the two functions...) */ static void -mbhit(mon, range, fhitm, fhito, obj) -struct monst *mon; /* monster shooting the wand */ -register int range; /* direction and range */ -int (*fhitm)(MONST_P, OBJ_P); -int (*fhito)(OBJ_P, OBJ_P); /* fns called when mon/obj hit */ -struct obj *obj; /* 2nd arg to fhitm/fhito */ +mbhit( + struct monst *mon, /**< monster shooting the wand */ + int range, /**< direction and range */ + int (*fhitm)(MONST_P, OBJ_P), + int (*fhito)(OBJ_P, OBJ_P), /**< fns called when mon/obj hit */ + struct obj *obj) /**< 2nd arg to fhitm/fhito */ { register struct monst *mtmp; register struct obj *otmp; @@ -1420,8 +1401,7 @@ struct obj *obj; /* 2nd arg to fhitm/fhito */ * after find_offensive(). Return values are same as use_defensive(). */ int -use_offensive(mtmp) -struct monst *mtmp; +use_offensive(struct monst *mtmp) { int i; struct obj *otmp = m.offensive; @@ -1593,8 +1573,7 @@ struct monst *mtmp; } int -rnd_offensive_item(mtmp) -struct monst *mtmp; +rnd_offensive_item(struct monst *mtmp) { struct permonst *pm = mtmp->data; int difficulty = monstr[(monsndx(pm))]; @@ -1641,8 +1620,7 @@ struct monst *mtmp; #define MUSE_POT_POLYMORPH 9 boolean -find_misc(mtmp) -struct monst *mtmp; +find_misc(struct monst *mtmp) { register struct obj *obj; struct permonst *mdat = mtmp->data; @@ -1776,8 +1754,7 @@ struct monst *mtmp; /* type of monster to polymorph into; defaults to one suitable for the current level rather than the totally arbitrary choice of newcham() */ static struct permonst * -muse_newcham_mon(mon) -struct monst *mon; +muse_newcham_mon(struct monst *mon) { struct obj *m_armr; @@ -1791,8 +1768,7 @@ struct monst *mon; } int -use_misc(mtmp) -struct monst *mtmp; +use_misc(struct monst *mtmp) { int i; struct obj *otmp = m.misc; @@ -1998,8 +1974,7 @@ struct monst *mtmp; } static void -you_aggravate(mtmp) -struct monst *mtmp; +you_aggravate(struct monst *mtmp) { pline("For some reason, %s presence is known to you.", s_suffix(noit_mon_nam(mtmp))); @@ -2023,8 +1998,7 @@ struct monst *mtmp; } int -rnd_misc_item(mtmp) -struct monst *mtmp; +rnd_misc_item(struct monst *mtmp) { struct permonst *pm = mtmp->data; int difficulty = monstr[(monsndx(pm))]; @@ -2063,9 +2037,7 @@ struct monst *mtmp; } boolean -searches_for_item(mon, obj) -struct monst *mon; -struct obj *obj; +searches_for_item(struct monst *mon, struct obj *obj) { int typ = obj->otyp; @@ -2159,9 +2131,7 @@ struct obj *obj; } boolean -mon_reflects(mon, str) -struct monst *mon; -const char *str; +mon_reflects(struct monst *mon, const char *str) { struct obj *orefl = which_armor(mon, W_ARMS); @@ -2209,8 +2179,7 @@ const char *str; } boolean -ureflects (fmt, str) -const char *fmt, *str; +ureflects (const char *fmt, const char *str) { /* prevent uarm from being null when reflecting due to being poly'd */ boolean is_reflecting_dragon = (youmonst.data == &mons[PM_SILVER_DRAGON] || @@ -2253,9 +2222,7 @@ const char *fmt, *str; /* cure mon's blindness (use_defensive, dog_eat, meatobj) */ void -mcureblindness(mon, verbose) -struct monst *mon; -boolean verbose; +mcureblindness(struct monst *mon, boolean verbose) { if (!mon->mcansee) { mon->mcansee = 1; @@ -2268,9 +2235,7 @@ boolean verbose; /* TRUE if the monster ate something */ boolean -munstone(mon, by_you) -struct monst *mon; -boolean by_you; +munstone(struct monst *mon, boolean by_you) { struct obj *obj; @@ -2293,11 +2258,7 @@ boolean by_you; } static void -mon_consume_unstone(mon, obj, by_you, stoning) -struct monst *mon; -struct obj *obj; -boolean by_you; -boolean stoning; +mon_consume_unstone(struct monst *mon, struct obj *obj, boolean by_you, boolean stoning) { boolean vis = canseemon(mon); boolean tinned = obj->otyp == TIN; @@ -2376,10 +2337,7 @@ boolean stoning; /* decide whether obj can cure petrification; also used when picking up */ static boolean -cures_stoning(mon, obj, tinok) -struct monst *mon; -struct obj *obj; -boolean tinok; +cures_stoning(struct monst *mon, struct obj *obj, boolean tinok) { if (obj->otyp == POT_ACID) { return TRUE; @@ -2398,8 +2356,7 @@ boolean tinok; } static boolean -mcould_eat_tin(mon) -struct monst *mon; +mcould_eat_tin(struct monst *mon) { /* monkeys who manage to steal tins can't open and eat them even if they happen to also have the appropriate tool */ @@ -2429,9 +2386,7 @@ struct monst *mon; /* TRUE if monster does something to avoid turning into green slime */ boolean -munslime(mon, by_you) -struct monst *mon; -boolean by_you; +munslime(struct monst *mon, boolean by_you) { struct obj *obj, odummy; struct permonst *mptr = mon->data; @@ -2510,11 +2465,11 @@ boolean by_you; /* mon uses an item--selected by caller--to burn away incipient slime */ static boolean -muse_unslime(mon, obj, trap, by_you) -struct monst *mon; -struct obj *obj; -struct trap *trap; -boolean by_you; /* true: if mon kills itself, hero gets credit/blame */ +muse_unslime(struct monst *mon, struct obj *obj, struct trap *trap, boolean by_you) + + + + /* true: if mon kills itself, hero gets credit/blame */ { /* [by_you not honored if 'mon' triggers fire trap]. */ struct obj *odummyp; int otyp = obj->otyp, dmg = 0; @@ -2634,9 +2589,7 @@ boolean by_you; /* true: if mon kills itself, hero gets credit/blame */ /* decide whether obj can be used to cure green slime */ static int -cures_sliming(mon, obj) -struct monst *mon; -struct obj *obj; +cures_sliming(struct monst *mon, struct obj *obj) { /* scroll of fire, non-empty wand or horn of fire */ if (obj->otyp == SCR_FIRE) { @@ -2652,8 +2605,7 @@ struct obj *obj; the display color, otherwise we just pick things that seem plausibly green (which doesn't necessarily match the TEXTCOLOR categorization) */ static boolean -green_mon(mon) -struct monst *mon; +green_mon(struct monst *mon) { struct permonst *ptr = mon->data; diff --git a/src/music.c b/src/music.c index ab089f474..52ac96e7d 100644 --- a/src/music.c +++ b/src/music.c @@ -55,8 +55,7 @@ void amii_speaker( struct obj *, char *, int ) ; */ void -awaken_monsters(distance) -int distance; +awaken_monsters(int distance) { struct monst *mtmp; int distm; @@ -88,8 +87,7 @@ int distance; */ static void -put_monsters_to_sleep(distance) -int distance; +put_monsters_to_sleep(int distance) { struct monst *mtmp; @@ -110,8 +108,7 @@ int distance; */ static void -charm_snakes(distance) -int distance; +charm_snakes(int distance) { struct monst *mtmp; int could_see_mon, was_peaceful; @@ -147,8 +144,7 @@ int distance; */ static void -calm_nymphs(distance) -int distance; +calm_nymphs(int distance) { struct monst *mtmp; @@ -171,8 +167,7 @@ int distance; /* Awake soldiers anywhere the level (and any nearby monster). */ void -awaken_soldiers(bugler) -struct monst *bugler; /* monster that played instrument */ +awaken_soldiers(struct monst *bugler) /**< monster that played instrument */ { struct monst *mtmp; int distance, distm; @@ -214,8 +209,7 @@ struct monst *bugler; /* monster that played instrument */ * If swallowed, range is reduced to 0. */ static void -charm_monsters(distance) -int distance; +charm_monsters(int distance) { struct monst *mtmp, *mtmp2; @@ -241,8 +235,7 @@ int distance; */ void -do_earthquake(force) -int force; +do_earthquake(int force) { register int x, y; struct monst *mtmp; @@ -453,8 +446,7 @@ const char *beats[] = { * The player is trying to extract something from his/her instrument. */ static int -do_improvisation(instr) -struct obj *instr; +do_improvisation(struct obj *instr) { int damage, mode, do_spec = !(Stunned || Confusion); struct obj itmp; @@ -667,8 +659,7 @@ struct obj *instr; */ int -do_play_instrument(instr) -struct obj *instr; +do_play_instrument(struct obj *instr) { char buf[BUFSZ] = DUMMY, c = 'y'; char *s; diff --git a/src/o_init.c b/src/o_init.c index 50775f0d5..045743407 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -5,16 +5,16 @@ #include "lev.h" /* save & restore info */ static void setgemprobs(d_level*); -static void shuffle(int, int, BOOLEAN_P); -static void shuffle_all(); +static void shuffle(int, int, boolean); +static void shuffle_all(void); static boolean interesting_to_discover(int); static void swap_armor(int, int, int); -static char *oclass_to_name(CHAR_P, char *); +static char *oclass_to_name(char, char *); static NEARDATA short disco[NUM_OBJECTS] = DUMMY; #ifdef USE_TILES -static void shuffle_tiles(); +static void shuffle_tiles(void); extern short glyph2tile[]; /* from tile.c */ /* Shuffle tile assignments to match descriptions, so a red potion isn't @@ -27,7 +27,7 @@ extern short glyph2tile[]; /* from tile.c */ * another routine. */ static void -shuffle_tiles() +shuffle_tiles(void) { int i; short tmp_tilemap[NUM_OBJECTS]; @@ -42,8 +42,7 @@ shuffle_tiles() #endif /* USE_TILES */ static void -setgemprobs(dlev) -d_level *dlev; +setgemprobs(d_level *dlev) { int j, first, lev; @@ -69,9 +68,7 @@ d_level *dlev; /* shuffle descriptions on objects o_low to o_high */ static void -shuffle(o_low, o_high, domaterial) -int o_low, o_high; -boolean domaterial; +shuffle(int o_low, int o_high, boolean domaterial) { int i, j, num_to_shuffle; short sw; @@ -106,7 +103,7 @@ boolean domaterial; } void -init_objects() +init_objects(void) { register int i, first, last, sum; register char oclass; @@ -177,7 +174,7 @@ init_objects() } static void -shuffle_all() +shuffle_all(void) { int first, last, oclass; @@ -254,10 +251,10 @@ shuffle_all() * Currently name, color and price are swapped. */ void -swap_armor(old_relative_position, new_relative_position, first) -int old_relative_position, /* old position of dragon scales */ -new_relative_position, /* new position of dragon scales */ -first; /* first armor of this armor class */ +swap_armor( + int old_relative_position, /**< old position of dragon scales */ + int new_relative_position, /**< new position of dragon scales */ + int first) /**< first armor of this armor class */ { struct objclass tmp; @@ -279,7 +276,7 @@ first; /* first armor of this armor class */ /* find the object index for snow boots; used [once] by slippery ice code */ int -find_skates() +find_skates(void) { register int i; register const char *s; @@ -294,14 +291,13 @@ find_skates() /* level dependent initialization */ void -oinit() +oinit(void) { setgemprobs(&u.uz); } void -savenames(fd, mode) -int fd, mode; +savenames(int fd, int mode) { register int i; unsigned int len; @@ -330,8 +326,7 @@ int fd, mode; } void -restnames(fd) -register int fd; +restnames(register int fd) { register int i; unsigned int len; @@ -351,10 +346,7 @@ register int fd; } void -discover_object(oindx, mark_as_known, credit_hero) -register int oindx; -boolean mark_as_known; -boolean credit_hero; +discover_object(register int oindx, boolean mark_as_known, boolean credit_hero) { if (!objects[oindx].oc_name_known) { register int dindx, acls = objects[oindx].oc_class; @@ -382,8 +374,7 @@ boolean credit_hero; /* if a class name has been cleared, we may need to purge it from disco[] */ void -undiscover_object(oindx) -register int oindx; +undiscover_object(register int oindx) { if (!objects[oindx].oc_name_known) { register int dindx, acls = objects[oindx].oc_class; @@ -433,8 +424,7 @@ makeknown_msg(int otyp) } static boolean -interesting_to_discover(i) -int i; +interesting_to_discover(int i) { /* Pre-discovered objects are now printed with a '*' */ return((boolean)(objects[i].oc_uname != (char *)0 || @@ -451,7 +441,7 @@ static short uniq_objs[] = { /* the '\' command - show discovered object types */ int -dodiscovered() /* free after Robert Viduya */ +dodiscovered(void) /* free after Robert Viduya */ { register int i, dis; int ct = 0; @@ -516,7 +506,7 @@ dodiscovered() /* free after Robert Viduya */ * Currently name, color are shuffled. */ void -dragons_init() +dragons_init(void) { /* Number of existing dragons. Assumes order of dragons */ int ndragons = YELLOW_DRAGON_SCALES - GRAY_DRAGON_SCALES + 1; @@ -551,7 +541,7 @@ dragons_init() /* the '`' command - show discovered object types for one class */ int -doclassdisco() +doclassdisco(void) { static NEARDATA const char prompt[] = "View discoveries for which sort of objects?", @@ -730,7 +720,7 @@ doclassdisco() /* put up nameable subset of discoveries list as a menu */ void -rename_disco() +rename_disco(void) { register int i, dis; int ct = 0, mn = 0, sl; diff --git a/src/objects.c b/src/objects.c index 2ed1a9346..59cd7d922 100644 --- a/src/objects.c +++ b/src/objects.c @@ -1088,11 +1088,11 @@ NEARDATA struct objclass objects[] = { # define OBJECTS_PASS_2_ #include "objects.c" -void objects_init(); +void objects_init(void); /* dummy routine used to force linkage */ void -objects_init() +objects_init(void) { return; } diff --git a/src/objnam.c b/src/objnam.c index 574c6d419..ee713a4c4 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -9,14 +9,14 @@ #define NUMOBUF 12 static char *strprepend(char *, const char *); -static boolean wishymatch(const char *, const char *, BOOLEAN_P); -static char *nextobuf(); +static boolean wishymatch(const char *, const char *, boolean); +static char *nextobuf(void); static void releaseobuf(char *); static char *minimal_xname(struct obj *); -static void add_erosion_words(struct obj *, char *, BOOLEAN_P); +static void add_erosion_words(struct obj *, char *, boolean); static char *just_an(char *str, const char *); static char *xname_flags(struct obj *, unsigned); -static boolean badman(const char *, BOOLEAN_P); +static boolean badman(const char *, boolean); struct Jitem { int item; @@ -59,9 +59,7 @@ static struct Jitem Japanese_items[] = { static const char *Japanese_item_name(int i); static char * -strprepend(s, pref) -char *s; -const char *pref; +strprepend(char *s, const char *pref) { char *prefixed = nextobuf(); @@ -75,7 +73,7 @@ static int obufidx = 0; /* manage a pool of BUFSZ buffers, so callers don't have to */ static char * -nextobuf() +nextobuf(void) { obufidx = (obufidx + 1) % NUMOBUF; obufs[obufidx][0] = '\0'; @@ -84,8 +82,7 @@ nextobuf() /* put the most recently allocated buffer back if possible */ static void -releaseobuf(bufp) -char *bufp; +releaseobuf(char *bufp) { /* caller may not know whether bufp is the most recently allocated buffer; if it isn't, do nothing; note that because of the somewhat @@ -98,8 +95,7 @@ char *bufp; } char * -obj_typename(otyp) -register int otyp; +obj_typename(register int otyp) { char *buf = nextobuf(); struct objclass *ocl = &objects[otyp]; @@ -175,8 +171,7 @@ register int otyp; /* less verbose result than obj_typename(); either the actual name or the description (but not both); user-assigned name is ignored */ char * -simple_typename(otyp) -int otyp; +simple_typename(int otyp) { char *bufp, *pp, *save_uname = objects[otyp].oc_uname; @@ -191,8 +186,7 @@ int otyp; /* less verbose result than obj_typename(); either the actual name or the description (but not both); user-assigned name is ignored */ char * -dump_typename(otyp) -int otyp; +dump_typename(int otyp) { char *p; int saved_name_known = objects[otyp].oc_name_known; @@ -204,8 +198,7 @@ int otyp; /* typename for debugging feedback where data involved might be suspect */ char * -safe_typename(otyp) -int otyp; +safe_typename(int otyp) { unsigned save_nameknown; char *res = 0; @@ -225,8 +218,7 @@ int otyp; } boolean -obj_is_pname(obj) -struct obj *obj; +obj_is_pname(struct obj *obj) { if (!obj->oartifact || !has_oname(obj)) { return FALSE; @@ -248,9 +240,7 @@ static int distantname = 0; * we don't want to set dknown if it's not set already. */ char * -distant_name(obj, func) -struct obj *obj; -char *(*func)(OBJ_P); +distant_name(struct obj *obj, char *(*func) (struct obj *)) { char *str; @@ -271,8 +261,7 @@ char *(*func)(OBJ_P); /* convert player specified fruit name into corresponding fruit juice name ("slice of pizza" -> "pizza juice" rather than "slice of pizza juice") */ char * -fruitname(juice) -boolean juice; /* whether or not to append " juice" to the name */ +fruitname(boolean juice) /**< whether or not to append " juice" to the name */ { char *buf = nextobuf(); const char *fruit_nam = strstri(pl_fruit, " of "); @@ -288,8 +277,7 @@ boolean juice; /* whether or not to append " juice" to the name */ /* look up a named fruit by index (1..127) */ struct fruit * -fruit_from_indx(indx) -int indx; +fruit_from_indx(int indx) { struct fruit *f; @@ -303,10 +291,10 @@ int indx; /* look up a named fruit by name */ struct fruit * -fruit_from_name(fname, exact, highest_fid) -const char *fname; -boolean exact; /* False => prefix or exact match, True = exact match only */ -int *highest_fid; /* optional output; only valid if 'fname' isn't found */ +fruit_from_name( + const char *fname, + boolean exact, /**< FALSE: prefix or exact match, True: exact match only */ + int *highest_fid) /**< optional output; only valid if 'fname' isn't found */ { struct fruit *f, *tentativef; char *altfname; @@ -389,8 +377,7 @@ int *highest_fid; /* optional output; only valid if 'fname' isn't found */ /* sort the named-fruit linked list by fruit index number */ void -reorder_fruit(forward) -boolean forward; +reorder_fruit(boolean forward) { struct fruit *f, *allfr[1 + 127]; int i, j, k = SIZE(allfr); @@ -425,16 +412,15 @@ boolean forward; } char * -xname(obj) -struct obj *obj; +xname(struct obj *obj) { return xname_flags(obj, CXN_NORMAL); } static char * -xname_flags(obj, cxn_flags) -register struct obj *obj; -unsigned cxn_flags; /* bitmask of CXN_xxx values */ +xname_flags( + struct obj *obj, + unsigned cxn_flags) /**< bitmask of CXN_xxx values */ { char *buf; int typ = obj->otyp; @@ -818,8 +804,7 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */ potion of object detection -- if discovered */ static char * -minimal_xname(obj) -struct obj *obj; +minimal_xname(struct obj *obj) { char *bufp; struct obj bareobj; @@ -866,8 +851,7 @@ struct obj *obj; /* xname() output augmented for multishot missile feedback */ char * -mshot_xname(obj) -struct obj *obj; +mshot_xname(struct obj *obj) { char tmpbuf[BUFSZ]; char *onm = xname(obj); @@ -884,8 +868,7 @@ struct obj *obj; /* used for naming "the unique_item" instead of "a unique_item" */ boolean -the_unique_obj(obj) -struct obj *obj; +the_unique_obj(struct obj *obj) { boolean known = (obj->known || iflags.override_ID); @@ -901,8 +884,7 @@ struct obj *obj; /** should monster type be prefixed with "the"? (mostly used for corpses) */ boolean -the_unique_pm(ptr) -struct permonst *ptr; +the_unique_pm(struct permonst *ptr) { boolean uniq; @@ -927,10 +909,7 @@ struct permonst *ptr; } static void -add_erosion_words(obj, prefix, in_final_dump) -struct obj *obj; -char *prefix; -boolean in_final_dump; +add_erosion_words(struct obj *obj, char *prefix, boolean in_final_dump) { boolean iscrys = (obj->otyp == CRYSKNIFE); boolean rknown = (iflags.override_ID == 0) ? obj->rknown : TRUE; @@ -968,8 +947,7 @@ boolean in_final_dump; /* used to prevent rust on items where rust makes no difference */ boolean -erosion_matters(obj) -struct obj *obj; +erosion_matters(struct obj *obj) { switch (obj->oclass) { case TOOL_CLASS: @@ -992,9 +970,7 @@ struct obj *obj; } static char * -doname_base(obj, with_price) -register struct obj *obj; -boolean with_price; +doname_base(register struct obj *obj, boolean with_price) { boolean ispoisoned = FALSE; boolean weightshown = FALSE; @@ -1593,24 +1569,21 @@ display_weight(struct obj *obj) /** Wrapper function for vanilla behaviour. */ char * -doname(obj) -register struct obj *obj; +doname(register struct obj *obj) { return doname_base(obj, FALSE); } /** Name of object including price. */ char * -doname_with_price(obj) -register struct obj *obj; +doname_with_price(register struct obj *obj) { return doname_base(obj, TRUE); } /* used from invent.c */ boolean -not_fully_identified(otmp) -struct obj *otmp; +not_fully_identified(struct obj *otmp) { /* gold doesn't have any interesting attributes [yet?] */ if (otmp->oclass == COIN_CLASS) return FALSE; /* always fully ID'd */ @@ -1650,10 +1623,10 @@ struct obj *otmp; /** format a corpse name (xname() omits monster type; doname() calls us); eatcorpse() also uses us for death reason when eating tainted glob */ char * -corpse_xname(otmp, adjective, cxn_flags) -struct obj *otmp; -const char *adjective; -unsigned cxn_flags; /* bitmask of CXN_xxx values */ +corpse_xname( + struct obj *otmp, + const char *adjective, + unsigned cxn_flags) /**< bitmask of CXN_xxx values */ { char *nambuf = nextobuf(); int omndx = otmp->corpsenm; @@ -1752,8 +1725,7 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */ /* xname, unless it's a corpse, then corpse_xname(obj, FALSE) */ char * -cxname(obj) -struct obj *obj; +cxname(struct obj *obj) { if (obj->otyp == CORPSE) { return corpse_xname(obj, (const char *) 0, CXN_NORMAL); @@ -1764,8 +1736,7 @@ struct obj *obj; #ifdef SORTLOOT /** like cxname, but ignores quantity */ char * -cxname_singular(obj) -struct obj *obj; +cxname_singular(struct obj *obj) { if (obj->otyp == CORPSE) { return corpse_xname(obj, (const char *) 0, CXN_SINGULAR); @@ -1776,8 +1747,7 @@ struct obj *obj; /** Returns the unidentified name of obj. */ char * -cxname_unidentified(obj) -struct obj *obj; +cxname_unidentified(struct obj *obj) { int cxn_flags = CXN_UNIDENTIFIED | CXN_SINGULAR; if (obj->otyp == CORPSE) { @@ -1789,8 +1759,7 @@ struct obj *obj; /* treat an object as fully ID'd when it might be used as reason for death */ char * -killer_xname(obj) -struct obj *obj; +killer_xname(struct obj *obj) { struct obj save_obj; unsigned save_ocknown; @@ -1861,11 +1830,11 @@ struct obj *obj; /* xname,doname,&c with long results reformatted to omit some stuff */ char * -short_oname(obj, func, altfunc, lenlimit) -struct obj *obj; -char *(*func) (OBJ_P), /* main formatting routine */ - *(*altfunc)(OBJ_P); /* alternate for shortest result */ -unsigned lenlimit; +short_oname(struct obj *obj, char *(*func) (struct obj *), char *(*altfunc) (struct obj *), unsigned int lenlimit) + + /* main formatting routine */ + /* alternate for shortest result */ + { struct obj save_obj; char unamebuf[12], onamebuf[12], *save_oname, *save_uname, *outbuf; @@ -1943,9 +1912,7 @@ unsigned lenlimit; * Used if only one of a collection of objects is named (e.g. in eat.c). */ const char * -singular(otmp, func) -register struct obj *otmp; -char *(*func)(OBJ_P); +singular(register struct obj *otmp, char *(*func) (struct obj *)) { long savequan; #ifdef SHOW_WEIGHT @@ -1974,9 +1941,7 @@ char *(*func)(OBJ_P); /** pick "", "a ", or "an " as article for 'str'; used by an() and doname() */ static char * -just_an(outbuf, str) -char *outbuf; -const char *str; +just_an(char *outbuf, const char *str) { char c0; @@ -2008,8 +1973,7 @@ const char *str; } char * -an(str) -const char *str; +an(const char *str) { char *buf = nextobuf(); @@ -2022,8 +1986,7 @@ const char *str; } char * -An(str) -const char *str; +An(const char *str) { char *tmp = an(str); @@ -2036,8 +1999,7 @@ const char *str; * Use type_is_pname() for monster names, not the(). the() is idempotent. */ char * -the(str) -const char *str; +the(const char *str) { char *buf = nextobuf(); boolean insert_the = FALSE; @@ -2090,8 +2052,7 @@ const char *str; } char * -The(str) -const char *str; +The(const char *str) { char *tmp = the(str); @@ -2101,9 +2062,7 @@ const char *str; /* returns "count cxname(otmp)" or just cxname(otmp) if count == 1 */ char * -aobjnam(otmp, verb) -struct obj *otmp; -const char *verb; +aobjnam(struct obj *otmp, const char *verb) { char *bp = cxname(otmp); char prefix[PREFIX]; @@ -2122,9 +2081,7 @@ const char *verb; /* combine yname and aobjnam eg "your count cxname(otmp)" */ char * -yobjnam(obj, verb) -struct obj *obj; -const char *verb; +yobjnam(struct obj *obj, const char *verb) { char *s = aobjnam(obj, verb); @@ -2147,9 +2104,7 @@ const char *verb; /* combine Yname2 and aobjnam eg "Your count cxname(otmp)" */ char * -Yobjnam2(obj, verb) -struct obj *obj; -const char *verb; +Yobjnam2(struct obj *obj, const char *verb) { register char *s = yobjnam(obj, verb); @@ -2159,9 +2114,7 @@ const char *verb; /* like aobjnam, but prepend "The", not count, and use xname */ char * -Tobjnam(otmp, verb) -struct obj *otmp; -const char *verb; +Tobjnam(struct obj *otmp, const char *verb) { char *bp = The(xname(otmp)); @@ -2174,9 +2127,7 @@ const char *verb; /* return form of the verb (input plural) if xname(otmp) were the subject */ char * -otense(otmp, verb) -struct obj *otmp; -const char *verb; +otense(struct obj *otmp, const char *verb) { char *buf; @@ -2215,9 +2166,7 @@ static const char * const special_subjs[] = { /* return form of the verb (input plural) for present tense 3rd person subj */ char * -vtense(subj, verb) -const char *subj; -const char *verb; +vtense(const char *subj, const char *verb) { char *buf = nextobuf(); int len, ltmp; @@ -2310,8 +2259,7 @@ const char *verb; /* capitalized variant of doname() */ char * -Doname2(obj) -register struct obj *obj; +Doname2(register struct obj *obj) { register char *s = doname(obj); @@ -2321,8 +2269,7 @@ register struct obj *obj; /* returns "your xname(obj)" or "Foobar's xname(obj)" or "the xname(obj)" */ char * -yname(obj) -struct obj *obj; +yname(struct obj *obj) { char *outbuf = nextobuf(); char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */ @@ -2333,8 +2280,7 @@ struct obj *obj; /* capitalized variant of yname() */ char * -Yname2(obj) -struct obj *obj; +Yname2(struct obj *obj) { char *s = yname(obj); @@ -2347,8 +2293,7 @@ struct obj *obj; * or "the minimal_xname(obj)" */ char * -ysimple_name(obj) -struct obj *obj; +ysimple_name(struct obj *obj) { char *outbuf = nextobuf(); char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */ @@ -2359,8 +2304,7 @@ struct obj *obj; /* capitalized variant of ysimple_name() */ char * -Ysimple_name2(obj) -struct obj *obj; +Ysimple_name2(struct obj *obj) { char *s = ysimple_name(obj); @@ -2370,8 +2314,7 @@ struct obj *obj; /* "scroll" or "scrolls" */ char * -simpleonames(obj) -struct obj *obj; +simpleonames(struct obj *obj) { char *simpleoname = minimal_xname(obj); @@ -2383,8 +2326,7 @@ struct obj *obj; /* "a scroll" or "scrolls"; "a silver bell" or "the Bell of Opening" */ char * -ansimpleoname(obj) -struct obj *obj; +ansimpleoname(struct obj *obj) { char *simpleoname = simpleonames(obj); int otyp = obj->otyp; @@ -2409,8 +2351,7 @@ struct obj *obj; /* "the scroll" or "the scrolls" */ char * -thesimpleoname(obj) -struct obj *obj; +thesimpleoname(struct obj *obj) { char *simpleoname = simpleonames(obj); @@ -2419,8 +2360,7 @@ struct obj *obj; /* artifact's name without any object type or known/dknown/&c feedback */ char * -bare_artifactname(obj) -struct obj *obj; +bare_artifactname(struct obj *obj) { char *outbuf; @@ -2499,10 +2439,10 @@ static const char *const as_is[] = { /* singularize/pluralize decisions common to both makesingular & makeplural */ static boolean -singplur_lookup(basestr, endstring, to_plural, alt_as_is) -char *basestr, *endstring; /* base string, pointer to eos(string) */ -boolean to_plural; /* true => makeplural, false => makesingular */ -const char *const *alt_as_is; /* another set like as_is[] */ +singplur_lookup( + char *basestr, char *endstring, /**< base string, pointer to eos(string) */ + boolean to_plural, /**< true => makeplural, false => makesingular */ + const char *const *alt_as_is) /**< another set like as_is[] */ { const struct sing_plur *sp; const char *same, *other, *const *as; @@ -2579,8 +2519,7 @@ const char *const *alt_as_is; /* another set like as_is[] */ /* searches for common compounds, ex. lump of royal jelly */ static char * -singplur_compound(str) -char *str; +singplur_compound(char *str) { /* if new entries are added, be sure to keep compound_start[] in sync */ static const char *const compounds[] = @@ -2635,8 +2574,7 @@ char *str; * 3.6.0: made case-insensitive. */ char * -makeplural(oldstr) -const char *oldstr; +makeplural(const char *oldstr) { /* Note: cannot use strcmpi here -- it'd give MATZot, CAVEMeN,... */ register char *spot; @@ -2853,8 +2791,7 @@ static NEARDATA const struct o_range o_ranges[] = { * 3.6.0: made case-insensitive. */ char * -makesingular(oldstr) -const char *oldstr; +makesingular(const char *oldstr) { register char *p, *bp; const char *excess = 0; @@ -2979,9 +2916,9 @@ const char *oldstr; } static boolean -badman(basestr, to_plural) -const char *basestr; -boolean to_plural; /* true => makeplural, false => makesingular */ +badman( + const char *basestr, + boolean to_plural) /* TRUE: makeplural, FALSE: makesingular */ { /* these are all the prefixes for *man that don't have a *men plural */ static const char *no_men[] = { @@ -3031,10 +2968,10 @@ boolean to_plural; /* true => makeplural, false => makesingular */ /* compare user string against object name string using fuzzy matching */ static boolean -wishymatch(u_str, o_str, retry_inverted) -const char *u_str; /* from user, so might be variant spelling */ -const char *o_str; /* from objects[], so is in canonical form */ -boolean retry_inverted; /* optional extra "of" handling */ +wishymatch( + const char *u_str, /**< from user, so might be variant spelling */ + const char *o_str, /**< from objects[], so is in canonical form */ + boolean retry_inverted) /**< optional extra "of" handling */ { static NEARDATA const char detect_SP[] = "detect ", SP_detection[] = " detection"; @@ -3145,8 +3082,7 @@ struct alt_spellings { }; static short -rnd_otyp_by_wpnskill(skill) -schar skill; +rnd_otyp_by_wpnskill(schar skill) { int i, n = 0; short otyp = STRANGE_OBJECT; @@ -3172,10 +3108,11 @@ schar skill; } static short -rnd_otyp_by_namedesc(name, oclass, xtra_prob) -const char *name; -char oclass; -int xtra_prob; /* to force 0% random generation items to also be considered */ +rnd_otyp_by_namedesc( + const char *name, + char oclass, + int xtra_prob) /**< add to item's chance of being chosen; non-zero causes + 0% random generation items to also be considered */ { int i, n = 0; short validobjs[NUM_OBJECTS]; @@ -3225,8 +3162,7 @@ int xtra_prob; /* to force 0% random generation items to also be considered */ } int -shiny_obj(oclass) -char oclass; +shiny_obj(char oclass) { return (int) rnd_otyp_by_namedesc("shiny", oclass, 0); } @@ -3240,8 +3176,7 @@ char oclass; * descriptions or user-called names would leak information to object lookup. */ short -name_to_otyp(in_str) -const char * in_str; +name_to_otyp(const char *in_str) { short otyp; int i; @@ -3345,9 +3280,7 @@ const char * in_str; * return null. */ struct obj * -readobjnam(bp, no_wish) -register char *bp; -struct obj *no_wish; +readobjnam(register char *bp, struct obj *no_wish) { char *p; int i; @@ -4635,8 +4568,7 @@ struct obj *no_wish; } int -rnd_class(first, last) -int first, last; +rnd_class(int first, int last) { int i, x, sum=0; @@ -4654,8 +4586,7 @@ int first, last; } static const char * -Japanese_item_name(i) -int i; +Japanese_item_name(int i) { struct Jitem *j = Japanese_items; @@ -4668,8 +4599,7 @@ int i; } const char * -suit_simple_name(suit) -struct obj *suit; +suit_simple_name(struct obj *suit) { if (suit) { if (Is_dragon_mail(suit->otyp)) { @@ -4691,8 +4621,7 @@ struct obj *suit; } const char * -cloak_simple_name(cloak) -struct obj *cloak; +cloak_simple_name(struct obj *cloak) { if (cloak) { switch (cloak->otyp) { @@ -4712,8 +4641,7 @@ struct obj *cloak; /* helm vs hat for messages */ const char * -helm_simple_name(helmet) -struct obj *helmet; +helm_simple_name(struct obj *helmet) { /* * There is some wiggle room here; the result has been chosen @@ -4732,8 +4660,7 @@ struct obj *helmet; /* gloves vs gauntlets; depends upon discovery state */ const char * -gloves_simple_name(gloves) -struct obj *gloves; +gloves_simple_name(struct obj *gloves) { static const char gauntlets[] = "gauntlets"; @@ -4751,8 +4678,7 @@ struct obj *gloves; } const char * -mimic_obj_name(mtmp) -struct monst *mtmp; +mimic_obj_name(struct monst *mtmp) { if (M_AP_TYPE(mtmp) == M_AP_OBJECT) { if (mtmp->mappearance == GOLD_PIECE) { @@ -4772,12 +4698,12 @@ struct monst *mtmp; * last resort literal which should be very short), and an optional suffix. */ char * -safe_qbuf(qbuf, qprefix, qsuffix, obj, func, altfunc, lastR) -char *qbuf; /* output buffer */ -const char *qprefix, *qsuffix; -struct obj *obj; -char *(*func) (OBJ_P), *(*altfunc) (OBJ_P); -const char *lastR; +safe_qbuf(char *qbuf, const char *qprefix, const char *qsuffix, struct obj *obj, char *(*func) (struct obj *), char *(*altfunc) (struct obj *), const char *lastR) + /* output buffer */ + + + + { char *bufp, *endp; /* convert size_t (or int for ancient systems) to ordinary unsigned */ diff --git a/src/options.c b/src/options.c index 9b30ed795..ad9379d28 100644 --- a/src/options.c +++ b/src/options.c @@ -24,7 +24,7 @@ NEARDATA struct instance_flags iflags; /* provide linkage */ #define PREFER_TILED FALSE #endif -static boolean illegal_menu_cmd_key(CHAR_P); +static boolean illegal_menu_cmd_key(char); #ifdef CURSES_GRAPHICS extern int curses_read_attrs(char *attrs); @@ -602,15 +602,15 @@ static void nmcpy(char *, const char *, int); static void escapes(const char *, char *); static void rejectoption(const char *); static void badoption(const char *); -static char *string_for_opt(char *, BOOLEAN_P); -static char *string_for_env_opt(const char *, char *, BOOLEAN_P); -static void bad_negation(const char *, BOOLEAN_P); +static char *string_for_opt(char *, boolean); +static char *string_for_env_opt(const char *, char *, boolean); +static void bad_negation(const char *, boolean); static int change_inv_order(char *); static void oc_to_str(char *, char *); static void graphics_opts(char *, const char *, int, int); static int feature_alert_opts(char *, const char *); static const char *get_compopt_value(const char *, char *); -static boolean special_handling(const char *, BOOLEAN_P, BOOLEAN_P); +static boolean special_handling(const char *, boolean, boolean); static void warning_opts(char *, const char *); static void duplicate_opt_detection(const char *, int); @@ -630,17 +630,17 @@ static boolean test_regex_pattern(const char *, const char *); extern struct menucoloring *menu_colorings; static boolean add_menu_coloring_parsed(char *, int, int); static void free_one_menu_coloring(int); -static int count_menucolors(); +static int count_menucolors(void); #ifdef AUTOPICKUP_EXCEPTIONS -static int handler_autopickup_exception(); +static int handler_autopickup_exception(void); static void remove_autopickup_exception(struct autopickup_exception *); -static int count_apes(); +static int count_apes(void); #endif #ifdef AUTOPICKUP_EXCEPTIONS static int -handler_autopickup_exception() +handler_autopickup_exception(void) { winid tmpwin; anything any; @@ -818,10 +818,7 @@ handler_menu_colors(void) substring of a particular option name; option string might have a colon or equals sign and arbitrary value appended to it */ boolean -match_optname(user_string, opt_name, min_length, val_allowed) -const char *user_string, *opt_name; -int min_length; -boolean val_allowed; +match_optname(const char *user_string, const char *opt_name, int min_length, boolean val_allowed) { int len = (int)strlen(user_string); @@ -853,8 +850,7 @@ boolean val_allowed; * bounds-check itself. */ char * -nh_getenv(ev) -const char *ev; +nh_getenv(const char *ev) { char *getev = getenv(ev); @@ -866,7 +862,7 @@ const char *ev; /* process options */ void -initoptions() +initoptions(void) { #ifndef MAC char *opts; @@ -1042,10 +1038,7 @@ initoptions() } static void -nmcpy(dest, src, maxlen) -char *dest; -const char *src; -int maxlen; +nmcpy(char *dest, const char *src, int maxlen) { int count; @@ -1079,9 +1072,8 @@ int maxlen; * or 'O', plus stop if the non-digit is end-of-string. */ static void -escapes(cp, tp) -const char *cp; /* might be 'tp', updating in place */ -char *tp; /* result is never longer than 'cp' */ +escapes(const char *cp, /**< might be 'tp', updating in place */ + char *tp) /**< result is never longer than 'cp' */ { static NEARDATA const char oct[] = "01234567", dec[] = "0123456789", hex[] = "00112233445566778899aAbBcCdDeEfF"; @@ -1141,8 +1133,7 @@ char *tp; /* result is never longer than 'cp' */ } static void -rejectoption(optname) -const char *optname; +rejectoption(const char *optname) { #ifdef MICRO pline("\"%s\" settable only from %s.", optname, configfile); @@ -1153,8 +1144,7 @@ const char *optname; } static void -badoption(opts) -const char *opts; +badoption(const char *opts) { if (!initial) { if (!strncmp(opts, "h", 1) || !strncmp(opts, "?", 1)) @@ -1176,9 +1166,7 @@ const char *opts; } static char * -string_for_opt(opts, val_optional) -char *opts; -boolean val_optional; +string_for_opt(char *opts, boolean val_optional) { char *colon, *equals; @@ -1194,10 +1182,7 @@ boolean val_optional; } static char * -string_for_env_opt(optname, opts, val_optional) -const char *optname; -char *opts; -boolean val_optional; +string_for_env_opt(const char *optname, char *opts, boolean val_optional) { if(!initial) { rejectoption(optname); @@ -1207,9 +1192,7 @@ boolean val_optional; } static void -bad_negation(optname, with_parameter) -const char *optname; -boolean with_parameter; +bad_negation(const char *optname, boolean with_parameter) { pline_The("%s option may not %sbe negated.", optname, @@ -1226,8 +1209,7 @@ boolean with_parameter; * the string. */ static int -change_inv_order(op) -char *op; +change_inv_order(char *op) { int oc_sym, num; char *sp, buf[BUFSZ]; @@ -1261,10 +1243,7 @@ char *op; } static void -graphics_opts(opts, optype, maxlen, offset) -register char *opts; -const char *optype; -int maxlen, offset; +graphics_opts(register char *opts, const char *optype, int maxlen, int offset) { glyph_t translate[MAXPCHARS+1]; int length, i; @@ -1282,9 +1261,7 @@ int maxlen, offset; } static void -warning_opts(opts, optype) -register char *opts; -const char *optype; +warning_opts(register char *opts, const char *optype) { uchar translate[MAXPCHARS+1]; int length, i; @@ -1303,8 +1280,7 @@ const char *optype; } void -assign_warnings(graph_chars) -register uchar *graph_chars; +assign_warnings(register uchar *graph_chars) { int i; for (i = 0; i < WARNCOUNT; i++) @@ -1312,9 +1288,7 @@ register uchar *graph_chars; } static int -feature_alert_opts(op, optn) -char *op; -const char *optn; +feature_alert_opts(char *op, const char *optn) { char buf[BUFSZ]; boolean rejectver = FALSE; @@ -1351,8 +1325,7 @@ const char *optn; /* parse key:command */ boolean -parsebindings(bindings) -char* bindings; +parsebindings(char *bindings) { char *bind; char key; @@ -1411,8 +1384,7 @@ int match_str2clr(char*); int match_str2attr(const char *, boolean); struct color_option -parse_color_option(start) -char *start; +parse_color_option(char *start) { struct color_option result = { NO_COLOR, 0 }; char *end = NULL; @@ -1443,9 +1415,7 @@ const struct percent_color_option *pw_colors = NULL; const struct text_color_option *text_colors = NULL; struct percent_color_option * -add_percent_option(new_option, list_head) -struct percent_color_option *new_option; -struct percent_color_option *list_head; +add_percent_option(struct percent_color_option *new_option, struct percent_color_option *list_head) { if (list_head == NULL) return new_option; @@ -1458,8 +1428,7 @@ struct percent_color_option *list_head; } boolean -parse_status_color_option(start) -char *start; +parse_status_color_option(char *start) { char *middle; @@ -1515,8 +1484,7 @@ char *start; } boolean -parse_status_color_options(start) -char *start; +parse_status_color_options(char *start) { char last = ','; char *end = start - 1; @@ -1534,8 +1502,7 @@ char *start; #endif /* STATUS_COLORS */ void -set_duplicate_opt_detection(on_or_off) -int on_or_off; +set_duplicate_opt_detection(int on_or_off) { int k, *optptr; if (on_or_off != 0) { @@ -1563,9 +1530,9 @@ int on_or_off; } static void -duplicate_opt_detection(opts, bool_or_comp) -const char *opts; -int bool_or_comp; /* 0 == boolean option, 1 == compound */ +duplicate_opt_detection( + const char *opts, + int bool_or_comp) /**< 0 == boolean option, 1 == compound */ { int i, *optptr; #if defined(MAC) @@ -1659,8 +1626,7 @@ static const struct { }; const char * -clr2colorname(clr) -int clr; +clr2colorname(int clr) { int i; @@ -1671,8 +1637,7 @@ int clr; } int -match_str2clr(str) -char *str; +match_str2clr(char *str) { int i, c = CLR_MAX; @@ -1695,8 +1660,7 @@ char *str; } static const char * -attr2attrname(attr) -int attr; +attr2attrname(int attr) { int i; for (i = 0; i < SIZE(attrnames); i++) { @@ -1727,8 +1691,7 @@ match_str2attr(const char *str, boolean complain) } int -query_color(prompt) -const char *prompt; +query_color(const char *prompt) { winid tmpwin; anything any; @@ -1771,8 +1734,7 @@ const char *prompt; for status highlighting, multiple attributes are allowed [overkill; life would be much simpler if that were restricted to one also...] */ int -query_attr(prompt) -const char *prompt; +query_attr(const char *prompt) { winid tmpwin; anything any; @@ -1844,9 +1806,7 @@ const char *prompt; /* parse 'str' as a regular expression to check whether it's valid; compiled regexp gets thrown away regardless of the outcome */ static boolean -test_regex_pattern(str, errmsg) -const char *str; -const char *errmsg; +test_regex_pattern(const char *str, const char *errmsg) { static const char def_errmsg[] = "NHregex error"; struct nhregex *match; @@ -1883,7 +1843,7 @@ const char *errmsg; /* parse '"regex_string"=color&attr' and add it to menucoloring */ boolean -add_menu_coloring(char *tmpstr) /* never NULL but could be empty */ +add_menu_coloring(char *tmpstr) /**< never NULL but could be empty */ { int c = NO_COLOR, a = ATR_NONE; char *tmps, *cs, *amp; @@ -1934,9 +1894,7 @@ add_menu_coloring(char *tmpstr) /* never NULL but could be empty */ } static boolean -add_menu_coloring_parsed(str, c, a) -char *str; -int c, a; +add_menu_coloring_parsed(char *str, int c, int a) { static const char re_error[] = "Menucolor regex error"; struct menucoloring *tmp; @@ -1966,7 +1924,7 @@ int c, a; } void -free_menu_coloring() +free_menu_coloring(void) { struct menucoloring *tmp, *tmp2; @@ -1980,8 +1938,7 @@ free_menu_coloring() } static void -free_one_menu_coloring(idx) -int idx; /* 0 .. */ +free_one_menu_coloring(int idx) /**< 0 .. */ { struct menucoloring *tmp = menu_colorings; struct menucoloring *prev = NULL; @@ -2007,7 +1964,7 @@ int idx; /* 0 .. */ } static int -count_menucolors() +count_menucolors(void) { struct menucoloring *tmp; int count = 0; @@ -2021,8 +1978,7 @@ count_menucolors() /* parse '"monster name":color' and change monster info accordingly */ boolean -parse_monster_color(str) -char *str; +parse_monster_color(char *str) { int i, c = NO_COLOR; char *tmps, *cs = strchr(str, ':'); @@ -2079,10 +2035,10 @@ char *str; /** Split up a string that matches name:value or 'name':value and * return name and value separately. */ static boolean -parse_extended_option(str, option_name, option_value) -const char *str; -char *option_name; /**< Output string buffer for option name */ -char *option_value; /**< Output string buffer for option value */ +parse_extended_option( + const char *str, + char *option_name, /**< Output string buffer for option name */ + char *option_value) /**< Output string buffer for option value */ { int i; char *tmps, *cs; @@ -2134,8 +2090,7 @@ char *option_value; /**< Output string buffer for option value */ * Valid codepoints are decimal numbers or U+FFFF and 0xFFFF for hexadecimal * values. */ static int -parse_codepoint(codepoint) -char *codepoint; +parse_codepoint(char *codepoint) { char *ptr, *endptr; int num=0, base; @@ -2162,8 +2117,7 @@ char *codepoint; /** Parse '"monster name":unicode_codepoint' and change symbol in * monster list. */ boolean -parse_monster_symbol(str) -const char *str; +parse_monster_symbol(const char *str) { char monster[BUFSZ]; char codepoint[BUFSZ]; @@ -2192,8 +2146,7 @@ const char *str; /** Parse '"dungeon feature":unicode_codepoint' and change symbol in * UTF8graphics. */ boolean -parse_symbol(str) -const char *str; +parse_symbol(const char *str) { char feature[BUFSZ]; char codepoint[BUFSZ]; @@ -2222,8 +2175,7 @@ const char *str; /** Parse '"object name":unicode_codepoint' and change symbol in * object list. */ boolean -parse_object_symbol(str) -const char *str; +parse_object_symbol(const char *str) { char object[BUFSZ]; char codepoint[BUFSZ]; @@ -2262,8 +2214,7 @@ const char *str; /** Parse '"color_name":rgb_in_hex' and set color value in instance flags. */ boolean -parse_color_definition(str) -const char *str; +parse_color_definition(const char *str) { char color_name[BUFSZ]; char color_value[BUFSZ]; @@ -2288,10 +2239,7 @@ const char *str; } void -common_prefix_options_parser(fullname, opts, negated) -const char *fullname; -char *opts; -boolean negated; +common_prefix_options_parser(const char *fullname, char *opts, boolean negated) { boolean badopt = FALSE; char *op; @@ -2356,9 +2304,7 @@ boolean negated; } boolean -parseoptions(opts, tinitial, tfrom_file) -register char *opts; -boolean tinitial, tfrom_file; +parseoptions(register char *opts, boolean tinitial, boolean tfrom_file) { register char *op; unsigned num; @@ -4308,8 +4254,7 @@ static NEARDATA const char *sortltype[] = { * symbols. */ static void -oc_to_str(src, dest) -char *src, *dest; +oc_to_str(char *src, char *dest) { int i; @@ -4327,8 +4272,7 @@ char *src, *dest; * maps valid C strings. */ void -add_menu_cmd_alias(from_ch, to_ch) -char from_ch, to_ch; +add_menu_cmd_alias(char from_ch, char to_ch) { if (n_menu_mapped >= MAX_MENU_MAPPED_CMDS) pline("out of menu map space."); @@ -4346,8 +4290,7 @@ char from_ch, to_ch; * doesn't match anything, just return the original. */ char -map_menu_cmd(ch) -char ch; +map_menu_cmd(char ch) { char *found = index(mapped_menu_cmds, ch); if (found) { @@ -4368,10 +4311,10 @@ static char fmtstr_doset_add_menu[] = "%s%-15s [%s] "; static char fmtstr_doset_add_menu_tab[] = "%s\t[%s]"; static void -doset_add_menu(win, option, indexoffset) -winid win; /* window to add to */ -const char *option; /* option name */ -int indexoffset; /* value to add to index in compopt[], or zero +doset_add_menu(winid win, const char *option, int indexoffset) + /* window to add to */ + /* option name */ + /* value to add to index in compopt[], or zero if option cannot be changed */ { const char *value = "unknown"; /* current value */ @@ -4407,7 +4350,7 @@ int indexoffset; /* value to add to index in compopt[], or zero /* Changing options via menu by Per Liboriussen */ int -doset() +doset(void) { char buf[BUFSZ*2], buf2[BUFSZ]; int i, pass, boolcount, pick_cnt, pick_idx, opt_indx; @@ -4614,9 +4557,7 @@ doset() } static boolean -special_handling(optname, setinitial, setfromfile) -const char *optname; -boolean setinitial, setfromfile; +special_handling(const char *optname, boolean setinitial, boolean setfromfile) { winid tmpwin; anything any; @@ -5093,9 +5034,7 @@ boolean setinitial, setfromfile; /* This is ugly. We have all the option names in the compopt[] array, but we need to look at each option individually to get the value. */ static const char * -get_compopt_value(optname, buf) -const char *optname; -char *buf; +get_compopt_value(const char *optname, char *buf) { char ocl[MAXOCLASSES+1]; static const char none[] = "(none)", randomrole[] = "random", @@ -5460,9 +5399,7 @@ char *buf; /* common to msg-types, menu-colors, autopickup-exceptions */ static int -handle_add_list_remove(optname, numtotal) -const char *optname; -int numtotal; +handle_add_list_remove(const char *optname, int numtotal) { winid tmpwin; anything any; @@ -5510,7 +5447,7 @@ int numtotal; } int -dotogglepickup() +dotogglepickup(void) { char buf[BUFSZ], ocl[MAXOCLASSES+1]; @@ -5531,8 +5468,7 @@ dotogglepickup() #ifdef AUTOPICKUP_EXCEPTIONS int -add_autopickup_exception(mapping) -const char *mapping; +add_autopickup_exception(const char *mapping) { static const char APE_regex_error[] = "regex error in AUTOPICKUP_EXCEPTION"; static const char APE_syntax_error[] = "syntax error in AUTOPICKUP_EXCEPTION"; @@ -5578,8 +5514,7 @@ const char *mapping; } static void -remove_autopickup_exception(whichape) -struct autopickup_exception *whichape; +remove_autopickup_exception(struct autopickup_exception *whichape) { struct autopickup_exception *ape, *freeape, *prev = 0; @@ -5603,7 +5538,7 @@ struct autopickup_exception *whichape; } void -free_autopickup_exceptions() +free_autopickup_exceptions(void) { struct autopickup_exception *ape; @@ -5616,7 +5551,7 @@ free_autopickup_exceptions() } int -count_apes() +count_apes(void) { int numapes = 0; struct autopickup_exception *ape = apelist; @@ -5659,7 +5594,7 @@ static const char *opt_epilog[] = { }; void -option_help() +option_help(void) { char buf[BUFSZ], buf2[BUFSZ]; register int i; @@ -5705,9 +5640,7 @@ option_help() * line if not. End with next_opt(""). */ void -next_opt(datawin, str) -winid datawin; -const char *str; +next_opt(winid datawin, const char *str) { static char *buf = 0; int i; @@ -5740,8 +5673,7 @@ const char *str; /** Check if character c is illegal as a menu command key */ boolean -illegal_menu_cmd_key(c) -char c; +illegal_menu_cmd_key(char c) { if (c == 0 || c == '\r' || c == '\n' || c == '\033' || c == ' ' || digit(c) || (letter(c) && c != '@')) { @@ -5764,8 +5696,7 @@ char c; * type to the chain and returns the new one. */ int -fruitadd(str) -char *str; +fruitadd(char *str) { register int i; register struct fruit *f; @@ -5866,12 +5797,7 @@ char *str; * Returns number selected. */ int -choose_classes_menu(prompt, category, way, class_list, class_select) -const char *prompt; -int category; -boolean way; -char *class_list; -char *class_select; +choose_classes_menu(const char *prompt, int category, boolean way, char *class_list, char *class_select) { menu_item *pick_list = (menu_item *)0; winid win; @@ -6001,9 +5927,7 @@ struct wc_Opt wc2_options[] = { * with the second argument of 0,2, or 3 respectively. */ void -set_option_mod_status(optnam, status) -const char *optnam; -int status; +set_option_mod_status(const char *optnam, int status) { int k; if (status < SET_IN_FILE || status > SET_IN_GAME) { @@ -6034,9 +5958,7 @@ int status; * example: set_wc_option_mod_status(WC_COLOR|WC_SCROLL_MARGIN, SET_IN_GAME); */ void -set_wc_option_mod_status(optmask, status) -unsigned long optmask; -int status; +set_wc_option_mod_status(long unsigned int optmask, int status) { int k = 0; if (status < SET_IN_FILE || status > SET_IN_GAME) { @@ -6053,8 +5975,7 @@ int status; } static boolean -is_wc_option(optnam) -const char *optnam; +is_wc_option(const char *optnam) { int k = 0; while (wc_options[k].wc_name) { @@ -6066,8 +5987,7 @@ const char *optnam; } static boolean -wc_supported(optnam) -const char *optnam; +wc_supported(const char *optnam) { int k = 0; while (wc_options[k].wc_name) { @@ -6090,9 +6010,7 @@ const char *optnam; */ void -set_wc2_option_mod_status(optmask, status) -unsigned long optmask; -int status; +set_wc2_option_mod_status(long unsigned int optmask, int status) { int k = 0; if (status < SET_IN_FILE || status > SET_IN_GAME) { @@ -6109,8 +6027,7 @@ int status; } static boolean -is_wc2_option(optnam) -const char *optnam; +is_wc2_option(const char *optnam) { int k = 0; while (wc2_options[k].wc_name) { @@ -6122,8 +6039,7 @@ const char *optnam; } static boolean -wc2_supported(optnam) -const char *optnam; +wc2_supported(const char *optnam) { int k = 0; while (wc2_options[k].wc_name) { @@ -6137,9 +6053,7 @@ const char *optnam; static void -wc_set_font_name(wtype, fontname) -int wtype; -char *fontname; +wc_set_font_name(int wtype, char *fontname) { char **fn = (char **)0; if (!fontname) return; @@ -6171,8 +6085,7 @@ char *fontname; } static int -wc_set_window_colors(op) -char *op; +wc_set_window_colors(char *op) { /* syntax: * menu white/black message green/yellow status white/blue text white/black diff --git a/src/pager.c b/src/pager.c index 4b57f57f3..063f035a4 100644 --- a/src/pager.c +++ b/src/pager.c @@ -13,7 +13,7 @@ static struct permonst * lookat(int, int, char *, char *); static void look_all(boolean, boolean, boolean); static void add_obj_info(winid, struct obj *, short); static void add_mon_info(winid, struct permonst *); -static void do_supplemental_info(char *, struct permonst *, BOOLEAN_P); +static void do_supplemental_info(char *, struct permonst *, boolean); static boolean help_menu(int *); #ifdef PORT_HELP extern void port_help(); @@ -24,8 +24,7 @@ static boolean lookup_database_entry(dlb *fp, struct obj *obj, const char* dbase /* Returns "true" for characters that could represent a monster's stomach. */ static boolean -is_swallow_sym(c) -int c; +is_swallow_sym(int c) { int i; for (i = S_sw_tl; i <= S_sw_br; i++) @@ -39,9 +38,7 @@ int c; * It is expected that buf is of size BUFSZ. */ static int -append_str(buf, new_str) -char *buf; -const char *new_str; +append_str(char *buf, const char *new_str) { int space_left; /* space remaining in buf */ @@ -58,8 +55,7 @@ const char *new_str; /* shared by monster probing (via query_objlist!) as well as lookat() */ char * -self_lookat(outbuf) -char *outbuf; +self_lookat(char *outbuf) { char race[QBUFSZ]; @@ -84,10 +80,10 @@ char *outbuf; /* describe a hidden monster; used for look_at during extended monster detection and for probing; also when looking at self */ void -mhidden_description(mon, altmon, outbuf) -struct monst *mon; -boolean altmon; /* for probing: if mimicking a monster, say so */ -char *outbuf; +mhidden_description(struct monst *mon, boolean altmon, char *outbuf) + + /* for probing: if mimicking a monster, say so */ + { struct obj *otmp; boolean fakeobj, isyou = (mon == &youmonst); @@ -142,9 +138,7 @@ char *outbuf; /* extracted from lookat(); also used by namefloorobj() */ boolean -object_from_map(glyph, x, y, obj_p) -int glyph, x, y; -struct obj **obj_p; +object_from_map(int glyph, int x, int y, struct obj **obj_p) { boolean fakeobj = FALSE, mimic_obj = FALSE; struct monst *mtmp; @@ -229,9 +223,9 @@ struct obj **obj_p; } static void -look_at_object(buf, x, y, glyph) -char *buf; /* output buffer */ -int x, y, glyph; +look_at_object(char *buf, int x, int y, int glyph) + /* output buffer */ + { struct obj *otmp = 0; boolean fakeobj = object_from_map(glyph, x, y, &otmp); @@ -264,10 +258,10 @@ int x, y, glyph; } static void -look_at_monster(buf, monbuf, mtmp, x, y) -char *buf, *monbuf; /* buf: output, monbuf: optional output */ -struct monst *mtmp; -int x, y; +look_at_monster(char *buf, char *monbuf, struct monst *mtmp, int x, int y) + /* buf: output, monbuf: optional output */ + + { char *name, monnambuf[BUFSZ]; boolean accurate = !Hallucination; @@ -394,9 +388,7 @@ int x, y; * If not hallucinating and the glyph is a monster, also monster data. */ static struct permonst * -lookat(x, y, buf, monbuf) -int x, y; -char *buf, *monbuf; +lookat(int x, int y, char *buf, char *monbuf) { struct monst *mtmp = (struct monst *) 0; struct permonst *pm = (struct permonst *) 0; @@ -1369,12 +1361,7 @@ add_obj_info(winid datawin, struct obj *obj, short otyp) * Therefore, we create a copy of inp _just_ for data.base lookup. */ void -checkfile(obj, inp, pm, user_typed_name, without_asking, supplemental_name) -struct obj *obj; -char *inp; -struct permonst *pm; -boolean user_typed_name, without_asking; -char *supplemental_name; +checkfile(struct obj *obj, char *inp, struct permonst *pm, boolean user_typed_name, boolean without_asking, char *supplemental_name) { dlb *fp; char newstr[BUFSZ]; @@ -1766,13 +1753,7 @@ char *supplemental_name) #define LOOK_VERBOSE 3 /* ':' -- show more info w/o asking */ int -do_screen_description(cc, looked, sym, out_str, firstmatch, for_supplement) -coord cc; -boolean looked; -glyph_t sym; -char *out_str; -const char **firstmatch; -struct permonst **for_supplement; +do_screen_description(coord cc, boolean looked, glyph_t sym, char *out_str, const char **firstmatch, struct permonst **for_supplement) { static const char mon_interior[] = "the interior of a monster"; static const char unreconnoitered[] = "unreconnoitered"; @@ -2650,10 +2631,7 @@ static const char *suptext2[] = { }; static void -do_supplemental_info(name, pm, without_asking) -char *name; -struct permonst *pm; -boolean without_asking; +do_supplemental_info(char *name, struct permonst *pm, boolean without_asking) { const char **textp; winid datawin = WIN_ERR; @@ -2718,14 +2696,14 @@ boolean without_asking; /* the '/' command */ int -dowhatis() +dowhatis(void) { return do_look(0, (coord *) 0); } /* the ';' command */ int -doquickwhatis() +doquickwhatis(void) { if(iflags.num_pad) check_tutorial_message(QT_T_CURSOR_NUMPAD); @@ -2736,7 +2714,7 @@ doquickwhatis() } int -doidtrap() +doidtrap(void) { register struct trap *trap; int x, y, tt; @@ -2768,9 +2746,7 @@ doidtrap() } char * -dowhatdoes_core(q, cbuf) -char q; -char *cbuf; +dowhatdoes_core(char q, char *cbuf) { dlb *fp; char bufr[BUFSZ]; @@ -2813,7 +2789,7 @@ char *cbuf; } int -dowhatdoes() +dowhatdoes(void) { char bufr[BUFSZ]; char q, *reslt; @@ -2861,8 +2837,7 @@ static const char *help_menu_items[] = { }; static boolean -help_menu(sel) -int *sel; +help_menu(int *sel) { winid tmpwin = create_nhwindow(NHW_MENU); #ifdef PORT_HELP @@ -2906,7 +2881,7 @@ int *sel; } int -dohelp() +dohelp(void) { int sel = 0; @@ -2935,7 +2910,7 @@ dohelp() } int -dohistory() +dohistory(void) { display_file_area(NH_HISTORY_AREA, HISTORY, TRUE); return 0; diff --git a/src/pickup.c b/src/pickup.c index d6ece7143..178b9bdb6 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -9,10 +9,10 @@ #define CONTAINED_SYM '>' /* from invent.c */ -static void simple_look(struct obj *, BOOLEAN_P); +static void simple_look(struct obj *, boolean); static boolean query_classes(char *, boolean *, boolean *, - const char *, struct obj *, BOOLEAN_P, int *); -static void check_here(BOOLEAN_P); + const char *, struct obj *, boolean, int *); +static void check_here(boolean); static boolean n_or_more(struct obj *); static boolean all_but_uchain(struct obj *); #if 0 /* not used */ @@ -20,22 +20,22 @@ static boolean allow_cat_no_uchain(struct obj *); #endif static int autopick(struct obj*, int, menu_item **); static int count_categories(struct obj *, int); -static long carry_count(struct obj *, struct obj *, long, BOOLEAN_P, int *, int *); -static int lift_object(struct obj *, struct obj *, long *, BOOLEAN_P); +static long carry_count(struct obj *, struct obj *, long, boolean, int *, int *); +static int lift_object(struct obj *, struct obj *, long *, boolean); static boolean mbag_explodes(struct obj *, int); static int in_container(struct obj *); static int ck_bag(struct obj *); static int out_container(struct obj *); static void removed_from_icebox(struct obj *); static long mbag_item_gone(int, struct obj *); -static int traditional_loot(BOOLEAN_P); -static int menu_loot(int, BOOLEAN_P); -static char in_or_out_menu(const char *, struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P); -static boolean able_to_loot(int, int, BOOLEAN_P); +static int traditional_loot(boolean); +static int menu_loot(int, boolean); +static char in_or_out_menu(const char *, struct obj *, boolean, boolean, boolean, boolean); +static boolean able_to_loot(int, int, boolean); static boolean mon_beside(int, int); static int do_loot_cont(struct obj **, int, int); -static int dump_container(struct obj*, BOOLEAN_P); -static void del_sokoprize(); +static int dump_container(struct obj*, boolean); +static void del_sokoprize(void); /* define for query_objlist() and autopickup() */ #define FOLLOW(curr, flags) \ @@ -60,9 +60,9 @@ static const char overloadmsg[] = "You have extreme difficulty lifting"; touching them */ /* much simpler version of the look-here code; used by query_classes() */ static void -simple_look(otmp, here) -struct obj *otmp; /* list of objects */ -boolean here; /* flag for type of obj list linkage */ +simple_look( + struct obj *otmp, /**< list of objects */ + boolean here) /**< flag for type of obj list linkage */ { /* Neither of the first two cases is expected to happen, since * we're only called after multiple classes of objects have been @@ -85,12 +85,7 @@ boolean here; /* flag for type of obj list linkage */ } int -collect_obj_classes(ilets, otmp, here, filter, itemcount) -char ilets[]; -register struct obj *otmp; -boolean here; -boolean (*filter)(OBJ_P); -int *itemcount; +collect_obj_classes(char *ilets, register struct obj *otmp, boolean here, boolean (*filter) (struct obj *), int *itemcount) { register int iletct = 0; register char c; @@ -121,14 +116,14 @@ int *itemcount; * (ie, treated as if it had just been "?a"). */ static boolean -query_classes(oclasses, one_at_a_time, everything, action, objs, - here, menu_on_demand) -char oclasses[]; -boolean *one_at_a_time, *everything; -const char *action; -struct obj *objs; -boolean here; -int *menu_on_demand; +query_classes( + char oclasses[], + boolean *one_at_a_time, + boolean *everything, + const char *action, + struct obj *objs, + boolean here, + int *menu_on_demand) { char ilets[20], inbuf[BUFSZ]; int iletct, oclassct; @@ -246,9 +241,7 @@ int *menu_on_demand; /* check whether hero is bare-handedly touching a cockatrice corpse */ static boolean -fatal_corpse_mistake(obj, remotely) -struct obj *obj; -boolean remotely; +fatal_corpse_mistake(struct obj *obj, boolean remotely) { if (uarmg || remotely || obj->otyp != CORPSE || !touch_petrifies(&mons[obj->corpsenm]) || Stone_resistance) { @@ -268,9 +261,7 @@ boolean remotely; /* attempting to manipulate a Rider's corpse triggers its revival */ boolean -rider_corpse_revival(obj, remotely) -struct obj *obj; -boolean remotely; +rider_corpse_revival(struct obj *obj, boolean remotely) { if (!obj || obj->otyp != CORPSE || !is_rider(&mons[obj->corpsenm])) { return FALSE; @@ -286,8 +277,7 @@ boolean remotely; /* look at the objects at our location, unless there are too many of them */ static void -check_here(picked_some) -boolean picked_some; +check_here(boolean picked_some) { register struct obj *obj; register int ct = 0; @@ -313,8 +303,7 @@ static long val_for_n_or_more; /* query_objlist callback: return TRUE if obj's count is >= reference value */ static boolean -n_or_more(obj) -struct obj *obj; +n_or_more(struct obj *obj) { if (obj == uchain) return FALSE; return (obj->quan >= val_for_n_or_more); @@ -328,15 +317,13 @@ static boolean unidentified_filter, recently_picked_up_filter; /* check valid_menu_classes[] for an entry; also used by askchain() */ boolean -menu_class_present(c) -int c; +menu_class_present(int c) { return (c && index(valid_menu_classes, c)) ? TRUE : FALSE; } void -add_valid_menu_class(c) -int c; +add_valid_menu_class(int c) { static int vmc_count = 0; @@ -380,8 +367,7 @@ int c; /* query_objlist callback: return TRUE if not uchain */ static boolean -all_but_uchain(obj) -struct obj *obj; +all_but_uchain(struct obj *obj) { return (obj != uchain); } @@ -389,15 +375,13 @@ struct obj *obj; /* query_objlist callback: return TRUE */ /*ARGSUSED*/ boolean -allow_all(obj) -struct obj *obj UNUSED; +allow_all(struct obj *obj UNUSED) { return TRUE; } boolean -allow_category(obj) -struct obj *obj; +allow_category(struct obj *obj) { /* For coins, if any class filter is specified, accept if coins * are included regardless of whether either unpaid or BUC-status @@ -469,8 +453,7 @@ struct obj *obj; /* query_objlist callback: return TRUE if valid class and worn */ boolean -is_worn_by_type(otmp) -register struct obj *otmp; +is_worn_by_type(register struct obj *otmp) { return (is_worn(otmp) && allow_category(otmp)); } @@ -479,7 +462,7 @@ register struct obj *otmp; * Returns the most recent turn on which an item got picked up. */ int -get_most_recently_picked_up_turn() +get_most_recently_picked_up_turn(void) { struct obj *list = invent; int turn = 0; @@ -541,8 +524,7 @@ find_most_recently_picked_up_obj(struct obj *olist) * or not it succeeded. */ int -pickup(what) -int what; /* should be a long */ +pickup(int what) /* should be a long */ { int i, n, res, count, n_tried = 0, n_picked = 0; menu_item *pick_list = (menu_item *) 0; @@ -779,8 +761,7 @@ int what; /* should be a long */ #ifdef AUTOPICKUP_EXCEPTIONS struct autopickup_exception * -check_autopickup_exceptions(obj) -struct obj *obj; +check_autopickup_exceptions(struct obj *obj) { /* * Does the text description of this match an exception? @@ -799,9 +780,7 @@ struct obj *obj; #endif /* AUTOPICKUP_EXCEPTIONS */ boolean -autopick_testobj(otmp, calc_costly) -struct obj *otmp; -boolean calc_costly; +autopick_testobj(struct obj *otmp, boolean calc_costly) { static boolean costly = FALSE; const char *otypes = flags.pickup_types; @@ -855,10 +834,10 @@ boolean calc_costly; * function must free the pickup list. */ static int -autopick(olist, follow, pick_list) -struct obj *olist; /* the object list */ -int follow; /* how to follow the object list */ -menu_item **pick_list; /* list of objects and counts to pick up */ +autopick( + struct obj *olist, /**< the object list */ + int follow, /**< how to follow the object list */ + menu_item **pick_list) /**< list of objects and counts to pick up */ { menu_item *pi; /* pick item */ struct obj *curr; @@ -908,13 +887,13 @@ menu_item **pick_list; /* list of objects and counts to pick up */ * FEEL_COCKATRICE - touch corpse. */ int -query_objlist(qstr, olist, qflags, pick_list, how, allow) -const char *qstr; /* query string */ -struct obj *olist; /* the list to pick from */ -int qflags; /* options to control the query */ -menu_item **pick_list; /* return list of items picked */ -int how; /* type of query */ -boolean (*allow)(OBJ_P);/* allow function */ +query_objlist( + const char *qstr, /**< query string */ + struct obj *olist, /**< the list to pick from */ + int qflags, /**< options to control the query */ + menu_item **pick_list, /**< return list of items picked */ + int how, /**< type of query */ + boolean (*allow)(OBJ_P)) /**< allow function */ { int i; #ifdef SORTLOOT @@ -1056,12 +1035,12 @@ boolean (*allow)(OBJ_P);/* allow function */ * */ int -query_category(qstr, olist, qflags, pick_list, how) -const char *qstr; /* query string */ -struct obj *olist; /* the list to pick from */ -int qflags; /* behaviour modification flags */ -menu_item **pick_list; /* return list of items picked */ -int how; /* type of query */ +query_category( + const char *qstr, /**< query string */ + struct obj *olist, /**< the list to pick from */ + int qflags, /**< behaviour modification flags */ + menu_item **pick_list, /**< return list of items picked */ + int how) /**< type of query */ { int n; winid win; @@ -1268,9 +1247,7 @@ int how; /* type of query */ } static int -count_categories(olist, qflags) -struct obj *olist; -int qflags; +count_categories(struct obj *olist, int qflags) { char *pack; boolean counted_category; @@ -1332,11 +1309,11 @@ delta_cwt(struct obj *container, struct obj *obj) /* could we carry `obj'? if not, could we carry some of it/them? */ static long -carry_count(obj, container, count, telekinesis, wt_before, wt_after) -struct obj *obj, *container; /* object to pick up, bag it's coming out of */ -long count; -boolean telekinesis; -int *wt_before, *wt_after; +carry_count(struct obj *obj, struct obj *container, long int count, boolean telekinesis, int *wt_before, int *wt_after) + /* object to pick up, bag it's coming out of */ + + + { boolean adjust_wt = container && carried(container), is_gold = obj->oclass == COIN_CLASS; @@ -1467,10 +1444,10 @@ int *wt_before, *wt_after; /* determine whether character is able and player is willing to carry `obj' */ static int -lift_object(obj, container, cnt_p, telekinesis) -struct obj *obj, *container; /* object to pick up, bag it's coming out of */ -long *cnt_p; -boolean telekinesis; +lift_object(struct obj *obj, struct obj *container, long int *cnt_p, boolean telekinesis) + /* object to pick up, bag it's coming out of */ + + { int result, old_wt, new_wt, prev_encumbr, next_encumbr; @@ -1553,10 +1530,10 @@ boolean telekinesis; * up, 1 if otherwise. */ int -pickup_object(obj, count, telekinesis) -struct obj *obj; -long count; -boolean telekinesis; /* not picking it up directly by hand */ +pickup_object( + struct obj *obj, + long count, + boolean telekinesis) /**< not picking it up directly by hand */ { int res, nearload; @@ -1647,8 +1624,7 @@ boolean telekinesis; /* not picking it up directly by hand */ * from otmp because of merging. */ struct obj * -pick_obj(otmp) -struct obj *otmp; +pick_obj(struct obj *otmp) { int ox = otmp->ox, oy = otmp->oy; boolean robshop = (!u.uswallow && otmp != uball && costly_spot(ox, oy)); @@ -1695,7 +1671,7 @@ struct obj *otmp; * returns the new encumbrance value (from near_capacity()). */ int -encumber_msg() +encumber_msg(void) { static int oldcap = UNENCUMBERED; int newcap = near_capacity(); @@ -1741,9 +1717,7 @@ encumber_msg() /* Is there a container at x,y. Optional: return count of containers at x,y */ int -container_at(x, y, countem) -int x, y; -boolean countem; +container_at(int x, int y, boolean countem) { struct obj *cobj, *nobj; int container_count = 0; @@ -1768,9 +1742,10 @@ boolean countem; * for tippability and bringing up the inventory prompt. */ static boolean -able_to_loot(x, y, looting) -int x, y; -boolean looting; /* loot vs tip */ +able_to_loot( + int x, + int y, + boolean looting) /**< loot vs tip */ { const char *verb = looting ? "loot" : "tip"; @@ -1798,8 +1773,7 @@ boolean looting; /* loot vs tip */ } static boolean -mon_beside(x, y) -int x, y; +mon_beside(int x, int y) { int i, j, nx, ny; @@ -1816,9 +1790,10 @@ int x, y; } static int -do_loot_cont(cobjp, cindex, container_count) -struct obj **cobjp; -int cindex, container_count; /* index of this container (1..N), number of them (N) */ +do_loot_cont( + struct obj **cobjp, + int cindex, /**< index of this container (1..N)... */ + int container_count) /**< ...number of them (N) */ { struct obj *cobj = *cobjp; @@ -1869,7 +1844,7 @@ int cindex, container_count; /* index of this container (1..N), number of them ( } /* loot a container on the floor or loot saddle from mon. */ int -doloot() +doloot(void) { struct obj *cobj, *nobj, *otmp; register int c = -1; @@ -2040,7 +2015,7 @@ doloot() } boolean -shopclutter() +shopclutter(void) { /* try to be a civilized adventurer, will you? */ if (*u.ushops && shop_keeper(*u.ushops) @@ -2071,8 +2046,7 @@ shopclutter() * breakage which takes place in dump_container(). */ int -tip_container(cobj) -struct obj *cobj; +tip_container(struct obj *cobj) { /* tipping in shops is buggy, thus temporarily disallowed */ if (*u.ushops && shop_keeper(*u.ushops) && @@ -2112,7 +2086,7 @@ struct obj *cobj; * when confused or hallucinating in such a circumstance. */ int -dotip() +dotip(void) { register struct obj *cobj, *nobj; register struct monst *shkp; @@ -2185,10 +2159,7 @@ dotip() /* loot_mon() returns amount of time passed. */ int -loot_mon(mtmp, passed_info, prev_loot) -struct monst *mtmp; -int *passed_info; -boolean *prev_loot; +loot_mon(struct monst *mtmp, int *passed_info, boolean *prev_loot) { int c = -1; int timepassed = 0; @@ -2247,9 +2218,7 @@ boolean *prev_loot; * it to explode. If the object is a bag itself, check recursively. */ static boolean -mbag_explodes(obj, depthin) -struct obj *obj; -int depthin; +mbag_explodes(struct obj *obj, int depthin) { /* these won't cause an explosion when they're empty */ if ((obj->otyp == WAN_CANCELLATION || obj->otyp == BAG_OF_TRICKS) && @@ -2270,9 +2239,7 @@ int depthin; } static long -boh_loss(container, held) -struct obj *container; -int held; +boh_loss(struct obj *container, int held) { /* sometimes toss objects if a cursed magic bag */ if (Is_mbag(container) && container->cursed && Has_contents(container)) { @@ -2298,8 +2265,7 @@ static NEARDATA struct obj *current_container; /* Returns: -1 to stop, 1 item was inserted, 0 item was not inserted. */ static int -in_container(obj) -register struct obj *obj; +in_container(register struct obj *obj) { boolean floor_container = !carried(current_container); boolean was_unpaid = FALSE; @@ -2471,16 +2437,14 @@ register struct obj *obj; } static int -ck_bag(obj) -struct obj *obj; +ck_bag(struct obj *obj) { return current_container && obj != current_container; } /* Returns: -1 to stop, 1 item was removed, 0 item was not removed. */ static int -out_container(obj) -register struct obj *obj; +out_container(register struct obj *obj) { register struct obj *otmp; boolean is_gold = (obj->oclass == COIN_CLASS); @@ -2542,8 +2506,7 @@ register struct obj *obj; /* taking a corpse out of an ice box needs a couple of adjustments */ static void -removed_from_icebox(obj) -struct obj *obj; +removed_from_icebox(struct obj *obj) { if (!age_is_relative(obj)) { obj->age = monstermoves - obj->age; /* actual age */ @@ -2555,9 +2518,7 @@ struct obj *obj; /* an object inside a cursed bag of holding is being destroyed */ static long -mbag_item_gone(held, item) -int held; -struct obj *item; +mbag_item_gone(int held, struct obj *item) { struct monst *shkp; long loss = 0L; @@ -2578,9 +2539,7 @@ struct obj *item; /* used for #loot/apply, #tip, and final disclosure */ void -observe_quantum_cat(box, past) -struct obj *box; -boolean past; +observe_quantum_cat(struct obj *box, boolean past) { static NEARDATA const char sc[] = "Schroedinger's Cat"; struct obj *deadcat; @@ -2637,9 +2596,7 @@ boolean past; /* based largely on borrowed code from dNetHack by Chris_ANG */ void -open_coffin(box, past) -struct obj *box; -boolean past; +open_coffin(struct obj *box, boolean past) { /* static NEARDATA const char sc[] = "Schroedinger's Cat"; */ /* Would be nice to name the vampire and put the name on the coffin. But not today. */ @@ -2670,16 +2627,14 @@ boolean past; /* used by askchain() to check for magic bag explosion */ boolean -container_gone(fn) -int (*fn)(OBJ_P); +container_gone(int (*fn) (struct obj *)) { /* result is only meaningful while use_container() is executing */ return ((fn == in_container || fn == out_container) && !current_container); } static void -explain_container_prompt(more_containers) -boolean more_containers; +explain_container_prompt(boolean more_containers) { static const char *const explaintext[] = { "Container actions:", @@ -2712,7 +2667,7 @@ boolean more_containers; } boolean -u_handsy() +u_handsy(void) { if (nohands(youmonst.data)) { You("have no hands!"); /* not `body_part(HAND)' */ @@ -2727,10 +2682,10 @@ u_handsy() static const char stashable[] = { ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, 0 }; int -use_container(objp, held, more_containers) -struct obj **objp; -int held; -boolean more_containers; /* True iff #loot multiple and this isn't last one */ +use_container( + struct obj **objp, + int held, + boolean more_containers) /**< TRUE iff #loot multiple and this isn't last one */ { struct obj *otmp, *obj = *objp; boolean one_by_one, allflag, quantum_cat = FALSE, @@ -3004,8 +2959,7 @@ boolean more_containers; /* True iff #loot multiple and this isn't last one */ /* loot current_container (take things out or put things in), by prompting */ static int -traditional_loot(put_in) -boolean put_in; +traditional_loot(boolean put_in) { int (*actionfunc)(OBJ_P), (*checkfunc)(OBJ_P); struct obj **objlist; @@ -3039,9 +2993,7 @@ boolean put_in; /* Loot a container (take things out, put things in), using a menu. */ static int -menu_loot(retry, put_in) -int retry; -boolean put_in; +menu_loot(int retry, boolean put_in) { int n, i, n_looted = 0; boolean all_categories = TRUE, loot_everything = FALSE; @@ -3137,10 +3089,7 @@ boolean put_in; } static char -in_or_out_menu(prompt, obj, outokay, inokay, alreadyused, more_containers) -const char *prompt; -struct obj *obj; -boolean outokay, inokay, alreadyused, more_containers; +in_or_out_menu(const char *prompt, struct obj *obj, boolean outokay, boolean inokay, boolean alreadyused, boolean more_containers) { /* underscore is not a choice; it's used to skip element [0] */ static const char lootchars[] = "_:oibrsnq", abc_chars[] = "_:abcdenq"; @@ -3226,9 +3175,7 @@ boolean outokay, inokay, alreadyused, more_containers; * Returns 1 if at least one object was present, 0 if empty. */ int -dump_container(container, destroy_after) -struct obj* container; -BOOLEAN_P destroy_after; +dump_container(struct obj *container, boolean destroy_after) { struct obj* otmp, *otmp2; int ret = 0; @@ -3335,7 +3282,7 @@ BOOLEAN_P destroy_after; static void -del_sokoprize() +del_sokoprize(void) { int x, y, cnt = 0; struct obj *otmp, *onext; diff --git a/src/pline.c b/src/pline.c index 68ca203a2..5cdd00bee 100644 --- a/src/pline.c +++ b/src/pline.c @@ -15,9 +15,7 @@ int lastmsg = -1; #endif void -msgpline_add(typ, pattern) -int typ; -char *pattern; +msgpline_add(int typ, char *pattern) { struct _plinemsg *tmp = (struct _plinemsg *) alloc(sizeof(struct _plinemsg)); if (!tmp) return; @@ -28,7 +26,7 @@ char *pattern; } void -msgpline_free() +msgpline_free(void) { struct _plinemsg *tmp = pline_msg; struct _plinemsg *tmp2; @@ -42,8 +40,7 @@ msgpline_free() } int -msgpline_type(msg) -char *msg; +msgpline_type(char *msg) { struct _plinemsg *tmp = pline_msg; while (tmp) { @@ -186,8 +183,7 @@ static char *you_buf = 0; static int you_buf_siz = 0; static char * -You_buf(siz) -int siz; +You_buf(int siz) { if (siz > you_buf_siz) { if (you_buf) free((genericptr_t) you_buf); @@ -198,7 +194,7 @@ int siz; } void -free_youbuf() +free_youbuf(void) { if (you_buf) free((genericptr_t) you_buf), you_buf = (char *)0; you_buf_siz = 0; @@ -424,8 +420,7 @@ warning VA_DECL(const char *, s) } const char * -align_str(alignment) -aligntyp alignment; +align_str(aligntyp alignment) { switch ((int)alignment) { case A_CHAOTIC: return "chaotic"; @@ -438,8 +433,7 @@ aligntyp alignment; /* stethoscope or probing applied to monster -- one-line feedback */ void -mstatusline(mtmp) -struct monst *mtmp; +mstatusline(struct monst *mtmp) { aligntyp alignment = mon_aligntyp(mtmp); char info[BUFSZ], monnambuf[BUFSZ]; @@ -551,7 +545,7 @@ struct monst *mtmp; /* stethoscope or probing applied to hero -- one-line feedback */ void -ustatusline() +ustatusline(void) { char info[BUFSZ]; @@ -616,7 +610,7 @@ ustatusline() } void -self_invis_message() +self_invis_message(void) { pline("%s %s.", Hallucination ? "Far out, man! You" : "Gee! All of a sudden, you", diff --git a/src/polyself.c b/src/polyself.c index 56422dbbf..d7b5bf053 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -22,17 +22,17 @@ static void polyman(const char *, const char *); static void dropp(struct obj *); -static void break_armor(); +static void break_armor(void); static void drop_weapon(int); static int armor_to_dragon(int); -static void newman(); +static void newman(void); static const char no_longer_petrify_resistant[] = "No longer petrify-resistant, you"; /* Assumes u.umonster is set up already */ /* Use u.umonster since we might be restoring and you may be polymorphed */ void -init_uasmon() +init_uasmon(void) { int i; @@ -69,7 +69,7 @@ init_uasmon() /* update the youmonst.data structure pointer */ void -set_uasmon() +set_uasmon(void) { set_mon_data(&youmonst, ((u.umonnum == u.umonster) ? &upermonst : &mons[u.umonnum])); @@ -77,7 +77,7 @@ set_uasmon() /* Levitation overrides Flying; set or clear BFlying|I_SPECIAL */ void -float_vs_flight() +float_vs_flight(void) { boolean stuck_in_floor = (u.utrap && u.utraptype != TT_PIT); @@ -102,7 +102,7 @@ float_vs_flight() /** Returns true if the player monster is genocided. */ boolean -is_playermon_genocided() +is_playermon_genocided(void) { return ((mvitals[urole.malenum].mvflags & G_GENOD) || (urole.femalenum != NON_PM && @@ -114,8 +114,7 @@ is_playermon_genocided() /* for changing into form that's immune to strangulation */ static void -check_strangling(on) -boolean on; +check_strangling(boolean on) { /* on -- maybe resume strangling */ if (on) { @@ -143,8 +142,7 @@ boolean on; /* make a (new) human out of the player */ static void -polyman(fmt, arg) -const char *fmt, *arg; +polyman(const char *fmt, const char *arg) { boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow; boolean was_mimicking = (U_AP_TYPE != M_AP_NOTHING); @@ -209,7 +207,7 @@ const char *fmt, *arg; } void -change_sex() +change_sex(void) { /* setting u.umonster for caveman/cavewoman or priest/priestess swap unintentionally makes `Upolyd' appear to be true */ @@ -241,7 +239,7 @@ change_sex() } static void -newman() +newman(void) { int tmp, oldlvl; @@ -341,8 +339,7 @@ newman() } void -polyself(forcecontrol) -boolean forcecontrol; +polyself(boolean forcecontrol) { char buf[BUFSZ]; int old_light, new_light; @@ -450,8 +447,8 @@ boolean forcecontrol; /* (try to) make a mntmp monster out of the player */ int -polymon(mntmp) /* returns 1 if polymorph successful */ -int mntmp; +polymon(int mntmp) /* returns 1 if polymorph successful */ + { boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow, was_blind = !!Blind, dochange = FALSE; @@ -747,8 +744,7 @@ int mntmp; /* dropx() jacket for break_armor() */ static void -dropp(obj) -struct obj *obj; +dropp(struct obj *obj) { struct obj *otmp; @@ -773,7 +769,7 @@ struct obj *obj; } static void -break_armor() +break_armor(void) { register struct obj *otmp; @@ -876,8 +872,7 @@ break_armor() } static void -drop_weapon(alone) -int alone; +drop_weapon(int alone) { struct obj *otmp; struct obj *otmp2; @@ -909,7 +904,7 @@ int alone; } void -rehumanize() +rehumanize(void) { boolean was_flying = Flying; @@ -953,7 +948,7 @@ rehumanize() } int -dobreathe() +dobreathe(void) { struct attack *mattk; @@ -989,7 +984,7 @@ dobreathe() } int -dospit() +dospit(void) { struct obj *otmp; @@ -1004,7 +999,7 @@ dospit() } int -doremove() +doremove(void) { if (!Punished) { if (u.utrap && u.utraptype == TT_BURIEDBALL) { @@ -1020,7 +1015,7 @@ doremove() } int -dospinweb() +dospinweb(void) { register struct trap *ttmp = t_at(u.ux, u.uy); @@ -1137,7 +1132,7 @@ dospinweb() } int -dosummon() +dosummon(void) { int placeholder; if (u.uen < 10) { @@ -1155,7 +1150,7 @@ dosummon() } int -dogaze() +dogaze(void) { register struct monst *mtmp; int looked = 0; @@ -1286,7 +1281,7 @@ dogaze() } int -dohide() +dohide(void) { boolean ismimic = youmonst.data->mlet == S_MIMIC; @@ -1305,7 +1300,7 @@ dohide() } int -domindblast() +domindblast(void) { struct monst *mtmp, *nmon; @@ -1349,7 +1344,7 @@ domindblast() } void -uunstick() +uunstick(void) { if (!u.ustuck) { warning("uunstick: no ustuck?"); @@ -1360,8 +1355,7 @@ uunstick() } void -skinback(silently) -boolean silently; +skinback(boolean silently) { if (uskin) { if (!silently) Your("skin returns to its original form."); @@ -1373,9 +1367,7 @@ boolean silently; } const char * -mbodypart(mon, part) -struct monst *mon; -int part; +mbodypart(struct monst *mon, int part) { static NEARDATA const char *humanoid_parts[] = { "arm", "eye", "face", "finger", @@ -1503,14 +1495,13 @@ int part; } const char * -body_part(part) -int part; +body_part(int part) { return mbodypart(&youmonst, part); } int -poly_gender() +poly_gender(void) { /* Returns gender of polymorphed player; 0/1=same meaning as flags.female, * 2=none. @@ -1520,8 +1511,7 @@ poly_gender() } void -ugolemeffects(damtype, dam) -int damtype, dam; +ugolemeffects(int damtype, int dam) { int heal = 0; /* We won't bother with "slow"/"haste" since players do not @@ -1548,8 +1538,7 @@ int damtype, dam; } static int -armor_to_dragon(atyp) -int atyp; +armor_to_dragon(int atyp) { switch(atyp) { case GRAY_DRAGON_SCALE_MAIL: @@ -1597,7 +1586,7 @@ int atyp; /* True iff hero's role or race has been genocided */ boolean -ugenocided() +ugenocided(void) { return ((mvitals[urole.malenum].mvflags & G_GENOD) || (urole.femalenum != NON_PM && (mvitals[urole.femalenum].mvflags & G_GENOD)) || @@ -1607,7 +1596,7 @@ ugenocided() /* how hero feels "inside" after self-genocide of role or race */ const char * -udeadinside() +udeadinside(void) { /* self-genocide used to always say "you feel dead inside" but that seems silly when you're polymorphed into something undead; diff --git a/src/potion.c b/src/potion.c index f70407be2..7aeeef27b 100644 --- a/src/potion.c +++ b/src/potion.c @@ -10,9 +10,9 @@ static NEARDATA const char beverages[] = { POTION_CLASS, 0 }; static long itimeout(long); static long itimeout_incr(long, int); -static void ghost_from_bottle(); -static void alchemy_init(); -static boolean H2Opotion_dip(struct obj *, struct obj *, BOOLEAN_P, const char *); +static void ghost_from_bottle(void); +static void alchemy_init(void); +static boolean H2Opotion_dip(struct obj *, struct obj *, boolean, const char *); #ifndef TESTING static int dip(struct obj *, struct obj *); @@ -20,8 +20,7 @@ static int dip(struct obj *, struct obj *); /* force `val' to be within valid range for intrinsic timeout value */ static long -itimeout(val) -long val; +itimeout(long int val) { if (val >= TIMEOUT) val = TIMEOUT; else if (val < 1) val = 0; @@ -31,17 +30,14 @@ long val; /* increment `old' by `incr' and force result to be valid intrinsic timeout */ static long -itimeout_incr(old, incr) -long old; -int incr; +itimeout_incr(long int old, int incr) { return itimeout((old & TIMEOUT) + (long)incr); } /* set the timeout field of intrinsic `which' */ void -set_itimeout(which, val) -long *which, val; +set_itimeout(long int *which, long int val) { *which &= ~TIMEOUT; *which |= itimeout(val); @@ -49,17 +45,13 @@ long *which, val; /* increment the timeout field of intrinsic `which' */ void -incr_itimeout(which, incr) -long *which; -int incr; +incr_itimeout(long int *which, int incr) { set_itimeout(which, itimeout_incr(*which, incr)); } void -make_confused(xtime, talk) -long xtime; -boolean talk; +make_confused(long int xtime, boolean talk) { long old = HConfusion; @@ -78,9 +70,7 @@ boolean talk; } void -make_stunned(xtime, talk) -long xtime; -boolean talk; +make_stunned(long int xtime, boolean talk) { long old = HStun; @@ -107,11 +97,11 @@ boolean talk; } void -make_sick(xtime, cause, talk, type) -long xtime; -const char *cause; /* sickness cause */ -boolean talk; -int type; +make_sick(long int xtime, const char *cause, boolean talk, int type) + + /* sickness cause */ + + { long old = Sick; @@ -160,11 +150,7 @@ int type; /* start or stop petrification */ void -make_stoned(xtime, msg, killedby, killername) -long xtime; -const char *msg; -int killedby; -const char *killername; +make_stoned(long int xtime, const char *msg, int killedby, const char *killername) { long old = Stoned; @@ -186,9 +172,7 @@ const char *killername; } void -make_vomiting(xtime, talk) -long xtime; -boolean talk; +make_vomiting(long int xtime, boolean talk) { long old = Vomiting; @@ -206,9 +190,7 @@ boolean talk; } void -make_slimed(xtime, msg) -long xtime; -const char *msg; +make_slimed(long int xtime, const char *msg) { long old = Slimed; @@ -239,9 +221,7 @@ static const char vismsg[] = "vision seems to %s for a moment but is %s now."; static const char eyemsg[] = "%s momentarily %s."; void -make_blinded(xtime, talk) -long xtime; -boolean talk; +make_blinded(long int xtime, boolean talk) { long old = Blinded; boolean u_could_see, can_see_now; @@ -319,7 +299,7 @@ boolean talk; /* blindness has just started or just ended--caller enforces that; called by Blindf_on(), Blindf_off(), and make_blinded() */ void -toggle_blindness() +toggle_blindness(void) { boolean Stinging = (uwep && (EWarn_of_mon & W_WEP) != 0L); @@ -353,10 +333,10 @@ toggle_blindness() } boolean -make_hallucinated(xtime, talk, mask) -long xtime; /* nonzero if this is an attempt to turn on hallucination */ -boolean talk; -long mask; /* nonzero if resistance status should change by mask */ +make_hallucinated( + long xtime, /**< nonzero if this is an attempt to turn on hallucination */ + boolean talk, + long mask) /**< nonzero if resistance status should change by mask */ { long old = HHallucination; boolean changed = 0; @@ -422,8 +402,7 @@ long mask; /* nonzero if resistance status should change by mask */ /* set or clear "slippery fingers" */ void -make_glib(xtime) -int xtime; +make_glib(int xtime) { set_itimeout(&Glib, xtime); /* may change "(being worn)" to "(being worn; slippery)" or vice versa */ @@ -433,7 +412,7 @@ int xtime; } static void -ghost_from_bottle() +ghost_from_bottle(void) { struct monst *mtmp = makemon(&mons[PM_GHOST], u.ux, u.uy, NO_MM_FLAGS); @@ -456,7 +435,7 @@ ghost_from_bottle() /* "Quaffing is like drinking, except you spill more." -- Terry Pratchett */ int -dodrink() +dodrink(void) { register struct obj *otmp; const char *potion_descr; @@ -537,8 +516,7 @@ dodrink() } int -dopotion(otmp) -register struct obj *otmp; +dopotion(register struct obj *otmp) { int retval; @@ -563,8 +541,7 @@ register struct obj *otmp; } int -peffects(otmp) -register struct obj *otmp; +peffects(register struct obj *otmp) { register int i, ii, lim; @@ -1191,9 +1168,7 @@ register struct obj *otmp; } void -healup(nhp, nxtra, curesick, cureblind) -int nhp, nxtra; -register boolean curesick, cureblind; +healup(int nhp, int nxtra, register boolean curesick, register boolean cureblind) { if (nhp && !marathon_mode) { if (Upolyd) { @@ -1220,9 +1195,7 @@ register boolean curesick, cureblind; } void -strange_feeling(obj, txt) -register struct obj *obj; -register const char *txt; +strange_feeling(register struct obj *obj, register const char *txt) { if (flags.beginner || !txt) You("have a %s feeling for a moment, then it passes.", @@ -1245,17 +1218,18 @@ const char *bottlenames[] = { const char * -bottlename() +bottlename(void) { return bottlenames[rn2(SIZE(bottlenames))]; } /* handle item dipped into water potion or steed saddle splashed by same */ static boolean -H2Opotion_dip(potion, targobj, useeit, objphrase) -struct obj *potion, *targobj; -boolean useeit; -const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ +H2Opotion_dip( + struct obj *potion, + struct obj *targobj, + boolean useeit, + const char *objphrase) /**< "Your widget glows" or "Steed's saddle glows" */ { void (*func) (OBJ_P) = 0; const char *glowcolor = 0; @@ -1345,10 +1319,7 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ /* potion obj hits monster mon, which might be youmonst; obj always used up */ void -potionhit(mon, obj, how) -struct monst *mon; -struct obj *obj; -int how; +potionhit(struct monst *mon, struct obj *obj, int how) { const char *botlnam = bottlename(); boolean isyou = (mon == &youmonst); @@ -1682,8 +1653,7 @@ int how; /* vapors are inhaled or get in your eyes */ void -potionbreathe(obj) -register struct obj *obj; +potionbreathe(register struct obj *obj) { register int i, ii, kn = 0; boolean cureblind = FALSE; @@ -1898,7 +1868,7 @@ short alchemy_table2[17]; /** Does a one-time set up of alchemical tables. */ static void -alchemy_init() +alchemy_init(void) { static boolean init = FALSE; @@ -2022,8 +1992,7 @@ get_base_mix_color(struct obj *potion) /** Returns the potion type when object o1 is dipped into object o2 */ short -mixtype(o1, o2) -register struct obj *o1, *o2; +mixtype(register struct obj *o1, register struct obj *o2) { /* cut down on the number of cases below */ if (o1->oclass == POTION_CLASS && @@ -2240,8 +2209,8 @@ register struct obj *o1, *o2; boolean -get_wet(obj) -register struct obj *obj; +get_wet(register struct obj *obj) + /* returns TRUE if something happened (potion should be used up) */ { char Your_buf[BUFSZ]; @@ -2347,7 +2316,7 @@ register struct obj *obj; /** User command for dipping objects. */ int -dodip() +dodip(void) { static const char Dip_[] = "Dip "; register struct obj *potion, *obj; @@ -2437,8 +2406,7 @@ dodip() /** Dip an arbitrary object into a potion. */ int -dip(potion, obj) -struct obj *potion, *obj; +dip(struct obj *potion, struct obj *obj) { struct obj *singlepotion; const char *tmp; @@ -2908,8 +2876,7 @@ struct obj *potion, *obj; /* *monp grants a wish and then leaves the game */ void -mongrantswish(monp) -struct monst **monp; +mongrantswish(struct monst **monp) { struct monst *mon = *monp; int mx = mon->mx, my = mon->my, glyph = glyph_at(mx, my); @@ -2929,8 +2896,7 @@ struct monst **monp; void -djinni_from_bottle(obj) -register struct obj *obj; +djinni_from_bottle(register struct obj *obj) { struct monst *mtmp; int chance; @@ -2977,9 +2943,9 @@ register struct obj *obj; /* clone a gremlin or mold (2nd arg non-null implies heat as the trigger); hit points are cut in half (odd HP stays with original) */ struct monst * -split_mon(mon, mtmp) -struct monst *mon, /* monster being split */ - *mtmp; /* optional attacker whose heat triggered it */ +split_mon( + struct monst *mon, /**< monster being split */ + struct monst *mtmp) /**< optional attacker whose heat triggered it */ { struct monst *mtmp2; char reason[BUFSZ]; diff --git a/src/pray.c b/src/pray.c index df3ec5825..277167aa7 100644 --- a/src/pray.c +++ b/src/pray.c @@ -3,20 +3,20 @@ #include "hack.h" -static int prayer_done(); -static struct obj *worst_cursed_item(); +static int prayer_done(void); +static struct obj *worst_cursed_item(void); static void fix_worst_trouble(int); -static void angrygods(ALIGNTYP_P); +static void angrygods(aligntyp); static void at_your_feet(const char *); -static void gcrownu(); -static void pleased(ALIGNTYP_P); -static void godvoice(ALIGNTYP_P, const char*); -static void god_zaps_you(ALIGNTYP_P); -static void fry_by_god(ALIGNTYP_P, BOOLEAN_P); -static void gods_angry(ALIGNTYP_P); -static void gods_upset(ALIGNTYP_P); +static void gcrownu(void); +static void pleased(aligntyp); +static void godvoice(aligntyp, const char*); +static void god_zaps_you(aligntyp); +static void fry_by_god(aligntyp, boolean); +static void gods_angry(aligntyp); +static void gods_upset(aligntyp); static void consume_offering(struct obj *); -static boolean water_prayer(BOOLEAN_P); +static boolean water_prayer(boolean); static boolean blocked_boulder(int, int); /* simplify a few tests */ @@ -115,7 +115,7 @@ static int p_type; /* (-1)-3: (-1)=really naughty, 3=really good */ /* return TRUE if surrounded by impassible rock, regardless of the state of your own location (for example, inside a doorless closet) */ boolean -stuck_in_wall() +stuck_in_wall(void) { int i, j, x, y, count = 0; @@ -141,7 +141,7 @@ stuck_in_wall() } int -in_trouble() +in_trouble(void) { struct obj *otmp; int i, j, count=0; @@ -224,7 +224,7 @@ in_trouble() /* select an item for TROUBLE_CURSED_ITEMS */ static struct obj * -worst_cursed_item() +worst_cursed_item(void) { register struct obj *otmp; @@ -283,8 +283,7 @@ worst_cursed_item() } static void -fix_worst_trouble(trouble) -register int trouble; +fix_worst_trouble(register int trouble) { int i; struct obj *otmp = 0; @@ -552,8 +551,7 @@ register int trouble; * Divine wrath, dungeon walls, and armor follow the same principle. */ static void -god_zaps_you(resp_god) -aligntyp resp_god; +god_zaps_you(aligntyp resp_god) { if (u.uswallow) { pline("Suddenly a bolt of lightning comes down at you from the heavens!"); @@ -627,9 +625,7 @@ aligntyp resp_god; } static void -fry_by_god(resp_god, via_disintegration) -aligntyp resp_god; -boolean via_disintegration; +fry_by_god(aligntyp resp_god, boolean via_disintegration) { You("%s!", !via_disintegration ? "fry to a crisp" : "disintegrate into a pile of dust"); killer.format = KILLED_BY; @@ -638,8 +634,7 @@ boolean via_disintegration; } static void -angrygods(resp_god) -aligntyp resp_god; +angrygods(aligntyp resp_god) { int maxanger; @@ -706,8 +701,7 @@ aligntyp resp_god; /* helper to print "str appears at your feet", or appropriate */ static void -at_your_feet(str) -const char *str; +at_your_feet(const char *str) { if (Blind) str = Something; if (u.uswallow) { @@ -723,7 +717,7 @@ const char *str; } static void -gcrownu() +gcrownu(void) { struct obj *obj; boolean already_exists, in_hand; @@ -924,8 +918,7 @@ gcrownu() } static void -pleased(g_align) -aligntyp g_align; +pleased(aligntyp g_align) { /* don't use p_trouble, worst trouble may get fixed while praying */ int trouble = in_trouble(); /* what's your worst difficulty? */ @@ -1224,8 +1217,7 @@ aligntyp g_align; * returns true if it found any water here. */ static boolean -water_prayer(bless_water) -boolean bless_water; +water_prayer(boolean bless_water) { register struct obj* otmp; register long changed = 0; @@ -1253,9 +1245,7 @@ boolean bless_water; } static void -godvoice(g_align, words) -aligntyp g_align; -const char *words; +godvoice(aligntyp g_align, const char *words) { const char *quot = ""; if(words) @@ -1268,16 +1258,14 @@ const char *words; } static void -gods_angry(g_align) -aligntyp g_align; +gods_angry(aligntyp g_align) { godvoice(g_align, "Thou hast angered me."); } /* The g_align god is upset with you. */ static void -gods_upset(g_align) -aligntyp g_align; +gods_upset(aligntyp g_align) { if(g_align == u.ualign.type) u.ugangr++; else if(u.ugangr) u.ugangr--; @@ -1287,8 +1275,7 @@ aligntyp g_align; static NEARDATA const char sacrifice_types[] = { FOOD_CLASS, AMULET_CLASS, 0 }; static void -consume_offering(otmp) -register struct obj *otmp; +consume_offering(register struct obj *otmp) { if (Hallucination) switch (rn2(3)) { @@ -1312,7 +1299,7 @@ register struct obj *otmp; } int -dosacrifice() +dosacrifice(void) { register struct obj *otmp; int value = 0; @@ -1810,8 +1797,7 @@ msg_luck_change(int change) /* determine prayer results in advance; also used for enlightenment */ boolean -can_pray(praying) -boolean praying; /* false means no messages should be given */ +can_pray(boolean praying) /**< FALSE means no messages should be given */ { int alignment; @@ -1858,7 +1844,7 @@ boolean praying; /* false means no messages should be given */ } int -dopray() +dopray(void) { /* Confirm accidental slips of Alt-P */ if (flags.prayconfirm) @@ -1910,7 +1896,7 @@ dopray() } static int -prayer_done() /* M. Stephenson (1.0.3b) */ +prayer_done(void) /* M. Stephenson (1.0.3b) */ { aligntyp alignment = p_aligntyp; @@ -1971,7 +1957,7 @@ prayer_done() /* M. Stephenson (1.0.3b) */ /* #turn command */ int -doturn() +doturn(void) { /* Knights & Priest(esse)s only please */ struct monst *mtmp, *mtmp2; @@ -2101,8 +2087,7 @@ doturn() } int -altarmask_at(x, y) -int x, y; +altarmask_at(int x, int y) { int res = 0; @@ -2120,15 +2105,14 @@ int x, y; } const char * -a_gname() +a_gname(void) { return(a_gname_at(u.ux, u.uy)); } /* returns the name of an altar's deity */ const char * -a_gname_at(x, y) -xchar x, y; +a_gname_at(xchar x, xchar y) { if(!IS_ALTAR(levl[x][y].typ)) return((char *)0); @@ -2137,14 +2121,13 @@ xchar x, y; /* returns the name of the hero's deity */ const char * -u_gname() +u_gname(void) { return align_gname(u.ualign.type); } const char * -align_gname(alignment) -aligntyp alignment; +align_gname(aligntyp alignment) { const char *gnam; @@ -2178,8 +2161,7 @@ static const char *hallu_gods[] = { /* hallucination handling for priest/minion names: select a random god iff character is hallucinating */ const char * -halu_gname(alignment) -aligntyp alignment; +halu_gname(aligntyp alignment) { const char *gnam = NULL; int which; @@ -2219,8 +2201,7 @@ aligntyp alignment; /* select a random god based on role if provided */ const char * -rnd_gname(role) -int role; +rnd_gname(int role) { const char *gnam; int which; @@ -2240,8 +2221,7 @@ int role; /* deity's title */ const char * -align_gtitle(alignment) -aligntyp alignment; +align_gtitle(aligntyp alignment) { const char *gnam, *result = "god"; @@ -2256,8 +2236,7 @@ aligntyp alignment; } void -altar_wrath(x, y) -register int x, y; +altar_wrath(register int x, register int y) { aligntyp altaralign = a_align(x, y); @@ -2279,8 +2258,7 @@ register int x, y; /* assumes isok() at one space away, but not necessarily at two */ static boolean -blocked_boulder(dx, dy) -int dx, dy; +blocked_boulder(int dx, int dy) { register struct obj *otmp; long count = 0L; @@ -2332,8 +2310,7 @@ int dx, dy; #ifdef ASTRAL_ESCAPE int -invoke_amulet(otmp) -struct obj *otmp; +invoke_amulet(struct obj *otmp) { aligntyp altaralign = a_align(u.ux, u.uy); diff --git a/src/priest.c b/src/priest.c index 683cfa5e5..cf2c69b40 100644 --- a/src/priest.c +++ b/src/priest.c @@ -8,12 +8,11 @@ #define ALGN_SINNED (-4) /* worse than strayed */ #define ALGN_PIOUS 14 /* better than fervent (9..13) */ -static boolean histemple_at(struct monst *, XCHAR_P, XCHAR_P); +static boolean histemple_at(struct monst *, xchar, xchar); static boolean has_shrine(struct monst *); void -newepri(mtmp) -struct monst *mtmp; +newepri(struct monst *mtmp) { if (!mtmp->mextra) mtmp->mextra = newmextra(); @@ -24,8 +23,7 @@ struct monst *mtmp; } void -free_epri(mtmp) -struct monst *mtmp; +free_epri(struct monst *mtmp) { if (mtmp->mextra && EPRI(mtmp)) { free((genericptr_t) EPRI(mtmp)); @@ -39,12 +37,7 @@ struct monst *mtmp; * Valid returns are 1: moved 0: didn't -1: let m_move do it -2: died. */ int -move_special(mtmp, in_his_shop, appr, uondoor, avoid, omx, omy, gx, gy) -register struct monst *mtmp; -boolean in_his_shop; -schar appr; -boolean uondoor, avoid; -register xchar omx, omy, gx, gy; +move_special(register struct monst *mtmp, boolean in_his_shop, schar appr, boolean uondoor, boolean avoid, register xchar omx, register xchar omy, register xchar gx, register xchar gy) { register xchar nx, ny, nix, niy; register schar i; @@ -148,8 +141,7 @@ register xchar omx, omy, gx, gy; } char -temple_occupied(array) -register char *array; +temple_occupied(register char *array) { register char *ptr; @@ -160,9 +152,7 @@ register char *array; } static boolean -histemple_at(priest, x, y) -register struct monst *priest; -register xchar x, y; +histemple_at(register struct monst *priest, register xchar x, register xchar y) { return (boolean) (priest && priest->ispriest && (EPRI(priest)->shroom == *in_rooms(x, y, TEMPLE)) && @@ -170,8 +160,7 @@ register xchar x, y; } boolean -inhistemple(priest) -struct monst *priest; +inhistemple(struct monst *priest) { /* make sure we have a priest */ if (!priest || !priest->ispriest) { @@ -189,8 +178,7 @@ struct monst *priest; * pri_move: return 1: moved 0: didn't -1: let m_move do it -2: died */ int -pri_move(priest) -register struct monst *priest; +pri_move(register struct monst *priest) { register xchar gx, gy, omx, omy; schar temple; @@ -232,11 +220,11 @@ register struct monst *priest; /* exclusively for mktemple() */ void -priestini(lvl, sroom, sx, sy, sanctum) -d_level *lvl; -struct mkroom *sroom; -int sx, sy; -boolean sanctum; /* is it the seat of the high priest? */ +priestini( + d_level *lvl, + struct mkroom *sroom, + int sx, int sy, + boolean sanctum) /**< is it the seat of the high priest? */ { struct monst *priest; struct obj *otmp = NULL; @@ -280,8 +268,7 @@ boolean sanctum; /* is it the seat of the high priest? */ /* get a monster's alignment type without caller needing EPRI & EMIN */ aligntyp -mon_aligntyp(mon) -struct monst *mon; +mon_aligntyp(struct monst *mon) { aligntyp algn = mon->ispriest ? EPRI(mon)->shralign : mon->isminion ? EMIN(mon)->min_align : @@ -306,9 +293,9 @@ struct monst *mon; * the true name even when under that influence */ char * -priestname(mon, pname) -register struct monst *mon; -char *pname; /* caller-supplied output buffer */ +priestname( + struct monst *mon, + char *pname) /**< caller-supplied output buffer */ { boolean do_hallu = Hallucination; boolean aligned_priest = mon->data == &mons[PM_ALIGNED_PRIEST]; @@ -369,15 +356,13 @@ char *pname; /* caller-supplied output buffer */ } boolean -p_coaligned(priest) -struct monst *priest; +p_coaligned(struct monst *priest) { return (boolean) (u.ualign.type == mon_aligntyp(priest)); } static boolean -has_shrine(pri) -struct monst *pri; +has_shrine(struct monst *pri) { struct rm *lev; struct epri *epri_p; @@ -393,8 +378,7 @@ struct monst *pri; } struct monst * -findpriest(roomno) -char roomno; +findpriest(char roomno) { register struct monst *mtmp; @@ -409,8 +393,7 @@ char roomno; /* called from check_special_room() when the player enters the temple room */ void -intemple(roomno) -register int roomno; +intemple(register int roomno) { struct epri *epri_p; boolean shrined, sanctum, can_speak; @@ -544,8 +527,7 @@ register int roomno; /* reset the move counters used to limit temple entry feedback; leaving the level and then returning yields a fresh start */ void -forget_temple_entry(priest) -struct monst *priest; +forget_temple_entry(struct monst *priest) { struct epri *epri_p = priest->ispriest ? EPRI(priest) : 0; @@ -560,8 +542,7 @@ struct monst *priest; } void -priest_talk(priest) -register struct monst *priest; +priest_talk(register struct monst *priest) { boolean coaligned = p_coaligned(priest); boolean strayed = (u.ualign.record < 0); @@ -673,11 +654,7 @@ register struct monst *priest; } struct monst * -mk_roamer(ptr, alignment, x, y, peaceful) -register struct permonst *ptr; -aligntyp alignment; -xchar x, y; -boolean peaceful; +mk_roamer(register struct permonst *ptr, aligntyp alignment, xchar x, xchar y, boolean peaceful) { register struct monst *roamer; register boolean coaligned = (u.ualign.type == alignment); @@ -702,8 +679,7 @@ boolean peaceful; } void -reset_hostility(roamer) -register struct monst *roamer; +reset_hostility(register struct monst *roamer) { if (!roamer->isminion) { return; @@ -721,9 +697,9 @@ register struct monst *roamer; } boolean -in_your_sanctuary(mon, x, y) -struct monst *mon; /* if non-null, overrides */ -xchar x, y; +in_your_sanctuary(struct monst *mon, xchar x, xchar y) + /* if non-null, overrides */ + { register char roomno; register struct monst *priest; @@ -746,8 +722,7 @@ xchar x, y; /* when attacking "priest" in his temple */ void -ghod_hitsu(priest) -struct monst *priest; +ghod_hitsu(struct monst *priest) { int x, y, ax, ay, roomno = (int)temple_occupied(u.urooms); struct mkroom *troom; @@ -808,7 +783,7 @@ struct monst *priest; } void -angry_priest() +angry_priest(void) { register struct monst *priest; struct rm *lev; @@ -849,7 +824,7 @@ angry_priest() * [Perhaps we should convert them into roamers instead?] */ void -clearpriests() +clearpriests(void) { struct monst *mtmp; @@ -865,9 +840,7 @@ clearpriests() /* munge priest-specific structure when restoring -dlc */ void -restpriest(mtmp, ghostly) -register struct monst *mtmp; -boolean ghostly; +restpriest(register struct monst *mtmp, boolean ghostly) { if (u.uz.dlevel) { if (ghostly) @@ -877,9 +850,7 @@ boolean ghostly; /* used for self-probing */ char * -piousness(showneg, suffix) -boolean showneg; -const char *suffix; +piousness(boolean showneg, const char *suffix) { static char buf[32]; /* bigger than "insufficiently neutral" */ const char *pio; diff --git a/src/quest.c b/src/quest.c index 2cc1bf344..803cdec38 100644 --- a/src/quest.c +++ b/src/quest.c @@ -12,20 +12,20 @@ #define Not_firsttime (on_level(&u.uz0, &u.uz)) #define Qstat(x) (quest_status.x) -static void on_start(); -static void on_locate(); -static void on_goal(); -static boolean not_capable(); -static int is_pure(BOOLEAN_P); -static void expulsion(BOOLEAN_P); -static void chat_with_leader(); -static void chat_with_nemesis(); -static void chat_with_guardian(); +static void on_start(void); +static void on_locate(void); +static void on_goal(void); +static boolean not_capable(void); +static int is_pure(boolean); +static void expulsion(boolean); +static void chat_with_leader(void); +static void chat_with_nemesis(void); +static void chat_with_guardian(void); static void prisoner_speaks(struct monst *); static void -on_start() +on_start(void) { if(!Qstat(first_start)) { qt_pager(QT_FIRSTTIME); @@ -37,7 +37,7 @@ on_start() } static void -on_locate() +on_locate(void) { if(!Qstat(first_locate)) { qt_pager(QT_FIRSTLOCATE); @@ -47,7 +47,7 @@ on_locate() } static void -on_goal() +on_goal(void) { if (Qstat(killed_nemesis)) { return; @@ -61,7 +61,7 @@ on_goal() } void -onquest() +onquest(void) { if(u.uevent.qcompleted || Not_firsttime) return; if(!Is_special(&u.uz)) return; @@ -73,7 +73,7 @@ onquest() } void -nemdead() +nemdead(void) { if(!Qstat(killed_nemesis)) { Qstat(killed_nemesis) = TRUE; @@ -82,7 +82,7 @@ nemdead() } void -artitouch() +artitouch(void) { if(!Qstat(touched_artifact)) { Qstat(touched_artifact) = TRUE; @@ -93,7 +93,7 @@ artitouch() /* external hook for do.c (level change check) */ boolean -ok_to_quest() +ok_to_quest(void) { if (((Qstat(got_quest) || Qstat(got_thanks)) && is_pure(FALSE) > 0) || quest_status.leader_is_dead) { @@ -103,7 +103,7 @@ ok_to_quest() } static boolean -not_capable() +not_capable(void) { return((boolean)(u.ulevel < MIN_QUEST_LEVEL)); } @@ -115,8 +115,7 @@ not_capable() * 1 if he is worthy */ static int -is_pure(talk) -boolean talk; +is_pure(boolean talk) { int purity; aligntyp original_alignment = u.ualignbase[A_ORIGINAL]; @@ -151,8 +150,7 @@ boolean talk; * there is a single branch to and from it. */ static void -expulsion(seal) -boolean seal; +expulsion(boolean seal) { branch *br; d_level *dest; @@ -185,8 +183,7 @@ boolean seal; give another message about the character keeping the artifact and using the magic portal to return to the dungeon. */ void -finish_quest(obj) -struct obj *obj; /* quest artifact; possibly null if carrying Amulet */ +finish_quest(struct obj *obj) /**< quest artifact; possibly NULL if carrying Amulet */ { struct obj *otmp; @@ -214,7 +211,7 @@ struct obj *obj; /* quest artifact; possibly null if carrying Amulet */ } static void -chat_with_leader() +chat_with_leader(void) { /* Rule 0: Cheater checks. */ if(u.uhave.questart && !Qstat(met_nemesis)) @@ -285,8 +282,7 @@ chat_with_leader() } void -leader_speaks(mtmp) -register struct monst *mtmp; +leader_speaks(register struct monst *mtmp) { /* maybe you attacked leader? */ if(!mtmp->mpeaceful) { @@ -313,7 +309,7 @@ register struct monst *mtmp; } static void -chat_with_nemesis() +chat_with_nemesis(void) { /* The nemesis will do most of the talking, but... */ qt_pager(rn1(10, QT_DISCOURAGE)); @@ -321,7 +317,7 @@ chat_with_nemesis() } void -nemesis_speaks() +nemesis_speaks(void) { if(!Qstat(in_battle)) { if(u.uhave.questart) qt_pager(QT_NEMWANTSIT); @@ -337,7 +333,7 @@ nemesis_speaks() } static void -chat_with_guardian() +chat_with_guardian(void) { /* These guys/gals really don't have much to say... */ if (u.uhave.questart && Qstat(killed_nemesis)) @@ -347,8 +343,7 @@ chat_with_guardian() } static void -prisoner_speaks (mtmp) -register struct monst *mtmp; +prisoner_speaks (register struct monst *mtmp) { if (mtmp->data == &mons[PM_PRISONER] && (mtmp->mstrategy & STRAT_WAITMASK)) { @@ -369,8 +364,7 @@ register struct monst *mtmp; } void -quest_chat(mtmp) -register struct monst *mtmp; +quest_chat(register struct monst *mtmp) { if (mtmp->m_id == Qstat(leader_m_id)) { chat_with_leader(); @@ -385,8 +379,7 @@ register struct monst *mtmp; } void -quest_talk(mtmp) -register struct monst *mtmp; +quest_talk(register struct monst *mtmp) { if (mtmp->m_id == Qstat(leader_m_id)) { leader_speaks(mtmp); @@ -400,8 +393,7 @@ register struct monst *mtmp; } void -quest_stat_check(mtmp) -struct monst *mtmp; +quest_stat_check(struct monst *mtmp) { if(mtmp->data->msound == MS_NEMESIS) Qstat(in_battle) = (mtmp->mcanmove && !mtmp->msleeping && diff --git a/src/questpgr.c b/src/questpgr.c index 8dfdc43c9..d89192f38 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -19,14 +19,14 @@ extern char *lev_message; static void Fread(genericptr_t, int, int, dlb *); static struct qtmsg * construct_qtlist(long); -static const char * intermed(); -static const char * creatorname(); -static const char * neminame(); -static const char * guardname(); -static const char * homebase(); -static void qtext_pronoun(CHAR_P, CHAR_P); +static const char * intermed(void); +static const char * creatorname(void); +static const char * neminame(void); +static const char * guardname(void); +static const char * homebase(void); +static void qtext_pronoun(char, char); static struct qtmsg * msg_in(struct qtmsg *, int); -static void convert_arg(CHAR_P); +static void convert_arg(char); static void convert_line(char *,char *); static void deliver_by_pline(struct qtmsg *); static void deliver_by_window(struct qtmsg *, int); @@ -40,8 +40,9 @@ static char nambuf[sizeof cvt_buf]; #ifdef DEBUG static void dump_qtlist(); +/** dump the character msg list to check appearance */ static void -dump_qtlist() /* dump the character msg list to check appearance */ +dump_qtlist() { struct qtmsg *msg; long size; @@ -57,10 +58,7 @@ dump_qtlist() /* dump the character msg list to check appearance */ #endif /* DEBUG */ static void -Fread(ptr, size, nitems, stream) -genericptr_t ptr; -int size, nitems; -dlb *stream; +Fread(genericptr_t ptr, int size, int nitems, dlb *stream) { int cnt; @@ -72,8 +70,7 @@ dlb *stream; } static struct qtmsg * -construct_qtlist(hdr_offset) -long hdr_offset; +construct_qtlist(long int hdr_offset) { struct qtmsg *msg_list; int n_msgs; @@ -93,7 +90,7 @@ long hdr_offset; } void -load_qtlist() +load_qtlist(void) { int n_classes, i; @@ -141,7 +138,7 @@ load_qtlist() /* called at program exit */ void -unload_qtlist() +unload_qtlist(void) { if (msg_file) (void) dlb_fclose(msg_file), msg_file = 0; @@ -153,8 +150,7 @@ unload_qtlist() } short -quest_info(typ) -int typ; +quest_info(int typ) { switch (typ) { case 0: return (urole.questarti); @@ -166,8 +162,9 @@ int typ; return 0; } +/** return your role leader's name */ const char * -ldrname() /* return your role leader's name */ +ldrname(void) { int i = urole.ldrnum; @@ -177,21 +174,22 @@ ldrname() /* return your role leader's name */ return nambuf; } +/** return your intermediate target string */ static const char * -intermed() /* return your intermediate target string */ +intermed(void) { return (urole.intermed); } boolean -is_quest_artifact(otmp) -struct obj *otmp; +is_quest_artifact(struct obj *otmp) { return((boolean)(otmp->oartifact == urole.questarti)); } +/** return your role nemesis' name */ static const char * -neminame() /* return your role nemesis' name */ +neminame(void) { int i = urole.neminum; @@ -201,16 +199,18 @@ neminame() /* return your role nemesis' name */ return nambuf; } +/** return your role leader's guard monster name */ static const char * -guardname() /* return your role leader's guard monster name */ +guardname(void) { int i = urole.guardnum; return(mons[i].mname); } +/** return your role leader's location */ static const char * -homebase() /* return your role leader's location */ +homebase(void) { return(urole.homebase); } @@ -218,9 +218,9 @@ homebase() /* return your role leader's location */ /* replace deity, leader, nemesis, or artifact name with pronoun; overwrites cvt_buf[] */ static void -qtext_pronoun(who, which) -char who; /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => artifact */ -char which; /* 'h'|'H'|'i'|'I'|'j'|'J' */ +qtext_pronoun(char who, char which) + /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => artifact */ + /* 'h'|'H'|'i'|'I'|'j'|'J' */ { const char *pnoun; int g; @@ -255,9 +255,7 @@ char which; /* 'h'|'H'|'i'|'I'|'j'|'J' */ } static struct qtmsg * -msg_in(qtm_list, msgnum) -struct qtmsg *qtm_list; -int msgnum; +msg_in(struct qtmsg *qtm_list, int msgnum) { struct qtmsg *qt_msg; @@ -268,8 +266,7 @@ int msgnum; } static void -convert_arg(c) -char c; +convert_arg(char c) { register const char *str; @@ -343,8 +340,7 @@ char c; } static void -convert_line(in_line, out_line) -char *in_line, *out_line; +convert_line(char *in_line, char *out_line) { char *c, *cc; char xbuf[BUFSZ]; @@ -430,8 +426,7 @@ char *in_line, *out_line; } char * -string_subst(str) -char *str; +string_subst(char *str) { xcrypt(str, in_line); convert_line(in_line, out_line); @@ -440,8 +435,7 @@ char *str; static void -deliver_by_pline(qt_msg) -struct qtmsg *qt_msg; +deliver_by_pline(struct qtmsg *qt_msg) { long size; char xbuf[BUFSZ]; @@ -455,9 +449,7 @@ struct qtmsg *qt_msg; } static void -deliver_by_window(qt_msg, how) -struct qtmsg *qt_msg; -int how; +deliver_by_window(struct qtmsg *qt_msg, int how) { long size; char in_line[BUFSZ], out_line[BUFSZ]; @@ -487,9 +479,7 @@ int how; } void -qt_com_firstline(msgnum, msgbuf) -int msgnum; -char *msgbuf; +qt_com_firstline(int msgnum, char *msgbuf) { struct qtmsg *qt_msg; char xbuf[BUFSZ]; @@ -507,8 +497,7 @@ char *msgbuf; } void -com_pager(msgnum) -int msgnum; +com_pager(int msgnum) { struct qtmsg *qt_msg; @@ -525,8 +514,7 @@ int msgnum; } void -qt_pager(msgnum) -int msgnum; +qt_pager(int msgnum) { struct qtmsg *qt_msg; @@ -543,7 +531,7 @@ int msgnum; } /** special levels can include a custom arrival message; display it */ void -deliver_splev_message() +deliver_splev_message(void) { char *str, *nl, in_line[BUFSZ], out_line[BUFSZ]; @@ -596,7 +584,7 @@ static const char *creator_names[] = { /** Return the name of the creator deity. * The name stays the same for the running game. */ static const char * -creatorname() +creatorname(void) { if (pirateday()) { return "the FSM"; diff --git a/src/read.c b/src/read.c index 9197a7740..a058ef28a 100644 --- a/src/read.c +++ b/src/read.c @@ -56,8 +56,7 @@ learn_scroll_typ(short scrolltyp, boolean verbose) /* also called from teleport.c for scroll of teleportation */ void -learn_scroll(sobj) -struct obj *sobj; +learn_scroll(struct obj *sobj) { /* it's implied that sobj->dknown is set; we couldn't be reading this scroll otherwise */ @@ -67,9 +66,7 @@ struct obj *sobj; } static char * -erode_obj_text(otmp, buf) -struct obj *otmp; -char *buf; +erode_obj_text(struct obj *otmp, char *buf) { int erosion = greatest_erosion(otmp); @@ -82,9 +79,7 @@ char *buf; } char * -tshirt_text(tshirt, buf) -struct obj *tshirt; -char *buf; +tshirt_text(struct obj *tshirt, char *buf) { static const char *shirt_msgs[] = { /* Scott Bigham */ @@ -264,7 +259,7 @@ apron_text(struct obj* apron, char* buf) } int -doread() +doread(void) { register struct obj *scroll; register boolean confused; @@ -559,8 +554,7 @@ doread() } static void -stripspe(obj) -register struct obj *obj; +stripspe(register struct obj *obj) { if (obj->blessed || obj->spe <= 0) { pline("%s", nothing_happens); @@ -576,17 +570,14 @@ register struct obj *obj; } static void -p_glow1(otmp) -register struct obj *otmp; +p_glow1(register struct obj *otmp) { Your("%s %s briefly.", xname(otmp), otense(otmp, Blind ? "vibrate" : "glow")); } static void -p_glow2(otmp, color) -register struct obj *otmp; -register const char *color; +p_glow2(register struct obj *otmp, register const char *color) { Your("%s %s%s%s for a moment.", xname(otmp), @@ -598,8 +589,7 @@ register const char *color; /* Is the object chargeable? For purposes of inventory display; it is */ /* possible to be able to charge things for which this returns FALSE. */ boolean -is_chargeable(obj) -struct obj *obj; +is_chargeable(struct obj *obj) { if (obj->oclass == WAND_CLASS) return TRUE; /* known && !oc_name_known is possible after amnesia/mind flayer */ @@ -629,9 +619,7 @@ struct obj *obj; * was cursed, +1 if blessed, 0 otherwise. */ void -recharge(obj, curse_bless) -struct obj *obj; -int curse_bless; +recharge(struct obj *obj, int curse_bless) { register int n; boolean is_cursed, is_blessed; @@ -907,8 +895,7 @@ int curse_bless; /* Forget known information about this object class. */ static void -forget_single_object(obj_id) -int obj_id; +forget_single_object(int obj_id) { objects[obj_id].oc_name_known = 0; objects[obj_id].oc_pre_discovered = 0; /* a discovery when relearned */ @@ -946,9 +933,7 @@ int oclass; /* randomize the given list of numbers 0 <= i < count */ static void -randomize(indices, count) -int *indices; -int count; +randomize(int *indices, int count) { int i, iswap, temp; @@ -963,8 +948,7 @@ int count; /* Forget % of known objects. */ void -forget_objects(percent) -int percent; +forget_objects(int percent) { int i, count; int indices[NUM_OBJECTS]; @@ -994,8 +978,7 @@ int percent; /* Forget some or all of map (depends on parameters). */ void -forget_map(howmuch) -int howmuch; +forget_map(int howmuch) { register int zx, zy; @@ -1019,7 +1002,7 @@ int howmuch; /* Forget all traps on the level. */ void -forget_traps() +forget_traps(void) { register struct trap *trap; @@ -1034,8 +1017,7 @@ forget_traps() * except this one. */ void -forget_levels(percent) -int percent; +forget_levels(int percent) { int i, count; xchar maxl, this_lev; @@ -1128,9 +1110,7 @@ int howmuch; /* monster is hit by scroll of taming's effect */ static int -maybe_tame(mtmp, sobj) -struct monst *mtmp; -struct obj *sobj; +maybe_tame(struct monst *mtmp, struct obj *sobj) { int was_tame = mtmp->mtame; unsigned was_peaceful = mtmp->mpeaceful; @@ -1154,9 +1134,7 @@ struct obj *sobj; /** Remove water tile at x,y. */ static void -undo_flood(x, y, roomcnt) -int x, y; -genericptr_t roomcnt; +undo_flood(int x, int y, genericptr_t roomcnt) { if ((levl[x][y].typ != POOL) && (levl[x][y].typ != MOAT) && @@ -1172,9 +1150,7 @@ genericptr_t roomcnt; } static void -do_flood(x, y, poolcnt) -int x, y; -genericptr_t poolcnt; +do_flood(int x, int y, genericptr_t poolcnt) { register struct monst *mtmp; register struct trap *ttmp; @@ -1206,8 +1182,7 @@ genericptr_t poolcnt; } static boolean -get_valid_stinking_cloud_pos(x,y) -int x,y; +get_valid_stinking_cloud_pos(int x, int y) { return (!(!isok(x,y) || !cansee(x, y) || @@ -1216,9 +1191,7 @@ int x,y; } static boolean -is_valid_stinking_cloud_pos(x, y, showmsg) -int x, y; -boolean showmsg; +is_valid_stinking_cloud_pos(int x, int y, boolean showmsg) { if (!get_valid_stinking_cloud_pos(x,y)) { if (showmsg) { @@ -1230,8 +1203,7 @@ boolean showmsg; } static void -display_stinking_cloud_positions(state) -int state; +display_stinking_cloud_positions(int state) { if (state == 0) { tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos)); @@ -1256,8 +1228,7 @@ int state; /* scroll effects; return 1 if we use up the scroll and possibly make it become discovered, 0 if caller should take care of those side-effects */ int -seffects(sobj) -struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ +seffects(struct obj *sobj) /**< scroll, or fake spellbook object for scroll-like spell */ { int cval, otyp = sobj->otyp; boolean confused = (Confusion != 0); @@ -2156,8 +2127,7 @@ case SPE_MAGIC_MAPPING: } static void -wand_explode(obj) -register struct obj *obj; +wand_explode(register struct obj *obj) { obj->in_use = TRUE; /* in case losehp() is fatal */ Your("%s vibrates violently, and explodes!", xname(obj)); @@ -2179,9 +2149,7 @@ static struct litmon *gremlins = 0; * Low-level lit-field update routine. */ static void -set_lit(x, y, val) -int x, y; -genericptr_t val; +set_lit(int x, int y, genericptr_t val) { struct monst *mtmp; struct litmon *gremlin; @@ -2201,9 +2169,7 @@ genericptr_t val; } void -litroom(on, obj) -register boolean on; -struct obj *obj; +litroom(register boolean on, struct obj *obj) { char is_lit; /* value is irrelevant; we use its address as a `not null' flag for set_lit() */ @@ -2470,10 +2436,11 @@ do_class_genocide() #define PLAYER 2 #define ONTHRONE 4 void -do_genocide(how, only_on_level) -int how; -boolean only_on_level; /**< if TRUE only genocide monsters on current level, - not in the complete dungeon */ +do_genocide( + int how, + boolean only_on_level /**< if TRUE only genocide monsters on current level, + not in the complete dungeon */ +) /* 0 = no genocide; create monsters (cursed scroll) */ /* 1 = normal genocide */ /* 3 = forced genocide of player */ @@ -2670,8 +2637,7 @@ boolean only_on_level; /**< if TRUE only genocide monsters on current level, } void -punish(sobj) -register struct obj *sobj; +punish(register struct obj *sobj) { struct obj *otmp; struct obj *reuse_ball = (sobj && sobj->otyp == HEAVY_IRON_BALL) ? sobj : (struct obj *) 0; @@ -2721,7 +2687,7 @@ register struct obj *sobj; /* remove the ball and chain */ void -unpunish() +unpunish(void) { struct obj *savechain = uchain; @@ -2740,10 +2706,7 @@ unpunish() * one, the disoriented creature becomes a zombie */ boolean -cant_revive(mtype, revival, from_obj) -int *mtype; -boolean revival; -struct obj *from_obj; +cant_revive(int *mtype, boolean revival, struct obj *from_obj) { /* SHOPKEEPERS can be revived now */ if ((*mtype == PM_GUARD) || @@ -2778,9 +2741,7 @@ struct _create_particular_data { }; static boolean -create_particular_parse(str, d) -char *str; -struct _create_particular_data *d; +create_particular_parse(char *str, struct _create_particular_data *d) { char *bufp = str; char *tmpp; @@ -2881,9 +2842,7 @@ struct _create_particular_data *d; } static boolean -create_particular_creation(str, d) -char *str; -struct _create_particular_data *d; +create_particular_creation(char *str, struct _create_particular_data *d) { struct permonst *whichpm = NULL; int i, mx, my, firstchoice = NON_PM; @@ -2990,7 +2949,7 @@ struct _create_particular_data *d; * this code was also used for the scroll/spell in explore mode. */ boolean -create_particular() +create_particular(void) { char buf[BUFSZ] = DUMMY, *bufp; int tryct = 5; @@ -3034,11 +2993,11 @@ create_particular_from_buffer(const char* bufp) #endif /* WIZARD */ void -drop_boulder_on_player(confused, helmet_protects, by_player, drop_directly_to_floor) -boolean confused; -boolean helmet_protects; /**< if player is protected by a hard helmet */ -boolean by_player; /**< is boulder creation caused by player */ -boolean drop_directly_to_floor; /**< don't check if player is swallowed by a monster */ +drop_boulder_on_player( + boolean confused, + boolean helmet_protects, /**< if player is protected by a hard helmet */ + boolean by_player, /**< is boulder creation caused by player */ + boolean drop_directly_to_floor) /**< don't check if player is swallowed by a monster */ { int dmg; struct obj *otmp2; @@ -3088,10 +3047,11 @@ boolean drop_directly_to_floor; /**< don't check if player is swallowed by a mon } int -drop_boulder_on_monster(x, y, confused, by_player) -int x, y; -boolean confused; -boolean by_player; /**< is boulder creation caused by player */ +drop_boulder_on_monster( + int x, + int y, + boolean confused, + boolean by_player) /**< is boulder creation caused by player */ { register struct obj *otmp2; register struct monst *mtmp2; diff --git a/src/rect.c b/src/rect.c index b0593374f..1165de041 100644 --- a/src/rect.c +++ b/src/rect.c @@ -25,7 +25,7 @@ static int rect_cnt; */ void -init_rect() +init_rect(void) { rect_cnt = 1; rect[0].lx = rect[0].ly = 0; @@ -39,8 +39,7 @@ init_rect() */ int -get_rect_ind(r) -NhRect *r; +get_rect_ind(NhRect *r) { register NhRect *rectp; register int lx, ly, hx, hy; @@ -60,8 +59,7 @@ NhRect *r; */ NhRect * -get_rect(r) -NhRect *r; +get_rect(NhRect *r) { register NhRect *rectp; register int lx, ly, hx, hy; @@ -81,7 +79,7 @@ NhRect *r; */ NhRect * -rnd_rect() +rnd_rect(void) { return rect_cnt > 0 ? &rect[rn2(rect_cnt)] : 0; } @@ -93,8 +91,7 @@ rnd_rect() */ static boolean -intersect(r1, r2, r3) -NhRect *r1, *r2, *r3; +intersect(NhRect *r1, NhRect *r2, NhRect *r3) { if (r2->lx > r1->hx || r2->ly > r1->hy || r2->hx < r1->lx || r2->hy < r1->ly) @@ -115,8 +112,7 @@ NhRect *r1, *r2, *r3; */ void -remove_rect(r) -NhRect *r; +remove_rect(NhRect *r) { int ind; @@ -130,8 +126,7 @@ NhRect *r; */ void -add_rect(r) -NhRect *r; +add_rect(NhRect *r) { if (rect_cnt >= MAXRECT) { #ifdef WIZARD @@ -154,8 +149,7 @@ NhRect *r; */ void -split_rects(r1, r2) -NhRect *r1, *r2; +split_rects(NhRect *r1, NhRect *r2) { NhRect r, old_r; int i; diff --git a/src/region.c b/src/region.c index 91868450c..756373cfe 100644 --- a/src/region.c +++ b/src/region.c @@ -38,9 +38,9 @@ void remove_region(NhRegion *); #if 0 void replace_mon_regions(struct monst *, struct monst *); void remove_mon_from_regions(struct monst *); -NhRegion *create_msg_region(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, const char *, const char *); +NhRegion *create_msg_region(xchar, xchar, xchar, xchar, const char *, const char *); boolean enter_force_field(genericptr, genericptr); -NhRegion *create_force_field(XCHAR_P, XCHAR_P, int, int); +NhRegion *create_force_field(xchar, xchar, int, int); #endif static void reset_region_mids(NhRegion *); @@ -56,9 +56,7 @@ static callback_proc callbacks[] = { /* Should be inlined. */ boolean -inside_rect(r, x, y) -NhRect *r; -int x, y; +inside_rect(NhRect *r, int x, int y) { return (x >= r->lx && x <= r->hx && y >= r->ly && y <= r->hy); } @@ -67,9 +65,7 @@ int x, y; * Check if a point is inside a region. */ boolean -inside_region(reg, x, y) -NhRegion *reg; -int x, y; +inside_region(NhRegion *reg, int x, int y) { int i; @@ -85,9 +81,7 @@ int x, y; * Create a region. It does not activate it. */ NhRegion * -create_region(rects, nrect) -NhRect *rects; -int nrect; +create_region(NhRect *rects, int nrect) { int i; NhRegion *reg; @@ -141,9 +135,7 @@ int nrect; * Add rectangle to region. */ void -add_rect_to_reg(reg, rect) -NhRegion *reg; -NhRect *rect; +add_rect_to_reg(NhRegion *reg, NhRect *rect) { NhRect *tmp_rect; @@ -171,9 +163,7 @@ NhRect *rect; * Add a monster to the region */ void -add_mon_to_reg(reg, mon) -NhRegion *reg; -struct monst *mon; +add_mon_to_reg(NhRegion *reg, struct monst *mon) { int i; unsigned *tmp_m; @@ -196,9 +186,7 @@ struct monst *mon; * Remove a monster from the region list (it left or died...) */ void -remove_mon_from_reg(reg, mon) -NhRegion *reg; -struct monst *mon; +remove_mon_from_reg(NhRegion *reg, struct monst *mon) { register int i; @@ -216,9 +204,7 @@ struct monst *mon; * than to check for coordinates. */ boolean -mon_in_region(reg, mon) -NhRegion *reg; -struct monst *mon; +mon_in_region(NhRegion *reg, struct monst *mon) { int i; @@ -268,8 +254,7 @@ NhRegion *reg; * Free mem from region. */ void -free_region(reg) -NhRegion *reg; +free_region(NhRegion *reg) { if (reg) { if (reg->rects) @@ -291,8 +276,7 @@ NhRegion *reg; * This actually activates the region. */ void -add_region(reg) -NhRegion *reg; +add_region(NhRegion *reg) { NhRegion **tmp_reg; int i, j; @@ -331,8 +315,7 @@ NhRegion *reg; * Remove a region from the list & free it. */ void -remove_region(reg) -NhRegion *reg; +remove_region(NhRegion *reg) { register int i, x, y; @@ -364,7 +347,7 @@ NhRegion *reg; * when changing level, for instance). */ void -clear_regions() +clear_regions(void) { register int i; @@ -383,7 +366,7 @@ clear_regions() * callbacks when needed. */ void -run_regions() +run_regions(void) { register int i, j, k; int f_indx; @@ -432,9 +415,7 @@ run_regions() * check whether player enters/leaves one or more regions. */ boolean -in_out_region(x, y) -xchar -x, y; +in_out_region(xchar x, xchar y) { int i, f_indx; @@ -483,9 +464,7 @@ x, y; * check whether a monster enters/leaves one or more regions. */ boolean -m_in_out_region(mon, x, y) -struct monst *mon; -xchar x, y; +m_in_out_region(struct monst *mon, xchar x, xchar y) { int i, f_indx; @@ -531,7 +510,7 @@ xchar x, y; * Checks player's regions after a teleport for instance. */ void -update_player_regions() +update_player_regions(void) { register int i; @@ -546,8 +525,7 @@ update_player_regions() * Ditto for a specified monster. */ void -update_monster_region(mon) -struct monst *mon; +update_monster_region(struct monst *mon) { register int i; @@ -604,8 +582,7 @@ struct monst *mon; * Returns NULL if not, otherwise returns region. */ NhRegion * -visible_region_at(x, y) -xchar x, y; +visible_region_at(xchar x, xchar y) { register int i; @@ -621,9 +598,7 @@ xchar x, y; } void -show_region(reg, x, y) -NhRegion *reg; -xchar x, y; +show_region(NhRegion *reg, xchar x, xchar y) { show_glyph(x, y, reg->glyph); } @@ -632,9 +607,7 @@ xchar x, y; * save_regions : */ void -save_regions(fd, mode) -int fd; -int mode; +save_regions(int fd, int mode) { int i, j; unsigned n; @@ -682,9 +655,9 @@ int mode; } void -rest_regions(fd, ghostly) -int fd; -boolean ghostly; /* If a bones file restore */ +rest_regions( + int fd, + boolean ghostly) /**< If a bones file restore */ { int i, j; unsigned n; @@ -771,10 +744,7 @@ boolean ghostly; /* If a bones file restore */ /* to support '#stats' wizard-mode command */ void -region_stats(hdrfmt, hdrbuf, count, size) -const char *hdrfmt; -char *hdrbuf; -long *count, *size; +region_stats(const char *hdrfmt, char *hdrbuf, long int *count, long int *size) { NhRegion *rg; int i; @@ -799,8 +769,7 @@ long *count, *size; /* update monster IDs for region being loaded from bones; `ghostly' implied */ static void -reset_region_mids(reg) -NhRegion *reg; +reset_region_mids(NhRegion *reg) { int i = 0, n = reg->n_monst; unsigned *mid_list = reg->monsters; @@ -925,9 +894,7 @@ int radius, ttl; * region life after some mods... */ boolean -expire_gas_cloud(p1, p2) -genericptr_t p1; -void *p2 UNUSED; +expire_gas_cloud(genericptr_t p1, void *p2 UNUSED) { NhRegion *reg; size_t damage; @@ -947,9 +914,7 @@ void *p2 UNUSED; } boolean -revive_cthulhu(p1, p2) -genericptr_t p1; -genericptr_t p2; +revive_cthulhu(genericptr_t p1, genericptr_t p2) { boolean ret = expire_gas_cloud(p1, p2); if (ret) { @@ -986,9 +951,7 @@ genericptr_t p2; } boolean -inside_gas_cloud(p1, p2) -genericptr_t p1; -genericptr_t p2; +inside_gas_cloud(genericptr_t p1, genericptr_t p2) { NhRegion *reg; struct monst *mtmp; @@ -1051,11 +1014,7 @@ genericptr_t p2; } NhRegion * -create_cthulhu_death_cloud(x, y, radius, damage, duration) -xchar x, y; -int radius; -size_t damage; -int duration; +create_cthulhu_death_cloud(xchar x, xchar y, int radius, size_t damage, int duration) { NhRegion *cloud; @@ -1066,11 +1025,7 @@ int duration; } NhRegion * -create_gas_cloud(x, y, radius, damage, duration) -xchar x, y; -int radius; -size_t damage; -int duration; +create_gas_cloud(xchar x, xchar y, int radius, size_t damage, int duration) { NhRegion *cloud; int i, nrect; @@ -1104,7 +1059,7 @@ int duration; /* for checking troubles during prayer; is hero at risk? */ boolean -region_danger() +region_danger(void) { int i, f_indx, n = 0; @@ -1134,7 +1089,7 @@ region_danger() /* for fixing trouble at end of prayer; danger detected at start of prayer might have expired by now */ void -region_safety() +region_safety(void) { NhRegion *r = 0; int i, f_indx, n = 0; diff --git a/src/restore.c b/src/restore.c index 7ad62d3c9..43050256d 100644 --- a/src/restore.c +++ b/src/restore.c @@ -18,20 +18,20 @@ extern void substitute_tiles(d_level *); /* from tile.c */ #ifdef ZEROCOMP static int mgetc(); #endif -static void find_lev_obj(); +static void find_lev_obj(void); static void restlevchn(int); -static void restdamage(int, BOOLEAN_P); +static void restdamage(int, boolean); static void restobj(int, struct obj *); -static struct obj *restobjchn(int, BOOLEAN_P, BOOLEAN_P); +static struct obj *restobjchn(int, boolean, boolean); static void restmon(int, struct monst *); -static struct monst *restmonchn(int, BOOLEAN_P); +static struct monst *restmonchn(int, boolean); static struct fruit *loadfruitchn(int); static void freefruitchn(struct fruit *); static void ghostfruit(struct obj *); static boolean restgamestate(int, unsigned int *, unsigned int *); static void restlevelstate(unsigned int, unsigned int); -static int restlevelfile(int, XCHAR_P); -static void reset_oattached_mids(BOOLEAN_P); +static int restlevelfile(int, xchar); +static void reset_oattached_mids(boolean); /* * Save a mapping of IDs from ghost levels to the current level. This @@ -46,7 +46,7 @@ struct bucket { } map[N_PER_BUCKET]; }; -static void clear_id_mapping(); +static void clear_id_mapping(void); static void add_id_mapping(unsigned, unsigned); static int n_ids_mapped = 0; @@ -68,7 +68,7 @@ static NEARDATA long omoves; /* Recalculate level.objects[x][y], since this info was not saved. */ static void -find_lev_obj() +find_lev_obj(void) { register struct obj *fobjtmp = (struct obj *)0; register struct obj *otmp; @@ -101,8 +101,7 @@ find_lev_obj() * infamous "HUP" cheat) get used up here. */ void -inven_inuse(quietly) -boolean quietly; +inven_inuse(boolean quietly) { register struct obj *otmp, *otmp2; @@ -116,8 +115,7 @@ boolean quietly; } static void -restlevchn(fd) -register int fd; +restlevchn(register int fd) { int cnt; s_level *tmplev, *x; @@ -139,9 +137,7 @@ register int fd; } static void -restdamage(fd, ghostly) -int fd; -boolean ghostly; +restdamage(int fd, boolean ghostly) { int counter; struct damage *tmp_dam; @@ -182,8 +178,7 @@ boolean ghostly; } struct lvl_sounds * -rest_lvl_sounds(fd) -register int fd; +rest_lvl_sounds(register int fd) { int marker; struct lvl_sounds *or = NULL; @@ -208,8 +203,7 @@ register int fd; } struct mon_gen_override * -rest_mongen_override(fd) -register int fd; +rest_mongen_override(register int fd) { int marker; struct mon_gen_override *or = NULL; @@ -240,9 +234,7 @@ register int fd; /* restore one object */ static void -restobj(fd, otmp) -int fd; -struct obj *otmp; +restobj(int fd, struct obj *otmp) { int buflen; @@ -294,9 +286,7 @@ struct obj *otmp; } static struct obj * -restobjchn(fd, ghostly, frozen) -register int fd; -boolean ghostly, frozen; +restobjchn(register int fd, boolean ghostly, boolean frozen) { register struct obj *otmp, *otmp2 = 0; register struct obj *first = (struct obj *) 0; @@ -386,9 +376,7 @@ boolean ghostly, frozen; /* restore one monster */ static void -restmon(fd, mtmp) -int fd; -struct monst *mtmp; +restmon(int fd, struct monst *mtmp) { int buflen; @@ -443,9 +431,7 @@ struct monst *mtmp; } static struct monst * -restmonchn(fd, ghostly) -register int fd; -boolean ghostly; +restmonchn(register int fd, boolean ghostly) { register struct monst *mtmp, *mtmp2 = 0; register struct monst *first = (struct monst *) 0; @@ -518,8 +504,7 @@ boolean ghostly; } static struct fruit * -loadfruitchn(fd) -int fd; +loadfruitchn(int fd) { register struct fruit *flist, *fnext; @@ -535,8 +520,7 @@ int fd; } static void -freefruitchn(flist) -register struct fruit *flist; +freefruitchn(register struct fruit *flist) { register struct fruit *fnext; @@ -548,8 +532,7 @@ register struct fruit *flist; } static void -ghostfruit(otmp) -register struct obj *otmp; +ghostfruit(register struct obj *otmp) { register struct fruit *oldf; @@ -561,9 +544,7 @@ register struct obj *otmp; } static boolean -restgamestate(fd, stuckid, steedid) -register int fd; -unsigned int *stuckid, *steedid; /* STEED */ +restgamestate(register int fd, unsigned int *stuckid, unsigned int *steedid) { /* discover is actually flags.explore */ boolean remember_discover = discover; @@ -668,8 +649,7 @@ unsigned int *stuckid, *steedid; /* STEED */ * don't dereference a wild u.ustuck when saving the game state, for instance) */ static void -restlevelstate(stuckid, steedid) -unsigned int stuckid, steedid; /* STEED */ +restlevelstate(unsigned int stuckid, unsigned int steedid) { register struct monst *mtmp; @@ -689,11 +669,12 @@ unsigned int stuckid, steedid; /* STEED */ } } -/*ARGSUSED*/ /* fd used in MFLOPPY only */ +/*ARGSUSED*/ static int -restlevelfile(fd, ltmp) -int fd UNUSED; -xchar ltmp; +restlevelfile( + int fd UNUSED, /**< fd used in MFLOPPY only */ + xchar ltmp +) #if defined(macintosh) && (defined(__SC__) || defined(__MRC__)) # pragma unused(fd) #endif @@ -753,8 +734,7 @@ xchar ltmp; } int -dorecover(fd) -register int fd; +dorecover(register int fd) { unsigned int stuckid = 0, steedid = 0; /* not a register */ xchar ltmp; @@ -914,9 +894,7 @@ register int fd; } void -restcemetery(fd, cemeteryaddr) -int fd; -struct cemetery **cemeteryaddr; +restcemetery(int fd, struct cemetery **cemeteryaddr) { struct cemetery *bonesinfo, **bonesaddr; int flag; @@ -936,8 +914,7 @@ struct cemetery **cemeteryaddr; } void -trickery(reason) -char *reason; +trickery(char *reason) { pline("Strange, this map is not as I remember it."); pline("Somebody is trying some trickery here..."); @@ -947,10 +924,7 @@ char *reason; } void -getlev(fd, pid, lev, ghostly) -int fd, pid; -xchar lev; -boolean ghostly; +getlev(int fd, int pid, xchar lev, boolean ghostly) { register struct trap *trap; register struct monst *mtmp; @@ -1175,7 +1149,7 @@ boolean ghostly; /* Clear all structures for object and monster ID mapping. */ static void -clear_id_mapping() +clear_id_mapping(void) { struct bucket *curr; @@ -1188,8 +1162,7 @@ clear_id_mapping() /* Add a mapping to the ID map. */ static void -add_id_mapping(gid, nid) -unsigned gid, nid; +add_id_mapping(unsigned int gid, unsigned int nid) { int idx; @@ -1213,8 +1186,7 @@ unsigned gid, nid; * ID. */ boolean -lookup_id_mapping(gid, nidp) -unsigned gid, *nidp; +lookup_id_mapping(unsigned int gid, unsigned int *nidp) { int i; struct bucket *curr; @@ -1239,8 +1211,7 @@ unsigned gid, *nidp; } static void -reset_oattached_mids(ghostly) -boolean ghostly; +reset_oattached_mids(boolean ghostly) { struct obj *otmp; unsigned oldid, nid; @@ -1328,16 +1299,13 @@ register unsigned len; #else /* ZEROCOMP */ void -minit() +minit(void) { return; } void -mread(fd, buf, len) -register int fd; -register genericptr_t buf; -register unsigned int len; +mread(register int fd, register genericptr_t buf, register unsigned int len) { register int rlen; diff --git a/src/rip.c b/src/rip.c index d0a4943a6..419f2f714 100644 --- a/src/rip.c +++ b/src/rip.c @@ -71,9 +71,7 @@ static const char *rip_txt[] = { static char **rip; static void -center(line, text) -int line; -char *text; +center(int line, char *text) { register char *ip, *op; ip = text; @@ -83,9 +81,7 @@ char *text; void -genl_outrip(tmpwin, how) -winid tmpwin; -int how; +genl_outrip(winid tmpwin, int how) { register char **dp; register char *dpx; diff --git a/src/rnd.c b/src/rnd.c index 8c354cbb8..c5fdad7aa 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -34,8 +34,7 @@ set_random_state(unsigned int x) } int -rn2(x) /**< 0 <= rn2(x) < x */ -register int x; +rn2(register int x) /**< 0 <= rn2(x) < x */ { if (x <= 0) { warning("rn2(%d) attempted", x); @@ -46,8 +45,8 @@ register int x; } int -rnl(x) /**< 0 <= rnl(x) < x; sometimes subtracting Luck */ -register int x; /**< good luck approaches 0, bad luck approaches (x-1) */ +rnl(register int x) /**< 0 <= rnl(x) < x; sometimes subtracting Luck */ + /**< good luck approaches 0, bad luck approaches (x-1) */ { register int i; @@ -68,8 +67,8 @@ register int x; /**< good luck approaches 0, bad luck approaches (x-1) */ } int -rnd(x) /**< 1 <= rnd(x) <= x */ -register int x; +rnd(register int x) /**< 1 <= rnd(x) <= x */ + { if (x <= 0) { warning("rnd(%d) attempted", x); @@ -80,8 +79,8 @@ register int x; } int -d(n, x) /**< n <= d(n,x) <= (n*x) */ -register int n, x; +d(register int n, register int x) /**< n <= d(n,x) <= (n*x) */ + { register int tmp = n; @@ -94,8 +93,7 @@ register int n, x; } int -rne(x) -register int x; +rne(register int x) { int i; @@ -122,8 +120,7 @@ register int x; } int -rnz(i) -int i; +rnz(int i) { #ifdef LINT int x = i; @@ -140,8 +137,8 @@ int i; } int -rnf(numerator, denominator) /**< @returns (rnf(n,d) < n/d) */ -int numerator, denominator; +rnf(int numerator, int denominator) /**< @returns (rnf(n,d) < n/d) */ + { return rn2(denominator) < numerator; } diff --git a/src/role.c b/src/role.c index 91fe0f560..ccf584e01 100644 --- a/src/role.c +++ b/src/role.c @@ -576,7 +576,7 @@ static struct { short mask; } rfilter; -static int randrole_filtered(); +static int randrole_filtered(void); static char * promptsep(char *, int); static int role_gendercount(int); static int race_alignmentcount(int); @@ -585,20 +585,19 @@ static int race_alignmentcount(int); static char NEARDATA randomstr[] = "random"; boolean -validrole(rolenum) -int rolenum; +validrole(int rolenum) { return (rolenum >= 0 && rolenum < SIZE(roles)-1); } int -randrole() +randrole(void) { return (rn2(SIZE(roles)-1)); } static int -randrole_filtered() +randrole_filtered(void) { int i, n = 0, set[SIZE(roles)]; @@ -647,8 +646,7 @@ str2role(const char *str) } boolean -validrace(rolenum, racenum) -int rolenum, racenum; +validrace(int rolenum, int racenum) { /* Assumes validrole */ return (racenum >= 0 && racenum < SIZE(races) - 1 && @@ -656,8 +654,7 @@ int rolenum, racenum; } int -randrace(rolenum) -int rolenum; +randrace(int rolenum) { int i, n = 0; @@ -711,8 +708,7 @@ str2race(const char *str) } boolean -validgend(rolenum, racenum, gendnum) -int rolenum, racenum, gendnum; +validgend(int rolenum, int racenum, int gendnum) { /* Assumes validrole and validrace */ return (gendnum >= 0 && gendnum < ROLE_GENDERS && @@ -721,8 +717,7 @@ int rolenum, racenum, gendnum; } int -randgend(rolenum, racenum) -int rolenum, racenum; +randgend(int rolenum, int racenum) { int i, n = 0; @@ -776,8 +771,7 @@ str2gend(const char *str) } boolean -validalign(rolenum, racenum, alignnum) -int rolenum, racenum, alignnum; +validalign(int rolenum, int racenum, int alignnum) { /* Assumes validrole and validrace */ return (alignnum >= 0 && alignnum < ROLE_ALIGNS && @@ -786,8 +780,7 @@ int rolenum, racenum, alignnum; } int -randalign(rolenum, racenum) -int rolenum, racenum; +randalign(int rolenum, int racenum) { int i, n = 0; @@ -840,8 +833,7 @@ str2align(const char *str) /* is rolenum compatible with any racenum/gendnum/alignnum constraints? */ boolean -ok_role(rolenum, racenum, gendnum, alignnum) -int rolenum, racenum, gendnum, alignnum; +ok_role(int rolenum, int racenum, int gendnum, int alignnum) { int i; short allow; @@ -893,8 +885,7 @@ int rolenum, racenum, gendnum, alignnum; /* If pickhow == PICK_RIGID a role is returned only if there is */ /* a single possibility */ int -pick_role(racenum, gendnum, alignnum, pickhow) -int racenum, gendnum, alignnum, pickhow; +pick_role(int racenum, int gendnum, int alignnum, int pickhow) { int i; int roles_ok = 0, set[SIZE(roles)]; @@ -915,8 +906,7 @@ int racenum, gendnum, alignnum, pickhow; /* is racenum compatible with any rolenum/gendnum/alignnum constraints? */ boolean -ok_race(rolenum, racenum, gendnum, alignnum) -int rolenum, racenum, gendnum, alignnum; +ok_race(int rolenum, int racenum, int gendnum, int alignnum) { int i; short allow; @@ -968,8 +958,7 @@ int rolenum, racenum, gendnum, alignnum; /* If pickhow == PICK_RIGID a race is returned only if there is */ /* a single possibility */ int -pick_race(rolenum, gendnum, alignnum, pickhow) -int rolenum, gendnum, alignnum, pickhow; +pick_race(int rolenum, int gendnum, int alignnum, int pickhow) { int i; int races_ok = 0; @@ -996,9 +985,7 @@ int rolenum, gendnum, alignnum, pickhow; /* is gendnum compatible with any rolenum/racenum/alignnum constraints? */ /* gender and alignment are not comparable (and also not constrainable) */ boolean -ok_gend(rolenum, racenum, gendnum, alignnum) -int rolenum, racenum, gendnum; -int alignnum UNUSED; +ok_gend(int rolenum, int racenum, int gendnum, int alignnum UNUSED) { int i; short allow; @@ -1043,8 +1030,7 @@ int alignnum UNUSED; /* If pickhow == PICK_RIGID a gender is returned only if there is */ /* a single possibility */ int -pick_gend(rolenum, racenum, alignnum, pickhow) -int rolenum, racenum, alignnum, pickhow; +pick_gend(int rolenum, int racenum, int alignnum, int pickhow) { int i; int gends_ok = 0; @@ -1073,10 +1059,7 @@ int rolenum, racenum, alignnum, pickhow; /* is alignnum compatible with any rolenum/racenum/gendnum constraints? */ /* alignment and gender are not comparable (and also not constrainable) */ boolean -ok_align(rolenum, racenum, gendnum, alignnum) -int rolenum, racenum; -int gendnum UNUSED; -int alignnum; +ok_align(int rolenum, int racenum, int gendnum UNUSED, int alignnum) { int i; short allow; @@ -1121,8 +1104,7 @@ int alignnum; /* If pickhow == PICK_RIGID an alignment is returned only if there is */ /* a single possibility */ int -pick_align(rolenum, racenum, gendnum, pickhow) -int rolenum, racenum, gendnum, pickhow; +pick_align(int rolenum, int racenum, int gendnum, int pickhow) { int i; int aligns_ok = 0; @@ -1146,7 +1128,7 @@ int rolenum, racenum, gendnum, pickhow; } void -rigid_role_checks() +rigid_role_checks(void) { int tmp; @@ -1201,8 +1183,7 @@ rigid_role_checks() } boolean -setrolefilter(bufp) -const char *bufp; +setrolefilter(const char *bufp) { int i; boolean reslt = TRUE; @@ -1222,7 +1203,7 @@ const char *bufp; } boolean -gotrolefilter() +gotrolefilter(void) { int i; @@ -1238,7 +1219,7 @@ gotrolefilter() } void -clearrolefilter() +clearrolefilter(void) { int i; @@ -1257,9 +1238,7 @@ clearrolefilter() static char pa[NUM_BP], post_attribs; static char * -promptsep(buf, num_post_attribs) -char *buf; -int num_post_attribs; +promptsep(char *buf, int num_post_attribs) { const char *conj = "and "; @@ -1273,8 +1252,7 @@ int num_post_attribs; } static int -role_gendercount(rolenum) -int rolenum; +role_gendercount(int rolenum) { int gendcount = 0; if (validrole(rolenum)) { @@ -1286,8 +1264,7 @@ int rolenum; } static int -race_alignmentcount(racenum) -int racenum; +race_alignmentcount(int racenum) { int aligncount = 0; if (racenum != ROLE_NONE && racenum != ROLE_RANDOM) { @@ -1299,9 +1276,7 @@ int racenum; } char * -root_plselection_prompt(suppliedbuf, buflen, rolenum, racenum, gendnum, alignnum) -char *suppliedbuf; -int buflen, rolenum, racenum, gendnum, alignnum; +root_plselection_prompt(char *suppliedbuf, int buflen, int rolenum, int racenum, int gendnum, int alignnum) { int k, gendercount = 0, aligncount = 0; char buf[BUFSZ]; @@ -1440,9 +1415,7 @@ int buflen, rolenum, racenum, gendnum, alignnum; } char * -build_plselection_prompt(buf, buflen, rolenum, racenum, gendnum, alignnum) -char *buf; -int buflen, rolenum, racenum, gendnum, alignnum; +build_plselection_prompt(char *buf, int buflen, int rolenum, int racenum, int gendnum, int alignnum) { const char *defprompt = "Shall I pick a character for you? [yntq] "; int num_post_attribs = 0; @@ -1517,7 +1490,7 @@ int buflen, rolenum, racenum, gendnum, alignnum; #undef NUM_BP void -plnamesuffix() +plnamesuffix(void) { char *sptr, *eptr; int i; @@ -1555,9 +1528,7 @@ plnamesuffix() /* show current settings for name, role, race, gender, and alignment in the specified window */ void -role_selection_prolog(which, where) -int which; -winid where; +role_selection_prolog(int which, winid where) { static const char choosing[] = " choosing now"; static const char not_yet[] = " not yet specified"; @@ -1640,10 +1611,7 @@ winid where; /* add a "pick alignment first"-type entry to the specified menu */ void -role_menu_extra(which, where, preselect) -int which; -winid where; -boolean preselect; +role_menu_extra(int which, winid where, boolean preselect) { static NEARDATA const char RS_menu_let[] = { '=', /* name */ @@ -1808,7 +1776,7 @@ boolean preselect; * This code also replaces quest_init(). */ void -role_init() +role_init(void) { int alignmnt; struct permonst *pm; @@ -1947,8 +1915,7 @@ role_init() } const char * -Hello(mtmp) -struct monst *mtmp; +Hello(struct monst *mtmp) { switch (Role_switch) { case PM_KNIGHT: @@ -1972,7 +1939,7 @@ struct monst *mtmp; } const char * -Goodbye() +Goodbye(void) { switch (Role_switch) { case PM_KNIGHT: @@ -1992,8 +1959,7 @@ Goodbye() /* A function to break a specific roleplay-conduct */ void -violated(cdt) -int cdt; +violated(int cdt) { switch(cdt) { case CONDUCT_PACIFISM: @@ -2085,8 +2051,7 @@ int cdt; * return FALSE if broken */ boolean -successful_cdt(cdt) -int cdt; +successful_cdt(int cdt) { if ((cdt == CONDUCT_PACIFISM) && !u.uconduct.killer && !num_genocides() && (u.uconduct.weaphit<=100)) @@ -2109,8 +2074,7 @@ int cdt; /* a function to check whether a specific conduct * * was selected at character creation */ boolean -intended_cdt(cdt) -int cdt; +intended_cdt(int cdt) { if ((cdt == CONDUCT_PACIFISM) && flags.pacifist) return TRUE; if ((cdt == CONDUCT_ATHEISM) && flags.atheist) return TRUE; @@ -2126,8 +2090,7 @@ int cdt; /* a function to check whether it's superflous to list that conduct */ boolean -superfluous_cdt(cdt) -int cdt; +superfluous_cdt(int cdt) { if ((cdt == CONDUCT_VEGAN) && successful_cdt(CONDUCT_FOODLESS)) return TRUE; if ((cdt == CONDUCT_VEGETARIAN) && successful_cdt(CONDUCT_VEGAN)) return TRUE; @@ -2138,8 +2101,7 @@ int cdt; /* tell if you failed a selected conduct */ boolean -failed_cdt(cdt) -int cdt; +failed_cdt(int cdt) { return (intended_cdt(cdt) && !successful_cdt(cdt)); } diff --git a/src/rumors.c b/src/rumors.c index 21680f33d..17de91ba0 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -54,8 +54,7 @@ static unsigned oracle_cnt = 0; static long *oracle_loc = 0; static void -init_rumors(fp) -dlb *fp; +init_rumors(dlb *fp) { char line[BUFSZ]; @@ -80,10 +79,10 @@ dlb *fp; * of them contain such references anyway. */ char * -getrumor(truth, rumor_buf, exclude_cookie) -int truth; /* 1=true, -1=false, 0=either */ -char *rumor_buf; -boolean exclude_cookie; +getrumor(int truth, char *rumor_buf, boolean exclude_cookie) + /* 1=true, -1=false, 0=either */ + + { dlb *rumors; long tidbit, beginning; @@ -151,9 +150,9 @@ boolean exclude_cookie; } void -outrumor(truth, mechanism) -int truth; /* 1=true, -1=false, 0=either */ -int mechanism; +outrumor(int truth, int mechanism) + /* 1=true, -1=false, 0=either */ + { static const char fortune_msg[] = "This cookie has a scrap of paper inside."; @@ -196,8 +195,7 @@ int mechanism; } static void -init_oracles(fp) -dlb *fp; +init_oracles(dlb *fp) { register int i; char line[BUFSZ]; @@ -218,8 +216,7 @@ dlb *fp; } void -save_oracles(fd, mode) -int fd, mode; +save_oracles(int fd, int mode) { if (perform_bwrite(mode)) { bwrite(fd, (genericptr_t) &oracle_cnt, sizeof oracle_cnt); @@ -235,8 +232,7 @@ int fd, mode; } void -restore_oracles(fd) -int fd; +restore_oracles(int fd) { mread(fd, (genericptr_t) &oracle_cnt, sizeof oracle_cnt); if (oracle_cnt) { @@ -247,9 +243,7 @@ int fd; } void -outoracle(special, delphi) -boolean special; -boolean delphi; +outoracle(boolean special, boolean delphi) { char line[COLNO]; char *endp; @@ -329,8 +323,7 @@ register struct monst *oracl; #endif int -doconsult(oracl) -register struct monst *oracl; +doconsult(register struct monst *oracl) { long umoney = money_cnt(invent); int u_pay, minor_cost = 50, major_cost = 500 + 50 * u.ulevel; diff --git a/src/save.c b/src/save.c index 211e1ce69..b48bcf2c1 100644 --- a/src/save.c +++ b/src/save.c @@ -36,7 +36,7 @@ static void savegamestate(int, int); void save_mongen_override(int, struct mon_gen_override *, int); void save_lvl_sounds(int, struct lvl_sounds *, int); #ifdef MFLOPPY -static void savelev0(int, XCHAR_P, int); +static void savelev0(int, xchar, int); static boolean swapout_oldest(); static void copyfile(char *, char *); #endif /* MFLOPPY */ @@ -66,7 +66,7 @@ extern const struct text_color_option *text_colors; static unsigned ustuck_id = 0, usteed_id = 0; int -dosave() +dosave(void) { if (iflags.debug_fuzzer) { return 0; @@ -100,8 +100,9 @@ dosave() #if defined(UNIX) || defined(VMS) || defined (__EMX__) || defined(WIN32) /*ARGSUSED*/ void -hangup(sig_unused) /* called as signal() handler, so sent at least one arg */ -int sig_unused UNUSED; +hangup( + int sig_unused UNUSED) /**< called as signal() handler, so sent + at least one arg */ { # ifdef NOSAVEONHANGUP (void) signal(SIGINT, SIG_IGN); @@ -130,7 +131,7 @@ int sig_unused UNUSED; /* returns 1 if save successful */ int -dosave0() +dosave0(void) { const char *fq_save; register int fd, ofd; @@ -307,8 +308,7 @@ dosave0() } static void -savegamestate(fd, mode) -register int fd, mode; +savegamestate(register int fd, register int mode) { int uid; #if defined(RECORD_REALTIME) || defined(REALTIME_ON_BOTL) @@ -375,7 +375,7 @@ register int fd, mode; #ifdef INSURANCE void -savestateinlock() +savestateinlock(void) { int fd, hpid; static boolean havestate = TRUE; @@ -481,11 +481,11 @@ static void savelev0(fd, lev, mode) #else void -savelev(fd, lev, mode) +savelev(int fd, xchar lev, int mode) #endif -int fd; -xchar lev; -int mode; + + + { #ifdef TOS short tlev; @@ -790,8 +790,7 @@ static FILE *bw_FILE = 0; static boolean buffering = FALSE; void -bufon(fd) -int fd; +bufon(int fd) { #ifdef UNIX if(bw_fd >= 0) @@ -804,16 +803,14 @@ int fd; } void -bufoff(fd) -int fd; +bufoff(int fd) { bflush(fd); buffering = FALSE; } void -bflush(fd) -int fd; +bflush(int fd) { #ifdef UNIX if(fd == bw_fd) { @@ -825,10 +822,7 @@ int fd; } void -bwrite(fd, loc, num) -register int fd; -register genericptr_t loc; -register unsigned num; +bwrite(register int fd, register genericptr_t loc, register unsigned int num) { boolean failed; @@ -865,8 +859,7 @@ register unsigned num; } void -bclose(fd) -int fd; +bclose(int fd) { bufoff(fd); #ifdef UNIX @@ -882,8 +875,7 @@ int fd; #endif /* ZEROCOMP */ static void -savelevchn(fd, mode) -register int fd, mode; +savelevchn(register int fd, register int mode) { s_level *tmplev, *tmplev2; int cnt = 0; @@ -905,10 +897,7 @@ register int fd, mode; /* used when saving a level and also when saving dungeon overview data */ void -savecemetery(fd, mode, cemeteryaddr) -int fd; -int mode; -struct cemetery **cemeteryaddr; +savecemetery(int fd, int mode, struct cemetery **cemeteryaddr) { struct cemetery *thisbones, *nextbones; int flag; @@ -933,8 +922,7 @@ struct cemetery **cemeteryaddr; } static void -savedamage(fd, mode) -register int fd, mode; +savedamage(register int fd, register int mode) { register struct damage *damageptr, *tmp_dam; unsigned int xl = 0; @@ -958,9 +946,7 @@ register int fd, mode; } void -save_mongen_override(fd, or, mode) -register int fd, mode; -register struct mon_gen_override *or; +save_mongen_override(register int fd, register struct mon_gen_override *or, register int mode) { struct mon_gen_tuple *mt; struct mon_gen_tuple *prev; @@ -993,9 +979,7 @@ register struct mon_gen_override *or; } void -save_lvl_sounds(fd, or, mode) -register int fd, mode; -register struct lvl_sounds *or; +save_lvl_sounds(register int fd, register struct lvl_sounds *or, register int mode) { int marker = 0; int i; @@ -1030,9 +1014,7 @@ register struct lvl_sounds *or; } static void -saveobj(fd, otmp) -int fd; -struct obj *otmp; +saveobj(int fd, struct obj *otmp) { int buflen, zerobuf = 0; @@ -1070,9 +1052,7 @@ struct obj *otmp; } static void -saveobjchn(fd, otmp, mode) -register int fd, mode; -register struct obj *otmp; +saveobjchn(register int fd, register struct obj *otmp, register int mode) { register struct obj *otmp2; int minusone = -1; @@ -1119,9 +1099,7 @@ register struct obj *otmp; } static void -savemon(fd, mtmp) -int fd; -struct monst *mtmp; +savemon(int fd, struct monst *mtmp) { int buflen; @@ -1168,9 +1146,7 @@ struct monst *mtmp; } static void -savemonchn(fd, mtmp, mode) -register int fd, mode; -register struct monst *mtmp; +savemonchn(register int fd, register struct monst *mtmp, register int mode) { register struct monst *mtmp2; int minusone = -1; @@ -1200,9 +1176,7 @@ register struct monst *mtmp; } static void -savetrapchn(fd, trap, mode) -register int fd, mode; -register struct trap *trap; +savetrapchn(register int fd, register struct trap *trap, register int mode) { static struct trap zerotrap; register struct trap *trap2; @@ -1225,8 +1199,7 @@ register struct trap *trap; * level routine marks nonexistent fruits by making the fid negative. */ void -savefruitchn(fd, mode) -register int fd, mode; +savefruitchn(register int fd, register int mode) { static struct fruit zerofruit; register struct fruit *f2, *f1; @@ -1249,8 +1222,7 @@ register int fd, mode; #if defined(STATUS_COLORS) && defined(TEXTCOLOR) void -free_percent_color_options(list_head) -const struct percent_color_option *list_head; +free_percent_color_options(const struct percent_color_option *list_head) { if (list_head == NULL) return; free_percent_color_options(list_head->next); @@ -1258,8 +1230,7 @@ const struct percent_color_option *list_head; } void -free_text_color_options(list_head) -const struct text_color_option *list_head; +free_text_color_options(const struct text_color_option *list_head) { if (list_head == NULL) return; free_text_color_options(list_head->next); @@ -1268,7 +1239,7 @@ const struct text_color_option *list_head; } void -free_status_colors() +free_status_colors(void) { free_percent_color_options(hp_colors); hp_colors = NULL; free_percent_color_options(pw_colors); pw_colors = NULL; @@ -1278,7 +1249,7 @@ free_status_colors() /* also called by prscore(); this probably belongs in dungeon.c... */ void -free_dungeons() +free_dungeons(void) { #ifdef FREE_ALL_MEMORY savelevchn(0, FREE_SAVE); @@ -1288,7 +1259,7 @@ free_dungeons() } void -freedynamicdata() +freedynamicdata(void) { #if defined(STATUS_COLORS) && defined(TEXTCOLOR) free_status_colors(); @@ -1450,7 +1421,7 @@ char *from, *to; } void -co_false() /* see comment in bones.c */ +co_false() /* see comment in bones.c */ { count_only = FALSE; return; diff --git a/src/shk.c b/src/shk.c index 161d6838d..2e86527e7 100644 --- a/src/shk.c +++ b/src/shk.c @@ -14,8 +14,8 @@ #ifdef KOPS static void makekops(coord *); -static void call_kops(struct monst *, BOOLEAN_P); -static void kops_gone(BOOLEAN_P); +static void call_kops(struct monst *, boolean); +static void kops_gone(boolean); #endif /* KOPS */ #define NOTANGRY(mon) ((mon)->mpeaceful) @@ -40,8 +40,8 @@ static const char the_contents_of[] = "the contents of "; static void setpaid(struct monst *); static long addupbill(struct monst *); static void pacify_shk(struct monst *); -static struct bill_x *onbill(struct obj *, struct monst *, BOOLEAN_P); -static struct monst *next_shkp(struct monst *, BOOLEAN_P); +static struct bill_x *onbill(struct obj *, struct monst *, boolean); +static struct monst *next_shkp(struct monst *, boolean); static long shop_debt(struct eshk *); static char *shk_owns(char *, struct obj *); static char *mon_owns(char *, struct obj *); @@ -52,26 +52,26 @@ static void pay(long, struct monst *); static long get_cost(struct obj *, struct monst *); static long set_cost(struct obj *, struct monst *); static const char *shk_embellish(struct obj *, long); -static long cost_per_charge(struct monst *, struct obj *, BOOLEAN_P); +static long cost_per_charge(struct monst *, struct obj *, boolean); static long cheapest_item(struct monst *); -static int dopayobj(struct monst *, struct bill_x *, struct obj **, int, BOOLEAN_P); -static long stolen_container(struct obj *, struct monst *, long, BOOLEAN_P); -static long getprice(struct obj *, BOOLEAN_P); +static int dopayobj(struct monst *, struct bill_x *, struct obj **, int, boolean); +static long stolen_container(struct obj *, struct monst *, long, boolean); +static long getprice(struct obj *, boolean); static void shk_names_obj(struct monst *, struct obj *, const char *, long, const char *); static struct obj *bp_to_obj(struct bill_x *); -static boolean inherits(struct monst *, int, int, BOOLEAN_P); +static boolean inherits(struct monst *, int, int, boolean); static void set_repo_loc(struct monst *); -static boolean angry_shk_exists(); +static boolean angry_shk_exists(void); static void rile_shk(struct monst *); -static void rouse_shk(struct monst *, BOOLEAN_P); -static void remove_damage(struct monst *, BOOLEAN_P); +static void rouse_shk(struct monst *, boolean); +static void remove_damage(struct monst *, boolean); static void sub_one_frombill(struct obj *, struct monst *); -static void add_one_tobill(struct obj *, BOOLEAN_P, struct monst *); -static void dropped_container(struct obj *, struct monst *, BOOLEAN_P); +static void add_one_tobill(struct obj *, boolean, struct monst *); +static void dropped_container(struct obj *, struct monst *, boolean); static void add_to_billobjs(struct obj *); static boolean rob_shop(struct monst *); -static boolean special_stock(struct obj *, struct monst *, BOOLEAN_P); -static const char *cad(BOOLEAN_P); +static boolean special_stock(struct obj *, struct monst *, boolean); +static const char *cad(boolean); /* invariants: obj->unpaid iff onbill(obj) [unless bp->useup] @@ -94,9 +94,7 @@ static const char *angrytexts[] = { "quite upset", "ticked off", "furious" }; if the monster kept the change. */ long -money2mon(mon, amount) -struct monst *mon; -long amount; +money2mon(struct monst *mon, long int amount) { struct obj *ygold = findgold(invent); @@ -126,9 +124,7 @@ long amount; the priest gives you money for an ale. */ void -money2u(mon, amount) -struct monst *mon; -long amount; +money2u(struct monst *mon, long int amount) { struct obj *mongold = findgold(mon->minvent); @@ -155,9 +151,7 @@ long amount; } static struct monst * -next_shkp(shkp, withbill) -register struct monst *shkp; -register boolean withbill; +next_shkp(register struct monst *shkp, register boolean withbill) { for (; shkp; shkp = shkp->nmon) { if (DEADMONSTER(shkp)) continue; @@ -176,8 +170,7 @@ register boolean withbill; /* called in mon.c */ void -shkgone(mtmp) -struct monst *mtmp; +shkgone(struct monst *mtmp) { struct eshk *eshk = ESHK(mtmp); struct mkroom *sroom = &rooms[eshk->shoproom - ROOMOFFSET]; @@ -211,9 +204,7 @@ struct monst *mtmp; } void -set_residency(shkp, zero_out) -register struct monst *shkp; -register boolean zero_out; +set_residency(register struct monst *shkp, register boolean zero_out) { if (on_level(&(ESHK(shkp)->shoplevel), &u.uz)) rooms[ESHK(shkp)->shoproom - ROOMOFFSET].resident = @@ -221,8 +212,7 @@ register boolean zero_out; } void -replshk(mtmp, mtmp2) -register struct monst *mtmp, *mtmp2; +replshk(register struct monst *mtmp, register struct monst *mtmp2) { rooms[ESHK(mtmp2)->shoproom - ROOMOFFSET].resident = mtmp2; if (inhishop(mtmp) && *u.ushops == ESHK(mtmp)->shoproom) { @@ -232,9 +222,7 @@ register struct monst *mtmp, *mtmp2; /* do shopkeeper specific structure munging -dlc */ void -restshk(shkp, ghostly) -struct monst *shkp; -boolean ghostly; +restshk(struct monst *shkp, boolean ghostly) { if (u.uz.dlevel) { struct eshk *eshkp = ESHK(shkp); @@ -253,9 +241,7 @@ boolean ghostly; /* Clear the unpaid bit on a single object and its contents. */ static void -clear_unpaid_obj(shkp, otmp) -struct monst *shkp; -struct obj *otmp; +clear_unpaid_obj(struct monst *shkp, struct obj *otmp) { if (Has_contents(otmp)) { clear_unpaid(shkp, otmp->cobj); @@ -267,9 +253,7 @@ struct obj *otmp; /* Clear the unpaid bit on all of the objects in the list. */ static void -clear_unpaid(shkp, list) -struct monst *shkp; -struct obj *list; +clear_unpaid(struct monst *shkp, struct obj *list) { while (list) { clear_unpaid_obj(shkp, list); @@ -279,8 +263,7 @@ struct obj *list; /* either you paid or left the shop or the shopkeeper died */ void -setpaid(shkp) -register struct monst *shkp; +setpaid(register struct monst *shkp) { register struct obj *obj; register struct monst *mtmp; @@ -313,8 +296,7 @@ register struct monst *shkp; } static long -addupbill(shkp) -register struct monst *shkp; +addupbill(register struct monst *shkp) { register int ct = ESHK(shkp)->billct; register struct bill_x *bp = ESHK(shkp)->bill_p; @@ -329,9 +311,7 @@ register struct monst *shkp; #ifdef KOPS static void -call_kops(shkp, nearshop) -register struct monst *shkp; -register boolean nearshop; +call_kops(register struct monst *shkp, register boolean nearshop) { /* Keystone Kops srt@ucla */ register boolean nokops; @@ -418,8 +398,7 @@ register boolean nearshop; #ifdef BLACKMARKET void -blkmar_guards(mtmp) -register struct monst *mtmp; +blkmar_guards(register struct monst *mtmp) { register struct monst *mt; boolean mesg_given = FALSE; /* Only give message if assistants peaceful */ @@ -460,8 +439,7 @@ register struct monst *mtmp; /* look for a portal on the level and add or * remove iron bars on every adjacent square */ void -bars_around_portal(removebars) -boolean removebars; +bars_around_portal(boolean removebars) { int x, y, dx, dy; boolean sawit = FALSE; @@ -505,8 +483,7 @@ boolean removebars; /* x,y is strictly inside shop */ char -inside_shop(x, y) -register xchar x, y; +inside_shop(register xchar x, register xchar y) { register char rno; @@ -518,9 +495,7 @@ register xchar x, y; } void -u_left_shop(leavestring, newlev) -char *leavestring; -boolean newlev; +u_left_shop(char *leavestring, boolean newlev) { struct monst *shkp; struct eshk *eshkp; @@ -579,8 +554,7 @@ boolean newlev; /* robbery from outside the shop via telekinesis or grappling hook */ void -remote_burglary(x, y) -xchar x, y; +remote_burglary(xchar x, xchar y) { struct monst *shkp; struct eshk *eshkp; @@ -613,8 +587,7 @@ xchar x, y; /* shop merchandise has been taken; pay for it with any credit available; return false if the debt is fully covered by credit, true otherwise */ static boolean -rob_shop(shkp) -struct monst *shkp; +rob_shop(struct monst *shkp) { struct eshk *eshkp; long total; @@ -651,8 +624,8 @@ struct monst *shkp; /* give a message when entering an untended shop (caller has verified that) */ static void -deserted_shop(enterstring) -/*const*/ char *enterstring; +deserted_shop(char *enterstring) +/*const*/ { struct monst *mtmp; struct mkroom *r = &rooms[(int) *enterstring - ROOMOFFSET]; @@ -683,8 +656,7 @@ deserted_shop(enterstring) } void -u_entered_shop(enterstring) -char *enterstring; +u_entered_shop(char *enterstring) { int rt; struct monst *shkp; @@ -867,8 +839,7 @@ char *enterstring; /* called when removing a pick-axe or mattock from a container */ void -pick_pick(obj) -struct obj *obj; +pick_pick(struct obj *obj) { struct monst *shkp; @@ -900,8 +871,7 @@ struct obj *obj; quoted by the shopkeeper and also that they both belong to the same shk. */ boolean -same_price(obj1, obj2) -struct obj *obj1, *obj2; +same_price(struct obj *obj1, struct obj *obj2) { struct monst *shkp1, *shkp2; struct bill_x *bp1 = 0, *bp2 = 0; @@ -932,8 +902,7 @@ struct obj *obj1, *obj2; * level is bones data which has a shk on the warpath. */ static long -shop_debt(eshkp) -struct eshk *eshkp; +shop_debt(struct eshk *eshkp) { struct bill_x *bp; int ct; @@ -946,7 +915,7 @@ struct eshk *eshkp; /* called in response to the `$' command */ void -shopper_financial_report() +shopper_financial_report(void) { struct monst *shkp, *this_shkp = shop_keeper(inside_shop(u.ux, u.uy)); struct eshk *eshkp; @@ -981,8 +950,7 @@ shopper_financial_report() } int -inhishop(mtmp) -register struct monst *mtmp; +inhishop(register struct monst *mtmp) { struct eshk *eshkp = ESHK(mtmp); @@ -991,8 +959,7 @@ register struct monst *mtmp; } struct monst * -shop_keeper(rmno) -register char rmno; +shop_keeper(register char rmno) { struct monst *shkp = rmno >= ROOMOFFSET ? rooms[rmno - ROOMOFFSET].resident : 0; @@ -1023,8 +990,7 @@ register char rmno; } boolean -tended_shop(sroom) -struct mkroom *sroom; +tended_shop(struct mkroom *sroom) { struct monst *mtmp = sroom->resident; @@ -1035,10 +1001,7 @@ struct mkroom *sroom; } static struct bill_x * -onbill(obj, shkp, silent) -register struct obj *obj; -register struct monst *shkp; -register boolean silent; +onbill(register struct obj *obj, register struct monst *shkp, register boolean silent) { if (shkp) { register struct bill_x *bp = ESHK(shkp)->bill_p; @@ -1059,8 +1022,7 @@ register boolean silent; /* check whether an object or any of its contents belongs to a shop */ boolean -is_unpaid(obj) -struct obj *obj; +is_unpaid(struct obj *obj) { return (boolean) (obj->unpaid || (Has_contents(obj) && count_unpaid(obj->cobj))); @@ -1068,8 +1030,7 @@ struct obj *obj; /* Delete the contents of the given object. */ void -delete_contents(obj) -register struct obj *obj; +delete_contents(register struct obj *obj) { register struct obj *curr; @@ -1081,8 +1042,7 @@ register struct obj *obj; /* called with two args on merge */ void -obfree(obj, merge) -register struct obj *obj, *merge; +obfree(register struct obj *obj, register struct obj *merge) { register struct bill_x *bp; register struct bill_x *bpm; @@ -1173,9 +1133,7 @@ register struct obj *obj, *merge; } static long -check_credit(tmp, shkp) -long tmp; -register struct monst *shkp; +check_credit(long int tmp, register struct monst *shkp) { long credit = ESHK(shkp)->credit; @@ -1194,9 +1152,7 @@ register struct monst *shkp; } static void -pay(tmp, shkp) -long tmp; -register struct monst *shkp; +pay(long int tmp, register struct monst *shkp) { long robbed = ESHK(shkp)->robbed; long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp)); @@ -1214,9 +1170,7 @@ register struct monst *shkp; /* return shkp to home position */ void -home_shk(shkp, killkops) -register struct monst *shkp; -register boolean killkops; +home_shk(register struct monst *shkp, register boolean killkops) { register xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y; @@ -1234,7 +1188,7 @@ register boolean killkops; } static boolean -angry_shk_exists() +angry_shk_exists(void) { register struct monst *shkp; @@ -1246,8 +1200,7 @@ angry_shk_exists() /* remove previously applied surcharge from all billed items */ static void -pacify_shk(shkp) -register struct monst *shkp; +pacify_shk(register struct monst *shkp) { NOTANGRY(shkp) = TRUE; /* make peaceful */ if (ESHK(shkp)->surcharge) { @@ -1265,8 +1218,7 @@ register struct monst *shkp; /* add aggravation surcharge to all billed items */ static void -rile_shk(shkp) -register struct monst *shkp; +rile_shk(register struct monst *shkp) { NOTANGRY(shkp) = FALSE; /* make angry */ if (!ESHK(shkp)->surcharge) { @@ -1284,9 +1236,7 @@ register struct monst *shkp; /* wakeup and/or unparalyze shopkeeper */ static void -rouse_shk(shkp, verbosely) -struct monst *shkp; -boolean verbosely; +rouse_shk(struct monst *shkp, boolean verbosely) { if (!shkp->mcanmove || shkp->msleeping) { /* greed induced recovery... */ @@ -1300,9 +1250,7 @@ boolean verbosely; } void -make_happy_shk(shkp, silentkops) -register struct monst *shkp; -register boolean silentkops; +make_happy_shk(register struct monst *shkp, register boolean silentkops) { boolean wasmad = ANGRY(shkp); struct eshk *eshkp = ESHK(shkp); @@ -1343,8 +1291,7 @@ register boolean silentkops; /* called by make_happy_shk() and also by losedogs() for migrating shk */ void -make_happy_shoppers(silentkops) -boolean silentkops; +make_happy_shoppers(boolean silentkops) { if (!angry_shk_exists()) { kops_gone(silentkops); @@ -1353,8 +1300,7 @@ boolean silentkops; } void -hot_pursuit(shkp) -register struct monst *shkp; +hot_pursuit(register struct monst *shkp) { if (!shkp->isshk) return; @@ -1369,10 +1315,8 @@ register struct monst *shkp; * must be checked by the calling function. */ void -make_angry_shk(shkp, ox, oy) -struct monst *shkp; -xchar ox UNUSED; /* predate 'noit_Monnam()', let alone Shknam() */ -xchar oy UNUSED; +make_angry_shk(struct monst *shkp, xchar ox UNUSED, xchar oy UNUSED) +/* predate 'noit_Monnam()', let alone Shknam() */ { struct eshk *eshkp = ESHK(shkp); @@ -1395,8 +1339,7 @@ static const char not_enough_money[] = /* delivers the cheapest item on the list */ static long -cheapest_item(shkp) -register struct monst *shkp; +cheapest_item(register struct monst *shkp) { register int ct = ESHK(shkp)->billct; register struct bill_x *bp = ESHK(shkp)->bill_p; @@ -1411,7 +1354,7 @@ register struct monst *shkp; } int -dopay() +dopay(void) { register struct eshk *eshkp; register struct monst *shkp; @@ -1765,12 +1708,12 @@ dopay() /* -1 if skip this object */ /* -2 if no money/credit left */ static int -dopayobj(shkp, bp, obj_p, which, itemize) -register struct monst *shkp; -register struct bill_x *bp; -struct obj **obj_p; -int which; /* 0 => used-up item, 1 => other (unpaid or lost) */ -boolean itemize; +dopayobj(register struct monst *shkp, register struct bill_x *bp, struct obj **obj_p, int which, boolean itemize) + + + + /* 0 => used-up item, 1 => other (unpaid or lost) */ + { register struct obj *obj = *obj_p; long ltmp, quan, save_quan; @@ -1880,9 +1823,9 @@ static struct repo { /* repossession context */ /* routine called after dying (or quitting) */ boolean -paybill(croaked, silently) -int croaked; /* -1: escaped dungeon; 0: quit; 1: died */ -boolean silently; /* maybe avoid messages */ +paybill( + int croaked, /**< -1: escaped dungeon; 0: quit; 1: died */ + boolean silently) /**< maybe avoid messages */ { struct monst *mtmp, *mtmp2, *firstshk, *resident, *creditor, *hostile, *localshk; struct eshk *eshkp; @@ -1969,11 +1912,7 @@ boolean silently; /* maybe avoid messages */ } static boolean -inherits(shkp, numsk, croaked, silently) -struct monst *shkp; -int numsk; -int croaked; -boolean silently; +inherits(struct monst *shkp, int numsk, int croaked, boolean silently) { long loss = 0L; long umoney; @@ -2078,8 +2017,7 @@ boolean silently; } static void -set_repo_loc(shkp) -struct monst *shkp; +set_repo_loc(struct monst *shkp) { register xchar ox, oy; struct eshk *eshkp = ESHK(shkp); @@ -2109,7 +2047,7 @@ struct monst *shkp; /** Dump inventory to the floor, called at game exit, after inventory disclosure but * before making bones */ void -finish_paybill() +finish_paybill(void) { struct monst *shkp = repo.shopkeeper; int ox = repo.location.x; @@ -2137,8 +2075,7 @@ finish_paybill() /* find obj on one of the lists */ static struct obj * -bp_to_obj(bp) -register struct bill_x *bp; +bp_to_obj(register struct bill_x *bp) { register struct obj *obj; register unsigned int id = bp->bo_id; @@ -2156,8 +2093,7 @@ register struct bill_x *bp; * be any timeouts on the billobjs chain. */ struct obj * -find_oid(id) -unsigned id; +find_oid(unsigned int id) { struct obj *obj; struct monst *mon, *mmtmp[3]; @@ -2184,9 +2120,7 @@ unsigned id; /* decide whether to apply a surcharge (or hypothetically, a discount) to obj if it had ID number 'oid'; returns 1: increase, 0: normal, -1: decrease */ int -oid_price_adjustment(obj, oid) -struct obj *obj; -unsigned oid; +oid_price_adjustment(struct obj *obj, unsigned int oid) { int res = 0, otyp = obj->otyp; @@ -2200,8 +2134,7 @@ unsigned oid; /** Returns the price of an arbitrary item in the shop. * Returns 0 if the item doesn't belong to a shopkeeper or hero is not in the shop. */ long -get_cost_of_shop_item(obj) -register struct obj *obj; +get_cost_of_shop_item(register struct obj *obj) { struct monst *shkp; xchar x, y; @@ -2228,9 +2161,9 @@ register struct obj *obj; } /* calculate the value that the shk will charge for [one of] an object */ static long -get_cost(obj, shkp) -register struct obj *obj; -register struct monst *shkp; /* if angry, impose a surcharge */ +get_cost( + struct obj *obj, + struct monst *shkp) /**< if angry, impose a surcharge */ { register long tmp = getprice(obj, FALSE); @@ -2324,12 +2257,7 @@ register struct monst *shkp; /* if angry, impose a surcharge */ * a different price quoted for selling as vs. buying. */ long -contained_cost(obj, shkp, price, usell, unpaid_only) -struct obj *obj; -struct monst *shkp; -long price; -boolean usell; -boolean unpaid_only; +contained_cost(struct obj *obj, struct monst *shkp, long int price, boolean usell, boolean unpaid_only) { struct obj *otmp, *top; xchar x, y; @@ -2376,8 +2304,7 @@ boolean unpaid_only; /* count amount of gold inside container 'obj' and any nested containers */ long -contained_gold(obj) -struct obj *obj; +contained_gold(struct obj *obj) { register struct obj *otmp; register long value = 0L; @@ -2393,10 +2320,7 @@ struct obj *obj; } static void -dropped_container(obj, shkp, sale) -register struct obj *obj; -register struct monst *shkp; -register boolean sale; +dropped_container(register struct obj *obj, register struct monst *shkp, register boolean sale) { register struct obj *otmp; @@ -2413,8 +2337,7 @@ register boolean sale; } void -picked_container(obj) -register struct obj *obj; +picked_container(register struct obj *obj) { register struct obj *otmp; @@ -2432,10 +2355,7 @@ register struct obj *obj; /* calculate how much the shk will pay when buying [all of] an object */ static boolean -special_stock(obj, shkp, quietly) -struct obj *obj; -struct monst *shkp; -boolean quietly; +special_stock(struct obj *obj, struct monst *shkp, boolean quietly) { /* for unique situations */ if (ESHK(shkp)->shoptype == CANDLESHOP && obj->otyp == CANDELABRUM_OF_INVOCATION) { @@ -2471,9 +2391,7 @@ boolean quietly; /* calculate how much the shk will pay when buying [all of] an object */ static long -set_cost(obj, shkp) -register struct obj *obj; -register struct monst *shkp; +set_cost(register struct obj *obj, register struct monst *shkp) { long tmp = getprice(obj, TRUE) * obj->quan; @@ -2508,8 +2426,7 @@ register struct monst *shkp; /* unlike alter_cost() which operates on a specific item, identifying or forgetting a gem causes all unpaid gems of its type to change value */ void -gem_learned(oindx) -int oindx; +gem_learned(int oindx) { struct obj *obj; struct monst *shkp; @@ -2549,9 +2466,9 @@ int oindx; on any shop bill, update that bill to reflect the new higher price [if the new price drops for some reason, keep the old one in place] */ void -alter_cost(obj, amt) -struct obj *obj; -long amt; /* if 0, use regular shop pricing, otherwise force amount; +alter_cost(struct obj *obj, long int amt) + + /* if 0, use regular shop pricing, otherwise force amount; if negative, use abs(amt) even if it's less than old cost */ { struct bill_x *bp = 0; @@ -2572,9 +2489,9 @@ long amt; /* if 0, use regular shop pricing, otherwise force amount; /* called from doinv(invent.c) for inventory of unpaid objects */ long -unpaid_cost(unp_obj, include_contents) -struct obj *unp_obj; /* known to be unpaid or contain unpaid */ -boolean include_contents; +unpaid_cost(struct obj *unp_obj, boolean include_contents) + /* known to be unpaid or contain unpaid */ + { struct bill_x *bp = (struct bill_x *)0; struct monst *shkp; @@ -2610,10 +2527,7 @@ boolean include_contents; } static void -add_one_tobill(obj, dummy, shkp) -struct obj *obj; -boolean dummy; -struct monst *shkp; +add_one_tobill(struct obj *obj, boolean dummy, struct monst *shkp) { struct eshk *eshkp; struct bill_x *bp; @@ -2651,8 +2565,7 @@ struct monst *shkp; } static void -add_to_billobjs(obj) -struct obj *obj; +add_to_billobjs(struct obj *obj) { if (obj->where != OBJ_FREE) panic("add_to_billobjs: obj not free (%d,%d,%d)", obj->where, obj->otyp, obj->invlet); @@ -2666,10 +2579,7 @@ struct obj *obj; /* recursive billing of objects within containers. */ void -bill_box_content(obj, ininv, dummy, shkp) -struct obj *obj; -boolean ininv, dummy; -struct monst *shkp; +bill_box_content(struct obj *obj, boolean ininv, boolean dummy, struct monst *shkp) { struct obj *otmp; @@ -2693,12 +2603,12 @@ struct monst *shkp; /* shopkeeper tells you what you bought or sold, sometimes partly IDing it */ static void -shk_names_obj(shkp, obj, fmt, amt, arg) -struct monst *shkp; -struct obj *obj; -const char *fmt; /* "%s %ld %s %s", doname(obj), amt, plur(amt), arg */ -long amt; -const char *arg; +shk_names_obj(struct monst *shkp, struct obj *obj, const char *fmt, long int amt, const char *arg) + + + /* "%s %ld %s %s", doname(obj), amt, plur(amt), arg */ + + { char *obj_name, fmtbuf[BUFSZ]; boolean was_unknown = !obj->dknown; @@ -2729,11 +2639,11 @@ const char *arg; /* decide whether a shopkeeper thinks an item belongs to her */ boolean -billable(shkpp, obj, roomno, reset_nocharge) -struct monst **shkpp; /* in: non-null if shk has been validated; out: shk */ -struct obj *obj; -char roomno; -boolean reset_nocharge; +billable(struct monst **shkpp, struct obj *obj, char roomno, boolean reset_nocharge) + /* in: non-null if shk has been validated; out: shk */ + + + { struct monst *shkp = *shkpp; @@ -2772,9 +2682,7 @@ boolean reset_nocharge; } void -addtobill(obj, ininv, dummy, silent) -struct obj *obj; -boolean ininv, dummy, silent; +addtobill(struct obj *obj, boolean ininv, boolean dummy, boolean silent) { struct monst *shkp = NULL; long ltmp, cltmp, gltmp; @@ -2877,8 +2785,7 @@ boolean ininv, dummy, silent; } void -append_honorific(buf) -char *buf; +append_honorific(char *buf) { /* (chooses among [0]..[3] normally; [1]..[4] after the Wizard has been killed or invocation ritual performed) */ @@ -2897,8 +2804,7 @@ char *buf; } void -splitbill(obj, otmp) -register struct obj *obj, *otmp; +splitbill(register struct obj *obj, register struct obj *otmp) { /* otmp has been split off from obj */ register struct bill_x *bp; @@ -2935,9 +2841,7 @@ register struct obj *obj, *otmp; } static void -sub_one_frombill(obj, shkp) -register struct obj *obj; -register struct monst *shkp; +sub_one_frombill(register struct obj *obj, register struct monst *shkp) { register struct bill_x *bp; @@ -2977,9 +2881,7 @@ register struct monst *shkp; /* recursive check of unpaid objects within nested containers. */ void -subfrombill(obj, shkp) -register struct obj *obj; -register struct monst *shkp; +subfrombill(register struct obj *obj, register struct monst *shkp) { register struct obj *otmp; @@ -2997,11 +2899,7 @@ register struct monst *shkp; } static long -stolen_container(obj, shkp, price, ininv) -struct obj *obj; -struct monst *shkp; -long price; -boolean ininv; +stolen_container(struct obj *obj, struct monst *shkp, long int price, boolean ininv) { struct obj *otmp; struct bill_x *bp; @@ -3041,10 +2939,7 @@ boolean ininv; } long -stolen_value(obj, x, y, peaceful, silent) -register struct obj *obj; -register xchar x, y; -register boolean peaceful, silent; +stolen_value(register struct obj *obj, register xchar x, register xchar y, register boolean peaceful, register boolean silent) { long value = 0L, gvalue = 0L, billamt = 0L; char roomno = *in_rooms(x, y, SHOPBASE); @@ -3161,8 +3056,7 @@ static int sell_how = SELL_NORMAL; static boolean auto_credit = FALSE; void -sellobj_state(deliberate) -int deliberate; +sellobj_state(int deliberate) { /* If we're deliberately dropping something, there's no automatic response to the shopkeeper's "want to sell" query; however, if we @@ -3175,9 +3069,7 @@ int deliberate; auto_credit = FALSE; } void -sellobj(obj, x, y) -register struct obj *obj; -xchar x, y; +sellobj(register struct obj *obj, xchar x, xchar y) { register struct monst *shkp; struct eshk *eshkp; @@ -3447,8 +3339,8 @@ xchar x, y; } int -doinvbill(mode) -int mode; /* 0: deliver count 1: paged */ +doinvbill(int mode) + /* 0: deliver count 1: paged */ { #ifdef __SASC void sasc_bug(struct obj *, unsigned); @@ -3526,9 +3418,7 @@ int mode; /* 0: deliver count 1: paged */ } static long -getprice(obj, shk_buying) -register struct obj *obj; -boolean shk_buying; +getprice(register struct obj *obj, boolean shk_buying) { register long tmp = (long) objects[obj->otyp].oc_cost; @@ -3564,9 +3454,7 @@ boolean shk_buying; /* shk catches thrown pick-axe */ struct monst * -shkcatch(obj, x, y) -register struct obj *obj; -register xchar x, y; +shkcatch(register struct obj *obj, register xchar x, register xchar y) { register struct monst *shkp; @@ -3599,9 +3487,7 @@ register xchar x, y; } void -add_damage(x, y, cost) -register xchar x, y; -long cost; +add_damage(register xchar x, register xchar y, long int cost) { struct damage *tmp_dam; char *shops; @@ -3645,9 +3531,7 @@ long cost; * telling that. */ static void -remove_damage(shkp, croaked) -struct monst *shkp; -boolean croaked; +remove_damage(struct monst *shkp, boolean croaked) { struct damage *tmp_dam, *tmp2_dam; struct obj *shk_inv = shkp->minvent; @@ -3767,10 +3651,10 @@ boolean croaked; * 3: untrap */ int -repair_damage(shkp, tmp_dam, catchup) -struct monst *shkp; -struct damage *tmp_dam; -boolean catchup; /* restoring a level */ +repair_damage( + struct monst *shkp, + struct damage *tmp_dam, + boolean catchup) /**< restoring a level */ { xchar x, y; xchar litter[9]; @@ -3935,8 +3819,7 @@ boolean catchup; /* restoring a level */ * shk_move: return 1: moved 0: didn't -1: let m_move do it -2: died */ int -shk_move(shkp) -struct monst *shkp; +shk_move(struct monst *shkp) { xchar gx, gy, omx, omy; int udist; @@ -4055,8 +3938,7 @@ struct monst *shkp; /* called after shopkeeper moves, in case the move causes re-entry into shop */ void -after_shk_move(shkp) -struct monst *shkp; +after_shk_move(struct monst *shkp) { struct eshk *eshkp = ESHK(shkp); @@ -4069,16 +3951,14 @@ struct monst *shkp; /* for use in levl_follower (mondata.c) */ boolean -is_fshk(mtmp) -register struct monst *mtmp; +is_fshk(register struct monst *mtmp) { return((boolean)(mtmp->isshk && ESHK(mtmp)->following)); } /* You are digging in the shop. */ void -shopdig(fall) -register int fall; +shopdig(register int fall) { register struct monst *shkp = shop_keeper(*u.ushops); int lang; @@ -4177,8 +4057,7 @@ register int fall; /* modified by M. Campostrini (campo@sunthpi3.difi.unipi.it) */ /* to allow for multiple choices of kops */ static void -makekops(mm) -coord *mm; +makekops(coord *mm) { int kop_cnt[5]; int kop_pm[5]; @@ -4223,9 +4102,7 @@ coord *mm; #endif /* KOPS */ void -pay_for_damage(dmgstr, cant_mollify) -const char *dmgstr; -boolean cant_mollify; +pay_for_damage(const char *dmgstr, boolean cant_mollify) { register struct monst *shkp = (struct monst *)0; char shops_affected[5]; @@ -4415,8 +4292,7 @@ boolean cant_mollify; /* called in dokick.c when we kick an object that might be in a store */ boolean -costly_spot(x, y) -register xchar x, y; +costly_spot(register xchar x, register xchar y) { struct monst *shkp; @@ -4436,8 +4312,7 @@ register xchar x, y; /* called by dotalk(sounds.c) when #chatting; returns obj if location contains shop goods and shopkeeper is willing & able to speak */ struct obj * -shop_object(x, y) -register xchar x, y; +shop_object(register xchar x, register xchar y) { register struct obj *otmp; register struct monst *shkp; @@ -4456,8 +4331,7 @@ register xchar x, y; /* give price quotes for all objects linked to this one (ie, on this spot) */ void -price_quote(first_obj) -register struct obj *first_obj; +price_quote(register struct obj *first_obj) { register struct obj *otmp; char buf[BUFSZ], price[40]; @@ -4506,9 +4380,7 @@ register struct obj *first_obj; } static const char * -shk_embellish(itm, cost) -register struct obj *itm; -long cost; +shk_embellish(register struct obj *itm, long int cost) { if (!rn2(3)) { register int o, choice = rn2(5); @@ -4551,8 +4423,7 @@ const char *Izchak_speaks[]={ /** returns TRUE if shopkeeper has at least one leather jacket in his shop. */ boolean -shk_has_leather_jackets(shkp) -struct monst *shkp; +shk_has_leather_jackets(struct monst *shkp) { struct eshk *eshk = ESHK(shkp); struct mkroom *sroom = &rooms[eshk->shoproom - ROOMOFFSET]; @@ -4569,8 +4440,7 @@ struct monst *shkp; } void -shk_chat(shkp) -struct monst *shkp; +shk_chat(struct monst *shkp) { struct eshk *eshk; long shkmoney; @@ -4655,8 +4525,7 @@ struct monst *shkp; #ifdef KOPS static void -kops_gone(silent) -register boolean silent; +kops_gone(register boolean silent) { register int cnt = 0; register struct monst *mtmp, *mtmp2; @@ -4675,10 +4544,10 @@ register boolean silent; #endif /* KOPS */ static long -cost_per_charge(shkp, otmp, altusage) -struct monst *shkp; -struct obj *otmp; -boolean altusage; /* some items have an "alternate" use with different cost */ +cost_per_charge( + struct monst *shkp, + struct obj *otmp, + boolean altusage) /**< some items have an "alternate" use with different cost */ { long tmp = 0L; @@ -4733,9 +4602,7 @@ boolean altusage; /* some items have an "alternate" use with different cost */ * when an object is completely used. */ void -check_unpaid_usage(otmp, altusage) -struct obj *otmp; -boolean altusage; +check_unpaid_usage(struct obj *otmp, boolean altusage) { struct monst *shkp; const char *fmt, *arg1, *arg2; @@ -4782,16 +4649,13 @@ boolean altusage; /* for using charges of unpaid objects "used in the normal manner" */ void -check_unpaid(otmp) -struct obj *otmp; +check_unpaid(struct obj *otmp) { check_unpaid_usage(otmp, FALSE); /* normal item use */ } void -costly_gold(x, y, amount) -register xchar x, y; -register long amount; +costly_gold(register xchar x, register xchar y, register long int amount) { register long delta; register struct monst *shkp; @@ -4826,8 +4690,7 @@ register long amount; /* used in domove to block diagonal shop-exit */ /* x,y should always be a door */ boolean -block_door(x, y) -register xchar x, y; +block_door(register xchar x, register xchar y) { register int roomno = *in_rooms(x, y, SHOPBASE); register struct monst *shkp; @@ -4857,8 +4720,7 @@ register xchar x, y; /* used in domove to block diagonal shop-entry */ /* u.ux, u.uy should always be a door */ boolean -block_entry(x, y) -register xchar x, y; +block_entry(register xchar x, register xchar y) { register xchar sx, sy; register int roomno; @@ -4896,9 +4758,7 @@ register xchar x, y; /* "your" or "Foobar's" or "the" */ char * -shk_your(buf, obj) -char *buf; -struct obj *obj; +shk_your(char *buf, struct obj *obj) { if (!shk_owns(buf, obj) && !mon_owns(buf, obj)) Strcpy(buf, carried(obj) ? "your" : "the"); @@ -4906,9 +4766,7 @@ struct obj *obj; } char * -Shk_Your(buf, obj) -char *buf; -struct obj *obj; +Shk_Your(char *buf, struct obj *obj) { (void) shk_your(buf, obj); *buf = highc(*buf); @@ -4916,9 +4774,7 @@ struct obj *obj; } static char * -shk_owns(buf, obj) -char *buf; -struct obj *obj; +shk_owns(char *buf, struct obj *obj) { struct monst *shkp; xchar x, y; @@ -4933,9 +4789,7 @@ struct obj *obj; } static char * -mon_owns(buf, obj) -char *buf; -struct obj *obj; +mon_owns(char *buf, struct obj *obj) { if (obj->where == OBJ_MINVENT) return strcpy(buf, s_suffix(y_monnam(obj->ocarry))); @@ -4943,8 +4797,7 @@ struct obj *obj; } static const char * -cad(altusage) -boolean altusage; /* used as a verbalized exclamation: \"Cad! ...\" */ +cad(boolean altusage) /**< used as a verbalized exclamation: \"Cad! ...\" */ { const char *res = 0; @@ -4986,7 +4839,7 @@ sasc_bug(struct obj *op, unsigned x){ #endif void -sanity_check_shopkeepers() +sanity_check_shopkeepers(void) { struct monst *mtmp; diff --git a/src/shknam.c b/src/shknam.c index 8fcf02645..3da21367b 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -283,7 +283,7 @@ const struct shclass shtypes[] = { /* validate shop probabilities; otherwise incorrect local changes could end up provoking infinite loops or wild subscripts fetching garbage */ void -shop_selection_init() +shop_selection_init(void) { register int i, j, item_prob, shop_prob; @@ -347,9 +347,7 @@ mkshobj_at(const struct shclass *shp, int sx, int sy, int color) /* extract a shopkeeper name for the given shop type */ static void -nameshk(shk, nlp) -struct monst *shk; -const char * const *nlp; +nameshk(struct monst *shk, const char *const *nlp) { int i, trycnt, names_avail; const char *shname = 0; @@ -453,8 +451,7 @@ const char * const *nlp; } void -neweshk(mtmp) -struct monst *mtmp; +neweshk(struct monst *mtmp) { if (!mtmp->mextra) mtmp->mextra = newmextra(); @@ -465,8 +462,7 @@ struct monst *mtmp; } void -free_eshk(mtmp) -struct monst *mtmp; +free_eshk(struct monst *mtmp) { if (mtmp->mextra && ESHK(mtmp)) { free((genericptr_t) ESHK(mtmp)); @@ -477,9 +473,7 @@ struct monst *mtmp; /* create a new shopkeeper in the given room */ static int -shkinit(shp, sroom) -const struct shclass *shp; -struct mkroom *sroom; +shkinit(const struct shclass *shp, struct mkroom *sroom) { register int sh, sx, sy; struct monst *shk; @@ -639,9 +633,7 @@ struct mkroom *sroom; } static boolean -stock_room_goodpos(sroom, rmno, sh, sx, sy) -struct mkroom *sroom; -int rmno, sh, sx,sy; +stock_room_goodpos(struct mkroom *sroom, int rmno, int sh, int sx, int sy) { if (sroom->irregular) { if (levl[sx][sy].edge || @@ -660,9 +652,7 @@ int rmno, sh, sx,sy; /* stock a newly-created room with objects */ void -stock_room(shp_indx, sroom) -int shp_indx; -register struct mkroom *sroom; +stock_room(int shp_indx, register struct mkroom *sroom) { /* * Someday soon we'll dispatch on the shdist field of shclass to do @@ -755,10 +745,7 @@ register struct mkroom *sroom; #ifdef BLACKMARKET /* stock a newly-created black market with objects */ static void -stock_blkmar(shp, sroom, sh) -const struct shclass *shp UNUSED; -register struct mkroom *sroom; -register int sh; +stock_blkmar(const struct shclass *shp UNUSED, register struct mkroom *sroom, register int sh) { /* * Someday soon we'll dispatch on the shdist field of shclass to do @@ -836,9 +823,7 @@ register int sh; /* does shkp's shop stock this item type? */ boolean -saleable(shkp, obj) -struct monst *shkp; -struct obj *obj; +saleable(struct monst *shkp, struct obj *obj) { int i, shp_indx = ESHK(shkp)->shoptype - SHOPBASE; const struct shclass *shp = &shtypes[shp_indx]; @@ -854,8 +839,7 @@ struct obj *obj; /* positive value: class; negative value: specific object type */ int -get_shop_item(type) -int type; +get_shop_item(int type) { const struct shclass *shp = shtypes+type; register int i, j; @@ -869,8 +853,7 @@ int type; /* version of shkname() for beginning of sentence */ char * -Shknam(mtmp) -struct monst *mtmp; +Shknam(struct monst *mtmp) { char *nam = shkname(mtmp); @@ -883,8 +866,7 @@ struct monst *mtmp; will yield some other shopkeeper's name (not necessarily one residing in the current game's dungeon, or who keeps same type of shop) */ char * -shkname(mtmp) -struct monst *mtmp; +shkname(struct monst *mtmp) { char *nam; unsigned save_isshk = mtmp->isshk; @@ -932,8 +914,7 @@ struct monst *mtmp; } boolean -shkname_is_pname(mtmp) -struct monst *mtmp; +shkname_is_pname(struct monst *mtmp) { const char *shknm = ESHK(mtmp)->shknam; @@ -941,9 +922,7 @@ struct monst *mtmp; } boolean -is_izchak(shkp, override_hallucination) -struct monst *shkp; -boolean override_hallucination; +is_izchak(struct monst *shkp, boolean override_hallucination) { const char *shknm; diff --git a/src/sit.c b/src/sit.c index d6edd96b4..bee4067b2 100644 --- a/src/sit.c +++ b/src/sit.c @@ -8,7 +8,7 @@ static void curse_objects(struct obj *, int, boolean); /* take away the hero's money */ void -take_gold() +take_gold(void) { struct obj *otmp, *nobj; int lost_money = 0; @@ -30,7 +30,7 @@ take_gold() /* #sit command */ int -dosit() +dosit(void) { static const char sit_message[] = "sit on the %s."; int typ = levl[u.ux][u.uy].typ; @@ -328,8 +328,9 @@ dosit() return(1); } +/** curse a few inventory items at random! */ void -rndcurse() /* curse a few inventory items at random! */ +rndcurse(void) { struct obj *otmp; static const char mal_aura[] = "feel a malignant aura surround %s."; @@ -366,10 +367,7 @@ rndcurse() /* curse a few inventory items at random! */ } void -curse_objects(firstobj, ncurse, showmsg) -struct obj *firstobj; -int ncurse; -boolean showmsg; +curse_objects(struct obj *firstobj, int ncurse, boolean showmsg) { struct obj *otmp; int cnt, onum; @@ -417,7 +415,7 @@ boolean showmsg; /* remove a random INTRINSIC ability */ void -attrcurse() +attrcurse(void) { switch(rnd(11)) { case 1: if (HFire_resistance & INTRINSIC) { diff --git a/src/sounds.c b/src/sounds.c index cd24ff9f2..ab2fda116 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -10,15 +10,13 @@ #endif static int domonnoise(struct monst *); -static int dochat(); +static int dochat(void); static int mon_in_room(struct monst *, int); /* this easily could be a macro, but it might overtax dumb compilers */ static int -mon_in_room(mon, rmtyp) -struct monst *mon; -int rmtyp; +mon_in_room(struct monst *mon, int rmtyp) { int rno = levl[mon->mx][mon->my].roomno; if (rno >= ROOMOFFSET) { @@ -28,7 +26,7 @@ int rmtyp; } void -dosounds() +dosounds(void) { register struct mkroom *sroom; register int hallu, vx, vy; @@ -410,8 +408,7 @@ static const char * const h_sounds[] = { }; const char * -growl_sound(mtmp) -register struct monst *mtmp; +growl_sound(register struct monst *mtmp) { const char *ret; @@ -453,8 +450,7 @@ register struct monst *mtmp; /* the sounds of a seriously abused pet, including player attacking it */ void -growl(mtmp) -register struct monst *mtmp; +growl(register struct monst *mtmp) { register const char *growl_verb = 0; @@ -475,8 +471,7 @@ register struct monst *mtmp; /* the sounds of mistreated pets */ void -yelp(mtmp) -register struct monst *mtmp; +yelp(register struct monst *mtmp) { register const char *yelp_verb = 0; @@ -516,8 +511,7 @@ register struct monst *mtmp; /* the sounds of distressed pets */ void -whimper(mtmp) -register struct monst *mtmp; +whimper(register struct monst *mtmp) { register const char *whimper_verb = 0; @@ -548,8 +542,7 @@ register struct monst *mtmp; /* pet makes "I'm hungry" noises */ void -beg(mtmp) -register struct monst *mtmp; +beg(register struct monst *mtmp) { if (mtmp->msleeping || !mtmp->mcanmove || !(carnivorous(mtmp->data) || herbivorous(mtmp->data))) @@ -567,8 +560,7 @@ register struct monst *mtmp; /** return TRUE if mon is a gecko or seems to look like one (hallucination) */ static boolean -mon_is_gecko(mon) -struct monst *mon; +mon_is_gecko(struct monst *mon) { int glyph; @@ -588,8 +580,7 @@ struct monst *mon; } static int -domonnoise(mtmp) -register struct monst *mtmp; +domonnoise(register struct monst *mtmp) { const char *pline_msg = 0; /* Monnam(mtmp) will be prepended */ const char *verbl_msg = 0; /* verbalize() */ @@ -1103,7 +1094,7 @@ register struct monst *mtmp; int -dotalk() +dotalk(void) { int result; boolean save_soundok = flags.soundok; @@ -1114,7 +1105,7 @@ dotalk() } static int -dochat() +dochat(void) { struct monst *mtmp; int tx, ty; diff --git a/src/sp_lev.c b/src/sp_lev.c index 6a54d837b..ea2e6d164 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -29,17 +29,17 @@ extern void mkmap(lev_init *); static void get_room_loc(schar *, schar *, struct mkroom *); static void get_free_room_loc(schar *, schar *, struct mkroom *, packed_coord); static void create_trap(trap *, struct mkroom *); -static int noncoalignment(ALIGNTYP_P); +static int noncoalignment(aligntyp); static void create_monster(monster *, struct mkroom *); static void create_object(object *, struct mkroom *); static void create_altar(altar *, struct mkroom *); -static boolean search_door(struct mkroom *, xchar *, xchar *, XCHAR_P, int); -static void fix_stair_rooms(); +static boolean search_door(struct mkroom *, xchar *, xchar *, xchar, int); +static void fix_stair_rooms(void); static void create_corridor(corridor *); -static void count_features(); +static void count_features(void); -static boolean create_subroom(struct mkroom *, XCHAR_P, XCHAR_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P); +static boolean create_subroom(struct mkroom *, xchar, xchar, + xchar, xchar, xchar, xchar); long opvar_array_length(struct sp_coder *); @@ -74,9 +74,9 @@ static aligntyp ralign[3] = { AM_CHAOTIC, AM_NEUTRAL, AM_LAWFUL }; static NEARDATA xchar xstart, ystart; static NEARDATA char xsize, ysize; -static void set_wall_property(XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, int); -static int rnddoor(); -static int rndtrap(); +static void set_wall_property(xchar, xchar, xchar, xchar, int); +static int rnddoor(void); +static int rndtrap(void); static void get_location(schar *, schar *, int, struct mkroom *); static void light_region(region *); static void maze1xy(coord *, int); @@ -99,7 +99,7 @@ static struct monst *invent_carrying_monster = NULL; #define SPLEV_STACK_RESERVE 128 void -solidify_map() +solidify_map(void) { xchar x, y; @@ -113,8 +113,7 @@ solidify_map() } void -splev_stack_init(st) -struct splevstack *st; +splev_stack_init(struct splevstack *st) { if (st) { st->depth = 0; @@ -125,8 +124,7 @@ struct splevstack *st; } void -splev_stack_done(st) -struct splevstack *st; +splev_stack_done(struct splevstack *st) { if (st) { int i; @@ -163,9 +161,7 @@ struct splevstack *st; } void -splev_stack_push(st, v) -struct splevstack *st; -struct opvar *v; +splev_stack_push(struct splevstack *st, struct opvar *v) { if (!st || !v) return; if (!st->stackdata) panic("splev_stack_push: no stackdata allocated?"); @@ -184,8 +180,7 @@ struct opvar *v; } struct opvar * -splev_stack_pop(st) -struct splevstack *st; +splev_stack_pop(struct splevstack *st) { struct opvar *ret = NULL; @@ -202,8 +197,7 @@ struct splevstack *st; } struct splevstack * -splev_stack_reverse(st) -struct splevstack *st; +splev_stack_reverse(struct splevstack *st) { long i; struct opvar *tmp; @@ -231,8 +225,7 @@ struct splevstack *st; struct opvar * -opvar_new_str(s) -char *s; +opvar_new_str(char *s) { struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); if (!tmpov) panic("could not alloc opvar struct"); @@ -251,8 +244,7 @@ char *s; } struct opvar * -opvar_new_int(i) -long i; +opvar_new_int(long int i) { struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); if (!tmpov) panic("could not alloc opvar struct"); @@ -262,8 +254,7 @@ long i; } struct opvar * -opvar_new_coord(x, y) -int x, y; +opvar_new_coord(int x, int y) { struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); if (!tmpov) panic("could not alloc opvar struct"); @@ -273,8 +264,7 @@ int x, y; } struct opvar * -opvar_new_region(x1, y1, x2, y2) -int x1, y1, x2, y2; +opvar_new_region(int x1, int y1, int x2, int y2) { struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); if (!tmpov) panic("could not alloc opvar struct"); @@ -284,8 +274,7 @@ int x1, y1, x2, y2; } void -opvar_free_x(ov) -struct opvar *ov; +opvar_free_x(struct opvar *ov) { if (!ov) return; switch (ov->spovartyp) { @@ -326,8 +315,7 @@ struct opvar *ov; } while (0) struct opvar * -opvar_clone(ov) -struct opvar *ov; +opvar_clone(struct opvar *ov) { struct opvar *tmpov; @@ -356,9 +344,7 @@ struct opvar *ov; struct opvar * -opvar_var_conversion(coder, ov) -struct sp_coder *coder; -struct opvar *ov; +opvar_var_conversion(struct sp_coder *coder, struct opvar *ov) { struct splev_var *tmp; struct opvar *tmpov; @@ -389,9 +375,7 @@ struct opvar *ov; } struct splev_var * -opvar_var_defined(coder, name) -struct sp_coder *coder; -char *name; +opvar_var_defined(struct sp_coder *coder, char *name) { struct splev_var *tmp; @@ -405,9 +389,7 @@ char *name; } struct opvar * -splev_stack_getdat(coder, typ) -struct sp_coder *coder; -xchar typ; +splev_stack_getdat(struct sp_coder *coder, xchar typ) { if (coder && coder->stack) { struct opvar *tmp = splev_stack_pop(coder->stack); @@ -431,8 +413,7 @@ xchar typ; } struct opvar * -splev_stack_getdat_any(coder) -struct sp_coder *coder; +splev_stack_getdat_any(struct sp_coder *coder) { if (coder && coder->stack) { struct opvar *tmp = splev_stack_pop(coder->stack); @@ -447,8 +428,7 @@ struct sp_coder *coder; } void -variable_list_del(varlist) -struct splev_var *varlist; +variable_list_del(struct splev_var *varlist) { struct splev_var *tmp = varlist; @@ -472,9 +452,7 @@ struct splev_var *varlist; } void -lvlfill_maze_grid(x1, y1, x2, y2, filling) -int x1, y1, x2, y2; -schar filling; +lvlfill_maze_grid(int x1, int y1, int x2, int y2, schar filling) { int x, y; @@ -490,9 +468,7 @@ schar filling; } void -lvlfill_solid(filling, lit) -schar filling; -schar lit; +lvlfill_solid(schar filling, schar lit) { int x, y; @@ -502,8 +478,7 @@ schar lit; } } -void flip_drawbridge_horizontal(lev) -struct rm *lev; +void flip_drawbridge_horizontal(struct rm *lev) { if (IS_DRAWBRIDGE(lev->typ)) { if ((lev->drawbridgemask & DB_DIR) == DB_WEST) { @@ -516,8 +491,7 @@ struct rm *lev; } } -void flip_drawbridge_vertical(lev) -struct rm *lev; +void flip_drawbridge_vertical(struct rm *lev) { if (IS_DRAWBRIDGE(lev->typ)) { if ((lev->drawbridgemask & DB_DIR) == DB_NORTH) { @@ -886,9 +860,7 @@ flip_level_rnd(int flp) * Make walls of the area (x1, y1, x2, y2) non diggable/non passwall-able */ static void -set_wall_property(x1, y1, x2, y2, prop) -xchar x1, y1, x2, y2; -int prop; +set_wall_property(xchar x1, xchar y1, xchar x2, xchar y2, int prop) { register xchar x, y; struct rm *lev; @@ -911,7 +883,7 @@ int prop; } static void -shuffle_alignments() +shuffle_alignments(void) { int i; aligntyp atmp; @@ -924,7 +896,7 @@ shuffle_alignments() * Count the different features (sinks, fountains) in the level. */ static void -count_features() +count_features(void) { xchar x, y; @@ -940,7 +912,7 @@ count_features() } void -remove_boundary_syms() +remove_boundary_syms(void) { /* * If any CROSSWALLs are found, must change to ROOM after REGION's @@ -966,8 +938,7 @@ remove_boundary_syms() } /* used by sel_set_door() and link_doors_rooms() */ static void -set_door_orientation(x, y) -int x, y; +set_door_orientation(int x, int y) { boolean wleft, wright, wup, wdown; @@ -1013,9 +984,7 @@ int x, y; } static void -maybe_add_door(x, y, droom) -int x, y; -struct mkroom *droom; +maybe_add_door(int x, int y, struct mkroom *droom) { if (droom->hx >= 0 && doorindex < DOORMAX && inside_room(droom, x, y)) { int i; @@ -1029,7 +998,7 @@ struct mkroom *droom; } static void -link_doors_rooms() +link_doors_rooms(void) { int x, y; int tmpi, m; @@ -1054,7 +1023,7 @@ link_doors_rooms() } void -fill_rooms() +fill_rooms(void) { int tmpi; @@ -1072,7 +1041,7 @@ fill_rooms() * Choose randomly the state (nodoor, open, closed or locked) for a door */ static int -rnddoor() +rnddoor(void) { int i = 1 << rn2(5); @@ -1084,7 +1053,7 @@ rnddoor() * Select a random trap */ static int -rndtrap() +rndtrap(void) { int rtrap; @@ -1115,13 +1084,10 @@ rndtrap() * The "humidity" flag is used to insure that engravings aren't * created underwater, or eels on dry land. */ -static boolean is_ok_location(SCHAR_P, SCHAR_P, int); +static boolean is_ok_location(schar, schar, int); static void -get_location(x, y, humidity, croom) -schar *x, *y; -int humidity; -struct mkroom *croom; +get_location(schar *x, schar *y, int humidity, struct mkroom *croom) { int cpt = 0; int mx, my, sx, sy; @@ -1184,9 +1150,7 @@ found_it:; } static boolean -is_ok_location(x, y, humidity) -register schar x, y; -register int humidity; +is_ok_location(register schar x, register schar y, register int humidity) { register int typ; @@ -1211,9 +1175,7 @@ register int humidity; } unpacked_coord -get_unpacked_coord(loc, defhumidity) -long loc; -int defhumidity; +get_unpacked_coord(long int loc, int defhumidity) { static unpacked_coord c; @@ -1232,11 +1194,7 @@ int defhumidity; } static void -get_location_coord(x, y, humidity, croom, crd) -schar *x, *y; -int humidity; -struct mkroom *croom; -long crd; +get_location_coord(schar *x, schar *y, int humidity, struct mkroom *croom, long int crd) { unpacked_coord c; @@ -1255,9 +1213,7 @@ long crd; */ static void -get_room_loc(x, y, croom) -schar *x, *y; -struct mkroom *croom; +get_room_loc(schar *x, schar *y, struct mkroom *croom) { coord c; @@ -1283,10 +1239,7 @@ struct mkroom *croom; */ static void -get_free_room_loc(x, y, croom, pos) -schar *x, *y; -struct mkroom *croom; -packed_coord pos; +get_free_room_loc(schar *x, schar *y, struct mkroom *croom, long int pos) { schar try_x, try_y; register int trycnt = 0; @@ -1305,9 +1258,7 @@ packed_coord pos; } boolean -check_room(lowx, ddx, lowy, ddy, vault) -xchar *lowx, *ddx, *lowy, *ddy; -boolean vault; +check_room(xchar *lowx, xchar *ddx, xchar *lowy, xchar *ddy, boolean vault) { register int x, y, hix = *lowx + *ddx, hiy = *lowy + *ddy; register struct rm *lev; @@ -1373,11 +1324,7 @@ boolean vault; * This is still very incomplete... */ boolean -create_room(x, y, w, h, xal, yal, rtype, rlit) -xchar x, y; -xchar w, h; -xchar xal, yal; -xchar rtype, rlit; +create_room(xchar x, xchar y, xchar w, xchar h, xchar xal, xchar yal, xchar rtype, xchar rlit) { xchar xabs, yabs; int wtmp, htmp, xaltmp, yaltmp, xtmp, ytmp; @@ -1551,11 +1498,7 @@ xchar rtype, rlit; * x & y are relative to the parent room. */ static boolean -create_subroom(proom, x, y, w, h, rtype, rlit) -struct mkroom *proom; -xchar x, y; -xchar w, h; -xchar rtype, rlit; +create_subroom(struct mkroom *proom, xchar x, xchar y, xchar w, xchar h, xchar rtype, xchar rlit) { xchar width, height; @@ -1599,9 +1542,7 @@ xchar rtype, rlit; * It's placed on a wall (north, south, east or west). */ static void -create_door(dd, broom) -room_door *dd; -struct mkroom *broom; +create_door(room_door *dd, struct mkroom *broom) { int x = 0, y = 0; int trycnt = 0, wtry = 0; @@ -1690,9 +1631,9 @@ redoloop:; * Create a secret door in croom on any one of the specified walls. */ void -create_secret_door(croom, walls) -struct mkroom *croom; -xchar walls; /* any of W_NORTH | W_SOUTH | W_EAST | W_WEST (or W_ANY) */ +create_secret_door( + struct mkroom *croom, + xchar walls) /**< any of W_NORTH | W_SOUTH | W_EAST | W_WEST (or W_ANY) */ { xchar sx, sy; /* location of the secret door */ int count; @@ -1731,9 +1672,7 @@ xchar walls; /* any of W_NORTH | W_SOUTH | W_EAST | W_WEST (or W_ANY) */ * Create a trap in a room. */ static void -create_trap(t, croom) -trap *t; -struct mkroom *croom; +create_trap(trap *t, struct mkroom *croom) { schar x = -1, y = -1; coord tm; @@ -1755,9 +1694,7 @@ struct mkroom *croom; } static void -spill_terrain(sp, croom) -spill* sp; -struct mkroom* croom; +spill_terrain(spill *sp, struct mkroom *croom) { schar x, y, nx, ny, qx, qy; int j, k, lastdir, guard; @@ -1836,8 +1773,7 @@ struct mkroom* croom; * Create a monster in a room. */ static int -noncoalignment(alignment) -aligntyp alignment; +noncoalignment(aligntyp alignment) { int k; @@ -1849,8 +1785,7 @@ aligntyp alignment; /* attempt to screen out locations where a mimic-as-boulder shouldn't occur */ static boolean -m_bad_boulder_spot(x, y) -int x, y; +m_bad_boulder_spot(int x, int y) { struct rm *lev; @@ -1873,8 +1808,7 @@ int x, y; } static int -pm_to_humidity(pm) -struct permonst *pm; +pm_to_humidity(struct permonst *pm) { int loc = DRY; if (!pm) { @@ -1896,9 +1830,7 @@ struct permonst *pm; } static void -create_monster(m, croom) -monster *m; -struct mkroom *croom; +create_monster(monster *m, struct mkroom *croom) { struct monst *mtmp; schar x, y; @@ -2145,9 +2077,7 @@ struct mkroom *croom; * Create an object in a room. */ static void -create_object(o, croom) -object *o; -struct mkroom *croom; +create_object(object *o, struct mkroom *croom) { struct obj *otmp; schar x, y; @@ -2383,9 +2313,7 @@ struct mkroom *croom; * Create an altar in a room. */ static void -create_altar(a, croom) -altar *a; -struct mkroom *croom; +create_altar(altar *a, struct mkroom *croom) { schar sproom, x = -1, y = -1; aligntyp amask; @@ -2439,9 +2367,7 @@ struct mkroom *croom; } void -replace_terrain(terr, croom) -replaceterrain *terr; -struct mkroom *croom; +replace_terrain(replaceterrain *terr, struct mkroom *croom) { schar x, y, x1, y1, x2, y2; @@ -2465,11 +2391,7 @@ struct mkroom *croom; * Search for a door in a room on a specified wall. */ static boolean -search_door(croom, x, y, wall, cnt) -struct mkroom *croom; -xchar *x, *y; -xchar wall; -int cnt; +search_door(struct mkroom *croom, xchar *x, xchar *y, xchar wall, int cnt) { int dx, dy; int xx, yy; @@ -2517,10 +2439,7 @@ int cnt; * Dig a corridor between two points. */ boolean -dig_corridor(org, dest, nxcor, ftyp, btyp) -coord *org, *dest; -boolean nxcor; -schar ftyp, btyp; +dig_corridor(coord *org, coord *dest, boolean nxcor, schar ftyp, schar btyp) { int dx=0, dy=0, dix, diy, cct; struct rm *crm; @@ -2635,7 +2554,7 @@ schar ftyp, btyp; * stairs don't get created until _after_ sorting takes place. */ static void -fix_stair_rooms() +fix_stair_rooms(void) { int i; struct mkroom *croom; @@ -2676,8 +2595,7 @@ fix_stair_rooms() * (from a distance). */ static void -create_corridor(c) -corridor *c; +create_corridor(corridor *c) { coord org, dest; @@ -2716,9 +2634,7 @@ corridor *c; * Fill a room (shop, zoo, etc...) with appropriate stuff. */ void -fill_room(croom, prefilled) -struct mkroom *croom; -boolean prefilled; +fill_room(struct mkroom *croom, boolean prefilled) { if (!croom || croom->rtype == OROOM) return; @@ -2788,9 +2704,7 @@ boolean prefilled; } static struct mkroom * -build_room(r, mkr) -room *r; -struct mkroom *mkr; +build_room(room *r, struct mkroom *mkr) { boolean okroom; struct mkroom *aroom; @@ -2823,8 +2737,7 @@ struct mkroom *mkr; * set lighting in a region that will not become a room. */ static void -light_region(tmpregion) -region *tmpregion; +light_region(region *tmpregion) { register boolean litstate = tmpregion->rlit ? 1 : 0; register int hiy = tmpregion->y2; @@ -2851,8 +2764,7 @@ region *tmpregion; } void -wallify_map(x1, y1, x2, y2) -int x1, y1, x2, y2; +wallify_map(int x1, int y1, int x2, int y2) { int x, y, xx, yy, lo_xx, lo_yy, hi_xx, hi_yy; @@ -2886,9 +2798,7 @@ int x1, y1, x2, y2; * the maze outside every part of the special level. */ static void -maze1xy(m, humidity) -coord *m; -int humidity; +maze1xy(coord *m, int humidity) { register int x, y, tryct = 2000; /* tryct: normally it won't take more than ten or so tries due @@ -2913,7 +2823,7 @@ int humidity; * to the size of the maze. */ static void -fill_empty_maze() +fill_empty_maze(void) { int mapcountmax, mapcount, mapfact; xchar x, y; @@ -2968,9 +2878,7 @@ fill_empty_maze() * special level loader */ static boolean -sp_level_loader(fd, lvl) -dlb *fd; -sp_lev *lvl; +sp_level_loader(dlb *fd, sp_lev *lvl) { long n_opcode = 0; struct opvar *opdat; @@ -3039,8 +2947,7 @@ sp_lev *lvl; /* Frees the memory allocated for special level creation structs */ static boolean -sp_level_free(lvl) -sp_lev *lvl; +sp_level_free(sp_lev *lvl) { long n_opcode = 0; @@ -3060,8 +2967,7 @@ sp_lev *lvl; } void -splev_initlev(linit) -lev_init *linit; +splev_initlev(lev_init *linit) { switch (linit->init_style) { default: impossible("Unrecognized level init style."); break; @@ -3091,8 +2997,7 @@ lev_init *linit; } struct sp_frame * -frame_new(execptr) -long execptr; +frame_new(long int execptr) { struct sp_frame *frame = (struct sp_frame *)alloc(sizeof(struct sp_frame)); if (!frame) panic("could not create execution frame."); @@ -3107,8 +3012,7 @@ long execptr; } void -frame_del(frame) -struct sp_frame *frame; +frame_del(struct sp_frame *frame) { if (!frame) return; if (frame->stack) { @@ -3123,9 +3027,7 @@ struct sp_frame *frame; } void -spo_corefunc(coder, fn) -struct sp_coder *coder; -long fn; +spo_corefunc(struct sp_coder *coder, long int fn) { struct opvar *i; struct opvar *s; @@ -3290,8 +3192,7 @@ long fn; } void -spo_frame_push(coder) -struct sp_coder *coder; +spo_frame_push(struct sp_coder *coder) { struct sp_frame *tmpframe = frame_new(coder->frame->n_opcode); @@ -3300,8 +3201,7 @@ struct sp_coder *coder; } void -spo_frame_pop(coder) -struct sp_coder *coder; +spo_frame_pop(struct sp_coder *coder) { if (coder->frame && coder->frame->next) { struct sp_frame *tmpframe = coder->frame->next; @@ -3313,15 +3213,13 @@ struct sp_coder *coder; } long -sp_code_jmpaddr(curpos, jmpaddr) -long curpos, jmpaddr; +sp_code_jmpaddr(long int curpos, long int jmpaddr) { return (curpos + jmpaddr); } void -spo_call(coder) -struct sp_coder *coder; +spo_call(struct sp_coder *coder) { struct opvar *addr; struct opvar *params; @@ -3346,8 +3244,7 @@ struct sp_coder *coder; } void -spo_return(coder) -struct sp_coder *coder; +spo_return(struct sp_coder *coder) { struct opvar *params; @@ -3371,8 +3268,7 @@ struct sp_coder *coder; } void -spo_end_moninvent(coder) -struct sp_coder *coder UNUSED; +spo_end_moninvent(struct sp_coder *coder UNUSED) { if (invent_carrying_monster) m_dowear(invent_carrying_monster, TRUE); @@ -3380,8 +3276,7 @@ struct sp_coder *coder UNUSED; } void -spo_pop_container(coder) -struct sp_coder *coder UNUSED; +spo_pop_container(struct sp_coder *coder UNUSED) { if (container_idx > 0) { container_idx--; @@ -3391,8 +3286,7 @@ struct sp_coder *coder UNUSED; void -spo_message(coder) -struct sp_coder *coder; +spo_message(struct sp_coder *coder) { struct opvar *op; char *msg, *levmsg; @@ -3419,8 +3313,7 @@ struct sp_coder *coder; } void -spo_monster(coder) -struct sp_coder *coder; +spo_monster(struct sp_coder *coder) { int nparams = 0; @@ -3566,8 +3459,7 @@ struct sp_coder *coder; } void -spo_object(coder) -struct sp_coder *coder; +spo_object(struct sp_coder *coder) { int nparams = 0; long quancnt; @@ -3720,8 +3612,7 @@ struct sp_coder *coder; } void -spo_level_flags(coder) -struct sp_coder *coder; +spo_level_flags(struct sp_coder *coder) { struct opvar *flagdata; long flags; @@ -3752,8 +3643,7 @@ struct sp_coder *coder; } void -spo_initlevel(coder) -struct sp_coder *coder; +spo_initlevel(struct sp_coder *coder) { lev_init init_lev; struct opvar *init_style, *fg, *bg, *smoothed, *joined, *lit, *walled, *filling; @@ -3793,8 +3683,7 @@ struct sp_coder *coder; } void -spo_mon_generation(coder) -struct sp_coder *coder; +spo_mon_generation(struct sp_coder *coder) { struct opvar *freq, *n_tuples; struct mon_gen_override *mg; @@ -3842,8 +3731,7 @@ struct sp_coder *coder; } void -spo_level_sounds(coder) -struct sp_coder *coder; +spo_level_sounds(struct sp_coder *coder) { struct opvar *freq, *n_tuples; struct lvl_sounds *mg; @@ -3889,8 +3777,7 @@ struct sp_coder *coder; } void -spo_engraving(coder) -struct sp_coder *coder; +spo_engraving(struct sp_coder *coder) { struct opvar *etyp, *txt, *coord; xchar x, y; @@ -3908,8 +3795,7 @@ struct sp_coder *coder; } void -spo_mineralize(coder) -struct sp_coder *coder; +spo_mineralize(struct sp_coder *coder) { struct opvar *kelp_pool, *kelp_moat, *gold_prob, *gem_prob; @@ -3927,8 +3813,7 @@ struct sp_coder *coder; } void -spo_room(coder) -struct sp_coder *coder; +spo_room(struct sp_coder *coder) { int isbigrm = FALSE; if (coder->n_subroom > MAX_NESTED_ROOMS) @@ -3995,8 +3880,7 @@ struct sp_coder *coder; } void -spo_endroom(coder) -struct sp_coder *coder; +spo_endroom(struct sp_coder *coder) { if (coder->n_subroom > 1) { coder->n_subroom--; @@ -4018,8 +3902,7 @@ struct sp_coder *coder; } void -spo_stair(coder) -struct sp_coder *coder; +spo_stair(struct sp_coder *coder) { xchar x, y; struct opvar *up, *coord; @@ -4040,8 +3923,7 @@ struct sp_coder *coder; } void -spo_ladder(coder) -struct sp_coder *coder; +spo_ladder(struct sp_coder *coder) { xchar x, y; struct opvar *up, *coord; @@ -4065,8 +3947,7 @@ struct sp_coder *coder; } void -spo_grave(coder) -struct sp_coder *coder; +spo_grave(struct sp_coder *coder) { struct opvar *coord, *typ, *txt; schar x, y; @@ -4091,8 +3972,7 @@ struct sp_coder *coder; } void -spo_altar(coder) -struct sp_coder *coder; +spo_altar(struct sp_coder *coder) { struct opvar *al, *shrine, *coord; altar tmpaltar; @@ -4113,8 +3993,7 @@ struct sp_coder *coder; } void -spo_wallwalk(coder) -struct sp_coder *coder; +spo_wallwalk(struct sp_coder *coder) { struct opvar *coord, *fgtyp, *bgtyp, *chance; xchar x, y; @@ -4138,8 +4017,7 @@ struct sp_coder *coder; } void -spo_trap(coder) -struct sp_coder *coder; +spo_trap(struct sp_coder *coder) { struct opvar *type; struct opvar *coord; @@ -4157,8 +4035,7 @@ struct sp_coder *coder; } void -spo_gold(coder) -struct sp_coder *coder; +spo_gold(struct sp_coder *coder) { struct opvar *coord, *amt; schar x, y; @@ -4175,8 +4052,7 @@ struct sp_coder *coder; } void -spo_corridor(coder) -struct sp_coder *coder; +spo_corridor(struct sp_coder *coder) { struct opvar *deswall, *desdoor, *desroom, *srcwall, *srcdoor, *srcroom; @@ -4207,8 +4083,7 @@ struct sp_coder *coder; } struct opvar * -selection_opvar(nbuf) -char *nbuf; +selection_opvar(char *nbuf) { struct opvar *ov; char buf[(COLNO*ROWNO)+1]; @@ -4225,9 +4100,7 @@ char *nbuf; } xchar -selection_getpoint(x, y, ov) -int x, y; -struct opvar *ov; +selection_getpoint(int x, int y, struct opvar *ov) { if (!ov || ov->spovartyp != SPOVAR_SEL) return 0; if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO) return 0; @@ -4236,10 +4109,7 @@ struct opvar *ov; } void -selection_setpoint(x, y, ov, c) -int x, y; -struct opvar *ov; -char c; +selection_setpoint(int x, int y, struct opvar *ov, char c) { if (!ov || ov->spovartyp != SPOVAR_SEL) return; if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO) return; @@ -4248,8 +4118,7 @@ char c; } struct opvar * -selection_not(s) -struct opvar *s; +selection_not(struct opvar *s) { struct opvar *ov; int x, y; @@ -4266,9 +4135,7 @@ struct opvar *s; } struct opvar * -selection_logical_oper(s1, s2, oper) -struct opvar *s1, *s2; -char oper; +selection_logical_oper(struct opvar *s1, struct opvar *s2, char oper) { struct opvar *ov; int x, y; @@ -4295,9 +4162,7 @@ char oper; } struct opvar * -selection_filter_mapchar(ov, mc) -struct opvar *ov; -struct opvar *mc; +selection_filter_mapchar(struct opvar *ov, struct opvar *mc) { int x, y; schar mapc; @@ -4324,9 +4189,7 @@ struct opvar *mc; void -selection_filter_percent(ov, percent) -struct opvar *ov; -int percent; +selection_filter_percent(struct opvar *ov, int percent) { int x, y; @@ -4338,10 +4201,7 @@ int percent; } static int -selection_rndcoord(ov, x, y, removeit) -struct opvar *ov; -schar *x, *y; -boolean removeit; +selection_rndcoord(struct opvar *ov, schar *x, schar *y, boolean removeit) { int idx = 0; int c; @@ -4372,9 +4232,7 @@ boolean removeit; } void -selection_do_grow(ov, dir) -struct opvar *ov; -int dir; +selection_do_grow(struct opvar *ov, int dir) { int x, y, c; char tmp[COLNO][ROWNO]; @@ -4407,22 +4265,19 @@ static int (*selection_flood_check_func)(int, int); static schar floodfillchk_match_under_typ; void -set_selection_floodfillchk(f) -int (*f)(int, int); +set_selection_floodfillchk(int (*f) (int, int)) { selection_flood_check_func = f; } static int -floodfillchk_match_under(x,y) -int x,y; +floodfillchk_match_under(int x, int y) { return (floodfillchk_match_under_typ == levl[x][y].typ); } static int -floodfillchk_match_accessible(x, y) -int x, y; +floodfillchk_match_accessible(int x, int y) { return (ACCESSIBLE(levl[x][y].typ) || levl[x][y].typ == SDOOR || @@ -4431,10 +4286,7 @@ int x, y; /* check whethere is already in xs[],ys[] */ static boolean -sel_flood_havepoint(x, y, xs, ys, n) -int x, y; -xchar xs[], ys[]; -int n; +sel_flood_havepoint(int x, int y, xchar *xs, xchar *ys, int n) { xchar xx = (xchar) x, yy = (xchar) y; @@ -4448,10 +4300,7 @@ int n; } void -selection_floodfill(ov, x, y, diagonals) -struct opvar *ov; -int x, y; -boolean diagonals; +selection_floodfill(struct opvar *ov, int x, int y, boolean diagonals) { struct opvar *tmp = selection_opvar(NULL); #define SEL_FLOOD_STACK (COLNO*ROWNO) @@ -4513,9 +4362,7 @@ boolean diagonals; /* McIlroy's Ellipse Algorithm */ void -selection_do_ellipse(ov, xc, yc, a, b, filled) -struct opvar *ov; -int xc, yc, a, b, filled; +selection_do_ellipse(struct opvar *ov, int xc, int yc, int a, int b, int filled) { /* e(x,y) = b^2*x^2 + a^2*y^2 - a^2*b^2 */ int x = 0, y = b; @@ -4577,8 +4424,7 @@ int xc, yc, a, b, filled; /* distance from line segment (x1,y1, x2,y2) to point (x3,y3) */ long -line_dist_coord(x1, y1, x2, y2, x3, y3) -long x1, y1, x2, y2, x3, y3; +line_dist_coord(long int x1, long int y1, long int x2, long int y2, long int x3, long int y3) { long px = x2-x1; long py = y2-y1; @@ -4601,9 +4447,7 @@ long x1, y1, x2, y2, x3, y3; } void -selection_do_gradient(ov, x, y, x2, y2, gtyp, mind, maxd, limit) -struct opvar *ov; -long x, y, x2, y2, gtyp, mind, maxd, limit; +selection_do_gradient(struct opvar *ov, long int x, long int y, long int x2, long int y2, long int gtyp, long int mind, long int maxd, long int limit) { long dx, dy, dofs; @@ -4653,9 +4497,7 @@ long x, y, x2, y2, gtyp, mind, maxd, limit; /* bresenham line algo */ void -selection_do_line(x1, y1, x2, y2, ov) -schar x1, y1, x2, y2; -struct opvar *ov; +selection_do_line(schar x1, schar y1, schar x2, schar y2, struct opvar *ov) { int d, dx, dy, ai, bi, xi, yi; @@ -4705,9 +4547,7 @@ struct opvar *ov; } void -selection_do_randline(x1, y1, x2, y2, rough, rec, ov) -schar x1, y1, x2, y2, rough, rec; -struct opvar *ov; +selection_do_randline(schar x1, schar y1, schar x2, schar y2, schar rough, schar rec, struct opvar *ov) { int mx, my; int dx, dy; @@ -4747,10 +4587,7 @@ struct opvar *ov; } void -selection_iterate(ov, func, arg) -struct opvar *ov; -void (*func)(int, int, genericptr_t); -genericptr_t arg; +selection_iterate(struct opvar *ov, void (*func) (int, int, genericptr_t), genericptr_t arg) { int x, y; /* yes, this is very naive, but it's not _that_ expensive. */ @@ -4760,9 +4597,7 @@ genericptr_t arg; } void -sel_set_ter(x, y, arg) -int x, y; -genericptr_t arg; +sel_set_ter(int x, int y, genericptr_t arg) { if (levl[x][y].typ == STAIRS) { return; @@ -4782,18 +4617,14 @@ genericptr_t arg; } void -sel_set_feature(x, y, arg) -int x, y; -genericptr_t arg; +sel_set_feature(int x, int y, genericptr_t arg) { if (IS_FURNITURE(levl[x][y].typ)) return; levl[x][y].typ = (*(int *)arg); } void -sel_set_door(dx, dy, arg) -int dx, dy; -genericptr_t arg; +sel_set_door(int dx, int dy, genericptr_t arg) { xchar typ = (*(xchar *)arg); xchar x = dx; @@ -4814,8 +4645,7 @@ genericptr_t arg; } void -spo_door(coder) -struct sp_coder *coder; +spo_door(struct sp_coder *coder) { struct opvar *msk, *sel; xchar typ; @@ -4832,8 +4662,7 @@ struct sp_coder *coder; } void -spo_feature(coder) -struct sp_coder *coder; +spo_feature(struct sp_coder *coder) { struct opvar *sel; int typ; @@ -4851,8 +4680,7 @@ struct sp_coder *coder; } void -spo_terrain(coder) -struct sp_coder *coder; +spo_terrain(struct sp_coder *coder) { terrain tmpterrain; struct opvar *ter, *sel; @@ -4869,8 +4697,7 @@ struct sp_coder *coder; } void -spo_replace_terrain(coder) -struct sp_coder *coder; +spo_replace_terrain(struct sp_coder *coder) { replaceterrain rt; struct opvar *reg, *from_ter, *to_ter, *chance; @@ -4899,9 +4726,7 @@ struct sp_coder *coder; } static boolean -generate_way_out_method(nx,ny, ov) -int nx,ny; -struct opvar *ov; +generate_way_out_method(int nx, int ny, struct opvar *ov) { const int escapeitems[] = { PICK_AXE, @@ -4976,7 +4801,7 @@ struct opvar *ov; } static void -ensure_way_out() +ensure_way_out(void) { struct opvar *ov = selection_opvar((char *) 0); struct trap *ttmp = ftrap; @@ -5025,8 +4850,7 @@ ensure_way_out() } void -spo_spill(coder) -struct sp_coder *coder; +spo_spill(struct sp_coder *coder) { spill sp; struct opvar *coord, *typ, *dir, *count; @@ -5057,8 +4881,7 @@ struct sp_coder *coder; } void -spo_levregion(coder) -struct sp_coder *coder; +spo_levregion(struct sp_coder *coder) { struct opvar *rname, *padding, *rtype, *del_islev, *dy2, *dx2, *dy1, *dx1, @@ -5147,8 +4970,7 @@ struct sp_coder *coder; } void -spo_region(coder) -struct sp_coder *coder; +spo_region(struct sp_coder *coder) { struct opvar *rtype, *rlit, *flags, *area; xchar dx1, dy1, dx2, dy2; @@ -5253,8 +5075,7 @@ struct sp_coder *coder; } void -spo_drawbridge(coder) -struct sp_coder *coder; +spo_drawbridge(struct sp_coder *coder) { xchar x, y; int dopen; @@ -5279,8 +5100,7 @@ struct sp_coder *coder; } void -spo_mazewalk(coder) -struct sp_coder *coder; +spo_mazewalk(struct sp_coder *coder) { xchar x, y; struct opvar *ftyp, *fstocked, *fdir, *coord; @@ -5348,8 +5168,7 @@ struct sp_coder *coder; } void -spo_wall_property(coder) -struct sp_coder *coder; +spo_wall_property(struct sp_coder *coder) { struct opvar *r; xchar dx1, dy1, dx2, dy2; @@ -5371,8 +5190,7 @@ struct sp_coder *coder; } void -spo_room_door(coder) -struct sp_coder *coder; +spo_room_door(struct sp_coder *coder) { struct opvar *wall, *secret, *mask, *pos; room_door tmpd; @@ -5397,16 +5215,13 @@ struct sp_coder *coder; } void -sel_set_wallify(x, y, arg) -int x, y; -void *arg UNUSED; +sel_set_wallify(int x, int y, void *arg UNUSED) { wallify_map(x, y, x, y); } void -spo_wallify(coder) -struct sp_coder *coder; +spo_wallify(struct sp_coder *coder) { struct opvar *typ, *r; int dx1, dy1, dx2, dy2; @@ -5439,8 +5254,7 @@ struct sp_coder *coder; } void -spo_map(coder) -struct sp_coder *coder; +spo_map(struct sp_coder *coder) { mazepart tmpmazepart; struct opvar *mpxs, *mpys, *mpmap, *mpa, *mpkeepr, *mpzalign; @@ -5611,9 +5425,7 @@ struct sp_coder *coder; } void -spo_jmp(coder, lvl) -struct sp_coder *coder; -sp_lev *lvl; +spo_jmp(struct sp_coder *coder, sp_lev *lvl) { struct opvar *tmpa; long a; @@ -5627,9 +5439,7 @@ sp_lev *lvl; } void -spo_conditional_jump(coder, lvl) -struct sp_coder *coder; -sp_lev *lvl; +spo_conditional_jump(struct sp_coder *coder, sp_lev *lvl) { struct opvar *oa, *oc; long a, c; @@ -5661,8 +5471,7 @@ sp_lev *lvl; void -spo_var_init(coder) -struct sp_coder *coder; +spo_var_init(struct sp_coder *coder) { struct opvar *vname; struct opvar *arraylen; @@ -5767,8 +5576,7 @@ struct sp_coder *coder; long -opvar_array_length(coder) -struct sp_coder *coder; +opvar_array_length(struct sp_coder *coder) { struct opvar *vname; struct splev_var *tmp; @@ -5799,8 +5607,7 @@ struct sp_coder *coder; void -spo_shuffle_array(coder) -struct sp_coder *coder; +spo_shuffle_array(struct sp_coder *coder) { struct opvar *vname; struct splev_var *tmp; @@ -5828,8 +5635,7 @@ struct sp_coder *coder; * Does not free the allocated memory. */ static boolean -sp_level_coder(lvl) -sp_lev *lvl; +sp_level_coder(sp_lev *lvl) { unsigned long exec_opcodes = 0; int tmpi; @@ -6458,8 +6264,7 @@ struct _sploader_cache { struct _sploader_cache *sp_loader_cache = NULL; sp_lev * -sp_lev_cache(fnam) -char *fnam; +sp_lev_cache(char *fnam) { struct _sploader_cache *tmp = sp_loader_cache; @@ -6471,9 +6276,7 @@ char *fnam; } void -sp_lev_savecache(fnam, lvl) -char *fnam; -sp_lev *lvl; +sp_lev_savecache(char *fnam, sp_lev *lvl) { struct _sploader_cache *tmp = (struct _sploader_cache *)alloc(sizeof(struct _sploader_cache)); if (!tmp) panic("save splev cache"); @@ -6484,8 +6287,7 @@ sp_lev *lvl; } boolean -load_special(name) -const char *name; +load_special(const char *name) { dlb *fd; sp_lev *lvl = NULL; diff --git a/src/spell.c b/src/spell.c index 75394d902..0f3cefaea 100644 --- a/src/spell.c +++ b/src/spell.c @@ -18,16 +18,16 @@ static NEARDATA struct obj *book; /* last/current book being xscribed */ #define spellev(spell) spl_book[spell].sp_lev #define spellname(spell) OBJ_NAME(objects[spellid(spell)]) -static int spell_let_to_idx(CHAR_P); +static int spell_let_to_idx(char); static boolean cursed_book(struct obj *bp); static boolean confused_book(struct obj *); static void deadbook(struct obj *); -static int learn(); +static int learn(void); static boolean getspell(int *); static boolean dospellmenu(const char *, int, int *); static int percent_success(int); -static int throwspell(); -static void cast_protection(); +static int throwspell(void); +static void cast_protection(void); static void spell_backfire(int); /* The roles[] table lists the role-specific values for tuning @@ -71,8 +71,7 @@ static const char explodes[] = "radiates explosive energy"; /* convert a letter into a number in the range 0..51, or -1 if not a letter */ static int -spell_let_to_idx(ilet) -char ilet; +spell_let_to_idx(char ilet) { int indx; @@ -85,8 +84,7 @@ char ilet; /* TRUE: book should be destroyed by caller */ static boolean -cursed_book(bp) -struct obj *bp; +cursed_book(struct obj *bp) { int lev = objects[bp->otyp].oc_level; @@ -155,8 +153,7 @@ struct obj *bp; /* study while confused: returns TRUE if the book is destroyed */ static boolean -confused_book(spellbook) -struct obj *spellbook; +confused_book(struct obj *spellbook) { boolean gone = FALSE; @@ -180,8 +177,7 @@ struct obj *spellbook; /* special effects for The Book of the Dead */ static void -deadbook(book2) -struct obj *book2; +deadbook(struct obj *book2) { struct monst *mtmp, *mtmp2; coord mm; @@ -294,8 +290,7 @@ struct obj *book2; /* 'book' has just become cursed; if we're reading it and realize it is now cursed, interrupt */ void -book_cursed(book) -struct obj *book; +book_cursed(struct obj *book) { #ifdef NEXT_VERSION if (occupation == learn && @@ -309,7 +304,7 @@ struct obj *book; } static int -learn() +learn(void) { int i; short booktype; @@ -389,8 +384,7 @@ learn() } int -study_book(spellbook) -register struct obj *spellbook; +study_book(register struct obj *spellbook) { register int booktype = spellbook->otyp; register boolean confused = (Confusion != 0); @@ -499,8 +493,7 @@ register struct obj *spellbook; /* a spellbook has been destroyed or the character has changed levels; the stored address for the current book is no longer valid */ void -book_disappears(obj) -struct obj *obj; +book_disappears(struct obj *obj) { if (obj == book) book = (struct obj *)0; } @@ -509,15 +502,14 @@ struct obj *obj; so the sequence start reading, get interrupted, name the book, resume reading would read the "new" book from scratch */ void -book_substitution(old_obj, new_obj) -struct obj *old_obj, *new_obj; +book_substitution(struct obj *old_obj, struct obj *new_obj) { if (old_obj == book) book = new_obj; } /* called from moveloop() */ void -age_spells() +age_spells(void) { int i; /* @@ -537,8 +529,7 @@ age_spells() * parameter. Otherwise return FALSE. */ static boolean -getspell(spell_no) -int *spell_no; +getspell(int *spell_no) { int nspells, idx; char ilet, lets[BUFSZ], qbuf[QBUFSZ]; @@ -580,7 +571,7 @@ int *spell_no; /* the 'Z' command -- cast a spell */ int -docast() +docast(void) { int spell_no; @@ -590,8 +581,7 @@ docast() } const char * -spelltypemnemonic(skill) -int skill; +spelltypemnemonic(int skill) { switch (skill) { case P_ATTACK_SPELL: @@ -615,14 +605,13 @@ int skill; } int -spell_skilltype(booktype) -int booktype; +spell_skilltype(int booktype) { return (objects[booktype].oc_skill); } static void -cast_protection() +cast_protection(void) { int loglev = 0; int l = u.ulevel; @@ -685,8 +674,7 @@ cast_protection() /* attempting to cast a forgotten spell will cause disorientation */ static void -spell_backfire(spell) -int spell; +spell_backfire(int spell) { long duration = (long)((spellev(spell) + 1) * 3); /* 6..24 */ @@ -713,9 +701,7 @@ int spell; } int -spelleffects(spell, atme) -int spell; -boolean atme; +spelleffects(int spell, boolean atme) { int energy, damage, chance, n, intell; int skill, role_skill; @@ -990,7 +976,7 @@ boolean atme; /* Choose location where spell takes effect. */ static int -throwspell() +throwspell(void) { coord cc; @@ -1028,8 +1014,7 @@ throwspell() /* add/hide/remove/unhide teleport-away on behalf of dotelecmd() to give more control to behavior of ^T when used in wizard mode */ int -tport_spell(what) -int what; +tport_spell(int what) { static struct tport_hideaway { struct spell savespell; @@ -1090,7 +1075,7 @@ int what; } void -losespells() +losespells(void) { boolean confused = (Confusion != 0); int n, nzap, i; @@ -1113,8 +1098,7 @@ static char spellorder[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ /** Return the shortcut character for the spell menu spell number. */ static int -spellet(spell) -int spell; +spellet(int spell) { if (spell < strlen(spellorder)) { return spellorder[spell]; @@ -1125,8 +1109,7 @@ int spell; /** Overwrite standard spell order with user supplied string. */ boolean -parse_spellorder(str) -char *str; +parse_spellorder(char *str) { int i; for (i=0; i < strlen(str) && i < strlen(spellorder); i++) { @@ -1138,7 +1121,7 @@ char *str; /* the '+' command -- view known spells */ int -dovspell() +dovspell(void) { char qbuf[QBUFSZ]; int splnum, othnum; @@ -1162,10 +1145,10 @@ dovspell() } static boolean -dospellmenu(prompt, splaction, spell_no) -const char *prompt; -int splaction; /* SPELLMENU_CAST, SPELLMENU_VIEW, or spl_book[] index */ -int *spell_no; +dospellmenu(const char *prompt, int splaction, int *spell_no) + + /* SPELLMENU_CAST, SPELLMENU_VIEW, or spl_book[] index */ + { winid tmpwin; int i, n, how; @@ -1236,7 +1219,7 @@ int *spell_no; /** Dump the currently known spells. */ void -dump_spells() +dump_spells(void) { int i; char buf[BUFSZ]; @@ -1277,8 +1260,7 @@ dump_spells() * Returns the success rate of the specified spell in percent. */ static int -percent_success(spell) -int spell; +percent_success(int spell) { /* Intrinsic and learned ability are combined to calculate * the probability of player's success at cast a given spell. @@ -1381,8 +1363,7 @@ int spell; /* Learn a spell during creation of the initial inventory */ void -initialspell(obj) -struct obj *obj; +initialspell(struct obj *obj) { int i; diff --git a/src/steal.c b/src/steal.c index 83911734e..c99f55670 100644 --- a/src/steal.c +++ b/src/steal.c @@ -3,13 +3,12 @@ #include "hack.h" -static int stealarm(); +static int stealarm(void); static const char *equipname(struct obj *); static const char * -equipname(otmp) -register struct obj *otmp; +equipname(register struct obj *otmp) { return ( (otmp == uarmu) ? "shirt" : @@ -22,8 +21,7 @@ register struct obj *otmp; /* proportional subset of gold; return value actually fits in an int */ long -somegold(lmoney) -long lmoney; +somegold(long int lmoney) { int igold = (lmoney >= (long) LARGEST_INT) ? LARGEST_INT : (int) lmoney; @@ -55,8 +53,7 @@ long lmoney; Deals in gold only, as leprechauns don't care for lesser coins. */ struct obj * -findgold(chain) -register struct obj *chain; +findgold(register struct obj *chain) { while (chain && chain->otyp != GOLD_PIECE) chain = chain->nobj; return chain; @@ -66,8 +63,7 @@ register struct obj *chain; Steal gold coins only. Leprechauns don't care for lesser coins. */ void -stealgold(mtmp) -register struct monst *mtmp; +stealgold(register struct monst *mtmp) { register struct obj *fgold = g_at(u.ux, u.uy); register struct obj *ygold; @@ -136,7 +132,7 @@ unsigned int stealoid; /* object to be stolen */ unsigned int stealmid; /* monster doing the stealing */ static int -stealarm() +stealarm(void) { register struct monst *mtmp; register struct obj *otmp; @@ -173,9 +169,9 @@ stealarm() /* An object you're wearing has been taken off by a monster (theft or seduction). Also used if a worn item gets transformed (stone to flesh). */ void -remove_worn_item(obj, unchain_ball) -struct obj *obj; -boolean unchain_ball; /* whether to unpunish or just unwield */ +remove_worn_item( + struct obj *obj, + boolean unchain_ball) /**< whether to unpunish or just unwield */ { if (donning(obj)) cancel_don(); @@ -225,9 +221,7 @@ boolean unchain_ball; /* whether to unpunish or just unwield */ * Nymphs and monkeys won't steal coins */ int -steal(mtmp, objnambuf) -struct monst *mtmp; -char *objnambuf; +steal(struct monst *mtmp, char *objnambuf) { struct obj *otmp; int tmp, could_petrify, armordelay, olddelay, icnt, named = 0, retrycnt = 0; @@ -469,9 +463,7 @@ char *objnambuf; /* Returns 1 if otmp is free'd, 0 otherwise. */ int -mpickobj(mtmp, otmp) -register struct monst *mtmp; -register struct obj *otmp; +mpickobj(register struct monst *mtmp, register struct obj *otmp) { int freed_otmp; boolean snuff_otmp = FALSE; @@ -523,8 +515,7 @@ register struct obj *otmp; /* called for AD_SAMU (the Wizard and quest nemeses) */ void -stealamulet(mtmp) -struct monst *mtmp; +stealamulet(struct monst *mtmp) { char buf[BUFSZ]; struct obj *otmp = (struct obj *)0; @@ -596,10 +587,10 @@ struct monst *mtmp; /* when a mimic gets poked with something, it might take that thing (at present, only implemented for when the hero does the poking) */ void -maybe_absorb_item(mon, obj, ochance, achance) -struct monst *mon; -struct obj *obj; -int ochance, achance; /* percent chance for ordinary item, artifact */ +maybe_absorb_item( + struct monst *mon, + struct obj *obj, + int ochance, int achance) /**< percent chance for ordinary item, artifact */ { if (obj == uball || obj == uchain || obj->oclass == ROCK_CLASS || obj_resists(obj, 100 - ochance, 100 - achance) || @@ -644,10 +635,7 @@ int ochance, achance; /* percent chance for ordinary item, artifact */ /* drop one object taken from a (possibly dead) monster's inventory */ void -mdrop_obj(mon, obj, verbosely) -struct monst *mon; -struct obj *obj; -boolean verbosely; +mdrop_obj(struct monst *mon, struct obj *obj, boolean verbosely) { int omx = mon->mx, omy = mon->my; boolean update_mon = FALSE; @@ -689,8 +677,7 @@ boolean verbosely; even leaving the game entirely; when that happens, prevent them from taking the Amulet, invocation items, or quest artifact with them */ void -mdrop_special_objs(mon) -struct monst *mon; +mdrop_special_objs(struct monst *mon) { struct obj *obj, *otmp; @@ -720,10 +707,10 @@ struct monst *mon; /* release the objects the creature is carrying */ void -relobj(mtmp, show, is_pet) -struct monst *mtmp; -int show; -boolean is_pet; /* If true, pet should keep wielded/worn items */ +relobj( + struct monst *mtmp, + int show, + boolean is_pet) /**< If TRUE, pet should keep wielded/worn items */ { struct obj *otmp; int omx = mtmp->mx, omy = mtmp->my; diff --git a/src/steed.c b/src/steed.c index 917e44f23..a3d77515f 100644 --- a/src/steed.c +++ b/src/steed.c @@ -13,7 +13,7 @@ static void maybewakesteed(struct monst *); /* caller has decided that hero can't reach something while mounted */ void -rider_cant_reach() +rider_cant_reach(void) { You("aren't skilled enough to reach from %s.", y_monnam(u.usteed)); } @@ -22,8 +22,7 @@ rider_cant_reach() /* Can this monster wear a saddle? */ boolean -can_saddle(mtmp) -struct monst *mtmp; +can_saddle(struct monst *mtmp) { struct permonst *ptr = mtmp->data; @@ -34,8 +33,7 @@ struct monst *mtmp; } int -use_saddle(otmp) -struct obj *otmp; +use_saddle(struct obj *otmp) { struct monst *mtmp; struct permonst *ptr; @@ -156,9 +154,7 @@ struct obj *otmp; } void -put_saddle_on_mon(saddle, mtmp) -struct obj *saddle; -struct monst *mtmp; +put_saddle_on_mon(struct obj *saddle, struct monst *mtmp) { if (!can_saddle(mtmp) || which_armor(mtmp, W_SADDLE)) return; @@ -174,8 +170,7 @@ struct monst *mtmp; /* Can we ride this monster? Caller should also check can_saddle() */ boolean -can_ride(mtmp) -struct monst *mtmp; +can_ride(struct monst *mtmp) { return (mtmp->mtame && humanoid(youmonst.data) && !verysmall(youmonst.data) && !bigmonst(youmonst.data) && @@ -183,7 +178,7 @@ struct monst *mtmp; } int -doride() +doride(void) { boolean forcemount = FALSE; @@ -202,9 +197,9 @@ doride() /* Start riding, with the given monster */ boolean -mount_steed(mtmp, force) -struct monst *mtmp; /* The animal */ -boolean force; /* Quietly force this animal */ +mount_steed( + struct monst *mtmp, /*< The animal */ + boolean force) /*< Quietly force this animal */ { struct obj *otmp; char buf[BUFSZ]; @@ -377,7 +372,7 @@ boolean force; /* Quietly force this animal */ /* You and your steed have moved */ void -exercise_steed() +exercise_steed(void) { if (!u.usteed) return; @@ -393,7 +388,7 @@ exercise_steed() /* The player kicks or whips the steed */ void -kick_steed() +kick_steed(void) { char He[4]; if (!u.usteed) @@ -450,10 +445,10 @@ kick_steed() * Adapted from mail daemon code. */ static boolean -landing_spot(spot, reason, forceit) -coord *spot; /* landing position (we fill it in) */ -int reason; -int forceit; +landing_spot(coord *spot, int reason, int forceit) + /* landing position (we fill it in) */ + + { int i = 0, x, y, distance, min_distance = -1; boolean found = FALSE; @@ -493,8 +488,8 @@ int forceit; /* Stop riding the current steed */ void -dismount_steed(reason) -int reason; /* Player was thrown off etc. */ +dismount_steed( + int reason) /**< Player was thrown off etc. */ { struct monst *mtmp; struct obj *otmp; @@ -710,8 +705,7 @@ int reason; /* Player was thrown off etc. */ /* when attempting to saddle or mount a sleeping steed, try to wake it up (for the saddling case, it won't be u.usteed yet) */ static void -maybewakesteed(steed) -struct monst *steed; +maybewakesteed(struct monst *steed) { int frozen = (int) steed->mfrozen; boolean wasimmobile = steed->msleeping || !steed->mcanmove; @@ -738,8 +732,7 @@ struct monst *steed; /* decide whether hero's steed is able to move; doesn't check for holding traps--those affect the hero directly */ boolean -stucksteed(checkfeeding) -boolean checkfeeding; +stucksteed(boolean checkfeeding) { struct monst *steed = u.usteed; @@ -759,9 +752,7 @@ boolean checkfeeding; } void -place_monster(mon, x, y) -struct monst *mon; -int x, y; +place_monster(struct monst *mon, int x, int y) { struct monst *othermon; const char *monnm, *othnm; diff --git a/src/sys.c b/src/sys.c index fdb8043ec..96b5d9d02 100644 --- a/src/sys.c +++ b/src/sys.c @@ -5,7 +5,7 @@ struct sysopt sysopt; void -sys_early_init() +sys_early_init(void) { #ifdef LIVELOGFILE sysopt.livelog = LIVELOG_DETAIL; @@ -14,7 +14,7 @@ sys_early_init() } void -sysopt_release() +sysopt_release(void) { if (sysopt.support) { free(sysopt.support), sysopt.support = (char *) 0; diff --git a/src/teleport.c b/src/teleport.c index f32815146..12ca2bb39 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -4,8 +4,8 @@ #include "hack.h" static boolean tele_jump_ok(int, int, int, int); -static boolean teleok(int, int, BOOLEAN_P); -static void vault_tele(); +static boolean teleok(int, int, boolean); +static void vault_tele(void); static boolean rloc_pos_ok(int, int, struct monst *); static void mvault_tele(struct monst *); @@ -21,10 +21,7 @@ static struct obj *telescroll = 0; * Returns: -1: Inaccessible, 0: Good pos, 1: Temporally inacessible */ static int -badpos(x, y, mtmp, gpflags) -int x, y; -struct monst *mtmp; -unsigned gpflags; +badpos(int x, int y, struct monst *mtmp, unsigned int gpflags) { int is_badpos = 0, pool; struct permonst *mdat = NULL; @@ -99,10 +96,7 @@ unsigned gpflags; * call it to generate new monster positions with fake monster structures. */ boolean -goodpos(x, y, mtmp, gpflags) -int x, y; -struct monst *mtmp; -unsigned gpflags; +goodpos(int x, int y, struct monst *mtmp, unsigned int gpflags) { struct permonst *mdat = NULL; boolean ignorewater = ((gpflags & MM_IGNOREWATER) != 0); @@ -199,31 +193,25 @@ unsigned gpflags; * Return TRUE and the position chosen when successful, FALSE otherwise. */ boolean -enexto(cc, xx, yy, mdat) -coord *cc; -register xchar xx, yy; -struct permonst *mdat; +enexto(coord *cc, register xchar xx, register xchar yy, struct permonst *mdat) { return enexto_core(cc, xx, yy, mdat, NO_MM_FLAGS); } boolean -enexto_core(cc, xx, yy, mdat, entflags) -coord *cc; -xchar xx, yy; -struct permonst *mdat; -unsigned entflags; +enexto_core(coord *cc, xchar xx, xchar yy, struct permonst *mdat, unsigned int entflags) { return enexto_core_range(cc, xx, yy, mdat, entflags, 1); } boolean -enexto_core_range(cc, xx, yy, mdat, entflags, start_range) -coord *cc; -register xchar xx, yy; -struct permonst *mdat; -unsigned entflags; -int start_range; /**< Distance of checked tiles to begin with. Should be >=1. */ +enexto_core_range( + coord *cc, + xchar xx, + xchar yy, + struct permonst *mdat, + unsigned int entflags, + int start_range) /**< Distance of checked tiles to begin with. Should be >=1. */ { #define MAX_GOOD 15 coord good[MAX_GOOD], *good_ptr; @@ -345,11 +333,7 @@ coord epathto_debug_cc[100]; #endif int -epathto(cc, nc, xx, yy, mdat) -coord *cc; -int nc; -register xchar xx, yy; -struct permonst *mdat; +epathto(coord *cc, int nc, register xchar xx, register xchar yy, struct permonst *mdat) { int i, j, dir, ndirs, xy, x, y, r; int path_len, postype; @@ -462,8 +446,7 @@ struct permonst *mdat; * only for explicitly chosen destinations.) */ static boolean -tele_jump_ok(x1, y1, x2, y2) -int x1, y1, x2, y2; +tele_jump_ok(int x1, int y1, int x2, int y2) { if (!isok(x2, y2)) { return FALSE; @@ -498,9 +481,7 @@ int x1, y1, x2, y2; } static boolean -teleok(x, y, trapok) -register int x, y; -boolean trapok; +teleok(register int x, register int y, boolean trapok) { if (!trapok) { /* allow teleportation onto vibrating square, it's not a real trap */ @@ -517,9 +498,7 @@ boolean trapok; } void -teleds(nux, nuy, allow_drag) -register int nux, nuy; -boolean allow_drag; +teleds(register int nux, register int nuy, boolean allow_drag) { if (u.utraptype == TT_BURIEDBALL) { /* unearth it */ @@ -652,8 +631,7 @@ boolean allow_drag; } boolean -safe_teleds(allow_drag) -boolean allow_drag; +safe_teleds(boolean allow_drag) { register int nux, nuy, tcnt = 0; @@ -670,7 +648,7 @@ boolean allow_drag; } static void -vault_tele() +vault_tele(void) { register struct mkroom *croom = search_special(VAULT); coord c; @@ -683,9 +661,7 @@ vault_tele() } boolean -teleport_pet(mtmp, force_it) -register struct monst *mtmp; -boolean force_it; +teleport_pet(register struct monst *mtmp, boolean force_it) { register struct obj *otmp; @@ -712,7 +688,7 @@ boolean force_it; } void -tele() +tele(void) { coord cc; @@ -776,7 +752,7 @@ tele() /** ^T command; 'm ^T' == choose among several teleport modes */ int -dotelecmd() +dotelecmd(void) { long save_HTele, save_ETele; int res, added, hidden; @@ -888,9 +864,9 @@ dotelecmd() return res; } +/** the #teleport command; 'm ^T' == choose among several teleport modes */ int -dotele(break_the_rules) -boolean break_the_rules; /* true: wizard mode ^T */ +dotele(boolean break_the_rules) /**< TRUE: wizard mode ^T */ { struct trap *trap; const char *cantdoit; @@ -1012,7 +988,7 @@ boolean break_the_rules; /* true: wizard mode ^T */ } void -level_tele() +level_tele(void) { register int newlev; d_level newlevel; @@ -1298,8 +1274,7 @@ level_tele() } void -domagicportal(ttmp) -register struct trap *ttmp; +domagicportal(register struct trap *ttmp) { struct d_level target_level; @@ -1341,8 +1316,7 @@ register struct trap *ttmp; } void -tele_trap(trap) -struct trap *trap; +tele_trap(struct trap *trap) { if (In_endgame(&u.uz) || Antimagic) { if (Antimagic) @@ -1359,9 +1333,7 @@ struct trap *trap; } void -level_tele_trap(trap, trflags) -struct trap *trap; -unsigned trflags; +level_tele_trap(struct trap *trap, unsigned int trflags) { char verbbuf[BUFSZ]; @@ -1392,9 +1364,9 @@ unsigned trflags; /* check whether monster can arrive at location via Tport (or fall) */ static boolean -rloc_pos_ok(x, y, mtmp) -register int x, y; /* coordinates of candidate location */ -struct monst *mtmp; +rloc_pos_ok(register int x, register int y, struct monst *mtmp) + /* coordinates of candidate location */ + { register int xx, yy; @@ -1456,9 +1428,7 @@ struct monst *mtmp; * the worm. */ void -rloc_to(mtmp, x, y) -struct monst *mtmp; -register int x, y; +rloc_to(struct monst *mtmp, register int x, register int y) { register int oldx = mtmp->mx, oldy = mtmp->my; boolean resident_shk = mtmp->isshk && inhishop(mtmp); @@ -1506,9 +1476,9 @@ register int x, y; /* place a monster at a random location, typically due to teleport */ /* return TRUE if successful, FALSE if not */ boolean -rloc(mtmp, suppress_impossible) -struct monst *mtmp; /* mx==0 implies migrating monster arrival */ -boolean suppress_impossible; +rloc(struct monst *mtmp, boolean suppress_impossible) + /* mx==0 implies migrating monster arrival */ + { register int x, y, trycount; @@ -1557,8 +1527,7 @@ boolean suppress_impossible; } static void -mvault_tele(mtmp) -struct monst *mtmp; +mvault_tele(struct monst *mtmp) { struct mkroom *croom = search_special(VAULT); coord c; @@ -1572,8 +1541,7 @@ struct monst *mtmp; } boolean -tele_restrict(mon) -struct monst *mon; +tele_restrict(struct monst *mon) { if (level.flags.noteleport) { if (canseemon(mon)) @@ -1585,10 +1553,7 @@ struct monst *mon; } void -mtele_trap(mtmp, trap, in_sight) -struct monst *mtmp; -struct trap *trap; -int in_sight; +mtele_trap(struct monst *mtmp, struct trap *trap, int in_sight) { char *monname; @@ -1619,11 +1584,7 @@ int in_sight; /* return 0 if still on level, 3 if not */ int -mlevel_tele_trap(mtmp, trap, force_it, in_sight) -struct monst *mtmp; -struct trap *trap; -boolean force_it; -int in_sight; +mlevel_tele_trap(struct monst *mtmp, struct trap *trap, boolean force_it, int in_sight) { int tt = (trap ? trap->ttyp : NO_TRAP); struct permonst *mptr = mtmp->data; @@ -1721,8 +1682,7 @@ int in_sight; /* place object randomly, returns False if it's gone (eg broken) */ boolean -rloco(obj) -register struct obj *obj; +rloco(register struct obj *obj) { register xchar tx, ty, otx, oty; boolean restricted_fall; @@ -1783,7 +1743,7 @@ register struct obj *obj; /* Returns an absolute depth */ int -random_teleport_level() +random_teleport_level(void) { int nlev, max_depth, min_depth, cur_depth = (int)depth(&u.uz); @@ -1859,9 +1819,7 @@ random_teleport_level() /** You teleport a monster (via wand, spell, or poly'd q.mechanic attack). returns false iff the attempt fails */ boolean -u_teleport_mon(mtmp, give_feedback) -struct monst *mtmp; -boolean give_feedback; +u_teleport_mon(struct monst *mtmp, boolean give_feedback) { coord cc; diff --git a/src/timeout.c b/src/timeout.c index 1e301feaa..5308a73c3 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -4,16 +4,16 @@ #include "hack.h" #include "lev.h" /* for checking save modes */ -static void stoned_dialogue(); -static void phasing_dialogue(); -static void vomiting_dialogue(); -static void choke_dialogue(); -static void slime_dialogue(); +static void stoned_dialogue(void); +static void phasing_dialogue(void); +static void vomiting_dialogue(void); +static void choke_dialogue(void); +static void slime_dialogue(void); static void slimed_to_death(struct kinfo *); static void sickness_dialogue(void); -static void phaze_dialogue(); +static void phaze_dialogue(void); static void done_timeout(int, int); -static void slip_or_trip(); +static void slip_or_trip(void); static void see_lamp_flicker(struct obj *, const char *); static void lantern_message(struct obj *); static void cleanup_burn(ANY_P *, long); @@ -107,7 +107,7 @@ static NEARDATA const char * const stoned_texts[] = { }; static void -stoned_dialogue() +stoned_dialogue(void) { register long i = (Stoned & TIMEOUT); @@ -173,7 +173,7 @@ stoned_dialogue() } static void -phasing_dialogue() +phasing_dialogue(void) { if (Phasing == 15) { if (!Hallucination) { @@ -202,7 +202,7 @@ static NEARDATA const char * const vomiting_texts[] = { }; static void -vomiting_dialogue() +vomiting_dialogue(void) { const char *txt = 0; long v = (Vomiting & TIMEOUT); @@ -288,7 +288,7 @@ static NEARDATA const char * const choke_texts2[] = { }; static void -choke_dialogue() +choke_dialogue(void) { register long i = (Strangled & TIMEOUT); @@ -345,7 +345,7 @@ static NEARDATA const char *const levi_texts[] = { }; static void -levitation_dialogue() +levitation_dialogue(void) { /* -1 because the last message comes via float_down() */ long i = (((HLevitation & TIMEOUT)-1L) / 2L); @@ -380,7 +380,7 @@ static NEARDATA const char * const slime_texts[] = { }; static void -slime_dialogue() +slime_dialogue(void) { register long i = (Slimed & TIMEOUT) / 2L; @@ -444,7 +444,7 @@ slime_dialogue() } void -burn_away_slime() +burn_away_slime(void) { if (Slimed) { pline_The("slime that covers you is burned away!"); @@ -467,7 +467,7 @@ static NEARDATA const char *const phaze_texts[] = { }; static void -phaze_dialogue() +phaze_dialogue(void) { long i = ((HPasses_walls & TIMEOUT) / 2L); @@ -484,8 +484,7 @@ phaze_dialogue() during end of game rundown (and potential dumplog); timeout has already counted down to 0 by the time we get here */ static void -done_timeout(how, which) -int how, which; +done_timeout(int how, int which) { long *intrinsic_p = &u.uprops[which].intrinsic; @@ -498,7 +497,7 @@ int how, which; } void -nh_timeout() +nh_timeout(void) { register struct prop *upp; struct kinfo *kptr; @@ -777,9 +776,7 @@ nh_timeout() } void -fall_asleep(how_long, wakeup_msg) -int how_long; -boolean wakeup_msg; +fall_asleep(int how_long, boolean wakeup_msg) { stop_occupation(); nomul(how_long, "sleeping"); @@ -803,9 +800,7 @@ boolean wakeup_msg; * existing hatch timer. Pass 0L for random hatch time. */ void -attach_egg_hatch_timeout(egg, when) -struct obj *egg; -long when; +attach_egg_hatch_timeout(struct obj *egg, long int when) { int i; @@ -834,8 +829,7 @@ long when; /* prevent an egg from ever hatching */ void -kill_egg(egg) -struct obj *egg; +kill_egg(struct obj *egg) { /* stop previous timer, if any */ (void) stop_timer(HATCH_EGG, obj_to_any(egg)); @@ -843,9 +837,7 @@ struct obj *egg; /* timer callback routine: hatch the given egg */ void -hatch_egg(arg, timeout) -anything *arg; -long timeout; +hatch_egg(anything *arg, long int timeout) { struct obj *egg; struct monst *mon, *mon2; @@ -1015,8 +1007,7 @@ long timeout; /* Learn to recognize eggs of the given type. */ void -learn_egg_type(mnum) -int mnum; +learn_egg_type(int mnum) { /* baby monsters hatch from grown-up eggs */ mnum = little_to_big(mnum); @@ -1027,8 +1018,7 @@ int mnum; /* Attach a fig_transform timeout to the given figurine. */ void -attach_fig_transform_timeout(figurine) -struct obj *figurine; +attach_fig_transform_timeout(struct obj *figurine) { int i; @@ -1045,7 +1035,7 @@ struct obj *figurine; /* give a fumble message */ static void -slip_or_trip() +slip_or_trip(void) { struct obj *otmp = vobj_at(u.ux, u.uy), *otmp2; const char *what, *pronoun; @@ -1126,9 +1116,7 @@ slip_or_trip() /* Print a lamp flicker message with tailer. */ static void -see_lamp_flicker(obj, tailer) -struct obj *obj; -const char *tailer; +see_lamp_flicker(struct obj *obj, const char *tailer) { switch (obj->where) { case OBJ_INVENT : @@ -1143,8 +1131,7 @@ const char *tailer; /* Print a dimming message for brass lanterns. */ static void -lantern_message(obj) -struct obj *obj; +lantern_message(struct obj *obj) { /* from adventure */ switch (obj->where) { @@ -1169,9 +1156,7 @@ struct obj *obj; * See begin_burn() for meanings of obj->age and obj->spe. */ void -burn_object(arg, timeout) -anything *arg; -long timeout; +burn_object(anything *arg, long int timeout) { struct obj *obj = arg->a_obj; boolean canseeit, many, menorah, need_newsym, need_invupdate; @@ -1491,9 +1476,7 @@ long timeout; * This is a "silent" routine - it should not print anything out. */ void -begin_burn(obj, already_lit) -struct obj *obj; -boolean already_lit; +begin_burn(struct obj *obj, boolean already_lit) { int radius = 3; long turns = 0; @@ -1589,9 +1572,7 @@ boolean already_lit; * light source. */ void -end_burn(obj, timer_attached) -struct obj *obj; -boolean timer_attached; +end_burn(struct obj *obj, boolean timer_attached) { if (!obj->lamplit) { warning("end_burn: obj %s not lit", xname(obj)); @@ -1616,9 +1597,7 @@ boolean timer_attached; * Cleanup a burning object if timer stopped. */ static void -cleanup_burn(arg, expire_time) -anything *arg; -long expire_time; +cleanup_burn(anything *arg, long int expire_time) { struct obj *obj = arg->a_obj; if (!obj->lamplit) { @@ -1638,7 +1617,7 @@ long expire_time; } void -do_storms() +do_storms(void) { int nstrike; register int x, y; @@ -1742,15 +1721,15 @@ do_storms() */ #ifdef WIZARD -static const char *kind_name(SHORT_P); +static const char *kind_name(short); static void print_queue(winid, timer_element *); #endif static void insert_timer(timer_element *); -static timer_element *remove_timer(timer_element **, SHORT_P, ANY_P *); +static timer_element *remove_timer(timer_element **, short, ANY_P *); static void write_timer(int, timer_element *); static boolean mon_is_local(struct monst *); static boolean timer_is_local(timer_element *); -static int maybe_write_timer(int, int, BOOLEAN_P); +static int maybe_write_timer(int, int, boolean); /* ordered timer list */ timer_element *timer_base; /* "active" */ @@ -1785,8 +1764,7 @@ static const ttable timeout_funcs[NUM_TIME_FUNCS] = { #if defined(WIZARD) static const char * -kind_name(kind) -short kind; +kind_name(short int kind) { switch (kind) { case TIMER_LEVEL: return "level"; @@ -1798,9 +1776,7 @@ short kind; } static void -print_queue(win, base) -winid win; -timer_element *base; +print_queue(winid win, timer_element *base) { timer_element *curr; char buf[BUFSZ]; @@ -1827,7 +1803,7 @@ timer_element *base; } int -wiz_timeout_queue() +wiz_timeout_queue(void) { winid win; char buf[BUFSZ]; @@ -1893,7 +1869,7 @@ wiz_timeout_queue() } void -timer_sanity_check() +timer_sanity_check(void) { timer_element *curr; boolean corrupted_timer = FALSE; @@ -1939,7 +1915,7 @@ timer_sanity_check() * Do this until their time is less than or equal to the move count. */ void -run_timers() +run_timers(void) { timer_element *curr; @@ -1965,11 +1941,7 @@ run_timers() * Start a timer. Return TRUE if successful. */ boolean -start_timer(when, kind, func_index, arg) -long when; -short kind; -short func_index; -anything *arg; +start_timer(long int when, short int kind, short int func_index, anything *arg) { timer_element *gnu, *dup; @@ -2022,9 +1994,7 @@ anything *arg; * remaining until it would have gone off, 0 if not found. */ long -stop_timer(func_index, arg) -short func_index; -anything *arg; +stop_timer(short int func_index, anything *arg) { timer_element *doomed; long timeout; @@ -2047,9 +2017,7 @@ anything *arg; * Find the timeout of specified timer; return 0 if none. */ long -peek_timer(type, arg) -short type; -anything *arg; +peek_timer(short int type, anything *arg) { timer_element *curr; @@ -2066,8 +2034,7 @@ anything *arg; * Move all object timers from src to dest, leaving src untimed. */ void -obj_move_timers(src, dest) -struct obj *src, *dest; +obj_move_timers(struct obj *src, struct obj *dest) { int count; timer_element *curr; @@ -2088,8 +2055,7 @@ struct obj *src, *dest; * Find all object timers and duplicate them for the new object "dest". */ void -obj_split_timers(src, dest) -struct obj *src, *dest; +obj_split_timers(struct obj *src, struct obj *dest) { timer_element *curr, *next_timer=0; @@ -2108,8 +2074,7 @@ struct obj *src, *dest; * all object pointers are unique. */ void -obj_stop_timers(obj) -struct obj *obj; +obj_stop_timers(struct obj *obj) { timer_element *curr, *prev, *next_timer=0; @@ -2135,9 +2100,7 @@ struct obj *obj; * Check whether object has a timer of type timer_type. */ boolean -obj_has_timer(object, timer_type) -struct obj *object; -short timer_type; +obj_has_timer(struct obj *object, short int timer_type) { long timeout = peek_timer(timer_type, obj_to_any(object)); @@ -2149,9 +2112,7 @@ short timer_type; * */ void -spot_stop_timers(x, y, func_index) -xchar x, y; -short func_index; +spot_stop_timers(xchar x, xchar y, short int func_index) { timer_element *curr, *prev, *next_timer = 0; long where = (((long) x << 16) | ((long) y)); @@ -2179,9 +2140,7 @@ short func_index; * Returns 0L if no such timer. */ long -spot_time_expires(x, y, func_index) -xchar x, y; -short func_index; +spot_time_expires(xchar x, xchar y, short int func_index) { timer_element *curr; long where = (((long) x << 16) | ((long) y)); @@ -2197,9 +2156,7 @@ short func_index; } long -spot_time_left(x, y, func_index) -xchar x, y; -short func_index; +spot_time_left(xchar x, xchar y, short int func_index) { long expires = spot_time_expires(x, y, func_index); return (expires > 0L) ? expires - monstermoves : 0L; @@ -2207,8 +2164,7 @@ short func_index; /* Insert timer into the global queue */ static void -insert_timer(gnu) -timer_element *gnu; +insert_timer(timer_element *gnu) { timer_element *curr, *prev; @@ -2224,10 +2180,7 @@ timer_element *gnu; static timer_element * -remove_timer(base, func_index, arg) -timer_element **base; -short func_index; -anything *arg; +remove_timer(timer_element **base, short int func_index, anything *arg) { timer_element *prev, *curr; @@ -2248,9 +2201,7 @@ anything *arg; static void -write_timer(fd, timer) -int fd; -timer_element *timer; +write_timer(int fd, timer_element *timer) { anything arg_save; @@ -2304,8 +2255,7 @@ timer_element *timer; * saved. */ boolean -obj_is_local(obj) -struct obj *obj; +obj_is_local(struct obj *obj) { switch (obj->where) { case OBJ_INVENT: @@ -2325,8 +2275,7 @@ struct obj *obj; * level is saved. */ static boolean -mon_is_local(mon) -struct monst *mon; +mon_is_local(struct monst *mon) { struct monst *curr; @@ -2344,8 +2293,7 @@ struct monst *mon; * level when the level is saved. */ static boolean -timer_is_local(timer) -timer_element *timer; +timer_is_local(timer_element *timer) { switch (timer->kind) { case TIMER_LEVEL: @@ -2367,9 +2315,7 @@ timer_element *timer; * be written. If write_it is true, actually write the timer. */ static int -maybe_write_timer(fd, range, write_it) -int fd, range; -boolean write_it; +maybe_write_timer(int fd, int range, boolean write_it) { int count = 0; timer_element *curr; @@ -2412,8 +2358,7 @@ boolean write_it; * + timeouts that stay with the level (obj & monst) */ void -save_timers(fd, mode, range) -int fd, mode, range; +save_timers(int fd, int mode, int range) { timer_element *curr, *prev, *next_timer=0; int count; @@ -2451,10 +2396,12 @@ int fd, mode, range; * monster pointers. */ void -restore_timers(fd, range, ghostly, adjust) -int fd, range; -boolean ghostly; /* restoring from a ghost level */ -long adjust; /* how much to adjust timeout */ +restore_timers( + int fd, + int range, + boolean ghostly, /**< restoring from a ghost level */ + long int adjust) /**< how much to adjust timeout */ + { int count; timer_element *curr; @@ -2475,10 +2422,7 @@ long adjust; /* how much to adjust timeout */ /* to support '#stats' wizard-mode command */ void -timer_stats(hdrfmt, hdrbuf, count, size) -const char *hdrfmt; -char *hdrbuf; -long *count, *size; +timer_stats(const char *hdrfmt, char *hdrbuf, long int *count, long int *size) { timer_element *te; @@ -2492,8 +2436,7 @@ long *count, *size; /* reset all timers that are marked for reseting */ void -relink_timers(ghostly) -boolean ghostly; +relink_timers(boolean ghostly) { timer_element *curr; unsigned nid; diff --git a/src/topten.c b/src/topten.c index a576e616d..fcb7cb812 100644 --- a/src/topten.c +++ b/src/topten.c @@ -64,20 +64,20 @@ struct toptenentry { static void topten_print(const char *); static void topten_print_bold(const char *); static xchar observable_depth(d_level *); -static void outheader(); -static void outentry(int, struct toptenentry *, BOOLEAN_P); +static void outheader(void); +static void outentry(int, struct toptenentry *, boolean); static void readentry(FILE *, struct toptenentry *); static void writeentry(FILE *, struct toptenentry *); #ifdef XLOGFILE static void munge_xlstring(char *dest, char *src, int n); static void write_xlentry(FILE *, struct toptenentry *); -static void add_achieveX(char *, const char *, BOOLEAN_P); -static char *encode_extended_achievements(); -static char *encode_extended_conducts(); +static void add_achieveX(char *, const char *, boolean); +static char *encode_extended_achievements(void); +static char *encode_extended_conducts(void); #endif static void free_ttlist(struct toptenentry *); -static int classmon(char *, BOOLEAN_P); -static int score_wanted(BOOLEAN_P, int, struct toptenentry *, int, const char **, int); +static int classmon(char *, boolean); +static int score_wanted(boolean, int, struct toptenentry *, int, const char **, int); #ifdef RECORD_ACHIEVE static long encodeachieve(void); #endif @@ -106,8 +106,7 @@ NEARDATA const char * const killed_by_prefix[] = { static winid toptenwin = WIN_ERR; static void -topten_print(x) -const char *x; +topten_print(const char *x) { if (toptenwin == WIN_ERR) raw_print(x); @@ -116,8 +115,7 @@ const char *x; } static void -topten_print_bold(x) -const char *x; +topten_print_bold(const char *x) { if (toptenwin == WIN_ERR) raw_print_bold(x); @@ -126,8 +124,7 @@ const char *x; } static xchar -observable_depth(lev) -d_level *lev; +observable_depth(d_level *lev) { #ifdef RANDOMIZED_PLANES /* if we ever randomize the order of the elemental planes, we must use a constant external representation in the record file */ @@ -144,9 +141,7 @@ d_level *lev; } static void -readentry(rfile, tt) -FILE *rfile; -struct toptenentry *tt; +readentry(FILE *rfile, struct toptenentry *tt) { #ifdef NO_SCAN_BRACK /* Version_ Pts DgnLevs_ Hp___ Died__Born id */ static const char fmt[] = GAME_SHORT_NAME " %d %d %d %ld %d %d %d %d %d %d %ld %ld %d%*c"; @@ -207,9 +202,7 @@ struct toptenentry *tt; } static void -writeentry(rfile, tt) -FILE *rfile; -struct toptenentry *tt; +writeentry(FILE *rfile, struct toptenentry *tt) { #ifdef NO_SCAN_BRACK nsb_mung_line(tt->name); @@ -255,10 +248,7 @@ struct toptenentry *tt; /* copy a maximum of n-1 characters from src to dest, changing ':' and '\n' * to '_'; always null-terminate. */ static void -munge_xlstring(dest, src, n) -char *dest; -char *src; -int n; +munge_xlstring(char *dest, char *src, int n) { int i; @@ -275,7 +265,7 @@ int n; } static unsigned long -encode_uevent() +encode_uevent(void) { unsigned long c = 0UL; @@ -312,7 +302,7 @@ encode_uevent() } static unsigned long -encode_carried() +encode_carried(void) { unsigned long c = 0UL; @@ -328,9 +318,7 @@ encode_carried() } static void -write_xlentry(rfile, tt) -FILE *rfile; -struct toptenentry *tt; +write_xlentry(FILE *rfile, struct toptenentry *tt) { s_level *lev = Is_special(&u.uz); char buf[DTHSZ+1]; @@ -436,10 +424,7 @@ struct toptenentry *tt; /* add the achievement or conduct comma-separated to string */ static void -add_achieveX(buf, achievement, condition) -char *buf; -const char *achievement; -boolean condition; +add_achieveX(char *buf, const char *achievement, boolean condition) { if (condition) { if (buf[0] != '\0') { @@ -450,7 +435,7 @@ boolean condition; } static char * -encode_extended_achievements() +encode_extended_achievements(void) { static char buf[30*40]; @@ -504,7 +489,7 @@ encode_extended_achievements() } static char * -encode_extended_conducts() +encode_extended_conducts(void) { static char buf[BUFSZ]; @@ -536,8 +521,7 @@ encode_extended_conducts() #endif /* XLOGFILE */ static void -free_ttlist(tt) -struct toptenentry *tt; +free_ttlist(struct toptenentry *tt) { struct toptenentry *ttnext; @@ -550,8 +534,7 @@ struct toptenentry *tt; } void -topten(how) -int how; +topten(int how) { int uid = getuid(); int rank, rank0 = -1, rank1 = 0; @@ -907,7 +890,7 @@ int how; } static void -outheader() +outheader(void) { char linebuf[BUFSZ]; register char *bp; @@ -924,10 +907,7 @@ outheader() /* so>0: standout line; so=0: ordinary line */ static void -outentry(rank, t1, so) -struct toptenentry *t1; -int rank; -boolean so; +outentry(int rank, struct toptenentry *t1, boolean so) { boolean second_line = TRUE; char linebuf[BUFSZ]; @@ -1103,13 +1083,7 @@ boolean so; } static int -score_wanted(current_ver, rank, t1, playerct, players, uid) -boolean current_ver; -int rank; -struct toptenentry *t1; -int playerct; -const char **players; -int uid; +score_wanted(boolean current_ver, int rank, struct toptenentry *t1, int playerct, const char **players, int uid) { int i; @@ -1251,9 +1225,7 @@ killed_uniques(void) * and argv[1] starting with "-s". */ void -prscore(argc, argv) -int argc; -char **argv; +prscore(int argc, char **argv) { const char **players; int playerct, rank; @@ -1392,9 +1364,7 @@ char **argv; } static int -classmon(plch, fem) -char *plch; -boolean fem; +classmon(char *plch, boolean fem) { int i; @@ -1420,8 +1390,7 @@ boolean fem; * and attach them to an object (for statues or morgue corpses). */ struct obj * -tt_oname(otmp) -struct obj *otmp; +tt_oname(struct obj *otmp) { int rank; register int i; diff --git a/src/track.c b/src/track.c index 87c9719a5..762c5c6ba 100644 --- a/src/track.c +++ b/src/track.c @@ -11,14 +11,14 @@ static NEARDATA int utcnt, utpnt; static NEARDATA coord utrack[UTSZ]; void -initrack() +initrack(void) { utcnt = utpnt = 0; } /* add to track */ void -settrack() +settrack(void) { if(utcnt < UTSZ) utcnt++; if(utpnt == UTSZ) utpnt = 0; @@ -28,8 +28,7 @@ settrack() } coord * -gettrack(x, y) -register int x, y; +gettrack(register int x, register int y) { register int cnt, ndist; register coord *tc; diff --git a/src/trap.c b/src/trap.c index 73f2f145d..116bcfacc 100644 --- a/src/trap.c +++ b/src/trap.c @@ -6,15 +6,15 @@ extern const char *const destroy_strings[][3]; /* from zap.c */ static struct obj *t_missile(int, struct trap *); -static void launch_drop_spot(struct obj *, XCHAR_P, XCHAR_P); +static void launch_drop_spot(struct obj *, xchar, xchar); static void decrease_mon_trapcounter(struct monst *); static void dofiretrap(struct obj *); static void doicetrap(struct obj *); -static void domagictrap(); +static void domagictrap(void); static boolean emergency_disrobe(boolean *); static int untrap_prob(struct trap *ttmp); static void move_into_trap(struct trap *); -static int try_disarm(struct trap *, BOOLEAN_P); +static int try_disarm(struct trap *, boolean); static void reward_untrap(struct trap *, struct monst *); static int disarm_holdingtrap(struct trap *); static int disarm_landmine(struct trap *); @@ -22,15 +22,15 @@ static int disarm_squeaky_board(struct trap *); static int disarm_shooting_trap(struct trap *, int); static void clear_conjoined_pits(struct trap *); static boolean adj_nonconjoined_pit(struct trap *); -static int try_lift(struct monst *, struct trap *, int, BOOLEAN_P); +static int try_lift(struct monst *, struct trap *, int, boolean); static int help_monster_out(struct monst *, struct trap *); #if 0 static void join_adjacent_pits(struct trap *); #endif -static boolean thitm(int, struct monst *, struct obj *, int, BOOLEAN_P); -static void maybe_finish_sokoban(); -static int mkroll_launch(struct trap *, XCHAR_P, XCHAR_P, SHORT_P, long); -static boolean isclearpath(coord *, int, SCHAR_P, SCHAR_P); +static boolean thitm(int, struct monst *, struct obj *, int, boolean); +static void maybe_finish_sokoban(void); +static int mkroll_launch(struct trap *, xchar, xchar, short, long); +static boolean isclearpath(coord *, int, schar, schar); static int steedintrap(struct trap *, struct obj *); static boolean keep_saddle_with_steedcorpse(unsigned, struct obj *, struct obj *); @@ -43,8 +43,7 @@ static const char *const blindgas[6] = /* called when you're hit by fire (dofiretrap,buzz,zapyourself,explode) */ boolean /* returns TRUE if hit on torso */ -burnarmor(victim) -struct monst *victim; +burnarmor(struct monst *victim) { struct obj *item; char buf[BUFSZ]; @@ -122,11 +121,7 @@ struct monst *victim; * Returns an erosion return value (ER_*) */ int -erode_obj(otmp, ostr, type, ef_flags) -struct obj *otmp; -const char *ostr; -int type; -int ef_flags; +erode_obj(struct obj *otmp, const char *ostr, int type, int ef_flags) { static NEARDATA const char *const action[] = { "smoulder", "rust", "rot", "corrode" }; static NEARDATA const char *const msg[] = { "burnt", "rusted", "rotten", "corroded" }; @@ -280,10 +275,7 @@ int ef_flags; * wears off. */ boolean -grease_protect(otmp, ostr, victim) -struct obj *otmp; -const char *ostr; -struct monst *victim; +grease_protect(struct obj *otmp, const char *ostr, struct monst *victim) { static const char txt[] = "protected by the layer of grease!"; boolean vismon = victim && (victim != &youmonst) && canseemon(victim); @@ -312,8 +304,7 @@ struct monst *victim; } struct trap * -maketrap(x, y, typ) -int x, y, typ; +maketrap(int x, int y, int typ) { static union vlaunchinfo zero_vl; boolean oldplace; @@ -430,9 +421,9 @@ int x, y, typ; } void -fall_through(td, ftflags) -boolean td; /* td == TRUE : trap door or hole */ -unsigned ftflags; +fall_through(boolean td, unsigned int ftflags) + /* td == TRUE : trap door or hole */ + { d_level dtmp; char msgbuf[BUFSZ]; @@ -572,11 +563,7 @@ unsigned ftflags; * shop status--it's not worth the hassle.] */ struct monst * -animate_statue(statue, x, y, cause, fail_reason) -struct obj *statue; -xchar x, y; -int cause; -int *fail_reason; +animate_statue(struct obj *statue, xchar x, xchar y, int cause, int *fail_reason) { int mnum = statue->corpsenm; struct permonst *mptr = &mons[mnum]; @@ -752,10 +739,7 @@ int *fail_reason; * or pick-axe. */ struct monst * -activate_statue_trap(trap, x, y, shatter) -struct trap *trap; -xchar x, y; -boolean shatter; +activate_statue_trap(struct trap *trap, xchar x, xchar y, boolean shatter) { struct monst *mtmp = (struct monst *)0; struct obj *otmp = sobj_at(STATUE, x, y); @@ -782,9 +766,7 @@ boolean shatter; } static boolean -keep_saddle_with_steedcorpse(steed_mid, objchn, saddle) -unsigned steed_mid; -struct obj *objchn, *saddle; +keep_saddle_with_steedcorpse(unsigned int steed_mid, struct obj *objchn, struct obj *saddle) { if (!saddle) { return FALSE; @@ -815,10 +797,7 @@ struct obj *objchn, *saddle; /* monster or you go through and possibly destroy a web. return TRUE if could go through. */ boolean -mu_maybe_destroy_web(mtmp, domsg, trap) -struct monst *mtmp; -boolean domsg; -struct trap *trap; +mu_maybe_destroy_web(struct monst *mtmp, boolean domsg, struct trap *trap) { boolean isyou = (mtmp == &youmonst); struct permonst *mptr = mtmp->data; @@ -859,9 +838,7 @@ struct trap *trap; /* make a single arrow/dart/rock for a trap to shoot or drop */ static struct obj * -t_missile(otyp, trap) -int otyp; -struct trap *trap; +t_missile(int otyp, struct trap *trap) { struct obj *otmp = mksobj(otyp, TRUE, FALSE); @@ -873,8 +850,7 @@ struct trap *trap; } void -set_utrap(tim, typ) -unsigned tim, typ; +set_utrap(unsigned int tim, unsigned int typ) { u.utrap = tim; /* FIXME: @@ -888,8 +864,7 @@ unsigned tim, typ; } void -reset_utrap(msg) -boolean msg; +reset_utrap(boolean msg) { boolean was_Lev = (Levitation != 0), was_Fly = (Flying != 0); @@ -906,9 +881,7 @@ boolean msg; } void -dotrap(trap, trflags) -register struct trap *trap; -unsigned trflags; +dotrap(register struct trap *trap, unsigned int trflags) { register int ttype = trap->ttyp; struct obj *otmp; @@ -1584,9 +1557,7 @@ unsigned trflags; } static int -steedintrap(trap, otmp) -struct trap *trap; -struct obj *otmp; +steedintrap(struct trap *trap, struct obj *otmp) { struct monst *steed = u.usteed; @@ -1673,8 +1644,7 @@ struct obj *otmp; /* some actions common to both player and monsters for triggered landmine */ void -blow_up_landmine(trap) -struct trap *trap; +blow_up_landmine(struct trap *trap) { int x = trap->tx, y = trap->ty, dbx, dby; struct rm *lev = &levl[x][y]; @@ -1721,9 +1691,7 @@ static struct { } launchplace; static void -launch_drop_spot(obj, x, y) -struct obj *obj; -xchar x, y; +launch_drop_spot(struct obj *obj, xchar x, xchar y) { if (!obj) { launchplace.obj = (struct obj *) 0; @@ -1737,7 +1705,7 @@ xchar x, y; } boolean -launch_in_progress() +launch_in_progress(void) { if (launchplace.obj) { return TRUE; @@ -1746,7 +1714,7 @@ launch_in_progress() } void -force_launch_placement() +force_launch_placement(void) { if (launchplace.obj) { launchplace.obj->otrapped = 0; @@ -1762,10 +1730,7 @@ force_launch_placement() * 2 if an object was launched, but used up. */ int -launch_obj(otyp, x1, y1, x2, y2, style) -short otyp; -register int x1, y1, x2, y2; -int style; +launch_obj(short int otyp, register int x1, register int y1, register int x2, register int y2, int style) { register struct monst *mtmp; register struct obj *otmp, *otmp2; @@ -2016,8 +1981,7 @@ int style; } void -seetrap(trap) -struct trap *trap; +seetrap(struct trap *trap) { if (!trap->tseen) { trap->tseen = 1; @@ -2027,8 +1991,7 @@ struct trap *trap; /* like seetrap() but overrides vision */ void -feeltrap(trap) -struct trap *trap; +feeltrap(struct trap *trap) { trap->tseen = 1; map_trap(trap, 1); @@ -2037,11 +2000,7 @@ struct trap *trap; } static int -mkroll_launch(ttmp, x, y, otyp, ocount) -struct trap *ttmp; -xchar x, y; -short otyp; -long ocount; +mkroll_launch(struct trap *ttmp, xchar x, xchar y, short int otyp, long int ocount) { struct obj *otmp; register int tmp; @@ -2112,10 +2071,7 @@ long ocount; } static boolean -isclearpath(cc, distance, dx, dy) -coord *cc; -int distance; -schar dx, dy; +isclearpath(coord *cc, int distance, schar dx, schar dy) { uchar typ; xchar x, y; @@ -2790,8 +2746,7 @@ glovecheck: target = which_armor(mtmp, W_ARMG); /* Combine cockatrice checks into single functions to avoid repeating code. */ void -instapetrify(str) -const char *str; +instapetrify(const char *str) { if (Stone_resistance) return; if (poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM)) @@ -2805,9 +2760,7 @@ const char *str; } void -minstapetrify(mon, byplayer) -struct monst *mon; -boolean byplayer; +minstapetrify(struct monst *mon, boolean byplayer) { if (resists_ston(mon)) return; if (poly_when_stoned(mon->data)) { @@ -2829,8 +2782,7 @@ boolean byplayer; #ifdef WEBB_DISINT int -instadisintegrate(str) -const char * str; +instadisintegrate(const char *str) { int result; if (Disint_resistance || !rn2(10)) @@ -2850,8 +2802,7 @@ const char * str; } int -minstadisintegrate(mon) -struct monst *mon; +minstadisintegrate(struct monst *mon) { int result = mon->data->cwt; if (resists_disint(mon) || !rn2(20)) return 0; @@ -2875,8 +2826,7 @@ struct monst *mon; #endif void -selftouch(arg) -const char *arg; +selftouch(const char *arg) { char kbuf[BUFSZ]; @@ -2907,10 +2857,7 @@ const char *arg; } void -mselftouch(mon, arg, byplayer) -struct monst *mon; -const char *arg; -boolean byplayer; +mselftouch(struct monst *mon, const char *arg, boolean byplayer) { struct obj *mwep = MON_WEP(mon); @@ -2934,7 +2881,7 @@ boolean byplayer; /* start levitating */ void -float_up() +float_up(void) { flags.botl = TRUE; if(u.utrap) { @@ -3013,8 +2960,7 @@ float_up() } void -fill_pit(x, y) -int x, y; +fill_pit(int x, int y) { struct obj *otmp; struct trap *t; @@ -3028,8 +2974,7 @@ int x, y; /* stop levitating */ int -float_down(hmask, emask) -long hmask, emask; /* might cancel timeout */ +float_down(long int hmask, long int emask) /**< might cancel timeout */ { register struct trap *trap = (struct trap *)0; d_level current_dungeon_level; @@ -3186,7 +3131,7 @@ long hmask, emask; /* might cancel timeout */ /* shared code for climbing out of a pit */ void -climb_pit() +climb_pit(void) { if (!u.utrap || u.utraptype != TT_PIT) { return; @@ -3228,8 +3173,7 @@ climb_pit() } static void -doicetrap(box) -struct obj *box; /* at the moment only for floor traps */ +doicetrap(struct obj *box) /**< at the moment only for floor traps */ { int num = 0; num = d(4, 4); @@ -3253,8 +3197,7 @@ struct obj *box; /* at the moment only for floor traps */ } static void -dofiretrap(box) -struct obj *box; /* null for floor trap */ +dofiretrap(struct obj *box) /**< NULL for floor trap */ { boolean see_it = !Blind; int num, alt; @@ -3318,7 +3261,7 @@ struct obj *box; /* null for floor trap */ } static void -domagictrap() +domagictrap(void) { register int fate = rnd(20); @@ -3432,10 +3375,7 @@ domagictrap() * Return whether the object was destroyed. */ boolean -fire_damage(obj, force, x, y) -struct obj *obj; -boolean force; -xchar x, y; +fire_damage(struct obj *obj, boolean force, xchar x, xchar y) { int chance; struct obj *otmp, *ncobj; @@ -3525,10 +3465,7 @@ xchar x, y; * Return number of objects destroyed. --ALI */ int -fire_damage_chain(chain, force, here, x, y) -struct obj *chain; -boolean force, here; -xchar x, y; +fire_damage_chain(struct obj *chain, boolean force, boolean here, xchar x, xchar y) { struct obj *obj, *nobj; int num = 0; @@ -3548,9 +3485,7 @@ xchar x, y; /* obj has been thrown or dropped into lava; damage is worse than mere fire */ boolean -lava_damage(obj, x, y) -struct obj *obj; -xchar x, y; +lava_damage(struct obj *obj, xchar x, xchar y) { int otyp = obj->otyp, ocls = obj->oclass; @@ -3597,8 +3532,7 @@ xchar x, y; } void -acid_damage(obj) -struct obj *obj; +acid_damage(struct obj *obj) { /* Scrolls but not spellbooks can be erased by acid. */ struct monst *victim; @@ -3651,10 +3585,7 @@ static struct h2o_ctx { * Returns an erosion return value (ER_*) */ int -water_damage(obj, ostr, force) -struct obj *obj; -const char *ostr; -boolean force; +water_damage(struct obj *obj, const char *ostr, boolean force) { if (!obj) { return ER_NOTHING; @@ -3821,9 +3752,7 @@ boolean force; } void -water_damage_chain(obj, here) -struct obj *obj; -boolean here; +water_damage_chain(struct obj *obj, boolean here) { struct obj *otmp; @@ -3849,8 +3778,7 @@ boolean here; * crawl out of the current predicament. */ static boolean -emergency_disrobe(lostsome) -boolean *lostsome; +emergency_disrobe(boolean *lostsome) { int invc = inv_cnt(TRUE); @@ -3896,7 +3824,7 @@ boolean *lostsome; * return(TRUE) == player relocated */ boolean -drown() +drown(void) { const char *pool_of_water; boolean inpool_ok = FALSE, crawl_ok; @@ -4062,8 +3990,7 @@ drown() } void -drain_en(n) -register int n; +drain_en(register int n) { if (!u.uenmax) { /* energy is completely gone */ @@ -4087,8 +4014,9 @@ register int n; } } +/** disarm a trap */ int -dountrap() /* disarm a trap */ +dountrap(void) { if (near_capacity() >= HVY_ENCUMBER) { pline("You're too strained to do that."); @@ -4111,8 +4039,7 @@ dountrap() /* disarm a trap */ /* Probability of disabling a trap. Helge Hafting */ static int -untrap_prob(ttmp) -struct trap *ttmp; +untrap_prob(struct trap *ttmp) { int chance = 3; @@ -4134,11 +4061,7 @@ struct trap *ttmp; /* Replace trap with object(s). Helge Hafting */ void -cnv_trap_obj(otyp, cnt, ttmp, bury_it) -int otyp; -int cnt; -struct trap *ttmp; -boolean bury_it; +cnv_trap_obj(int otyp, int cnt, struct trap *ttmp, boolean bury_it) { struct obj *otmp = mksobj(otyp, TRUE, FALSE); @@ -4167,8 +4090,7 @@ boolean bury_it; /* while attempting to disarm an adjacent trap, we've fallen into it */ static void -move_into_trap(ttmp) -struct trap *ttmp; +move_into_trap(struct trap *ttmp) { int bc = 0; xchar x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy; @@ -4203,9 +4125,7 @@ struct trap *ttmp; * 2: succeeds */ static int -try_disarm(ttmp, force_failure) -struct trap *ttmp; -boolean force_failure; +try_disarm(struct trap *ttmp, boolean force_failure) { struct monst *mtmp = m_at(ttmp->tx, ttmp->ty); int ttype = ttmp->ttyp; @@ -4287,9 +4207,7 @@ boolean force_failure; } static void -reward_untrap(ttmp, mtmp) -struct trap *ttmp; -struct monst *mtmp; +reward_untrap(struct trap *ttmp, struct monst *mtmp) { if (!ttmp->madeby_u) { if (rnl(10) < 8 && !mtmp->mpeaceful && @@ -4310,8 +4228,8 @@ struct monst *mtmp; } static int -disarm_holdingtrap(ttmp) /* Helge Hafting */ -struct trap *ttmp; +disarm_holdingtrap(struct trap *ttmp) /* Helge Hafting */ + { struct monst *mtmp; int fails = try_disarm(ttmp, FALSE); @@ -4342,8 +4260,8 @@ struct trap *ttmp; } static int -disarm_landmine(ttmp) /* Helge Hafting */ -struct trap *ttmp; +disarm_landmine(struct trap *ttmp) /* Helge Hafting */ + { int fails = try_disarm(ttmp, FALSE); @@ -4358,8 +4276,7 @@ static NEARDATA const char oil[] = { ALL_CLASSES, TOOL_CLASS, POTION_CLASS, 0 }; /* it may not make much sense to use grease on floor boards, but so what? */ static int -disarm_squeaky_board(ttmp) -struct trap *ttmp; +disarm_squeaky_board(struct trap *ttmp) { struct obj *obj; boolean bad_tool; @@ -4392,9 +4309,7 @@ struct trap *ttmp; /* removes traps that shoot arrows, darts, etc. */ static int -disarm_shooting_trap(ttmp, otyp) -struct trap *ttmp; -int otyp; +disarm_shooting_trap(struct trap *ttmp, int otyp) { int fails = try_disarm(ttmp, FALSE); @@ -4407,11 +4322,7 @@ int otyp; /* Is the weight too heavy? * Formula as in near_capacity() & check_capacity() */ static int -try_lift(mtmp, ttmp, wt, stuff) -struct monst *mtmp; -struct trap *ttmp; -int wt; -boolean stuff; +try_lift(struct monst *mtmp, struct trap *ttmp, int wt, boolean stuff) { int wc = weight_cap(); @@ -4432,9 +4343,7 @@ boolean stuff; /* Help trapped monster (out of a (spiked) pit) */ static int -help_monster_out(mtmp, ttmp) -struct monst *mtmp; -struct trap *ttmp; +help_monster_out(struct monst *mtmp, struct trap *ttmp) { int wt; struct obj *otmp; @@ -4559,8 +4468,7 @@ struct trap *ttmp; } int -untrap(force) -boolean force; +untrap(boolean force) { register struct obj *otmp; register boolean confused = (Confusion > 0 || Hallucination > 0); @@ -4821,9 +4729,9 @@ boolean force; /* for magic unlocking; returns true if targetted monster (which might be hero) gets untrapped; the trap remains intact */ boolean -openholdingtrap(mon, noticed) -struct monst *mon; -boolean *noticed; /* set to true iff hero notices the effect; */ +openholdingtrap(struct monst *mon, boolean *noticed) + + /* set to true iff hero notices the effect; */ { /* otherwise left with its previous value intact */ struct trap *t; char buf[BUFSZ], whichbuf[20]; @@ -4923,9 +4831,9 @@ boolean *noticed; /* set to true iff hero notices the effect; */ /* for magic locking; returns true if targetted monster (which might be hero) gets hit by a trap (might avoid actually becoming trapped) */ boolean -closeholdingtrap(mon, noticed) -struct monst *mon; -boolean *noticed; /* set to true iff hero notices the effect; */ +closeholdingtrap(struct monst *mon, boolean *noticed) + + /* set to true iff hero notices the effect; */ { /* otherwise left with its previous value intact */ struct trap *t; unsigned dotrapflags; @@ -4970,10 +4878,10 @@ boolean *noticed; /* set to true iff hero notices the effect; */ /* for magic unlocking; returns true if targetted monster (which might be hero) gets hit by a trap (target might avoid its effect) */ boolean -openfallingtrap(mon, trapdoor_only, noticed) -struct monst *mon; -boolean trapdoor_only; -boolean *noticed; /* set to true iff hero notices the effect; */ +openfallingtrap(struct monst *mon, boolean trapdoor_only, boolean *noticed) + + + /* set to true iff hero notices the effect; */ { /* otherwise left with its previous value intact */ struct trap *t; boolean ishero = (mon == &youmonst), result; @@ -5017,10 +4925,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ /* only called when the player is doing something to the chest directly */ boolean -chest_trap(obj, bodypart, disarm) -register struct obj *obj; -register int bodypart; -boolean disarm; +chest_trap(register struct obj *obj, register int bodypart, boolean disarm) { register struct obj *otmp = obj, *otmp2; char buf[80]; @@ -5189,8 +5094,7 @@ boolean disarm; } struct trap * -t_at(x, y) -register int x, y; +t_at(register int x, register int y) { register struct trap *trap = ftrap; while(trap) { @@ -5201,8 +5105,7 @@ register int x, y; } void -deltrap(trap) -register struct trap *trap; +deltrap(register struct trap *trap) { struct trap *ttmp; @@ -5227,9 +5130,7 @@ register struct trap *trap; } boolean -conjoined_pits(trap2, trap1, u_entering_trap2) -struct trap *trap2, *trap1; -boolean u_entering_trap2; +conjoined_pits(struct trap *trap2, struct trap *trap1, boolean u_entering_trap2) { int dx, dy, diridx, adjidx; @@ -5256,8 +5157,7 @@ boolean u_entering_trap2; } static void -clear_conjoined_pits(trap) -struct trap *trap; +clear_conjoined_pits(struct trap *trap) { int diridx, adjidx, x, y; struct trap *t; @@ -5278,8 +5178,7 @@ struct trap *trap; } static boolean -adj_nonconjoined_pit(adjtrap) -struct trap *adjtrap; +adj_nonconjoined_pit(struct trap *adjtrap) { struct trap *trap_with_u = t_at(u.ux0, u.uy0); @@ -5304,8 +5203,7 @@ struct trap *adjtrap; * Returns TRUE if you escaped a pit and are standing on the precipice. */ boolean -uteetering_at_seen_pit(trap) -struct trap *trap; +uteetering_at_seen_pit(struct trap *trap) { return (trap && is_pit(trap->ttyp) && @@ -5319,8 +5217,7 @@ struct trap *trap; * release a trap door */ boolean -uescaped_shaft(trap) -struct trap *trap; +uescaped_shaft(struct trap *trap) { return (trap && is_hole(trap->ttyp) && @@ -5330,8 +5227,7 @@ struct trap *trap; /* Destroy a trap that emanates from the floor. */ boolean -delfloortrap(ttmp) -register struct trap *ttmp; +delfloortrap(register struct trap *ttmp) { /* Destroy a trap that emanates from the floor. */ /* some of these are arbitrary -dlc */ @@ -5363,9 +5259,7 @@ register struct trap *ttmp; /* used for doors (also tins). can be used for anything else that opens. */ void -b_trapped(item, bodypart) -register const char *item; -register int bodypart; +b_trapped(register const char *item, register int bodypart) { register int lvl = level_difficulty(); int dmg = rnd(5 + (lvl < 5 ? lvl : 2+lvl/2)); @@ -5385,12 +5279,7 @@ register int bodypart; /* Monster is hit by trap. */ /* Note: doesn't work if both obj and d_override are null */ static boolean -thitm(tlev, mon, obj, d_override, nocorpse) -int tlev; -struct monst *mon; -struct obj *obj; -int d_override; -boolean nocorpse; +thitm(int tlev, struct monst *mon, struct obj *obj, int d_override, boolean nocorpse) { int strike; boolean trapkilled = FALSE; @@ -5449,7 +5338,7 @@ boolean nocorpse; } boolean -unconscious() +unconscious(void) { if (multi >= 0) { return FALSE; @@ -5465,7 +5354,7 @@ unconscious() static const char lava_killer[] = "molten lava"; boolean -lava_effects() +lava_effects(void) { register struct obj *obj, *obj2; int dmg = d(6, 6); /* only applicable for water walking */ @@ -5613,7 +5502,7 @@ lava_effects() } boolean -swamp_effects() +swamp_effects(void) { static int mudboots = 0; int i; @@ -5659,7 +5548,7 @@ swamp_effects() /* called each turn when trapped in lava */ void -sink_into_lava() +sink_into_lava(void) { static const char sink_deeper[] = "You sink deeper into the lava."; @@ -5710,8 +5599,7 @@ sink_into_lava() static void -decrease_mon_trapcounter(mon) -struct monst* mon; +decrease_mon_trapcounter(struct monst *mon) { if (mon->mfeetfrozen) --mon->mfeetfrozen; /* only decrease the other */ @@ -5721,7 +5609,7 @@ struct monst* mon; /* called when a trap has been deleted or had its ttyp replaced */ static void -maybe_finish_sokoban() +maybe_finish_sokoban(void) { struct trap *t; diff --git a/src/tutorial.c b/src/tutorial.c index d4043a885..4b691350d 100644 --- a/src/tutorial.c +++ b/src/tutorial.c @@ -9,8 +9,7 @@ /* Display a tutorial message, if it hasn't been displayed before. Returns TRUE if a tutorial message is output. */ boolean -check_tutorial_message(msgnum) -int msgnum; +check_tutorial_message(int msgnum) { if (!flags.tutorial) return FALSE; if (pl_tutorial[msgnum - QT_T_FIRST] > 0) return FALSE; @@ -26,8 +25,7 @@ int msgnum; message is shown or not. This assumes that the object classes haven't been customized too heavily (possibly a custom boulder, and that's it). */ int -check_tutorial_oclass(oclass) -int oclass; +check_tutorial_oclass(int oclass) { switch(oclass) { case WEAPON_CLASS: check_tutorial_message(QT_T_ITEM_WEAPON); return 1; @@ -51,10 +49,7 @@ int oclass; if there is a message and it hasn't been shown already. Returns TRUE if a message is shown. */ int -check_tutorial_location(lx, ly, from_farlook) -int lx; -int ly; -boolean from_farlook; +check_tutorial_location(int lx, int ly, boolean from_farlook) { struct rm *l = &(levl[lx][ly]); if (!flags.tutorial) return FALSE; /* short-circuit */ @@ -108,9 +103,7 @@ boolean from_farlook; } /* Display tutorial messages that may result from farlook data. */ void -check_tutorial_farlook(x, y) -int x; -int y; +check_tutorial_farlook(int x, int y) { int glyph = glyph_at(x, y); /* Monsters */ @@ -152,8 +145,7 @@ static char check_tutorial_command_buffer[CHECK_TUTORIAL_COMMAND_BUFSIZE]; static int check_tutorial_command_pointer = 0; static int check_tutorial_command_count = 0; void -check_tutorial_command(c) -char c; +check_tutorial_command(char c) { int i, r; char lc; @@ -242,7 +234,7 @@ char c; /* Display tutorial messages based on the state of the character. */ void -maybe_tutorial() +maybe_tutorial(void) { /* So that we don't get two different combats if a monster disappears */ static int time_since_combat = 0; @@ -522,7 +514,7 @@ maybe_tutorial() /* Redisplay tutorial messages. */ int -tutorial_redisplay() +tutorial_redisplay(void) { winid tempwin = create_nhwindow(NHW_MENU); anything i; diff --git a/src/u_init.c b/src/u_init.c index 298303c3b..853e7e0df 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -617,8 +617,7 @@ static const struct def_skill Skill_W[] = { static void -knows_object(obj) -register int obj; +knows_object(register int obj) { discover_object(obj, TRUE, FALSE); objects[obj].oc_pre_discovered = 1; /* not a "discovery" */ @@ -674,7 +673,7 @@ knows_class(char sym) } void -u_init() +u_init(void) { register int i; struct permonst* shambler = &mons[PM_SHAMBLING_HORROR]; @@ -1144,8 +1143,7 @@ u_init() /* skills aren't initialized, so we use the role-specific skill lists */ static boolean -restricted_spell_discipline(otyp) -int otyp; +restricted_spell_discipline(int otyp) { const struct def_skill *skills; int this_skill = spell_skilltype(otyp); @@ -1178,8 +1176,7 @@ int otyp; } static void -ini_inv(trop) -register struct trobj *trop; +ini_inv(register struct trobj *trop) { struct obj *obj; int otyp, i; diff --git a/src/uhitm.c b/src/uhitm.c index 3d3f216a8..61407f49f 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -8,11 +8,11 @@ static boolean hitum(struct monst *, struct attack *); static boolean hmon_hitmon(struct monst *, struct obj *, int, int); static void noisy_hit(struct monst*, struct obj*, int); static int joust(struct monst *, struct obj *); -static void demonpet(); +static void demonpet(void); static boolean m_slips_free(struct monst *mtmp, struct attack *mattk); static int explum(struct monst *, struct attack *); static void start_engulf(struct monst *); -static void end_engulf(); +static void end_engulf(void); static int gulpum(struct monst *, struct attack *); static boolean hmonas(struct monst *); static void nohandglow(struct monst *); @@ -29,9 +29,7 @@ static boolean override_confirmation = FALSE; /* modified from hurtarmor() in mhitu.c */ /* This is not static because it is also used for monsters rusting monsters */ void -hurtmarmor(mdef, attk) -struct monst *mdef; -int attk; +hurtmarmor(struct monst *mdef, int attk) { int hurt; struct obj *target; @@ -46,9 +44,7 @@ int attk; } void -erode_armor(mdef, hurt) -struct monst *mdef; -int hurt; +erode_armor(struct monst *mdef, int hurt) { struct obj *target; @@ -103,9 +99,7 @@ int hurt; /* FALSE means it's OK to attack */ boolean -attack_checks(mtmp, wep) -register struct monst *mtmp; -struct obj *wep; /* uwep for attack(), null for kick_monster() */ +attack_checks(struct monst *mtmp, struct obj *wep) /**< uwep for attack(), null for kick_monster() */ { char qbuf[QBUFSZ]; @@ -241,8 +235,7 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */ * It is unchivalrous for a knight to attack the defenseless or from behind. */ void -check_caitiff(mtmp) -struct monst *mtmp; +check_caitiff(struct monst *mtmp) { if (u.ualign.record <= -10) { return; @@ -263,11 +256,11 @@ struct monst *mtmp; } int -find_roll_to_hit(mtmp, aatyp, weapon, attk_count, role_roll_penalty) -register struct monst *mtmp; -uchar aatyp; /* usually AT_WEAP or AT_KICK */ -struct obj *weapon; /* uwep or uswapwep or NULL */ -int *attk_count, *role_roll_penalty; +find_roll_to_hit(register struct monst *mtmp, uchar aatyp, struct obj *weapon, int *attk_count, int *role_roll_penalty) + + /* usually AT_WEAP or AT_KICK */ + /* uwep or uswapwep or NULL */ + { schar tmp; int tmp2, wepskill, twowepskill, useskill; @@ -366,8 +359,7 @@ int *attk_count, *role_roll_penalty; /* try to attack; return FALSE if monster evaded */ /* u.dx and u.dy must be set */ boolean -attack(mtmp) -register struct monst *mtmp; +attack(register struct monst *mtmp) { register struct permonst *mdat = mtmp->data; @@ -500,13 +492,13 @@ register struct monst *mtmp; /* really hit target monster; returns TRUE if it still lives */ static boolean -known_hitum(mon, weapon, mhit, rollneeded, armorpenalty, uattk, dieroll) -register struct monst *mon; -struct obj *weapon; -int *mhit; -int rollneeded, armorpenalty; /* for monks */ -struct attack *uattk; -int dieroll; +known_hitum(register struct monst *mon, struct obj *weapon, int *mhit, int rollneeded, int armorpenalty, struct attack *uattk, int dieroll) + + + + /* for monks */ + + { boolean malive = TRUE; /* hmon() might destroy weapon; remember aspect for cutworm */ @@ -566,9 +558,9 @@ int dieroll; /* hit the monster next to you and the monsters to the left and right of it; return False if the primary target is killed, True otherwise */ static boolean -hitum_cleave(target, uattk) -struct monst *target; /* non-Null; forcefight at nothing doesn't cleave... */ -struct attack *uattk; /* ... but we don't enforce that here; Null works ok */ +hitum_cleave( + struct monst *target, /**< non-Null; forcefight at nothing doesn't cleave +*/ + struct attack *uattk) /**<+ but we don't enforce that here; Null works ok */ { /* swings will be delivered in alternate directions; with consecutive attacks it will simulate normal swing and backswing; when swings @@ -650,9 +642,7 @@ struct attack *uattk; /* ... but we don't enforce that here; Null works ok */ /* hit target monster; returns TRUE if it still lives */ static boolean -hitum(mon, uattk) -struct monst *mon; -struct attack *uattk; +hitum(struct monst *mon, struct attack *uattk) { boolean malive, wep_was_destroyed = FALSE; struct obj *wepbefore = uwep; @@ -698,11 +688,11 @@ struct attack *uattk; /* general "damage monster" routine; return true if mon still alive */ boolean -hmon(mon, obj, thrown, dieroll) -struct monst *mon; -struct obj *obj; -int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ -int dieroll; +hmon(struct monst *mon, struct obj *obj, int thrown, int dieroll) + + + /* HMON_xxx (0 => hand-to-hand, other => ranged) */ + { boolean anger_guards = (mon->mpeaceful && (mon->ispriest || mon->isshk || is_watch(mon->data))); @@ -721,11 +711,11 @@ int dieroll; /* guts of hmon() */ static boolean -hmon_hitmon(mon, obj, thrown, dieroll) -struct monst *mon; -struct obj *obj; -int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ -int dieroll; +hmon_hitmon(struct monst *mon, struct obj *obj, int thrown, int dieroll) + + + /* HMON_xxx (0 => hand-to-hand, other => ranged) */ + { int tmp; struct permonst *mdat = mon->data; @@ -1533,10 +1523,7 @@ int dieroll; * particular monster is hit. */ static void -noisy_hit(mtmp, otmp, thrown) -struct monst* mtmp; -struct obj* otmp; -int thrown; +noisy_hit(struct monst *mtmp, struct obj *otmp, int thrown) { struct monst* mtmp2; int noiserange; @@ -1589,8 +1576,7 @@ int thrown; } static boolean -shade_aware(obj) -struct obj *obj; +shade_aware(struct obj *obj) { if (!obj) return FALSE; /* @@ -1612,10 +1598,7 @@ struct obj *obj; /* used for hero vs monster and monster vs monster; also handles monster vs hero but that won't happen because hero can't be a shade */ boolean -shade_miss(magr, mdef, obj, thrown, verbose) -struct monst *magr, *mdef; -struct obj *obj; -boolean thrown, verbose; +shade_miss(struct monst *magr, struct monst *mdef, struct obj *obj, boolean thrown, boolean verbose) { const char *what, *whose, *target; boolean youagr = (magr == &youmonst), youdef = (mdef == &youmonst); @@ -1652,9 +1635,7 @@ boolean thrown, verbose; /* check whether slippery clothing protects from hug or wrap attack */ /* [currently assumes that you are the attacker] */ static boolean -m_slips_free(mdef, mattk) -struct monst *mdef; -struct attack *mattk; +m_slips_free(struct monst *mdef, struct attack *mattk) { struct obj *obj; @@ -1693,9 +1674,9 @@ struct attack *mattk; /* used when hitting a monster with a lance while mounted */ static int /* 1: joust hit; 0: ordinary hit; -1: joust but break lance */ -joust(mon, obj) -struct monst *mon; /* target */ -struct obj *obj; /* weapon */ +joust( + struct monst *mon, /**< target */ + struct obj *obj) /**< weapon */ { int skill_rating, joust_dieroll; @@ -1727,7 +1708,7 @@ struct obj *obj; /* weapon */ * Pulling it out makes it work. */ static void -demonpet() +demonpet(void) { int i; struct permonst *pm; @@ -1754,9 +1735,7 @@ demonpet() * will need to be smarter about whether to break out of the theft loop. */ static void -steal_it(mdef, mattk) -struct monst *mdef; -struct attack *mattk; +steal_it(struct monst *mdef, struct attack *mattk) { struct obj *otmp, *stealoid, **minvent_ptr; long unwornmask; @@ -1833,10 +1812,10 @@ struct attack *mattk; } int -damageum(mdef, mattk, specialdmg) -struct monst *mdef; -struct attack *mattk; -int specialdmg; /* blessed and/or silver bonus against various things */ +damageum( + struct monst *mdef, /**< target */ + struct attack *mattk, /**< hero's attack */ + int specialdmg) /**< blessed and/or silver bonus against various things */ { register struct permonst *pd = mdef->data; register int tmp = d((int)mattk->damn, (int)mattk->damd); @@ -2323,9 +2302,7 @@ int specialdmg; /* blessed and/or silver bonus against various things */ } static int -explum(mdef, mattk) -register struct monst *mdef; -register struct attack *mattk; +explum(register struct monst *mdef, register struct attack *mattk) { register int tmp = d((int)mattk->damn, (int)mattk->damd); @@ -2383,8 +2360,7 @@ register struct attack *mattk; } static void -start_engulf(mdef) -struct monst *mdef; +start_engulf(struct monst *mdef) { if (!Invisible) { map_location(u.ux, u.uy, TRUE); @@ -2397,7 +2373,7 @@ struct monst *mdef; } static void -end_engulf() +end_engulf(void) { if (!Invisible) { tmp_at(DISP_END, 0); @@ -2406,9 +2382,7 @@ end_engulf() } static int -gulpum(mdef, mattk) -register struct monst *mdef; -register struct attack *mattk; +gulpum(register struct monst *mdef, register struct attack *mattk) { register int tmp; register int dam = d((int)mattk->damn, (int)mattk->damd); @@ -2604,10 +2578,7 @@ register struct attack *mattk; } void -missum(mdef, mattk, wouldhavehit) -struct monst *mdef; -struct attack *mattk; -boolean wouldhavehit; +missum(struct monst *mdef, struct attack *mattk, boolean wouldhavehit) { if (wouldhavehit) { /* monk is missing due to penalty for wearing suit */ @@ -2625,8 +2596,7 @@ boolean wouldhavehit; /* attack monster as a monster; returns true if mon survives */ static boolean -hmonas(mon) -register struct monst *mon; +hmonas(register struct monst *mon) { struct attack *mattk, alt_attk; struct obj *weapon, **originalweapon; @@ -3084,13 +3054,13 @@ register struct monst *mon; /* Special (passive) attacks on you by monsters done here. */ int -passive(mon, weapon, mhit, malive, aatyp, wep_was_destroyed) -struct monst *mon; -struct obj *weapon; /* uwep or uswapwep or uarmg or uarmf or Null */ -boolean mhit; -int malive; -uchar aatyp; -boolean wep_was_destroyed; +passive(struct monst *mon, struct obj *weapon, boolean mhit, int malive, uchar aatyp, boolean wep_was_destroyed) + + /* uwep or uswapwep or uarmg or uarmf or Null */ + + + + { register struct permonst *ptr = mon->data; register int i, tmp; @@ -3337,10 +3307,9 @@ boolean wep_was_destroyed; * Assumes the attack was successful. */ void -passive_obj(mon, obj, mattk) -struct monst *mon; -struct obj *obj; /* null means pick uwep, uswapwep or uarmg */ -struct attack *mattk; /* null means we find one internally */ +passive_obj(struct monst *mon, + struct obj *obj, /**< null means pick uwep, uswapwep or uarmg */ + struct attack *mattk) /**< null means we find one internally */ { struct permonst *ptr = mon->data; int i; @@ -3403,8 +3372,7 @@ struct attack *mattk; /* null means we find one internally */ /* Note: caller must ascertain mtmp is mimicking... */ void -stumble_onto_mimic(mtmp) -struct monst *mtmp; +stumble_onto_mimic(struct monst *mtmp) { const char *fmt = "Wait! That's %s!", *generic = "a monster", @@ -3448,8 +3416,7 @@ struct monst *mtmp; } static void -nohandglow(mon) -struct monst *mon; +nohandglow(struct monst *mon) { char *hands = makeplural(body_part(HAND)); @@ -3470,9 +3437,9 @@ struct monst *mon; } int -flash_hits_mon(mtmp, otmp) -struct monst *mtmp; -struct obj *otmp; /* source of flash */ +flash_hits_mon( + struct monst *mtmp, + struct obj *otmp) /*< source of flash */ { int tmp, amt, res = 0, useeit = canseemon(mtmp); @@ -3523,9 +3490,7 @@ struct obj *otmp; /* source of flash */ } void -light_hits_gremlin(mon, dmg) -struct monst *mon; -int dmg; +light_hits_gremlin(struct monst *mon, int dmg) { pline("%s %s!", Monnam(mon), (dmg > mon->mhp / 2) ? "wails in agony" : "cries out in pain"); mon->mhp -= dmg; diff --git a/src/vault.c b/src/vault.c index 9020fe739..2cc184804 100644 --- a/src/vault.c +++ b/src/vault.c @@ -3,7 +3,7 @@ #include "hack.h" -static boolean clear_fcorr(struct monst *, BOOLEAN_P); +static boolean clear_fcorr(struct monst *, boolean); static void blackout(int, int); static void restfakecorr(struct monst *); static void parkguard(struct monst *); @@ -15,8 +15,7 @@ static void gd_mv_monaway(struct monst *, int, int); static void gd_pick_corridor_gold(struct monst *, int, int); void -newegd(mtmp) -struct monst *mtmp; +newegd(struct monst *mtmp) { if (!mtmp->mextra) mtmp->mextra = newmextra(); @@ -27,8 +26,7 @@ struct monst *mtmp; } void -free_egd(mtmp) -struct monst *mtmp; +free_egd(struct monst *mtmp) { if (mtmp->mextra && EGD(mtmp)) { free((genericptr_t) EGD(mtmp)); @@ -41,9 +39,7 @@ struct monst *mtmp; maintained by guard 'grd'; if guard is still in it, removal will fail, to be tried again later */ static boolean -clear_fcorr(grd, forceshow) -struct monst *grd; -boolean forceshow; +clear_fcorr(struct monst *grd, boolean forceshow) { int fcx, fcy, fcbeg; struct monst *mtmp; @@ -125,8 +121,7 @@ boolean forceshow; the corridor, we don't want the light to reappear if/when a new tunnel goes through the same area */ static void -blackout(x, y) -int x, y; +blackout(int x, int y) { struct rm *lev; int i, j; @@ -148,8 +143,7 @@ int x, y; } static void -restfakecorr(grd) -struct monst *grd; +restfakecorr(struct monst *grd) { /* it seems you left the corridor - let the guard disappear */ if (clear_fcorr(grd, FALSE)) { @@ -160,8 +154,7 @@ struct monst *grd; /* move guard--dead to alive--to <0,0> until temporary corridor is removed */ static void -parkguard(grd) -struct monst *grd; +parkguard(struct monst *grd) { /* either guard is dead or will now be treated as if so; monster traversal loops should skip it */ @@ -181,8 +174,7 @@ struct monst *grd; /* called in mon.c */ boolean -grddead(grd) -struct monst *grd; +grddead(struct monst *grd) { boolean dispose = clear_fcorr(grd, TRUE); @@ -200,9 +192,7 @@ struct monst *grd; } static boolean -in_fcorridor(grd, x, y) -struct monst *grd; -int x, y; +in_fcorridor(struct monst *grd, int x, int y) { int fci; struct egd *egrd = EGD(grd); @@ -217,7 +207,7 @@ int x, y; } struct monst * -findgd() +findgd(void) { register struct monst *mtmp; @@ -233,7 +223,7 @@ findgd() } void -vault_summon_gd() +vault_summon_gd(void) { if (vault_occupied(u.urooms) && !findgd()) { u.uinvault = (VAULT_GUARD_TIME - 1); @@ -241,8 +231,7 @@ vault_summon_gd() } char -vault_occupied(array) -char *array; +vault_occupied(char *array) { register char *ptr; @@ -254,8 +243,7 @@ char *array; /* hero has teleported out of vault while a guard is active */ void -uleftvault(grd) -struct monst *grd; +uleftvault(struct monst *grd) { /* only called if caller has checked vault_occupied() and findgd() */ if (!grd || !grd->isgd || DEADMONSTER(grd)) { @@ -280,9 +268,7 @@ struct monst *grd; } static boolean -find_guard_dest(guard, rx, ry) -struct monst *guard; -xchar *rx, *ry; +find_guard_dest(struct monst *guard, xchar *rx, xchar *ry) { register int x, y, dd, lx = 0, ly = 0; @@ -318,7 +304,7 @@ xchar *rx, *ry; } void -invault() +invault(void) { struct monst *guard; boolean gsensed; @@ -563,9 +549,7 @@ invault() } static void -move_gold(gold, vroom) -struct obj *gold; -int vroom; +move_gold(struct obj *gold, int vroom) { xchar nx, ny; @@ -579,8 +563,7 @@ int vroom; } static void -wallify_vault(grd) -struct monst *grd; +wallify_vault(struct monst *grd) { int x, y, typ; int vlt = EGD(grd)->vroom; @@ -653,9 +636,7 @@ struct monst *grd; } static void -gd_mv_monaway(grd, nx, ny) -register struct monst *grd; -int nx, ny; +gd_mv_monaway(register struct monst *grd, int nx, int ny) { if (MON_AT(nx, ny) && !(nx == grd->mx && ny == grd->my)) { if (!Deaf) @@ -668,9 +649,7 @@ int nx, ny; /* have guard pick gold off the floor, possibly moving to the gold's position before message and back to his current spot after */ static void -gd_pick_corridor_gold(grd, goldx, goldy) -struct monst *grd; -int goldx, goldy; /* ox, gold->oy> */ +gd_pick_corridor_gold(struct monst *grd, int goldx, int goldy) { struct obj *gold; coord newcc, bestcc; @@ -760,8 +739,7 @@ int goldx, goldy; /* ox, gold->oy> */ * return 1: guard moved, 0: guard didn't, -1: let m_move do it, -2: died */ int -gd_move(grd) -register struct monst *grd; +gd_move(register struct monst *grd) { int x, y, nx, ny, m, n; int dx, dy, gx = 0, gy = 0, fci; @@ -1110,8 +1088,7 @@ nextnxy: ; /* Routine when dying or quitting with a vault guard around */ void -paygd(silently) -boolean silently; +paygd(boolean silently) { register struct monst *grd = findgd(); long umoney = money_cnt(invent); @@ -1159,7 +1136,7 @@ boolean silently; } long -hidden_gold() +hidden_gold(void) { register long value = 0L; register struct obj *obj; @@ -1174,7 +1151,7 @@ hidden_gold() /* prevent "You hear footsteps.." when inappropriate */ boolean -gd_sound() +gd_sound(void) { register struct monst *grd = findgd(); @@ -1183,8 +1160,7 @@ gd_sound() } void -vault_gd_watching(activity) -unsigned int activity; +vault_gd_watching(unsigned int activity) { struct monst *guard = findgd(); diff --git a/src/version.c b/src/version.c index 3f6c1953e..c57408d62 100644 --- a/src/version.c +++ b/src/version.c @@ -17,16 +17,14 @@ /* fill buffer with short version (so caller can avoid including date.h) */ char * -version_string(buf) -char *buf; +version_string(char *buf) { return strcpy(buf, VERSION_STRING); } /* fill and return the given buffer with the long nethack version string */ char * -getversionstring(buf) -char *buf; +getversionstring(char *buf) { Strcpy(buf, VERSION_ID); #if defined(BETA) && defined(BETA_INFO) @@ -40,7 +38,7 @@ char *buf; /** the 'V' command */ int -doversion() +doversion(void) { char buf[BUFSZ]; @@ -50,7 +48,7 @@ doversion() /** the '#version' command; also a choice for '?' */ int -doextversion() +doextversion(void) { display_file_area(NH_OPTIONS_USED_AREA, OPTIONS_USED, TRUE); return 0; @@ -66,10 +64,7 @@ long filetime; #endif boolean -check_version(version_data, filename, complain) -struct version_info *version_data; -const char *filename; -boolean complain; +check_version(struct version_info *version_data, const char *filename, boolean complain) { if ( #ifdef VERSION_COMPATIBILITY @@ -102,9 +97,7 @@ boolean complain; /* this used to be based on file date and somewhat OS-dependant, but now examines the initial part of the file's contents */ boolean -uptodate(fd, name) -int fd; -const char *name; +uptodate(int fd, const char *name) { int rlen; struct version_info vers_info; @@ -127,8 +120,7 @@ const char *name; } void -store_version(fd) -int fd; +store_version(int fd) { static const struct version_info version_data = { VERSION_NUMBER, VERSION_FEATURES, @@ -147,8 +139,7 @@ const char amiga_version_string[] = AMIGA_VERSION_STRING; #endif unsigned long -get_feature_notice_ver(str) -char *str; +get_feature_notice_ver(char *str) { char buf[BUFSZ]; int ver_maj, ver_min, patch; @@ -178,7 +169,7 @@ char *str; } unsigned long -get_current_feature_ver() +get_current_feature_ver(void) { return FEATURE_NOTICE_VER(VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL); } diff --git a/src/vision.c b/src/vision.c index 7da0bd1c3..d60c28524 100644 --- a/src/vision.c +++ b/src/vision.c @@ -94,7 +94,7 @@ static char right_ptrs[ROWNO][COLNO]; /* Forward declarations. */ static void fill_point(int, int); static void dig_point(int, int); -static void view_init(); +static void view_init(void); static void view_from(int, int, char **, char *, char *, int, void (*)(int, int, genericptr_t), genericptr_t); @@ -116,7 +116,7 @@ static void rogue_vision(char **, char *, char *); * or before a game restore. Else we die a horrible death. */ void -vision_init() +vision_init(void) { int i; @@ -153,9 +153,7 @@ vision_init() * sight. */ int -does_block(x, y, lev) -int x, y; -register struct rm *lev; +does_block(int x, int y, register struct rm *lev) { struct obj *obj; struct monst *mon; @@ -193,7 +191,7 @@ register struct rm *lev; * level and the level monsters and objects are in place. */ void -vision_reset() +vision_reset(void) { int y; register int x, i, dig_left, block; @@ -255,9 +253,7 @@ vision_reset() * to the unused vision work area. */ static void -get_unused_cs(rows, rmin, rmax) -char ***rows; -char **rmin, **rmax; +get_unused_cs(char ***rows, char **rmin, char **rmax) { register int row; register char *nrmin, *nrmax; @@ -298,9 +294,9 @@ char **rmin, **rmax; * due to the one-sided lit wall hack. */ static void -rogue_vision(next, rmin, rmax) -char **next; /* could_see array pointers */ -char *rmin, *rmax; +rogue_vision(char **next, char *rmin, char *rmax) + /* could_see array pointers */ + { int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET; /* no SHARED... */ int start, stop, in_door, xhi, xlo, yhi, ylo; @@ -489,8 +485,7 @@ int row, col; * + Just before bubbles are moved. [movebubbles()] */ void -vision_recalc(control) -int control; +vision_recalc(int control) { char **temp_array; /* points to the old vision array */ char **next_array; /* points to the new vision array */ @@ -828,8 +823,7 @@ int control; * Make the location opaque to light. */ void -block_point(x, y) -int x, y; +block_point(int x, int y) { fill_point(y, x); @@ -851,8 +845,7 @@ int x, y; * Make the location transparent to light. */ void -unblock_point(x, y) -int x, y; +unblock_point(int x, int y) { dig_point(y, x); @@ -911,8 +904,7 @@ int x, y; * spot on its right) will point to itself. */ static void -dig_point(row, col) -int row, col; +dig_point(int row, int col) { int i; @@ -992,8 +984,7 @@ int row, col; } static void -fill_point(row, col) -int row, col; +fill_point(int row, int col) { int i; @@ -1512,8 +1503,7 @@ int scol, srow, y2, x2; * do_light_sources() */ boolean -clear_path(col1, row1, col2, row2) -int col1, row1, col2, row2; +clear_path(int col1, int row1, int col2, int row2) { int result; @@ -1661,13 +1651,13 @@ int side, this_row, block_row, block_col; * Figure out what could be seen on the right side of the source. */ static void -right_side(row, cb_row, cb_col, fb_row, fb_col, left, right_mark, limits) -int row; /* current row */ -int cb_row, cb_col; /* close block row and col */ -int fb_row, fb_col; /* far block row and col */ -int left; /* left mark of the previous row */ -int right_mark; /* right mark of previous row */ -char *limits; /* points at range limit for current row, or NULL */ +right_side( + int row, /**< current row */ + int cb_row, cb_col, /**< close block row and col */ + int fb_row, fb_col, /**< far block row and col */ + int left, /**< left mark of the previous row */ + int right_mark, /**< right mark of previous row */ + char *limits) /**< points at range limit for current row, or NULL */ { register int i; char *rowp = NULL; @@ -2186,7 +2176,7 @@ static void left_side(int, int, int, char*); /* Initialize algorithm C (nothing). */ static void -view_init() +view_init(void) { } @@ -2195,11 +2185,11 @@ view_init() * quadrant is determined by the value of the global variable step. */ static void -right_side(row, left, right_mark, limits) -int row; /* current row */ -int left; /* first (left side) visible spot on prev row */ -int right_mark; /* last (right side) visible spot on prev row */ -char *limits; /* points at range limit for current row, or NULL */ +right_side( + int row, /**< current row */ + int left, /**< first (left side) visible spot on prev row */ + int right_mark, /**< last (right side) visible spot on prev row */ + char *limits) /**< points at range limit for current row, or NULL */ { int right; /* right limit of "could see" */ int right_edge; /* right edge of an opening */ @@ -2375,9 +2365,7 @@ char *limits; /* points at range limit for current row, or NULL */ * extensive comments. */ static void -left_side(row, left_mark, right, limits) -int row, left_mark, right; -char *limits; +left_side(int row, int left_mark, int right, char *limits) { int left, left_edge, nrow, deeper, result; register int i; @@ -2495,14 +2483,14 @@ char *limits; * array provided. */ static void -view_from(srow, scol, loc_cs_rows, left_most, right_most, range, func, arg) -int srow, scol; /* starting row and column */ -char **loc_cs_rows; /* pointers to the rows of the could_see array */ -char *left_most; /* min mark on each row */ -char *right_most; /* max mark on each row */ -int range; /* 0 if unlimited */ -void (*func)(int, int, genericptr_t); -genericptr_t arg; +view_from(int srow, int scol, char **loc_cs_rows, char *left_most, char *right_most, int range, void (*func) (int, int, genericptr_t), genericptr_t arg) + /* starting row and column */ + /* pointers to the rows of the could_see array */ + /* min mark on each row */ + /* max mark on each row */ + /* 0 if unlimited */ + + { register int i; /* loop counter */ char *rowp; /* optimization for setting could_see */ @@ -2590,10 +2578,7 @@ genericptr_t arg; * vision matrix and reduce extra work. */ void -do_clear_area(scol, srow, range, func, arg) -int scol, srow, range; -void (*func)(int, int, genericptr_t); -genericptr_t arg; +do_clear_area(int scol, int srow, int range, void (*func) (int, int, genericptr_t), genericptr_t arg) { /* If not centered on hero, do the hard work of figuring the area */ if (scol != u.ux || srow != u.uy) @@ -2631,8 +2616,7 @@ genericptr_t arg; /* bitmask indicating ways mon is seen; extracted from lookat(pager.c) */ unsigned -how_mon_is_seen(mon) -struct monst *mon; +how_mon_is_seen(struct monst *mon) { boolean useemon = (boolean) canseemon(mon); int xraydist = (u.xray_range < 0) ? -1 : (u.xray_range * u.xray_range); diff --git a/src/weapon.c b/src/weapon.c index 540979cd6..95e1667fa 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -74,8 +74,7 @@ static NEARDATA const char * const barehands_or_martial[] = { }; static void -give_may_advance_msg(skill) -int skill; +give_may_advance_msg(int skill) { You_feel("more confident in your %sskills.", skill == P_NONE ? @@ -87,7 +86,7 @@ int skill; "fighting "); } -static boolean can_advance(int, BOOLEAN_P); +static boolean can_advance(int, boolean); static boolean could_advance(int); static boolean peaked_skill(int); static int slots_required(int); @@ -108,8 +107,7 @@ static NEARDATA const char kebabable[] = { mostly used to shorten "you drop your " messages when slippery fingers or polymorph causes hero to involuntarily drop wielded weapon(s) */ const char * -weapon_descr(obj) -struct obj *obj; +weapon_descr(struct obj *obj) { int skill = weapon_type(obj); const char *descr = P_NAME(skill); @@ -173,9 +171,7 @@ struct obj *obj; * of "otmp" against the monster. */ int -hitval(otmp, mon) -struct obj *otmp; -struct monst *mon; +hitval(struct obj *otmp, struct monst *mon) { int tmp = 0; struct permonst *ptr = mon->data; @@ -246,9 +242,7 @@ struct monst *mon; * of "otmp" against the monster. */ int -dmgval(otmp, mon) -struct obj *otmp; -struct monst *mon; +dmgval(struct obj *otmp, struct monst *mon) { struct damage_info_t ignored = {0}; return dmgval_core(otmp, mon, &ignored); @@ -446,11 +440,13 @@ struct damage_info_t *damage_info) /* check whether blessed and/or silver damage applies for *non-weapon* hit; return value is the amount of the extra damage */ int -special_dmgval(magr, mdef, armask, silverhit_p) -struct monst *magr, *mdef; -long armask; /* armor mask, multiple bits accepted for W_ARMC|W_ARM|W_ARMU - * or W_ARMG|W_RINGL|W_RINGR only */ -long *silverhit_p; /* output flag mask for silver bonus */ +special_dmgval( + struct monst *magr, /**< attacker */ + struct monst *mdef, /**< defender */ + long armask, /**< armor mask, multiple bits accepted for + * W_ARMC|W_ARM|W_ARMU or + * W_ARMG|W_RINGL|W_RINGR only */ + long *silverhit_p) /**< output flag mask for silver bonus */ { struct obj *obj; struct permonst *ptr = mdef->data; @@ -519,10 +515,7 @@ long *silverhit_p; /* output flag mask for silver bonus */ /* give a "silver sears " message; not used for weapon hit, so we only handle rings */ void -silver_sears(magr, mdef, silverhit) -struct monst *magr UNUSED; -struct monst *mdef; -long silverhit; +silver_sears(struct monst *magr UNUSED, struct monst *mdef, long int silverhit) { char rings[20]; /* plenty of room for "rings" */ int ltyp = ((uleft && (silverhit & W_RINGL)) ? uleft->otyp : STRANGE_OBJECT); @@ -551,9 +544,7 @@ static struct obj *oselect(struct monst *, int); #define Oselect(x) if ((otmp = oselect(mtmp, x)) != 0) return (otmp); static struct obj * -oselect(mtmp, x) -struct monst *mtmp; -int x; +oselect(struct monst *mtmp, int x) { struct obj *otmp; @@ -585,8 +576,7 @@ static struct obj *propellor; /* select a ranged weapon for the monster */ struct obj * -select_rwep(mtmp) -register struct monst *mtmp; +select_rwep(register struct monst *mtmp) { register struct obj *otmp; int i; @@ -706,8 +696,7 @@ register struct monst *mtmp; /* is 'obj' a type of weapon that any monster knows how to throw? */ boolean -mon_might_throw_wep(obj) -struct obj *obj; +mon_might_throw_wep(struct obj *obj) { short idx; @@ -738,8 +727,7 @@ static const NEARDATA short hwep[] = { /* select a hand to hand weapon for the monster */ struct obj * -select_hwep(mtmp) -struct monst *mtmp; +select_hwep(struct monst *mtmp) { struct obj *otmp; int i; @@ -788,9 +776,7 @@ struct monst *mtmp; * otherwise never unwield stuff on their own. Might print message. */ void -possibly_unwield(mon, polyspot) -struct monst *mon; -boolean polyspot; +possibly_unwield(struct monst *mon, boolean polyspot) { struct obj *obj, *mw_tmp; @@ -844,8 +830,7 @@ boolean polyspot; * Returns 1 if the monster took time to do it, 0 if it did not. */ int -mon_wield_item(mon) -register struct monst *mon; +mon_wield_item(register struct monst *mon) { struct obj *obj; @@ -963,8 +948,7 @@ register struct monst *mon; /* force monster to stop wielding current weapon, if any */ void -mwepgone(mon) -struct monst *mon; +mwepgone(struct monst *mon) { struct obj *mwep = MON_WEP(mon); @@ -976,7 +960,7 @@ struct monst *mon; /* attack bonus for strength & dexterity */ int -abon() +abon(void) { int sbon; int str = ACURR(A_STR), dex = ACURR(A_DEX); @@ -1001,7 +985,7 @@ abon() /* damage bonus for strength */ int -dbon() +dbon(void) { int str = ACURR(A_STR); int dbon = 0; @@ -1031,10 +1015,10 @@ dbon() /* increase a towel's wetness */ void -wet_a_towel(obj, amt, verbose) -struct obj *obj; -int amt; /* positive: new value; negative: increment by -amt; zero: no-op */ -boolean verbose; +wet_a_towel(struct obj *obj, int amt, boolean verbose) + + /* positive: new value; negative: increment by -amt; zero: no-op */ + { int newspe = (amt <= 0) ? obj->spe - amt : amt; @@ -1063,10 +1047,10 @@ boolean verbose; /* decrease a towel's wetness */ void -dry_a_towel(obj, amt, verbose) -struct obj *obj; -int amt; /* positive: new value; negative: decrement by -amt; zero: no-op */ -boolean verbose; +dry_a_towel(struct obj *obj, int amt, boolean verbose) + + /* positive: new value; negative: decrement by -amt; zero: no-op */ + { int newspe = (amt <= 0) ? obj->spe + amt : amt; @@ -1094,10 +1078,7 @@ boolean verbose; /* copy the skill level name into the given buffer */ char * -skill_level_name(skill, buf, max) -int skill; -char *buf; -boolean max; +skill_level_name(int skill, char *buf, boolean max) { const char *ptr; @@ -1117,16 +1098,14 @@ boolean max; } const char * -skill_name(skill) -int skill; +skill_name(int skill) { return P_NAME(skill); } /* return the # of slots required to advance the skill */ static int -slots_required(skill) -int skill; +slots_required(int skill) { int tmp = P_SKILL(skill); @@ -1150,9 +1129,7 @@ int skill; /* return true if this skill can be advanced */ boolean -can_advance(skill, speedy) -int skill; -boolean speedy; +can_advance(int skill, boolean speedy) { if (P_RESTRICTED(skill) || P_SKILL(skill) >= P_MAX_SKILL(skill) || @@ -1171,7 +1148,7 @@ boolean speedy; /* return true if any skill can be advanced */ boolean -can_advance_something() +can_advance_something(void) { int i; for (i = 0; i < P_NUM_SKILLS; i++) @@ -1182,8 +1159,7 @@ can_advance_something() /* return true if this skill could be advanced if more slots were available */ static boolean -could_advance(skill) -int skill; +could_advance(int skill) { if (P_RESTRICTED(skill) || P_SKILL(skill) >= P_MAX_SKILL(skill) || @@ -1197,8 +1173,7 @@ int skill; /* return true if this skill has reached its maximum and there's been enough practice to become eligible for the next step if that had been possible */ static boolean -peaked_skill(skill) -int skill; +peaked_skill(int skill) { if (P_RESTRICTED(skill)) { return FALSE; @@ -1211,8 +1186,7 @@ int skill; /* return true if this skill requires only a bit more exercise before it can * be advanced (if it's 80% of the way to the next level) */ static boolean -can_almost_advance(skill) -int skill; +can_almost_advance(int skill) { if ( P_RESTRICTED(skill) || P_SKILL(skill) >= P_MAX_SKILL(skill) @@ -1230,8 +1204,7 @@ int skill; } static void -skill_advance(skill) -int skill; +skill_advance(int skill) { u.weapon_slots -= slots_required(skill); P_SKILL(skill)++; @@ -1260,14 +1233,14 @@ static const struct skill_range { * others unselectable. */ int -enhance_weapon_skill() +enhance_weapon_skill(void) { return enhance_skill(FALSE); } /* Dump the weapon skills. */ void -dump_weapon_skill() +dump_weapon_skill(void) { enhance_skill(TRUE); } @@ -1481,8 +1454,7 @@ int enhance_skill(boolean want_dump) * function may be called with with P_NONE. Used in pray.c as well as below. */ void -unrestrict_weapon_skill(skill) -int skill; +unrestrict_weapon_skill(int skill) { if (skill < P_NUM_SKILLS && P_RESTRICTED(skill)) { P_SKILL(skill) = P_UNSKILLED; @@ -1492,9 +1464,7 @@ int skill; } void -use_skill(skill, degree) -int skill; -int degree; +use_skill(int skill, int degree) { boolean advance_before; @@ -1507,8 +1477,7 @@ int degree; } void -add_weapon_skill(n) -int n; /* number of slots to gain; normally one */ +add_weapon_skill(int n) /**< number of slots to gain; normally one */ { int i, before, after; @@ -1522,8 +1491,7 @@ int n; /* number of slots to gain; normally one */ } void -lose_weapon_skill(n) -int n; /* number of slots to lose; normally one */ +lose_weapon_skill(int n) /**< number of slots to lose; normally one */ { int skill; @@ -1546,8 +1514,7 @@ int n; /* number of slots to lose; normally one */ } int -weapon_type(obj) -struct obj *obj; +weapon_type(struct obj *obj) { /* KMH -- now uses the object table */ int type; @@ -1568,7 +1535,7 @@ struct obj *obj; } int -uwep_skill_type() +uwep_skill_type(void) { if (u.twoweap) return P_TWO_WEAPON_COMBAT; @@ -1580,8 +1547,7 @@ uwep_skill_type() * Treat restricted weapons as unskilled. */ int -weapon_hit_bonus(weapon) -struct obj *weapon; +weapon_hit_bonus(struct obj *weapon) { int type, wep_type, skill, bonus = 0; static const char bad_skill[] = "weapon_hit_bonus: bad skill %d"; @@ -1647,8 +1613,7 @@ struct obj *weapon; * Treat restricted weapons as unskilled. */ int -weapon_dam_bonus(weapon) -struct obj *weapon; +weapon_dam_bonus(struct obj *weapon) { int type, wep_type, skill, bonus = 0; @@ -1715,8 +1680,7 @@ struct obj *weapon; * maximums. */ void -skill_init(class_skill) -const struct def_skill *class_skill; +skill_init(const struct def_skill *class_skill) { struct obj *obj; int skmax, skill; @@ -1790,9 +1754,7 @@ const struct def_skill *class_skill; } void -setmnotwielded(mon, obj) -register struct monst *mon; -register struct obj *obj; +setmnotwielded(register struct monst *mon, register struct obj *obj) { if (!obj) return; if (artifact_light(obj) && obj->lamplit) { diff --git a/src/were.c b/src/were.c index 3aaedd7d1..71970fde8 100644 --- a/src/were.c +++ b/src/were.c @@ -4,8 +4,7 @@ #include "hack.h" void -were_change(mon) -register struct monst *mon; +were_change(register struct monst *mon) { if (!is_were(mon->data)) return; @@ -35,8 +34,7 @@ register struct monst *mon; } int -counter_were(pm) -int pm; +counter_were(int pm) { switch(pm) { case PM_WEREWOLF: return(PM_HUMAN_WEREWOLF); @@ -52,8 +50,7 @@ int pm; /* convert monsters similar to werecritters into appropriate werebeast */ int -were_beastie(pm) -int pm; +were_beastie(int pm) { switch (pm) { case PM_WERERAT: @@ -78,8 +75,7 @@ int pm; } void -new_were(mon) -register struct monst *mon; +new_were(register struct monst *mon) { register int pm; @@ -111,11 +107,11 @@ register struct monst *mon; /* were-creature (even you) summons a horde */ int -were_summon(ptr, yours, visible, genbuf) -struct permonst *ptr; -boolean yours; -int *visible; /* number of visible helpers created */ -char *genbuf; +were_summon(struct permonst *ptr, boolean yours, int *visible, char *genbuf) + + + /* number of visible helpers created */ + { int i, typ, pm = monsndx(ptr); struct monst *mtmp; @@ -159,7 +155,7 @@ char *genbuf; } void -you_were() +you_were(void) { char qbuf[QBUFSZ]; boolean controllable_poly = Polymorph_control && !(Stunned || Unaware); @@ -175,8 +171,7 @@ you_were() } void -you_unwere(purify) -boolean purify; +you_unwere(boolean purify) { if (purify) { You_feel("purified."); @@ -189,8 +184,7 @@ boolean purify; /* lycanthropy is being caught or cured, but no shape change is involved */ void -set_ulycn(which) -int which; +set_ulycn(int which) { u.ulycn = which; /* add or remove lycanthrope's innate intrinsics (Drain_resistance) */ diff --git a/src/wield.c b/src/wield.c index 0e4941964..8c80f5182 100644 --- a/src/wield.c +++ b/src/wield.c @@ -84,8 +84,7 @@ static int wield(boolean prompt_for_obj); * to print the appropriate messages. */ void -setuwep(obj) -register struct obj *obj; +setuwep(register struct obj *obj) { struct obj *olduwep = uwep; int oldcon = acurr(A_CON); @@ -143,8 +142,7 @@ register struct obj *obj; } static boolean -cant_wield_corpse(obj) -struct obj *obj; +cant_wield_corpse(struct obj *obj) { char kbuf[BUFSZ]; @@ -163,8 +161,7 @@ struct obj *obj; } static int -ready_weapon(wep) -struct obj *wep; +ready_weapon(struct obj *wep) { /* Separated function so swapping works easily */ int res = 0; @@ -257,15 +254,13 @@ struct obj *wep; } void -setuqwep(obj) -register struct obj *obj; +setuqwep(register struct obj *obj) { setworn(obj, W_QUIVER); } void -setuswapwep(obj) -register struct obj *obj; +setuswapwep(register struct obj *obj) { if (obj) { obj->quiver_priority = 0; @@ -287,22 +282,21 @@ static NEARDATA const char bullets[] = { /* (note: different from dothrow.c) */ /** Unwield a weapon. */ int -dounwield() +dounwield(void) { return wield(FALSE); } /** Wield an item as weapon. */ int -dowield() +dowield(void) { return wield(TRUE); } /* Main method for wielding and unwielding. */ static int -wield(prompt_for_obj) -boolean prompt_for_obj; +wield(boolean prompt_for_obj) { register struct obj *wep=&zeroobj, *oldwep; int result; @@ -356,7 +350,7 @@ boolean prompt_for_obj; } int -doswapweapon() +doswapweapon(void) { register struct obj *oldwep, *oldswap; int result = 0; @@ -399,7 +393,7 @@ doswapweapon() } int -dowieldquiver() +dowieldquiver(void) { struct obj *newquiver; struct obj *oldquiver = uquiver; @@ -474,9 +468,9 @@ dowieldquiver() /* used for #rub and for applying pick-axe, whip, grappling hook, or polearm */ /* (moved from apply.c) */ boolean -wield_tool(obj, verb) -struct obj *obj; -const char *verb; /* "rub",&c */ +wield_tool( + struct obj *obj, + const char *verb) /**< "rub",&c */ { const char *what; boolean more_than_1; @@ -547,7 +541,7 @@ const char *verb; /* "rub",&c */ } int -can_twoweapon() +can_twoweapon(void) { struct obj *otmp; @@ -606,7 +600,7 @@ can_twoweapon() } void -drop_uswapwep() +drop_uswapwep(void) { char str[BUFSZ]; struct obj *obj = uswapwep; @@ -618,7 +612,7 @@ drop_uswapwep() } int -dotwoweapon() +dotwoweapon(void) { /* You can always toggle it off */ if (u.twoweap) { @@ -646,7 +640,7 @@ dotwoweapon() * 2. Making an item disappear for a bones pile. */ void -uwepgone() +uwepgone(void) { if (uwep) { if (artifact_light(uwep) && uwep->lamplit) { @@ -662,7 +656,7 @@ uwepgone() } void -uswapwepgone() +uswapwepgone(void) { if (uswapwep) { setworn((struct obj *)0, W_SWAPWEP); @@ -671,7 +665,7 @@ uswapwepgone() } void -uqwepgone() +uqwepgone(void) { if (uquiver) { setworn((struct obj *)0, W_QUIVER); @@ -680,7 +674,7 @@ uqwepgone() } void -untwoweapon() +untwoweapon(void) { if (u.twoweap) { You("can no longer use two weapons at once."); @@ -691,9 +685,7 @@ untwoweapon() } int -chwepon(otmp, amount) -register struct obj *otmp; -register int amount; +chwepon(register struct obj *otmp, register int amount) { const char *color = hcolor((amount < 0) ? NH_BLACK : NH_BLUE); const char *xtime; @@ -836,8 +828,7 @@ register int amount; } int -welded(obj) -register struct obj *obj; +welded(register struct obj *obj) { if (obj && obj == uwep && will_weld(obj)) { set_bknown(obj, 1); @@ -847,8 +838,7 @@ register struct obj *obj; } void -weldmsg(obj) -register struct obj *obj; +weldmsg(register struct obj *obj) { long savewornmask; @@ -861,8 +851,7 @@ register struct obj *obj; /** test whether monster's wielded weapon is stuck to hand/paw/whatever */ boolean -mwelded(obj) -struct obj *obj; +mwelded(struct obj *obj) { /* caller is responsible for making sure this is a monster's item */ if (obj && (obj->owornmask & W_WEP) && will_weld(obj)) { @@ -873,7 +862,7 @@ struct obj *obj; /** Unwields all weapons silently. */ void -unwield_weapons_silently() +unwield_weapons_silently(void) { setuwep((struct obj *) 0); setuswapwep((struct obj *) 0); diff --git a/src/windows.c b/src/windows.c index 8b0299bb2..8f9266590 100644 --- a/src/windows.c +++ b/src/windows.c @@ -104,15 +104,13 @@ struct win_choices { }; static void -def_raw_print(s) -const char *s; +def_raw_print(const char *s) { puts(s); } void -choose_windows(s) -const char *s; +choose_windows(const char *s) { register int i; @@ -141,10 +139,7 @@ const char *s; */ /*ARGSUSED*/ char -genl_message_menu(let, how, mesg) -char let UNUSED; -int how UNUSED; -const char *mesg; +genl_message_menu(char let UNUSED, int how UNUSED, const char *mesg) { pline("%s", mesg); return 0; @@ -152,8 +147,7 @@ const char *mesg; /*ARGSUSED*/ void -genl_preference_update(pref) -const char *pref UNUSED; +genl_preference_update(const char *pref UNUSED) { /* window ports are expected to provide their own preference update routine diff --git a/src/wizard.c b/src/wizard.c index f08a6776b..2d058c1ed 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -12,9 +12,9 @@ extern const int monstr[]; static short which_arti(int); -static boolean mon_has_arti(struct monst *, SHORT_P); -static struct monst *other_mon_has_arti(struct monst *, SHORT_P); -static struct obj *on_ground(SHORT_P); +static boolean mon_has_arti(struct monst *, short); +static struct monst *other_mon_has_arti(struct monst *, short); +static struct obj *on_ground(short); static boolean you_have(int); static unsigned long target_on(int, struct monst *); static unsigned long strategy(struct monst *); @@ -52,7 +52,7 @@ static NEARDATA const unsigned wizapp[] = { /* If you've found the Amulet, make the Wizard appear after some time */ /* Also, give hints about portal locations, if amulet is worn/wielded -dlc */ void -amulet() +amulet(void) { struct monst *mtmp; struct trap *ttmp; @@ -95,8 +95,7 @@ amulet() } int -mon_has_amulet(mtmp) -register struct monst *mtmp; +mon_has_amulet(register struct monst *mtmp) { register struct obj *otmp; @@ -106,8 +105,7 @@ register struct monst *mtmp; } int -mon_has_special(mtmp) -register struct monst *mtmp; +mon_has_special(register struct monst *mtmp) { register struct obj *otmp; @@ -132,8 +130,7 @@ register struct monst *mtmp; #define M_Wants(mask) (mtmp->data->mflags3 & (mask)) static short -which_arti(mask) -register int mask; +which_arti(register int mask) { switch(mask) { case M3_WANTSAMUL: return(AMULET_OF_YENDOR); @@ -151,9 +148,7 @@ register int mask; * artifacts right now. [MRS] */ static boolean -mon_has_arti(mtmp, otyp) -register struct monst *mtmp; -register short otyp; +mon_has_arti(struct monst *mtmp, short int otyp) { register struct obj *otmp; @@ -169,9 +164,7 @@ register short otyp; } static struct monst * -other_mon_has_arti(mtmp, otyp) -register struct monst *mtmp; -register short otyp; +other_mon_has_arti(struct monst *mtmp, short int otyp) { register struct monst *mtmp2; @@ -184,8 +177,7 @@ register short otyp; } static struct obj * -on_ground(otyp) -register short otyp; +on_ground(register short int otyp) { register struct obj *otmp; @@ -199,8 +191,7 @@ register short otyp; } static boolean -you_have(mask) -register int mask; +you_have(register int mask) { switch(mask) { case M3_WANTSAMUL: return (boolean)(u.uhave.amulet); @@ -214,9 +205,7 @@ register int mask; } static unsigned long -target_on(mask, mtmp) -register int mask; -register struct monst *mtmp; +target_on(register int mask, register struct monst *mtmp) { register short otyp; register struct obj *otmp; @@ -245,8 +234,7 @@ register struct monst *mtmp; } static unsigned long -strategy(mtmp) -register struct monst *mtmp; +strategy(register struct monst *mtmp) { unsigned long strat, dstrat; @@ -304,9 +292,7 @@ register struct monst *mtmp; } static void -choose_stairs(sx, sy) -xchar *sx; -xchar *sy; +choose_stairs(xchar *sx, xchar *sy) { xchar x = 0, y = 0; @@ -340,8 +326,7 @@ xchar *sy; } int -tactics(mtmp) -register struct monst *mtmp; +tactics(register struct monst *mtmp) { unsigned long strat = strategy(mtmp); xchar sx = 0, sy = 0, mx, my; @@ -442,8 +427,7 @@ register struct monst *mtmp; /* are there any monsters mon could aggravate? */ boolean -has_aggravatables(mon) -struct monst *mon; +has_aggravatables(struct monst *mon) { struct monst *mtmp; boolean in_w_tower = In_W_tower(mon->mx, mon->my, &u.uz); @@ -468,7 +452,7 @@ struct monst *mon; return FALSE; } void -aggravate() +aggravate(void) { register struct monst *mtmp; boolean in_w_tower = In_W_tower(u.ux, u.uy, &u.uz); @@ -490,7 +474,7 @@ aggravate() } void -clonewiz() +clonewiz(void) { register struct monst *mtmp2; @@ -509,7 +493,7 @@ clonewiz() /* also used by newcham() */ int -pick_nasty() +pick_nasty(void) { /* To do? Possibly should filter for appropriate forms when in the elemental planes or surrounded by water or lava. */ @@ -524,8 +508,7 @@ pick_nasty() creatures on average (in 3.6.0 and earlier, Null was treated as chaotic); returns the number of monsters created */ int -nasty(summoner) -struct monst *summoner; +nasty(struct monst *summoner) { struct monst *mtmp; int i, j; @@ -611,7 +594,7 @@ struct monst *summoner; /* Let's resurrect the wizard, for some unexpected fun. */ void -resurrect() +resurrect(void) { struct monst *mtmp, **mmtmp; long elapsed; @@ -666,7 +649,7 @@ resurrect() /* Here, we make trouble for the poor shmuck who actually */ /* managed to do in the Wizard. */ void -intervene() +intervene(void) { int which = Is_astralevel(&u.uz) ? rnd(4) : rn2(7); /* cases 0, 5, and 6 don't apply on the Astral level */ @@ -695,7 +678,7 @@ intervene() } void -wizdead() +wizdead(void) { flags.no_of_wizards--; if (!u.uevent.udemigod) { @@ -751,8 +734,7 @@ const char * const random_malediction[] = { /* Insult or intimidate the player */ void -cuss(mtmp) -register struct monst *mtmp; +cuss(register struct monst *mtmp) { if (mtmp->iswiz) { if (!rn2(5)) /* typical bad guy action */ diff --git a/src/worm.c b/src/worm.c index f6d4ed418..f43087bd3 100644 --- a/src/worm.c +++ b/src/worm.c @@ -13,9 +13,9 @@ struct wseg { xchar wx, wy; /* the segment's position */ }; -static void toss_wsegs(struct wseg *, BOOLEAN_P); +static void toss_wsegs(struct wseg *, boolean); static void shrink_worm(int); -static void random_dir(XCHAR_P, XCHAR_P, xchar *, xchar *); +static void random_dir(xchar, xchar, xchar *, xchar *); static struct wseg *create_worm_tail(int); /* Description of long worm implementation. @@ -82,7 +82,7 @@ long wgrowtime[MAX_NUM_WORMS] = DUMMY; * Implementation is left to the interested hacker. */ int -get_wormno() +get_wormno(void) { register int new_wormno = 1; @@ -108,9 +108,7 @@ get_wormno() * not be called. */ void -initworm(worm, wseg_count) -struct monst *worm; -int wseg_count; +initworm(struct monst *worm, int wseg_count) { register struct wseg *seg, *new_tail = create_worm_tail(wseg_count); register int wnum = worm->wormno; @@ -141,9 +139,7 @@ int wseg_count; * The display may or may not need to be updated as we free the segments. */ static void -toss_wsegs(curr, display_update) -register struct wseg *curr; -register boolean display_update; +toss_wsegs(register struct wseg *curr, register boolean display_update) { register struct wseg *seg; @@ -173,8 +169,7 @@ register boolean display_update; * Remove the tail segment of the worm (the starting segment of the list). */ static void -shrink_worm(wnum) -int wnum; /* worm number */ +shrink_worm(int wnum) /**< worm number */ { struct wseg *seg; @@ -194,8 +189,7 @@ int wnum; /* worm number */ * Move the worm. Maybe grow. */ void -worm_move(worm) -struct monst *worm; +worm_move(struct monst *worm) { register struct wseg *seg, *new_seg; /* new segment */ register int wnum = worm->wormno; /* worm number */ @@ -244,8 +238,7 @@ struct monst *worm; * The worm don't move so it should shrink. */ void -worm_nomove(worm) -register struct monst *worm; +worm_nomove(register struct monst *worm) { shrink_worm((int) worm->wormno); /* shrink */ @@ -263,8 +256,7 @@ register struct monst *worm; * Kill a worm tail. */ void -wormgone(worm) -register struct monst *worm; +wormgone(register struct monst *worm) { register int wnum = worm->wormno; @@ -291,8 +283,7 @@ register struct monst *worm; * If the hero is near any part of the worm, the worm will try to attack. */ void -wormhitu(worm) -register struct monst *worm; +wormhitu(register struct monst *worm) { register int wnum = worm->wormno; register struct wseg *seg; @@ -317,9 +308,7 @@ register struct monst *worm; * Remove the tail of a worm and adjust the hp of the worm. */ void -cutoff(worm, tail) -struct monst *worm; -struct wseg *tail; +cutoff(struct monst *worm, struct wseg *tail) { if (flags.mon_moving) pline("Part of the tail of %s is cut off.", mon_nam(worm)); @@ -338,10 +327,7 @@ struct wseg *tail; * that both halves will survive. */ void -cutworm(worm, x, y, weap) -struct monst *worm; -xchar x, y; -struct obj *weap; +cutworm(struct monst *worm, xchar x, xchar y, struct obj *weap) { register struct wseg *curr, *new_tail; register struct monst *new_worm; @@ -446,8 +432,7 @@ struct obj *weap; * is located here for modularity. */ void -see_wsegs(worm) -struct monst *worm; +see_wsegs(struct monst *worm) { struct wseg *curr = wtails[worm->wormno]; @@ -468,9 +453,7 @@ struct monst *worm; * Display all of the segments of the given worm for detection. */ void -detect_wsegs(worm, use_detection_glyph) -struct monst *worm; -boolean use_detection_glyph; +detect_wsegs(struct monst *worm, boolean use_detection_glyph) { int num; struct wseg *curr = wtails[worm->wormno]; @@ -497,8 +480,7 @@ boolean use_detection_glyph; * of segments, including the dummy. Called from save.c. */ void -save_worm(fd, mode) -int fd, mode; +save_worm(int fd, int mode) { int i; int count; @@ -543,8 +525,7 @@ int fd, mode; * Restore the worm information from the save file. Called from restore.c */ void -rest_worm(fd) -int fd; +rest_worm(int fd) { int i, j, count; struct wseg *curr, *temp; @@ -576,8 +557,7 @@ int fd; * Place the segments of the given worm. Called from restore.c */ void -place_wsegs(worm, oldworm) -struct monst *worm, *oldworm; +place_wsegs(struct monst *worm, struct monst *oldworm) { struct wseg *curr = wtails[worm->wormno]; @@ -603,8 +583,7 @@ struct monst *worm, *oldworm; } void -sanity_check_worm(worm) -struct monst *worm; +sanity_check_worm(struct monst *worm) { struct wseg *curr; @@ -639,8 +618,7 @@ struct monst *worm; * not remove the mon from the fmon chain. */ void -remove_worm(worm) -register struct monst *worm; +remove_worm(register struct monst *worm) { register struct wseg *curr = wtails[worm->wormno]; @@ -669,9 +647,7 @@ register struct monst *worm; * be, if somehow the head is disjoint from the tail. */ void -place_worm_tail_randomly(worm, x, y) -struct monst *worm; -xchar x, y; +place_worm_tail_randomly(struct monst *worm, xchar x, xchar y) { int wnum = worm->wormno; struct wseg *curr = wtails[wnum]; @@ -728,9 +704,7 @@ xchar x, y; * enexto() with a search radius. */ static void -random_dir(x, y, nx, ny) -register xchar x, y; -register xchar *nx, *ny; +random_dir(register xchar x, register xchar y, register xchar *nx, register xchar *ny) { *nx = x; *ny = y; @@ -758,8 +732,7 @@ register xchar *nx, *ny; /* for size_monst(cmd.c) to support #stats */ int -size_wseg(worm) -struct monst *worm; +size_wseg(struct monst *worm) { return (int) (count_wsegs(worm) * sizeof (struct wseg)); } @@ -771,8 +744,7 @@ struct monst *worm; */ int -count_wsegs(mtmp) -struct monst *mtmp; +count_wsegs(struct monst *mtmp) { register int i=0; register struct wseg *curr = (wtails[mtmp->wormno])->nseg; @@ -795,8 +767,7 @@ struct monst *mtmp; * will create a worm tail chain of (num_segs + 1) and return a pointer to it. */ static struct wseg * -create_worm_tail(num_segs) -int num_segs; +create_worm_tail(int num_segs) { register int i=0; register struct wseg *new_tail, *curr; @@ -827,8 +798,7 @@ int num_segs; * Mostly used in the canseemon() macro. */ boolean -worm_known(worm) -struct monst *worm; +worm_known(struct monst *worm) { struct wseg *curr = wtails[worm->wormno]; @@ -842,8 +812,7 @@ struct monst *worm; /* would moving from to involve passing between two consecutive segments of the same worm? */ boolean -worm_cross(x1, y1, x2, y2) -int x1, y1, x2, y2; +worm_cross(int x1, int y1, int x2, int y2) { struct monst *worm; struct wseg *curr, *wnxt; @@ -897,9 +866,7 @@ int x1, y1, x2, y2; /* construct an index number for a worm tail segment */ int -wseg_at(worm, x, y) -struct monst *worm; -int x, y; +wseg_at(struct monst *worm, int x, int y) { int res = 0; diff --git a/src/worn.c b/src/worn.c index b8ed80caa..58aad3da4 100644 --- a/src/worn.c +++ b/src/worn.c @@ -4,7 +4,7 @@ #include "hack.h" static void m_lose_armor(struct monst *, struct obj *); -static void m_dowear_type(struct monst *, long, BOOLEAN_P, BOOLEAN_P); +static void m_dowear_type(struct monst *, long, boolean, boolean); static int extra_pref(struct monst *, struct obj *); const struct worn { @@ -41,9 +41,7 @@ const struct worn { /* Updated to use the extrinsic and blocked fields. */ void -setworn(obj, mask) -register struct obj *obj; -long mask; +setworn(register struct obj *obj, long int mask) { register const struct worn *wp; register struct obj *oobj; @@ -122,8 +120,7 @@ long mask; /* called e.g. when obj is destroyed */ /* Updated to use the extrinsic and blocked fields. */ void -setnotworn(obj) -register struct obj *obj; +setnotworn(register struct obj *obj) { register const struct worn *wp; register int p; @@ -154,8 +151,7 @@ register struct obj *obj; /* return item worn in slot indiciated by wornmask; needed by poly_obj() */ struct obj * -wearmask_to_obj(wornmask) -long wornmask; +wearmask_to_obj(long int wornmask) { const struct worn *wp; @@ -169,8 +165,7 @@ long wornmask; /* return a bitmask of the equipment slot(s) a given item might be worn in */ long -wearslot(obj) -struct obj *obj; +wearslot(struct obj *obj) { int otyp = obj->otyp; /* practically any item can be wielded or quivered; it's up to @@ -245,8 +240,7 @@ struct obj *obj; } void -mon_set_minvis(mon) -struct monst *mon; +mon_set_minvis(struct monst *mon) { mon->perminvis = 1; if (!mon->invis_blkd) { @@ -259,10 +253,9 @@ struct monst *mon; } void -mon_adjust_speed(mon, adjust, obj) -struct monst *mon; -int adjust; /* positive => increase speed, negative => decrease */ -struct obj *obj; /* item to make known if effect can be seen */ +mon_adjust_speed(struct monst *mon, + int adjust, /**< positive => increase speed, negative => decrease */ + struct obj *obj) /**< item to make known if effect can be seen */ { struct obj *otmp; boolean give_msg = !in_mklev, petrify = FALSE; @@ -342,10 +335,7 @@ struct obj *obj; /* item to make known if effect can be seen */ /* armor put on or taken off; might be magical variety [TODO: rename to 'update_mon_extrinsics()' and change all callers...] */ void -update_mon_intrinsics(mon, obj, on, silently) -struct monst *mon; -struct obj *obj; -boolean on, silently; +update_mon_intrinsics(struct monst *mon, struct obj *obj, boolean on, boolean silently) { int unseen; uchar mask; @@ -464,8 +454,7 @@ boolean on, silently; } int -find_mac(mon) -register struct monst *mon; +find_mac(register struct monst *mon) { register struct obj *obj; int base = mon->data->ac; @@ -505,9 +494,7 @@ register struct monst *mon; * already worn body armor is too obviously buggy... */ void -m_dowear(mon, creation) -register struct monst *mon; -boolean creation; +m_dowear(register struct monst *mon, boolean creation) { #define RACE_EXCEPTION TRUE /* Note the restrictions here are the same as in dowear in do_wear.c @@ -544,11 +531,7 @@ boolean creation; } static void -m_dowear_type(mon, flag, creation, racialexception) -struct monst *mon; -long flag; -boolean creation; -boolean racialexception; +m_dowear_type(struct monst *mon, long int flag, boolean creation, boolean racialexception) { struct obj *old, *best, *obj; int m_delay = 0; @@ -676,9 +659,7 @@ boolean racialexception; #undef RACE_EXCEPTION struct obj * -which_armor(mon, flag) -struct monst *mon; -long flag; +which_armor(struct monst *mon, long int flag) { if (mon == &youmonst) { switch (flag) { @@ -714,9 +695,7 @@ long flag; /* remove an item of armor and then drop it */ static void -m_lose_armor(mon, obj) -struct monst *mon; -struct obj *obj; +m_lose_armor(struct monst *mon, struct obj *obj) { mon->misc_worn_check &= ~obj->owornmask; if (obj->owornmask) @@ -731,7 +710,7 @@ struct obj *obj; /* all objects with their bypass bit set should now be reset to normal */ void -clear_bypasses() +clear_bypasses(void) { struct obj *otmp, *nobj; struct monst *mtmp; @@ -794,8 +773,7 @@ clear_bypasses() } void -bypass_obj(obj) -struct obj *obj; +bypass_obj(struct obj *obj) { obj->bypass = 1; flags.bypasses = TRUE; @@ -803,9 +781,7 @@ struct obj *obj; /* set or clear the bypass bit in a list of objects */ void -bypass_objlist(objchain, on) -struct obj *objchain; -boolean on; /* TRUE => set, FALSE => clear */ +bypass_objlist(struct obj *objchain, boolean on) /**< TRUE => set, FALSE => clear */ { if (on && objchain) { flags.bypasses = TRUE; @@ -819,8 +795,7 @@ boolean on; /* TRUE => set, FALSE => clear */ /* return the first object without its bypass bit set; set that bit before returning so that successive calls will find further objects */ struct obj * -nxt_unbypassed_obj(objchain) -struct obj *objchain; +nxt_unbypassed_obj(struct obj *objchain) { while (objchain) { if (!objchain->bypass) { @@ -833,9 +808,7 @@ struct obj *objchain; } void -mon_break_armor(mon, polyspot) -struct monst *mon; -boolean polyspot; +mon_break_armor(struct monst *mon, boolean polyspot) { struct obj *otmp; struct permonst *mdat = mon->data; @@ -991,9 +964,7 @@ boolean polyspot; /* currently only does speed boots, but might be expanded if monsters get to use more armor abilities */ static int -extra_pref(mon, obj) -struct monst *mon; -struct obj *obj; +extra_pref(struct monst *mon, struct obj *obj) { /* currently only does speed boots, but might be expanded if monsters * get to use more armor abilities. */ @@ -1013,9 +984,7 @@ struct obj *obj; * -1 If the race/object combination is unacceptable. */ int -racial_exception(mon, obj) -struct monst *mon; -struct obj *obj; +racial_exception(struct monst *mon, struct obj *obj) { const struct permonst *ptr = raceptr(mon); diff --git a/src/write.c b/src/write.c index dcdc1fa0c..9dfd995f1 100644 --- a/src/write.c +++ b/src/write.c @@ -66,9 +66,7 @@ ink_cost(struct obj *otmp) the discoveries list and aren't present in current inventory, so some scrolls with ought to yield True will end up False */ static boolean -label_known(scrolltype, objlist) -int scrolltype; -struct obj *objlist; +label_known(int scrolltype, struct obj *objlist) { struct obj *otmp; @@ -99,8 +97,7 @@ static NEARDATA const char write_on[] = { SCROLL_CLASS, SPBOOK_CLASS, 0 }; /** write -- applying a magic marker */ int -dowrite(pen) -register struct obj *pen; +dowrite(register struct obj *pen) { register struct obj *paper; char namebuf[BUFSZ] = DUMMY, *nm, *bp; @@ -362,9 +359,7 @@ register struct obj *pen; even that's rather iffy, indicating that such descriptions probably ought to be eliminated (especially "cloth"!) */ static char * -new_book_description(booktype, outbuf) -int booktype; -char *outbuf; +new_book_description(int booktype, char *outbuf) { /* subset of description strings from objects.c; if it grows much, we may need to add a new flag field to objects[] instead */ diff --git a/src/zap.c b/src/zap.c index 19f5b61d1..ab29f4747 100644 --- a/src/zap.c +++ b/src/zap.c @@ -23,7 +23,7 @@ static boolean zombie_can_dig(xchar x, xchar y); static void polyuse(struct obj*, int, int); static void create_polymon(struct obj *, int); static boolean zap_updown(struct obj *); -static void zhitu(int, int, const char *, XCHAR_P, XCHAR_P); +static void zhitu(int, int, const char *, xchar, xchar); static void revive_egg(struct obj *); static boolean zap_steed(struct obj *); @@ -112,8 +112,7 @@ const char * const flash_types[] = { /* also used in buzzmu(mcastu.c) */ /* wand discovery gets special handling when hero is blinded */ void -learn_wand(obj) -struct obj *obj; +learn_wand(struct obj *obj) { /* For a wand (or wand-like tool) zapped by the player, if the effect was observable (determined by caller; usually seen, but @@ -148,9 +147,7 @@ struct obj *obj; /* Routines for IMMEDIATE wands and spells. */ /* bhitm: monster mtmp was hit by the effect of wand or spell otmp */ int -bhitm(mtmp, otmp) -struct monst *mtmp; -struct obj *otmp; +bhitm(struct monst *mtmp, struct obj *otmp) { boolean wake = TRUE; /* Most 'zaps' should wake monster */ boolean reveal_invis = FALSE; @@ -512,8 +509,7 @@ struct obj *otmp; } void -probe_monster(mtmp) -struct monst *mtmp; +probe_monster(struct monst *mtmp) { struct obj *otmp; @@ -564,10 +560,7 @@ struct monst *mtmp; * is not available or subject to the constraints above. */ boolean -get_obj_location(obj, xp, yp, locflags) -struct obj *obj; -xchar *xp, *yp; -int locflags; +get_obj_location(struct obj *obj, xchar *xp, xchar *yp, int locflags) { switch (obj->where) { case OBJ_INVENT: @@ -602,10 +595,10 @@ int locflags; } boolean -get_mon_location(mon, xp, yp, locflags) -struct monst *mon; -xchar *xp, *yp; -int locflags; /* non-zero means get location even if monster is buried */ +get_mon_location( + struct monst *mon, + xchar *xp, xchar *yp, + int locflags) /* non-zero means get location even if monster is buried */ { if (mon == &youmonst) { *xp = u.ux; @@ -623,10 +616,11 @@ int locflags; /* non-zero means get location even if monster is buried */ /* used by revive() and animate_statue() */ struct monst * -montraits(obj, cc, adjacentok) -struct obj *obj; -coord *cc; -boolean adjacentok; /* False: at obj's spot only, True: nearby is allowed */ +montraits( + struct obj *obj, + coord *cc, + boolean adjacentok) /**< FALSE: at obj's spot only, + * TRUE: nearby is allowed */ { struct monst *mtmp = (struct monst *)0; struct monst *mtmp2 = has_omonst(obj) ? get_mtraits(obj, TRUE) : 0; @@ -731,10 +725,7 @@ boolean adjacentok; /* False: at obj's spot only, True: nearby is allowed */ * if applicable. */ struct monst * -get_container_location(obj, loc, container_nesting) -struct obj *obj; -int *loc; -int *container_nesting; +get_container_location(struct obj *obj, int *loc, int *container_nesting) { if (!obj || !loc) return 0; @@ -776,9 +767,7 @@ zombie_can_dig(xchar x, xchar y) * and only one monster will be resurrected. */ struct monst * -revive(corpse, by_hero) -struct obj *corpse; -boolean by_hero; +revive(struct obj *corpse, boolean by_hero) { struct monst *mtmp = 0; struct permonst *mptr; @@ -994,8 +983,7 @@ boolean by_hero; } void -remove_corpse(corpse) -struct obj *corpse; +remove_corpse(struct obj *corpse) { xchar x, y; boolean is_zomb = (mons[corpse->corpsenm].mlet == S_ZOMBIE); @@ -1033,8 +1021,7 @@ struct obj *corpse; } static void -revive_egg(obj) -struct obj *obj; +revive_egg(struct obj *obj) { /* * Note: generic eggs with corpsenm set to NON_PM will never hatch. @@ -1046,8 +1033,7 @@ struct obj *obj; /* try to revive all corpses and eggs carried by `mon' */ int -unturn_dead(mon) -struct monst *mon; +unturn_dead(struct monst *mon) { struct obj *otmp, *otmp2; struct monst *mtmp2; @@ -1083,8 +1069,7 @@ struct monst *mon; return res; } -boolean cancellable(obj) -register struct obj *obj; +boolean cancellable(register struct obj *obj) { return objects[obj->otyp].oc_magic || (obj->spe && @@ -1097,8 +1082,7 @@ register struct obj *obj; /* cancel obj, possibly carried by you or a monster */ void -cancel_item(obj) -register struct obj *obj; +cancel_item(register struct obj *obj) { boolean u_ring = (obj == uleft) || (obj == uright); @@ -1249,9 +1233,7 @@ register struct obj *obj; * possibly carried by you or a monster */ boolean -drain_item(obj, by_you) -struct obj *obj; -boolean by_you; +drain_item(struct obj *obj, boolean by_you) { boolean u_ring; @@ -1348,9 +1330,9 @@ boolean by_you; } boolean -obj_resists(obj, ochance, achance) -struct obj *obj; -int ochance, achance; /* percent chance for ordinary objects, artifacts */ +obj_resists(struct obj *obj, + int ochance, /**< percent chance for ordinary objects */ + int achance) /**< percent chance for artifacts */ { if (obj->otyp == AMULET_OF_YENDOR || obj->otyp == SPE_BOOK_OF_THE_DEAD || @@ -1366,8 +1348,7 @@ int ochance, achance; /* percent chance for ordinary objects, artifacts */ } boolean -obj_shudders(obj) -struct obj *obj; +obj_shudders(struct obj *obj) { int zap_odds; @@ -1396,9 +1377,7 @@ struct obj *obj; * at the top of the pile. */ static void -polyuse(objhdr, mat, minwt) -struct obj *objhdr; -int mat, minwt; +polyuse(struct obj *objhdr, int mat, int minwt) { register struct obj *otmp, *otmp2; @@ -1437,9 +1416,7 @@ int mat, minwt; * a golem of the kind okind. */ static void -create_polymon(obj, okind) -struct obj *obj; -int okind; +create_polymon(struct obj *obj, int okind) { struct permonst *mdat = (struct permonst *)0; struct monst *mtmp; @@ -1534,8 +1511,7 @@ int okind; /* Assumes obj is on the floor. */ void -do_osshock(obj) -struct obj *obj; +do_osshock(struct obj *obj) { long i; @@ -1589,9 +1565,7 @@ static const char charged_objs[] = { WAND_CLASS, WEAPON_CLASS, ARMOR_CLASS, '\0' * This should be safe to call for an object anywhere. */ struct obj * -poly_obj(obj, id) -struct obj *obj; -int id; +poly_obj(struct obj *obj, int id) { struct obj *otmp; xchar ox = 0, oy = 0; @@ -1861,8 +1835,7 @@ int id; /* stone-to-flesh spell hits and maybe transforms or animates obj */ static int -stone_to_flesh_obj(obj) -struct obj *obj; +stone_to_flesh_obj(struct obj *obj) { int res = 1; /* affected object by default */ struct permonst *ptr; @@ -1992,8 +1965,7 @@ struct obj *obj; * non-zero if the wand/spell had any effect. */ int -bhito(obj, otmp) -struct obj *obj, *otmp; +bhito(struct obj *obj, struct obj *otmp) { int res = 1; /* affected object by default */ xchar refresh_x, refresh_y; @@ -2227,11 +2199,7 @@ struct obj *obj, *otmp; /* returns nonzero if something was hit */ int -bhitpile(obj, fhito, tx, ty, zz) -struct obj *obj; -int (*fhito)(OBJ_P, OBJ_P); -int tx, ty; -schar zz; +bhitpile(struct obj *obj, int (*fhito) (struct obj *, struct obj *), int tx, int ty, schar zz) { int hitanything = 0; register struct obj *otmp, *next_obj; @@ -2271,8 +2239,7 @@ schar zz; * it removes a charge from the wand. */ int -zappable(wand) -register struct obj *wand; +zappable(register struct obj *wand) { int zap_it = 1; if (wand->spe < 0) { @@ -2293,8 +2260,7 @@ register struct obj *wand; * added by GAN 11/03/86 */ void -zapnodir(obj) -register struct obj *obj; +zapnodir(register struct obj *obj) { boolean known = FALSE; @@ -2340,8 +2306,7 @@ register struct obj *obj; } static void -backfire(otmp) -struct obj *otmp; +backfire(struct obj *otmp) { int dmg; @@ -2356,7 +2321,7 @@ static NEARDATA const char zap_syms[] = { WAND_CLASS, 0 }; /* 'z' command (or 'y' if numbed_pad==-1) */ int -dozap() +dozap(void) { register struct obj *obj; int damage; @@ -2409,9 +2374,7 @@ dozap() } int -zapyourself(obj, ordinary) -struct obj *obj; -boolean ordinary; +zapyourself(struct obj *obj, boolean ordinary) { boolean learn_it = FALSE; int damage = 0; @@ -2767,8 +2730,7 @@ boolean ordinary; /* called when poly'd hero uses breath attack against self */ void -ubreatheu(mattk) -struct attack *mattk; +ubreatheu(struct attack *mattk) { int dtyp = 20 + mattk->adtyp - 1; /* breath by hero */ const char *fltxt = flash_types[dtyp]; /* blast of */ @@ -2778,10 +2740,9 @@ struct attack *mattk; /* light damages hero in gremlin form */ int -lightdamage(obj, ordinary, amt) -struct obj *obj; /* item making light (fake book if spell) */ -boolean ordinary; /* wand/camera zap vs wand destruction */ -int amt; /* pseudo-damage used to determine blindness duration */ +lightdamage(struct obj *obj, /**< item making light (fake book if spell) */ + boolean ordinary, /**< wand/camera zap vs wand destruction */ + int amt) /**< pseudo-damage used to determine blindness duration */ { char buf[BUFSZ]; const char *how; @@ -2813,8 +2774,7 @@ int amt; /* pseudo-damage used to determine blindness duration */ /* light[ning] causes blindness */ boolean -flashburn(duration) -long duration; +flashburn(long int duration) { if (!resists_blnd(&youmonst)) { You(are_blinded_by_the_flash); @@ -2832,8 +2792,7 @@ long duration; * Return FALSE if the steed was not hit by the wand. */ static boolean -zap_steed(obj) -struct obj *obj; /* wand or spell */ +zap_steed(struct obj *obj) /**< wand or spell */ { int steedhit = FALSE; @@ -2898,10 +2857,7 @@ struct obj *obj; /* wand or spell */ * themselves with cancellation. */ boolean -cancel_monst(mdef, obj, youattack, allow_cancel_kill, self_cancel) -register struct monst *mdef; -register struct obj *obj; -boolean youattack, allow_cancel_kill, self_cancel; +cancel_monst(register struct monst *mdef, register struct obj *obj, boolean youattack, boolean allow_cancel_kill, boolean self_cancel) { boolean youdefend = (mdef == &youmonst); static const char writing_vanishes[] = @@ -3066,8 +3022,7 @@ boolean youattack, allow_cancel_kill, self_cancel; /* you've zapped an immediate type wand up or down */ static boolean -zap_updown(obj) -struct obj *obj; /* wand or spell */ +zap_updown(struct obj *obj) /**< wand or spell */ { boolean striking = FALSE, disclose = FALSE; int x, y, xx, yy, ptmp; @@ -3308,13 +3263,13 @@ struct obj *obj; /* wand or spell */ /* used by do_break_wand() was well as by weffects() */ void -zapsetup() +zapsetup(void) { obj_zapped = FALSE; } void -zapwrapup() +zapwrapup(void) { /* if do_osshock() set obj_zapped while polying, give a message now */ if (obj_zapped) { @@ -3325,8 +3280,7 @@ zapwrapup() /* called for various wand and spell effects - M. Stephenson */ void -weffects(obj) -register struct obj *obj; +weffects(register struct obj *obj) { int otyp = obj->otyp; boolean disclose = FALSE, was_unkn = !objects[otyp].oc_name_known; @@ -3379,8 +3333,7 @@ register struct obj *obj; /* augment damage for a spell dased on the hero's intelligence (and level) */ int -spell_damage_bonus(dmg) -int dmg; /* base amount to be adjusted by bonus or penalty */ +spell_damage_bonus(int dmg) /**< base amount to be adjusted by bonus or penalty */ { int intell = ACURR(A_INT); @@ -3410,8 +3363,7 @@ int dmg; /* base amount to be adjusted by bonus or penalty */ * spell class and dexterity. */ static int -spell_hit_bonus(skill) -int skill; +spell_hit_bonus(int skill) { int hit_bon = 0; int dex = ACURR(A_DEX); @@ -3439,8 +3391,7 @@ int skill; } const char * -exclam(force) -register int force; +exclam(register int force) { /* force == 0 occurs e.g. with sleep ray */ /* note that large force is usual with wands so that !! would @@ -3449,10 +3400,9 @@ register int force; } void -hit(str, mtmp, force) -register const char *str; -register struct monst *mtmp; -register const char *force; /* usually either "." or "!" */ +hit(const char *str, /**< zap text or missile name */ + struct monst *mtmp, /**< target; for missile, might be hero */ + const char *force) /**< usually either "." or "!" via exclam() */ { if((!cansee(bhitpos.x, bhitpos.y) && !canspotmon(mtmp) && !(u.uswallow && mtmp == u.ustuck)) @@ -3463,9 +3413,7 @@ register const char *force; /* usually either "." or "!" */ } void -miss(str, mtmp) -register const char *str; -register struct monst *mtmp; +miss(register const char *str, register struct monst *mtmp) { pline("%s %s %s.", The(str), vtense(str, "miss"), ((cansee(bhitpos.x, bhitpos.y) || canspotmon(mtmp)) @@ -3474,8 +3422,7 @@ register struct monst *mtmp; } static void -skiprange(range, skipstart, skipend) -int range, *skipstart, *skipend; +skiprange(int range, int *skipstart, int *skipend) { int tr = (range / 4); int tmp = range - ((tr > 0) ? rnd(tr) : 0); @@ -3506,13 +3453,15 @@ int range, *skipstart, *skipend; * one is revealed for a weapon, but if not a weapon is left up to fhitm(). */ struct monst * -bhit(ddx, ddy, range, weapon, fhitm, fhito, obj, obj_destroyed) -register int ddx, ddy, range; /**< direction and range */ -int weapon; /**< see values in hack.h */ -int (*fhitm) (MONST_P, OBJ_P), /**< fns called when mon/obj hit */ -(*fhito)(OBJ_P, OBJ_P); -struct obj *obj; /**< object tossed/used */ -boolean *obj_destroyed; /**< has object been deallocated? Pointer to boolean, may be NULL */ +bhit( + int ddx, + int ddy, + int range, /**< direction and range */ + int weapon, /**< see values in hack.h */ + int (*fhitm) (struct monst *, struct obj *), /**< fns called when mon/obj hit */ + int (*fhito) (struct obj *, struct obj *), + struct obj *obj, /**< object tossed/used */ + boolean *obj_destroyed) /**< has object been deallocated? Pointer to boolean, may be NULL */ { struct monst *mtmp, *result = (struct monst *) 0; uchar typ; @@ -3820,9 +3769,7 @@ boolean *obj_destroyed; /**< has object been deallocated? Pointer * is too obviously silly. */ struct monst * -boomhit(obj, dx, dy) -struct obj *obj; -int dx, dy; +boomhit(struct obj *obj, int dx, int dy) { register int i, ct; int boom; /* showsym[] index */ @@ -3899,10 +3846,11 @@ int dx, dy; /* used by buzz(); also used by munslime(muse.c); returns damage applied to mon; note: caller is responsible for killing mon if damage is fatal */ int -zhitm(mon, type, nd, ootmp) /* returns damage to mon */ -register struct monst *mon; -register int type, nd; -struct obj **ootmp; /* to return worn armor for caller to disintegrate */ +zhitm( + struct monst *mon, /**< monster being hit */ + int type, /**< zap or breath type */ + int nd, /**< number of hit dice to use */ + struct obj **ootmp) /**< to return worn armor for caller to disintegrate */ { register int tmp = 0; register int abstype = abs(type) % 10; @@ -4073,10 +4021,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ } static void -zhitu(type, nd, fltxt, sx, sy) -int type, nd; -const char *fltxt; -xchar sx, sy; +zhitu(int type, int nd, const char *fltxt, xchar sx, xchar sy) { int dam = 0; @@ -4205,8 +4150,7 @@ xchar sx, sy; } void -melt_icewall(x, y) -xchar x, y; +melt_icewall(xchar x, xchar y) { struct rm *lev = &levl[x][y]; if (cansee(x, y)) { @@ -4222,9 +4166,7 @@ xchar x, y; } void -melt_ice(x, y, msg) -xchar x, y; -const char *msg; +melt_ice(xchar x, xchar y, const char *msg) { struct rm *lev = &levl[x][y]; struct obj *otmp; @@ -4271,10 +4213,10 @@ const char *msg; * return the number of objects burned */ int -burn_floor_objects(x, y, give_feedback, u_caused) -int x, y; -boolean give_feedback; /* caller needs to decide about visibility checks */ -boolean u_caused; +burn_floor_objects(int x, int y, boolean give_feedback, boolean u_caused) + + /* caller needs to decide about visibility checks */ + { struct obj *obj, *obj2; long i, scrquan, delquan; @@ -4321,9 +4263,9 @@ boolean u_caused; /* will zap/spell/breath attack score a hit against armor class `ac'? */ static int -zap_hit(ac, type) -int ac; -int type; /* either hero cast spell type or 0 */ +zap_hit( + int ac, + int type) /**< either hero cast spell type or 0 */ { int chance = rn2(20); int spell_bonus = type ? spell_hit_bonus(type) : 0; @@ -4338,10 +4280,10 @@ int type; /* either hero cast spell type or 0 */ } static void -disintegrate_mon(mon, type, fltxt) -struct monst *mon; -int type; /* hero vs other */ -const char *fltxt; +disintegrate_mon(struct monst *mon, int type, const char *fltxt) + + /* hero vs other */ + { struct obj *otmp, *otmp2, *m_amulet = mlifesaver(mon); @@ -4381,10 +4323,7 @@ const char *fltxt; } void -buzz(type, nd, sx, sy, dx, dy) -int type, nd; -xchar sx, sy; -int dx, dy; +buzz(int type, int nd, xchar sx, xchar sy, int dx, int dy) { dobuzz(type, nd, sx, sy, dx, dy, TRUE); } @@ -4397,11 +4336,12 @@ int dx, dy; /* type == -30 to -39 : monster shooting a wand */ /* called with dx = dy = 0 with vertical bolts */ void -dobuzz(type, nd, sx, sy, dx, dy, say) -int type, nd; -xchar sx, sy; -int dx, dy; -boolean say; /* Announce out of sight hit/miss events if true */ +dobuzz( + int type, + int nd, + xchar sx, xchar sy, + int dx, int dy, + boolean say) /**< announce out of sight hit/miss events if true */ { int range, abstype = abs(type) % 10; struct rm *lev; @@ -4692,9 +4632,9 @@ boolean say; /* Announce out of sight hit/miss events if true */ * permanent instead. */ void -start_melt_ice_timeout(x, y, min_time) -xchar x, y; -long min_time; /* 's old melt timeout (deleted by time we get here) */ +start_melt_ice_timeout( + xchar x, xchar y, + long int min_time) /**< 's old melt timeout (deleted by time we get here) */ { int when; long where; @@ -4725,9 +4665,7 @@ long min_time; /* 's old melt timeout (deleted by time we get here) */ * Called when ice has melted completely away. */ void -melt_ice_away(arg, timeout) -anything *arg; -long timeout UNUSED; +melt_ice_away(anything *arg, long int timeout UNUSED) { xchar x, y; long where = arg->a_long; @@ -4748,11 +4686,7 @@ long timeout UNUSED; * amount by which range is reduced (the latter is just ignored by fireballs) */ int -zap_over_floor(x, y, type, shopdamage, exploding_wand_typ) -xchar x, y; -int type; -boolean *shopdamage; -short exploding_wand_typ; +zap_over_floor(xchar x, xchar y, int type, boolean *shopdamage, short int exploding_wand_typ) { const char *zapverb; struct monst *mon; @@ -5050,8 +4984,7 @@ short exploding_wand_typ; /* fractured by pick-axe or wand of striking */ void -fracture_rock(obj) -register struct obj *obj; /* no texts here! */ +fracture_rock(struct obj *obj) /* no texts here! */ { xchar x, y; boolean by_you = !flags.mon_moving; @@ -5092,8 +5025,7 @@ register struct obj *obj; /* no texts here! */ /* handle statue hit by striking/force bolt/pick-axe */ boolean -break_statue(obj) -register struct obj *obj; +break_statue(register struct obj *obj) { /* [obj is assumed to be on floor, so no get_obj_location() needed] */ struct trap *trap = t_at(obj->ox, obj->oy); @@ -5143,9 +5075,7 @@ const char *const destroy_strings[][3] = { /* guts of destroy_item(), which ought to be called maybe_destroy_items(); caller must decide whether obj is eligible */ static void -destroy_one_item(obj, osym, dmgtyp) -struct obj *obj; -int osym, dmgtyp; +destroy_one_item(struct obj *obj, int osym, int dmgtyp) { long i, cnt, quan; int dmg, xresist, skip, dindx; @@ -5289,8 +5219,7 @@ int osym, dmgtyp; /* target items of specified class for possible destruction */ void -destroy_item(osym, dmgtyp) -int osym, dmgtyp; +destroy_item(int osym, int dmgtyp) { struct obj *obj; int i, deferral_indx = 0; @@ -5373,9 +5302,7 @@ int osym, dmgtyp; } int -destroy_mitem(mtmp, osym, dmgtyp) -struct monst *mtmp; -int osym, dmgtyp; +destroy_mitem(struct monst *mtmp, int osym, int dmgtyp) { struct obj *obj, *obj2; int skip, tmp = 0; @@ -5494,10 +5421,7 @@ int osym, dmgtyp; } int -resist(mtmp, oclass, damage, tell) -struct monst *mtmp; -char oclass; -int damage, tell; +resist(struct monst *mtmp, char oclass, int damage, int tell) { int resisted; int alev, dlev; @@ -5553,8 +5477,7 @@ int damage, tell; #define MAXWISHTRY 5 static void -wishcmdassist(triesleft) -int triesleft; +wishcmdassist(int triesleft) { static NEARDATA const char * wishinfo[] = { @@ -5617,8 +5540,7 @@ int triesleft; * Entering "nothing" returns nothing and keeps the wishing conduct. */ void -makewish(magical) -boolean magical; /**< if wishing for magical items is allowed */ +makewish(boolean magical) /**< if wishing for magical items is allowed */ { char buf[BUFSZ]; #ifdef LIVELOGFILE diff --git a/sys/share/ioctl.c b/sys/share/ioctl.c index bf0605434..d7e2b181f 100644 --- a/sys/share/ioctl.c +++ b/sys/share/ioctl.c @@ -74,17 +74,17 @@ struct termio termio; #endif #ifdef _M_UNIX -extern void sco_mapon(); -extern void sco_mapoff(); +extern void sco_mapon(void); +extern void sco_mapoff(void); #endif #ifdef __linux__ -extern void linux_mapon(); -extern void linux_mapoff(); +extern void linux_mapon(void); +extern void linux_mapoff(void); #endif #ifdef AUX void -catch_stp() +catch_stp(void) { signal(SIGTSTP, SIG_DFL); dosuspend(); @@ -92,7 +92,7 @@ catch_stp() #endif /* AUX */ void -getwindowsz() +getwindowsz(void) { #ifdef USE_WIN_IOCTL /* @@ -115,7 +115,7 @@ getwindowsz() } void -getioctls() +getioctls(void) { #ifdef BSD_JOB_CONTROL (void) ioctl(fileno(stdin), (int) TIOCGLTC, (char *) <chars); @@ -138,7 +138,7 @@ getioctls() } void -setioctls() +setioctls(void) { #ifdef BSD_JOB_CONTROL (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) <chars); @@ -157,7 +157,7 @@ setioctls() #ifdef SUSPEND /* No longer implies BSD */ int -dosuspend() +dosuspend(void) { if (iflags.debug_fuzzer) { return 0; diff --git a/sys/share/posixregex.c b/sys/share/posixregex.c index 5b677abbe..bee8a3a6f 100644 --- a/sys/share/posixregex.c +++ b/sys/share/posixregex.c @@ -52,7 +52,7 @@ struct nhregex { }; struct nhregex * -regex_init() +regex_init(void) { return (struct nhregex *) alloc(sizeof(struct nhregex)); } diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c index bdb6d2d8c..8b0b4c2a8 100644 --- a/sys/share/unixtty.c +++ b/sys/share/unixtty.c @@ -139,8 +139,7 @@ struct termstruct inittyb, curttyb; #ifdef POSIX_TYPES static int -speednum(speed) -speed_t speed; +speednum(speed_t speed) { switch (speed) { case B0: return 0; @@ -166,7 +165,7 @@ speed_t speed; #endif static void -setctty() +setctty(void) { if(STTY(&curttyb) < 0 || STTY2(&curttyb2) < 0) perror("NetHack (setctty)"); @@ -178,7 +177,7 @@ setctty() * Called by startup() in termcap.c and after returning from ! or ^Z */ void -gettty() +gettty(void) { if(GTTY(&inittyb) < 0 || GTTY2(&inittyb2) < 0) perror("NetHack (gettty)"); @@ -200,8 +199,7 @@ gettty() /* reset terminal to original state */ void -settty(s) -const char *s; +settty(const char *s) { end_screen(); if(s) raw_print(s); @@ -214,7 +212,7 @@ const char *s; } void -setftty() +setftty(void) { register int ef = 0; /* desired value of flags & ECHO */ #ifdef LINT /* cf = CBRKON(CBRKMASK); const expr to initialize is ok */ @@ -281,8 +279,9 @@ register int change = 0; start_screen(); } +/** enable kbd interupts if enabled when game started */ void -intron() /* enable kbd interupts if enabled when game started */ +intron(void) { #ifdef TTY_GRAPHICS /* Ugly hack to keep from changing tty modes for non-tty games -dlc */ @@ -294,8 +293,9 @@ intron() /* enable kbd interupts if enabled when game started */ #endif } +/** disable kbd interrupts if required*/ void -introff() /* disable kbd interrupts if required*/ +introff(void) { #ifdef TTY_GRAPHICS /* Ugly hack to keep from changing tty modes for non-tty games -dlc */ @@ -325,7 +325,7 @@ void check_sco_console(); void init_sco_cons(); void -sco_mapon() +sco_mapon(void) { # ifdef TTY_GRAPHICS if (!strcmp(windowprocs.name, "tty") && sco_flag_console) { @@ -338,7 +338,7 @@ sco_mapon() } void -sco_mapoff() +sco_mapoff(void) { # ifdef TTY_GRAPHICS if (!strcmp(windowprocs.name, "tty") && sco_flag_console) { @@ -351,7 +351,7 @@ sco_mapoff() } void -check_sco_console() +check_sco_console(void) { if (isatty(0) && ioctl(0,CONS_GET,0) != -1) { sco_flag_console = 1; @@ -359,7 +359,7 @@ check_sco_console() } void -init_sco_cons() +init_sco_cons(void) { # ifdef TTY_GRAPHICS if (!strcmp(windowprocs.name, "tty") && sco_flag_console) { @@ -382,13 +382,13 @@ init_sco_cons() int linux_flag_console = 0; -void linux_mapon(); -void linux_mapoff(); -void check_linux_console(); -void init_linux_cons(); +void linux_mapon(void); +void linux_mapoff(void); +void check_linux_console(void); +void init_linux_cons(void); void -linux_mapon() +linux_mapon(void) { # ifdef TTY_GRAPHICS if (!strcmp(windowprocs.name, "tty") && linux_flag_console) { @@ -398,7 +398,7 @@ linux_mapon() } void -linux_mapoff() +linux_mapoff(void) { # ifdef TTY_GRAPHICS if (!strcmp(windowprocs.name, "tty") && linux_flag_console) { @@ -408,7 +408,7 @@ linux_mapoff() } void -check_linux_console() +check_linux_console(void) { struct vt_mode vtm; @@ -418,7 +418,7 @@ check_linux_console() } void -init_linux_cons() +init_linux_cons(void) { # ifdef TTY_GRAPHICS if (!strcmp(windowprocs.name, "tty") && linux_flag_console) { @@ -453,7 +453,7 @@ error VA_DECL(const char *,s) #ifdef UTF8_GLYPHS void -check_utf8_console() +check_utf8_console(void) { struct termios original; /* store current tty settings */ diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 7d12ed7d7..f0198fa51 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -26,33 +26,31 @@ extern struct passwd *getpwuid(int); #endif extern struct passwd *getpwnam(const char *); #ifdef CHDIR -static void chdirx(const char *,BOOLEAN_P); +static void chdirx(const char *, boolean); #endif /* CHDIR */ -static boolean whoami(); +static boolean whoami(void); static void process_options(int, char **); #ifdef _M_UNIX -extern void check_sco_console(); -extern void init_sco_cons(); +extern void check_sco_console(void); +extern void init_sco_cons(void); #endif #ifdef __linux__ -extern void check_linux_console(); -extern void init_linux_cons(); +extern void check_linux_console(void); +extern void init_linux_cons(void); #endif -static void wd_message(); +static void wd_message(void); #ifdef WIZARD static boolean wiz_error_flag = FALSE; #endif #ifdef UTF8_GLYPHS -extern void check_utf8_console(); +extern void check_utf8_console(void); #endif int -main(argc,argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { register int fd; #ifdef CHDIR @@ -325,13 +323,10 @@ char *argv[]; } static void -process_options(argc, argv) -int argc; -char *argv[]; +process_options(int argc, char *argv[]) { int i; - /* * Process options. */ @@ -443,9 +438,7 @@ char *argv[]; #ifdef CHDIR static void -chdirx(dir, wr) -const char *dir; -boolean wr; +chdirx(const char *dir, boolean wr) { if (dir /* User specified directory? */ # ifdef HACKDIR @@ -500,7 +493,8 @@ boolean wr; #endif /* CHDIR */ static boolean -whoami() { +whoami(void) +{ /* * Who am i? Algorithm: 1. Use name as specified in NETHACKOPTIONS * 2. Use $USER or $LOGNAME (if 1. fails) @@ -526,7 +520,7 @@ whoami() { #ifdef PORT_HELP void -port_help() +port_help(void) { /* * Display unix-specific help. Just show contents of the helpfile @@ -537,7 +531,7 @@ port_help() #endif static void -wd_message() +wd_message(void) { #ifdef WIZARD if (wiz_error_flag) { @@ -559,8 +553,7 @@ wd_message() * be room for the / */ void -append_slash(name) -char *name; +append_slash(char *name) { char *ptr; diff --git a/sys/unix/unixunix.c b/sys/unix/unixunix.c index af7adfb6e..90f2ad26a 100644 --- a/sys/unix/unixunix.c +++ b/sys/unix/unixunix.c @@ -15,12 +15,12 @@ #include #ifdef _M_UNIX -extern void sco_mapon(); -extern void sco_mapoff(); +extern void sco_mapon(void); +extern void sco_mapoff(void); #endif #ifdef __linux__ -extern void linux_mapon(); -extern void linux_mapoff(); +extern void linux_mapon(void); +extern void linux_mapoff(void); #endif #ifndef NHSTDC @@ -33,8 +33,7 @@ static struct stat buf; /* see whether we should throw away this xlock file */ static int -veryold(fd) -int fd; +veryold(int fd) { time_t date; @@ -70,7 +69,7 @@ int fd; } static int -eraseoldlocks() +eraseoldlocks(void) { register int i; @@ -98,7 +97,7 @@ eraseoldlocks() } void -getlock() +getlock(void) { register int i = 0, fd, c; #ifndef FILE_AREAS @@ -259,9 +258,9 @@ getlock() } } +/** normalize file name - we don't like .'s, /'s, spaces */ void -regularize(s) /* normalize file name - we don't like .'s, /'s, spaces */ -register char *s; +regularize(char *s) { register char *lp; @@ -306,7 +305,7 @@ unsigned msec; /* milliseconds */ #ifdef SHELL int -dosh() +dosh(void) { register char *str; @@ -328,8 +327,7 @@ dosh() #if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER) int -child(wt) -int wt; +child(int wt) { register int f; suspend_nhwindows((char *)0); /* also calls end_screen() */ @@ -381,8 +379,7 @@ int wt; */ char * -make_file_name(filearea, filename) -const char *filearea, *filename; +make_file_name(const char *filearea, const char *filename) { char *buf; int lenarea; @@ -403,9 +400,11 @@ const char *filearea, *filename; } FILE * -fopen_datafile_area(filearea, filename, mode, use_scoreprefix) -const char *filearea, *filename, *mode; -boolean use_scoreprefix UNUSED; +fopen_datafile_area( + const char *filearea, + const char *filename, + const char *mode, + boolean use_scoreprefix UNUSED) { FILE *fp; char *buf; @@ -416,9 +415,7 @@ boolean use_scoreprefix UNUSED; } int -chmod_area(filearea, filename, mode) -const char *filearea, *filename; -int mode; +chmod_area(const char *filearea, const char *filename, int mode) { int retval; char *buf; @@ -429,9 +426,7 @@ int mode; } int -open_area(filearea, filename, flags, mode) -const char *filearea, *filename; -int flags, mode; +open_area(const char *filearea, const char *filename, int flags, int mode) { int fd; char *buf; @@ -442,9 +437,7 @@ int flags, mode; } int -creat_area(filearea, filename, mode) -const char *filearea, *filename; -int mode; +creat_area(const char *filearea, const char *filename, int mode) { int fd; char *buf; @@ -455,8 +448,7 @@ int mode; } int -rename_area(filearea, oldfilename, newfilename) -const char *filearea, *oldfilename, *newfilename; +rename_area(const char *filearea, const char *oldfilename, const char *newfilename) { int retval; char *oldpath,*newpath; @@ -469,8 +461,7 @@ const char *filearea, *oldfilename, *newfilename; } int -remove_area(filearea, filename) -const char *filearea, *filename; +remove_area(const char *filearea, const char *filename) { int retval; char *buf; @@ -481,9 +472,7 @@ const char *filearea, *filename; } FILE * -freopen_area(filearea, filename, mode, stream) -const char *filearea, *filename, *mode; -FILE *stream; +freopen_area(const char *filearea, const char *filename, const char *mode, FILE *stream) { FILE *fp; char *buf; @@ -525,13 +514,13 @@ uid_t *ruid, *euid, *suid; } uid_t -(getuid)() +(getuid)(void) { return nh_getuid(); } uid_t -(geteuid)() +(geteuid)(void) { return nh_geteuid(); } @@ -544,13 +533,13 @@ gid_t *rgid, *egid, *sgid; } gid_t -(getgid)() +(getgid)(void) { return nh_getgid(); } gid_t -(getegid)() +(getegid)(void) { return nh_getegid(); } diff --git a/tests/options/mocks.h b/tests/options/mocks.h index 24fef670a..a85405c03 100644 --- a/tests/options/mocks.h +++ b/tests/options/mocks.h @@ -64,10 +64,10 @@ void reassign() {} uint32_t isaac_next_uint32(isaac_ctx *_ctx) { return 0; } void isaac_init(isaac_ctx *_ctx,const unsigned char *_seed,int _nseed) {} -void reset_commands(BOOLEAN_P b) {} +void reset_commands(boolean b) {} boolean is_pool(int i1, int i2) { return FALSE; } boolean is_lava(int i1, int i3) { return FALSE; } char txt2key(char *txt) { return ' '; } -boolean bind_key(UCHAR_P key, const char *command) { return FALSE; } -boolean bind_specialkey(UCHAR_P key, const char *command) { return FALSE; } +boolean bind_key(uchar key, const char *command) { return FALSE; } +boolean bind_specialkey(uchar key, const char *command) { return FALSE; } diff --git a/tests/unicode/mocks.h b/tests/unicode/mocks.h index 4ab933134..8dda59771 100644 --- a/tests/unicode/mocks.h +++ b/tests/unicode/mocks.h @@ -58,8 +58,8 @@ void reassign() {} void set_random_state(unsigned int a) { } int rnd(int a) { return 0; } -void reset_commands(BOOLEAN_P b) {} +void reset_commands(boolean b) {} char txt2key(char *txt) { return ' '; } -boolean bind_key(UCHAR_P key, const char *command) { return FALSE; } -boolean bind_specialkey(UCHAR_P key, const char *command) { return FALSE; } +boolean bind_key(uchar key, const char *command) { return FALSE; } +boolean bind_specialkey(uchar key, const char *command) { return FALSE; } diff --git a/tests/wishing/mocks.h b/tests/wishing/mocks.h index a6ac02aea..1dd753b28 100644 --- a/tests/wishing/mocks.h +++ b/tests/wishing/mocks.h @@ -64,7 +64,7 @@ void choose_windows(const char *str) {} void reassign() {} boolean Can_fall_thru(d_level *l) { return FALSE; } -const char *align_str(ALIGNTYP_P alignment) { return "unknown"; } +const char *align_str(aligntyp alignment) { return "unknown"; } const char* artifact_name(const char *name, short *typ) { return NULL; } void attach_egg_hatch_timeout(struct obj *obj, long i) {} @@ -73,7 +73,7 @@ void unblock_point(int x, int y) {} const char* body_part(int typ) { return "body_part"; } int can_be_hatched(int typ) { return typ; } void consume_oeaten(struct obj *obj, int amount) {} -boolean dead_species(int typ, BOOLEAN_P bool) { return FALSE; } +boolean dead_species(int typ, boolean bool) { return FALSE; } void del_engr_at(int x, int y) {} void delete_contents(struct obj *obj) {} int genus(int typ, int number) { return 0; } @@ -86,8 +86,8 @@ int title_to_mon(const char *str, int* number1, int* number2) { return NON_PM; } void obfree(struct obj *obj1, struct obj *obj2) {} struct obj* oname(struct obj *obj, const char *str) { return NULL; } -int water_damage(struct obj *o, const char *str, BOOLEAN_P b) { return FALSE; } -void water_damage_chain(struct obj *o, BOOLEAN_P b) {} +int water_damage(struct obj *o, const char *str, boolean b) { return FALSE; } +void water_damage_chain(struct obj *o, boolean b) {} void reset_remarm() {} struct permonst* rndmonst() { return NULL; } @@ -99,15 +99,15 @@ uint32_t isaac_next_uint32(isaac_ctx *_ctx) { return 0; } void isaac_init(isaac_ctx *_ctx,const unsigned char *_seed,int _nseed) {} const char *artiname(int i) { return 0; } -struct obj* mk_artifact(struct obj *obj, ALIGNTYP_P typ) { return NULL; } +struct obj* mk_artifact(struct obj *obj, aligntyp typ) { return NULL; } boolean exist_artifact(int typ, const char *str) { return FALSE; } -void artifact_exists(struct obj *obj, const char *str, BOOLEAN_P bool) {} +void artifact_exists(struct obj *obj, const char *str, boolean bool) {} int nartifact_exist() { return 0; } boolean confers_luck(struct obj *obj) { return FALSE; } boolean defends(int number1, struct obj *obj) { return FALSE; } boolean defends_when_carried(int i, struct obj *o) { return FALSE; } -boolean protects(struct obj *o, BOOLEAN_P b) { return FALSE; } -boolean undiscovered_artifact(XCHAR_P typ) { return FALSE; } +boolean protects(struct obj *o, boolean b) { return FALSE; } +boolean undiscovered_artifact(xchar typ) { return FALSE; } boolean MATCH_WARN_OF_MON(struct monst *monst) { return FALSE; } void set_moreluck() {} @@ -125,7 +125,7 @@ xchar level_difficulty() { return 1; } int eaten_stat(int number1, struct obj *obj) { return 0; } -char* in_rooms(XCHAR_P x, XCHAR_P y, int number) { return NULL; } +char* in_rooms(xchar x, xchar y, int number) { return NULL; } int merged(struct obj **obj1, struct obj **obj2) { return 0; } const char* currency(long number) { return "currency"; } @@ -140,16 +140,16 @@ boolean prohibited_by_generation_flags(struct permonst *permonst) { return FALSE int undead_to_corpse(int number) { return NON_PM; } -void discover_object(int number, BOOLEAN_P bool1, BOOLEAN_P bool2) {} +void discover_object(int number, boolean bool1, boolean bool2) {} -struct monst* shop_keeper(CHAR_P c) { return NULL; } -long contained_cost(struct obj *obj, struct monst *monst, long number, BOOLEAN_P bool1, BOOLEAN_P bool2) { return 0; } -long unpaid_cost(struct obj *obj, BOOLEAN_P b) { return 0; } -void addtobill(struct obj *obj, BOOLEAN_P bool1, BOOLEAN_P bool2, BOOLEAN_P bool3) {} +struct monst* shop_keeper(char c) { return NULL; } +long contained_cost(struct obj *obj, struct monst *monst, long number, boolean bool1, boolean bool2) { return 0; } +long unpaid_cost(struct obj *obj, boolean b) { return 0; } +void addtobill(struct obj *obj, boolean bool1, boolean bool2, boolean bool3) {} void splitbill(struct obj *obj1, struct obj *obj2) {} void subfrombill(struct obj *obj, struct monst *monst) {} boolean is_fshk(struct monst *monst) { return FALSE; } -boolean costly_spot(XCHAR_P x, XCHAR_P y) { return FALSE; } +boolean costly_spot(xchar x, xchar y) { return FALSE; } long get_cost_of_shop_item(struct obj *obj) { return 0; } char* shk_your(char *buf, struct obj *obj) { return "shk_your"; } char* Shk_Your(char *buf, struct obj *obj) { return "Shk_Your"; } @@ -157,9 +157,9 @@ char* Shk_Your(char *buf, struct obj *obj) { return "Shk_Your"; } boolean rloco(struct obj *obj) { return FALSE; } void attach_fig_transform_timeout(struct obj *obj) {} -void begin_burn(struct obj *obj, BOOLEAN_P bool) {} -boolean start_timer(long timeleft, SHORT_P typ, SHORT_P action, ANY_P *generic) { return TRUE; } -long stop_timer(SHORT_P typ, ANY_P *generic) { return 0; } +void begin_burn(struct obj *obj, boolean bool) {} +boolean start_timer(long timeleft, short typ, short action, ANY_P *generic) { return TRUE; } +long stop_timer(short typ, ANY_P *generic) { return 0; } void obj_split_timers(struct obj *obj1, struct obj *obj2) {} void obj_stop_timers(struct obj *obj) {} @@ -175,8 +175,8 @@ void copy_mextra(struct monst *m1, struct monst *m2) {} void dealloc_mextra(struct monst *m) {} struct obj *hold_another_object(struct obj *o, const char *s1, const char *s2, const char *s3) { return NULL; } -boolean can_reach_floor(BOOLEAN_P b) { return FALSE; } -void hitfloor(struct obj *o, BOOLEAN_P b) {} +boolean can_reach_floor(boolean b) { return FALSE; } +void hitfloor(struct obj *o, boolean b) {} void doaltarobj(struct obj *o) {} const char *surface(int i1, int i2) { return NULL; } void dropy(struct obj *o) {} @@ -187,51 +187,51 @@ int arti_light_radius(struct obj *o) { return 0; } void alter_cost(struct obj *o, long l) {} -boolean billable(struct monst **m, struct obj *o, CHAR_P c, BOOLEAN_P b) { return FALSE; } +boolean billable(struct monst **m, struct obj *o, char c, boolean b) { return FALSE; } void book_cursed(struct obj *o) {} -void consume_obj_charge(struct obj *o, BOOLEAN_P b) {} +void consume_obj_charge(struct obj *o, boolean b) {} void forget_temple_entry(struct monst *m) {} void maybe_reset_pick(struct obj *o) {} boolean mergable(struct obj *o1, struct obj *o2) { return FALSE; } void mwepgone(struct monst *m) {} -struct obj *nxtobj(struct obj *o, int i, BOOLEAN_P b) { return NULL; } +struct obj *nxtobj(struct obj *o, int i, boolean b) { return NULL; } void obj_adjust_light_radius(struct obj *o, int i) {} int oid_price_adjustment(struct obj *o, unsigned i) { return 0; } void set_tin_variety(struct obj *o, int i) {} struct obj *sobj_at(int i1, int i2, int i3) { return NULL; } -long stolen_value(struct obj *o, XCHAR_P c1, XCHAR_P c2, BOOLEAN_P b1, BOOLEAN_P b2) { return 0; } -void update_mon_intrinsics(struct monst *m, struct obj *o, BOOLEAN_P b1, BOOLEAN_P b2) {} -char *x_monnam(struct monst *m, int i1, const char *s, int i2, BOOLEAN_P b) { return NULL; } +long stolen_value(struct obj *o, xchar c1, xchar c2, boolean b1, boolean b2) { return 0; } +void update_mon_intrinsics(struct monst *m, struct obj *o, boolean b1, boolean b2) {} +char *x_monnam(struct monst *m, int i1, const char *s, int i2, boolean b) { return NULL; } const char *safe_oname(struct obj *o) { return NULL; } void update_inventory() {} -void reset_commands(BOOLEAN_P b) {} +void reset_commands(boolean b) {} char *tshirt_text(struct obj *o, char *s) { return NULL; } char *hawaiian_motif(struct obj *o, char *s) { return NULL; } char *apron_text(struct obj *o, char *s) { return NULL; } void tin_details(struct obj *o, int i, char *s) {} -long count_contents(struct obj *o, BOOLEAN_P b1, BOOLEAN_P b2, BOOLEAN_P b3, BOOLEAN_P b4) { return 0; } +long count_contents(struct obj *o, boolean b1, boolean b2, boolean b3, boolean b4) { return 0; } boolean donning(struct obj *o) { return FALSE; } boolean doffing(struct obj *o) { return FALSE; } struct monst *find_mid(unsigned i1, unsigned i2) { return NULL; } char *noit_mon_nam(struct monst *m) { return NULL; } const char *glow_color(int i) { return NULL; } -const char *glow_verb(int i, BOOLEAN_P b) { return NULL; } +const char *glow_verb(int i, boolean b) { return NULL; } boolean restoring = FALSE; boolean is_pool(int i1, int i2) { return FALSE; } boolean is_lava(int i1, int i3) { return FALSE; } -void feel_newsym(XCHAR_P x, XCHAR_P y) {} -void reset_utrap(BOOLEAN_P b) {} +void feel_newsym(xchar x, xchar y) {} +void reset_utrap(boolean b) {} boolean is_fainted() { return FALSE; } boolean unconscious() { return FALSE; } char txt2key(char *txt) { return ' '; } -boolean bind_key(UCHAR_P key, const char *command) { return FALSE; } -boolean bind_specialkey(UCHAR_P key, const char *command) { return FALSE; } +boolean bind_key(uchar key, const char *command) { return FALSE; } +boolean bind_specialkey(uchar key, const char *command) { return FALSE; } int zombie_form(struct permonst *pm) { return 0; } diff --git a/util/dgn_comp.l b/util/dgn_comp.l index 51b88994b..b2a5f1a88 100644 --- a/util/dgn_comp.l +++ b/util/dgn_comp.l @@ -117,8 +117,7 @@ RNDCHLEVEL return(RNDCHLEVEL); %% /* routine to switch to another input file; needed for flex */ -void init_yyin( input_f ) -FILE *input_f; +void init_yyin(FILE *input_f) { #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) if (yyin) @@ -128,8 +127,7 @@ FILE *input_f; yyin = input_f; } /* analogous routine (for completeness) */ -void init_yyout( output_f ) -FILE *output_f; +void init_yyout(FILE *output_f) { yyout = output_f; } diff --git a/util/dgn_comp.y b/util/dgn_comp.y index c47b960c2..aa5334e71 100644 --- a/util/dgn_comp.y +++ b/util/dgn_comp.y @@ -28,16 +28,16 @@ void yyerror(const char *); void yywarning(const char *); -int yylex(); -int yyparse(); +int yylex(void); +int yyparse(void); int getchain(char *); -int check_dungeon(); -int check_branch(); -int check_level(); -void init_dungeon(); -void init_branch(); -void init_level(); -void output_dgn(); +int check_dungeon(void); +int check_branch(void); +int check_level(void); +void init_dungeon(void); +void init_branch(void); +void init_level(void); +void output_dgn(void); #define Free(ptr) free((genericptr_t)ptr) @@ -432,7 +432,7 @@ rcouple : '(' INTEGER ',' INTEGER ')' %% void -init_dungeon() +init_dungeon(void) { if(++n_dgns > MAXDUNGEON) { (void) fprintf(stderr, "FATAL - Too many dungeons (limit: %d).\n", @@ -454,7 +454,7 @@ init_dungeon() } void -init_level() +init_level(void) { if(++n_levs > LEV_LIMIT) { @@ -471,7 +471,7 @@ init_level() } void -init_branch() +init_branch(void) { if(++n_brs > BRANCH_LIMIT) { @@ -485,8 +485,7 @@ init_branch() } int -getchain(s) - char *s; +getchain(char *s) { int i; @@ -511,7 +510,7 @@ getchain(s) */ int -check_dungeon() +check_dungeon(void) { int i; @@ -548,7 +547,7 @@ check_dungeon() */ int -check_level() +check_level(void) { int i; @@ -590,7 +589,7 @@ check_level() */ int -check_branch() +check_branch(void) { int i; @@ -637,7 +636,7 @@ check_branch() */ void -output_dgn() +output_dgn(void) { int nd, cl = 0, nl = 0, cb = 0, nb = 0; diff --git a/util/dgn_main.c b/util/dgn_main.c index aba0f85ba..4a77d99ac 100644 --- a/util/dgn_main.c +++ b/util/dgn_main.c @@ -53,9 +53,7 @@ FILE *freopen(char *,char *,FILE *); extern unsigned _stklen = STKSIZ; #endif int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { char infile[64], outfile[64], basename[64]; FILE *fin, *fout; @@ -158,8 +156,7 @@ char **argv; * MAX_ERRORS wouldn't be reasonable. */ -void yyerror(s) -const char *s; +void yyerror(const char *s) { (void) fprintf(stderr,"%s : line %d : %s\n",fname,line_number, s); if (++fatal_error > MAX_ERRORS) { @@ -172,13 +169,12 @@ const char *s; * Just display a warning (that is : a non fatal error) */ -void yywarning(s) -const char *s; +void yywarning(const char *s) { (void) fprintf(stderr,"%s : line %d : WARNING : %s\n",fname,line_number,s); } -int yywrap() +int yywrap(void) { SpinCursor(3); /* Don't know if this is a good place to put it ? Is it called for our grammar ? Often enough ? diff --git a/util/dlb_main.c b/util/dlb_main.c index da5df7329..e9c338e8e 100644 --- a/util/dlb_main.c +++ b/util/dlb_main.c @@ -34,8 +34,8 @@ extern int vms_open(const char *,int,unsigned int); #endif static void Write(int,char *,long); -static void usage(); -static void verbose_help(); +static void usage(void); +static void verbose_help(void); static void write_dlb_directory(int,int,libdir *,long,long,long); static char default_progname[] = "dlb"; @@ -81,7 +81,7 @@ static char origdir[255]=""; */ static void -usage() +usage(void) { (void) printf("Usage: %s [ctxCIfv] arguments... [files...]\n", progname); (void) printf(" default library is %s\n", library_file); @@ -90,7 +90,7 @@ usage() } static void -verbose_help() +verbose_help(void) { static const char *long_help[] = { "", @@ -117,9 +117,7 @@ verbose_help() } libdir * -realloc_ld(ld, len) -libdir *ld; -long *len; +realloc_ld(libdir *ld, long *len) { libdir *tmp = (libdir *)alloc(((*len) + DLB_IDX_REALLOC) * sizeof(libdir)); if (!tmp) { @@ -135,10 +133,7 @@ long *len; } static void -Write(out,buf,len) - int out; - char *buf; - long len; +Write(int out, char *buf, long len) { #if defined(MSDOS) && !defined(__DJGPP__) unsigned short slen; @@ -160,8 +155,7 @@ Write(out,buf,len) char * -eos(s) - char *s; +eos(char *s) { while (*s) s++; return s; @@ -192,8 +186,7 @@ const char *filename, *mode; #ifdef FILE_AREAS #ifdef UNIX FILE * -fopen_datafile_area(filearea, filename, mode) -const char *filearea, *filename, *mode; +fopen_datafile_area(const char *filearea, const char *filename, const char *mode) { FILE *fp; char *buf; @@ -225,9 +218,7 @@ const char *filename, *mode; #endif /* DLB */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { #ifdef DLB #ifdef DLBLIB @@ -537,10 +528,13 @@ main(argc, argv) #ifdef DLBLIB static void -write_dlb_directory(out, nfiles, ld, slen, dir_size, flen) -int out, nfiles; -libdir *ld; -long slen, dir_size, flen; +write_dlb_directory( + int out, + int nfiles, + libdir *ld, + long slen, + long dir_size, + long flen) { char buf[BUFSIZ]; int i; @@ -571,8 +565,7 @@ long slen, dir_size, flen; #endif /* DLB */ static void -xexit(retcd) - int retcd; +xexit(int retcd) { #ifdef DLB #ifdef AMIGA @@ -582,7 +575,6 @@ xexit(retcd) exit(retcd); } - #ifdef AMIGA #include "date.h" const char amiga_version_string[] = AMIGA_VERSION_STRING; diff --git a/util/lev_comp.l b/util/lev_comp.l index edfebe29c..cf4f5bf33 100644 --- a/util/lev_comp.l +++ b/util/lev_comp.l @@ -14,10 +14,10 @@ */ #if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER) int yyback(int *,int); -int yylook(); -int yyinput(); -int yywrap(); -int yylex(); +int yylook(void); +int yyinput(void); +int yywrap(void); +int yylex(void); /* Traditional lexes let yyunput() and yyoutput() default to int; * newer ones may declare them as void since they don't return * values. For even more fun, the lex supplied as part of the @@ -65,9 +65,9 @@ void init_yyin(FILE *); void init_yyout(FILE *); void include_push(const char *); -int include_pop(); +int include_pop(void); -long handle_varstring_method(); +long handle_varstring_method(void); long corefunc_str_check(char *, long); extern struct lc_vardefs *vardef_defined(struct lc_vardefs *,char *, int); @@ -77,7 +77,7 @@ extern struct lc_vardefs *variable_definitions; extern long method_defined(char *, long, long *); void savetoken(char *); -void newline(); +void newline(void); void advancepos(char *); extern void VDECL(lc_error, (const char *, ...)); @@ -86,7 +86,7 @@ extern char core_func_retval(int); extern int is_core_func(char *); extern int core_func_idx(char *); -extern int yyparse(); +extern int yyparse(void); extern void yyerror(const char *); /* @@ -383,8 +383,7 @@ long *alloc(n) #endif /* routine to switch to another input file; needed for flex */ -void init_yyin( input_f ) -FILE *input_f; +void init_yyin(FILE *input_f) { #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) if (yyin) @@ -397,15 +396,13 @@ FILE *input_f; } } /* analogous routine (for completeness) */ -void init_yyout( output_f ) -FILE *output_f; +void init_yyout(FILE *output_f) { yyout = output_f; } void -include_push(fname) -const char *fname; +include_push(const char *fname) { if (doing_included_file >= 5) yyerror("Too deep includes"); @@ -428,7 +425,7 @@ const char *fname; } int -include_pop() +include_pop(void) { if (--doing_included_file < 0) { doing_included_file = 0; @@ -447,7 +444,7 @@ include_pop() * Stub needed for lex interface. */ int -yywrap() +yywrap(void) { if (doing_included_file > 0) { include_pop(); @@ -456,7 +453,7 @@ yywrap() } long -handle_varstring_check() +handle_varstring_check(void) { struct lc_vardefs *vd; yylval.map = (char *) alloc(strlen(yytext)+1); @@ -479,7 +476,7 @@ handle_varstring_check() } long -handle_varstring_method() +handle_varstring_method(void) { struct lc_vardefs *vd; char *idx = index(yytext, '.'); @@ -519,9 +516,7 @@ handle_varstring_method() long -corefunc_str_check(s, retval) -char *s; -long retval; +corefunc_str_check(char *s, long retval) { int f = is_core_func(s); if (f) { @@ -542,7 +537,7 @@ long retval; } void -newline() +newline(void) { line_number++; token_start_pos = 0; @@ -550,16 +545,14 @@ newline() } void -savetoken(s) -char *s; +savetoken(char *s) { sprintf(curr_token, "%s", s); advancepos(s); } void -advancepos(s) -char *s; +advancepos(char *s) { token_start_pos += strlen(s); } diff --git a/util/lev_comp.y b/util/lev_comp.y index c9291b1e2..0c633a6da 100644 --- a/util/lev_comp.y +++ b/util/lev_comp.y @@ -43,10 +43,10 @@ extern void VDECL(lc_error, (const char *, ...)); extern void VDECL(lc_warning, (const char *, ...)); extern void yyerror(const char *); extern void yywarning(const char *); -extern int yylex(); -int yyparse(); +extern int yylex(void); +int yyparse(void); extern void include_push(const char *); -extern int include_pop(); +extern int include_pop(void); extern int get_floor_type(CHAR_P); extern int get_room_type(char *); @@ -75,7 +75,7 @@ extern struct lc_vardefs *vardef_new(long,char *); extern void vardef_free_all(struct lc_vardefs *); extern struct lc_vardefs *vardef_defined(struct lc_vardefs *,char *, int); -extern void break_stmt_start(); +extern void break_stmt_start(void); extern void break_stmt_end(sp_lev *); extern void break_stmt_new(sp_lev *, long); diff --git a/util/lev_main.c b/util/lev_main.c index ea62910c8..430329635 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -77,14 +77,14 @@ int main(int, char **); void yyerror(const char *); void yywarning(const char *); int yywrap(void); -int get_floor_type(CHAR_P); +int get_floor_type(char); int get_room_type(char *); int get_trap_type(char *); -int get_monster_id(char *,CHAR_P); -int get_object_id(char *,CHAR_P); -boolean check_monster_char(CHAR_P); -boolean check_object_char(CHAR_P); -char what_map_char(CHAR_P); +int get_monster_id(char *,char); +int get_object_id(char *,char); +boolean check_monster_char(char); +boolean check_object_char(char); +char what_map_char(char); void scan_map(char *, sp_lev *); boolean check_subrooms(sp_lev *); boolean write_level_file(char *,sp_lev *); @@ -99,15 +99,15 @@ struct lc_vardefs *vardef_defined(struct lc_vardefs *,char *, int); void splev_add_from(sp_lev *, sp_lev *); -extern void monst_init(); -extern void objects_init(); -extern void decl_init(); +extern void monst_init(void); +extern void objects_init(void); +extern void decl_init(void); void add_opcode(sp_lev *, int, genericptr_t); static boolean write_common_data(int,sp_lev *); static boolean write_maze(int,sp_lev *); -static void init_obj_classes(); +static void init_obj_classes(void); void VDECL(lc_error, (const char *, ...)); void VDECL(add_opvars, (sp_lev *, const char *, ...)); @@ -282,9 +282,7 @@ extern int allow_break_statements; extern struct lc_breakdef *break_list; int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { FILE *fin; int i; @@ -379,8 +377,7 @@ char **argv; * MAX_ERRORS wouldn't be reasonable. */ void -yyerror(s) -const char *s; +yyerror(const char *s) { char *e = ((char *)s + strlen(s) - 1); (void) fprintf(stderr, "%s: line %d, pos %zu : %s", @@ -415,8 +412,7 @@ lc_error(const char *fmt, ...) * Just display a warning (that is : a non fatal error) */ void -yywarning(s) -const char *s; +yywarning(const char *s) { (void) fprintf(stderr, "%s: line %d : WARNING : %s\n", fname, line_number, s); @@ -436,8 +432,7 @@ lc_warning(const char *fmt, ...) } char * -decode_parm_chr(chr) -char chr; +decode_parm_chr(char chr) { static char buf[32]; switch (chr) { @@ -455,8 +450,7 @@ char chr; } char * -decode_parm_str(str) -char *str; +decode_parm_str(char *str) { static char tmpbuf[1024]; char *p = str; @@ -509,11 +503,7 @@ core_func_name(int idx) } int -handle_corefunc(splev, funcname, parmlist, retc) -sp_lev *splev; -char *funcname; -char *parmlist; -char retc; +handle_corefunc(sp_lev *splev, char *funcname, char *parmlist, char retc) { int f = is_core_func(funcname); int i; @@ -546,9 +536,7 @@ char retc; } struct opvar * -set_opvar_int(ov, val) -struct opvar *ov; -long val; +set_opvar_int(struct opvar *ov, long val) { if (ov) { ov->spovartyp = SPOVAR_INT; @@ -558,9 +546,7 @@ long val; } struct opvar * -set_opvar_coord(ov, val) -struct opvar *ov; -long val; +set_opvar_coord(struct opvar *ov, long val) { if (ov) { ov->spovartyp = SPOVAR_COORD; @@ -570,9 +556,7 @@ long val; } struct opvar * -set_opvar_region(ov, val) -struct opvar *ov; -long val; +set_opvar_region(struct opvar *ov, long val) { if (ov) { ov->spovartyp = SPOVAR_REGION; @@ -582,9 +566,7 @@ long val; } struct opvar * -set_opvar_mapchar(ov, val) -struct opvar *ov; -long val; +set_opvar_mapchar(struct opvar *ov, long val) { if (ov) { ov->spovartyp = SPOVAR_MAPCHAR; @@ -594,9 +576,7 @@ long val; } struct opvar * -set_opvar_monst(ov, val) -struct opvar *ov; -long val; +set_opvar_monst(struct opvar *ov, long val) { if (ov) { ov->spovartyp = SPOVAR_MONST; @@ -606,9 +586,7 @@ long val; } struct opvar * -set_opvar_obj(ov, val) -struct opvar *ov; -long val; +set_opvar_obj(struct opvar *ov, long val) { if (ov) { ov->spovartyp = SPOVAR_OBJ; @@ -618,9 +596,7 @@ long val; } struct opvar * -set_opvar_str(ov, val) -struct opvar *ov; -char *val; +set_opvar_str(struct opvar *ov, char *val) { if (ov) { ov->spovartyp = SPOVAR_STRING; @@ -630,9 +606,7 @@ char *val; } struct opvar * -set_opvar_var(ov, val) -struct opvar *ov; -char *val; +set_opvar_var(struct opvar *ov, char *val) { if (ov) { ov->spovartyp = SPOVAR_VARIABLE; @@ -729,14 +703,13 @@ add_opvars(sp_lev *sp, const char *fmt, ...) } void -break_stmt_start() +break_stmt_start(void) { allow_break_statements++; } void -break_stmt_end(splev) - sp_lev *splev; +break_stmt_end(sp_lev *splev) { struct lc_breakdef *tmp = break_list; struct lc_breakdef *prv = NULL; @@ -758,9 +731,7 @@ break_stmt_end(splev) } void -break_stmt_new(splev,i) - sp_lev *splev; - long i; +break_stmt_new(sp_lev *splev, long i) { struct lc_breakdef *tmp = New(struct lc_breakdef); tmp->breakpoint = New(struct opvar); @@ -773,9 +744,7 @@ break_stmt_new(splev,i) } struct lc_funcdefs * -funcdef_new(addr, name) - long addr; - char *name; +funcdef_new(long addr, char *name) { struct lc_funcdefs *f = New(struct lc_funcdefs); if (!f) { @@ -794,8 +763,7 @@ funcdef_new(addr, name) } void -funcdef_free_all(fchain) - struct lc_funcdefs *fchain; +funcdef_free_all(struct lc_funcdefs *fchain) { struct lc_funcdefs *tmp = fchain; struct lc_funcdefs *nxt; @@ -820,8 +788,7 @@ funcdef_free_all(fchain) char * -funcdef_paramtypes(f) - struct lc_funcdefs *f; +funcdef_paramtypes(struct lc_funcdefs *f) { int i = 0; struct lc_funcdefs_parm *fp = f->params; @@ -836,10 +803,7 @@ funcdef_paramtypes(f) } struct lc_funcdefs * -funcdef_defined(f, name, casesense) - struct lc_funcdefs *f; - char *name; - int casesense; +funcdef_defined(struct lc_funcdefs *f, char *name, int casesense) { while (f) { if (casesense) { @@ -854,9 +818,7 @@ funcdef_defined(f, name, casesense) struct lc_vardefs * -vardef_new(typ, name) - long typ; - char *name; +vardef_new(long typ, char *name) { struct lc_vardefs *f = New(struct lc_vardefs); if (!f) { @@ -871,8 +833,7 @@ vardef_new(typ, name) } void -vardef_free_all(fchain) - struct lc_vardefs *fchain; +vardef_free_all(struct lc_vardefs *fchain) { struct lc_vardefs *tmp = fchain; struct lc_vardefs *nxt; @@ -887,10 +848,7 @@ vardef_free_all(fchain) } struct lc_vardefs * -vardef_defined(f, name, casesense) - struct lc_vardefs *f; - char *name; - int casesense; +vardef_defined(struct lc_vardefs *f, char *name, int casesense) { while (f) { if (casesense) { @@ -904,8 +862,7 @@ vardef_defined(f, name, casesense) } const char * -spovar2str(spovar) - long spovar; +spovar2str(long spovar) { static int togl = 0; static char buf[2][128]; @@ -932,19 +889,14 @@ spovar2str(spovar) } void -vardef_used(vd, varname) - struct lc_vardefs *vd; - char *varname; +vardef_used(struct lc_vardefs *vd, char *varname) { struct lc_vardefs *tmp; if ((tmp = vardef_defined(vd, varname, 1))) tmp->n_used++; } void -check_vardef_type(vd, varname, vartype) - struct lc_vardefs *vd; - char *varname; - long vartype; +check_vardef_type(struct lc_vardefs *vd, char *varname, long vartype) { struct lc_vardefs *tmp; if ((tmp = vardef_defined(vd, varname, 1))) { @@ -955,10 +907,7 @@ check_vardef_type(vd, varname, vartype) } struct lc_vardefs * -add_vardef_type(vd, varname, vartype) - struct lc_vardefs *vd; - char *varname; - long vartype; +add_vardef_type(struct lc_vardefs *vd, char *varname, long vartype) { struct lc_vardefs *tmp; if ((tmp = vardef_defined(vd, varname, 1))) { @@ -974,8 +923,7 @@ add_vardef_type(vd, varname, vartype) } int -reverse_jmp_opcode(opcode) - int opcode; +reverse_jmp_opcode(int opcode) { switch (opcode) { case SPO_JE: return SPO_JNE; @@ -990,8 +938,7 @@ reverse_jmp_opcode(opcode) /* basically copied from src/sp_lev.c */ struct opvar * -opvar_clone(ov) - struct opvar *ov; +opvar_clone(struct opvar *ov) { if (ov) { struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); @@ -1031,9 +978,7 @@ opvar_clone(ov) void -splev_add_from(splev, from_splev) - sp_lev *splev; - sp_lev *from_splev; +splev_add_from(sp_lev *splev, sp_lev *from_splev) { int i; if (splev && from_splev) @@ -1046,8 +991,7 @@ splev_add_from(splev, from_splev) * Find the type of floor, knowing its char representation. */ int -get_floor_type(c) -char c; +get_floor_type(char c) { int val; @@ -1064,8 +1008,7 @@ char c; * Find the type of a room in the table, knowing its name. */ int -get_room_type(s) -char *s; +get_room_type(char *s) { register int i; @@ -1080,8 +1023,7 @@ char *s; * Find the type of a trap in the table, knowing its name. */ int -get_trap_type(s) -char *s; +get_trap_type(char *s) { register int i; @@ -1096,9 +1038,7 @@ char *s; * Find the index of a monster in the table, knowing its name. */ int -get_monster_id(s, c) -char *s; -char c; +get_monster_id(char *s, char c) { register int i, class; @@ -1124,9 +1064,9 @@ char c; * Find the index of an object in the table, knowing its name. */ int -get_object_id(s, c) -char *s; -char c; /* class */ +get_object_id( + char *s, + char c) /**< class */ { int i, class; const char *objname; @@ -1156,7 +1096,7 @@ char c; /* class */ } static void -init_obj_classes() +init_obj_classes(void) { int i, class, prev_class; @@ -1174,8 +1114,7 @@ init_obj_classes() * Is the character 'c' a valid monster class ? */ boolean -check_monster_char(c) -char c; +check_monster_char(char c) { return (def_char_to_monclass(c) != MAXMCLASSES); } @@ -1184,8 +1123,7 @@ char c; * Is the character 'c' a valid object class ? */ boolean -check_object_char(c) -char c; +check_object_char(char c) { return (def_char_to_objclass(c) != MAXOCLASSES); } @@ -1194,8 +1132,7 @@ char c; * Convert .des map letter into floor type. */ char -what_map_char(c) -char c; +what_map_char(char c) { SpinCursor(3); switch(c) { @@ -1236,10 +1173,7 @@ char c; } void -add_opcode(sp, opc, dat) -sp_lev *sp; -int opc; -genericptr_t dat; +add_opcode(sp_lev *sp, int opc, genericptr_t dat) { long nop = sp->n_opcodes; _opcode *tmp; @@ -1267,9 +1201,7 @@ genericptr_t dat; * Just analyze it here. */ void -scan_map(map, sp) -char *map; -sp_lev *sp; +scan_map(char *map, sp_lev *sp) { register int i, len; register char *s1, *s2; @@ -1350,9 +1282,7 @@ sp_lev *sp; * Output some info common to all special levels. */ static boolean -write_common_data(fd, lvl) -int fd; -sp_lev *lvl UNUSED; +write_common_data(int fd, sp_lev *lvl UNUSED) { static struct version_info version_data = { VERSION_NUMBER, VERSION_FEATURES, @@ -1370,9 +1300,7 @@ sp_lev *lvl UNUSED; * Also, we have to free the memory allocated via alloc(). */ static boolean -write_maze(fd, maze) -int fd; -sp_lev *maze; +write_maze(int fd, sp_lev *maze) { int i; @@ -1439,9 +1367,7 @@ sp_lev *maze; static boolean -decompile_maze(fd, maze) -int fd; -sp_lev *maze; +decompile_maze(int fd, sp_lev *maze) { long i; char debuf[128]; @@ -1626,8 +1552,7 @@ sp_lev *maze; } char * -mangle_fname(fname) - char *fname; +mangle_fname(char *fname) { static char buf[256]; char *p = strchr(fname, '%'); @@ -1653,9 +1578,7 @@ mangle_fname(fname) * Return TRUE on success, FALSE on failure. */ boolean -write_level_file(filename, lvl) -char *filename; -sp_lev *lvl; +write_level_file(char *filename, sp_lev *lvl) { int fout; char lbuf[60]; diff --git a/util/makedefs.c b/util/makedefs.c index 35e032e2f..7dea87c54 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -143,25 +143,25 @@ char *file_prefix=""; #ifdef MACsansMPWTOOL int main(void); #else -int main(int,char **); +int main(int, char **); #endif void do_makedefs(char *); -void do_objs(); -void do_data(); -void do_dungeon(); -void do_date(); -void do_options(); -void do_monstr(); -void do_permonst(); -void do_questtxt(); -void do_rumors(); -void do_oracles(); -void do_vision(); - -extern void monst_init(); /* monst.c */ -extern void objects_init(); /* objects.c */ - -static void make_version(); +void do_objs(void); +void do_data(void); +void do_dungeon(void); +void do_date(void); +void do_options(void); +void do_monstr(void); +void do_permonst(void); +void do_questtxt(void); +void do_rumors(void); +void do_oracles(void); +void do_vision(void); + +extern void monst_init(void); /* monst.c */ +extern void objects_init(void); /* objects.c */ + +static void make_version(void); static char *version_string(char *); static char *version_id_string(char *,const char *); static char *xcrypt(const char *); @@ -171,7 +171,7 @@ static boolean d_filter(char *); static boolean h_filter(char *); static boolean ranged_attk(struct permonst*); static int mstrength(struct permonst *); -static void build_savebones_compat_string(); +static void build_savebones_compat_string(void); static boolean qt_comment(char *); static boolean qt_control(char *); @@ -181,14 +181,14 @@ static boolean known_msg(int,int); static void new_msg(char *,int,int); static void do_qt_control(char *); static void do_qt_text(char *); -static void adjust_qt_hdrs(); -static void put_qt_hdrs(); +static void adjust_qt_hdrs(void); +static void put_qt_hdrs(void); #ifdef VISION_TABLES -static void H_close_gen(); -static void H_far_gen(); -static void C_close_gen(); -static void C_far_gen(); +static void H_close_gen(void); +static void H_far_gen(void); +static void C_close_gen(void); +static void C_far_gen(void); static int clear_path(int,int,int,int); #endif @@ -229,9 +229,7 @@ main(void) #else /* ! MAC */ int -main(argc, argv) -int argc; -char *argv[]; +main( int argc, char *argv[]) { if ( (argc != 2) #ifdef FILE_PREFIX @@ -258,8 +256,7 @@ char *argv[]; #endif void -do_makedefs(options) -char *options; +do_makedefs(char *options) { boolean more_than_one; @@ -326,8 +323,7 @@ char *options; /* trivial text encryption routine which can't be broken with `tr' */ static -char *xcrypt(str) -const char *str; +char *xcrypt(const char *str) { /* duplicated in src/hacklib.c */ static char buf[BUFSZ]; register const char *p; @@ -344,7 +340,7 @@ const char *str; } void -do_rumors() +do_rumors(void) { char infile[60]; long true_rumor_size; @@ -421,7 +417,7 @@ do_rumors() ) static void -make_version() +make_version(void) { register int i; @@ -501,8 +497,7 @@ make_version() } static char * -version_string(outbuf) -char *outbuf; +version_string(char *outbuf) { Sprintf(outbuf, "%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL); #ifdef VERSION_REVISION @@ -515,9 +510,7 @@ char *outbuf; } static char * -version_id_string(outbuf, build_date) -char *outbuf; -const char *build_date; +version_id_string(char *outbuf, const char *build_date) { char subbuf[64], versbuf[64]; @@ -536,7 +529,7 @@ const char *build_date; } void -do_date() +do_date(void) { time_t clocktim = 0; char *c, cbuf[60], buf[BUFSZ], *source_date_epoch; @@ -604,7 +597,7 @@ do_date() static char save_bones_compat_buf[BUFSZ]; static void -build_savebones_compat_string() +build_savebones_compat_string(void) { unsigned long uver = VERSION_COMPATIBILITY; unsigned long cver = (((unsigned long) VERSION_MAJOR << 24) | @@ -845,7 +838,7 @@ static const char *window_opts[] = { }; void -do_options() +do_options(void) { register int i, length; register const char *str, *indent = " "; @@ -904,8 +897,7 @@ do_options() /* routine to decide whether to discard something from data.base */ static boolean -d_filter(line) - char *line; +d_filter(char *line) { if (*line == '#') return TRUE; /* ignore comment lines */ return FALSE; @@ -934,7 +926,7 @@ text-b/text-c at fseek(0x01234567L + 456L) */ void -do_data() +do_data(void) { char infile[60], tempfile[60]; boolean ok; @@ -1033,8 +1025,7 @@ dead_data: perror(in_line); /* report the problem */ /* routine to decide whether to discard something from oracles.txt */ static boolean -h_filter(line) - char *line; +h_filter(char *line) { static boolean skip = FALSE; char tag[sizeof in_line]; @@ -1075,7 +1066,7 @@ static const char *special_oracle[] = { */ void -do_oracles() +do_oracles(void) { char infile[60], tempfile[60]; boolean in_oracle, ok; @@ -1223,8 +1214,7 @@ static struct deflist { { 0, 0 } }; static int -check_control(s) - char *s; +check_control(char *s) { int i; @@ -1238,14 +1228,13 @@ check_control(s) } static char * -without_control(s) - char *s; +without_control(char *s) { return(s + 1 + strlen(deflist[check_control(in_line)].defname)); } void -do_dungeon() +do_dungeon(void) { int rcnt = 0; @@ -1293,9 +1282,9 @@ do_dungeon() return; } +/** returns TRUE if monster can attack at range */ static boolean -ranged_attk(ptr) /* returns TRUE if monster can attack at range */ - register struct permonst *ptr; +ranged_attk(struct permonst *ptr) { register int i, j; register int atk_mask = (1<mlevel; @@ -1368,7 +1356,7 @@ struct permonst *ptr; } void -do_monstr() +do_monstr(void) { register struct permonst *ptr; register int i, j; @@ -1398,9 +1386,9 @@ do_monstr() /* might want to insert a final 0 entry here instead of just newline */ Fprintf(ofp,"%s};\n", (j & 15) ? "\n" : ""); - Fprintf(ofp,"\nvoid monstr_init();\n"); + Fprintf(ofp,"\nvoid monstr_init(void);\n"); Fprintf(ofp,"\nvoid\n"); - Fprintf(ofp,"monstr_init()\n"); + Fprintf(ofp,"monstr_init(void)\n"); Fprintf(ofp,"{\n"); Fprintf(ofp," return;\n"); Fprintf(ofp,"}\n"); @@ -1411,7 +1399,7 @@ do_monstr() } void -do_permonst() +do_permonst(void) { int i; char *c, *nam; @@ -1464,23 +1452,20 @@ static boolean in_msg; #define NO_MSG 1 /* strlen of a null line returned by fgets() */ static boolean -qt_comment(s) - char *s; +qt_comment(char *s) { if(s[0] == '#') return(TRUE); return((boolean)(!in_msg && strlen(s) == NO_MSG)); } static boolean -qt_control(s) - char *s; +qt_control(char *s) { return((boolean)(s[0] == '%' && (s[1] == 'C' || s[1] == 'E'))); } static int -get_hdr (code) - char *code; +get_hdr(char *code) { int i; @@ -1491,8 +1476,7 @@ get_hdr (code) } static boolean -new_id (code) - char *code; +new_id(char *code) { if(qt_hdr.n_hdr >= N_HDR) { Fprintf(stderr, OUT_OF_HEADERS, qt_line); @@ -1506,8 +1490,7 @@ new_id (code) } static boolean -known_msg(num, id) - int num, id; +known_msg(int num, int id) { int i; @@ -1519,9 +1502,7 @@ known_msg(num, id) static void -new_msg(s, num, id) - char *s; - int num, id; +new_msg(char *s, int num, int id) { struct qtmsg *qt_msg; @@ -1538,8 +1519,7 @@ new_msg(s, num, id) } static void -do_qt_control(s) - char *s; +do_qt_control(char *s) { char code[BUFSZ]; int num, id = 0; @@ -1577,8 +1557,7 @@ do_qt_control(s) } static void -do_qt_text(s) - char *s; +do_qt_text(char *s) { if (!in_msg) { Fprintf(stderr, TEXT_NOT_IN_MSG, qt_line); @@ -1588,7 +1567,7 @@ do_qt_text(s) } static void -adjust_qt_hdrs() +adjust_qt_hdrs(void) { int i, j; long count = 0L, hdr_offset = sizeof(int) + @@ -1609,7 +1588,7 @@ adjust_qt_hdrs() } static void -put_qt_hdrs() +put_qt_hdrs(void) { int i; @@ -1657,7 +1636,7 @@ put_qt_hdrs() } void -do_questtxt() +do_questtxt(void) { Sprintf(filename, DATA_IN_TEMPLATE, QTXT_I_FILE); if(!(ifp = fopen(filename, RDTMODE))) { @@ -1712,10 +1691,9 @@ do_questtxt() static char temp[32]; +/** limit a name to 30 characters length */ static char * -limit(name,pref) /* limit a name to 30 characters length */ -char *name; -int pref; +limit(char *name, int pref) { (void) strncpy(temp, name, pref ? 26 : 30); temp[pref ? 26 : 30] = 0; @@ -1723,7 +1701,7 @@ int pref; } void -do_objs() +do_objs(void) { int i, sum = 0; char *c, *objnam; @@ -1842,8 +1820,7 @@ do_objs() } static char * -tmpdup(str) -const char *str; +tmpdup(const char *str) { static char buf[128]; @@ -1853,8 +1830,7 @@ const char *str; } static char * -eos(str) -char *str; +eos(char *str) { while (*str) str++; return str; @@ -1866,7 +1842,7 @@ char *str; */ void -do_vision() +do_vision(void) { #ifdef VISION_TABLES int i, j; @@ -1998,7 +1974,7 @@ do_vision() \*-------------- vision tables --------------*/ static void -H_close_gen() +H_close_gen(void) { Fprintf(ofp,"\n/* Close */\n"); Fprintf(ofp,"#define CLOSE_MAX_SB_DY %2d\t/* |src row - block row| - 1\t*/\n", @@ -2015,7 +1991,7 @@ H_close_gen() } static void -H_far_gen() +H_far_gen(void) { Fprintf(ofp,"\n/* Far */\n"); Fprintf(ofp,"#define FAR_MAX_SB_DY %2d\t/* |src row - block row|\t*/\n", @@ -2032,7 +2008,7 @@ H_far_gen() } static void -C_close_gen() +C_close_gen(void) { int i,dx,dy; int src_row, src_col; /* source */ @@ -2092,7 +2068,7 @@ C_close_gen() } static void -C_far_gen() +C_far_gen(void) { int i,dx,dy; int src_row, src_col; /* source */ diff --git a/util/recover.c b/util/recover.c index 75541dd23..f2d3de56b 100644 --- a/util/recover.c +++ b/util/recover.c @@ -24,7 +24,7 @@ extern int vms_open(const char *,int,unsigned); int restore_savefile(char *, const char *); static void set_levelfile_name(int); static int open_levelfile(int, const char *); -static int create_savefile(); +static int create_savefile(void); void copy_bytes(int,int); #ifndef WIN_CE @@ -61,9 +61,7 @@ char savename[SAVESIZE]; /* holds relative path of save file from playground */ #ifndef NO_MAIN int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { int argno; const char *dir = (char *)0; @@ -148,8 +146,7 @@ char *argv[]; static char lock[256]; static void -set_levelfile_name(lev) -int lev; +set_levelfile_name(int lev) { char *tf; @@ -162,9 +159,7 @@ int lev; } static int -open_levelfile(lev, directory) -int lev; -const char *directory; +open_levelfile(int lev, const char *directory) { int fd; char levelfile[BUFSIZ]; @@ -184,7 +179,7 @@ const char *directory; } static int -create_savefile() +create_savefile(void) { int fd; char savefile[BUFSIZ]; @@ -203,8 +198,7 @@ create_savefile() } void -copy_bytes(ifd, ofd) -int ifd, ofd; +copy_bytes(int ifd, int ofd) { char buf[BUFSIZ]; int nfrom, nto; @@ -220,9 +214,7 @@ int ifd, ofd; } int -restore_savefile(basename, directory) -char *basename; -const char *directory; +restore_savefile(char *basename, const char *directory) { int gfd, lfd, sfd; int lev, savelev, hpid; diff --git a/win/curses/cursdial.c b/win/curses/cursdial.c index 120774c61..7134721b3 100644 --- a/win/curses/cursdial.c +++ b/win/curses/cursdial.c @@ -16,11 +16,11 @@ typedef struct nhmi { winid wid; /* NetHack window id */ int glyph; /* Menu glyphs */ anything identifier; /* Value returned if item selected */ - CHAR_P accelerator; /* Character used to select item from menu */ - CHAR_P group_accel; /* Group accelerator for menu item, if any */ + char accelerator; /* Character used to select item from menu */ + char group_accel; /* Group accelerator for menu item, if any */ int attr; /* Text attributes for item */ const char *str; /* Text of menu item */ - BOOLEAN_P presel; /* Whether menu item should be preselected */ + boolean presel; /* Whether menu item should be preselected */ boolean selected; /* Whether item is currently selected */ int page_num; /* Display page number for entry */ int line_num; /* Line number on page where entry begins */ @@ -145,7 +145,7 @@ curses_line_input_dialog(const char *prompt, char *answer, int buffer) int curses_character_input_dialog(const char *prompt, const char *choices, - CHAR_P def) + char def) { WINDOW *askwin = NULL; int answer, count, maxwidth, map_height, map_width; @@ -306,7 +306,7 @@ curses_character_input_dialog(const char *prompt, const char *choices, /* Return an extended command from the user */ int -curses_ext_cmd() +curses_ext_cmd(void) { int count, letter, prompt_width, startx, starty, winx, winy; int messageh, messagew, maxlen = BUFSZ - 1; @@ -502,8 +502,8 @@ curses_create_nhmenu(winid wid) void curses_add_nhmenu_item(winid wid, int glyph, const ANY_P * identifier, - CHAR_P accelerator, CHAR_P group_accel, int attr, - const char *str, BOOLEAN_P presel) + char accelerator, char group_accel, int attr, + const char *str, boolean presel) { char *new_str; nhmenu_item *new_item, *current_items, *menu_item_ptr; diff --git a/win/curses/cursdial.h b/win/curses/cursdial.h index eb5b0145c..4220d6be6 100644 --- a/win/curses/cursdial.h +++ b/win/curses/cursdial.h @@ -14,12 +14,12 @@ void curses_line_input_dialog(const char *prompt, char *answer, int buffer); int curses_character_input_dialog(const char *prompt, const char *choices, - CHAR_P def); + char def); int curses_ext_cmd(void); void curses_create_nhmenu(winid wid); void curses_add_nhmenu_item(winid wid, int glyph, const ANY_P * identifier, - CHAR_P accelerator, CHAR_P group_accel, int attr, - const char *str, BOOLEAN_P presel); + char accelerator, char group_accel, int attr, + const char *str, boolean presel); # ifdef MENU_COLOR boolean curses_get_menu_coloring(const char *, int *, attr_t *); # endif @@ -28,6 +28,4 @@ int curses_display_nhmenu(winid wid, int how, MENU_ITEM_P ** _selected); boolean curses_menu_exists(winid wid); void curses_del_menu(winid wid); - - #endif /* CURSDIAL_H */ diff --git a/win/curses/cursinit.c b/win/curses/cursinit.c index 3f6508301..fb4d17aab 100644 --- a/win/curses/cursinit.c +++ b/win/curses/cursinit.c @@ -172,7 +172,7 @@ set_window_position(int *winx, int *winy, int *winw, int *winh, int orientation, /* Create the "main" nonvolitile windows used by nethack */ void -curses_create_main_windows() +curses_create_main_windows(void) { int min_message_height = 1; int message_orientation = 0; @@ -356,7 +356,7 @@ curses_create_main_windows() /* Initialize curses colors to colors used by NetHack */ void -curses_init_nhcolors() +curses_init_nhcolors(void) { #ifdef TEXTCOLOR if (has_colors()) { @@ -424,7 +424,7 @@ curses_init_nhcolors() Borrowed from the Gnome window port. */ void -curses_choose_character() +curses_choose_character(void) { int n, i, sel, count_off, pick4u; int count = 0; @@ -854,7 +854,7 @@ curses_character_dialog(const char **choices, const char *prompt) /* Initialize and display options appropriately */ void -curses_init_options() +curses_init_options(void) { set_wc_option_mod_status(WC_ALIGN_MESSAGE | WC_ALIGN_STATUS | WC_COLOR | WC_HILITE_PET | WC_POPUP_DIALOG, SET_IN_GAME); @@ -922,7 +922,7 @@ curses_init_options() /* Display an ASCII splash screen if the splash_screen option is set */ void -curses_display_splash_window() +curses_display_splash_window(void) { int x_start; int y_start; @@ -1049,14 +1049,14 @@ curses_display_splash_window() /* Resore colors and cursor state before exiting */ void -curses_cleanup() +curses_cleanup(void) { } /** Show all available colors with names. */ int -curses_debug_show_colors() +curses_debug_show_colors(void) { int i,c; winid tmpwin; diff --git a/win/curses/cursinvt.c b/win/curses/cursinvt.c index 86f3491f6..546e29a54 100644 --- a/win/curses/cursinvt.c +++ b/win/curses/cursinvt.c @@ -56,7 +56,7 @@ void curses_add_inv( int y, /* line index; 1..n rather than 0..n-1 */ int glyph, /* glyph to display with item */ - CHAR_P accelerator, /* selector letter for items, 0 for class headers */ + char accelerator, /* selector letter for items, 0 for class headers */ attr_t attr, /* curses attribute for headers, 0 for items */ const char *str) /* formatted inventory item, without invlet prefix, * or class header text */ diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index 4daca4dcd..725be2b77 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -180,7 +180,7 @@ curses_init_nhwindows(int *argcp UNUSED, char **argv UNUSED) the process. You need to fill in pl_character[0]. */ void -curses_player_selection() +curses_player_selection(void) { curses_choose_character(); } @@ -188,7 +188,7 @@ curses_player_selection() /* Ask the user for a player name. */ void -curses_askname() +curses_askname(void) { curses_line_input_dialog("Who are you?", plname, PL_NSIZ); } @@ -198,7 +198,7 @@ curses_askname() A noop for the tty and X window-ports. */ void -curses_get_nh_event() +curses_get_nh_event(void) { #ifdef PDCURSES if (is_termresized()) { @@ -249,7 +249,7 @@ curses_suspend_nhwindows(const char *str UNUSED) /* Restore the windows after being suspended. */ void -curses_resume_nhwindows() +curses_resume_nhwindows(void) { curses_refresh_nethack_windows(); } @@ -294,7 +294,7 @@ curses_clear_nhwindow(winid wid) --more--, if necessary, in the tty window-port. */ void -curses_display_nhwindow(winid wid, BOOLEAN_P block) +curses_display_nhwindow(winid wid, boolean block) { menu_item *selected = NULL; if (curses_is_menu(wid) || curses_is_text(wid)) { @@ -387,13 +387,13 @@ curses_putstr(winid wid, int attr, const char *text) */ #ifdef FILE_AREAS void -curses_display_file(const char *filearea,const char *filename,BOOLEAN_P must_exist) +curses_display_file(const char *filearea,const char *filename,boolean must_exist) { curses_view_file(filearea, filename, must_exist); } #else void -curses_display_file(const char *filename,BOOLEAN_P must_exist) +curses_display_file(const char *filename,boolean must_exist) { curses_view_file(filename, must_exist); } @@ -446,7 +446,7 @@ add_menu(winid wid, int glyph, const anything identifier, */ void curses_add_menu(winid wid, int glyph, int cnt UNUSED, const ANY_P * identifier, - CHAR_P accelerator, CHAR_P group_accel, int attr, + char accelerator, char group_accel, int attr, const char *str, unsigned int presel) { attr &= ~(ATR_URGENT | ATR_NOHISTORY); @@ -544,7 +544,7 @@ mark_synch() -- Don't go beyond this point in I/O on any channel until for the moment */ void -curses_mark_synch() +curses_mark_synch(void) { } @@ -555,7 +555,7 @@ wait_synch() -- Wait until all pending output is complete (*flush*() for display is OK when return from wait_synch(). */ void -curses_wait_synch() +curses_wait_synch(void) { } @@ -583,7 +583,7 @@ print_glyph(window, x, y, glyph) a 1-1 map between glyphs and distinct things on the map). */ void -curses_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph, +curses_print_glyph(winid wid, xchar x, xchar y, int glyph, int bg_glyph UNUSED) { int ch, color; @@ -649,7 +649,7 @@ int nhgetch() -- Returns a single character input from the user. Returned character _must_ be non-zero. */ int -curses_nhgetch() +curses_nhgetch(void) { int ch; @@ -695,18 +695,18 @@ nhbell() -- Beep at user. [This will exist at least until sounds are redone, since sounds aren't attributable to windows anyway.] */ void -curses_nhbell() +curses_nhbell(void) { beep(); } /* -doprev_message() +doprev_message(void) -- Display previous messages. Used by the ^P command. -- On the tty-port this scrolls WIN_MESSAGE back one line. */ int -curses_doprev_message() +curses_doprev_message(void) { curses_prev_mesg(); return 0; @@ -732,7 +732,7 @@ char yn_function(const char *ques, const char *choices, char default) ports might use a popup. */ char -curses_yn_function(const char *question, const char *choices, CHAR_P def) +curses_yn_function(const char *question, const char *choices, char def) { return (char) curses_character_input_dialog(question, choices, def); } @@ -754,13 +754,13 @@ curses_getlin(const char *question, char *input) } /* -int get_ext_cmd(void) +int get_ext_cmd() -- Get an extended command in a window-port specific way. An index into extcmdlist[] is returned on a successful selection, -1 otherwise. */ int -curses_get_ext_cmd() +curses_get_ext_cmd(void) { return curses_ext_cmd(); } @@ -781,7 +781,7 @@ delay_output() -- Causes a visible delay of 50ms in the output. by a nap(50ms), but allows asynchronous operation. */ void -curses_delay_output() +curses_delay_output(void) { /* refreshing the whole display is a waste of time, * but that's why we're here */ @@ -797,7 +797,7 @@ start_screen() -- Only used on Unix tty ports, but must be declared for just declare an empty function. */ void -curses_start_screen() +curses_start_screen(void) { } @@ -806,7 +806,7 @@ end_screen() -- Only used on Unix tty ports, but must be declared for completeness. The complement of start_screen(). */ void -curses_end_screen() +curses_end_screen(void) { } diff --git a/win/curses/cursmesg.c b/win/curses/cursmesg.c index e9217bb06..d2a588ed3 100644 --- a/win/curses/cursmesg.c +++ b/win/curses/cursmesg.c @@ -163,7 +163,7 @@ curses_block(boolean require_tab) } int -curses_more() +curses_more(void) { return curses_block(FALSE); } @@ -172,7 +172,7 @@ curses_more() /* Clear the message window if one line; otherwise unhighlight old messages */ void -curses_clear_unhighlight_message_window() +curses_clear_unhighlight_message_window(void) { int mh, mw, count; boolean border = curses_window_has_border(MESSAGE_WIN); @@ -213,7 +213,7 @@ curses_clear_unhighlight_message_window() recent messages. */ void -curses_last_messages() +curses_last_messages(void) { boolean border = curses_window_has_border(MESSAGE_WIN); @@ -239,7 +239,7 @@ curses_last_messages() /* Initialize list for message history */ void -curses_init_mesg_history() +curses_init_mesg_history(void) { max_messages = iflags.msg_history; @@ -256,7 +256,7 @@ curses_init_mesg_history() /* Display previous message window messages in reverse chron order */ void -curses_prev_mesg() +curses_prev_mesg(void) { int count; winid wid; diff --git a/win/curses/cursmisc.c b/win/curses/cursmisc.c index b2cbcc274..d07df9466 100644 --- a/win/curses/cursmisc.c +++ b/win/curses/cursmisc.c @@ -36,7 +36,7 @@ static int parse_escape_sequence(void); /* Read a character of input from the user */ int -curses_read_char() +curses_read_char(void) { int ch, tmpch; nhUse(tmpch); @@ -515,7 +515,7 @@ curses_move_cursor(winid wid, int x, int y) /* Perform actions that should be done every turn before nhgetch() */ void -curses_prehousekeeping() +curses_prehousekeeping(void) { #ifndef PDCURSES WINDOW *win = curses_get_nhwin(MAP_WIN); @@ -538,7 +538,7 @@ curses_prehousekeeping() /* Perform actions that should be done every turn after nhgetch() */ void -curses_posthousekeeping() +curses_posthousekeeping(void) { curs_set(0); curses_decrement_highlights(FALSE); @@ -888,7 +888,7 @@ term_start_attr(int attr) } extern void -term_end_color() +term_end_color(void) { } diff --git a/win/curses/cursstat.h b/win/curses/cursstat.h index 7773d422b..17cf32b79 100644 --- a/win/curses/cursstat.h +++ b/win/curses/cursstat.h @@ -14,7 +14,7 @@ /* Global declarations */ -void curses_update_stats(); +void curses_update_stats(void); void curses_decrement_highlights(boolean); attr_t curses_color_attr(int nh_color, int bg_color); diff --git a/win/curses/curswins.c b/win/curses/curswins.c index b466799f0..6a0178021 100644 --- a/win/curses/curswins.c +++ b/win/curses/curswins.c @@ -155,7 +155,7 @@ curses_destroy_win(WINDOW * win) /* Refresh nethack windows if they exist, or base window if not */ void -curses_refresh_nethack_windows() +curses_refresh_nethack_windows(void) { WINDOW *status_window, *message_window, *map_window, *inv_window; @@ -684,7 +684,7 @@ curses_draw_map(int sx, int sy, int ex, int ey) /* Init map array to blanks */ static void -clear_map() +clear_map(void) { int x, y; diff --git a/win/dummy/dummy_graphics.c b/win/dummy/dummy_graphics.c index 6cbf9e800..b74ae38de 100644 --- a/win/dummy/dummy_graphics.c +++ b/win/dummy/dummy_graphics.c @@ -41,7 +41,7 @@ struct window_procs dummy_procs = { dummy_add_menu, dummy_end_menu, dummy_select_menu, - genl_message_menu, /* no need for X-specific handling */ + genl_message_menu, /* no need for X-specific handling */ dummy_update_inventory, dummy_mark_synch, dummy_wait_synch, @@ -115,12 +115,12 @@ void dummy_init_nhwindows(int* argc, char** argv) the process. You need to fill in pl_character[0]. */ void -dummy_player_selection() +dummy_player_selection(void) { } /* Ask the user for a player name. */ -void dummy_askname() +void dummy_askname(void) { if (iflags.debug_fuzzer) { @@ -138,7 +138,7 @@ void dummy_askname() /* Does window event processing (e.g. exposure events). A noop for the tty and X window-ports. */ -void dummy_get_nh_event() +void dummy_get_nh_event(void) { dummy_printf("dummy_get_nh_event\n"); } @@ -161,7 +161,7 @@ void dummy_suspend_nhwindows(const char *str) /* Restore the windows after being suspended. */ -void dummy_resume_nhwindows() +void dummy_resume_nhwindows(void) { /* Do Nothing. */ dummy_printf("dummy_resume_nhwindows\n"); @@ -210,7 +210,7 @@ void dummy_clear_nhwindow(winid wid) -- Calling display_nhwindow(WIN_MESSAGE,???) will do a --more--, if necessary, in the tty window-port. */ -void dummy_display_nhwindow(winid wid, BOOLEAN_P block) +void dummy_display_nhwindow(winid wid, boolean block) { dummy_printf("dummy_display_nhwindow(%s, %d)\n", winid2str(wid), block); } @@ -267,9 +267,9 @@ void dummy_putstr(winid wid, int attr, const char *text) */ void #ifdef FILE_AREAS -dummy_display_file(const char *farea, const char *filename, BOOLEAN_P must_exist) +dummy_display_file(const char *farea, const char *filename, boolean must_exist) #else -dummy_display_file(const char *filename, BOOLEAN_P must_exist) +dummy_display_file(const char *filename, boolean must_exist) #endif { dummy_printf("dummy_display_file(%s, %d)\n", filename, must_exist); @@ -337,7 +337,7 @@ add_menu(windid window, int glyph, const anything identifier, menu is displayed, set preselected to TRUE. */ void dummy_add_menu(winid wid, int glyph, int cnt, const ANY_P * identifier, - CHAR_P accelerator, CHAR_P group_accel, int attr, + char accelerator, char group_accel, int attr, const char *str, unsigned int presel) { /* Do Nothing */ @@ -406,7 +406,7 @@ int dummy_select_menu(winid wid, int how, MENU_ITEM_P **selected) -- Merely calls display_inventory() for window-ports that leave the window up, otherwise empty. */ -void dummy_update_inventory() +void dummy_update_inventory(void) { /* Do Nothing */ dummy_printf("dummy_update_inventory\n"); @@ -417,7 +417,7 @@ mark_synch() -- Don't go beyond this point in I/O on any channel until all channels are caught up to here. Can be an empty call for the moment */ -void dummy_mark_synch() +void dummy_mark_synch(void) { /* Do nothing */ dummy_printf("dummy_mark_synch\n"); @@ -429,7 +429,7 @@ wait_synch() -- Wait until all pending output is complete (*flush*() for -- May also deal with exposure events etc. so that the display is OK when return from wait_synch(). */ -void dummy_wait_synch() +void dummy_wait_synch(void) { /* Do nothing */ dummy_printf("dummy_wait_synch\n"); @@ -456,7 +456,7 @@ print_glyph(window, x, y, glyph) port wants (symbol, font, color, attributes, ...there's a 1-1 map between glyphs and distinct things on the map). */ -void dummy_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph, int bg_glyph) +void dummy_print_glyph(winid wid, xchar x, xchar y, int glyph, int bg_glyph) { if (wid != -1) { dummy_printf("winid %d; x %d, y %d, glyph: %d, bg_glyph: %d\n", wid, x, y, glyph, bg_glyph); @@ -487,7 +487,7 @@ void dummy_raw_print_bold(const char *str) dummy_printf("dummy_raw_print_bold\n*%s*\n", str); } -static int dummy_getchar() +static int dummy_getchar(void) { char input[256]; char *rets = NULL; @@ -507,7 +507,7 @@ int nhgetch() -- Returns a single character input from the user. will be the routine the OS provides to read a character. Returned character _must_ be non-zero. */ -int dummy_nhgetch() +int dummy_nhgetch(void) { dummy_printf("dummy_nhgetch\n"); int ret = dummy_getchar(); @@ -544,7 +544,7 @@ int dummy_nh_poskey(int *x, int *y, int *mod) nhbell() -- Beep at user. [This will exist at least until sounds are redone, since sounds aren't attributable to windows anyway.] */ -void dummy_nhbell() +void dummy_nhbell(void) { dummy_printf("BEEP!\n"); } @@ -554,7 +554,7 @@ doprev_message() -- Display previous messages. Used by the ^P command. -- On the tty-port this scrolls WIN_MESSAGE back one line. */ -int dummy_doprev_message() +int dummy_doprev_message(void) { /* Do Nothing. They can read old messages using the scrollbar. */ return 0; @@ -580,7 +580,7 @@ char yn_function(const char *ques, const char *choices, char default) ports might use a popup. */ char dummy_yn_function(const char *question, const char *choices, - CHAR_P def) + char def) { // TODO dummy_printf("dummy_yn_function %s\n", question); @@ -640,7 +640,7 @@ int get_ext_cmd(void) An index into extcmdlist[] is returned on a successful selection, -1 otherwise. */ -int dummy_get_ext_cmd() +int dummy_get_ext_cmd(void) { char cmd[255]; int i; @@ -680,7 +680,7 @@ delay_output() -- Causes a visible delay of 50ms in the output. Conceptually, this is similar to wait_synch() followed by a nap(50ms), but allows asynchronous operation. */ -void dummy_delay_output() +void dummy_delay_output(void) { // TODO /* Do Nothing */ @@ -694,7 +694,7 @@ start_screen() -- Only used on Unix tty ports, but must be declared for example. If your window-port does not need this function just declare an empty function. */ -void dummy_start_screen() +void dummy_start_screen(void) { /* Do Nothing */ dummy_printf("dummy_start_screen\n"); @@ -704,7 +704,7 @@ void dummy_start_screen() end_screen() -- Only used on Unix tty ports, but must be declared for completeness. The complement of start_screen(). */ -void dummy_end_screen() +void dummy_end_screen(void) { /* Do Nothing */ dummy_printf("dummy_end_screen\n"); diff --git a/win/dummy/dummy_graphics.h b/win/dummy/dummy_graphics.h index cbd1f78fd..056549792 100644 --- a/win/dummy/dummy_graphics.h +++ b/win/dummy/dummy_graphics.h @@ -17,18 +17,18 @@ void dummy_resume_nhwindows(void); winid dummy_create_nhwindow(int type); void dummy_create_nhwindow_by_id(int type, winid i); void dummy_clear_nhwindow(winid wid); -void dummy_display_nhwindow(winid wid, BOOLEAN_P block); +void dummy_display_nhwindow(winid wid, boolean block); void dummy_destroy_nhwindow(winid wid); void dummy_curs(winid wid, int x, int y); void dummy_putstr(winid wid, int attr, const char *text); #ifdef FILE_AREAS -void dummy_display_file(const char *farea, const char *filename, BOOLEAN_P must_exist); +void dummy_display_file(const char *farea, const char *filename, boolean must_exist); #else -void dummy_display_file(const char *filename, BOOLEAN_P must_exist); +void dummy_display_file(const char *filename, boolean must_exist); #endif void dummy_start_menu(winid wid); void dummy_add_menu(winid wid, int glyph, int cnt, const ANY_P * identifier, - CHAR_P accelerator, CHAR_P group_accel, int attr, + char accelerator, char group_accel, int attr, const char *str, unsigned int presel); void dummy_end_menu(winid wid, const char *prompt); int dummy_select_menu(winid wid, int how, MENU_ITEM_P **selected); @@ -41,7 +41,7 @@ void dummy_cliparound(int x, int y); * dummy_cliparound (which lacks the winid) simply calls this funtion. */ void dummy_cliparound_proper(winid wid, int x, int y); -void dummy_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph, int bg_glyph); +void dummy_print_glyph(winid wid, xchar x, xchar y, int glyph, int bg_glyph); void dummy_raw_print(const char *str); void dummy_raw_print_bold(const char *str); int dummy_nhgetch(void); @@ -49,7 +49,7 @@ int dummy_nh_poskey(int *x, int *y, int *mod); void dummy_nhbell(void); int dummy_doprev_message(void); char dummy_yn_function(const char *question, const char *choices, - CHAR_P def); + char def); void dummy_getlin(const char *question, char *input); int dummy_get_ext_cmd(void); void dummy_number_pad(int state); diff --git a/win/lisp/winlisp.c b/win/lisp/winlisp.c index e59dab714..1b8da0f1f 100644 --- a/win/lisp/winlisp.c +++ b/win/lisp/winlisp.c @@ -350,8 +350,7 @@ struct window_procs lisp_procs = { while (0) static const char* -attr_to_string(attr) - int attr; +attr_to_string(int attr) { switch (attr) { @@ -374,8 +373,7 @@ attr_to_string(attr) } static const char* -special_glyph_to_string(special) - unsigned special; +special_glyph_to_string(unsigned special) { switch (special) { @@ -399,8 +397,7 @@ special_glyph_to_string(special) } static const char* -wintype_to_string(type) - int type; +wintype_to_string(int type) { switch (type) { @@ -422,8 +419,7 @@ wintype_to_string(type) } static const char* -how_to_string (how) - int how; +how_to_string(int how) { switch (how) { @@ -440,9 +436,9 @@ how_to_string (how) } static int -read_int (prompt, i) - const char* prompt; - int *i; +read_int( + const char *prompt, + int *i) { char line[BUFSZ]; int rv; @@ -455,9 +451,9 @@ read_int (prompt, i) } static int -read_string (prompt, str) - const char* prompt; - char **str; +read_string( + const char* prompt, + char **str) { char* rv; int len; @@ -505,10 +501,10 @@ read_string (prompt, str) static int -read_command (prompt, cmd, count) - const char *prompt; - char *cmd; - char *count; +read_command ( + const char *prompt, + char *cmd, + char *count) { char *buf; int rv; @@ -523,8 +519,7 @@ read_command (prompt, cmd, count) } void -bail(mesg) - const char *mesg; +bail(const char *mesg) { clearlocks (); lisp_exit_nhwindows (mesg); @@ -533,13 +528,13 @@ bail(mesg) } void -win_lisp_init () +win_lisp_init(void) { /* Code to be executed on startup. */ } void -lisp_player_selection () +lisp_player_selection(void) { int i, k, n; char pick4u = 'n', thisch, lastch = 0; @@ -851,7 +846,7 @@ lisp_player_selection () /* Reads from standard in, the player's name. */ void -lisp_askname () +lisp_askname(void) { char *line; lisp_cmd ("askname",); @@ -863,30 +858,26 @@ lisp_askname () /* This is a noop for tty and X, so should it be a noop for us too? */ void -lisp_get_nh_event () +lisp_get_nh_event(void) { /* lisp_cmd ("get-event",); */ } /* Global Functions */ void -lisp_raw_print(str) - const char *str; +lisp_raw_print(const char *str) { lisp_cmd ("raw-print", lisp_string (str)); } void -lisp_raw_print_bold(str) - const char *str; +lisp_raw_print_bold(const char *str) { lisp_cmd ("raw-print-bold", lisp_string (str)); } void -lisp_curs(window, x, y) - winid window; - int x, y; +lisp_curs(winid window, int x, int y) { if (window == WIN_MAP) lisp_cmd ("curs", @@ -902,7 +893,7 @@ lisp_curs(window, x, y) /* Send the options to the lisp process */ static void -get_options() +get_options(void) { lisp_cmd ("options", lisp_boolean(iflags.cbreak); /* in cbreak mode, rogue format */ @@ -931,7 +922,7 @@ get_options() } static void -generate_status_line () +generate_status_line(void) { /* Ripped from botl.c */ int hp, hpmax; @@ -1085,10 +1076,7 @@ generate_status_line () } void -lisp_putstr(window, attr, str) - winid window; - int attr; - const char *str; +lisp_putstr(winid window, int attr, const char *str) { static char statline1[BUFSZ] = ""; if (window == WIN_STATUS) @@ -1113,8 +1101,7 @@ lisp_putstr(window, attr, str) } void -lisp_start_menu(window) - winid window; +lisp_start_menu(winid window) { lisp_menu_list_num = 0; lisp_current_accelerator = 'a'; @@ -1122,16 +1109,16 @@ lisp_start_menu(window) } void -lisp_add_menu(window, glyph, cnt, identifier, ch, gch, attr, str, preselected) - winid window; /* window to use, must be of type NHW_MENU */ - int glyph; /* glyph to display with item (unused) */ - int cnt; /* max number of times this item can be selected */ - const anything *identifier; /* what to return if selected */ - char ch; /* keyboard accelerator (0 = pick our own) */ - char gch; /* group accelerator (0 = no group) */ - int attr; /* attribute for string (like tty_putstr()) */ - const char *str; /* menu string */ - unsigned int preselected; /* item is marked as selected */ +lisp_add_menu( + winid window, /**< window to use, must be of type NHW_MENU */ + int glyph, /**< glyph to display with item (unused) */ + int cnt, /**< max number of times this item can be selected */ + const anything *identifier, /**< what to return if selected */ + char ch, /**< keyboard accelerator (0 = pick our own) */ + char gch, /**< group accelerator (0 = no group) */ + int attr, /**< attribute for string (like tty_putstr()) */ + const char *str, /**< menu string */ + unsigned int preselected) /**< item is marked as selected */ { nhUse(cnt); @@ -1170,9 +1157,9 @@ lisp_add_menu(window, glyph, cnt, identifier, ch, gch, attr, str, preselected) } void -lisp_end_menu(window, prompt) - winid window; /* menu to use */ - const char *prompt; /* prompt to for menu */ +lisp_end_menu( + winid window, /**< menu to use */ + const char *prompt) /**< prompt to for menu */ { lisp_cmd ("end-menu", lisp_int (window); @@ -1180,9 +1167,9 @@ lisp_end_menu(window, prompt) } static int -lisp_get_menu_identifier(ch, identifier) - char ch; - anything *identifier; +lisp_get_menu_identifier( + char ch, + anything *identifier) { int i; @@ -1199,10 +1186,10 @@ lisp_get_menu_identifier(ch, identifier) } int -lisp_select_menu(window, how, menu_list) - winid window; - int how; - menu_item **menu_list; +lisp_select_menu( + winid window, + int how, + menu_item **menu_list) { const char *delim = "() \n"; char *list; @@ -1266,10 +1253,10 @@ lisp_select_menu(window, how, menu_list) /* This is a tty-specific hack. Do we need it? */ char -lisp_message_menu(let, how, mesg) - char let; - int how; - const char *mesg; +lisp_message_menu( + char let, + int how, + const char *mesg) { lisp_cmd ("message-menu", lisp_int (let); @@ -1279,8 +1266,7 @@ lisp_message_menu(let, how, mesg) } static int -lisp_get_cmd(str) - const char *str; +lisp_get_cmd(const char *str) { int i; @@ -1294,8 +1280,7 @@ lisp_get_cmd(str) } static int -lisp_get_ext_cmd_id (str) - const char *str; +lisp_get_ext_cmd_id(const char *str) { int i; @@ -1338,7 +1323,7 @@ lisp_get_ext_cmd_id (str) /* } */ int -lisp_nhgetch() +lisp_nhgetch(void) { /* multi is not 0 if this */ static char count_buf[BUFSIZ] = ""; @@ -1423,8 +1408,7 @@ lisp_nhgetch() } int -lisp_nh_poskey(x, y, mod) - int *x, *y, *mod; +lisp_nh_poskey(int *x, int *y, int *mod) { nhUse(x); nhUse(y); @@ -1452,7 +1436,7 @@ static int winid_list_max = 0; /* returns index into winid_list that can be used. */ static int -find_empty_cell () +find_empty_cell(void) { int i; @@ -1487,7 +1471,7 @@ winid_is_taken (winid n) } static int -add_winid (winid n) +add_winid(winid n) { if (winid_is_taken (n)) return 0; /* failed. */ @@ -1496,7 +1480,7 @@ add_winid (winid n) } static winid -get_unique_winid () +get_unique_winid(void) { winid i; @@ -1511,7 +1495,7 @@ get_unique_winid () /* When a window is destroyed, it gives back its window number with this function. */ static void -return_winid (winid n) +return_winid(winid n) { int i; @@ -1526,7 +1510,7 @@ return_winid (winid n) } static void -init_winid_list () +init_winid_list(void) { winid_list_max = 10; winid_list_len = 0; @@ -1537,8 +1521,7 @@ init_winid_list () /* Prints a create_nhwindow function and expects from stdin the id of this new window as a number. */ winid -lisp_create_nhwindow(type) - int type; +lisp_create_nhwindow(int type) { winid id = get_unique_winid(); @@ -1573,8 +1556,7 @@ lisp_create_nhwindow(type) } void -lisp_clear_nhwindow(window) - winid window; +lisp_clear_nhwindow(winid window) { if (window == WIN_MESSAGE) lisp_cmd ("clear-message",); @@ -1586,9 +1568,7 @@ lisp_clear_nhwindow(window) } void -lisp_display_nhwindow(window, blocking) - winid window; - boolean blocking; +lisp_display_nhwindow(winid window, boolean blocking) { /* don't send display messages for anything but menus */ char *dummy; @@ -1621,8 +1601,7 @@ lisp_display_nhwindow(window, blocking) } void -lisp_destroy_nhwindow(window) - winid window; +lisp_destroy_nhwindow(winid window) { if ((window != WIN_STATUS) && (window != WIN_MESSAGE) @@ -1634,33 +1613,33 @@ lisp_destroy_nhwindow(window) } void -lisp_update_inventory() +lisp_update_inventory(void) { lisp_cmd ("update-inventory",); } int -lisp_doprev_message() +lisp_doprev_message(void) { lisp_cmd ("doprev-message",); return 0; } void -lisp_nhbell() +lisp_nhbell(void) { lisp_cmd ("nhbell",); } /* Can be an empty call says window.doc. */ void -lisp_mark_synch() +lisp_mark_synch(void) { /* lisp_cmd ("mark-sync",); */ } void -lisp_wait_synch() +lisp_wait_synch(void) { lisp_cmd ("wait-synch",); } @@ -1668,7 +1647,7 @@ lisp_wait_synch() /* Since nethack will never be suspended, we need not worry about this function. */ void -lisp_resume_nhwindows() +lisp_resume_nhwindows(void) { return; } @@ -1676,8 +1655,7 @@ lisp_resume_nhwindows() /* Since nethack will never be suspended, we need not worry about this function. */ void -lisp_suspend_nhwindows(str) - const char *str; +lisp_suspend_nhwindows(const char *str) { nhUse(str); @@ -1686,8 +1664,7 @@ lisp_suspend_nhwindows(str) /* All keys are defined in emacs, so number_pad makes no sense. */ void -lisp_number_pad(state) - int state; +lisp_number_pad(int state) { nhUse(state); @@ -1695,9 +1672,7 @@ lisp_number_pad(state) } void -lisp_init_nhwindows(argcp,argv) - int* argcp; - char** argv; +lisp_init_nhwindows(int *argcp, char **argv) { int i; @@ -1724,14 +1699,13 @@ lisp_init_nhwindows(argcp,argv) } void -lisp_exit_nhwindows (str) - const char *str; +lisp_exit_nhwindows (const char *str) { lisp_cmd ("exit-nhwindows ", lisp_string (str)); } void -lisp_delay_output() +lisp_delay_output(void) { char *dummy; lisp_cmd ("delay-output",); @@ -1740,9 +1714,7 @@ lisp_delay_output() } void -lisp_getlin(question, input) - const char *question; - char *input; +lisp_getlin(const char *question, char *input) { char *tmp; lisp_cmd ("getlin", lisp_string (question)); @@ -1752,7 +1724,7 @@ lisp_getlin(question, input) } int -lisp_get_ext_cmd() +lisp_get_ext_cmd(void) { /* int cmd; */ /* int i; */ @@ -1771,14 +1743,12 @@ lisp_get_ext_cmd() } void +lisp_display_file( #ifdef FILE_AREAS -lisp_display_file(farea, fname, complain) - const char *farea UNUSED; -#else -lisp_display_file(fname, complain) + const char *farea UNUSED, #endif - const char *fname; - boolean complain; + const char *fname, + boolean complain) { lisp_cmd ("display-file", lisp_string (fname); @@ -1786,10 +1756,7 @@ lisp_display_file(fname, complain) } char -lisp_yn_function(ques, choices, def) - const char *ques; - const char *choices; - char def; +lisp_yn_function(const char *ques, const char *choices, char def) { int answer; @@ -1863,11 +1830,11 @@ lisp_update_positionbar(features) #define warn_color(n) def_warnsyms[n].color void -lisp_print_glyph(window, x, y, glyph, bg_glyph) - winid window; - xchar x, y; - int glyph; - int bg_glyph UNUSED; +lisp_print_glyph( + winid window, + xchar x, xchar y, + int glyph, + int bg_glyph UNUSED) { glyph_t ch; int color; @@ -1921,9 +1888,7 @@ lisp_print_glyph(window, x, y, glyph, bg_glyph) #ifdef CLIPPING void -lisp_cliparound(x, y) - int x UNUSED; - int y UNUSED; +lisp_cliparound(int x UNUSED, int y UNUSED) { /* as far as I can tell, the x and y values here are exactly the ones given by the next lisp_curs call, so its redundant @@ -1933,20 +1898,23 @@ lisp_cliparound(x, y) } #endif -void lisp_start_screen() { return; } /* called from setftty() in unixtty.c */ -void lisp_end_screen() {return; } /* called from settty() in unixtty.c */ +/* called from setftty() in unixtty.c */ +void lisp_start_screen(void) +{ +} -static void -get_death_text (buf) - char buf[BUFSZ] UNUSED; +/* called from settty() in unixtty.c */ +void lisp_end_screen(void) { +} +static void +get_death_text(char buf[BUFSZ] UNUSED) +{ } void -lisp_outrip(window, how) - winid window; - int how UNUSED; +lisp_outrip(winid window, int how UNUSED) { lisp_cmd ("outrip", lisp_int (window); diff --git a/win/share/tilemap.c b/win/share/tilemap.c index d57d842c7..b7b305c12 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -12,7 +12,7 @@ #define Fprintf (void) fprintf const char * tilename(int, int); -void init_tilemap(); +void init_tilemap(void); void process_substitutions(FILE *); boolean acceptable_tilename(int, const char *, const char *); static int include_obj_class = 0; @@ -337,7 +337,7 @@ int lastmontile, lastobjtile, lastothtile, laststatuetile; * introduced in 3.3.1. */ void -init_tilemap() +init_tilemap(void) { int i, j, condnum, tilenum; int corpsetile, swallowbase; @@ -470,8 +470,7 @@ const char *prolog[] = { "", "", "void", - "substitute_tiles(plev)", - "d_level *plev;", + "substitute_tiles(d_level *plev)", "{", "\tint i;", "" @@ -483,8 +482,7 @@ const char *epilog[] = { /* write out the substitutions in an easily-used form. */ void -process_substitutions(ofp) -FILE *ofp; +process_substitutions(FILE *ofp) { int i, j, k, span, start; @@ -556,7 +554,7 @@ FILE *ofp; fprintf(ofp, "\nint total_tiles_used = %d;\n", start); } -int main() +int main(void) { register int i; char filename[30]; @@ -706,9 +704,7 @@ struct { }; boolean -acceptable_tilename(idx, encountered, expected) -int idx; -const char *encountered, *expected; +acceptable_tilename(int idx, const char *encountered, const char *expected) { if (idx >= 0 && idx < SIZE(altlabels)) { if (!strcmp(altlabels[idx].expectedlabel, expected)) { diff --git a/win/tty/getline.c b/win/tty/getline.c index b22cfa23f..f8c960c32 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -19,9 +19,9 @@ static boolean ext_cmd_getlin_hook(char *); typedef boolean (*getlin_hook_proc)(char *); static void hooked_tty_getlin(const char*, char*, getlin_hook_proc); -extern int extcmd_via_menu(); /* cmd.c */ +extern int extcmd_via_menu(void); /* cmd.c */ -extern char erase_char, kill_char; /* from appropriate tty.c file */ +extern char erase_char, kill_char; /* from appropriate tty.c file */ /* * Read a line closed with '\n' into the array char bufp[BUFSZ]. @@ -30,18 +30,13 @@ extern char erase_char, kill_char; /* from appropriate tty.c file */ * resulting string is "\033". */ void -tty_getlin(query, bufp) -const char *query; -register char *bufp; +tty_getlin(const char *query, char *bufp) { hooked_tty_getlin(query, bufp, (getlin_hook_proc) 0); } static void -hooked_tty_getlin(query, bufp, hook) -const char *query; -register char *bufp; -getlin_hook_proc hook; +hooked_tty_getlin(const char *query, char *bufp, getlin_hook_proc hook) { register char *obufp = bufp; register int c; @@ -185,8 +180,7 @@ getlin_hook_proc hook; } void -xwaitforspace(s) -register const char *s; /* chars allowed besides return */ +xwaitforspace(const char *s) /**< chars allowed besides return */ { register int c, x = ttyDisplay ? (int) ttyDisplay->dismiss_more : '\n'; @@ -218,8 +212,7 @@ register const char *s; /* chars allowed besides return */ * + base has enough room to hold our string */ static boolean -ext_cmd_getlin_hook(base) -char *base; +ext_cmd_getlin_hook(char *base) { int oindex, com_index; @@ -253,7 +246,7 @@ char *base; * stop when we have found enough characters to make a unique command. */ int -tty_get_ext_cmd() +tty_get_ext_cmd(void) { int i; char buf[BUFSZ]; diff --git a/win/tty/termcap.c b/win/tty/termcap.c index f17c9ef72..04f69d15f 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -28,8 +28,8 @@ void nocmov(int, int); static void analyze_seq(char *, int *, int *); # endif # endif -static void init_hilite(); -static void kill_hilite(); +static void init_hilite(void); +static void kill_hilite(void); #endif /* (see tcap.h) -- nh_CM, nh_ND, nh_CD, nh_HI,nh_HE, nh_US,nh_UE, @@ -79,13 +79,13 @@ static char tgotobuf[20]; #ifndef MSDOS -static void init_ttycolor(); +static void init_ttycolor(void); boolean colorflag = FALSE; /* colors are initialized */ int ttycolors[CLR_MAX]; void -init_ttycolor() +init_ttycolor(void) { if (!colorflag) { ttycolors[CLR_RED] = CLR_RED; @@ -146,10 +146,10 @@ int assign_videocolors(char *colorvals) #endif static int -convert_uchars(bufp, list, size) -char *bufp; /* current pointer */ -uchar *list; /* return list */ -int size; +convert_uchars( + char *bufp, /**< current pointer */ + uchar *list, /**< return list */ + int size) { unsigned int num = 0; int count = 0; @@ -190,8 +190,7 @@ int size; #endif /* !MSDOS */ void -tty_startup(wid, hgt) -int *wid, *hgt; +tty_startup(int *wid, int *hgt) { register int i; #ifdef TERMLIB @@ -451,7 +450,7 @@ int *wid, *hgt; /* note: at present, this routine is not part of the formal window interface */ /* deallocate resources prior to final termination */ void -tty_shutdown() +tty_shutdown(void) { #if defined(TEXTCOLOR) && defined(TERMLIB) kill_hilite(); @@ -461,8 +460,7 @@ tty_shutdown() } void -tty_number_pad(state) -int state; +tty_number_pad(int state) { switch (state) { case -1: /* activate keypad mode (escape sequences) */ @@ -479,7 +477,7 @@ int state; #ifdef TERMLIB extern void (*decgraphics_mode_callback)(void); /* defined in drawing.c */ -static void tty_decgraphics_termcap_fixup(); +static void tty_decgraphics_termcap_fixup(void); /* We call this routine whenever DECgraphics mode is enabled, even if it @@ -489,7 +487,7 @@ static void tty_decgraphics_termcap_fixup(); so this is a convenient hook. */ static void -tty_decgraphics_termcap_fixup() +tty_decgraphics_termcap_fixup(void) { static char ctrlN[] = "\016"; static char ctrlO[] = "\017"; @@ -547,7 +545,7 @@ extern void (*ascgraphics_mode_callback()); /* defined in drawing.c */ static void tty_ascgraphics_hilite_fixup(); static void -tty_ascgraphics_hilite_fixup() +tty_ascgraphics_hilite_fixup(void) { register int c; @@ -564,7 +562,7 @@ tty_ascgraphics_hilite_fixup() #endif /* PC9800 */ void -tty_start_screen() +tty_start_screen(void) { xputs(TI); xputs(VS); @@ -589,7 +587,7 @@ tty_start_screen() } void -tty_end_screen() +tty_end_screen(void) { clear_screen(); xputs(VE); @@ -599,8 +597,7 @@ tty_end_screen() /* Cursor movements */ void -nocmov(x, y) -int x, y; +nocmov(int x, int y) { if ((int) ttyDisplay->cury > y) { if(UP) { @@ -646,8 +643,7 @@ int x, y; } void -cmov(x, y) -register int x, y; +cmov(int x, int y) { xputs(tgoto(nh_CM, x, y)); ttyDisplay->cury = y; @@ -676,22 +672,17 @@ xputc(int c) /* actually char, but explicitly specify its widened type */ } void -xputs(s) -const char *s; +xputs(const char *s) { -# ifndef TERMLIB +#ifndef TERMLIB (void) fputs(s, stdout); -# else -# if defined(NHSTDC) || defined(ULTRIX_PROTO) - tputs(s, 1, (int (*)())xputc); -# else +#else tputs(s, 1, xputc); -# endif -# endif +#endif } void -cl_end() +cl_end(void) { if(CE) xputs(CE); @@ -710,7 +701,7 @@ cl_end() } void -clear_screen() +clear_screen(void) { /* note: if CL is null, then termcap initialization failed, so don't attempt screen-oriented I/O during final cleanup. @@ -722,7 +713,7 @@ clear_screen() } void -home() +home(void) { if(HO) xputs(HO); @@ -734,58 +725,58 @@ home() } void -standoutbeg() +standoutbeg(void) { if(SO) xputs(SO); } void -standoutend() +standoutend(void) { if(SE) xputs(SE); } #if 0 /* if you need one of these, uncomment it (here and in extern.h) */ void -revbeg() +revbeg(void) { if(MR) xputs(MR); } void -boldbeg() +boldbeg(void) { if(MD) xputs(MD); } void -blinkbeg() +blinkbeg(void) { if(MB) xputs(MB); } void -dimbeg() +dimbeg(void) /* not in most termcap entries */ { if(MH) xputs(MH); } void -m_end() +m_end(void) { if(ME) xputs(ME); } #endif void -backsp() +backsp(void) { xputs(BC); } void -tty_nhbell() +tty_nhbell(void) { if (flags.silent) return; (void) putchar('\007'); /* curx does not change */ @@ -794,12 +785,14 @@ tty_nhbell() #ifdef ASCIIGRAPH void -graph_on() { +graph_on(void) +{ if (AS) xputs(AS); } void -graph_off() { +graph_off(void) +{ if (AE) xputs(AE); } #endif @@ -819,7 +812,7 @@ static const short tmspc10[] = { /* from termcap */ /* delay 50 ms */ void -tty_delay_output() +tty_delay_output(void) { #if defined(MICRO) register int i; @@ -865,8 +858,8 @@ tty_delay_output() } void -cl_eos() /* free after Robert Viduya */ -{ /* must only be called with curx = 1 */ +cl_eos(void) /* free after Robert Viduya */ +{ /* must only be called with curx = 1 */ if(nh_CD) xputs(nh_CD); @@ -1248,7 +1241,7 @@ init_color_rgb(int color, uint64_t rgb) } static void -init_hilite() +init_hilite(void) { register int c; char *setf, *scratch; @@ -1423,7 +1416,7 @@ int *fg, *bg; */ static void -init_hilite() +init_hilite(void) { register int c; # ifdef TOS @@ -1505,7 +1498,7 @@ init_hilite() # endif /* UNIX */ static void -kill_hilite() +kill_hilite(void) { # ifndef TOS register int c; @@ -1529,8 +1522,7 @@ kill_hilite() static char nulstr[] = ""; static char * -s_atr2str(n) -int n; +s_atr2str(int n) { switch (n) { case ATR_ULINE: @@ -1551,8 +1543,7 @@ int n; } static char * -e_atr2str(n) -int n; +e_atr2str(int n) { switch (n) { case ATR_ULINE: @@ -1571,8 +1562,7 @@ int n; void -term_start_attr(attr) -int attr; +term_start_attr(int attr) { if (attr) { xputs(s_atr2str(attr)); @@ -1581,8 +1571,7 @@ int attr; void -term_end_attr(attr) -int attr; +term_end_attr(int attr) { if(attr) { xputs(e_atr2str(attr)); @@ -1591,14 +1580,14 @@ int attr; void -term_start_raw_bold() +term_start_raw_bold(void) { xputs(nh_HI); } void -term_end_raw_bold() +term_end_raw_bold(void) { xputs(nh_HE); } @@ -1607,15 +1596,14 @@ term_end_raw_bold() #ifdef TEXTCOLOR void -term_end_color() +term_end_color(void) { xputs(nh_HE); } void -term_start_color(color) -int color; +term_start_color(int color) { if (iflags.wc2_newcolors) xputs(hilites[ttycolors[color]]); @@ -1625,8 +1613,7 @@ int color; int -has_color(color) -int color; +has_color(int color) { #ifdef X11_GRAPHICS /* XXX has_color() should be added to windowprocs */ diff --git a/win/tty/topl.c b/win/tty/topl.c index 40fcf0574..a264de109 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -15,11 +15,11 @@ #endif static void redotoplin(const char*); -static void topl_putsym(CHAR_P); +static void topl_putsym(char); static void removetopl(int); int -tty_doprev_message() +tty_doprev_message(void) { register struct WinDesc *cw = wins[WIN_MESSAGE]; @@ -115,8 +115,7 @@ tty_doprev_message() } static void -redotoplin(str) -const char *str; +redotoplin(const char *str) { int otoplin = ttyDisplay->toplin; home(); @@ -156,7 +155,7 @@ show_topl(const char *str) } void -remember_topl() +remember_topl(void) { register struct WinDesc *cw = wins[WIN_MESSAGE]; int idx = cw->maxrow; @@ -181,8 +180,7 @@ remember_topl() } void -addtopl(s) -const char *s; +addtopl(const char *s) { register struct WinDesc *cw = wins[WIN_MESSAGE]; @@ -193,7 +191,7 @@ const char *s; } void -more() +more(void) { struct WinDesc *cw = wins[WIN_MESSAGE]; @@ -231,8 +229,7 @@ more() } void -update_topl(bp) -register const char *bp; +update_topl(const char *bp) { register char *tl, *otl; register int n0; @@ -279,8 +276,7 @@ register const char *bp; } static void -topl_putsym(c) -char c; +topl_putsym(char c) { register struct WinDesc *cw = wins[WIN_MESSAGE]; @@ -319,16 +315,14 @@ char c; } void -putsyms(str) -const char *str; +putsyms(const char *str) { while(*str) topl_putsym(*str++); } static void -removetopl(n) -register int n; +removetopl(int n) { /* assume addtopl() has been done, so ttyDisplay->toplin is already set */ while (n-- > 0) putsyms("\b \b"); @@ -337,9 +331,7 @@ register int n; extern char erase_char; /* from xxxtty.c; don't need kill_char */ char -tty_yn_function(query, resp, def) -const char *query, *resp; -char def; +tty_yn_function(const char *query, const char *resp, char def) /* * Generic yes/no function. 'def' is the default (returned by space or * return; 'esc' returns 'q', or 'n', or the default, depending on diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 6d74a1619..364fdb7ea 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -164,26 +164,26 @@ boolean HE_resets_AS; /* see termcap.c */ static const char to_continue[] = "to continue"; #define getret() getreturn(to_continue) #else -static void getret(); +static void getret(void); #endif -static void erase_menu_or_text(winid, struct WinDesc *, BOOLEAN_P); -static void free_window_info(struct WinDesc *, BOOLEAN_P); +static void erase_menu_or_text(winid, struct WinDesc *, boolean); +static void free_window_info(struct WinDesc *, boolean); static void dmore(struct WinDesc *, const char *); static void set_item_state(winid, int, tty_menu_item *); static void set_all_on_page(winid, tty_menu_item *, tty_menu_item *); static void unset_all_on_page(winid, tty_menu_item *, tty_menu_item *); -static void invert_all_on_page(winid, tty_menu_item *, tty_menu_item *, CHAR_P); -static void invert_all(winid, tty_menu_item *, tty_menu_item *, CHAR_P); +static void invert_all_on_page(winid, tty_menu_item *, tty_menu_item *, char); +static void invert_all(winid, tty_menu_item *, tty_menu_item *, char); static void process_menu_window(winid, struct WinDesc *); static void process_text_window(winid, struct WinDesc *); static tty_menu_item *reverse(tty_menu_item *); const char * compress_str(const char *); -static void tty_putsym(winid, int, int, CHAR_P); -static void setup_rolemenu(winid, BOOLEAN_P, int, int, int); -static void setup_racemenu(winid, BOOLEAN_P, int, int, int); -static void setup_gendmenu(winid, BOOLEAN_P, int, int, int); -static void setup_algnmenu(winid, BOOLEAN_P, int, int, int); -static boolean reset_role_filtering(); +static void tty_putsym(winid, int, int, char); +static void setup_rolemenu(winid, boolean, int, int, int); +static void setup_racemenu(winid, boolean, int, int, int); +static void setup_gendmenu(winid, boolean, int, int, int); +static void setup_algnmenu(winid, boolean, int, int, int); +static boolean reset_role_filtering(void); static char *copy_of(const char *); static void bail(const char *); /* __attribute__((noreturn)) */ @@ -218,8 +218,7 @@ int vt_tile_current_window = -2; static void -print_vt_code(i, c) -int i, c; +print_vt_code(int i, int c) { if (iflags.vt_nethack) { if (c >= 0) { @@ -240,8 +239,7 @@ int i, c; /* clean up and quit */ static void -bail(mesg) -const char *mesg; +bail(const char *mesg) { clearlocks(); tty_exit_nhwindows(mesg); @@ -251,7 +249,7 @@ const char *mesg; #if defined(SIGWINCH) && defined(CLIPPING) static void -winch() +winch(void) { int oldLI = LI, oldCO = CO, i; register struct WinDesc *cw; @@ -307,9 +305,7 @@ winch() /*ARGSUSED*/ void -tty_init_nhwindows(argcp, argv) -int *argcp UNUSED; -char **argv UNUSED; +tty_init_nhwindows(int *argcp UNUSED, char **argv UNUSED) { int wid, hgt; @@ -350,7 +346,7 @@ char **argv UNUSED; ttyDisplay->lastwin = WIN_ERR; #if defined(SIGWINCH) && defined(CLIPPING) - (void) signal(SIGWINCH, winch); + (void) signal(SIGWINCH, (SIG_RET_TYPE) winch); #endif /* add one a space forward menu command alias */ @@ -373,7 +369,7 @@ char **argv UNUSED; #define ALGN flags.initalign void -tty_player_selection() +tty_player_selection(void) { int i, k, n, choice, nextpick; char pick4u = 'n', thisch, lastch = 0; @@ -1086,7 +1082,7 @@ tty_player_selection() } static boolean -reset_role_filtering() +reset_role_filtering(void) { winid win; anything any; @@ -1142,10 +1138,10 @@ reset_role_filtering() /* add entries a-Archeologist, b-Barbarian, &c to menu being built in 'win' */ static void -setup_rolemenu(win, filtering, race, gend, algn) -winid win; -boolean filtering; /* True => exclude filtered roles; False => filter reset */ -int race, gend, algn; /* all ROLE_NONE for !filtering case */ +setup_rolemenu( + winid win, + boolean filtering, /**< TRUE => exclude filtered roles; False => filter reset */ + int race, int gend, int algn) /**< all ROLE_NONE for !filtering case */ { anything any; int i; @@ -1188,10 +1184,10 @@ int race, gend, algn; /* all ROLE_NONE for !filtering case */ } static void -setup_racemenu(win, filtering, role, gend, algn) -winid win; -boolean filtering; -int role, gend, algn; +setup_racemenu( + winid win, + boolean filtering, + int role, int gend, int algn) { anything any; boolean race_ok; @@ -1223,10 +1219,10 @@ int role, gend, algn; } static void -setup_gendmenu(win, filtering, role, race, algn) -winid win; -boolean filtering; -int role, race, algn; +setup_gendmenu( + winid win, + boolean filtering, + int role, int race, int algn) { anything any; boolean gend_ok; @@ -1256,10 +1252,10 @@ int role, race, algn; } static void -setup_algnmenu(win, filtering, role, race, gend) -winid win; -boolean filtering; -int role, race, gend; +setup_algnmenu( + winid win, + boolean filtering, + int role, int race, int gend) { anything any; boolean algn_ok; @@ -1295,7 +1291,7 @@ int role, race, gend; * Always called after init_nhwindows() and before display_gamewindows(). */ void -tty_askname() +tty_askname(void) { static char who_are_you[] = "Who are you? "; register int c, ct, tryct = 0; @@ -1371,14 +1367,14 @@ tty_askname() } void -tty_get_nh_event() +tty_get_nh_event(void) { return; } #if !defined(MICRO) && !defined(WIN32CON) static void -getret() +getret(void) { xputs("\n"); if(flags.standout) @@ -1393,15 +1389,14 @@ getret() #endif void -tty_suspend_nhwindows(str) -const char *str; +tty_suspend_nhwindows(const char *str) { settty(str); /* calls end_screen, perhaps raw_print */ if (!str) tty_raw_print(""); /* calls fflush(stdout) */ } void -tty_resume_nhwindows() +tty_resume_nhwindows(void) { gettty(); setftty(); /* calls start_screen */ @@ -1409,8 +1404,7 @@ tty_resume_nhwindows() } void -tty_exit_nhwindows(str) -const char *str; +tty_exit_nhwindows(const char *str) { winid i; @@ -1433,8 +1427,7 @@ const char *str; } winid -tty_create_nhwindow(type) -int type; +tty_create_nhwindow(int type) { struct WinDesc* newwin; int i; @@ -1551,10 +1544,7 @@ int type; } static void -erase_menu_or_text(window, cw, clear) -winid window; -struct WinDesc *cw; -boolean clear; +erase_menu_or_text(winid window, struct WinDesc *cw, boolean clear) { if(cw->offx == 0) if(cw->offy) { @@ -1569,9 +1559,7 @@ boolean clear; } static void -free_window_info(cw, free_data) -struct WinDesc *cw; -boolean free_data; +free_window_info(struct WinDesc *cw, boolean free_data) { int i; @@ -1620,8 +1608,7 @@ boolean free_data; } void -tty_clear_nhwindow(window) -winid window; +tty_clear_nhwindow(winid window) { register struct WinDesc *cw = 0; @@ -1673,9 +1660,9 @@ winid window; } static void -dmore(cw, s) -register struct WinDesc *cw; -const char *s; /* valid responses */ +dmore( + struct WinDesc *cw, + const char *s) /**< valid responses */ { const char *prompt = cw->morestr ? cw->morestr : defmorestr; int offset = (cw->type == NHW_TEXT) ? 1 : 2; @@ -1693,10 +1680,7 @@ const char *s; /* valid responses */ } static void -set_item_state(window, lineno, item) -winid window; -int lineno; -tty_menu_item *item; +set_item_state(winid window, int lineno, tty_menu_item *item) { char ch = item->selected ? (item->count == -1L ? '+' : '#') : '-'; tty_curs(window, 4, lineno); @@ -1707,9 +1691,7 @@ tty_menu_item *item; } static void -set_all_on_page(window, page_start, page_end) -winid window; -tty_menu_item *page_start, *page_end; +set_all_on_page(winid window, tty_menu_item *page_start, tty_menu_item *page_end) { tty_menu_item *curr; int n; @@ -1722,9 +1704,7 @@ tty_menu_item *page_start, *page_end; } static void -unset_all_on_page(window, page_start, page_end) -winid window; -tty_menu_item *page_start, *page_end; +unset_all_on_page(winid window, tty_menu_item *page_start, tty_menu_item *page_end) { tty_menu_item *curr; int n; @@ -1738,10 +1718,11 @@ tty_menu_item *page_start, *page_end; } static void -invert_all_on_page(window, page_start, page_end, acc) -winid window; -tty_menu_item *page_start, *page_end; -char acc; /* group accelerator, 0 => all */ +invert_all_on_page( + winid window, + tty_menu_item *page_start, + tty_menu_item *page_end, + char acc) /**< group accelerator, 0 => all */ { tty_menu_item *curr; int n; @@ -1762,10 +1743,11 @@ char acc; /* group accelerator, 0 => all */ * zero). */ static void -invert_all(window, page_start, page_end, acc) -winid window; -tty_menu_item *page_start, *page_end; -char acc; /* group accelerator, 0 => all */ +invert_all( + winid window, + tty_menu_item *page_start, + tty_menu_item *page_end, + char acc) /**< group accelerator, 0 => all */ { tty_menu_item *curr; boolean on_curr_page; @@ -1793,9 +1775,7 @@ char acc; /* group accelerator, 0 => all */ #ifdef MENU_COLOR boolean -get_menu_coloring(line, color, attr) -const char *line; -int *color, *attr; +get_menu_coloring(const char *line, int *color, int *attr) { struct menucoloring *tmpmc; boolean foundcolor = FALSE, foundattr = FALSE; @@ -1818,9 +1798,7 @@ int *color, *attr; #endif /* MENU_COLOR */ static void -process_menu_window(window, cw) -winid window; -struct WinDesc *cw; +process_menu_window(winid window, struct WinDesc *cw) { tty_menu_item *page_start, *page_end, *curr; long count; @@ -2177,9 +2155,7 @@ struct WinDesc *cw; } static void -process_text_window(window, cw) -winid window; -struct WinDesc *cw; +process_text_window(winid window, struct WinDesc *cw) { int i, n, attr; register char *cp; @@ -2252,9 +2228,9 @@ struct WinDesc *cw; /*ARGSUSED*/ void -tty_display_nhwindow(window, blocking) -winid window; -boolean blocking; /* with ttys, all windows are blocking */ +tty_display_nhwindow( + winid window, + boolean blocking) /**< with ttys, all windows are blocking */ { register struct WinDesc *cw = 0; @@ -2333,8 +2309,7 @@ boolean blocking; /* with ttys, all windows are blocking */ } void -tty_dismiss_nhwindow(window) -winid window; +tty_dismiss_nhwindow(winid window) { register struct WinDesc *cw = 0; @@ -2378,8 +2353,7 @@ winid window; } void -tty_destroy_nhwindow(window) -winid window; +tty_destroy_nhwindow(winid window) { register struct WinDesc *cw = 0; @@ -2399,10 +2373,11 @@ winid window; } void -tty_curs(window, x, y) -winid window; -register int x, y; /* not xchar: perhaps xchar is unsigned and - curx-x would be unsigned as well */ +tty_curs( + winid window, + int x, + int y) /* not xchar: perhaps xchar is unsigned and + curx-x would be unsigned as well */ { struct WinDesc *cw = 0; int cx = ttyDisplay->curx; @@ -2477,10 +2452,7 @@ register int x, y; /* not xchar: perhaps xchar is unsigned and } static void -tty_putsym(window, x, y, ch) -winid window; -int x, y; -char ch; +tty_putsym(winid window, int x, int y, char ch) { register struct WinDesc *cw = 0; @@ -2516,8 +2488,7 @@ char ch; const char* -compress_str(str) -const char *str; +compress_str(const char *str) { static char cbuf[BUFSZ]; /* compress in case line too long */ @@ -2539,12 +2510,12 @@ const char *str; } void -tty_putstr_extended(window, color, attr, str, attributes) -winid window; -int color; -int attr; -const char *str; -const int *attributes; +tty_putstr_extended( + winid window, + int color, + int attr, + const char *str, + const int *attributes) { register struct WinDesc *cw = 0; register char *ob; @@ -2733,23 +2704,18 @@ const int *attributes; } void -tty_putstr(window, attr, str) -winid window; -int attr; -const char *str; +tty_putstr(winid window, int attr, const char *str) { tty_putstr_extended(window, NO_COLOR, attr, str, NULL); } void +tty_display_file( #ifdef FILE_AREAS -tty_display_file(farea, fname, complain) -const char *farea; -#else -tty_display_file(fname, complain) +const char *farea, #endif -const char *fname; -boolean complain; +const char *fname, +boolean complain) { #ifdef DEF_PAGER /* this implies that UNIX is defined */ { @@ -2833,8 +2799,7 @@ boolean complain; } void -tty_start_menu(window) -winid window; +tty_start_menu(winid window) { tty_clear_nhwindow(window); return; @@ -2846,16 +2811,16 @@ winid window; * later. */ void -tty_add_menu(window, glyph, cnt, identifier, ch, gch, attr, str, itemflags) -winid window; /* window to use, must be of type NHW_MENU */ -int glyph; /* glyph to display with item */ -int cnt; /* max number of times this item can be selected */ -const anything *identifier; /* what to return if selected */ -char ch; /* keyboard accelerator (0 = pick our own) */ -char gch; /* group accelerator (0 = no group) */ -int attr; /* attribute for string (like tty_putstr()) */ -const char *str; /* menu string */ -unsigned int itemflags; /* itemflags such as MENU_ITEMFLAGS_SELECTED */ +tty_add_menu( + winid window, /**< window to use, must be of type NHW_MENU */ + int glyph, /**< glyph to display with item */ + int cnt, /**< max number of times this item can be selected */ + const anything *identifier, /**< what to return if selected */ + char ch, /**< keyboard accelerator (0 = pick our own) */ + char gch, /**< group accelerator (0 = no group) */ + int attr, /**< attribute for string (like tty_putstr()) */ + const char *str, /**< menu string */ + unsigned int itemflags) /**< itemflags such as MENU_ITEMFLAGS_SELECTED */ { boolean preselected = ((itemflags & MENU_ITEMFLAGS_SELECTED) != 0); register struct WinDesc *cw = 0; @@ -2887,8 +2852,7 @@ unsigned int itemflags; /* itemflags such as MENU_ITEMFLAGS_SELECTED */ /* Invert the given list, can handle NULL as an input. */ static tty_menu_item * -reverse(curr) -tty_menu_item *curr; +reverse(tty_menu_item *curr) { tty_menu_item *next, *head = 0; @@ -2908,9 +2872,9 @@ tty_menu_item *curr; * height of the window. */ void -tty_end_menu(window, prompt) -winid window; /* menu to use */ -const char *prompt; /* prompt to for menu */ +tty_end_menu( + winid window, /**< menu to use */ + const char *prompt) /**< prompt to for menu */ { struct WinDesc *cw = 0; tty_menu_item *curr; @@ -3015,10 +2979,7 @@ const char *prompt; /* prompt to for menu */ } int -tty_select_menu(window, how, menu_list) -winid window; -int how; -menu_item **menu_list; +tty_select_menu(winid window, int how, menu_item **menu_list) { register struct WinDesc *cw = 0; tty_menu_item *curr; @@ -3058,10 +3019,7 @@ menu_item **menu_list; /* special hack for treating top line --More-- as a one item menu */ char -tty_message_menu(let, how, mesg) -char let; -int how; -const char *mesg; +tty_message_menu(char let, int how, const char *mesg) { /* "menu" without selection; use ordinary pline, no more() */ if (how == PICK_NONE) { @@ -3090,19 +3048,19 @@ const char *mesg; } void -tty_update_inventory() +tty_update_inventory(void) { return; } void -tty_mark_synch() +tty_mark_synch(void) { (void) fflush(stdout); } void -tty_wait_synch() +tty_wait_synch(void) { /* we just need to make sure all windows are synch'd */ if(!ttyDisplay || ttyDisplay->rawprint) { @@ -3126,8 +3084,7 @@ tty_wait_synch() } void -docorner(xmin, ymax) -register int xmin, ymax; +docorner(int xmin, int ymax) { register int y; register struct WinDesc *cw = wins[WIN_MAP]; @@ -3163,7 +3120,7 @@ register int xmin, ymax; } void -end_glyphout() +end_glyphout(void) { #if defined(ASCIIGRAPH) && !defined(NO_TERMS) if (GFlag) { @@ -3181,8 +3138,7 @@ end_glyphout() #ifndef WIN32 void -g_putch(in_ch) -int in_ch; +g_putch(int in_ch) { register char ch = (char)in_ch; @@ -3215,7 +3171,7 @@ int in_ch; #ifdef CLIPPING void -setclipped() +setclipped(void) { clipping = TRUE; clipx = clipy = 0; @@ -3224,8 +3180,7 @@ setclipped() } void -tty_cliparound(x, y) -int x, y; +tty_cliparound(int x, int y) { extern boolean restoring; int oldx = clipx, oldy = clipy; @@ -3254,7 +3209,6 @@ int x, y; } #endif /* CLIPPING */ - /* * tty_print_glyph * @@ -3265,11 +3219,11 @@ int x, y; */ void -tty_print_glyph(window, x, y, glyph, bg_glyph) -winid window; -xchar x, y; -int glyph; -int bg_glyph UNUSED; +tty_print_glyph( + winid window, + xchar x, xchar y, + int glyph, + int bg_glyph UNUSED) { glyph_t ch; boolean reverse_on = FALSE; @@ -3364,8 +3318,7 @@ int bg_glyph UNUSED; } void -tty_raw_print(str) -const char *str; +tty_raw_print(const char *str) { if(ttyDisplay) ttyDisplay->rawprint++; #if defined(MICRO) || defined(WIN32CON) @@ -3376,8 +3329,7 @@ const char *str; } void -tty_raw_print_bold(str) -const char *str; +tty_raw_print_bold(const char *str) { if(ttyDisplay) ttyDisplay->rawprint++; term_start_raw_bold(); @@ -3396,7 +3348,7 @@ const char *str; } int -tty_nhgetch() +tty_nhgetch(void) { int i; int tmp; @@ -3449,8 +3401,7 @@ tty_nhgetch() */ /*ARGSUSED*/ int -tty_nh_poskey(x, y, mod) -int *x, *y, *mod; +tty_nh_poskey(int *x, int *y, int *mod) { # if defined(WIN32CON) int i; @@ -3478,7 +3429,7 @@ int *x, *y, *mod; } void -win_tty_init() +win_tty_init(void) { # if defined(WIN32CON) nttty_open(); @@ -3488,8 +3439,7 @@ win_tty_init() #ifdef POSITIONBAR void -tty_update_positionbar(posbar) -char *posbar; +tty_update_positionbar(char *posbar) { # ifdef MSDOS video_update_positionbar(posbar); @@ -3504,8 +3454,7 @@ char *posbar; * This is an exact duplicate of copy_of() in X11/winmenu.c. */ static char * -copy_of(s) -const char *s; +copy_of(const char *s) { if (!s) s = ""; return strcpy((char *) alloc((unsigned) (strlen(s) + 1)), s); @@ -3513,7 +3462,7 @@ const char *s; /** Show all available colors with names. */ int -tty_debug_show_colors() +tty_debug_show_colors(void) { #ifdef TERMINFO int i, c; From 64a42febeaf38c1e0f3e2979b9d631a5b25d8a0f Mon Sep 17 00:00:00 2001 From: Patric Mueller Date: Mon, 8 Aug 2022 21:15:04 +0200 Subject: [PATCH 4/7] Remove all register keywords --- src/alloc.c | 2 +- src/apply.c | 52 +++++----- src/artifact.c | 38 ++++---- src/attrib.c | 28 +++--- src/bones.c | 8 +- src/botl.c | 10 +- src/cmd.c | 20 ++-- src/dbridge.c | 6 +- src/detect.c | 64 ++++++------- src/dig.c | 36 +++---- src/display.c | 78 +++++++-------- src/do.c | 26 ++--- src/do_name.c | 20 ++-- src/do_wear.c | 28 +++--- src/dog.c | 16 ++-- src/dogmove.c | 22 ++--- src/dokick.c | 18 ++-- src/dothrow.c | 14 +-- src/drawing.c | 6 +- src/dungeon.c | 10 +- src/eat.c | 26 ++--- src/end.c | 24 ++--- src/engrave.c | 30 +++--- src/exper.c | 8 +- src/explode.c | 4 +- src/extralev.c | 8 +- src/files.c | 4 +- src/fountain.c | 18 ++-- src/hack.c | 70 +++++++------- src/hacklib.c | 42 ++++---- src/invent.c | 68 ++++++------- src/lock.c | 14 +-- src/mail.c | 4 +- src/makemon.c | 50 +++++----- src/mapglyph.c | 2 +- src/mcastu.c | 4 +- src/mhitm.c | 30 +++--- src/mhitu.c | 14 +-- src/minion.c | 4 +- src/mklev.c | 94 +++++++++--------- src/mkmap.c | 20 ++-- src/mkmaze.c | 4 +- src/mkobj.c | 42 ++++---- src/mkroom.c | 44 ++++----- src/mon.c | 60 ++++++------ src/mondata.c | 32 +++---- src/monmove.c | 54 +++++------ src/mplayer.c | 16 ++-- src/mthrowu.c | 14 +-- src/muse.c | 18 ++-- src/music.c | 2 +- src/o_init.c | 28 +++--- src/objnam.c | 32 +++---- src/options.c | 20 ++-- src/pager.c | 4 +- src/pickup.c | 26 ++--- src/polyself.c | 6 +- src/potion.c | 30 +++--- src/pray.c | 20 ++-- src/priest.c | 38 ++++---- src/quest.c | 8 +- src/questpgr.c | 2 +- src/read.c | 54 +++++------ src/rect.c | 12 +-- src/region.c | 18 ++-- src/restore.c | 60 ++++++------ src/rip.c | 10 +- src/rnd.c | 18 ++-- src/rumors.c | 4 +- src/save.c | 34 +++---- src/shk.c | 222 +++++++++++++++++++++---------------------- src/shknam.c | 18 ++-- src/sit.c | 2 +- src/sounds.c | 22 ++--- src/sp_lev.c | 32 +++---- src/spell.c | 10 +- src/steal.c | 18 ++-- src/teleport.c | 36 +++---- src/timeout.c | 10 +- src/topten.c | 14 +-- src/track.c | 6 +- src/trap.c | 58 +++++------ src/u_init.c | 8 +- src/uhitm.c | 28 +++--- src/vault.c | 22 ++--- src/vision.c | 52 +++++----- src/weapon.c | 8 +- src/were.c | 6 +- src/wield.c | 16 ++-- src/windows.c | 2 +- src/wizard.c | 38 ++++---- src/worm.c | 46 ++++----- src/worn.c | 20 ++-- src/write.c | 6 +- src/zap.c | 40 ++++---- sys/share/dgn_lex.c | 38 ++++---- sys/share/lev_lex.c | 38 ++++---- sys/share/pcmain.c | 4 +- sys/share/pcunix.c | 8 +- sys/share/random.c | 10 +- sys/share/tclib.c | 4 +- sys/share/unixtty.c | 8 +- sys/share/uudecode.c | 2 +- sys/winnt/nttty.c | 4 +- sys/winnt/winnt.c | 4 +- util/lev_main.c | 10 +- util/makedefs.c | 24 ++--- win/tty/getline.c | 6 +- win/tty/termcap.c | 26 ++--- win/tty/topl.c | 14 +-- win/tty/wintty.c | 42 ++++---- 111 files changed, 1366 insertions(+), 1366 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 5403acc37..c8641c01f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -28,7 +28,7 @@ extern void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2); long * -alloc(register unsigned int lth) +alloc(unsigned int lth) { void *ptr; diff --git a/src/apply.c b/src/apply.c index ce2a0b271..89732f8e2 100644 --- a/src/apply.c +++ b/src/apply.c @@ -323,7 +323,7 @@ static const char hollow_str[] = "a hollow sound. This must be a secret %s!"; almost useless. As a compromise, one use per turn is free, another uses up the turn; this makes curse status have a tangible effect. */ static int -use_stethoscope(register struct obj *obj) +use_stethoscope(struct obj *obj) { static long last_used_move = -1; static short last_used_movement = 0; @@ -564,7 +564,7 @@ use_magic_whistle(struct obj *obj) } boolean -um_dist(register xchar x, register xchar y, register xchar n) +um_dist(xchar x, xchar y, xchar n) { return((boolean)(abs(u.ux - x) > n || abs(u.uy - y) > n)); } @@ -572,8 +572,8 @@ um_dist(register xchar x, register xchar y, register xchar n) int number_leashed(void) { - register int i = 0; - register struct obj *obj; + int i = 0; + struct obj *obj; for(obj = invent; obj; obj = obj->nobj) if(obj->otyp == LEASH && obj->leashmon != 0) i++; @@ -582,9 +582,9 @@ number_leashed(void) /* otmp is about to be destroyed or stolen */ void -o_unleash(register struct obj *otmp) +o_unleash(struct obj *otmp) { - register struct monst *mtmp; + struct monst *mtmp; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) if(mtmp->m_id == (unsigned)otmp->leashmon) @@ -594,9 +594,9 @@ o_unleash(register struct obj *otmp) /* mtmp is about to die, or become untame */ void -m_unleash(register struct monst *mtmp, boolean feedback) +m_unleash(struct monst *mtmp, boolean feedback) { - register struct obj *otmp; + struct obj *otmp; if (feedback) { if (canseemon(mtmp)) @@ -615,8 +615,8 @@ m_unleash(register struct monst *mtmp, boolean feedback) void unleash_all(void) { - register struct obj *otmp; - register struct monst *mtmp; + struct obj *otmp; + struct monst *mtmp; for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp->otyp == LEASH) otmp->leashmon = 0; @@ -743,8 +743,8 @@ get_mleash(struct monst *mtmp) boolean next_to_u(void) { - register struct monst *mtmp; - register struct obj *otmp; + struct monst *mtmp; + struct obj *otmp; for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) continue; @@ -772,10 +772,10 @@ next_to_u(void) } void -check_leash(register xchar x, register xchar y) +check_leash(xchar x, xchar y) { - register struct obj *otmp; - register struct monst *mtmp; + struct obj *otmp; + struct monst *mtmp; for (otmp = invent; otmp; otmp = otmp->nobj) { if (otmp->otyp != LEASH || otmp->leashmon == 0) continue; @@ -1023,7 +1023,7 @@ use_mirror(struct obj *obj) static void use_bell(struct obj **optr) { - register struct obj *obj = *optr; + struct obj *obj = *optr; struct monst *mtmp; boolean wakem = FALSE, learno = FALSE, ordinary = (obj->otyp != BELL_OF_OPENING || !obj->spe), @@ -1142,7 +1142,7 @@ use_bell(struct obj **optr) } static void -use_candelabrum(register struct obj *obj) +use_candelabrum(struct obj *obj) { const char *s = (obj->spe != 1) ? "candles" : "candle"; @@ -1203,8 +1203,8 @@ use_candelabrum(register struct obj *obj) static void use_candle(struct obj **optr) { - register struct obj *obj = *optr; - register struct obj *otmp; + struct obj *obj = *optr; + struct obj *otmp; const char *s = (obj->quan != 1) ? "candles" : "candle"; char qbuf[QBUFSZ], qsfx[QBUFSZ], *q; @@ -1273,7 +1273,7 @@ use_candle(struct obj **optr) /* call in drop, throw, and put in box, etc. */ boolean -snuff_candle(register struct obj *otmp) +snuff_candle(struct obj *otmp) { boolean candle = Is_candle(otmp); @@ -1856,7 +1856,7 @@ tinnable(struct obj *corpse) } static void -use_tinning_kit(register struct obj *obj) +use_tinning_kit(struct obj *obj) { struct obj *corpse, *can; @@ -2233,7 +2233,7 @@ figurine_location_checks(struct obj *obj, coord *cc, boolean quietly) static void use_figurine(struct obj **optr) { - register struct obj *obj = *optr; + struct obj *obj = *optr; xchar x, y; coord cc; @@ -3272,8 +3272,8 @@ static int do_break_wand(struct obj *obj) { static const char nothing_else_happens[] = "But nothing else happens..."; - register int i, x, y; - register struct monst *mon; + int i, x, y; + struct monst *mon; int dmg, damage; boolean affects_objects, is_fragile; boolean shop_damage = FALSE; @@ -3657,7 +3657,7 @@ do_break_wand(struct obj *obj) static boolean uhave_graystone(void) { - register struct obj *otmp; + struct obj *otmp; for(otmp = invent; otmp; otmp = otmp->nobj) if(is_graystone(otmp)) @@ -3768,7 +3768,7 @@ int doapply(void) { struct obj *obj; - register int res = 1; + int res = 1; char class_list[MAXOCLASSES+2]; if(check_capacity((char *)0)) return (0); diff --git a/src/artifact.c b/src/artifact.c index ae3bbc1a1..88693a33e 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -163,8 +163,8 @@ make_artif: if (by_align) otmp = mksobj((int)a->otyp, TRUE, FALSE); const char* artifact_name(const char *name, short int *otyp) { - register const struct artifact *a; - register const char *aname; + const struct artifact *a; + const char *aname; if(!strncmpi(name, "the ", 4)) name += 4; @@ -181,10 +181,10 @@ artifact_name(const char *name, short int *otyp) } boolean -exist_artifact(register int otyp, register const char *name) +exist_artifact(int otyp, const char *name) { - register const struct artifact *a; - register boolean *arex; + const struct artifact *a; + boolean *arex; if (otyp && *name) for (a = artilist+1, arex = artiexist+1; a->otyp; a++, arex++) @@ -196,12 +196,12 @@ exist_artifact(register int otyp, register const char *name) void artifact_exists(struct obj *otmp, const char *name, boolean mod) { - register const struct artifact *a; + const struct artifact *a; if (otmp && *name) for (a = artilist+1; a->otyp; a++) if (a->otyp == otmp->otyp && !strcmp(a->name, name)) { - register int m = a - artilist; + int m = a - artilist; otmp->oartifact = (char)(mod ? m : 0); otmp->age = 0; if(otmp->otyp == RIN_INCREASE_DAMAGE) @@ -287,8 +287,8 @@ restrict_name( const char *name, boolean restrict_typ) /**< restrict for otmp->otyp? */ { - register const struct artifact *a; - register const char *aname; + const struct artifact *a; + const char *aname; if (!*name) return FALSE; if (!strncmpi(name, "the ", 4)) name += 4; @@ -310,9 +310,9 @@ restrict_name( } static boolean -attacks(register int adtyp, register struct obj *otmp) +attacks(int adtyp, struct obj *otmp) { - register const struct artifact *weap; + const struct artifact *weap; if ((weap = get_artifact(otmp)) != 0) return((boolean)(weap->attk.adtyp == adtyp)); @@ -322,7 +322,7 @@ attacks(register int adtyp, register struct obj *otmp) boolean defends(int adtyp, struct obj *otmp) { - register const struct artifact *weap; + const struct artifact *weap; unsigned long mask; if ((weap = get_artifact(otmp)) != 0) { @@ -386,7 +386,7 @@ defends(int adtyp, struct obj *otmp) boolean defends_when_carried(int adtyp, struct obj *otmp) { - register const struct artifact *weap; + const struct artifact *weap; if ((weap = get_artifact(otmp))) { return (boolean) (weap->cary.adtyp == adtyp); @@ -641,7 +641,7 @@ static boolean touch_blasted; /* for retouch_object() */ int touch_artifact(struct obj *obj, struct monst *mon) { - register const struct artifact *oart = get_artifact(obj); + const struct artifact *oart = get_artifact(obj); boolean badclass, badalign, self_willed, yours; touch_blasted = FALSE; @@ -726,7 +726,7 @@ touch_artifact(struct obj *obj, struct monst *mon) boolean arti_immune(struct obj *obj, int dtyp) { - register const struct artifact *weap = get_artifact(obj); + const struct artifact *weap = get_artifact(obj); if (!weap) { return FALSE; @@ -756,7 +756,7 @@ bane_applies(const struct artifact *oart, struct monst *mon) /* decide whether an artifact's special attacks apply against mtmp */ static int -spec_applies(register const struct artifact *weap, struct monst *mtmp) +spec_applies(const struct artifact *weap, struct monst *mtmp) { struct permonst *ptr; boolean yours; @@ -839,7 +839,7 @@ spec_abon(struct obj *otmp, struct monst *mon) int spec_dbon(struct obj *otmp, struct monst *mon, int tmp) { - register const struct artifact *weap = get_artifact(otmp); + const struct artifact *weap = get_artifact(otmp); if (otmp->oclass == GEM_CLASS && uwep && uwep->oartifact == ART_GIANTSLAYER) { weap = get_artifact(uwep); @@ -1550,7 +1550,7 @@ doinvoke(void) static int arti_invoke(struct obj *obj) { - register const struct artifact *oart = get_artifact(obj); + const struct artifact *oart = get_artifact(obj); if(!oart || !oart->inv_prop) { if(obj->otyp == CRYSTAL_BALL) @@ -1836,7 +1836,7 @@ artifact_light(struct obj *obj) void arti_speak(struct obj *obj) { - register const struct artifact *oart = get_artifact(obj); + const struct artifact *oart = get_artifact(obj); const char *line; char buf[BUFSZ]; diff --git a/src/attrib.c b/src/attrib.c index e27106042..a44eefe0f 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -180,7 +180,7 @@ adjattrib(int ndx, int incr, int msgflg) } void -gainstr(register struct obj *otmp, register int incr) +gainstr(struct obj *otmp, int incr) { int num = 1; @@ -193,7 +193,7 @@ gainstr(register struct obj *otmp, register int incr) } void -losestr(register int num) /* may kill you; cause may be poison or monster like 'a' */ +losestr(int num) /* may kill you; cause may be poison or monster like 'a' */ { int ustr = ABASE(A_STR) - num; @@ -213,7 +213,7 @@ losestr(register int num) /* may kill you; cause may be poison or monster lik } void -change_luck(register schar n) +change_luck(schar n) { u.uluck += n; if (u.uluck < 0 && u.uluck < LUCKMIN) u.uluck = LUCKMIN; @@ -223,8 +223,8 @@ change_luck(register schar n) int stone_luck(boolean parameter) /* So I can't think up of a good name. So sue me. --KAA */ { - register struct obj *otmp; - register long bonchance = 0; + struct obj *otmp; + long bonchance = 0; for (otmp = invent; otmp; otmp = otmp->nobj) if (confers_luck(otmp)) { @@ -239,7 +239,7 @@ stone_luck(boolean parameter) /* So I can't think up of a good name. So sue me. boolean has_luckitem(void) { - register struct obj *otmp; + struct obj *otmp; for (otmp = invent; otmp; otmp = otmp->nobj) if (confers_luck(otmp)) return TRUE; @@ -466,9 +466,9 @@ reset_attribute_clock(void) void -init_attr(register int np) +init_attr(int np) { - register int i, x, tryct; + int i, x, tryct; for(i = 0; i < A_MAX; i++) { @@ -517,7 +517,7 @@ init_attr(register int np) void redist_attr(void) { - register int i, tmp; + int i, tmp; for(i = 0; i < A_MAX; i++) { if (i==A_INT || i==A_WIS) continue; @@ -544,7 +544,7 @@ postadjabil(long int *ability) void adjabil(int oldlevel, int newlevel) { - register const struct innate *abil, *rabil; + const struct innate *abil, *rabil; long mask = FROMEXPER; @@ -676,7 +676,7 @@ newhp(void) schar acurr(int x) { - register int tmp = (u.abon.a[x] + u.atemp.a[x] + u.acurr.a[x]); + int tmp = (u.abon.a[x] + u.atemp.a[x] + u.acurr.a[x]); if (x == A_STR) { if (uarmg && uarmg->otyp == GAUNTLETS_OF_POWER) return(125); @@ -713,7 +713,7 @@ acurr(int x) schar acurrstr(void) { - register int str = ACURR(A_STR); + int str = ACURR(A_STR); if (str <= 18) return((schar)str); if (str <= 121) return((schar)(19 + str / 50)); /* map to 19-21 */ @@ -724,9 +724,9 @@ acurrstr(void) * location for any future alignment limits */ void -adjalign(register int n) +adjalign(int n) { - register int newalign = u.ualign.record + n; + int newalign = u.ualign.record + n; if(n < 0) { if(newalign < u.ualign.record) diff --git a/src/bones.c b/src/bones.c index 9f27261c4..3cd77caae 100644 --- a/src/bones.c +++ b/src/bones.c @@ -355,7 +355,7 @@ fixuporacle(struct monst *oracle) boolean can_make_bones(void) { - register struct trap *ttmp; + struct trap *ttmp; if (ledger_no(&u.uz) <= 0 || ledger_no(&u.uz) > maxledgerno()) return FALSE; @@ -594,8 +594,8 @@ savebones(struct obj *corpse) int getbones(void) { - register int fd; - register int ok; + int fd; + int ok; char c, *bonesid, oldbonesid[40]; /* was [10]; more should be safer */ /* wizard check added by GAN 02/05/87 */ @@ -645,7 +645,7 @@ getbones(void) #endif trickery(errbuf); } else { - register struct monst *mtmp; + struct monst *mtmp; getlev(fd, 0, 0, TRUE); diff --git a/src/botl.c b/src/botl.c index 0a5941a4c..a757b1a8e 100644 --- a/src/botl.c +++ b/src/botl.c @@ -166,8 +166,8 @@ int rank; const char * rank_of(int lev, short int monnum, boolean female) { - register const struct Role *role; - register int i; + const struct Role *role; + int i; /* Find the role */ @@ -201,7 +201,7 @@ rank(void) int title_to_mon(const char *str, int *rank_indx, int *title_length) { - register int i, j; + int i, j; /* Loop through each of the roles */ @@ -227,7 +227,7 @@ title_to_mon(const char *str, int *rank_indx, int *title_length) void max_rank_sz(void) { - register int i, r, maxr = 0; + int i, r, maxr = 0; for (i = 0; i < 9; i++) { if (urole.rank[i].m && (r = strlen(urole.rank[i].m)) > maxr) maxr = r; if (urole.rank[i].f && (r = strlen(urole.rank[i].f)) > maxr) maxr = r; @@ -467,7 +467,7 @@ void bot2str(char *newbot2) #ifndef DUMP_LOG char newbot2[MAXCO]; #endif - register char *nb; + char *nb; int hp, hpmax; int cap = near_capacity(); #if defined(STATUS_COLORS) && defined(TEXTCOLOR) diff --git a/src/cmd.c b/src/cmd.c index 37173710e..6512ae6e3 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -299,7 +299,7 @@ popch(void) { char pgetchar(void) { /* curtesy of aeb@cwi.nl */ - register int ch; + int ch; if (iflags.debug_fuzzer) { return randomkey(); @@ -3237,7 +3237,7 @@ void parseautocomplete(char *autocomplete, boolean condition) { struct ext_func_tab *efp; - register char *autoc; + char *autoc; /* break off first autocomplete from the rest; parse the rest */ if ((autoc = index(autocomplete, ',')) != 0 || @@ -3526,7 +3526,7 @@ ch2spkeys(char c, int start, int end) } void -rhack(register char *cmd) +rhack(char *cmd) { int spkey = -1; boolean do_walk, do_rush, prefix_seen, bad_command, @@ -3747,7 +3747,7 @@ rhack(register char *cmd) if (bad_command) { char expcmd[10]; - register char *cp = expcmd; + char *cp = expcmd; while (*cmd && (int)(cp - expcmd) < (int)(sizeof expcmd - 3)) { if (*cmd >= 040 && *cmd < 0177) { @@ -3776,7 +3776,7 @@ rhack(register char *cmd) int xytod(schar x, schar y) { - register int dd; + int dd; for(dd = 0; dd < 8; dd++) if(x == xdir[dd] && y == ydir[dd]) return dd; @@ -3786,7 +3786,7 @@ xytod(schar x, schar y) /* convert a direction code into an x,y pair */ void -dtoxy(coord *cc, register int dd) +dtoxy(coord *cc, int dd) { cc->x = xdir[dd]; cc->y = ydir[dd]; @@ -4148,7 +4148,7 @@ directionname(int dir) } int -isok(register int x, register int y) +isok(int x, int y) { /* x corresponds to curx, so x==1 is the first column. Ach. %% */ return x >= 1 && x <= COLNO-1 && y >= 0 && y <= ROWNO-1; @@ -4591,7 +4591,7 @@ parse(void) #else static char in_line[COLNO]; #endif - register int foo; + int foo; boolean prezero = FALSE; multi = 0; @@ -4713,7 +4713,7 @@ end_of_input(void) char readchar(void) { - register int sym; + int sym; int x = u.ux, y = u.uy, mod = 0; if (iflags.debug_fuzzer) { @@ -4731,7 +4731,7 @@ readchar(void) #ifdef NR_OF_EOFS if (sym == EOF) { - register int cnt = NR_OF_EOFS; + int cnt = NR_OF_EOFS; /* * Some SYSV systems seem to return EOFs for various reasons * (?like when one hits break or for interrupted systemcalls?), diff --git a/src/dbridge.c b/src/dbridge.c index 72bb00f6e..2b11a6417 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -747,7 +747,7 @@ do_entity(struct entity *etmp) boolean close_drawbridge(int x, int y) { - register struct rm *lev1, *lev2; + struct rm *lev1, *lev2; struct trap *t; int x2, y2; @@ -817,7 +817,7 @@ close_drawbridge(int x, int y) void open_drawbridge(int x, int y) { - register struct rm *lev1, *lev2; + struct rm *lev1, *lev2; struct trap *t; int x2, y2; @@ -861,7 +861,7 @@ open_drawbridge(int x, int y) void destroy_drawbridge(int x, int y) { - register struct rm *lev1, *lev2; + struct rm *lev1, *lev2; struct trap *t; struct obj *otmp; int x2, y2, i; diff --git a/src/detect.c b/src/detect.c index f1ac3c763..378db0975 100644 --- a/src/detect.c +++ b/src/detect.c @@ -156,7 +156,7 @@ trapped_door_at(int ttyp, int x, int y) struct obj * o_in(struct obj *obj, char oclass) { - register struct obj* otmp; + struct obj* otmp; struct obj *temp; if (obj->oclass == oclass) return obj; @@ -181,7 +181,7 @@ o_in(struct obj *obj, char oclass) struct obj * o_material(struct obj *obj, unsigned int material) { - register struct obj* otmp; + struct obj* otmp; struct obj *temp; if (objects[obj->otyp].oc_material == material) return obj; @@ -212,8 +212,8 @@ static boolean check_map_spot(int x, int y, char oclass, unsigned int material) { int glyph; - register struct obj *otmp; - register struct monst *mtmp; + struct obj *otmp; + struct monst *mtmp; glyph = glyph_at(x, y); if (glyph_is_object(glyph)) { @@ -262,7 +262,7 @@ check_map_spot(int x, int y, char oclass, unsigned int material) static boolean clear_stale_map(char oclass, unsigned int material) { - register int zx, zy; + int zx, zy; boolean change_made = FALSE; for (zx = 1; zx < COLNO; zx++) @@ -277,10 +277,10 @@ clear_stale_map(char oclass, unsigned int material) /* look for gold, on the floor or in monsters' possession */ int -gold_detect(register struct obj *sobj) +gold_detect(struct obj *sobj) { - register struct obj *obj; - register struct monst *mtmp; + struct obj *obj; + struct monst *mtmp; struct obj gold, *temp = 0; boolean stale, ugold = FALSE, steedgold = FALSE; int ter_typ = TER_DETECT | TER_OBJ; @@ -430,11 +430,11 @@ gold_detect(register struct obj *sobj) /* returns 1 if nothing was detected */ /* returns 0 if something was detected */ int -food_detect(register struct obj *sobj) +food_detect(struct obj *sobj) { - register struct obj *obj; - register struct monst *mtmp; - register int ct = 0, ctu = 0; + struct obj *obj; + struct monst *mtmp; + int ct = 0, ctu = 0; boolean confused = (Confusion || (sobj && sobj->cursed)), stale; char oclass = confused ? POTION_CLASS : FOOD_CLASS; const char *what = confused ? something : "food"; @@ -562,15 +562,15 @@ object_detect( int class, /**< an object class, 0 for all */ boolean quiet) /**< don't output any message */ { - register int x, y; + int x, y; char stuff[BUFSZ]; int is_cursed = (detector && detector->cursed); int do_dknown = (detector && (detector->oclass == POTION_CLASS || detector->oclass == SPBOOK_CLASS) && detector->blessed); int ct = 0, ctu = 0; - register struct obj *obj, *otmp = (struct obj *)0; - register struct monst *mtmp; + struct obj *obj, *otmp = (struct obj *)0; + struct monst *mtmp; int sym, boulder = 0, ter_typ = TER_DETECT | TER_OBJ; if (class < 0 || class >= MAXOCLASSES) { @@ -749,7 +749,7 @@ monster_detect( struct obj *otmp, /**< detecting object (if any) */ int mclass) /**< monster class, 0 for all */ { - register struct monst *mtmp; + struct monst *mtmp; int mcnt = 0; @@ -895,7 +895,7 @@ detect_obj_traps( int trap_detect(struct obj *sobj) /**< sobj is null if crystal ball, *scroll if gold detection scroll */ { - register struct trap *ttmp; + struct trap *ttmp; struct monst *mon; int door, glyph, tr, ter_typ = TER_DETECT | TER_TRP; int cursed_src = sobj && sobj->cursed; @@ -1009,8 +1009,8 @@ trap_detect(struct obj *sobj) /**< sobj is null if crystal ball, *scroll if gold const char * level_distance(d_level *where) { - register schar ll = depth(&u.uz) - depth(where); - register boolean indun = (u.uz.dnum == where->dnum); + schar ll = depth(&u.uz) - depth(where); + boolean indun = (u.uz.dnum == where->dnum); if (ll < 0) { if (ll < (-8 - rn2(3))) @@ -1170,7 +1170,7 @@ use_crystal_ball(struct obj **optr) } static void -show_map_spot(register int x, register int y) +show_map_spot(int x, int y) { struct rm *lev; struct trap *t; @@ -1216,7 +1216,7 @@ show_map_spot(register int x, register int y) void do_mapping(void) { - register int zx, zy; + int zx, zy; boolean unconstrained; unconstrained = unconstrain_map(); @@ -1239,7 +1239,7 @@ do_mapping(void) void do_vicinity_map(void) { - register int zx, zy; + int zx, zy; int lo_y = (u.uy-5 < 0 ? 0 : u.uy-5), hi_y = (u.uy+6 > ROWNO ? ROWNO : u.uy+6), lo_x = (u.ux-9 < 1 ? 1 : u.ux-9), /* avoid column 0 */ @@ -1280,8 +1280,8 @@ cvt_sdoor_to_door(struct rm *lev) static void findone(int zx, int zy, genericptr_t num) { - register struct trap *ttmp; - register struct monst *mtmp; + struct trap *ttmp; + struct monst *mtmp; /* * This used to use if/else-if/else-if/else/end-if but that only @@ -1336,8 +1336,8 @@ findone(int zx, int zy, genericptr_t num) static void openone(int zx, int zy, genericptr_t num) { - register struct trap *ttmp; - register struct obj *otmp; + struct trap *ttmp; + struct obj *otmp; if(OBJ_AT(zx, zy)) { for(otmp = level.objects[zx][zy]; @@ -1508,10 +1508,10 @@ dosearch0(int aflag) /**< intrinsic autosearch vs explicit searching */ */ volatile xchar x, y; #else - register xchar x, y; + xchar x, y; #endif - register struct trap *trap; - register struct monst *mtmp; + struct trap *trap; + struct monst *mtmp; if (u.uswallow) { if (!aflag) @@ -1609,9 +1609,9 @@ warnreveal(void) void sokoban_detect(void) { - register int x, y; - register struct trap *ttmp; - register struct obj *obj; + int x, y; + struct trap *ttmp; + struct obj *obj; /* Map the background and boulders */ for (x = 1; x < COLNO; x++) diff --git a/src/dig.c b/src/dig.c index 3918f68c8..71980e141 100644 --- a/src/dig.c +++ b/src/dig.c @@ -34,7 +34,7 @@ enum dig_types { static boolean rm_waslit(void) { - register xchar x, y; + xchar x, y; if (levl[u.ux][u.uy].typ == ROOM && levl[u.ux][u.uy].waslit) { return TRUE; @@ -55,7 +55,7 @@ rm_waslit(void) static void mkcavepos(xchar x, xchar y, int dist, boolean waslit, boolean rockit) { - register struct rm *lev; + struct rm *lev; if (!isok(x, y)) { return; @@ -63,7 +63,7 @@ mkcavepos(xchar x, xchar y, int dist, boolean waslit, boolean rockit) lev = &levl[x][y]; if (rockit) { - register struct monst *mtmp; + struct monst *mtmp; if (IS_ROCK(lev->typ)) { return; @@ -102,13 +102,13 @@ mkcavepos(xchar x, xchar y, int dist, boolean waslit, boolean rockit) } static void -mkcavearea(register boolean rockit) +mkcavearea(boolean rockit) { int dist; xchar xmin = u.ux, xmax = u.ux; xchar ymin = u.uy, ymax = u.uy; - register xchar i; - register boolean waslit = rm_waslit(); + xchar i; + boolean waslit = rm_waslit(); if (rockit) { pline("Crash! The ceiling collapses around you!"); @@ -266,9 +266,9 @@ dig_check(struct monst *madeby, boolean verbose, int x, int y) static int dig(void) { - register struct rm *lev; - register xchar dpx = digging.pos.x, dpy = digging.pos.y; - register boolean ispick = uwep && is_pick(uwep); + struct rm *lev; + xchar dpx = digging.pos.x, dpy = digging.pos.y; + boolean ispick = uwep && is_pick(uwep); const char *verb = (!uwep || is_pick(uwep)) ? "dig into" : "chop through"; lev = &levl[dpx][dpy]; @@ -519,7 +519,7 @@ dig(void) } if (Is_earthlevel(&u.uz) && !rn2(3)) { - register struct monst *mtmp; + struct monst *mtmp; switch(rn2(2)) { case 0: @@ -589,7 +589,7 @@ fillholetyp( int y, boolean fill_if_any) /**< force filling if it exists at all */ { - register int x1, y1; + int x1, y1; int lo_x = max(1, x-1), hi_x = min(x+1, COLNO-1), lo_y = max(0, y-1), hi_y = min(y+1, ROWNO-1); int pool_cnt = 0, moat_cnt = 0, lava_cnt = 0, swamp_cnt = 0; @@ -630,10 +630,10 @@ fillholetyp( } void -digactualhole(register int x, register int y, struct monst *madeby, int ttyp) +digactualhole(int x, int y, struct monst *madeby, int ttyp) { struct obj *oldobjs, *newobjs; - register struct trap *ttmp; + struct trap *ttmp; char surface_type[BUFSZ]; struct rm *lev = &levl[x][y]; boolean shopdoor; @@ -878,7 +878,7 @@ liquid_flow(xchar x, xchar y, schar typ, struct trap *ttmp, const char *fillmsg) boolean dighole(boolean pit_only, boolean by_magic, coord *cc) { - register struct trap *ttmp; + struct trap *ttmp; struct rm *lev; struct obj *boulder_here; schar typ; @@ -1191,8 +1191,8 @@ use_pick_axe(struct obj *obj) int use_pick_axe2(struct obj *obj) { - register int rx, ry; - register struct rm *lev; + int rx, ry; + struct rm *lev; struct trap *trap, *trap_with_u; int dig_target; boolean ispick = is_pick(obj); @@ -1439,9 +1439,9 @@ watch_dig(struct monst *mtmp, xchar x, xchar y, boolean zap) /* Return TRUE if monster died, FALSE otherwise. Called from m_move(). */ boolean -mdig_tunnel(register struct monst *mtmp) +mdig_tunnel(struct monst *mtmp) { - register struct rm *here; + struct rm *here; int pile = rnd(12); here = &levl[mtmp->mx][mtmp->my]; diff --git a/src/display.c b/src/display.c index d7e9946a7..7bd703a30 100644 --- a/src/display.c +++ b/src/display.c @@ -199,9 +199,9 @@ magic_map_background(xchar x, xchar y, int show) * the hero can physically see the location. Update the screen if directed. */ void -map_background(register xchar x, register xchar y, register int show) +map_background(xchar x, xchar y, int show) { - register int glyph = back_to_glyph(x, y); + int glyph = back_to_glyph(x, y); if (level.flags.hero_memory) levl[x][y].glyph = glyph; @@ -215,10 +215,10 @@ map_background(register xchar x, register xchar y, register int show) * hero can physically see the location. */ void -map_trap(register struct trap *trap, register int show) +map_trap(struct trap *trap, int show) { - register int x = trap->tx, y = trap->ty; - register int glyph = trap_to_glyph(trap); + int x = trap->tx, y = trap->ty; + int glyph = trap_to_glyph(trap); assert_valid_coordinates(x, y); @@ -234,10 +234,10 @@ map_trap(register struct trap *trap, register int show) * see the location of the object. Update the screen if directed. */ void -map_object(register struct obj *obj, register int show) +map_object(struct obj *obj, int show) { - register int x = obj->ox, y = obj->oy; - register int glyph = obj_to_glyph(obj); + int x = obj->ox, y = obj->oy; + int glyph = obj_to_glyph(obj); assert_valid_coordinates(x, y); @@ -264,7 +264,7 @@ map_object(register struct obj *obj, register int show) * by newsym() if necessary. */ void -map_invisible(register xchar x, register xchar y) +map_invisible(xchar x, xchar y) { assert_valid_coordinates(x, y); @@ -296,9 +296,9 @@ unmap_invisible(int x, int y) * to call newsym(). */ void -unmap_object(register int x, register int y) +unmap_object(int x, int y) { - register struct trap *trap; + struct trap *trap; if (!level.flags.hero_memory) return; @@ -343,8 +343,8 @@ vobj_at(int x, int y) */ #define _map_location(x, y, show) \ { \ - register struct obj *obj; \ - register struct trap *trap; \ + struct obj *obj; \ + struct trap *trap; \ \ if ((obj = vobj_at(x, y)) && !covers_objects(x, y)) \ map_object(obj, show); \ @@ -514,7 +514,7 @@ display_monster(xchar x, xchar y, /**< display position */ * Do not call for worm tails. */ static void -display_warning(register struct monst *mon) +display_warning(struct monst *mon) { int x = mon->mx, y = mon->my; int wl = (int) (mon->m_lev / 4); @@ -581,7 +581,7 @@ feel_location(xchar x, xchar y) { struct rm *lev; struct obj *boulder; - register struct monst *mon; + struct monst *mon; if (!isok(x, y)) { return; @@ -744,12 +744,12 @@ feel_location(xchar x, xchar y) * Possibly put a new glyph at the given location. */ void -newsym(register int x, register int y) +newsym(int x, int y) { - register struct monst *mon; - register struct rm *lev = &(levl[x][y]); - register int see_it; - register xchar worm_tail; + struct monst *mon; + struct rm *lev = &(levl[x][y]); + int see_it; + xchar worm_tail; if (in_mklev) return; @@ -911,7 +911,7 @@ newsym(register int x, register int y) void shieldeff(xchar x, xchar y) { - register int i; + int i; if (!flags.sparkle) return; if (cansee(x, y)) { /* Don't see anything if can't see the location */ @@ -1014,7 +1014,7 @@ tmp_at(int x, int y) case DISP_END: if (tglyph->style == DISP_BEAM || tglyph->style == DISP_ALL) { - register int i; + int i; /* Erase (reset) from source to end */ for (i = 0; i < tglyph->sidx; i++) @@ -1189,7 +1189,7 @@ under_water(int mode) { static xchar lastx, lasty; static boolean dela; - register int x, y; + int x, y; /* swallowing has a higher precedence than under water */ if (Is_waterlevel(&u.uz) || u.uswallow) return; @@ -1281,7 +1281,7 @@ under_ground(int mode) void see_monsters(void) { - register struct monst *mon; + struct monst *mon; int new_warn_obj_cnt = 0; if (defer_see_monsters) { @@ -1323,7 +1323,7 @@ see_monsters(void) void set_mimic_blocking(void) { - register struct monst *mon; + struct monst *mon; for (mon = fmon; mon; mon = mon->nmon) { if (DEADMONSTER(mon)) continue; @@ -1343,7 +1343,7 @@ set_mimic_blocking(void) void see_objects(void) { - register struct obj *obj; + struct obj *obj; for(obj = fobj; obj; obj = obj->nobj) if (vobj_at(obj->ox, obj->oy) == obj) newsym(obj->ox, obj->oy); } @@ -1383,8 +1383,8 @@ doredraw(void) void docrt(void) { - register int x, y; - register struct rm *lev; + int x, y; + struct rm *lev; if (!u.ux) return; /* display isn't ready yet */ @@ -1482,7 +1482,7 @@ static char gbuf_stop[ROWNO]; * between object piles and single objects, it doesn't mark the location * for update. */ void -newsym_force(register int x, register int y) +newsym_force(int x, int y) { newsym(x,y); gbuf[y][x].new = 1; @@ -1593,8 +1593,8 @@ static gbuf_entry nul_gbuf = { 0, cmap_to_glyph(S_stone) }; void clear_glyph_buffer(void) { - register int x, y; - register gbuf_entry *gptr; + int x, y; + gbuf_entry *gptr; for (y = 0; y < ROWNO; y++) { gptr = &gbuf[y][0]; @@ -1611,7 +1611,7 @@ clear_glyph_buffer(void) void row_refresh(int start, int stop, int y) { - register int x; + int x; for (x = start; x <= stop; x++) if (gbuf[y][x].glyph != cmap_to_glyph(S_stone)) @@ -1647,7 +1647,7 @@ flush_screen(int cursor_on_u) */ static boolean flushing = 0; static boolean delay_flushing = 0; - register int x, y; + int x, y; if (cursor_on_u == -1) delay_flushing = !delay_flushing; if (delay_flushing) return; @@ -1660,7 +1660,7 @@ flush_screen(int cursor_on_u) #endif for (y = 0; y < ROWNO; y++) { - register gbuf_entry *gptr = &gbuf[y][x = gbuf_start[y]]; + gbuf_entry *gptr = &gbuf[y][x = gbuf_start[y]]; for (; x <= gbuf_stop[y]; gptr++, x++) if (gptr->new) { print_glyph(WIN_MAP, x, y, gptr->glyph, get_bk_glyph(x, y)); @@ -1744,8 +1744,8 @@ const char *str; static char cbuf[BUFSZ]; /* compress in case line too long */ if((int)strlen(str) >= 80) { - register const char *bp0 = str; - register char *bp1 = cbuf; + const char *bp0 = str; + char *bp1 = cbuf; do { if(*bp0 != ' ' || bp0[1] != ' ') @@ -1761,7 +1761,7 @@ const char *str; void dump_screen(void) { - register int x, y; + int x, y; int lastc = -1; /* D: botl.c has a closer approximation to the size, but we'll go with * this */ @@ -2043,7 +2043,7 @@ swallow_to_glyph(int mnum, int loc) * / S_rslant (-1, 1) or ( 1,-1) */ int -zapdir_to_glyph(register int dx, register int dy, int beam_type) +zapdir_to_glyph(int dx, int dy, int beam_type) { if (beam_type >= NUM_ZAP) { warning("zapdir_to_glyph: illegal beam type"); @@ -2526,7 +2526,7 @@ t_warn(struct rm *lev) static int wall_angle(struct rm *lev) { - register unsigned int seenv = lev->seenv & 0xff; + unsigned int seenv = lev->seenv & 0xff; const int *row; int col, idx; diff --git a/src/do.c b/src/do.c index caf53abf2..73e75a3fa 100644 --- a/src/do.c +++ b/src/do.c @@ -48,7 +48,7 @@ dodrop(void) * it's gone for good... If the destination is not a pool, returns FALSE. */ boolean -boulder_hits_pool(struct obj *otmp, register int rx, register int ry, boolean pushing) +boulder_hits_pool(struct obj *otmp, int rx, int ry, boolean pushing) { if (!otmp || otmp->otyp != BOULDER) warning("Not a boulder?"); @@ -285,7 +285,7 @@ flooreffects(struct obj *obj, int x, int y, const char *verb) /** obj is an object dropped on an altar */ void -doaltarobj(register struct obj *obj) +doaltarobj(struct obj *obj) { if (Blind) return; @@ -460,7 +460,7 @@ teleport_sink(void) } static void -dosinkring(register struct obj *obj) /* obj is a ring being dropped over a kitchen sink */ +dosinkring(struct obj *obj) /* obj is a ring being dropped over a kitchen sink */ { struct obj *otmp, *otmp2; @@ -664,7 +664,7 @@ canletgo(struct obj *obj, const char *word) } static int -drop(register struct obj *obj) +drop(struct obj *obj) { if(!obj) return(0); if(!canletgo(obj, "drop")) @@ -722,7 +722,7 @@ drop(register struct obj *obj) /* Called in several places - may produce output */ /* eg ship_object() and dropy() -> sellobj() both produce output */ void -dropx(register struct obj *obj) +dropx(struct obj *obj) { /* Tipped objects aren't considered carried, even if * their container is, so don't freeinv() it. */ @@ -1202,7 +1202,7 @@ d_level save_dlevel = {0, 0}; static int currentlevel_rewrite(void) { - register int fd; + int fd; char whynot[BUFSZ]; /* since level change might be a bit slow, flush any buffered screen @@ -1257,7 +1257,7 @@ save_currentstate(void) /* static boolean badspot(x, y) - register xchar x, y; + xchar x, y; { return((levl[x][y].typ != ROOM && levl[x][y].typ != AIR && levl[x][y].typ != CORR) || MON_AT(x, y)); @@ -1493,7 +1493,7 @@ goto_level(d_level *newlevel, boolean at_stairs, boolean falling, boolean portal if (portal && !In_endgame(&u.uz)) { /* find the portal on the new level */ - register struct trap *ttrap; + struct trap *ttrap; for (ttrap = ftrap; ttrap; ttrap = ttrap->ntrap) /* find the portal with the right destination level */ @@ -1511,7 +1511,7 @@ goto_level(d_level *newlevel, boolean at_stairs, boolean falling, boolean portal } else { if (newdungeon) { if (Is_stronghold(&u.uz)) { - register xchar x, y; + xchar x, y; int trycnt = 0; do { @@ -2180,7 +2180,7 @@ dowipe(void) } void -set_wounded_legs(register long int side, register int timex) +set_wounded_legs(long int side, int timex) { /* KMH -- STEED * If you are riding, your steed gets the wounded legs instead. @@ -2244,8 +2244,8 @@ heal_legs(int how) /**< 0: ordinary, 1: dismounting steed, 2: limbs turn to ston boolean unique_item_check(void) { - register struct obj *obj; - register struct monst *mtmp; + struct obj *obj; + struct monst *mtmp; for (obj = fobj; obj; obj = obj->nobj) { if (is_unique(obj)) return TRUE; @@ -2263,7 +2263,7 @@ unique_item_check(void) void levelport_monsters(void) { - register struct monst *mtmp, *mtmp2; + struct monst *mtmp, *mtmp2; int nlev; for (mtmp = fmon; mtmp; mtmp = mtmp2) { diff --git a/src/do_name.c b/src/do_name.c index b24fcd72e..cfe93e936 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -1180,8 +1180,8 @@ do_mname(void) { char buf[BUFSZ]; coord cc; - register int cx, cy; - register struct monst *mtmp; + int cx, cy; + struct monst *mtmp; char qbuf[BUFSZ*2]; if (Hallucination) { @@ -1238,7 +1238,7 @@ static int via_naming = 0; * when obj is in the inventory. */ void -do_oname(register struct obj *obj) +do_oname(struct obj *obj) { char *bufp, buf[BUFSZ], bufcpy[BUFSZ], qbuf[QBUFSZ]; const char *aname; @@ -1289,7 +1289,7 @@ do_oname(register struct obj *obj) return; } else if (restrict_name(obj, buf, FALSE) || exist_artifact(obj->otyp, buf)) { int n = rn2((int)strlen(buf)); - register char c1, c2; + char c1, c2; c1 = lowc(buf[n]); do c2 = 'a' + rn2('z'-'a'); while (c1 == c2); @@ -1376,7 +1376,7 @@ objtyp_is_callable(int i) int ddocall(void) { - register struct obj *obj; + struct obj *obj; #ifdef REDO char ch; #endif @@ -1507,7 +1507,7 @@ call_input(int obj_otyp, char *prompt) static void call_object(int obj_otyp, char *buf) { - register char **str1; + char **str1; /* clear old name */ str1 = &(objects[obj_otyp].oc_uname); if(*str1) free((genericptr_t)*str1); @@ -1639,7 +1639,7 @@ rndghostname(void) * options works, since those are special cases. */ char * -x_monnam(register struct monst *mtmp, int article, const char *adjective, int suppress, boolean called) +x_monnam(struct monst *mtmp, int article, const char *adjective, int suppress, boolean called) /* ARTICLE_NONE, ARTICLE_THE, ARTICLE_A: obvious @@ -1867,7 +1867,7 @@ noit_mon_nam(struct monst *mtmp) char * Monnam(struct monst *mtmp) { - register char *bp = mon_nam(mtmp); + char *bp = mon_nam(mtmp); *bp = highc(*bp); return(bp); @@ -1876,7 +1876,7 @@ Monnam(struct monst *mtmp) char * noit_Monnam(struct monst *mtmp) { - register char *bp = noit_mon_nam(mtmp); + char *bp = noit_mon_nam(mtmp); *bp = highc(*bp); return(bp); @@ -1922,7 +1922,7 @@ Adjmonnam(struct monst *mtmp, const char *adj) } char * -a_monnam(register struct monst *mtmp) +a_monnam(struct monst *mtmp) { return x_monnam(mtmp, ARTICLE_A, (char *)0, has_mgivenname(mtmp) ? SUPPRESS_SADDLE : 0, FALSE); diff --git a/src/do_wear.c b/src/do_wear.c index 86a0a2ffd..9c54d5969 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -65,7 +65,7 @@ off_msg(struct obj *otmp) /* for items that involve no delay */ static void -on_msg(register struct obj *otmp) +on_msg(struct obj *otmp) { if (flags.verbose) { char how[BUFSZ]; @@ -1117,7 +1117,7 @@ learnring(struct obj *ring, boolean observed) } void -Ring_on(register struct obj *obj) +Ring_on(struct obj *obj) { long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic; int old_attrib, which; @@ -1269,7 +1269,7 @@ Ring_on(register struct obj *obj) } static void -Ring_off_or_gone(register struct obj *obj, boolean gone) +Ring_off_or_gone(struct obj *obj, boolean gone) { long mask = (obj->owornmask & W_RING); int old_attrib, which; @@ -1420,7 +1420,7 @@ Ring_gone(struct obj *obj) } void -Blindf_on(register struct obj *otmp) +Blindf_on(struct obj *otmp) { boolean already_blind = Blind, changed = FALSE; @@ -1447,7 +1447,7 @@ Blindf_on(register struct obj *otmp) } void -Blindf_off(register struct obj *otmp) +Blindf_off(struct obj *otmp) { boolean was_blind = Blind, changed = FALSE; @@ -1500,7 +1500,7 @@ set_wear(void) /* check whether the target object is currently being put on (or taken off) */ boolean -donning(register struct obj *otmp) /* also checks for doffing */ +donning(struct obj *otmp) /* also checks for doffing */ { /* long what = (occupation == take_off) ? taking_off : 0L; */ @@ -2406,7 +2406,7 @@ find_ac(void) void glibr(void) { - register struct obj *otmp; + struct obj *otmp; int xfl = 0; boolean leftfall, rightfall, wastwoweap = FALSE; const char *otherwep = 0, *thiswep, *which, *hand; @@ -2500,7 +2500,7 @@ glibr(void) struct obj * some_armor(struct monst *victim) { - register struct obj *otmph, *otmp; + struct obj *otmph, *otmp; otmph = (victim == &youmonst) ? uarmc : which_armor(victim, W_ARMC); if (!otmph) @@ -2557,7 +2557,7 @@ unchanger(void) /* occupation callback for 'A' */ static int -select_off(register struct obj *otmp) +select_off(struct obj *otmp) { struct obj *why; char buf[BUFSZ]; @@ -2723,8 +2723,8 @@ static const char *disrobing = ""; static int take_off(void) { - register int i; - register struct obj *otmp; + int i; + struct obj *otmp; if (taking_off) { if (todelay > 0) { @@ -2902,9 +2902,9 @@ menu_remarm(int retry) /* hit by destroy armor scroll/black dragon breath/monster spell */ int -destroy_arm(register struct obj *atmp) +destroy_arm(struct obj *atmp) { - register struct obj *otmp; + struct obj *otmp; #define DESTROY_ARM(o) ((otmp = (o)) != 0 && \ (!atmp || atmp == otmp) && \ (!obj_resists(otmp, 0, 90))) @@ -2958,7 +2958,7 @@ destroy_arm(register struct obj *atmp) } void -adj_abon(register struct obj *otmp, register schar delta) +adj_abon(struct obj *otmp, schar delta) { if (uarmg && uarmg == otmp && otmp->otyp == GAUNTLETS_OF_DEXTERITY) { if (delta) { diff --git a/src/dog.c b/src/dog.c index 950b773fa..fe1c744b7 100644 --- a/src/dog.c +++ b/src/dog.c @@ -28,7 +28,7 @@ free_edog(struct monst *mtmp) } void -initedog(register struct monst *mtmp) +initedog(struct monst *mtmp) { mtmp->mtame = is_domestic(mtmp->data) ? 10 : 5; mtmp->mpeaceful = 1; @@ -74,7 +74,7 @@ pet_type(void) } struct monst * -make_familiar(register struct obj *otmp, xchar x, xchar y, boolean quietly) +make_familiar(struct obj *otmp, xchar x, xchar y, boolean quietly) { struct permonst *pm; struct monst *mtmp = 0; @@ -158,8 +158,8 @@ make_familiar(register struct obj *otmp, xchar x, xchar y, boolean quietly) struct monst * makedog(void) { - register struct monst *mtmp; - register struct obj *otmp; + struct monst *mtmp; + struct obj *otmp; const char *petname; int pettype; static int petname_used = 0; @@ -613,8 +613,8 @@ mon_catchup_elapsed_time( void keepdogs(boolean pets_only) /**< TRUE for ascension or final escape */ { - register struct monst *mtmp, *mtmp2; - register struct obj *obj; + struct monst *mtmp, *mtmp2; + struct obj *obj; int num_segs; boolean stay_behind; #ifdef BLACKMARKET @@ -699,7 +699,7 @@ keepdogs(boolean pets_only) /**< TRUE for ascension or final escape */ set_residency(mtmp, TRUE); if (mtmp->wormno) { - register int cnt; + int cnt; /* NOTE: worm is truncated to # segs = max wormno size */ cnt = count_wsegs(mtmp); num_segs = min(cnt, MAX_NUM_WORMS - 1); @@ -798,7 +798,7 @@ migrate_to_level( /* return quality of food; the lower the better */ /* fungi will eat even tainted food */ int -dogfood(struct monst *mon, register struct obj *obj) +dogfood(struct monst *mon, struct obj *obj) { struct permonst *mptr = mon->data, *fptr = 0; boolean carni = carnivorous(mptr); diff --git a/src/dogmove.c b/src/dogmove.c index ed86a7eb9..4b0795183 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -205,7 +205,7 @@ dog_eat(struct monst *mtmp, struct obj *obj, int x, int y, boolean devour) /* dog's starting location, might be different from current */ { - register struct edog *edog = EDOG(mtmp); + struct edog *edog = EDOG(mtmp); boolean poly, grow, heal, eyes, slimer, deadmimic; int nutrit; boolean vampiric = is_vampiric(mtmp->data); @@ -429,7 +429,7 @@ dog_hunger(struct monst *mtmp, struct edog *edog) static int dog_invent(struct monst *mtmp, struct edog *edog, int udist) { - register int omx, omy, carryamt = 0; + int omx, omy, carryamt = 0; struct obj *obj, *otmp; if (mtmp->msleeping || !mtmp->mcanmove) return(0); @@ -496,11 +496,11 @@ dog_invent(struct monst *mtmp, struct edog *edog, int udist) * returns -1/0/1 (dog's desire to approach player) or -2 (abort move) */ static int -dog_goal(register struct monst *mtmp, struct edog *edog, int after, int udist, int whappr) +dog_goal(struct monst *mtmp, struct edog *edog, int after, int udist, int whappr) { - register int omx, omy; + int omx, omy; boolean in_masters_sight, dog_has_minvent; - register struct obj *obj; + struct obj *obj; xchar otyp; int appr; @@ -522,7 +522,7 @@ dog_goal(register struct monst *mtmp, struct edog *edog, int after, int udist, i #define DDIST(x, y) (dist2(x, y, omx, omy)) #define SQSRCHRADIUS 5 int min_x, max_x, min_y, max_y; - register int nx, ny; + int nx, ny; gtyp = UNDEF; /* no goal as yet */ gx = gy = 0; /* suppress 'used before set' message */ @@ -599,7 +599,7 @@ dog_goal(register struct monst *mtmp, struct edog *edog, int after, int udist, i #define FARAWAY (COLNO + 2) /* position outside screen */ if (gx == u.ux && gy == u.uy && !in_masters_sight) { - register coord *cp; + coord *cp; cp = gettrack(omx, omy); if (cp) { @@ -636,7 +636,7 @@ dog_goal(register struct monst *mtmp, struct edog *edog, int after, int udist, i } static struct monst * -find_targ(register struct monst *mtmp, int dx, int dy, int maxdist) +find_targ(struct monst *mtmp, int dx, int dy, int maxdist) { struct monst *targ = 0; int curx = mtmp->mx, cury = mtmp->my; @@ -898,13 +898,13 @@ dog_move(struct monst *mtmp, { int appr, whappr, udist; int i, j, k; - register struct edog *edog = EDOG(mtmp); + struct edog *edog = EDOG(mtmp); struct obj *obj = (struct obj *) 0; xchar otyp; boolean has_edog, cursemsg[9], do_eat = FALSE; boolean better_with_displacing = FALSE; xchar nix, niy; /* position mtmp is (considering) moving to */ - register int nx, ny; /* temporary coordinates */ + int nx, ny; /* temporary coordinates */ xchar cnt, uncursedcnt, chcnt; int chi = -1, nidist, ndist; coord poss[9]; @@ -1025,7 +1025,7 @@ dog_move(struct monst *mtmp, if ((info[i] & ALLOW_M) && MON_AT(nx, ny)) { int mstatus; - register struct monst *mtmp2 = m_at(nx, ny); + struct monst *mtmp2 = m_at(nx, ny); if ((int)mtmp2->m_lev >= (int)mtmp->m_lev+2 || (mtmp2->data == &mons[PM_FLOATING_EYE] && rn2(10) && diff --git a/src/dokick.c b/src/dokick.c index 773a0b078..55c9735e6 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -285,7 +285,7 @@ kick_monster(struct monst *mon, xchar x, xchar y) * The gold object is *not* attached to the fobj chain! */ boolean -ghitm(register struct monst *mtmp, register struct obj *gold) +ghitm(struct monst *mtmp, struct obj *gold) { boolean msg_given = FALSE; #ifdef WEBB_DISINT @@ -410,7 +410,7 @@ ghitm(register struct monst *mtmp, register struct obj *gold) } void -lawful_bribery_alignment(register schar penalty) +lawful_bribery_alignment(schar penalty) { if ((u.ualign.type == A_LAWFUL) && (u.ualign.record > -10)) { adjalign(penalty); @@ -812,7 +812,7 @@ dokick(void) int x, y; int avrg_attrib; int dmg = 0, glyph, oldglyph = -1; - register struct monst *mtmp; + struct monst *mtmp; boolean no_kick = FALSE; char buf[BUFSZ], kickobjnam[BUFSZ]; @@ -1050,7 +1050,7 @@ dokick(void) } else goto ouch; } if (IS_THRONE(maploc->typ)) { - register int i; + int i; if(Levitation) goto dumb; if ((Luck < 0 || maploc->doormask) && !rn2(3)) { maploc->typ = ROOM; @@ -1444,8 +1444,8 @@ impact_drop( xchar dlev) /**< if !0 send to dlev near player */ { schar toloc; - register struct obj *obj, *obj2; - register struct monst *shkp; + struct obj *obj, *obj2; + struct monst *shkp; long oct, dct, price, debit, robbed; boolean angry, costly, isrock; coord cc; @@ -1681,8 +1681,8 @@ ship_object(struct obj *otmp, xchar x, xchar y, boolean shop_floor_obj) void obj_delivery(boolean near_hero) { - register struct obj *otmp, *otmp2; - register int nx, ny; + struct obj *otmp, *otmp2; + int nx, ny; long where; boolean nobreak, noscatter; @@ -1801,7 +1801,7 @@ deliver_obj_to_mon(struct monst *mtmp, int cnt, long unsigned int deliverflags) } static void -otransit_msg(register struct obj *otmp, register boolean nodrop, long int num) +otransit_msg(struct obj *otmp, boolean nodrop, long int num) { char *optr = 0, obuf[BUFSZ], xbuf[BUFSZ]; diff --git a/src/dothrow.c b/src/dothrow.c index a5b399528..6da8a2713 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -284,7 +284,7 @@ ok_to_throw(int *shotlimit_p) /**< (see dothrow()) */ int dothrow(void) { - register struct obj *obj; + struct obj *obj; int shotlimit; /* @@ -1134,8 +1134,8 @@ throwit( boolean twoweap) /**< used to restore twoweapon mode if wielded weapon returns */ { - register struct monst *mon; - register int range, urange; + struct monst *mon; + int range, urange; boolean crossbowing, clear_thrownobj = FALSE; boolean impaired = (Confusion || Stunned || Blind || Hallucination || Fumbling); @@ -1642,8 +1642,8 @@ thitmonst( struct monst *mon, struct obj *obj) /**< thrownobj or kickedobj or uwep */ { - register int tmp; /* Base chance to hit */ - register int disttmp; /* distance modifier */ + int tmp; /* Base chance to hit */ + int disttmp; /* distance modifier */ int otyp = obj->otyp; boolean guaranteed_hit = (u.uswallow && mon == u.ustuck); int dieroll; @@ -1948,7 +1948,7 @@ thitmonst( } static int -gem_accept(register struct monst *mon, register struct obj *obj) +gem_accept(struct monst *mon, struct obj *obj) { char buf[BUFSZ]; boolean is_buddy = sgn(mon->data->maligntyp) == sgn(u.ualign.type); @@ -2279,7 +2279,7 @@ static int throw_gold(struct obj *obj) { int range, odx, ody; - register struct monst *mon; + struct monst *mon; if (!u.dx && !u.dy && !u.dz) { You("cannot throw gold at yourself."); diff --git a/src/drawing.c b/src/drawing.c index 2bcf6e366..493697139 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -791,9 +791,9 @@ def_char_to_monclass(char ch) } void -assign_graphics(register glyph_t *graph_chars, int glth, int maxlen, int offset) +assign_graphics(glyph_t *graph_chars, int glth, int maxlen, int offset) { - register int i; + int i; for (i = 0; i < maxlen; i++) showsyms[i+offset] = (((i < glth) && graph_chars[i]) ? @@ -992,7 +992,7 @@ assign_rogue_graphics(boolean is_rlevel) /* Adjust graphics display characters on Rogue levels */ if (is_rlevel) { - register int i; + int i; save_syms(); diff --git a/src/dungeon.c b/src/dungeon.c index 516987c90..543366e65 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -728,8 +728,8 @@ void init_dungeons(void) { dlb *dgn_file; - register int i, cl = 0, cb = 0; - register s_level *x; + int i, cl = 0, cb = 0; + s_level *x; struct proto_dungeon pd; struct level_map *lev_map; struct version_info vers_info; @@ -1070,9 +1070,9 @@ deepest_lev_reached(boolean noquest) * calculation. _However_ the Quest is a difficult dungeon, so we * include it in the factor of difficulty calculations. */ - register int i; + int i; d_level tmp; - register schar ret = 0; + schar ret = 0; for(i = 0; i < n_dgns; i++) { if((tmp.dlevel = dungeons[i].dunlev_ureached) == 0) continue; @@ -1113,7 +1113,7 @@ maxledgerno(void) xchar ledger_to_dnum(xchar ledgerno) { - register int i; + int i; /* find i such that (i->base + 1) <= ledgerno <= (i->base + i->count) */ for (i = 0; i < n_dgns; i++) diff --git a/src/eat.c b/src/eat.c index 1b8b65be7..e68bcf308 100644 --- a/src/eat.c +++ b/src/eat.c @@ -89,7 +89,7 @@ const char *hu_stat[] = { * polymorphed character. Not used for monster checks. */ boolean -is_edible(register struct obj *obj) +is_edible(struct obj *obj) { /* protect invocation tools but not Rider corpses (handled elsewhere)*/ /* if (obj->oclass != FOOD_CLASS && obj_resists(obj, 0, 0)) */ @@ -598,7 +598,7 @@ maybe_cannibal(int pm, boolean allowmsg) } static void -cprefx(register int pm) +cprefx(int pm) { (void) maybe_cannibal(pm, TRUE); if (flesh_petrifies(&mons[pm])) { @@ -735,7 +735,7 @@ fix_petrification(void) /* intrinsic_possible() returns TRUE iff a monster can give an intrinsic. */ int -intrinsic_possible(int type, register struct permonst *ptr) +intrinsic_possible(int type, struct permonst *ptr) { switch (type) { case FIRE_RES: @@ -829,9 +829,9 @@ intrinsic_possible(int type, register struct permonst *ptr) * and what type of intrinsic it is trying to give you. */ static void -givit(int type, register struct permonst *ptr) +givit(int type, struct permonst *ptr) { - register int chance; + int chance; #ifdef DEBUG debugpline("Attempting to give intrinsic %d", type); @@ -1309,7 +1309,7 @@ tin_details(struct obj *obj, int mnum, char *buf) void set_tin_variety(struct obj *obj, int forcetype) { - register int r; + int r; if (forcetype == SPINACH_TIN || (forcetype == HEALTHY_TIN @@ -1341,7 +1341,7 @@ static int tin_variety(struct obj *obj, boolean disp) /**< we're just displaying so leave things alone */ { - register int r; + int r; if (obj->spe == 1) { r = SPINACH_TIN; @@ -1374,7 +1374,7 @@ tin_variety(struct obj *obj, static int opentin(void) { - register int r; + int r; const char *what; int which; @@ -1542,10 +1542,10 @@ consume_tin(const char *mesg) /* called when starting to open a tin */ static void -start_tin(register struct obj *otmp) +start_tin(struct obj *otmp) { const char *mesg = 0; - register int tmp; + int tmp; if (metallivorous(youmonst.data)) { mesg = "You bite right into the metal tin..."; @@ -2269,7 +2269,7 @@ static const char *foodwords[] = { }; static const char * -foodword(register struct obj *otmp) +foodword(struct obj *otmp) { if (otmp->oclass == FOOD_CLASS) return "food"; if (otmp->oclass == GEM_CLASS && @@ -3183,7 +3183,7 @@ floorfood( const char *verb, int corpsecheck) /**< 0, no check, 1, corpses, 2, tinnable corpses */ { - register struct obj *otmp; + struct obj *otmp; char qbuf[QBUFSZ]; char c; boolean feeding = (!strcmp(verb, "eat")); // corpsecheck == 0 @@ -3336,7 +3336,7 @@ vomit(void) /* A good idea from David Neves */ } int -eaten_stat(register int base, register struct obj *obj) +eaten_stat(int base, struct obj *obj) { long uneaten_amt, full_amount; diff --git a/src/end.c b/src/end.c index 0e753a743..6af7a720c 100644 --- a/src/end.c +++ b/src/end.c @@ -202,7 +202,7 @@ done_hangup(int sig) /* signal() handler */ #endif /* NO_SIGNAL */ void -done_in_by(register struct monst *mtmp) +done_in_by(struct monst *mtmp) { char buf[BUFSZ]; struct permonst *mptr = mtmp->data; @@ -489,8 +489,8 @@ savelife(int how) static void get_valuables(struct obj *list) /**< inventory or container contents */ { - register struct obj *obj; - register int i; + struct obj *obj; + int i; /* find amulets and gems, ignoring all artifacts */ for (obj = list; obj; obj = obj->nobj) @@ -523,7 +523,7 @@ sort_valuables( struct valuable_data *list, int size) /**< max value is less than 20 */ { - register int i, j; + int i, j; struct valuable_data ltmp; /* move greater quantities to the front of the list */ @@ -989,10 +989,10 @@ done(int how) if (how == ESCAPED || how == DEFIED || how == ASCENDED) #endif { - register struct monst *mtmp; - register struct obj *otmp; - register struct val_list *val; - register int i; + struct monst *mtmp; + struct obj *otmp; + struct val_list *val; + int i; for (val = valuables; val->list; val++) for (i = 0; i < val->size; i++) { @@ -1152,7 +1152,7 @@ heaven_or_hell_lifesave_end(void) void container_contents(struct obj *list, boolean identified, boolean all_containers, boolean want_disp) { - register struct obj *box, *obj; + struct obj *box, *obj; #ifdef SORTLOOT struct obj **oarray; int i, j, n; @@ -1278,7 +1278,7 @@ nh_terminate(int status) void list_vanquishedonly(void) { - register int i, lev; + int i, lev; int ntypes = 0, max_lev = 0, nkilled; long total_killed = 0L; winid klwin = WIN_ERR; @@ -1356,7 +1356,7 @@ void do_vanquished(int defquery, boolean ask) #endif { - register int i, lev; + int i, lev; int ntypes = 0, max_lev = 0, nkilled; long total_killed = 0L; char c; @@ -1455,7 +1455,7 @@ num_genocides(void) static void list_genocided(int defquery, boolean ask, boolean want_disp UNUSED) { - register int i; + int i; int ngenocided=0; #ifdef SHOW_EXTINCT int nextincted=0; diff --git a/src/engrave.c b/src/engrave.c index 0570d78fe..10e92ccad 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -256,9 +256,9 @@ cant_reach_floor(int x, int y, boolean up, boolean check_pit) } const char * -surface(register int x, register int y) +surface(int x, int y) { - register struct rm *lev = &levl[x][y]; + struct rm *lev = &levl[x][y]; if ((x == u.ux) && (y == u.uy) && u.uswallow && is_animal(u.ustuck->data)) @@ -289,9 +289,9 @@ surface(register int x, register int y) } const char * -ceiling(register int x, register int y) +ceiling(int x, int y) { - register struct rm *lev = &levl[x][y]; + struct rm *lev = &levl[x][y]; const char *what; /* other room types will no longer exist when we're interested -- @@ -319,7 +319,7 @@ ceiling(register int x, register int y) struct engr * engr_at(xchar x, xchar y) { - register struct engr *ep = head_engr; + struct engr *ep = head_engr; while(ep) { if(x == ep->engr_x && y == ep->engr_y) @@ -338,7 +338,7 @@ engr_at(xchar x, xchar y) int sengr_at(const char *s, xchar x, xchar y) { - register struct engr *ep = engr_at(x, y); + struct engr *ep = engr_at(x, y); if (ep && ep->engr_type != HEADSTONE && ep->engr_time <= moves) { if (strstri(ep->engr_txt, s) != 0) { @@ -361,7 +361,7 @@ unsigned nengr_at(xchar x, xchar y) { const char *s = "Elbereth"; - register struct engr *ep = engr_at(x, y); + struct engr *ep = engr_at(x, y); unsigned count = 0; const char *p; @@ -379,16 +379,16 @@ nengr_at(xchar x, xchar y) #endif /* ELBERETH_CONDUCT */ void -u_wipe_engr(register int cnt) +u_wipe_engr(int cnt) { if (can_reach_floor(TRUE)) wipe_engr_at(u.ux, u.uy, cnt); } void -wipe_engr_at(register xchar x, register xchar y, register xchar cnt) +wipe_engr_at(xchar x, xchar y, xchar cnt) { - register struct engr *ep = engr_at(x, y); + struct engr *ep = engr_at(x, y); /* Headstones are indelible */ if(ep && ep->engr_type != HEADSTONE) { @@ -407,7 +407,7 @@ wipe_engr_at(register xchar x, register xchar y, register xchar cnt) void read_engr_at(int x, int y) { - register struct engr *ep = engr_at(x, y); + struct engr *ep = engr_at(x, y); int sensed = 0; char buf[BUFSZ]; @@ -512,7 +512,7 @@ make_engr_at(int x, int y, const char *s, long int e_time, xchar e_type) void del_engr_at(int x, int y) { - register struct engr *ep = engr_at(x, y); + struct engr *ep = engr_at(x, y); if (ep) del_engr(ep); } @@ -1108,7 +1108,7 @@ engrave(const char *engraving, boolean fingers) * possible) by now. */ if (oep) { - register char c = 'n'; + char c = 'n'; /* Give player the choice to add to engraving. */ if (type == HEADSTONE || engraving) { @@ -1448,12 +1448,12 @@ engr_stats(const char *hdrfmt, char *hdrbuf, long int *count, long int *size) void -del_engr(register struct engr *ep) +del_engr(struct engr *ep) { if (ep == head_engr) { head_engr = ep->nxt_engr; } else { - register struct engr *ept; + struct engr *ept; for (ept = head_engr; ept; ept = ept->nxt_engr) if (ept->nxt_engr == ep) { diff --git a/src/exper.c b/src/exper.c index a942ca8dc..95481f7ea 100644 --- a/src/exper.c +++ b/src/exper.c @@ -116,7 +116,7 @@ newpw(void) int experience(struct monst *mtmp, int nk UNUSED) { - register struct permonst *ptr = mtmp->data; + struct permonst *ptr = mtmp->data; int i, tmp, tmp2; tmp = 1 + mtmp->m_lev * mtmp->m_lev; @@ -177,7 +177,7 @@ experience(struct monst *mtmp, int nk UNUSED) * Adds to Experience and Scoring counter */ void -more_experienced(register int exp, register int score, register int rexp) +more_experienced(int exp, int score, int rexp) { u.uexp += exp; u.urexp += 4*exp + rexp; @@ -208,7 +208,7 @@ more_experienced(register int exp, register int score, register int rexp) void losexp(const char *drainer) /**< cause of death, if drain should be fatal */ { - register int num; + int num; #ifdef WIZARD /* override life-drain resistance when handling an explicit @@ -282,7 +282,7 @@ void pluslvl(boolean incr) /* true iff via incremental experience growth */ { /* (false for potion of gain level) */ - register int num; + int num; if (!incr) You_feel("more experienced."); num = newhp(); diff --git a/src/explode.c b/src/explode.c index caf98af49..bcd89dc13 100644 --- a/src/explode.c +++ b/src/explode.c @@ -579,8 +579,8 @@ scatter(int sx, int sy, /**< location of objects to scatter */ unsigned int scflags, struct obj *obj) /**< only scatter this obj */ { - register struct obj *otmp; - register int tmp; + struct obj *otmp; + int tmp; int farthest = 0; uchar typ; long qtmp; diff --git a/src/extralev.c b/src/extralev.c index 7173aa56c..a15020590 100644 --- a/src/extralev.c +++ b/src/extralev.c @@ -58,7 +58,7 @@ roguejoin(int x1, int y1, int x2, int y2, int horiz) static void roguecorr(int x, int y, int dir) { - register int fromx, fromy, tox, toy; + int fromx, fromy, tox, toy; if (dir==DOWN) { r[x][y].doortable &= ~DOWN; @@ -155,7 +155,7 @@ roguecorr(int x, int y, int dir) static void miniwalk(int x, int y) { - register int q, dir; + int q, dir; int dirs[4]; while(1) { @@ -202,7 +202,7 @@ miniwalk(int x, int y) void makeroguerooms(void) { - register int x, y; + int x, y; /* Rogue levels are structured 3 by 3, with each section containing * a room or an intersection. The minimum width is 2 each way. * One difference between these and "real" Rogue levels: real Rogue @@ -293,7 +293,7 @@ corr(int x, int y) void makerogueghost(void) { - register struct monst *ghost; + struct monst *ghost; struct obj *ghostobj; struct mkroom *croom; int x, y; diff --git a/src/files.c b/src/files.c index f6c550384..afbf66910 100644 --- a/src/files.c +++ b/src/files.c @@ -553,7 +553,7 @@ clearlocks(void) if (ramdisk) eraseall(permbones, alllevels); #else - register int x; + int x; # if defined(UNIX) || defined(VMS) (void) signal(SIGHUP, SIG_IGN); @@ -1584,7 +1584,7 @@ lock_file(const char *filename, int whichprefix, int retryct) return FALSE; } #else - register int errnosv = errno; + int errnosv = errno; switch (errnosv) { /* George Barbanis */ case EEXIST: diff --git a/src/fountain.c b/src/fountain.c index ac102b50f..391dd062b 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -31,7 +31,7 @@ floating_above(const char *what) static void dowatersnakes(void) { - register int num = rn1(5, 2); + int num = rn1(5, 2); struct monst *mtmp; if (!(mvitals[PM_WATER_MOCCASIN].mvflags & G_GONE)) { @@ -79,7 +79,7 @@ dowaterdemon(void) static void dowaternymph(void) { - register struct monst *mtmp; + struct monst *mtmp; if(!(mvitals[PM_WATER_NYMPH].mvflags & G_GONE) && (mtmp = makemon(&mons[PM_WATER_NYMPH], u.ux, u.uy, NO_MM_FLAGS))) { @@ -116,8 +116,8 @@ dogushforth(int drinking) static void gush(int x, int y, genericptr_t poolcnt) { - register struct monst *mtmp; - register struct trap *ttmp; + struct monst *mtmp; + struct trap *ttmp; if (((x+y)%2) || (x == u.ux && y == u.uy) || (rn2(1 + distmin(u.ux, u.uy, x, y))) || @@ -214,8 +214,8 @@ void drinkfountain(void) { /* What happens when you drink from a fountain? */ - register boolean mgkftn = (levl[u.ux][u.uy].blessedftn == 1); - register int fate = rnd(30); + boolean mgkftn = (levl[u.ux][u.uy].blessedftn == 1); + int fate = rnd(30); if (Levitation) { floating_above("fountain"); @@ -292,7 +292,7 @@ drinkfountain(void) break; case 24: /* Curse an item */ { - register struct obj *obj; + struct obj *obj; pline("This water's no good!"); morehungry(rn1(20, 11)); @@ -336,7 +336,7 @@ drinkfountain(void) break; case 29: /* Scare */ { - register struct monst *mtmp; + struct monst *mtmp; pline("This %s gives you bad breath!", hliquid("water")); for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) @@ -358,7 +358,7 @@ drinkfountain(void) } void -dipfountain(register struct obj *obj) +dipfountain(struct obj *obj) { int er = ER_NOTHING; diff --git a/src/hack.c b/src/hack.c index 3bae014a9..6201484d6 100644 --- a/src/hack.c +++ b/src/hack.c @@ -63,13 +63,13 @@ static const struct herb_info { long count_herbs_at(xchar x, xchar y, boolean watery) { - register int dd; - register long count = 0; + int dd; + long count = 0; if (isok(x, y)) { for (dd = 0; dd < SIZE(herb_info); dd++) { if (watery == herb_info[dd].in_water) { - register struct obj *otmp = sobj_at(herb_info[dd].herb, x, y); + struct obj *otmp = sobj_at(herb_info[dd].herb, x, y); if (otmp) count += otmp->quan; } @@ -82,7 +82,7 @@ count_herbs_at(xchar x, xchar y, boolean watery) boolean herb_can_grow_at(xchar x, xchar y, boolean watery) { - register struct rm *lev = &levl[x][y]; + struct rm *lev = &levl[x][y]; if (inside_shop(x, y)) return FALSE; if (watery) return (IS_POOL(lev->typ) && @@ -221,7 +221,7 @@ water_current(xchar x, xchar y, int dir, unsigned int waterforce, boolean showms boolean drop_ripe_treefruit(xchar x, xchar y, boolean showmsg, boolean update) { - register struct rm *lev; + struct rm *lev; rndmappos(&x, &y); lev = &levl[x][y]; @@ -377,7 +377,7 @@ obj_to_any(struct obj *obj) boolean revive_nasty(int x, int y, const char *msg) { - register struct obj *otmp, *otmp2; + struct obj *otmp, *otmp2; struct monst *mtmp; coord cc; boolean revived = FALSE; @@ -414,10 +414,10 @@ revive_nasty(int x, int y, const char *msg) static int moverock(void) { - register xchar rx, ry, sx, sy; - register struct obj *otmp; - register struct trap *ttmp; - register struct monst *mtmp; + xchar rx, ry, sx, sy; + struct obj *otmp; + struct trap *ttmp; + struct monst *mtmp; sx = u.ux + u.dx, sy = u.uy + u.dy; /* boulder starting position */ while ((otmp = sobj_at(BOULDER, sx, sy)) != 0) { @@ -854,7 +854,7 @@ still_chewing(xchar x, xchar y) } void -movobj(register struct obj *obj, register xchar ox, register xchar oy) +movobj(struct obj *obj, xchar ox, xchar oy) { /* optimize by leaving on the fobj chain? */ remove_object(obj); @@ -869,7 +869,7 @@ static NEARDATA const char fell_on_sink[] = "fell onto a sink"; static void dosinkfall(void) { - register struct obj *obj; + struct obj *obj; int dmg; boolean lev_boots = (uarmf && uarmf->otyp == LEVITATION_BOOTS); boolean innate_lev = ((HLevitation & (FROMOUTSIDE | FROMFORM)) != 0L); @@ -953,7 +953,7 @@ dosinkfall(void) /* intended to be called only on ROCKs */ boolean -may_dig(register xchar x, register xchar y) +may_dig(xchar x, xchar y) { struct rm *lev = &levl[x][y]; @@ -964,14 +964,14 @@ may_dig(register xchar x, register xchar y) } boolean -may_passwall(register xchar x, register xchar y) +may_passwall(xchar x, xchar y) { return (boolean)(!((IS_STWALL(levl[x][y].typ) || IS_TREES(levl[x][y].typ)) && (levl[x][y].wall_info & W_NONPASSWALL))); } boolean -bad_rock(struct permonst *mdat, register xchar x, register xchar y) +bad_rock(struct permonst *mdat, xchar x, xchar y) { return((boolean) ((Sokoban && sobj_at(BOULDER, x, y)) || (IS_ROCK(levl[x][y].typ) @@ -1034,8 +1034,8 @@ test_move(int ux, int uy, int dx, int dy, int mode) { int x = ux+dx; int y = uy+dy; - register struct rm *tmpr = &levl[x][y]; - register struct rm *ust; + struct rm *tmpr = &levl[x][y]; + struct rm *ust; door_opened = FALSE; /* @@ -1911,9 +1911,9 @@ domove_swap_with_pet(struct monst *mtmp, xchar x, xchar y) void domove(void) { - register struct monst *mtmp; - register struct rm *tmpr; - register xchar x, y; + struct monst *mtmp; + struct rm *tmpr; + xchar x, y; struct trap *trap = NULL; int wtcap; boolean on_ice; @@ -2064,7 +2064,7 @@ domove(void) x = u.ux + u.dx; y = u.uy + u.dy; if (Stunned || (Confusion && !rn2(5))) { - register int tries = 0; + int tries = 0; do { if (tries++ > 50) { @@ -3063,7 +3063,7 @@ spoteffects(boolean pick) static struct monst * monstinroom(struct permonst *mdat, int roomno) { - register struct monst *mtmp; + struct monst *mtmp; for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) { @@ -3078,12 +3078,12 @@ monstinroom(struct permonst *mdat, int roomno) } char * -in_rooms(register xchar x, register xchar y, register int typewanted) +in_rooms(xchar x, xchar y, int typewanted) { static char buf[5]; char rno, *ptr = &buf[4]; int typefound, min_x, min_y, max_x, max_y_offset, step; - register struct rm *lev; + struct rm *lev; #define goodtype(rno) (!typewanted || \ ((typefound = rooms[rno - ROOMOFFSET].rtype) == typewanted) || \ @@ -3144,10 +3144,10 @@ in_rooms(register xchar x, register xchar y, register int typewanted) /* is (x,y) in a town? */ boolean -in_town(register int x, register int y) +in_town(int x, int y) { s_level *slev = Is_special(&u.uz); - register struct mkroom *sroom; + struct mkroom *sroom; boolean has_subrooms = FALSE; if (!slev || !slev->flags.town) @@ -3183,7 +3183,7 @@ in_town(register int x, register int y) } static void -move_update(register boolean newlev) +move_update(boolean newlev) { char *ptr1, *ptr2, *ptr3, *ptr4; @@ -3234,9 +3234,9 @@ u_in_mine_town(void) /* possibly deliver a one-time room entry message */ void -check_special_room(register boolean newlev) +check_special_room(boolean newlev) { - register struct monst *mtmp; + struct monst *mtmp; char *ptr; move_update(newlev); @@ -3437,7 +3437,7 @@ pickup_checks(void) } } if (!OBJ_AT(u.ux, u.uy)) { - register struct rm *lev = &levl[u.ux][u.uy]; + struct rm *lev = &levl[u.ux][u.uy]; if (IS_THRONE(lev->typ)) pline("It must weigh%s a ton!", lev->looted ? " almost" : ""); @@ -3775,7 +3775,7 @@ monster_nearby(void) } void -nomul(register int nval, const char *txt) +nomul(int nval, const char *txt) { if (multi < nval) return; /* This is a bug fix by ab@unido */ u.uinvulnerable = FALSE; /* Kludge to avoid ctrl-C bug -dlc */ @@ -4001,8 +4001,8 @@ static int wc; /* current weight_cap(); valid after call to inv_weight() */ int inv_weight(void) { - register struct obj *otmp = invent; - register int wt = 0; + struct obj *otmp = invent; + int wt = 0; while (otmp) { if (otmp->oclass == COIN_CLASS) @@ -4073,8 +4073,8 @@ check_capacity(const char *str) int inv_cnt(boolean incl_gold) { - register struct obj *otmp = invent; - register int ct = 0; + struct obj *otmp = invent; + int ct = 0; while (otmp) { if (incl_gold || otmp->invlet != GOLD_SYM) { diff --git a/src/hacklib.c b/src/hacklib.c index 99def4130..00756c6a5 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -47,7 +47,7 @@ lowc(char c) char * lcase(char *s) { - register char *p; + char *p; for (p = s; *p; p++) if ('A' <= *p && *p <= 'Z') *p |= 040; @@ -58,7 +58,7 @@ lcase(char *s) char * ucase(char *s) { - register char *p; + char *p; for (p = s; *p; p++) if ('a' <= *p && *p <= 'z') @@ -78,7 +78,7 @@ upstart(char *s) char * mungspaces(char *bp) { - register char c, *p, *p2; + char c, *p, *p2; boolean was_space = TRUE; for (p = p2 = bp; (c = *p) != '\0'; p++) { @@ -132,7 +132,7 @@ strip_newline(char *str) /* return the end of a string (pointing at '\0') */ char * -eos(register char *s) +eos(char *s) { while (*s) s++; /* s += strlen(s); */ return s; @@ -310,9 +310,9 @@ ing_suffix(const char *s) char * xcrypt(const char *str, char *buf) { - register const char *p; - register char *q; - register int bitmask; + const char *p; + char *q; + int bitmask; for (bitmask = 1, p = str, q = buf; *p; q++) { *q = *p++; @@ -337,8 +337,8 @@ char * tabexpand(char *sbuf) { char buf[BUFSZ]; - register char *bp, *s = sbuf; - register int idx; + char *bp, *s = sbuf; + int idx; if (!*s) return sbuf; @@ -361,7 +361,7 @@ visctrl(char c) { Static char visctrl_bufs[VISCTRL_NBUF][5]; static int nbuf = 0; - register int i = 0; + int i = 0; char *ccc = visctrl_bufs[nbuf]; nbuf = (nbuf + 1) % VISCTRL_NBUF; @@ -489,7 +489,7 @@ strNsubst( const char * ordin(int n) /**< note: should be non-negative */ { - register int dd = n % 10; + int dd = n % 10; return (dd == 0 || dd > 3 || (n % 100) / 10 == 1) ? "th" : (dd == 1) ? "st" : (dd == 2) ? "nd" : "rd"; @@ -539,7 +539,7 @@ int distmin(int x0, int y0, int x1, int y1) /* distance between two points, in moves */ { - register int dx = x0 - x1, dy = y0 - y1; + int dx = x0 - x1, dy = y0 - y1; if (dx < 0) dx = -dx; if (dy < 0) dy = -dy; /* The minimum number of moves to get from (x0,y0) to (x1,y1) is the @@ -552,7 +552,7 @@ distmin(int x0, int y0, int x1, int y1) /* distance between two points, in moves int dist2(int x0, int y0, int x1, int y1) { - register int dx = x0 - x1, dy = y0 - y1; + int dx = x0 - x1, dy = y0 - y1; return dx * dx + dy * dy; } @@ -683,7 +683,7 @@ strncmpi( const char *s2, int n) /*(should probably be size_t, which is unsigned)*/ { - register char t1, t2; + char t1, t2; while (n--) { if (!*s2) return (*s1 != 0); /* s1 >= s2 */ @@ -704,8 +704,8 @@ strstri(const char *str, const char *sub) /* case insensitive substring search { - register const char *s1, *s2; - register int i, k; + const char *s1, *s2; + int i, k; # define TABSIZ 0x20 /* 0x40 would be case-sensitive */ char tstr[TABSIZ], tsub[TABSIZ]; /* nibble count tables */ # if 0 @@ -742,7 +742,7 @@ strstri(const char *str, const char *sub) /* case insensitive substring search boolean fuzzymatch(const char *s1, const char *s2, const char *ignore_chars, boolean caseblind) { - register char c1, c2; + char c1, c2; do { while ((c1 = *s1++) != '\0' && index(ignore_chars, c1) != 0) continue; @@ -998,8 +998,8 @@ time_from_yyyymmddhhmmss(char *buf) int phase_of_the_moon(void) /* 0-7, with 0: new, 4: full */ { - register struct tm *lt = getlt(); - register int epact, diy, goldn; + struct tm *lt = getlt(); + int epact, diy, goldn; diy = lt->tm_yday; goldn = (lt->tm_year % 19) + 1; @@ -1021,7 +1021,7 @@ is_june(void) boolean friday_13th(void) { - register struct tm *lt = getlt(); + struct tm *lt = getlt(); return((boolean)(lt->tm_wday == 5 /* friday */ && lt->tm_mday == 13)); } @@ -1029,7 +1029,7 @@ friday_13th(void) int night(void) { - register int hour = getlt()->tm_hour; + int hour = getlt()->tm_hour; return(hour < 6 || hour > 21); } diff --git a/src/invent.c b/src/invent.c index 4ec59fb25..bbdf6f661 100644 --- a/src/invent.c +++ b/src/invent.c @@ -41,11 +41,11 @@ static char venom_inv[] = { VENOM_CLASS, 0 }; /* (constant) */ #endif void -assigninvlet(register struct obj *otmp) +assigninvlet(struct obj *otmp) { boolean inuse[52]; - register int i; - register struct obj *obj; + int i; + struct obj *obj; /* there should be at most one of these in inventory... */ if (otmp->oclass == COIN_CLASS) { @@ -161,7 +161,7 @@ merge_choice(struct obj *objlist, struct obj *obj) int merged(struct obj **potmp, struct obj **pobj) { - register struct obj *otmp = *potmp, *obj = *pobj; + struct obj *otmp = *potmp, *obj = *pobj; if (mergable(otmp, obj)) { /* Approximate age: we do it this way because if we were to @@ -539,7 +539,7 @@ useupall(struct obj *obj) } void -useup(register struct obj *obj) +useup(struct obj *obj) { /* Note: This works correctly for containers because they */ /* (containers) don't merge. */ @@ -610,7 +610,7 @@ freeinv_core(struct obj *obj) /* remove an object from the hero's inventory */ void -freeinv(register struct obj *obj) +freeinv(struct obj *obj) { extract_nobj(obj, &invent); freeinv_core(obj); @@ -635,7 +635,7 @@ delallobj(int x, int y) /* destroy object in fobj chain (if unpaid, it remains on the bill) */ void -delobj(register struct obj *obj) +delobj(struct obj *obj) { boolean update_map; @@ -660,7 +660,7 @@ delobj(register struct obj *obj) struct obj * sobj_at(int otyp, int x, int y) { - register struct obj *otmp; + struct obj *otmp; for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere) { if (otmp->otyp == otyp) { @@ -674,7 +674,7 @@ sobj_at(int otyp, int x, int y) struct obj * nxtobj(struct obj *obj, int type, boolean by_nexthere) { - register struct obj *otmp; + struct obj *otmp; otmp = obj; /* start with the object after this one */ do { @@ -688,9 +688,9 @@ nxtobj(struct obj *obj, int type, boolean by_nexthere) } struct obj * -carrying(register int type) +carrying(int type) { - register struct obj *otmp; + struct obj *otmp; for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp->otyp == type) @@ -740,7 +740,7 @@ currency(long int amount) boolean have_lizard(void) { - register struct obj *otmp; + struct obj *otmp; for(otmp = invent; otmp; otmp = otmp->nobj) if(otmp->otyp == CORPSE && otmp->corpsenm == PM_LIZARD) @@ -749,7 +749,7 @@ have_lizard(void) } struct obj * -o_on(unsigned int id, register struct obj *objchn) +o_on(unsigned int id, struct obj *objchn) { struct obj *temp; @@ -763,9 +763,9 @@ o_on(unsigned int id, register struct obj *objchn) } boolean -obj_here(register struct obj *obj, int x, int y) +obj_here(struct obj *obj, int x, int y) { - register struct obj *otmp; + struct obj *otmp; for(otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere) if(obj == otmp) return(TRUE); @@ -773,9 +773,9 @@ obj_here(register struct obj *obj, int x, int y) } struct obj * -g_at(register int x, register int y) +g_at(int x, int y) { - register struct obj *obj = level.objects[x][y]; + struct obj *obj = level.objects[x][y]; while (obj) { if (obj->oclass == COIN_CLASS) return obj; @@ -786,10 +786,10 @@ g_at(register int x, register int y) /* compact a string of inventory letters by dashing runs of letters */ static void -compactify(register char *buf) +compactify(char *buf) { - register int i1 = 1, i2 = 1; - register char ilet, ilet1, ilet2; + int i1 = 1, i2 = 1; + char ilet, ilet1, ilet2; ilet2 = buf[0]; ilet1 = buf[1]; @@ -867,7 +867,7 @@ getnextgetobj(void) !!!! may be able to remove "usegold" */ struct obj * -getobj(register const char *let, register const char *word) +getobj(const char *let, const char *word) { struct obj *otmp; char ilet = 0; @@ -939,7 +939,7 @@ getobj(register const char *let, register const char *word) || (usegold && otmp->invlet == GOLD_SYM) || (useboulder && otmp->otyp == BOULDER) ) { - register int otyp = otmp->otyp; + int otyp = otmp->otyp; bp[foo++] = otmp->invlet; /* ugly check: remove inappropriate things */ @@ -1280,14 +1280,14 @@ silly_thing(const char *word, struct obj *otmp) } static int -ckvalidcat(register struct obj *otmp) +ckvalidcat(struct obj *otmp) { /* use allow_category() from pickup.c */ return((int)allow_category(otmp)); } static int -ckunpaid(register struct obj *otmp) +ckunpaid(struct obj *otmp) { return (otmp->unpaid || (Has_contents(otmp) && count_unpaid(otmp->cobj))); } @@ -1524,8 +1524,8 @@ askchain(struct obj **objchn, const char *olets, int allflag, int (*fn) (struct { struct obj *otmp, *otmp2, *otmpo; - register char sym, ilet; - register int cnt = 0, dud = 0, tmp; + char sym, ilet; + int cnt = 0, dud = 0, tmp; boolean takeoff, nodot, ident, take_out, put_in, first, ininv, bycat; char qbuf[QBUFSZ], qpfx[QBUFSZ]; @@ -1890,7 +1890,7 @@ update_inventory(void) } static char -obj_to_let(register struct obj *obj) /* should of course only be called for things in invent */ +obj_to_let(struct obj *obj) /* should of course only be called for things in invent */ { if (!flags.invlet_constant) { @@ -2757,7 +2757,7 @@ display_inventory(const char *lets, boolean want_reply) /** See display_inventory. This is the same thing WITH dumpfile creation */ char -dump_inventory(register const char *lets, boolean want_reply, boolean want_disp) +dump_inventory(const char *lets, boolean want_reply, boolean want_disp) { return display_pickinv(lets, NULL, NULL, want_reply, (long *)0, TRUE, want_disp); } @@ -2991,7 +2991,7 @@ dounpaid(void) { winid win; struct obj *otmp, *marker; - register char ilet; + char ilet; char *invlet = flags.inv_order; int classcount, count, num_so_far; int save_unpaid = 0; /* lint init */ @@ -3714,7 +3714,7 @@ doprring(void) You("are not wearing any rings."); else { char lets[3]; - register int ct = 0; + int ct = 0; if(uleft) lets[ct++] = obj_to_let(uleft); if(uright) lets[ct++] = obj_to_let(uright); @@ -3785,9 +3785,9 @@ doprinuse(void) * uses up an object that's on the floor, charging for it as necessary */ void -useupf(register struct obj *obj, long int numused) +useupf(struct obj *obj, long int numused) { - register struct obj *otmp; + struct obj *otmp; boolean at_u = (obj->ox == u.ux && obj->oy == u.uy); /* burn_floor_objects() keeps an object pointer that it tries to @@ -4179,7 +4179,7 @@ worn_wield_only(struct obj *obj) * MINV_ALL - display all inventory */ struct obj * -display_minventory(register struct monst *mon, int dflags, char *title) +display_minventory(struct monst *mon, int dflags, char *title) { struct obj *ret; char tmp[QBUFSZ]; @@ -4229,7 +4229,7 @@ display_minventory(register struct monst *mon, int dflags, char *title) * Currently, this is only used for statues, via wand of probing. */ struct obj * -display_cinventory(register struct obj *obj) +display_cinventory(struct obj *obj) { struct obj *ret; char tmp[QBUFSZ]; diff --git a/src/lock.c b/src/lock.c index 6d8fa36f6..faa8f84e9 100644 --- a/src/lock.c +++ b/src/lock.c @@ -569,8 +569,8 @@ pick_lock( int doforce(void) { - register struct obj *otmp; - register int c, picktyp; + struct obj *otmp; + int c, picktyp; char qbuf[QBUFSZ]; if (u.uswallow) { @@ -675,7 +675,7 @@ doopen_indir(int x, int y) { #endif /* AUTO_OPEN */ coord cc; - register struct rm *door; + struct rm *door; boolean portcullis; int res = 0; struct monst *mtmp; @@ -783,7 +783,7 @@ doopen_indir(int x, int y) } static boolean -obstructed(register int x, register int y, boolean quietly) +obstructed(int x, int y, boolean quietly) { struct monst *mtmp = m_at(x, y); @@ -821,8 +821,8 @@ obstructed(register int x, register int y, boolean quietly) int doclose(void) { - register int x, y; - register struct rm *door; + int x, y; + struct rm *door; struct monst *mtmp; boolean portcullis; int res = 0; @@ -964,7 +964,7 @@ boxlock(struct obj *obj, struct obj *otmp) /* obj *is* a box */ boolean doorlock(struct obj *otmp, int x, int y) { - register struct rm *door = &levl[x][y]; + struct rm *door = &levl[x][y]; boolean res = TRUE; int loudness = 0; const char *msg = (const char *)0; diff --git a/src/mail.c b/src/mail.c index bb86768c9..af33b0617 100644 --- a/src/mail.c +++ b/src/mail.c @@ -286,7 +286,7 @@ md_rush( int ty) /**< destination of mail daemon */ { struct monst *mon; /* displaced monster */ - register int dx, dy; /* direction counters */ + int dx, dy; /* direction counters */ int fx = md->mx, fy = md->my; /* current location */ int nfx = fx, nfy = fy, /* new location */ d1, d2; /* shortest distances */ @@ -536,7 +536,7 @@ readmail(struct obj *otmp) { nhUse(otmp); #ifdef DEF_MAILREADER - register const char *mr = 0; + const char *mr = 0; if (iflags.debug_fuzzer) { return; } diff --git a/src/makemon.c b/src/makemon.c index dc5a15936..59b5550a2 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -31,7 +31,7 @@ extern const int monstr[]; #define tooweak(monindx, lev) (monstr[monindx] < lev) boolean -is_home_elemental(register struct permonst *ptr) +is_home_elemental(struct permonst *ptr) { if (ptr->mlet == S_ELEMENTAL) switch (monsndx(ptr)) { @@ -74,7 +74,7 @@ static void m_initgrp(struct monst *mtmp, int x, int y, int n, int mmflags) { coord mm; - register int cnt = rnd(n); + int cnt = rnd(n); struct monst *mon; #if defined(__GNUC__) && (defined(HPUX) || defined(DGUX)) /* There is an unresolved problem with several people finding that @@ -138,7 +138,7 @@ m_initgrp(struct monst *mtmp, int x, int y, int n, int mmflags) static void m_initthrow(struct monst *mtmp, int otyp, int oquan) { - register struct obj *otmp; + struct obj *otmp; otmp = mksobj(otyp, TRUE, FALSE); otmp->quan = (long) rn1(oquan, 3); @@ -150,7 +150,7 @@ m_initthrow(struct monst *mtmp, int otyp, int oquan) static void m_inityour(struct monst *mtmp, struct obj *obj) { - register struct obj *otmp; + struct obj *otmp; otmp = mksobj(obj->otyp, FALSE, FALSE); if (obj->blessed) bless(obj); @@ -164,10 +164,10 @@ m_inityour(struct monst *mtmp, struct obj *obj) } static void -m_initweap(register struct monst *mtmp) +m_initweap(struct monst *mtmp) { - register struct permonst *ptr = mtmp->data; - register int mm = monsndx(ptr); + struct permonst *ptr = mtmp->data; + int mm = monsndx(ptr); struct obj *otmp; int bias, w1, w2; @@ -595,11 +595,11 @@ mkmonmoney(struct monst *mtmp, long int amount) } static void -m_initinv(register struct monst *mtmp) +m_initinv(struct monst *mtmp) { - register int cnt; - register struct obj *otmp; - register struct permonst *ptr = mtmp->data; + int cnt; + struct obj *otmp; + struct permonst *ptr = mtmp->data; int i; #ifdef REINCARNATION if (Is_rogue_level(&u.uz)) return; @@ -612,7 +612,7 @@ m_initinv(register struct monst *mtmp) case S_HUMAN: if(is_mercenary(ptr)) { - register int mac; + int mac; switch(monsndx(ptr)) { case PM_GUARD: mac = -1; break; @@ -1120,9 +1120,9 @@ makemon_rnd_goodpos(struct monst *mon, unsigned int gpflags, coord *cc) static struct monst * -_makemon(register struct permonst *ptr, register int x, register int y, register int mmflags) +_makemon(struct permonst *ptr, int x, int y, int mmflags) { - register struct monst *mtmp; + struct monst *mtmp; int mndx, mcham, ct, mitem, xlth, mhitdie; boolean anymon = (!ptr); boolean byyou = (x == u.ux && y == u.uy); @@ -1529,7 +1529,7 @@ newmextra(void) * In case we make a monster group, only return the one at [x,y]. */ struct monst * -makemon(register struct permonst *ptr, register int x, register int y, register int mmflags) +makemon(struct permonst *ptr, int x, int y, int mmflags) { use_mon_rng++; struct monst *mtmp = _makemon(ptr, x, y, mmflags); @@ -1641,11 +1641,11 @@ prohibited_by_generation_flags(struct permonst *ptr) * return an integer in the range of 0-5. */ static int -align_shift(register struct permonst *ptr) +align_shift(struct permonst *ptr) { static NEARDATA long oldmoves = 0L; /* != 1, starting value of moves */ static NEARDATA s_level *lev; - register int alshift; + int alshift; if (oldmoves != moves) { lev = Is_special(&u.uz); @@ -1724,8 +1724,8 @@ static struct permonst * _rndmonst(void) { - register struct permonst *ptr; - register int mndx, ct; + struct permonst *ptr; + int mndx, ct; if (level.mon_gen && (rn2(100) < level.mon_gen->override_chance) && @@ -1874,7 +1874,7 @@ mkclass(char class, int spc) struct permonst * mkclass_aligned(char class, int spc, aligntyp atyp) { - register int first, last, num = 0; + int first, last, num = 0; int k, nums[SPECIAL_PM + 1]; /* +1: insurance for final return value */ int maxmlev, mask = (G_NOGEN | G_UNIQ) & ~spc; @@ -1953,7 +1953,7 @@ mkclass_aligned(char class, int spc, aligntyp atyp) int mkclass_poly(int class) { - register int first, last, num = 0; + int first, last, num = 0; for (first = LOW_PM; first < SPECIAL_PM; first++) { if (mons[first].mlet == class) { @@ -1984,7 +1984,7 @@ mkclass_poly(int class) } int -adj_lev(register struct permonst *ptr) /* adjust strength of monsters based on u.uz and u.ulevel */ +adj_lev(struct permonst *ptr) /* adjust strength of monsters based on u.uz and u.ulevel */ { int tmp, tmp2; @@ -2129,7 +2129,7 @@ grow_up(struct monst *mtmp, struct monst *victim) int mongets(struct monst *mtmp, int otyp) { - register struct obj *otmp; + struct obj *otmp; int spe; if (!otyp) return 0; @@ -2200,7 +2200,7 @@ golemhp(int type) * ( some "animal" types are co-aligned, but also hungry ) */ boolean -peace_minded(register struct permonst *ptr) +peace_minded(struct permonst *ptr) { aligntyp mal = ptr->maligntyp, ual = u.ualign.type; @@ -2318,7 +2318,7 @@ static NEARDATA char syms[] = { }; void -set_mimic_sym(register struct monst *mtmp) /* KAA, modified by ERS */ +set_mimic_sym(struct monst *mtmp) /* KAA, modified by ERS */ { int typ, roomno, rt; diff --git a/src/mapglyph.c b/src/mapglyph.c index 0b1c6fcd3..808d83a08 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -92,7 +92,7 @@ void mapglyph(int glyph, glyph_t *ochar, int *ocolor, unsigned int *ospecial, int x, int y, unsigned int mgflags UNUSED) { - register int offset; + int offset; #if defined(TEXTCOLOR) || defined(ROGUE_COLOR) int color = NO_COLOR; #endif diff --git a/src/mcastu.c b/src/mcastu.c index 62309d21e..6e7938547 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -213,7 +213,7 @@ choose_punisher_spell(void) * 0: unsuccessful spell */ int -castmu(register struct monst *mtmp, register struct attack *mattk, boolean thinks_it_foundyou, boolean foundyou) +castmu(struct monst *mtmp, struct attack *mattk, boolean thinks_it_foundyou, boolean foundyou) { int dmg, ml = mtmp->m_lev; int ret; @@ -952,7 +952,7 @@ spell_would_be_useless(struct monst *mtmp, unsigned int adtyp, int spellnum) /* monster uses spell (ranged) */ int -buzzmu(register struct monst *mtmp, register struct attack *mattk) +buzzmu(struct monst *mtmp, struct attack *mattk) { /* don't print constant stream of curse messages for 'normal' spellcasting monsters at range */ diff --git a/src/mhitm.c b/src/mhitm.c index 592961de8..7af34685f 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -33,7 +33,7 @@ static int passivemm(struct monst *, struct monst *, boolean, int); static int dieroll; static void -noises(register struct monst *magr, register struct attack *mattk) +noises(struct monst *magr, struct attack *mattk) { boolean farq = (distu(magr->mx, magr->my) > 15); @@ -47,7 +47,7 @@ noises(register struct monst *magr, register struct attack *mattk) } static void -missmm(register struct monst *magr, register struct monst *mdef, struct attack *mattk) +missmm(struct monst *magr, struct monst *mdef, struct attack *mattk) { const char *fmt; char buf[BUFSZ], mdef_name[BUFSZ]; @@ -101,9 +101,9 @@ missmm(register struct monst *magr, register struct monst *mdef, struct attack * */ /* have monsters fight each other */ int -fightm(register struct monst *mtmp) +fightm(struct monst *mtmp) { - register struct monst *mon, *nmon; + struct monst *mon, *nmon; int result, has_u_swallowed; #ifdef LINT nmon = 0; @@ -172,7 +172,7 @@ fightm(register struct monst *mtmp) * returns same results as mattackm(). */ int -mdisplacem(register struct monst *magr, register struct monst *mdef, boolean quietly) +mdisplacem(struct monst *magr, struct monst *mdef, boolean quietly) { struct permonst *pa, *pd; int tx, ty, fx, fy; @@ -278,7 +278,7 @@ mdisplacem(register struct monst *magr, register struct monst *mdef, boolean qui * In the case of exploding monsters, the monster dies as well. */ int -mattackm(register struct monst *magr, register struct monst *mdef) +mattackm(struct monst *magr, struct monst *mdef) { int i, /* loop counter */ tmp, /* amour class difference */ @@ -568,7 +568,7 @@ mattackm(register struct monst *magr, register struct monst *mdef) /* Returns the result of mdamagem(). */ static int -hitmm(register struct monst *magr, register struct monst *mdef, struct attack *mattk) +hitmm(struct monst *magr, struct monst *mdef, struct attack *mattk) { boolean weaponhit = ((mattk->aatyp == AT_WEAP || (mattk->aatyp == AT_CLAW && otmp))); boolean silverhit = (weaponhit && otmp && objects[otmp->otyp].oc_material == SILVER); @@ -687,7 +687,7 @@ hitmm(register struct monst *magr, register struct monst *mdef, struct attack *m /* Returns the same values as mdamagem(). */ static int -gazemm(register struct monst *magr, register struct monst *mdef, struct attack *mattk) +gazemm(struct monst *magr, struct monst *mdef, struct attack *mattk) { char buf[BUFSZ]; @@ -784,7 +784,7 @@ engulf_target(struct monst *magr, struct monst *mdef) /* Returns the same values as mattackm(). */ static int -gulpmm(register struct monst *magr, register struct monst *mdef, register struct attack *mattk) +gulpmm(struct monst *magr, struct monst *mdef, struct attack *mattk) { xchar ax, ay, dx, dy; int status; @@ -918,7 +918,7 @@ explmm(struct monst *magr, struct monst *mdef, struct attack *mattk) #ifdef WEBB_DISINT static int -defdisintagr(register struct monst *magr, register struct monst *mdef, register struct attack *mattk) +defdisintagr(struct monst *magr, struct monst *mdef, struct attack *mattk) { int tmp=-1; /* -1 a miss, -MM_AGR_DIED aggre died, @@ -1049,7 +1049,7 @@ defdisintagr(register struct monst *magr, register struct monst *mdef, register * See comment at top of mattackm(), for return values. */ static int -mdamagem(register struct monst *magr, register struct monst *mdef, register struct attack *mattk) +mdamagem(struct monst *magr, struct monst *mdef, struct attack *mattk) { struct obj *obj; char buf[BUFSZ]; @@ -1515,7 +1515,7 @@ post_stone: if (mdef->mhp > 0) return 0; case AD_BLND: if (can_blnd(magr, mdef, mattk->aatyp, (struct obj*)0)) { - register unsigned rnd_tmp; + unsigned rnd_tmp; if (vis && mdef->mcansee && canspotmon(mdef)) { pline("%s is blinded.", Monnam(mdef)); @@ -1962,10 +1962,10 @@ mswingsm(struct monst *magr, struct monst *mdef, struct obj *otemp) * handled above. Returns same values as mattackm. */ static int -passivemm(register struct monst *magr, register struct monst *mdef, boolean mhit, int mdead) +passivemm(struct monst *magr, struct monst *mdef, boolean mhit, int mdead) { - register struct permonst *mddat = mdef->data; - register struct permonst *madat = magr->data; + struct permonst *mddat = mdef->data; + struct permonst *madat = magr->data; char buf[BUFSZ]; int i, tmp; diff --git a/src/mhitu.c b/src/mhitu.c index fae7df321..5dcbd4f69 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -100,7 +100,7 @@ missmu(struct monst *mtmp, boolean nearmiss, struct attack *mattk) } static void -mswings(register struct monst *mtmp, register struct obj *otemp) /* monster swings obj */ +mswings(struct monst *mtmp, struct obj *otemp) /* monster swings obj */ { @@ -140,7 +140,7 @@ u_slow_down(void) } static void -wildmiss(register struct monst *mtmp, register struct attack *mattk) /* monster attacked your displaced image */ +wildmiss(struct monst *mtmp, struct attack *mattk) /* monster attacked your displaced image */ { @@ -364,7 +364,7 @@ getmattk(struct monst *magr, struct monst *mdef, int indx, int *prev_result, str * take care of it... */ int -mattacku(register struct monst *mtmp) +mattacku(struct monst *mtmp) { struct attack *mattk, alt_attk; int i, j=0, tmp, sum[NATTK]; @@ -918,7 +918,7 @@ magic_negation(struct monst *mon) * attacking you */ static int -hitmu(register struct monst *mtmp, register struct attack *mattk) +hitmu(struct monst *mtmp, struct attack *mattk) { struct permonst *mdat = mtmp->data; int uncancelled, ptmp; @@ -1232,7 +1232,7 @@ hitmu(register struct monst *mtmp, register struct attack *mattk) break; case AD_LEGS: - { register long side = rn2(2) ? RIGHT_SIDE : LEFT_SIDE; + { long side = rn2(2) ? RIGHT_SIDE : LEFT_SIDE; const char *sidestr = (side == RIGHT_SIDE) ? "right" : "left"; /* This case is too obvious to ignore, but Nethack is not in @@ -1948,7 +1948,7 @@ gulpmu(struct monst *mtmp, struct attack *mattk) struct trap *t = t_at(u.ux, u.uy); int tmp = d((int)mattk->damn, (int)mattk->damd); int tim_tmp; - register struct obj *otmp2; + struct obj *otmp2; int i; boolean physical_damage = FALSE; @@ -2355,7 +2355,7 @@ gazemu(struct monst *mtmp, struct attack *mattk) /* assumes that hero has to see monster's gaze in order to be affected, rather than monster just having to look at hero; - when hallucinating, hero's brain doesn't register what + when hallucinating, hero's brain doesn't what it's seeing correctly so the gaze is usually ineffective [this could be taken a lot farther and select a gaze effect appropriate to what's currently being displayed, giving diff --git a/src/minion.c b/src/minion.c index 0ad99a712..fd2f0e0fd 100644 --- a/src/minion.c +++ b/src/minion.c @@ -155,7 +155,7 @@ msummon(struct monst *mon) void summon_minion(aligntyp alignment, boolean talk) { - register struct monst *mon; + struct monst *mon; int mnum; if (alignment == u.ualign.type) { @@ -227,7 +227,7 @@ summon_minion(aligntyp alignment, boolean talk) /* returns 1 if it won't attack. */ int -demon_talk(register struct monst *mtmp) +demon_talk(struct monst *mtmp) { long cash, demand, offer; diff --git a/src/mklev.c b/src/mklev.c index a5436f6bc..6b17bab61 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -66,7 +66,7 @@ do_comp(const void *vx, const void *vy) */ return (vx == vy) ? 0 : -1; #else - register const struct mkroom *x, *y; + const struct mkroom *x, *y; x = (const struct mkroom *)vx; y = (const struct mkroom *)vy; @@ -78,7 +78,7 @@ do_comp(const void *vx, const void *vy) static void finddpos(coord *cc, xchar xl, xchar yl, xchar xh, xchar yh) { - register xchar x, y; + xchar x, y; x = (xl == xh) ? xl : (xl + rn2(xh-xl+1)); y = (yl == yh) ? yl : (yl + rn2(yh-yl+1)); @@ -112,9 +112,9 @@ sort_rooms(void) } static void -do_room_or_subroom(register struct mkroom *croom, int lowx, int lowy, register int hix, register int hiy, boolean lit, schar rtype, boolean special, boolean is_room) +do_room_or_subroom(struct mkroom *croom, int lowx, int lowy, int hix, int hiy, boolean lit, schar rtype, boolean special, boolean is_room) { - register int x, y; + int x, y; struct rm *lev; /* locations might bump level edges in wall-less rooms */ @@ -179,9 +179,9 @@ do_room_or_subroom(register struct mkroom *croom, int lowx, int lowy, register i void -add_room(register int lowx, register int lowy, register int hix, register int hiy, boolean lit, schar rtype, boolean special) +add_room(int lowx, int lowy, int hix, int hiy, boolean lit, schar rtype, boolean special) { - register struct mkroom *croom; + struct mkroom *croom; croom = &rooms[nroom]; do_room_or_subroom(croom, lowx, lowy, hix, hiy, lit, @@ -192,9 +192,9 @@ add_room(register int lowx, register int lowy, register int hix, register int hi } void -add_subroom(struct mkroom *proom, register int lowx, register int lowy, register int hix, register int hiy, boolean lit, schar rtype, boolean special) +add_subroom(struct mkroom *proom, int lowx, int lowy, int hix, int hiy, boolean lit, schar rtype, boolean special) { - register struct mkroom *croom; + struct mkroom *croom; croom = &subrooms[nsubroom]; do_room_or_subroom(croom, lowx, lowy, hix, hiy, lit, @@ -305,12 +305,12 @@ makerooms(void) } static void -join(register int a, register int b, boolean nxcor) +join(int a, int b, boolean nxcor) { coord cc, tt, org, dest; - register xchar tx, ty, xx, yy; - register struct mkroom *croom, *troom; - register int dx, dy; + xchar tx, ty, xx, yy; + struct mkroom *croom, *troom; + int dx, dy; croom = &rooms[a]; troom = &rooms[b]; @@ -456,10 +456,10 @@ makecorridors(int style) } void -add_door(register int x, register int y, register struct mkroom *aroom) +add_door(int x, int y, struct mkroom *aroom) { - register struct mkroom *broom; - register int tmp; + struct mkroom *broom; + int tmp; aroom->doorct++; broom = aroom+1; @@ -475,7 +475,7 @@ add_door(register int x, register int y, register struct mkroom *aroom) } static void -dosdoor(register xchar x, register xchar y, register struct mkroom *aroom, register int type) +dosdoor(xchar x, xchar y, struct mkroom *aroom, int type) { boolean shdoor = ((*in_rooms(x, y, SHOPBASE)) ? TRUE : FALSE); @@ -530,7 +530,7 @@ dosdoor(register xchar x, register xchar y, register struct mkroom *aroom, regis } static boolean -place_niche(register struct mkroom *aroom, int *dy, int *xx, int *yy) +place_niche(struct mkroom *aroom, int *dy, int *xx, int *yy) { coord dd; @@ -589,11 +589,11 @@ static const char * const hhgtg_engravings[] = { static void makeniche(int trap_type) { - register struct mkroom *aroom; - register struct rm *rm; - register int vct = 8; + struct mkroom *aroom; + struct rm *rm; + int vct = 8; int dy, xx, yy; - register struct trap *ttmp; + struct trap *ttmp; if(doorindex < DOORMAX) while(vct--) { @@ -680,7 +680,7 @@ make_ironbarwalls(int chance) static void make_niches(void) { - register int ct = rnd((nroom>>1) + 1), dep = depth(&u.uz); + int ct = rnd((nroom>>1) + 1), dep = depth(&u.uz); boolean ltptr = (!level.flags.noteleport && dep > 15), vamp = (dep > 5 && dep < 25); @@ -786,9 +786,9 @@ mk_knox_vault(int x, int y, int w, int h) static void makelevel(void) { - register struct mkroom *croom, *troom; - register int tryct; - register int i; + struct mkroom *croom, *troom; + int tryct; + int i; struct monst *tmonst; /* always put a web with a spider */ branch *branchp; int room_threshold, boxtype; @@ -799,7 +799,7 @@ makelevel(void) clear_level_structures(); { - register s_level *slev = Is_special(&u.uz); + s_level *slev = Is_special(&u.uz); /* check for special levels */ #ifdef REINCARNATION @@ -924,7 +924,7 @@ makelevel(void) } { - register int u_depth = depth(&u.uz); + int u_depth = depth(&u.uz); #ifdef WIZARD if(wizard && nh_getenv("SHOPTYPE")) mkroom(SHOPBASE); else @@ -1294,17 +1294,17 @@ topologize(croom, do_ordinary) register struct mkroom *croom; boolean do_ordinary; #else -topologize(register struct mkroom *croom) +topologize(struct mkroom *croom) #endif { - register int x, y, roomno = (croom - rooms) + ROOMOFFSET; - register int lowx = croom->lx, lowy = croom->ly; - register int hix = croom->hx, hiy = croom->hy; + int x, y, roomno = (croom - rooms) + ROOMOFFSET; + int lowx = croom->lx, lowy = croom->ly; + int hix = croom->hx, hiy = croom->hy; #ifdef SPECIALIZATION - register schar rtype = croom->rtype; + schar rtype = croom->rtype; #endif - register int subindex, nsubrooms = croom->nsubrooms; + int subindex, nsubrooms = croom->nsubrooms; /* skip the room if already done; i.e. a shop handled out of order */ /* also skip if this is non-rectangular (it _must_ be done already) */ @@ -1458,9 +1458,9 @@ place_branch( } boolean -bydoor(register xchar x, register xchar y) +bydoor(xchar x, xchar y) { - register int typ; + int typ; if (isok(x+1, y)) { typ = levl[x+1][y].typ; @@ -1483,16 +1483,16 @@ bydoor(register xchar x, register xchar y) /* see whether it is allowable to create a door at [x,y] */ int -okdoor(register xchar x, register xchar y) +okdoor(xchar x, xchar y) { - register boolean near_door = bydoor(x, y); + boolean near_door = bydoor(x, y); return((levl[x][y].typ == HWALL || levl[x][y].typ == VWALL) && doorindex < DOORMAX && !near_door); } void -dodoor(register int x, register int y, register struct mkroom *aroom) +dodoor(int x, int y, struct mkroom *aroom) { if(doorindex >= DOORMAX) { impossible("DOORMAX exceeded?"); @@ -1503,7 +1503,7 @@ dodoor(register int x, register int y, register struct mkroom *aroom) } boolean -occupied(register xchar x, register xchar y) +occupied(xchar x, xchar y) { return((boolean)(t_at(x, y) || IS_FURNITURE(levl[x][y].typ) @@ -1516,7 +1516,7 @@ occupied(register xchar x, register xchar y) /* make a trap somewhere (in croom if mazeflag = 0 && !tm) */ /* if tm != null, make trap at that location */ void -mktrap(register int num, register int mazeflag, register struct mkroom *croom, coord *tm) +mktrap(int num, int mazeflag, struct mkroom *croom, coord *tm) { int kind; coord m; @@ -1671,7 +1671,7 @@ mkstairs(xchar x, xchar y, char up, struct mkroom *croom) } static void -mkfount(register int mazeflag, register struct mkroom *croom) +mkfount(int mazeflag, struct mkroom *croom) { coord m; @@ -1690,7 +1690,7 @@ mkfount(register int mazeflag, register struct mkroom *croom) #ifdef SINKS static void -mksink(register struct mkroom *croom) +mksink(struct mkroom *croom) { coord m; @@ -1706,7 +1706,7 @@ mksink(register struct mkroom *croom) static void -mkaltar(register struct mkroom *croom) +mkaltar(struct mkroom *croom) { coord m; aligntyp al; @@ -1728,8 +1728,8 @@ static void mkgrave(struct mkroom *croom) { coord m; - register int tryct = 0; - register struct obj *otmp; + int tryct = 0; + struct obj *otmp; boolean doobj = !rn2(10); boolean dobell = !rn2(2); @@ -1783,7 +1783,7 @@ mkinvokearea(void) int dist; xchar xmin = inv_pos.x, xmax = inv_pos.x; xchar ymin = inv_pos.y, ymax = inv_pos.y; - register xchar i; + xchar i; pline_The("floor shakes violently under you!"); pline_The("walls around you begin to bend and crumble!"); @@ -1835,7 +1835,7 @@ mkinvpos(xchar x, xchar y, int dist) struct trap *ttmp; struct obj *otmp; boolean make_rocks; - register struct rm *lev = &levl[x][y]; + struct rm *lev = &levl[x][y]; /* clip at existing map borders if necessary */ if (!within_bounded_area(x, y, x_maze_min + 1, y_maze_min + 1, diff --git a/src/mkmap.c b/src/mkmap.c index c249494ab..be78f8b99 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -28,7 +28,7 @@ static int n_loc_filled; static void init_map(schar bg_typ) { - register int i, j; + int i, j; if (bg_typ >= MAX_TYPE) return; @@ -64,7 +64,7 @@ backfill(schar bg_typ, schar filler) static void init_fill(schar bg_typ, schar fg_typ) { - register int i, j; + int i, j; long limit, count; if (fg_typ >= MAX_TYPE) return; @@ -98,7 +98,7 @@ static int dirs[16] = { static void pass_one(schar bg_typ, schar fg_typ) { - register int i, j; + int i, j; short count, dr; for(i=2; i<=WIDTH; i++) @@ -133,7 +133,7 @@ pass_one(schar bg_typ, schar fg_typ) static void pass_two(schar bg_typ, schar fg_typ) { - register int i, j; + int i, j; short count, dr; for(i=2; i<=WIDTH; i++) @@ -157,7 +157,7 @@ pass_two(schar bg_typ, schar fg_typ) static void pass_three(schar bg_typ, schar fg_typ) { - register int i, j; + int i, j; short count, dr; for(i=2; i<=WIDTH; i++) @@ -192,9 +192,9 @@ check_flood_anyroom(int x, int y, schar fg_typ, boolean anyroom) * exactly matching levl[sx][sy].typ and walls are included as well. */ void -flood_fill_rm(int sx, register int sy, register int rmno, boolean lit, boolean anyroom) +flood_fill_rm(int sx, int sy, int rmno, boolean lit, boolean anyroom) { - register int i; + int i; int nx; schar fg_typ = levl[sx][sy].typ; @@ -214,7 +214,7 @@ flood_fill_rm(int sx, register int sy, register int rmno, boolean lit, boolean a levl[i][sy].lit = lit; if(anyroom) { /* add walls to room as well */ - register int ii, jj; + int ii, jj; for(ii= (i == sx ? i-1 : i); ii <= i+1; ii++) for(jj = sy-1; jj <= sy+1; jj++) if(isok(ii, jj) && @@ -296,9 +296,9 @@ wallify_map(void) static void join_map(schar bg_typ, schar fg_typ) { - register struct mkroom *croom, *croom2; + struct mkroom *croom, *croom2; - register int i, j; + int i, j; int sx, sy; coord sm, em; diff --git a/src/mkmaze.c b/src/mkmaze.c index 6c6f6a205..daa2501f4 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -573,7 +573,7 @@ fixup_special(void) /* randomize Sokoban prize */ if (dunlev(&u.uz)==1) { int price=0; - register struct engr *ep; + struct engr *ep; for (ep = head_engr; ep; ep = ep->nxt_engr) { /* Sokoban top levels have no random, burned engravings */ if (ep && ep->engr_txt[0] && ep->engr_type == BURN && @@ -1404,7 +1404,7 @@ walkfrom(int x, int y, schar typ) #endif /* MICRO */ static void -move(register int *x, register int *y, register int dir) +move(int *x, int *y, int dir) { switch(dir) { case 0: --(*y); break; diff --git a/src/mkobj.c b/src/mkobj.c index bb3652071..b0df66595 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -269,8 +269,8 @@ mkobj(char oclass, boolean artif) static void mkbox_cnts(struct obj *box) { - register int n; - register struct obj *otmp; + int n; + struct obj *otmp; box->cobj = (struct obj *) 0; @@ -315,7 +315,7 @@ mkbox_cnts(struct obj *box) (void) stop_timer(REVIVE_MON, obj_to_any(otmp)); } } else { - register int tprob; + int tprob; const struct icp *iprobs = boxiprobs; for (tprob = rnd(100); (tprob -= iprobs->iprob) > 0; iprobs++) @@ -353,8 +353,8 @@ mkbox_cnts(struct obj *box) int rndmonnum(void) { - register struct permonst *ptr; - register int i; + struct permonst *ptr; + int i; unsigned short excludeflags; /* Plan A: get a level-appropriate common monster */ @@ -647,9 +647,9 @@ unknwn_contnr_contents(struct obj *obj) * usage of an object. */ void -bill_dummy_object(register struct obj *otmp) +bill_dummy_object(struct obj *otmp) { - register struct obj *dummy; + struct obj *dummy; long cost = 0L; if (otmp->unpaid) { @@ -1294,7 +1294,7 @@ maybe_adjust_light(struct obj *obj, int old_range) * these routines to make the actual curse/bless state change. */ void -bless(register struct obj *otmp) +bless(struct obj *otmp) { int old_light = 0; @@ -1318,7 +1318,7 @@ bless(register struct obj *otmp) } void -unbless(register struct obj *otmp) +unbless(struct obj *otmp) { int old_light = 0; @@ -1337,7 +1337,7 @@ unbless(register struct obj *otmp) } void -curse(register struct obj *otmp) +curse(struct obj *otmp) { unsigned already_cursed; int old_light = 0; @@ -1380,7 +1380,7 @@ curse(register struct obj *otmp) } void -uncurse(register struct obj *otmp) +uncurse(struct obj *otmp) { int old_light = 0; @@ -1401,7 +1401,7 @@ uncurse(register struct obj *otmp) } void -blessorcurse(register struct obj *otmp, register int chance) +blessorcurse(struct obj *otmp, int chance) { if(otmp->blessed || otmp->cursed) return; @@ -1416,7 +1416,7 @@ blessorcurse(register struct obj *otmp, register int chance) } int -bcsign(register struct obj *otmp) +bcsign(struct obj *otmp) { return(!!otmp->blessed - !!otmp->cursed); } @@ -1444,7 +1444,7 @@ set_bknown( * container's weight. */ int -weight(register struct obj *obj) +weight(struct obj *obj) { int wt = objects[obj->otyp].oc_weight; @@ -1457,7 +1457,7 @@ weight(register struct obj *obj) } if (Is_container(obj) || obj->otyp == STATUE) { struct obj *contents; - register int cwt = 0; + int cwt = 0; if (obj->otyp == STATUE && obj->corpsenm >= LOW_PM) wt = (int)obj->quan * @@ -1529,7 +1529,7 @@ rnd_treesticks_at(int x, int y) struct obj * mkgold(long int amount, int x, int y) { - register struct obj *gold = g_at(x, y); + struct obj *gold = g_at(x, y); if (amount <= 0L) amount = (long)(1 + rnd(level_difficulty()+2) * rnd(30)); @@ -1738,7 +1738,7 @@ mk_named_object(int objtype, struct permonst *ptr, int x, int y, const char *nm) } boolean -is_flammable(register struct obj *otmp) +is_flammable(struct obj *otmp) { int otyp = otmp->otyp; int omat = objects[otyp].oc_material; @@ -1757,7 +1757,7 @@ is_flammable(register struct obj *otmp) } boolean -is_rottable(register struct obj *otmp) +is_rottable(struct obj *otmp) { int otyp = otmp->otyp; @@ -1772,9 +1772,9 @@ is_rottable(register struct obj *otmp) /* put the object at the given location */ void -place_object(register struct obj *otmp, int x, int y) +place_object(struct obj *otmp, int x, int y) { - register struct obj *otmp2 = level.objects[x][y]; + struct obj *otmp2 = level.objects[x][y]; if (!isok(x, y)) { /* validate location */ void VDECL((*func), (const char *, ...)) PRINTF_F(1, 2); @@ -1945,7 +1945,7 @@ obj_timer_checks( #undef ROT_ICE_ADJUSTMENT void -remove_object(register struct obj *otmp) +remove_object(struct obj *otmp) { xchar x = otmp->ox; xchar y = otmp->oy; diff --git a/src/mkroom.c b/src/mkroom.c index e24aec797..6317b62f8 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -32,9 +32,9 @@ static void rest_room(int, struct mkroom *); extern const struct shclass shtypes[]; /* defined in shknam.c */ static boolean -isbig(register struct mkroom *sroom) +isbig(struct mkroom *sroom) { - register int area = (sroom->hx - sroom->lx + 1) + int area = (sroom->hx - sroom->lx + 1) * (sroom->hy - sroom->ly + 1); return((boolean)( area > 20 )); @@ -68,7 +68,7 @@ mkroom(int roomtype) static void mkshop(void) { - register struct mkroom *sroom; + struct mkroom *sroom; int i = -1; #ifdef WIZARD char *ep = (char *)0; /* (init == lint suppression) */ @@ -176,7 +176,7 @@ mkshop(void) } if(i < 0) { /* shoptype not yet determined */ - register int j; + int j; /* pick a shop type at random */ for (j = rnd(100), i = 0; (j -= shtypes[i].prob) > 0; i++) @@ -237,7 +237,7 @@ pick_room(boolean strict) static void mkzoo(int type) { - register struct mkroom *sroom; + struct mkroom *sroom; if ((sroom = pick_room(FALSE)) != 0) { sroom->rtype = type; @@ -267,7 +267,7 @@ void fill_zoo(struct mkroom *sroom) { struct monst *mon; - register int sx, sy, i; + int sx, sy, i; int sh, tx = 0, ty = 0, goldlim = 0, type = sroom->rtype; int rmno = (sroom - rooms) + ROOMOFFSET; coord mm; @@ -510,7 +510,7 @@ mkundead(coord *mm, boolean revive_corpses, int mm_flags) static struct permonst * morguemon(void) { - register int i = rn2(100), hd = rn2(level_difficulty()); + int i = rn2(100), hd = rn2(level_difficulty()); if (hd > 10 && i < 10) { if (Inhell || In_endgame(&u.uz)) { @@ -560,13 +560,13 @@ armorymon(void) static void mkgarden(struct mkroom *croom) /**< NULL == choose random room */ { - register int tryct = 0; + int tryct = 0; boolean maderoom = FALSE; coord pos; - register int i, tried; + int i, tried; while ((tryct++ < 25) && !maderoom) { - register struct mkroom *sroom = croom ? croom : &rooms[rn2(nroom)]; + struct mkroom *sroom = croom ? croom : &rooms[rn2(nroom)]; if (sroom->hx < 0 || (!croom && (sroom->rtype != OROOM || !sroom->rlit || has_upstairs(sroom) || has_dnstairs(sroom)))) @@ -606,8 +606,8 @@ mkgarden(struct mkroom *croom) /**< NULL == choose random room */ static void mkswamp(void) /* Michiel Huisjes & Fred de Wilde */ { - register struct mkroom *sroom; - register int sx, sy, i, eelct = 0; + struct mkroom *sroom; + int sx, sy, i, eelct = 0; for(i=0; i<5; i++) { /* turn up to 5 rooms swampy */ sroom = &rooms[rn2(nroom)]; @@ -671,9 +671,9 @@ shrine_pos(int roomno) static void mktemple(void) { - register struct mkroom *sroom; + struct mkroom *sroom; coord *shrine_spot; - register struct rm *lev; + struct rm *lev; if(!(sroom = pick_room(TRUE))) return; @@ -693,10 +693,10 @@ mktemple(void) } boolean -nexttodoor(register int sx, register int sy) +nexttodoor(int sx, int sy) { - register int dx, dy; - register struct rm *lev; + int dx, dy; + struct rm *lev; for(dx = -1; dx <= 1; dx++) for(dy = -1; dy <= 1; dy++) { if(!isok(sx+dx, sy+dy)) continue; if(IS_DOOR((lev = &levl[sx+dx][sy+dy])->typ) || @@ -707,7 +707,7 @@ nexttodoor(register int sx, register int sy) } boolean -has_dnstairs(register struct mkroom *sroom) +has_dnstairs(struct mkroom *sroom) { if (sroom == dnstairs_room) return TRUE; @@ -717,7 +717,7 @@ has_dnstairs(register struct mkroom *sroom) } boolean -has_upstairs(register struct mkroom *sroom) +has_upstairs(struct mkroom *sroom) { if (sroom == upstairs_room) return TRUE; @@ -727,13 +727,13 @@ has_upstairs(register struct mkroom *sroom) } int -somex(register struct mkroom *croom) +somex(struct mkroom *croom) { return rn1(croom->hx - croom->lx + 1, croom->lx); } int -somey(register struct mkroom *croom) +somey(struct mkroom *croom) { return rn1(croom->hy - croom->ly + 1, croom->ly); } @@ -823,7 +823,7 @@ somexyspace(struct mkroom *croom, coord *pos, int flags) struct mkroom * search_special(schar type) { - register struct mkroom *croom; + struct mkroom *croom; for(croom = &rooms[0]; croom->hx >= 0; croom++) if((type == ANY_TYPE && croom->rtype != OROOM) || diff --git a/src/mon.c b/src/mon.c index 0a9bdbd73..1ba1176e4 100644 --- a/src/mon.c +++ b/src/mon.c @@ -339,9 +339,9 @@ pm_to_cham(int mndx) * etc.... */ static struct obj * -make_corpse(register struct monst *mtmp, unsigned int corpseflags) +make_corpse(struct monst *mtmp, unsigned int corpseflags) { - register struct permonst *mdat = mtmp->data; + struct permonst *mdat = mtmp->data; int num; struct obj *obj = (struct obj *)0; struct obj *otmp = (struct obj *) 0; @@ -552,7 +552,7 @@ make_corpse(register struct monst *mtmp, unsigned int corpseflags) /* check mtmp and water/lava for compatibility, 0 (survived), 1 (died) */ int -minliquid(register struct monst *mtmp) +minliquid(struct monst *mtmp) { boolean inpool, inlava, inswamp, infountain, grounded; @@ -775,8 +775,8 @@ mcalcdistress(void) int movemon(void) { - register struct monst *mtmp, *nmtmp; - register boolean somebody_can_move = FALSE; + struct monst *mtmp, *nmtmp; + boolean somebody_can_move = FALSE; #if 0 /* part of the original warning code which was replaced in 3.3.1 */ warnlevel = 0; @@ -937,9 +937,9 @@ movemon(void) * has young and old forms). */ int -meatmetal(register struct monst *mtmp) +meatmetal(struct monst *mtmp) { - register struct obj *otmp; + struct obj *otmp; struct permonst *ptr; int poly, grow, heal, mstone; @@ -1068,7 +1068,7 @@ meatobj(struct monst *mtmp) /* for gelatinous cubes */ if (mtmp->mhp > mtmp->mhpmax) mtmp->mhp = mtmp->mhpmax; } if (Has_contents(otmp)) { - register struct obj *otmp3; + struct obj *otmp3; /* contents of eaten containers become engulfed; this is arbitrary, but otherwise g.cubes are too powerful */ while ((otmp3 = otmp->cobj) != 0) { @@ -1123,9 +1123,9 @@ meatobj(struct monst *mtmp) /* for gelatinous cubes */ } void -mpickgold(register struct monst *mtmp) +mpickgold(struct monst *mtmp) { - register struct obj *gold; + struct obj *gold; int mat_idx; if ((gold = g_at(mtmp->mx, mtmp->my)) != 0) { @@ -1142,7 +1142,7 @@ mpickgold(register struct monst *mtmp) } boolean -mpickstuff(register struct monst *mtmp, register const char *str) +mpickstuff(struct monst *mtmp, const char *str) { struct obj *otmp, *otmp2, *otmp3; @@ -1214,7 +1214,7 @@ mpickup_obj(struct monst *mtmp, struct obj *otmp) } int -curr_mon_load(register struct monst *mtmp) +curr_mon_load(struct monst *mtmp) { int curload = 0; struct obj *obj; @@ -1229,9 +1229,9 @@ curr_mon_load(register struct monst *mtmp) } int -max_mon_load(register struct monst *mtmp) +max_mon_load(struct monst *mtmp) { - register long maxload; + long maxload; /* Base monster carrying capacity is equal to human maximum * carrying capacity, or half human maximum if not strong. @@ -1373,9 +1373,9 @@ mfndpos(struct monst *mon, coord *poss, long int *info, long int flag) { struct permonst *mdat = mon->data; - register xchar x, y, nx, ny; - register int cnt = 0; - register uchar ntyp; + xchar x, y, nx, ny; + int cnt = 0; + uchar ntyp; uchar nowtyp; boolean wantpool, poolok, lavaok, nodiag, quantumlock; boolean rockok = FALSE, treeok = FALSE, thrudoor; @@ -2111,13 +2111,13 @@ mondead(mtmp) register struct monst *mtmp; #else void -mondead(register struct monst *mtmp) +mondead(struct monst *mtmp) { mondead_helper(mtmp, 0); /* mmm... default parameter values */ } void -mondead_helper(register struct monst *mtmp, uchar adtyp) +mondead_helper(struct monst *mtmp, uchar adtyp) #endif @@ -2486,7 +2486,7 @@ spore_dies(struct monst *mon) /** drop (perhaps) a cadaver and remove monster */ void -mondied(register struct monst *mdef) +mondied(struct monst *mdef) { mondead(mdef); if (!DEADMONSTER(mdef)) { @@ -2612,7 +2612,7 @@ monstone(struct monst *mdef) /* another monster has killed the monster mdef */ void -monkilled(register struct monst *mdef, const char *fltxt, int how) +monkilled(struct monst *mdef, const char *fltxt, int how) { boolean be_sad = FALSE; /* true if unseen pet is killed */ boolean kenny = (!strcmp(m_monnam(mdef), "Kenny")); @@ -2659,7 +2659,7 @@ monkilled(register struct monst *mdef, const char *fltxt, int how) } void -unstuck(register struct monst *mtmp) +unstuck(struct monst *mtmp) { if (u.ustuck == mtmp) { if (u.uswallow) { @@ -2683,7 +2683,7 @@ unstuck(register struct monst *mtmp) } void -killed(register struct monst *mtmp) +killed(struct monst *mtmp) { xkilled(mtmp, XKILL_GIVEMSG); } @@ -2911,7 +2911,7 @@ xkilled( /* changes the monster into a stone monster of the same type */ /* this should only be called when poly_when_stoned() is true */ void -mon_to_stone(register struct monst *mtmp) +mon_to_stone(struct monst *mtmp) { if (mtmp->data->mlet == S_GOLEM) { /* it's a golem, and not a stone golem */ @@ -3507,7 +3507,7 @@ wake_nearto(int x, int y, int distance) /* NOTE: we must check for mimicry before calling this routine */ void -seemimic(register struct monst *mtmp) +seemimic(struct monst *mtmp) { boolean is_blocker_appear = (is_lightblocker_mappear(mtmp)); @@ -3533,7 +3533,7 @@ seemimic(register struct monst *mtmp) void rescham(void) { - register struct monst *mtmp; + struct monst *mtmp; int mcham; for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { @@ -3598,7 +3598,7 @@ restore_cham(struct monst *mon) /* unwatched hiders may hide again; if so, returns True */ static boolean -restrap(register struct monst *mtmp) +restrap(struct monst *mtmp) { struct trap *t; @@ -4319,7 +4319,7 @@ newcham( */ /* former giants can't continue carrying boulders */ if (mtmp->minvent && !throws_rocks(mdat)) { - register struct obj *otmp, *otmp2; + struct obj *otmp, *otmp2; for (otmp = mtmp->minvent; otmp; otmp = otmp2) { otmp2 = otmp->nobj; @@ -4493,7 +4493,7 @@ kill_monster_on_level(int mndx) /**< Monster index number */ } void -golemeffects(register struct monst *mon, int damtype, int dam) +golemeffects(struct monst *mon, int damtype, int dam) { int heal = 0, slow = 0; @@ -4568,7 +4568,7 @@ angry_guards(boolean silent) void pacify_guards(void) { - register struct monst *mtmp; + struct monst *mtmp; for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) continue; diff --git a/src/mondata.c b/src/mondata.c index 7a19b4a09..4914d05e6 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -266,7 +266,7 @@ can_blnd( boolean ranged_attk(struct permonst *ptr) { - register int i, atyp; + int i, atyp; long atk_mask = (1L << AT_BREA) | (1L << AT_SPIT) | (1L << AT_GAZE); /* was: (attacktype(ptr, AT_BREA) || attacktype(ptr, AT_WEAP) || @@ -293,7 +293,7 @@ mon_hates_silver(struct monst *mon) /* returns TRUE if monster is especially affected by silver weapons */ boolean -hates_silver(register struct permonst *ptr) +hates_silver(struct permonst *ptr) { return((boolean)(is_were(ptr) || is_vampire(ptr) || is_demon(ptr) || ptr == &mons[PM_SHADE] || @@ -384,7 +384,7 @@ can_be_strangled(struct monst *mon) /** returns TRUE if monster can track well */ boolean -can_track(register struct permonst *ptr) +can_track(struct permonst *ptr) { if (uwep && uwep->oartifact == ART_EXCALIBUR) return TRUE; @@ -394,7 +394,7 @@ can_track(register struct permonst *ptr) /** creature will slide out of armor */ boolean -sliparm(register struct permonst *ptr) +sliparm(struct permonst *ptr) { return((boolean)(is_whirly(ptr) || ptr->msize <= MZ_SMALL || noncorporeal(ptr))); @@ -402,7 +402,7 @@ sliparm(register struct permonst *ptr) /** creature will break out of armor */ boolean -breakarm(register struct permonst *ptr) +breakarm(struct permonst *ptr) { if (sliparm(ptr)) { return FALSE; @@ -417,7 +417,7 @@ breakarm(register struct permonst *ptr) /** creature sticks other creatures it hits */ boolean -sticks(register struct permonst *ptr) +sticks(struct permonst *ptr) { return((boolean)(dmgtype(ptr, AD_STCK) || dmgtype(ptr, AD_WRAP) || attacktype(ptr, AT_HUGS))); @@ -480,7 +480,7 @@ dmgtype(struct permonst *ptr, int dtyp) /* returns the maximum damage a defender can do to the attacker via * a passive defense */ int -max_passive_dmg(register struct monst *mdef, register struct monst *magr) +max_passive_dmg(struct monst *mdef, struct monst *magr) { int i, dmg = 0, multi2 = 0; uchar adtyp; @@ -633,7 +633,7 @@ same_race(struct permonst *pm1, struct permonst *pm2) int monsndx(struct permonst *ptr) { - register int i; + int i; if (ptr == &upermonst) return PM_PLAYERMON; @@ -670,9 +670,9 @@ name_to_mon(const char *in_str) * This also permits plurals created by adding suffixes such as 's' * or 'es'. Other plurals must still be handled explicitly. */ - register int i; - register int mntmp = NON_PM; - register char *s, *str, *term; + int i; + int mntmp = NON_PM; + char *s, *str, *term; char buf[BUFSZ]; int len, slen; @@ -765,7 +765,7 @@ name_to_mon(const char *in_str) /* end of list */ { 0, NON_PM } }; - register const struct alt_spl *namep; + const struct alt_spl *namep; for (namep = names; namep->name; namep++) if (!strncmpi(str, namep->name, (int)strlen(namep->name))) @@ -773,7 +773,7 @@ name_to_mon(const char *in_str) } for (len = 0, i = LOW_PM; i < NUMMONS; i++) { - register int m_i_len = strlen(mons[i].mname); + int m_i_len = strlen(mons[i].mname); if (m_i_len > len && !strncmpi(mons[i].mname, str, m_i_len)) { if (m_i_len == slen) { mntmp = i; @@ -909,7 +909,7 @@ name_to_monclass(const char *in_str, int *mndx_p) /* returns 3 values (0=male, 1=female, 2=none) */ int -gender(register struct monst *mtmp) +gender(struct monst *mtmp) { if (is_neuter(mtmp->data)) return 2; return mtmp->female; @@ -1029,7 +1029,7 @@ static const short grownups[][2] = { int little_to_big(int montype) { - register int i; + int i; for (i = 0; grownups[i][0] >= LOW_PM; i++) if(montype == grownups[i][0]) return grownups[i][1]; @@ -1039,7 +1039,7 @@ little_to_big(int montype) int big_to_little(int montype) { - register int i; + int i; for (i = 0; grownups[i][0] >= LOW_PM; i++) if(montype == grownups[i][1]) return grownups[i][0]; diff --git a/src/monmove.c b/src/monmove.c index 33cf291b5..1c71a7f50 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -18,7 +18,7 @@ static void share_hp(struct monst* mon1, struct monst* mon2); /* TRUE if mtmp died */ boolean -mb_trapped(register struct monst *mtmp) +mb_trapped(struct monst *mtmp) { if (flags.verbose) { if (cansee(mtmp->mx, mtmp->my) && !Unaware) { @@ -77,7 +77,7 @@ mon_yells(struct monst *mon, const char *shout) } static void -watch_on_duty(register struct monst *mtmp) +watch_on_duty(struct monst *mtmp) { int x, y; @@ -113,7 +113,7 @@ watch_on_duty(register struct monst *mtmp) } int -dochugw(register struct monst *mtmp) +dochugw(struct monst *mtmp) { int x = mtmp->mx, y = mtmp->my; boolean already_saw_mon = !occupation ? 0 : canspotmon(mtmp); @@ -213,7 +213,7 @@ mon_regen(struct monst *mon, boolean digest_meal) * jolted awake. */ static int -disturb(register struct monst *mtmp) +disturb(struct monst *mtmp) { /* * + Ettins are hard to surprise. @@ -322,7 +322,7 @@ monflee(struct monst *mtmp, int fleetime, boolean first, boolean fleemsg) } static void -distfleeck(register struct monst *mtmp, int *inrange, int *nearby, int *scared) +distfleeck(struct monst *mtmp, int *inrange, int *nearby, int *scared) { int seescaryx, seescaryy; boolean sawscary = FALSE, bravegremlin = (rn2(5) == 0); @@ -378,10 +378,10 @@ m_arrival(struct monst *mon) * code. --KAA */ int -dochug(register struct monst *mtmp) +dochug(struct monst *mtmp) { - register struct permonst *mdat; - register int tmp=0; + struct permonst *mdat; + int tmp=0; int inrange, nearby, scared; struct obj *ygold = 0, *lepgold = 0; struct monst* currmon; @@ -591,7 +591,7 @@ dochug(register struct monst *mtmp) (!Conflict || resist(mtmp, RING_CLASS, 0, 0))) { pline("It feels quite soothing."); } else if (!u.uinvulnerable) { - register boolean m_sen = sensemon(mtmp); + boolean m_sen = sensemon(mtmp); if (m_sen || (Blind_telepat && rn2(2)) || !rn2(10)) { int dmg; @@ -777,7 +777,7 @@ static NEARDATA const char boulder_class[] = { ROCK_CLASS, 0 }; static NEARDATA const char gem_class[] = { GEM_CLASS, 0 }; boolean -itsstuck(register struct monst *mtmp) +itsstuck(struct monst *mtmp) { if (sticks(youmonst.data) && mtmp == u.ustuck && !u.uswallow) { pline("%s cannot escape from you!", Monnam(mtmp)); @@ -804,7 +804,7 @@ should_displace(struct monst *mtmp, coord *poss, long int *info, int cnt, xchar int shortest_with_displacing = -1; int shortest_without_displacing = -1; int count_without_displacing = 0; - register int i, nx, ny; + int i, nx, ny; int ndist; for (i = 0; i < cnt; i++) { @@ -874,9 +874,9 @@ m_digweapon_check(struct monst *mtmp, xchar nix, xchar niy) * 3: did not move, and can't do anything else either. */ int -m_move(register struct monst *mtmp, register int after) +m_move(struct monst *mtmp, int after) { - register int appr; + int appr; xchar gx, gy, nix, niy, chcnt; int chi; /* could be schar except for stupid Sun-2 compiler */ boolean likegold=0, likegems=0, likeobjs=0, likemagic=0, conceals=0; @@ -1036,7 +1036,7 @@ m_move(register struct monst *mtmp, register int after) appr = -1; if (!should_see && can_track(ptr)) { - register coord *cp; + coord *cp; cp = gettrack(omx, omy); if (cp) { @@ -1061,7 +1061,7 @@ m_move(register struct monst *mtmp, register int after) * situation where you toss arrows at it and it has nothing * better to do than pick the arrows up. */ - register int pctload = (curr_mon_load(mtmp) * 100) / + int pctload = (curr_mon_load(mtmp) * 100) / max_mon_load(mtmp); /* look for gold or jewels nearby */ @@ -1080,9 +1080,9 @@ m_move(register struct monst *mtmp, register int after) #define SQSRCHRADIUS 5 - { register int minr = SQSRCHRADIUS; /* not too far away */ - register struct obj *otmp; - register int xx, yy; + { int minr = SQSRCHRADIUS; /* not too far away */ + struct obj *otmp; + int xx, yy; int oomx, oomy, lmx, lmy; /* cut down the search radius if it thinks character is closer. */ @@ -1207,10 +1207,10 @@ m_move(register struct monst *mtmp, register int after) if (can_unlock) flag |= UNLOCKDOOR; if (doorbuster) flag |= BUSTDOOR; { - register int i, j, nx, ny, nearer; + int i, j, nx, ny, nearer; int jcnt, cnt; int ndist, nidist; - register coord *mtrk; + coord *mtrk; coord poss[9]; cnt = mfndpos(mtmp, poss, info, flag); @@ -1265,7 +1265,7 @@ nxti: ; } if(mmoved) { - register int j; + int j; if (mmoved==1 && (u.ux != nix || u.uy != niy) && itsstuck(mtmp)) { return(3); @@ -1545,7 +1545,7 @@ nxti: ; /* recompute the likes tests, in case we polymorphed * or if the "likegold" case got taken above */ if (setlikes) { - register int pctload = (curr_mon_load(mtmp) * 100) / + int pctload = (curr_mon_load(mtmp) * 100) / max_mon_load(mtmp); /* look for gold or jewels nearby */ @@ -1665,14 +1665,14 @@ m_move_aggress(struct monst* mtmp, xchar x, xchar y) } boolean -closed_door(register int x, register int y) +closed_door(int x, int y) { return((boolean)(IS_DOOR(levl[x][y].typ) && (levl[x][y].doormask & (D_LOCKED | D_CLOSED)))); } boolean -accessible(register int x, register int y) +accessible(int x, int y) { int levtyp = levl[x][y].typ; @@ -1685,10 +1685,10 @@ accessible(register int x, register int y) /* decide where the monster thinks you are standing */ void -set_apparxy(register struct monst *mtmp) +set_apparxy(struct monst *mtmp) { boolean notseen, gotu; - register int disp, mx = mtmp->mux, my = mtmp->muy; + int disp, mx = mtmp->mux, my = mtmp->muy; long umoney = money_cnt(invent); /* @@ -1722,7 +1722,7 @@ set_apparxy(register struct monst *mtmp) gotu = notseen ? !rn2(3) : Displaced ? !rn2(4) : FALSE; if (!gotu) { - register int try_cnt = 0; + int try_cnt = 0; do { if (++try_cnt > 200) goto found_you; /* punt */ mx = u.ux - disp + rn2(2*disp+1); diff --git a/src/mplayer.c b/src/mplayer.c index 80eb79c3c..cc44e4826 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -39,9 +39,9 @@ static const char *developers[] = { const char * dev_name(void) { - register int i, m = 0, n = SIZE(developers); - register struct monst *mtmp; - register boolean match; + int i, m = 0, n = SIZE(developers); + struct monst *mtmp; + boolean match; do { match = FALSE; @@ -62,7 +62,7 @@ dev_name(void) } static void -get_mplname(register struct monst *mtmp, char *nam) +get_mplname(struct monst *mtmp, char *nam) { boolean fmlkind = is_female(mtmp->data); const char *devnam; @@ -103,9 +103,9 @@ mk_mplayer_armor(struct monst *mon, short int typ) } struct monst * -mk_mplayer(register struct permonst *ptr, xchar x, xchar y, register boolean special) +mk_mplayer(struct permonst *ptr, xchar x, xchar y, boolean special) { - register struct monst *mtmp; + struct monst *mtmp; char nam[PL_NSIZ]; if(!is_mplayer(ptr)) @@ -289,7 +289,7 @@ mk_mplayer(register struct permonst *ptr, xchar x, xchar y, register boolean spe * fill up the overflow. */ void -create_mplayers(register int num, boolean special) +create_mplayers(int num, boolean special) { int pm, x, y; struct monst fakemon; @@ -317,7 +317,7 @@ create_mplayers(register int num, boolean special) } void -mplayer_talk(register struct monst *mtmp) +mplayer_talk(struct monst *mtmp) { static const char *same_class_msg[3] = { "I can't win, and neither will you!", diff --git a/src/mthrowu.c b/src/mthrowu.c index 9ce3a598c..57ad6c9b7 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -112,7 +112,7 @@ thitu( */ static int -drop_throw(register struct obj *obj, boolean ohit, int x, int y) +drop_throw(struct obj *obj, boolean ohit, int x, int y) { int retvalu = 1; int create; @@ -719,7 +719,7 @@ int thrwmm(struct monst *mtmp, struct monst *mtarg) { struct obj *otmp, *mwep; - register xchar x, y; + xchar x, y; boolean ispole; /* Polearms won't be applied by monsters against other monsters */ @@ -969,7 +969,7 @@ thrwmu(struct monst *mtmp) /* monster spits substance at you */ int -spitmu(register struct monst *mtmp, register struct attack *mattk) +spitmu(struct monst *mtmp, struct attack *mattk) { struct obj *otmp; @@ -1017,7 +1017,7 @@ spitmu(register struct monst *mtmp, register struct attack *mattk) /* monster breathes at you (ranged) */ int -breamu(register struct monst *mtmp, register struct attack *mattk) /* monster breathes at you (ranged) */ +breamu(struct monst *mtmp, struct attack *mattk) /* monster breathes at you (ranged) */ { @@ -1116,7 +1116,7 @@ m_lined_up(struct monst *mtarg, struct monst *mtmp) } boolean -lined_up(register struct monst *mtmp) /* is mtmp in position to use ranged attack? */ +lined_up(struct monst *mtmp) /* is mtmp in position to use ranged attack? */ { boolean ignore_boulders; @@ -1138,7 +1138,7 @@ lined_up(register struct monst *mtmp) /* is mtmp in position to use ranged struct obj * m_carrying(struct monst *mtmp, int type) { - register struct obj *otmp; + struct obj *otmp; for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) if (otmp->otyp == type) @@ -1255,7 +1255,7 @@ hit_bars(struct obj **obj_p, int objx, int objy, int barsx, int barsy, boolean y } void -dissolve_bars(register int x, register int y) +dissolve_bars(int x, int y) { levl[x][y].typ = (Is_special(&u.uz) || *in_rooms(x, y, 0)) ? ROOM : CORR; levl[x][y].flags = 0; diff --git a/src/muse.c b/src/muse.c index 9c8d6e763..ea0eafa4c 100644 --- a/src/muse.c +++ b/src/muse.c @@ -1100,7 +1100,7 @@ rnd_defensive_item(struct monst *mtmp) boolean find_offensive(struct monst *mtmp) { - register struct obj *obj; + struct obj *obj; boolean ranged_stuff = lined_up(mtmp); boolean reflection_skip = (Reflecting && rn2(2)); struct obj *helmet = which_armor(mtmp, W_ARMH); @@ -1233,7 +1233,7 @@ find_offensive(struct monst *mtmp) } static int -mbhitm(register struct monst *mtmp, register struct obj *otmp) +mbhitm(struct monst *mtmp, struct obj *otmp) { int tmp; boolean reveal_invis = FALSE; @@ -1317,9 +1317,9 @@ mbhit( int (*fhito)(OBJ_P, OBJ_P), /**< fns called when mon/obj hit */ struct obj *obj) /**< 2nd arg to fhitm/fhito */ { - register struct monst *mtmp; - register struct obj *otmp; - register uchar typ; + struct monst *mtmp; + struct obj *otmp; + uchar typ; int ddx, ddy; bhitpos.x = mon->mx; @@ -1357,7 +1357,7 @@ mbhit( /* modified by GAN to hit all objects */ if (fhito) { int hitanything = 0; - register struct obj *next_obj; + struct obj *next_obj; for(otmp = level.objects[bhitpos.x][bhitpos.y]; otmp; otmp = next_obj) { @@ -1452,7 +1452,7 @@ use_offensive(struct monst *mtmp) case MUSE_SCR_EARTH: { /* TODO: handle steeds */ - register int x, y; + int x, y; /* don't use monster fields after killing it */ boolean confused = (mtmp->mconf ? TRUE : FALSE); int mmx = mtmp->mx, mmy = mtmp->my; @@ -1622,7 +1622,7 @@ rnd_offensive_item(struct monst *mtmp) boolean find_misc(struct monst *mtmp) { - register struct obj *obj; + struct obj *obj; struct permonst *mdat = mtmp->data; int x = mtmp->mx, y = mtmp->my; struct trap *t; @@ -1785,7 +1785,7 @@ use_misc(struct monst *mtmp) mquaffmsg(mtmp, otmp); if (otmp->cursed) { if (Can_rise_up(mtmp->mx, mtmp->my, &u.uz)) { - register int tolev = depth(&u.uz)-1; + int tolev = depth(&u.uz)-1; d_level tolevel; get_level(&tolevel, tolev); diff --git a/src/music.c b/src/music.c index 52ac96e7d..93f033ffb 100644 --- a/src/music.c +++ b/src/music.c @@ -237,7 +237,7 @@ charm_monsters(int distance) void do_earthquake(int force) { - register int x, y; + int x, y; struct monst *mtmp; struct obj *otmp; struct trap *chasm; diff --git a/src/o_init.c b/src/o_init.c index 045743407..ae5e1dd0e 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -105,8 +105,8 @@ shuffle(int o_low, int o_high, boolean domaterial) void init_objects(void) { - register int i, first, last, sum; - register char oclass; + int i, first, last, sum; + char oclass; #ifdef TEXTCOLOR # define COPY_OBJ_DESCR(o_dst, o_src) \ o_dst.oc_descr_idx = o_src.oc_descr_idx, \ @@ -278,8 +278,8 @@ swap_armor( int find_skates(void) { - register int i; - register const char *s; + int i; + const char *s; for (i = SPEED_BOOTS; i <= LEVITATION_BOOTS; i++) if ((s = OBJ_DESCR(objects[i])) != 0 && !strcmp(s, "snow boots")) @@ -299,7 +299,7 @@ oinit(void) void savenames(int fd, int mode) { - register int i; + int i; unsigned int len; if (perform_bwrite(mode)) { @@ -326,9 +326,9 @@ savenames(int fd, int mode) } void -restnames(register int fd) +restnames(int fd) { - register int i; + int i; unsigned int len; mread(fd, (genericptr_t) bases, sizeof bases); @@ -346,10 +346,10 @@ restnames(register int fd) } void -discover_object(register int oindx, boolean mark_as_known, boolean credit_hero) +discover_object(int oindx, boolean mark_as_known, boolean credit_hero) { if (!objects[oindx].oc_name_known) { - register int dindx, acls = objects[oindx].oc_class; + int dindx, acls = objects[oindx].oc_class; /* Loop thru disco[] 'til we find the target (which may have been uname'd) or the next open slot; one or the other will be found @@ -374,11 +374,11 @@ discover_object(register int oindx, boolean mark_as_known, boolean credit_hero) /* if a class name has been cleared, we may need to purge it from disco[] */ void -undiscover_object(register int oindx) +undiscover_object(int oindx) { if (!objects[oindx].oc_name_known) { - register int dindx, acls = objects[oindx].oc_class; - register boolean found = FALSE; + int dindx, acls = objects[oindx].oc_class; + boolean found = FALSE; /* find the object; shift those behind it forward one slot */ for (dindx = bases[acls]; @@ -443,7 +443,7 @@ static short uniq_objs[] = { int dodiscovered(void) /* free after Robert Viduya */ { - register int i, dis; + int i, dis; int ct = 0; char *s, oclass, prev_class, classes[MAXOCLASSES]; winid tmpwin; @@ -722,7 +722,7 @@ doclassdisco(void) void rename_disco(void) { - register int i, dis; + int i, dis; int ct = 0, mn = 0, sl; char *s, oclass, prev_class; winid tmpwin; diff --git a/src/objnam.c b/src/objnam.c index ee713a4c4..40ec63d3a 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -95,7 +95,7 @@ releaseobuf(char *bufp) } char * -obj_typename(register int otyp) +obj_typename(int otyp) { char *buf = nextobuf(); struct objclass *ocl = &objects[otyp]; @@ -970,7 +970,7 @@ erosion_matters(struct obj *obj) } static char * -doname_base(register struct obj *obj, boolean with_price) +doname_base(struct obj *obj, boolean with_price) { boolean ispoisoned = FALSE; boolean weightshown = FALSE; @@ -990,7 +990,7 @@ doname_base(register struct obj *obj, boolean with_price) } } - register char *bp = xname(obj), *tmp; + char *bp = xname(obj), *tmp; int dump_ID_flag = program_state.gameover; /* display ID in addition to appearance */ @@ -1569,14 +1569,14 @@ display_weight(struct obj *obj) /** Wrapper function for vanilla behaviour. */ char * -doname(register struct obj *obj) +doname(struct obj *obj) { return doname_base(obj, FALSE); } /** Name of object including price. */ char * -doname_with_price(register struct obj *obj) +doname_with_price(struct obj *obj) { return doname_base(obj, TRUE); } @@ -1912,7 +1912,7 @@ short_oname(struct obj *obj, char *(*func) (struct obj *), char *(*altfunc) (str * Used if only one of a collection of objects is named (e.g. in eat.c). */ const char * -singular(register struct obj *otmp, char *(*func) (struct obj *)) +singular(struct obj *otmp, char *(*func) (struct obj *)) { long savequan; #ifdef SHOW_WEIGHT @@ -2020,7 +2020,7 @@ the(const char *str) insert_the = TRUE; } else { /* Probably a proper name, might not need an article */ - register char *tmp, *named, *called; + char *tmp, *named, *called; int l; /* some objects have capitalized adjectives in their names */ @@ -2106,7 +2106,7 @@ yobjnam(struct obj *obj, const char *verb) char * Yobjnam2(struct obj *obj, const char *verb) { - register char *s = yobjnam(obj, verb); + char *s = yobjnam(obj, verb); *s = highc(*s); return s; @@ -2259,9 +2259,9 @@ vtense(const char *subj, const char *verb) /* capitalized variant of doname() */ char * -Doname2(register struct obj *obj) +Doname2(struct obj *obj) { - register char *s = doname(obj); + char *s = doname(obj); *s = highc(*s); return(s); @@ -2577,7 +2577,7 @@ char * makeplural(const char *oldstr) { /* Note: cannot use strcmpi here -- it'd give MATZot, CAVEMeN,... */ - register char *spot; + char *spot; char *str = nextobuf(); char lo_c; const char *excess = (char *)0; @@ -2793,7 +2793,7 @@ static NEARDATA const struct o_range o_ranges[] = { char * makesingular(const char *oldstr) { - register char *p, *bp; + char *p, *bp; const char *excess = 0; char *str = nextobuf(); @@ -3116,7 +3116,7 @@ rnd_otyp_by_namedesc( { int i, n = 0; short validobjs[NUM_OBJECTS]; - register const char *zn; + const char *zn; int prob, maxprob = 0; if (!name || !*name) { @@ -3280,7 +3280,7 @@ name_to_otyp(const char *in_str) * return null. */ struct obj * -readobjnam(register char *bp, struct obj *no_wish) +readobjnam(char *bp, struct obj *no_wish) { char *p; int i; @@ -3851,7 +3851,7 @@ readobjnam(register char *bp, struct obj *no_wish) } else if (!strcmpi(bp, "looking glass")) { ; /* avoid false hit on "* glass" */ } else if (!BSTRCMPI(bp, p-6, " glass") || !strcmpi(bp, "glass")) { - register char *g = bp; + char *g = bp; /* treat "broken glass" as a non-existent item; since "broken" is also a chest/box prefix it might have been stripped off above */ @@ -3881,7 +3881,7 @@ readobjnam(register char *bp, struct obj *no_wish) /* check real names of gems first */ if (!oclass && actualn) { for (i = bases[GEM_CLASS]; i <= LAST_GEM; i++) { - register const char *zn; + const char *zn; if ((zn = OBJ_NAME(objects[i])) && !strcmpi(actualn, zn)) { typ = i; diff --git a/src/options.c b/src/options.c index ad9379d28..fcc5d890d 100644 --- a/src/options.c +++ b/src/options.c @@ -1243,7 +1243,7 @@ change_inv_order(char *op) } static void -graphics_opts(register char *opts, const char *optype, int maxlen, int offset) +graphics_opts(char *opts, const char *optype, int maxlen, int offset) { glyph_t translate[MAXPCHARS+1]; int length, i; @@ -1261,7 +1261,7 @@ graphics_opts(register char *opts, const char *optype, int maxlen, int offset) } static void -warning_opts(register char *opts, const char *optype) +warning_opts(char *opts, const char *optype) { uchar translate[MAXPCHARS+1]; int length, i; @@ -1280,7 +1280,7 @@ warning_opts(register char *opts, const char *optype) } void -assign_warnings(register uchar *graph_chars) +assign_warnings(uchar *graph_chars) { int i; for (i = 0; i < WARNCOUNT; i++) @@ -2268,7 +2268,7 @@ common_prefix_options_parser(const char *fullname, char *opts, boolean negated) /* check for "+option1 -option2" */ while (*op) { boolean check = FALSE, value = FALSE; - register char c; + char c; c = *op; if (c == '+') { check = TRUE; @@ -2304,9 +2304,9 @@ common_prefix_options_parser(const char *fullname, char *opts, boolean negated) } boolean -parseoptions(register char *opts, boolean tinitial, boolean tfrom_file) +parseoptions(char *opts, boolean tinitial, boolean tfrom_file) { - register char *op; + char *op; unsigned num; boolean negated; int i; @@ -3468,7 +3468,7 @@ parseoptions(register char *opts, boolean tinitial, boolean tfrom_file) num = 0; prefix_val = -1; while (*op && num < sizeof flags.end_disclose - 1) { - register char c, *dop; + char c, *dop; static char valid_settings[] = { DISCLOSE_PROMPT_DEFAULT_YES, DISCLOSE_PROMPT_DEFAULT_NO, @@ -5597,7 +5597,7 @@ void option_help(void) { char buf[BUFSZ], buf2[BUFSZ]; - register int i; + int i; winid datawin; datawin = create_nhwindow(NHW_TEXT); @@ -5698,8 +5698,8 @@ illegal_menu_cmd_key(char c) int fruitadd(char *str) { - register int i; - register struct fruit *f; + int i; + struct fruit *f; struct fruit *lastf = 0; int highest_fruit_id = 0; char buf[PL_FSIZ]; diff --git a/src/pager.c b/src/pager.c index 063f035a4..a2ffcb38a 100644 --- a/src/pager.c +++ b/src/pager.c @@ -2716,7 +2716,7 @@ doquickwhatis(void) int doidtrap(void) { - register struct trap *trap; + struct trap *trap; int x, y, tt; if (!getdir("^")) return 0; @@ -2750,7 +2750,7 @@ dowhatdoes_core(char q, char *cbuf) { dlb *fp; char bufr[BUFSZ]; - register char *buf = &bufr[6], *ep, ctrl, meta; + char *buf = &bufr[6], *ep, ctrl, meta; fp = dlb_fopen_area(NH_CMDHELPAREA, CMDHELPFILE, "r"); if (!fp) { diff --git a/src/pickup.c b/src/pickup.c index 178b9bdb6..fd573a4c3 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -85,10 +85,10 @@ simple_look( } int -collect_obj_classes(char *ilets, register struct obj *otmp, boolean here, boolean (*filter) (struct obj *), int *itemcount) +collect_obj_classes(char *ilets, struct obj *otmp, boolean here, boolean (*filter) (struct obj *), int *itemcount) { - register int iletct = 0; - register char c; + int iletct = 0; + char c; *itemcount = 0; ilets[iletct] = '\0'; /* terminate ilets so that index() will work */ @@ -279,8 +279,8 @@ rider_corpse_revival(struct obj *obj, boolean remotely) static void check_here(boolean picked_some) { - register struct obj *obj; - register int ct = 0; + struct obj *obj; + int ct = 0; /* count the objects here */ for (obj = level.objects[u.ux][u.uy]; obj; obj = obj->nexthere) { @@ -453,7 +453,7 @@ struct obj *obj; /* query_objlist callback: return TRUE if valid class and worn */ boolean -is_worn_by_type(register struct obj *otmp) +is_worn_by_type(struct obj *otmp) { return (is_worn(otmp) && allow_category(otmp)); } @@ -1847,7 +1847,7 @@ int doloot(void) { struct obj *cobj, *nobj, *otmp; - register int c = -1; + int c = -1; int timepassed = 0; coord cc; boolean underfoot = TRUE; @@ -2088,9 +2088,9 @@ tip_container(struct obj *cobj) int dotip(void) { - register struct obj *cobj, *nobj; - register struct monst *shkp; - register int c = -1; + struct obj *cobj, *nobj; + struct monst *shkp; + int c = -1; coord cc; char qbuf[BUFSZ]; const char tools[] = {TOOL_CLASS, 0}; @@ -2265,7 +2265,7 @@ static NEARDATA struct obj *current_container; /* Returns: -1 to stop, 1 item was inserted, 0 item was not inserted. */ static int -in_container(register struct obj *obj) +in_container(struct obj *obj) { boolean floor_container = !carried(current_container); boolean was_unpaid = FALSE; @@ -2444,9 +2444,9 @@ ck_bag(struct obj *obj) /* Returns: -1 to stop, 1 item was removed, 0 item was not removed. */ static int -out_container(register struct obj *obj) +out_container(struct obj *obj) { - register struct obj *otmp; + struct obj *otmp; boolean is_gold = (obj->oclass == COIN_CLASS); int res, loadlev; long count; diff --git a/src/polyself.c b/src/polyself.c index d7b5bf053..d3d132daa 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -771,7 +771,7 @@ dropp(struct obj *obj) static void break_armor(void) { - register struct obj *otmp; + struct obj *otmp; if (breakarm(youmonst.data)) { if ((otmp = uarm) != 0) { @@ -1017,7 +1017,7 @@ doremove(void) int dospinweb(void) { - register struct trap *ttmp = t_at(u.ux, u.uy); + struct trap *ttmp = t_at(u.ux, u.uy); if (Levitation || Is_airlevel(&u.uz) || Underwater || Is_waterlevel(&u.uz)) { @@ -1152,7 +1152,7 @@ dosummon(void) int dogaze(void) { - register struct monst *mtmp; + struct monst *mtmp; int looked = 0; char qbuf[QBUFSZ]; int i; diff --git a/src/potion.c b/src/potion.c index 7aeeef27b..356e49a23 100644 --- a/src/potion.c +++ b/src/potion.c @@ -437,7 +437,7 @@ ghost_from_bottle(void) int dodrink(void) { - register struct obj *otmp; + struct obj *otmp; const char *potion_descr; if (Strangled) { @@ -516,7 +516,7 @@ dodrink(void) } int -dopotion(register struct obj *otmp) +dopotion(struct obj *otmp) { int retval; @@ -541,9 +541,9 @@ dopotion(register struct obj *otmp) } int -peffects(register struct obj *otmp) +peffects(struct obj *otmp) { - register int i, ii, lim; + int i, ii, lim; switch(otmp->otyp) { case POT_RESTORE_ABILITY: @@ -931,7 +931,7 @@ peffects(register struct obj *otmp) goto_level(&earth_level, FALSE, FALSE, FALSE); #endif } else { - register int newlev = depth(&u.uz)-1; + int newlev = depth(&u.uz)-1; d_level newlevel; get_level(&newlevel, newlev); @@ -1045,7 +1045,7 @@ peffects(register struct obj *otmp) break; case POT_GAIN_ENERGY: /* M. Stephenson */ - { register int num; + { int num; if(otmp->cursed) You_feel("lackluster."); else @@ -1168,7 +1168,7 @@ peffects(register struct obj *otmp) } void -healup(int nhp, int nxtra, register boolean curesick, register boolean cureblind) +healup(int nhp, int nxtra, boolean curesick, boolean cureblind) { if (nhp && !marathon_mode) { if (Upolyd) { @@ -1195,7 +1195,7 @@ healup(int nhp, int nxtra, register boolean curesick, register boolean cureblind } void -strange_feeling(register struct obj *obj, register const char *txt) +strange_feeling(struct obj *obj, const char *txt) { if (flags.beginner || !txt) You("have a %s feeling for a moment, then it passes.", @@ -1525,7 +1525,7 @@ potionhit(struct monst *mon, struct obj *obj, int how) break; case POT_BLINDNESS: if (haseyes(mon->data)) { - register int btmp = 64 + rn2(32) + + int btmp = 64 + rn2(32) + rn2(32) * !resist(mon, POTION_CLASS, 0, NOTELL); btmp += mon->mblinded; mon->mblinded = min(btmp, 127); @@ -1653,9 +1653,9 @@ potionhit(struct monst *mon, struct obj *obj, int how) /* vapors are inhaled or get in your eyes */ void -potionbreathe(register struct obj *obj) +potionbreathe(struct obj *obj) { - register int i, ii, kn = 0; + int i, ii, kn = 0; boolean cureblind = FALSE; /* potion of unholy water might be wielded; prevent @@ -1992,7 +1992,7 @@ get_base_mix_color(struct obj *potion) /** Returns the potion type when object o1 is dipped into object o2 */ short -mixtype(register struct obj *o1, register struct obj *o2) +mixtype(struct obj *o1, struct obj *o2) { /* cut down on the number of cases below */ if (o1->oclass == POTION_CLASS && @@ -2209,7 +2209,7 @@ mixtype(register struct obj *o1, register struct obj *o2) boolean -get_wet(register struct obj *obj) +get_wet(struct obj *obj) /* returns TRUE if something happened (potion should be used up) */ { @@ -2319,7 +2319,7 @@ int dodip(void) { static const char Dip_[] = "Dip "; - register struct obj *potion, *obj; + struct obj *potion, *obj; struct obj *singlepotion; uchar here; char allowall[2]; @@ -2896,7 +2896,7 @@ mongrantswish(struct monst **monp) void -djinni_from_bottle(register struct obj *obj) +djinni_from_bottle(struct obj *obj) { struct monst *mtmp; int chance; diff --git a/src/pray.c b/src/pray.c index 277167aa7..d4cb819fd 100644 --- a/src/pray.c +++ b/src/pray.c @@ -226,7 +226,7 @@ in_trouble(void) static struct obj * worst_cursed_item(void) { - register struct obj *otmp; + struct obj *otmp; /* if strained or worse, check for loadstone first */ if (near_capacity() >= HVY_ENCUMBER) { @@ -283,7 +283,7 @@ worst_cursed_item(void) } static void -fix_worst_trouble(register int trouble) +fix_worst_trouble(int trouble) { int i; struct obj *otmp = 0; @@ -1118,7 +1118,7 @@ pleased(aligntyp g_align) break; case 4: { - register struct obj *otmp; + struct obj *otmp; int any = 0; if (Blind) @@ -1219,8 +1219,8 @@ pleased(aligntyp g_align) static boolean water_prayer(boolean bless_water) { - register struct obj* otmp; - register long changed = 0; + struct obj* otmp; + long changed = 0; boolean other = FALSE, bc_known = !(Blind || Hallucination); for (otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere) { @@ -1275,7 +1275,7 @@ gods_upset(aligntyp g_align) static NEARDATA const char sacrifice_types[] = { FOOD_CLASS, AMULET_CLASS, 0 }; static void -consume_offering(register struct obj *otmp) +consume_offering(struct obj *otmp) { if (Hallucination) switch (rn2(3)) { @@ -1301,7 +1301,7 @@ consume_offering(register struct obj *otmp) int dosacrifice(void) { - register struct obj *otmp; + struct obj *otmp; int value = 0; int pm; aligntyp altaralign = a_align(u.ux, u.uy); @@ -1347,7 +1347,7 @@ dosacrifice(void) #define MAXVALUE 24 /* Highest corpse value (besides Wiz) */ if (otmp->otyp == CORPSE) { - register struct permonst *ptr = &mons[otmp->corpsenm]; + struct permonst *ptr = &mons[otmp->corpsenm]; struct monst *mtmp; extern const int monstr[]; @@ -2236,7 +2236,7 @@ align_gtitle(aligntyp alignment) } void -altar_wrath(register int x, register int y) +altar_wrath(int x, int y) { aligntyp altaralign = a_align(x, y); @@ -2260,7 +2260,7 @@ altar_wrath(register int x, register int y) static boolean blocked_boulder(int dx, int dy) { - register struct obj *otmp; + struct obj *otmp; long count = 0L; for(otmp = level.objects[u.ux+dx][u.uy+dy]; otmp; otmp = otmp->nexthere) { diff --git a/src/priest.c b/src/priest.c index cf2c69b40..31219e9e4 100644 --- a/src/priest.c +++ b/src/priest.c @@ -37,10 +37,10 @@ free_epri(struct monst *mtmp) * Valid returns are 1: moved 0: didn't -1: let m_move do it -2: died. */ int -move_special(register struct monst *mtmp, boolean in_his_shop, schar appr, boolean uondoor, boolean avoid, register xchar omx, register xchar omy, register xchar gx, register xchar gy) +move_special(struct monst *mtmp, boolean in_his_shop, schar appr, boolean uondoor, boolean avoid, xchar omx, xchar omy, xchar gx, xchar gy) { - register xchar nx, ny, nix, niy; - register schar i; + xchar nx, ny, nix, niy; + schar i; schar chcnt, cnt; coord poss[9]; long info[9]; @@ -141,9 +141,9 @@ move_special(register struct monst *mtmp, boolean in_his_shop, schar appr, boole } char -temple_occupied(register char *array) +temple_occupied(char *array) { - register char *ptr; + char *ptr; for (ptr = array; *ptr; ptr++) if (rooms[*ptr - ROOMOFFSET].rtype == TEMPLE) @@ -152,7 +152,7 @@ temple_occupied(register char *array) } static boolean -histemple_at(register struct monst *priest, register xchar x, register xchar y) +histemple_at(struct monst *priest, xchar x, xchar y) { return (boolean) (priest && priest->ispriest && (EPRI(priest)->shroom == *in_rooms(x, y, TEMPLE)) && @@ -178,9 +178,9 @@ inhistemple(struct monst *priest) * pri_move: return 1: moved 0: didn't -1: let m_move do it -2: died */ int -pri_move(register struct monst *priest) +pri_move(struct monst *priest) { - register xchar gx, gy, omx, omy; + xchar gx, gy, omx, omy; schar temple; boolean avoid = TRUE; @@ -380,7 +380,7 @@ has_shrine(struct monst *pri) struct monst * findpriest(char roomno) { - register struct monst *mtmp; + struct monst *mtmp; for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) continue; @@ -393,7 +393,7 @@ findpriest(char roomno) /* called from check_special_room() when the player enters the temple room */ void -intemple(register int roomno) +intemple(int roomno) { struct epri *epri_p; boolean shrined, sanctum, can_speak; @@ -542,7 +542,7 @@ forget_temple_entry(struct monst *priest) } void -priest_talk(register struct monst *priest) +priest_talk(struct monst *priest) { boolean coaligned = p_coaligned(priest); boolean strayed = (u.ualign.record < 0); @@ -654,10 +654,10 @@ priest_talk(register struct monst *priest) } struct monst * -mk_roamer(register struct permonst *ptr, aligntyp alignment, xchar x, xchar y, boolean peaceful) +mk_roamer(struct permonst *ptr, aligntyp alignment, xchar x, xchar y, boolean peaceful) { - register struct monst *roamer; - register boolean coaligned = (u.ualign.type == alignment); + struct monst *roamer; + boolean coaligned = (u.ualign.type == alignment); if (MON_AT(x, y)) (void) rloc(m_at(x, y), FALSE); /* insurance */ @@ -679,7 +679,7 @@ mk_roamer(register struct permonst *ptr, aligntyp alignment, xchar x, xchar y, b } void -reset_hostility(register struct monst *roamer) +reset_hostility(struct monst *roamer) { if (!roamer->isminion) { return; @@ -701,8 +701,8 @@ in_your_sanctuary(struct monst *mon, xchar x, xchar y) /* if non-null, overrides */ { - register char roomno; - register struct monst *priest; + char roomno; + struct monst *priest; if (mon) { if (is_minion(mon->data) || is_rider(mon->data)) return FALSE; @@ -785,7 +785,7 @@ ghod_hitsu(struct monst *priest) void angry_priest(void) { - register struct monst *priest; + struct monst *priest; struct rm *lev; if ((priest = findpriest(temple_occupied(u.urooms))) != 0) { @@ -840,7 +840,7 @@ clearpriests(void) /* munge priest-specific structure when restoring -dlc */ void -restpriest(register struct monst *mtmp, boolean ghostly) +restpriest(struct monst *mtmp, boolean ghostly) { if (u.uz.dlevel) { if (ghostly) diff --git a/src/quest.c b/src/quest.c index 803cdec38..87afa12ea 100644 --- a/src/quest.c +++ b/src/quest.c @@ -282,7 +282,7 @@ chat_with_leader(void) } void -leader_speaks(register struct monst *mtmp) +leader_speaks(struct monst *mtmp) { /* maybe you attacked leader? */ if(!mtmp->mpeaceful) { @@ -343,7 +343,7 @@ chat_with_guardian(void) } static void -prisoner_speaks (register struct monst *mtmp) +prisoner_speaks (struct monst *mtmp) { if (mtmp->data == &mons[PM_PRISONER] && (mtmp->mstrategy & STRAT_WAITMASK)) { @@ -364,7 +364,7 @@ prisoner_speaks (register struct monst *mtmp) } void -quest_chat(register struct monst *mtmp) +quest_chat(struct monst *mtmp) { if (mtmp->m_id == Qstat(leader_m_id)) { chat_with_leader(); @@ -379,7 +379,7 @@ quest_chat(register struct monst *mtmp) } void -quest_talk(register struct monst *mtmp) +quest_talk(struct monst *mtmp) { if (mtmp->m_id == Qstat(leader_m_id)) { leader_speaks(mtmp); diff --git a/src/questpgr.c b/src/questpgr.c index d89192f38..7bb775abe 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -268,7 +268,7 @@ msg_in(struct qtmsg *qtm_list, int msgnum) static void convert_arg(char c) { - register const char *str; + const char *str; switch (c) { diff --git a/src/read.c b/src/read.c index a058ef28a..d86cf4fdb 100644 --- a/src/read.c +++ b/src/read.c @@ -261,8 +261,8 @@ apron_text(struct obj* apron, char* buf) int doread(void) { - register struct obj *scroll; - register boolean confused; + struct obj *scroll; + boolean confused; known = FALSE; if (check_capacity((char *)0)) { @@ -554,7 +554,7 @@ doread(void) } static void -stripspe(register struct obj *obj) +stripspe(struct obj *obj) { if (obj->blessed || obj->spe <= 0) { pline("%s", nothing_happens); @@ -570,14 +570,14 @@ stripspe(register struct obj *obj) } static void -p_glow1(register struct obj *otmp) +p_glow1(struct obj *otmp) { Your("%s %s briefly.", xname(otmp), otense(otmp, Blind ? "vibrate" : "glow")); } static void -p_glow2(register struct obj *otmp, register const char *color) +p_glow2(struct obj *otmp, const char *color) { Your("%s %s%s%s for a moment.", xname(otmp), @@ -621,7 +621,7 @@ is_chargeable(struct obj *obj) void recharge(struct obj *obj, int curse_bless) { - register int n; + int n; boolean is_cursed, is_blessed; is_cursed = curse_bless < 0; @@ -980,7 +980,7 @@ forget_objects(int percent) void forget_map(int howmuch) { - register int zx, zy; + int zx, zy; if (In_sokoban(&u.uz)) return; @@ -1004,7 +1004,7 @@ forget_map(int howmuch) void forget_traps(void) { - register struct trap *trap; + struct trap *trap; /* forget all traps (except the one the hero is in :-) */ for (trap = ftrap; trap; trap = trap->ntrap) @@ -1152,8 +1152,8 @@ undo_flood(int x, int y, genericptr_t roomcnt) static void do_flood(int x, int y, genericptr_t poolcnt) { - register struct monst *mtmp; - register struct trap *ttmp; + struct monst *mtmp; + struct trap *ttmp; if (nexttodoor(x, y) || (rn2(1 + distmin(u.ux, u.uy, x, y))) || (sobj_at(BOULDER, x, y)) || (levl[x][y].typ != ROOM)) @@ -1264,7 +1264,7 @@ seffects(struct obj *sobj) /**< scroll, or fake spellbook object for scroll-like #endif case SCR_ENCHANT_ARMOR: { - register schar s; + schar s; boolean special_armor; boolean same_color; @@ -1489,8 +1489,8 @@ seffects(struct obj *sobj) /**< scroll, or fake spellbook object for scroll-like case SCR_SCARE_MONSTER: case SPE_CAUSE_FEAR: - { register int ct = 0; - register struct monst *mtmp; + { int ct = 0; + struct monst *mtmp; for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) continue; @@ -1524,7 +1524,7 @@ seffects(struct obj *sobj) /**< scroll, or fake spellbook object for scroll-like case SCR_REMOVE_CURSE: case SPE_REMOVE_CURSE: - { register struct obj *obj; + { struct obj *obj; if(confused) if (Hallucination) You_feel("the power of the Force against you!"); @@ -1918,7 +1918,7 @@ seffects(struct obj *sobj) /**< scroll, or fake spellbook object for scroll-like } /* reveal secret doors for uncursed and blessed scrolls */ if (!sobj_cursed) { - register int x, y; + int x, y; for (x = 1; x < COLNO; x++) for (y = 0; y < ROWNO; y++) @@ -2029,7 +2029,7 @@ case SPE_MAGIC_MAPPING: !Is_rogue_level(&u.uz) && #endif (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) { - register int x, y; + int x, y; int boulder_created = 0; /* Identify the scroll */ @@ -2127,7 +2127,7 @@ case SPE_MAGIC_MAPPING: } static void -wand_explode(register struct obj *obj) +wand_explode(struct obj *obj) { obj->in_use = TRUE; /* in case losehp() is fatal */ Your("%s vibrates violently, and explodes!", xname(obj)); @@ -2169,14 +2169,14 @@ set_lit(int x, int y, genericptr_t val) } void -litroom(register boolean on, struct obj *obj) +litroom(boolean on, struct obj *obj) { char is_lit; /* value is irrelevant; we use its address as a `not null' flag for set_lit() */ /* first produce the text (provided you're not blind) */ if(!on) { - register struct obj *otmp; + struct obj *otmp; if (!Blind) { if(u.uswallow) { @@ -2333,7 +2333,7 @@ do_class_genocide() else #ifdef WIZARD /* to aid in topology testing; remove pesky monsters */ if (wizard && buf[0] == '*') { - register struct monst *mtmp, *mtmp2; + struct monst *mtmp, *mtmp2; gonecnt = 0; for (mtmp = fmon; mtmp; mtmp = mtmp2) { @@ -2447,9 +2447,9 @@ do_genocide( /* 5 (4 | 1) = normal genocide from throne */ { char buf[BUFSZ]; - register int i, killplayer = 0; - register int mndx; - register struct permonst *ptr; + int i, killplayer = 0; + int mndx; + struct permonst *ptr; const char *which; const char *on_this_level; @@ -2483,7 +2483,7 @@ do_genocide( #ifdef WIZARD /* to aid in topology testing; remove pesky monsters */ /* copy from do_class_genocide */ if (wizard && buf[0] == '*') { - register struct monst *mtmp, *mtmp2; + struct monst *mtmp, *mtmp2; int gonecnt = 0; for (mtmp = fmon; mtmp; mtmp = mtmp2) { @@ -2637,7 +2637,7 @@ do_genocide( } void -punish(register struct obj *sobj) +punish(struct obj *sobj) { struct obj *otmp; struct obj *reuse_ball = (sobj && sobj->otyp == HEAVY_IRON_BALL) ? sobj : (struct obj *) 0; @@ -3053,8 +3053,8 @@ drop_boulder_on_monster( boolean confused, boolean by_player) /**< is boulder creation caused by player */ { - register struct obj *otmp2; - register struct monst *mtmp2; + struct obj *otmp2; + struct monst *mtmp2; /* Make the object(s) */ otmp2 = mksobj(confused ? ROCK : BOULDER, diff --git a/src/rect.c b/src/rect.c index 1165de041..24e6ec860 100644 --- a/src/rect.c +++ b/src/rect.c @@ -41,9 +41,9 @@ init_rect(void) int get_rect_ind(NhRect *r) { - register NhRect *rectp; - register int lx, ly, hx, hy; - register int i; + NhRect *rectp; + int lx, ly, hx, hy; + int i; lx = r->lx; ly = r->ly; hx = r->hx; hy = r->hy; @@ -61,9 +61,9 @@ get_rect_ind(NhRect *r) NhRect * get_rect(NhRect *r) { - register NhRect *rectp; - register int lx, ly, hx, hy; - register int i; + NhRect *rectp; + int lx, ly, hx, hy; + int i; lx = r->lx; ly = r->ly; hx = r->hx; hy = r->hy; diff --git a/src/region.c b/src/region.c index 756373cfe..f14d1ef0d 100644 --- a/src/region.c +++ b/src/region.c @@ -188,7 +188,7 @@ add_mon_to_reg(NhRegion *reg, struct monst *mon) void remove_mon_from_reg(NhRegion *reg, struct monst *mon) { - register int i; + int i; for (i = 0; i < reg->n_monst; i++) if (reg->monsters[i] == mon->m_id) { @@ -317,7 +317,7 @@ add_region(NhRegion *reg) void remove_region(NhRegion *reg) { - register int i, x, y; + int i, x, y; for (i = 0; i < n_regions; i++) if (regions[i] == reg) @@ -349,7 +349,7 @@ remove_region(NhRegion *reg) void clear_regions(void) { - register int i; + int i; for (i = 0; i < n_regions; i++) free_region(regions[i]); @@ -368,7 +368,7 @@ clear_regions(void) void run_regions(void) { - register int i, j, k; + int i, j, k; int f_indx; /* End of life ? */ @@ -512,7 +512,7 @@ m_in_out_region(struct monst *mon, xchar x, xchar y) void update_player_regions(void) { - register int i; + int i; for (i = 0; i < n_regions; i++) if (!regions[i]->attach_2_u && inside_region(regions[i], u.ux, u.uy)) @@ -527,7 +527,7 @@ update_player_regions(void) void update_monster_region(struct monst *mon) { - register int i; + int i; for (i = 0; i < n_regions; i++) { if (inside_region(regions[i], mon->mx, mon->my)) { @@ -552,7 +552,7 @@ void replace_mon_regions(monold, monnew) struct monst *monold, *monnew; { - register int i; + int i; for (i = 0; i < n_regions; i++) if (mon_in_region(regions[i], monold)) { @@ -568,7 +568,7 @@ void remove_mon_from_regions(mon) struct monst *mon; { - register int i; + int i; for (i = 0; i < n_regions; i++) if (mon_in_region(regions[i], mon)) @@ -584,7 +584,7 @@ struct monst *mon; NhRegion * visible_region_at(xchar x, xchar y) { - register int i; + int i; for (i = 0; i < n_regions; i++) { if (!regions[i]->visible || regions[i]->ttl <= 0) { diff --git a/src/restore.c b/src/restore.c index 43050256d..86b1aeb81 100644 --- a/src/restore.c +++ b/src/restore.c @@ -70,8 +70,8 @@ static NEARDATA long omoves; static void find_lev_obj(void) { - register struct obj *fobjtmp = (struct obj *)0; - register struct obj *otmp; + struct obj *fobjtmp = (struct obj *)0; + struct obj *otmp; int x, y; for(x=0; xnobj; @@ -115,7 +115,7 @@ inven_inuse(boolean quietly) } static void -restlevchn(register int fd) +restlevchn(int fd) { int cnt; s_level *tmplev, *x; @@ -178,7 +178,7 @@ restdamage(int fd, boolean ghostly) } struct lvl_sounds * -rest_lvl_sounds(register int fd) +rest_lvl_sounds(int fd) { int marker; struct lvl_sounds *or = NULL; @@ -203,7 +203,7 @@ rest_lvl_sounds(register int fd) } struct mon_gen_override * -rest_mongen_override(register int fd) +rest_mongen_override(int fd) { int marker; struct mon_gen_override *or = NULL; @@ -286,10 +286,10 @@ restobj(int fd, struct obj *otmp) } static struct obj * -restobjchn(register int fd, boolean ghostly, boolean frozen) +restobjchn(int fd, boolean ghostly, boolean frozen) { - register struct obj *otmp, *otmp2 = 0; - register struct obj *first = (struct obj *) 0; + struct obj *otmp, *otmp2 = 0; + struct obj *first = (struct obj *) 0; int buflen; while (1) { @@ -431,10 +431,10 @@ restmon(int fd, struct monst *mtmp) } static struct monst * -restmonchn(register int fd, boolean ghostly) +restmonchn(int fd, boolean ghostly) { - register struct monst *mtmp, *mtmp2 = 0; - register struct monst *first = (struct monst *) 0; + struct monst *mtmp, *mtmp2 = 0; + struct monst *first = (struct monst *) 0; int offset, buflen; while (1) { @@ -506,7 +506,7 @@ restmonchn(register int fd, boolean ghostly) static struct fruit * loadfruitchn(int fd) { - register struct fruit *flist, *fnext; + struct fruit *flist, *fnext; flist = 0; while (fnext = newfruit(), @@ -520,9 +520,9 @@ loadfruitchn(int fd) } static void -freefruitchn(register struct fruit *flist) +freefruitchn(struct fruit *flist) { - register struct fruit *fnext; + struct fruit *fnext; while (flist) { fnext = flist->nextf; @@ -532,9 +532,9 @@ freefruitchn(register struct fruit *flist) } static void -ghostfruit(register struct obj *otmp) +ghostfruit(struct obj *otmp) { - register struct fruit *oldf; + struct fruit *oldf; for (oldf = oldfruit; oldf; oldf = oldf->nextf) if (oldf->fid == otmp->spe) break; @@ -544,7 +544,7 @@ ghostfruit(register struct obj *otmp) } static boolean -restgamestate(register int fd, unsigned int *stuckid, unsigned int *steedid) +restgamestate(int fd, unsigned int *stuckid, unsigned int *steedid) { /* discover is actually flags.explore */ boolean remember_discover = discover; @@ -651,7 +651,7 @@ restgamestate(register int fd, unsigned int *stuckid, unsigned int *steedid) static void restlevelstate(unsigned int stuckid, unsigned int steedid) { - register struct monst *mtmp; + struct monst *mtmp; if (stuckid) { for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) @@ -679,7 +679,7 @@ restlevelfile( # pragma unused(fd) #endif { - register int nfd; + int nfd; char whynot[BUFSZ]; nfd = create_levelfile(ltmp, whynot); @@ -734,9 +734,9 @@ restlevelfile( } int -dorecover(register int fd) +dorecover(int fd) { - unsigned int stuckid = 0, steedid = 0; /* not a register */ + unsigned int stuckid = 0, steedid = 0; /* not a */ xchar ltmp; int rtmp; struct obj *otmp; @@ -926,8 +926,8 @@ trickery(char *reason) void getlev(int fd, int pid, xchar lev, boolean ghostly) { - register struct trap *trap; - register struct monst *mtmp; + struct trap *trap; + struct monst *mtmp; branch *br; int hpid; xchar dlvl; @@ -1031,7 +1031,7 @@ getlev(int fd, int pid, xchar lev, boolean ghostly) /* regenerate animals while on another level */ if (u.uz.dlevel) { - register struct monst *mtmp2; + struct monst *mtmp2; for (mtmp = fmon; mtmp; mtmp = mtmp2) { mtmp2 = mtmp->nmon; @@ -1115,7 +1115,7 @@ getlev(int fd, int pid, xchar lev, boolean ghostly) break; case BR_PORTAL: /* max of 1 portal per level */ { - register struct trap *ttmp; + struct trap *ttmp; for(ttmp = ftrap; ttmp; ttmp = ttmp->ntrap) if (ttmp->ttyp == MAGIC_PORTAL) break; @@ -1126,7 +1126,7 @@ getlev(int fd, int pid, xchar lev, boolean ghostly) } } else if (!br) { /* Remove any dangling portals. */ - register struct trap *ttmp; + struct trap *ttmp; for (ttmp = ftrap; ttmp; ttmp = ttmp->ntrap) if (ttmp->ttyp == MAGIC_PORTAL) { deltrap(ttmp); @@ -1285,7 +1285,7 @@ register unsigned len; inrunlength--; *(*((char **)&buf))++ = '\0'; } else { - register short ch = mgetc(); + short ch = mgetc(); if (ch < 0) return -1; /*readlen;*/ if ((*(*(char **)&buf)++ = (char)ch) == RLESC) { inrunlength = mgetc(); @@ -1305,9 +1305,9 @@ minit(void) } void -mread(register int fd, register genericptr_t buf, register unsigned int len) +mread(int fd, genericptr_t buf, unsigned int len) { - register int rlen; + int rlen; #if defined(BSD) || defined(ULTRIX) rlen = read(fd, buf, (int) len); diff --git a/src/rip.c b/src/rip.c index 419f2f714..488508566 100644 --- a/src/rip.c +++ b/src/rip.c @@ -73,7 +73,7 @@ static char **rip; static void center(int line, char *text) { - register char *ip, *op; + char *ip, *op; ip = text; op = &rip[line][STONE_LINE_CENT - ((strlen(text)+1)>>1)]; while(*ip) *op++ = *ip++; @@ -83,10 +83,10 @@ center(int line, char *text) void genl_outrip(winid tmpwin, int how) { - register char **dp; - register char *dpx; + char **dp; + char *dpx; char buf[BUFSZ]; - register int x; + int x; int line; rip = dp = (char **) alloc(sizeof(rip_txt)); @@ -125,7 +125,7 @@ genl_outrip(winid tmpwin, int how) /* Put death type on stone */ for (line=DEATH_LINE, dpx = buf; line STONE_LINE_LEN) { diff --git a/src/rnd.c b/src/rnd.c index c5fdad7aa..47a1c4818 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -34,7 +34,7 @@ set_random_state(unsigned int x) } int -rn2(register int x) /**< 0 <= rn2(x) < x */ +rn2(int x) /**< 0 <= rn2(x) < x */ { if (x <= 0) { warning("rn2(%d) attempted", x); @@ -45,10 +45,10 @@ rn2(register int x) /**< 0 <= rn2(x) < x */ } int -rnl(register int x) /**< 0 <= rnl(x) < x; sometimes subtracting Luck */ +rnl(int x) /**< 0 <= rnl(x) < x; sometimes subtracting Luck */ /**< good luck approaches 0, bad luck approaches (x-1) */ { - register int i; + int i; if (x <= 0) { warning("rnl(%d) attempted", x); @@ -67,7 +67,7 @@ rnl(register int x) /**< 0 <= rnl(x) < x; sometimes subtracting Luck */ } int -rnd(register int x) /**< 1 <= rnd(x) <= x */ +rnd(int x) /**< 1 <= rnd(x) <= x */ { if (x <= 0) { @@ -79,10 +79,10 @@ rnd(register int x) /**< 1 <= rnd(x) <= x */ } int -d(register int n, register int x) /**< n <= d(n,x) <= (n*x) */ +d(int n, int x) /**< n <= d(n,x) <= (n*x) */ { - register int tmp = n; + int tmp = n; if (x < 0 || n < 0 || (x == 0 && n != 0)) { warning("d(%d,%d) attempted", n, x); @@ -93,7 +93,7 @@ d(register int n, register int x) /**< n <= d(n,x) <= (n*x) */ } int -rne(register int x) +rne(int x) { int i; @@ -126,8 +126,8 @@ rnz(int i) int x = i; int tmp = 1000; #else - register long x = i; - register long tmp = 1000; + long x = i; + long tmp = 1000; #endif tmp += rn2(1000); tmp *= rne(4); diff --git a/src/rumors.c b/src/rumors.c index 17de91ba0..b764998f9 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -197,7 +197,7 @@ outrumor(int truth, int mechanism) static void init_oracles(dlb *fp) { - register int i; + int i; char line[BUFSZ]; int cnt = 0; @@ -323,7 +323,7 @@ register struct monst *oracl; #endif int -doconsult(register struct monst *oracl) +doconsult(struct monst *oracl) { long umoney = money_cnt(invent); int u_pay, minor_cost = 50, major_cost = 500 + 50 * u.ulevel; diff --git a/src/save.c b/src/save.c index b48bcf2c1..fc2caab22 100644 --- a/src/save.c +++ b/src/save.c @@ -134,7 +134,7 @@ int dosave0(void) { const char *fq_save; - register int fd, ofd; + int fd, ofd; xchar ltmp; d_level uz_save; char whynot[BUFSZ]; @@ -308,7 +308,7 @@ dosave0(void) } static void -savegamestate(register int fd, register int mode) +savegamestate(int fd, int mode) { int uid; #if defined(RECORD_REALTIME) || defined(REALTIME_ON_BOTL) @@ -742,7 +742,7 @@ int fd; genericptr_t loc; register unsigned num; { - register unsigned char *bp = (unsigned char *)loc; + unsigned char *bp = (unsigned char *)loc; if (!compressing) { #ifdef MFLOPPY @@ -822,7 +822,7 @@ bflush(int fd) } void -bwrite(register int fd, register genericptr_t loc, register unsigned int num) +bwrite(int fd, genericptr_t loc, unsigned int num) { boolean failed; @@ -875,7 +875,7 @@ bclose(int fd) #endif /* ZEROCOMP */ static void -savelevchn(register int fd, register int mode) +savelevchn(int fd, int mode) { s_level *tmplev, *tmplev2; int cnt = 0; @@ -922,9 +922,9 @@ savecemetery(int fd, int mode, struct cemetery **cemeteryaddr) } static void -savedamage(register int fd, register int mode) +savedamage(int fd, int mode) { - register struct damage *damageptr, *tmp_dam; + struct damage *damageptr, *tmp_dam; unsigned int xl = 0; damageptr = level.damagelist; @@ -946,7 +946,7 @@ savedamage(register int fd, register int mode) } void -save_mongen_override(register int fd, register struct mon_gen_override *or, register int mode) +save_mongen_override(int fd, struct mon_gen_override *or, int mode) { struct mon_gen_tuple *mt; struct mon_gen_tuple *prev; @@ -979,7 +979,7 @@ save_mongen_override(register int fd, register struct mon_gen_override *or, regi } void -save_lvl_sounds(register int fd, register struct lvl_sounds *or, register int mode) +save_lvl_sounds(int fd, struct lvl_sounds *or, int mode) { int marker = 0; int i; @@ -1052,9 +1052,9 @@ saveobj(int fd, struct obj *otmp) } static void -saveobjchn(register int fd, register struct obj *otmp, register int mode) +saveobjchn(int fd, struct obj *otmp, int mode) { - register struct obj *otmp2; + struct obj *otmp2; int minusone = -1; while (otmp) { @@ -1146,9 +1146,9 @@ savemon(int fd, struct monst *mtmp) } static void -savemonchn(register int fd, register struct monst *mtmp, register int mode) +savemonchn(int fd, struct monst *mtmp, int mode) { - register struct monst *mtmp2; + struct monst *mtmp2; int minusone = -1; while (mtmp) { @@ -1176,10 +1176,10 @@ savemonchn(register int fd, register struct monst *mtmp, register int mode) } static void -savetrapchn(register int fd, register struct trap *trap, register int mode) +savetrapchn(int fd, struct trap *trap, int mode) { static struct trap zerotrap; - register struct trap *trap2; + struct trap *trap2; while (trap) { trap2 = trap->ntrap; @@ -1199,10 +1199,10 @@ savetrapchn(register int fd, register struct trap *trap, register int mode) * level routine marks nonexistent fruits by making the fid negative. */ void -savefruitchn(register int fd, register int mode) +savefruitchn(int fd, int mode) { static struct fruit zerofruit; - register struct fruit *f2, *f1; + struct fruit *f2, *f1; f1 = ffruit; while (f1) { diff --git a/src/shk.c b/src/shk.c index 2e86527e7..b5f24ad81 100644 --- a/src/shk.c +++ b/src/shk.c @@ -151,7 +151,7 @@ money2u(struct monst *mon, long int amount) } static struct monst * -next_shkp(register struct monst *shkp, register boolean withbill) +next_shkp(struct monst *shkp, boolean withbill) { for (; shkp; shkp = shkp->nmon) { if (DEADMONSTER(shkp)) continue; @@ -204,7 +204,7 @@ shkgone(struct monst *mtmp) } void -set_residency(register struct monst *shkp, register boolean zero_out) +set_residency(struct monst *shkp, boolean zero_out) { if (on_level(&(ESHK(shkp)->shoplevel), &u.uz)) rooms[ESHK(shkp)->shoproom - ROOMOFFSET].resident = @@ -212,7 +212,7 @@ set_residency(register struct monst *shkp, register boolean zero_out) } void -replshk(register struct monst *mtmp, register struct monst *mtmp2) +replshk(struct monst *mtmp, struct monst *mtmp2) { rooms[ESHK(mtmp2)->shoproom - ROOMOFFSET].resident = mtmp2; if (inhishop(mtmp) && *u.ushops == ESHK(mtmp)->shoproom) { @@ -263,10 +263,10 @@ clear_unpaid(struct monst *shkp, struct obj *list) /* either you paid or left the shop or the shopkeeper died */ void -setpaid(register struct monst *shkp) +setpaid(struct monst *shkp) { - register struct obj *obj; - register struct monst *mtmp; + struct obj *obj; + struct monst *mtmp; clear_unpaid(shkp, invent); clear_unpaid(shkp, fobj); @@ -296,11 +296,11 @@ setpaid(register struct monst *shkp) } static long -addupbill(register struct monst *shkp) +addupbill(struct monst *shkp) { - register int ct = ESHK(shkp)->billct; - register struct bill_x *bp = ESHK(shkp)->bill_p; - register long total = 0L; + int ct = ESHK(shkp)->billct; + struct bill_x *bp = ESHK(shkp)->bill_p; + long total = 0L; while (ct--) { total += bp->price * bp->bquan; @@ -311,10 +311,10 @@ addupbill(register struct monst *shkp) #ifdef KOPS static void -call_kops(register struct monst *shkp, register boolean nearshop) +call_kops(struct monst *shkp, boolean nearshop) { /* Keystone Kops srt@ucla */ - register boolean nokops; + boolean nokops; char kopname[20]; Strcpy(kopname, "Keystone Kops"); @@ -398,9 +398,9 @@ call_kops(register struct monst *shkp, register boolean nearshop) #ifdef BLACKMARKET void -blkmar_guards(register struct monst *mtmp) +blkmar_guards(struct monst *mtmp) { - register struct monst *mt; + struct monst *mt; boolean mesg_given = FALSE; /* Only give message if assistants peaceful */ static boolean rlock = FALSE; /* Prevent recursive calls (via wakeup) */ @@ -483,9 +483,9 @@ bars_around_portal(boolean removebars) /* x,y is strictly inside shop */ char -inside_shop(register xchar x, register xchar y) +inside_shop(xchar x, xchar y) { - register char rno; + char rno; rno = levl[x][y].roomno; if ((rno < ROOMOFFSET) || levl[x][y].edge || !IS_SHOP(rno-ROOMOFFSET)) @@ -950,7 +950,7 @@ shopper_financial_report(void) } int -inhishop(register struct monst *mtmp) +inhishop(struct monst *mtmp) { struct eshk *eshkp = ESHK(mtmp); @@ -959,7 +959,7 @@ inhishop(register struct monst *mtmp) } struct monst * -shop_keeper(register char rmno) +shop_keeper(char rmno) { struct monst *shkp = rmno >= ROOMOFFSET ? rooms[rmno - ROOMOFFSET].resident : 0; @@ -1001,11 +1001,11 @@ tended_shop(struct mkroom *sroom) } static struct bill_x * -onbill(register struct obj *obj, register struct monst *shkp, register boolean silent) +onbill(struct obj *obj, struct monst *shkp, boolean silent) { if (shkp) { - register struct bill_x *bp = ESHK(shkp)->bill_p; - register int ct = ESHK(shkp)->billct; + struct bill_x *bp = ESHK(shkp)->bill_p; + int ct = ESHK(shkp)->billct; while (--ct >= 0) if (bp->bo_id == obj->o_id) { @@ -1030,9 +1030,9 @@ is_unpaid(struct obj *obj) /* Delete the contents of the given object. */ void -delete_contents(register struct obj *obj) +delete_contents(struct obj *obj) { - register struct obj *curr; + struct obj *curr; while ((curr = obj->cobj) != 0) { obj_extract_self(curr); @@ -1042,11 +1042,11 @@ delete_contents(register struct obj *obj) /* called with two args on merge */ void -obfree(register struct obj *obj, register struct obj *merge) +obfree(struct obj *obj, struct obj *merge) { - register struct bill_x *bp; - register struct bill_x *bpm; - register struct monst *shkp; + struct bill_x *bp; + struct bill_x *bpm; + struct monst *shkp; if (obj->otyp == LEASH && obj->leashmon) o_unleash(obj); if (obj->oclass == FOOD_CLASS) food_disappears(obj); @@ -1133,7 +1133,7 @@ obfree(register struct obj *obj, register struct obj *merge) } static long -check_credit(long int tmp, register struct monst *shkp) +check_credit(long int tmp, struct monst *shkp) { long credit = ESHK(shkp)->credit; @@ -1152,7 +1152,7 @@ check_credit(long int tmp, register struct monst *shkp) } static void -pay(long int tmp, register struct monst *shkp) +pay(long int tmp, struct monst *shkp) { long robbed = ESHK(shkp)->robbed; long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp)); @@ -1170,9 +1170,9 @@ pay(long int tmp, register struct monst *shkp) /* return shkp to home position */ void -home_shk(register struct monst *shkp, register boolean killkops) +home_shk(struct monst *shkp, boolean killkops) { - register xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y; + xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y; (void) mnearto(shkp, x, y, TRUE); level.flags.has_shop = 1; @@ -1190,7 +1190,7 @@ home_shk(register struct monst *shkp, register boolean killkops) static boolean angry_shk_exists(void) { - register struct monst *shkp; + struct monst *shkp; for (shkp = next_shkp(fmon, FALSE); shkp; shkp = next_shkp(shkp->nmon, FALSE)) @@ -1200,16 +1200,16 @@ angry_shk_exists(void) /* remove previously applied surcharge from all billed items */ static void -pacify_shk(register struct monst *shkp) +pacify_shk(struct monst *shkp) { NOTANGRY(shkp) = TRUE; /* make peaceful */ if (ESHK(shkp)->surcharge) { - register struct bill_x *bp = ESHK(shkp)->bill_p; - register int ct = ESHK(shkp)->billct; + struct bill_x *bp = ESHK(shkp)->bill_p; + int ct = ESHK(shkp)->billct; ESHK(shkp)->surcharge = FALSE; while (ct-- > 0) { - register long reduction = (bp->price + 3L) / 4L; + long reduction = (bp->price + 3L) / 4L; bp->price -= reduction; /* undo 33% increase */ bp++; } @@ -1218,16 +1218,16 @@ pacify_shk(register struct monst *shkp) /* add aggravation surcharge to all billed items */ static void -rile_shk(register struct monst *shkp) +rile_shk(struct monst *shkp) { NOTANGRY(shkp) = FALSE; /* make angry */ if (!ESHK(shkp)->surcharge) { - register struct bill_x *bp = ESHK(shkp)->bill_p; - register int ct = ESHK(shkp)->billct; + struct bill_x *bp = ESHK(shkp)->bill_p; + int ct = ESHK(shkp)->billct; ESHK(shkp)->surcharge = TRUE; while (ct-- > 0) { - register long surcharge = (bp->price + 2L) / 3L; + long surcharge = (bp->price + 2L) / 3L; bp->price += surcharge; bp++; } @@ -1250,7 +1250,7 @@ rouse_shk(struct monst *shkp, boolean verbosely) } void -make_happy_shk(register struct monst *shkp, register boolean silentkops) +make_happy_shk(struct monst *shkp, boolean silentkops) { boolean wasmad = ANGRY(shkp); struct eshk *eshkp = ESHK(shkp); @@ -1300,7 +1300,7 @@ make_happy_shoppers(boolean silentkops) } void -hot_pursuit(register struct monst *shkp) +hot_pursuit(struct monst *shkp) { if (!shkp->isshk) return; @@ -1339,11 +1339,11 @@ static const char not_enough_money[] = /* delivers the cheapest item on the list */ static long -cheapest_item(register struct monst *shkp) +cheapest_item(struct monst *shkp) { - register int ct = ESHK(shkp)->billct; - register struct bill_x *bp = ESHK(shkp)->bill_p; - register long gmin = (bp->price * bp->bquan); + int ct = ESHK(shkp)->billct; + struct bill_x *bp = ESHK(shkp)->bill_p; + long gmin = (bp->price * bp->bquan); while (ct--) { if (bp->price * bp->bquan < gmin) @@ -1356,8 +1356,8 @@ cheapest_item(register struct monst *shkp) int dopay(void) { - register struct eshk *eshkp; - register struct monst *shkp; + struct eshk *eshkp; + struct monst *shkp; struct monst *nxtm, *resident; long ltmp; long umoney; @@ -1637,7 +1637,7 @@ dopay(void) tmp = 0; while (tmp < eshkp->billct) { struct obj *otmp; - register struct bill_x *bp = &(eshkp->bill_p[tmp]); + struct bill_x *bp = &(eshkp->bill_p[tmp]); /* find the object on one of the lists */ if ((otmp = bp_to_obj(bp)) != 0) { @@ -1708,14 +1708,14 @@ dopay(void) /* -1 if skip this object */ /* -2 if no money/credit left */ static int -dopayobj(register struct monst *shkp, register struct bill_x *bp, struct obj **obj_p, int which, boolean itemize) +dopayobj(struct monst *shkp, struct bill_x *bp, struct obj **obj_p, int which, boolean itemize) /* 0 => used-up item, 1 => other (unpaid or lost) */ { - register struct obj *obj = *obj_p; + struct obj *obj = *obj_p; long ltmp, quan, save_quan; long umoney = money_cnt(invent); int buy; @@ -2019,7 +2019,7 @@ inherits(struct monst *shkp, int numsk, int croaked, boolean silently) static void set_repo_loc(struct monst *shkp) { - register xchar ox, oy; + xchar ox, oy; struct eshk *eshkp = ESHK(shkp); /* if you're not in this shk's shop room, or if you're in its doorway @@ -2075,10 +2075,10 @@ finish_paybill(void) /* find obj on one of the lists */ static struct obj * -bp_to_obj(register struct bill_x *bp) +bp_to_obj(struct bill_x *bp) { - register struct obj *obj; - register unsigned int id = bp->bo_id; + struct obj *obj; + unsigned int id = bp->bo_id; if (bp->useup) obj = o_on(id, billobjs); @@ -2134,7 +2134,7 @@ oid_price_adjustment(struct obj *obj, unsigned int oid) /** Returns the price of an arbitrary item in the shop. * Returns 0 if the item doesn't belong to a shopkeeper or hero is not in the shop. */ long -get_cost_of_shop_item(register struct obj *obj) +get_cost_of_shop_item(struct obj *obj) { struct monst *shkp; xchar x, y; @@ -2165,7 +2165,7 @@ get_cost( struct obj *obj, struct monst *shkp) /**< if angry, impose a surcharge */ { - register long tmp = getprice(obj, FALSE); + long tmp = getprice(obj, FALSE); if (!tmp) tmp = 5L; /* shopkeeper may notice if the player isn't very knowledgeable - @@ -2306,8 +2306,8 @@ contained_cost(struct obj *obj, struct monst *shkp, long int price, boolean usel long contained_gold(struct obj *obj) { - register struct obj *otmp; - register long value = 0L; + struct obj *otmp; + long value = 0L; /* accumulate contained gold */ for (otmp = obj->cobj; otmp; otmp = otmp->nobj) @@ -2320,9 +2320,9 @@ contained_gold(struct obj *obj) } static void -dropped_container(register struct obj *obj, register struct monst *shkp, register boolean sale) +dropped_container(struct obj *obj, struct monst *shkp, boolean sale) { - register struct obj *otmp; + struct obj *otmp; /* the "top" container is treated in the calling fn */ for (otmp = obj->cobj; otmp; otmp = otmp->nobj) { @@ -2337,9 +2337,9 @@ dropped_container(register struct obj *obj, register struct monst *shkp, registe } void -picked_container(register struct obj *obj) +picked_container(struct obj *obj) { - register struct obj *otmp; + struct obj *otmp; /* the "top" container is treated in the calling fn */ for (otmp = obj->cobj; otmp; otmp = otmp->nobj) { @@ -2391,7 +2391,7 @@ special_stock(struct obj *obj, struct monst *shkp, boolean quietly) /* calculate how much the shk will pay when buying [all of] an object */ static long -set_cost(register struct obj *obj, register struct monst *shkp) +set_cost(struct obj *obj, struct monst *shkp) { long tmp = getprice(obj, TRUE) * obj->quan; @@ -2804,12 +2804,12 @@ append_honorific(char *buf) } void -splitbill(register struct obj *obj, register struct obj *otmp) +splitbill(struct obj *obj, struct obj *otmp) { /* otmp has been split off from obj */ - register struct bill_x *bp; - register long tmp; - register struct monst *shkp = shop_keeper(*u.ushops); + struct bill_x *bp; + long tmp; + struct monst *shkp = shop_keeper(*u.ushops); if (!shkp || !inhishop(shkp)) { warning("splitbill: no resident shopkeeper??"); @@ -2841,12 +2841,12 @@ splitbill(register struct obj *obj, register struct obj *otmp) } static void -sub_one_frombill(register struct obj *obj, register struct monst *shkp) +sub_one_frombill(struct obj *obj, struct monst *shkp) { - register struct bill_x *bp; + struct bill_x *bp; if ((bp = onbill(obj, shkp, FALSE)) != 0) { - register struct obj *otmp; + struct obj *otmp; obj->unpaid = 0; if (bp->bquan > obj->quan) { @@ -2881,9 +2881,9 @@ sub_one_frombill(register struct obj *obj, register struct monst *shkp) /* recursive check of unpaid objects within nested containers. */ void -subfrombill(register struct obj *obj, register struct monst *shkp) +subfrombill(struct obj *obj, struct monst *shkp) { - register struct obj *otmp; + struct obj *otmp; sub_one_frombill(obj, shkp); @@ -2939,7 +2939,7 @@ stolen_container(struct obj *obj, struct monst *shkp, long int price, boolean in } long -stolen_value(register struct obj *obj, register xchar x, register xchar y, register boolean peaceful, register boolean silent) +stolen_value(struct obj *obj, xchar x, xchar y, boolean peaceful, boolean silent) { long value = 0L, gvalue = 0L, billamt = 0L; char roomno = *in_rooms(x, y, SHOPBASE); @@ -3069,9 +3069,9 @@ sellobj_state(int deliberate) auto_credit = FALSE; } void -sellobj(register struct obj *obj, xchar x, xchar y) +sellobj(struct obj *obj, xchar x, xchar y) { - register struct monst *shkp; + struct monst *shkp; struct eshk *eshkp; long ltmp = 0L, cltmp = 0L, gltmp = 0L, offer, shkmoney; boolean saleitem, cgold = FALSE, container = Has_contents(obj); @@ -3418,9 +3418,9 @@ doinvbill(int mode) } static long -getprice(register struct obj *obj, boolean shk_buying) +getprice(struct obj *obj, boolean shk_buying) { - register long tmp = (long) objects[obj->otyp].oc_cost; + long tmp = (long) objects[obj->otyp].oc_cost; if (obj->oartifact) { tmp = arti_cost(obj); @@ -3454,9 +3454,9 @@ getprice(register struct obj *obj, boolean shk_buying) /* shk catches thrown pick-axe */ struct monst * -shkcatch(register struct obj *obj, register xchar x, register xchar y) +shkcatch(struct obj *obj, xchar x, xchar y) { - register struct monst *shkp; + struct monst *shkp; if (!(shkp = shop_keeper(inside_shop(x, y))) || !inhishop(shkp)) return(0); @@ -3487,7 +3487,7 @@ shkcatch(register struct obj *obj, register xchar x, register xchar y) } void -add_damage(register xchar x, register xchar y, long int cost) +add_damage(xchar x, xchar y, long int cost) { struct damage *tmp_dam; char *shops; @@ -3951,16 +3951,16 @@ after_shk_move(struct monst *shkp) /* for use in levl_follower (mondata.c) */ boolean -is_fshk(register struct monst *mtmp) +is_fshk(struct monst *mtmp) { return((boolean)(mtmp->isshk && ESHK(mtmp)->following)); } /* You are digging in the shop. */ void -shopdig(register int fall) +shopdig(int fall) { - register struct monst *shkp = shop_keeper(*u.ushops); + struct monst *shkp = shop_keeper(*u.ushops); int lang; const char *grabs = "grabs"; @@ -4104,11 +4104,11 @@ makekops(coord *mm) void pay_for_damage(const char *dmgstr, boolean cant_mollify) { - register struct monst *shkp = (struct monst *)0; + struct monst *shkp = (struct monst *)0; char shops_affected[5]; - register boolean uinshp = (*u.ushops != '\0'); + boolean uinshp = (*u.ushops != '\0'); char qbuf[80]; - register xchar x, y; + xchar x, y; boolean dugwall = !strcmp(dmgstr, "dig into") || /* wand */ !strcmp(dmgstr, "damage"); /* pick-axe */ boolean animal, pursue; @@ -4292,7 +4292,7 @@ pay_for_damage(const char *dmgstr, boolean cant_mollify) /* called in dokick.c when we kick an object that might be in a store */ boolean -costly_spot(register xchar x, register xchar y) +costly_spot(xchar x, xchar y) { struct monst *shkp; @@ -4312,10 +4312,10 @@ costly_spot(register xchar x, register xchar y) /* called by dotalk(sounds.c) when #chatting; returns obj if location contains shop goods and shopkeeper is willing & able to speak */ struct obj * -shop_object(register xchar x, register xchar y) +shop_object(xchar x, xchar y) { - register struct obj *otmp; - register struct monst *shkp; + struct obj *otmp; + struct monst *shkp; if (!(shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) || !inhishop(shkp)) return (struct obj *)0; @@ -4331,9 +4331,9 @@ shop_object(register xchar x, register xchar y) /* give price quotes for all objects linked to this one (ie, on this spot) */ void -price_quote(register struct obj *first_obj) +price_quote(struct obj *first_obj) { - register struct obj *otmp; + struct obj *otmp; char buf[BUFSZ], price[40]; long cost = 0; int cnt = 0; @@ -4380,10 +4380,10 @@ price_quote(register struct obj *first_obj) } static const char * -shk_embellish(register struct obj *itm, long int cost) +shk_embellish(struct obj *itm, long int cost) { if (!rn2(3)) { - register int o, choice = rn2(5); + int o, choice = rn2(5); if (choice == 0) choice = (cost < 100L ? 1 : cost < 500L ? 2 : 3); switch (choice) { @@ -4427,7 +4427,7 @@ shk_has_leather_jackets(struct monst *shkp) { struct eshk *eshk = ESHK(shkp); struct mkroom *sroom = &rooms[eshk->shoproom - ROOMOFFSET]; - register struct obj *otmp; + struct obj *otmp; int sx, sy; for (sx = sroom->lx; sx <= sroom->hx; sx++) @@ -4481,7 +4481,7 @@ shk_chat(struct monst *shkp) } } } else if (eshk->billct) { - register long total = addupbill(shkp) + eshk->debit; + long total = addupbill(shkp) + eshk->debit; pline("%s %s that your bill comes to %ld %s.", Shknam(shkp), @@ -4525,10 +4525,10 @@ shk_chat(struct monst *shkp) #ifdef KOPS static void -kops_gone(register boolean silent) +kops_gone(boolean silent) { - register int cnt = 0; - register struct monst *mtmp, *mtmp2; + int cnt = 0; + struct monst *mtmp, *mtmp2; for (mtmp = fmon; mtmp; mtmp = mtmp2) { mtmp2 = mtmp->nmon; @@ -4655,11 +4655,11 @@ check_unpaid(struct obj *otmp) } void -costly_gold(register xchar x, register xchar y, register long int amount) +costly_gold(xchar x, xchar y, long int amount) { - register long delta; - register struct monst *shkp; - register struct eshk *eshkp; + long delta; + struct monst *shkp; + struct eshk *eshkp; if (!costly_spot(x, y)) return; /* shkp now guaranteed to exist by costly_spot() */ @@ -4690,10 +4690,10 @@ costly_gold(register xchar x, register xchar y, register long int amount) /* used in domove to block diagonal shop-exit */ /* x,y should always be a door */ boolean -block_door(register xchar x, register xchar y) +block_door(xchar x, xchar y) { - register int roomno = *in_rooms(x, y, SHOPBASE); - register struct monst *shkp; + int roomno = *in_rooms(x, y, SHOPBASE); + struct monst *shkp; if (roomno < 0 || !IS_SHOP(roomno)) return(FALSE); if (!IS_DOOR(levl[x][y].typ)) return(FALSE); @@ -4720,11 +4720,11 @@ block_door(register xchar x, register xchar y) /* used in domove to block diagonal shop-entry */ /* u.ux, u.uy should always be a door */ boolean -block_entry(register xchar x, register xchar y) +block_entry(xchar x, xchar y) { - register xchar sx, sy; - register int roomno; - register struct monst *shkp; + xchar sx, sy; + int roomno; + struct monst *shkp; if (!(IS_DOOR(levl[u.ux][u.uy].typ) && levl[u.ux][u.uy].doormask == D_BROKEN)) return(FALSE); diff --git a/src/shknam.c b/src/shknam.c index 3da21367b..38cf7babe 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -285,7 +285,7 @@ const struct shclass shtypes[] = { void shop_selection_init(void) { - register int i, j, item_prob, shop_prob; + int i, j, item_prob, shop_prob; for (shop_prob = 0, i = 0; i < SIZE(shtypes)-1; i++) { shop_prob += shtypes[i].prob; @@ -475,7 +475,7 @@ free_eshk(struct monst *mtmp) static int shkinit(const struct shclass *shp, struct mkroom *sroom) { - register int sh, sx, sy; + int sh, sx, sy; struct monst *shk; struct eshk *eshkp; long shkmoney; /* Temporary placeholder for Shopkeeper's initial capital */ @@ -509,7 +509,7 @@ shkinit(const struct shclass *shp, struct mkroom *sroom) /* Said to happen sometimes, but I have never seen it. */ /* Supposedly fixed by fdoor change in mklev.c */ if(wizard) { - register int j = sroom->doorct; + int j = sroom->doorct; pline("Where is shopdoor?"); pline("Room at (%d,%d),(%d,%d).", @@ -598,7 +598,7 @@ shkinit(const struct shclass *shp, struct mkroom *sroom) #ifdef BLACKMARKET /* One-eyed Sam already got her equipment in makemon */ if (Is_blackmarket(&u.uz) && sroom->rtype != BLACKSHOP) { - register struct obj *otmp; + struct obj *otmp; /* black marketeer's equipment */ otmp = mksobj(LONG_SWORD, FALSE, FALSE); mpickobj(shk, otmp); @@ -652,7 +652,7 @@ stock_room_goodpos(struct mkroom *sroom, int rmno, int sh, int sx, int sy) /* stock a newly-created room with objects */ void -stock_room(int shp_indx, register struct mkroom *sroom) +stock_room(int shp_indx, struct mkroom *sroom) { /* * Someday soon we'll dispatch on the shdist field of shclass to do @@ -685,7 +685,7 @@ stock_room(int shp_indx, register struct mkroom *sroom) levl[sx][sy].doormask = D_LOCKED; if(levl[sx][sy].doormask == D_LOCKED) { - register int m = sx, n = sy; + int m = sx, n = sy; if(inside_shop(sx+1, sy)) m--; else if(inside_shop(sx-1, sy)) m++; @@ -745,7 +745,7 @@ stock_room(int shp_indx, register struct mkroom *sroom) #ifdef BLACKMARKET /* stock a newly-created black market with objects */ static void -stock_blkmar(const struct shclass *shp UNUSED, register struct mkroom *sroom, register int sh) +stock_blkmar(const struct shclass *shp UNUSED, struct mkroom *sroom, int sh) { /* * Someday soon we'll dispatch on the shdist field of shclass to do @@ -753,7 +753,7 @@ stock_blkmar(const struct shclass *shp UNUSED, register struct mkroom *sroom, re * shop-style placement (all squares except a row nearest the first * door get objects). */ - /* [max] removed register int cl, char buf[bufsz] */ + /* [max] removed int cl, char buf[bufsz] */ int i, sx, sy, first = 0, next = 0, total, partial; /* int blkmar_gen[NUM_OBJECTS+2]; */ int *clp, *lastclp; @@ -842,7 +842,7 @@ int get_shop_item(int type) { const struct shclass *shp = shtypes+type; - register int i, j; + int i, j; /* select an appropriate object type at random */ for(j = rnd(100), i = 0; (j -= shp->iprobs[i].iprob) > 0; i++) diff --git a/src/sit.c b/src/sit.c index bee4067b2..5f9e9b72b 100644 --- a/src/sit.c +++ b/src/sit.c @@ -62,7 +62,7 @@ dosit(void) if (OBJ_AT(u.ux, u.uy) && /* ensure we're not standing on the precipice */ !(uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) { - register struct obj *obj; + struct obj *obj; obj = level.objects[u.ux][u.uy]; if (youmonst.data->mlet == S_DRAGON && obj->oclass == COIN_CLASS) { diff --git a/src/sounds.c b/src/sounds.c index ab2fda116..d09b7e0f1 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -28,8 +28,8 @@ mon_in_room(struct monst *mon, int rmtyp) void dosounds(void) { - register struct mkroom *sroom; - register int hallu, vx, vy; + struct mkroom *sroom; + int hallu, vx, vy; #if defined(AMIGA) && defined(AZTEC_C_WORKAROUND) int xx; #endif @@ -408,7 +408,7 @@ static const char * const h_sounds[] = { }; const char * -growl_sound(register struct monst *mtmp) +growl_sound(struct monst *mtmp) { const char *ret; @@ -450,9 +450,9 @@ growl_sound(register struct monst *mtmp) /* the sounds of a seriously abused pet, including player attacking it */ void -growl(register struct monst *mtmp) +growl(struct monst *mtmp) { - register const char *growl_verb = 0; + const char *growl_verb = 0; if (mtmp->msleeping || !mtmp->mcanmove || !mtmp->data->msound) return; @@ -471,9 +471,9 @@ growl(register struct monst *mtmp) /* the sounds of mistreated pets */ void -yelp(register struct monst *mtmp) +yelp(struct monst *mtmp) { - register const char *yelp_verb = 0; + const char *yelp_verb = 0; if (mtmp->msleeping || !mtmp->mcanmove || !mtmp->data->msound) return; @@ -511,9 +511,9 @@ yelp(register struct monst *mtmp) /* the sounds of distressed pets */ void -whimper(register struct monst *mtmp) +whimper(struct monst *mtmp) { - register const char *whimper_verb = 0; + const char *whimper_verb = 0; if (mtmp->msleeping || !mtmp->mcanmove || !mtmp->data->msound) return; @@ -542,7 +542,7 @@ whimper(register struct monst *mtmp) /* pet makes "I'm hungry" noises */ void -beg(register struct monst *mtmp) +beg(struct monst *mtmp) { if (mtmp->msleeping || !mtmp->mcanmove || !(carnivorous(mtmp->data) || herbivorous(mtmp->data))) @@ -580,7 +580,7 @@ mon_is_gecko(struct monst *mon) } static int -domonnoise(register struct monst *mtmp) +domonnoise(struct monst *mtmp) { const char *pline_msg = 0; /* Monnam(mtmp) will be prepended */ const char *verbl_msg = 0; /* verbalize() */ diff --git a/src/sp_lev.c b/src/sp_lev.c index ea2e6d164..18f97ae2c 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -862,7 +862,7 @@ flip_level_rnd(int flp) static void set_wall_property(xchar x1, xchar y1, xchar x2, xchar y2, int prop) { - register xchar x, y; + xchar x, y; struct rm *lev; x1 = max(x1, 1); @@ -1121,7 +1121,7 @@ get_location(schar *x, schar *y, int humidity, struct mkroom *croom) if (is_ok_location(*x, *y, humidity)) break; } while (++cpt < 100); if (cpt >= 100) { - register int xx, yy; + int xx, yy; /* last try */ for (xx = 0; xx < sx; xx++) @@ -1150,9 +1150,9 @@ found_it:; } static boolean -is_ok_location(register schar x, register schar y, register int humidity) +is_ok_location(schar x, schar y, int humidity) { - register int typ; + int typ; if (Is_waterlevel(&u.uz)) return TRUE; /* accept any spot */ @@ -1242,7 +1242,7 @@ static void get_free_room_loc(schar *x, schar *y, struct mkroom *croom, long int pos) { schar try_x, try_y; - register int trycnt = 0; + int trycnt = 0; get_location_coord(&try_x, &try_y, DRY, croom, pos); if (levl[try_x][try_y].typ != ROOM) { @@ -1260,8 +1260,8 @@ get_free_room_loc(schar *x, schar *y, struct mkroom *croom, long int pos) boolean check_room(xchar *lowx, xchar *ddx, xchar *lowy, xchar *ddy, boolean vault) { - register int x, y, hix = *lowx + *ddx, hiy = *lowy + *ddy; - register struct rm *lev; + int x, y, hix = *lowx + *ddx, hiy = *lowy + *ddy; + struct rm *lev; int xlim, ylim, ymax; xchar s_lowx, s_ddx, s_lowy, s_ddy; @@ -1573,7 +1573,7 @@ create_door(room_door *dd, struct mkroom *broom) } do { - register int dwall, dpos; + int dwall, dpos; dwall = dd->wall; if (dwall == -1) /* The wall is RANDOM */ @@ -2506,7 +2506,7 @@ dig_corridor(coord *org, coord *dest, boolean nxcor, schar ftyp, schar btyp) /* do we have to change direction ? */ if(dy && dix > diy) { - register int ddx = (xx > tx) ? -1 : 1; + int ddx = (xx > tx) ? -1 : 1; crm = &levl[xx+ddx][yy]; if(crm->typ == btyp || crm->typ == ftyp || crm->typ == SCORR) { @@ -2515,7 +2515,7 @@ dig_corridor(coord *org, coord *dest, boolean nxcor, schar ftyp, schar btyp) continue; } } else if(dx && diy > dix) { - register int ddy = (yy > ty) ? -1 : 1; + int ddy = (yy > ty) ? -1 : 1; crm = &levl[xx][yy+ddy]; if(crm->typ == btyp || crm->typ == ftyp || crm->typ == SCORR) { @@ -2739,10 +2739,10 @@ build_room(room *r, struct mkroom *mkr) static void light_region(region *tmpregion) { - register boolean litstate = tmpregion->rlit ? 1 : 0; - register int hiy = tmpregion->y2; - register int x, y; - register struct rm *lev; + boolean litstate = tmpregion->rlit ? 1 : 0; + int hiy = tmpregion->y2; + int x, y; + struct rm *lev; int lowy = tmpregion->y1; int lowx = tmpregion->x1, hix = tmpregion->x2; @@ -2800,7 +2800,7 @@ wallify_map(int x1, int y1, int x2, int y2) static void maze1xy(coord *m, int humidity) { - register int x, y, tryct = 2000; + int x, y, tryct = 2000; /* tryct: normally it won't take more than ten or so tries due to the circumstances under which we'll be called, but the `humidity' screening might drastically change the chances */ @@ -4974,7 +4974,7 @@ spo_region(struct sp_coder *coder) { struct opvar *rtype, *rlit, *flags, *area; xchar dx1, dy1, dx2, dy2; - register struct mkroom *troom; + struct mkroom *troom; boolean prefilled, room_not_needed, irregular, joined; if (!OV_pop_i(flags) || diff --git a/src/spell.c b/src/spell.c index 0f3cefaea..195f9952b 100644 --- a/src/spell.c +++ b/src/spell.c @@ -187,8 +187,8 @@ deadbook(struct obj *book2) /* KMH -- Need ->known to avoid "_a_ Book of the Dead" */ book2->known = 1; if(invocation_pos(u.ux, u.uy) && !On_stairs(u.ux, u.uy)) { - register struct obj *otmp; - register boolean arti1_primed = FALSE, arti2_primed = FALSE, + struct obj *otmp; + boolean arti1_primed = FALSE, arti2_primed = FALSE, arti_cursed = FALSE; if(book2->cursed) { @@ -384,10 +384,10 @@ learn(void) } int -study_book(register struct obj *spellbook) +study_book(struct obj *spellbook) { - register int booktype = spellbook->otyp; - register boolean confused = (Confusion != 0); + int booktype = spellbook->otyp; + boolean confused = (Confusion != 0); boolean too_hard = FALSE; if (delay && !confused && spellbook == book && diff --git a/src/steal.c b/src/steal.c index c99f55670..1fab148d6 100644 --- a/src/steal.c +++ b/src/steal.c @@ -8,7 +8,7 @@ static int stealarm(void); static const char *equipname(struct obj *); static const char * -equipname(register struct obj *otmp) +equipname(struct obj *otmp) { return ( (otmp == uarmu) ? "shirt" : @@ -53,7 +53,7 @@ somegold(long int lmoney) Deals in gold only, as leprechauns don't care for lesser coins. */ struct obj * -findgold(register struct obj *chain) +findgold(struct obj *chain) { while (chain && chain->otyp != GOLD_PIECE) chain = chain->nobj; return chain; @@ -63,11 +63,11 @@ findgold(register struct obj *chain) Steal gold coins only. Leprechauns don't care for lesser coins. */ void -stealgold(register struct monst *mtmp) +stealgold(struct monst *mtmp) { - register struct obj *fgold = g_at(u.ux, u.uy); - register struct obj *ygold; - register long tmp; + struct obj *fgold = g_at(u.ux, u.uy); + struct obj *ygold; + long tmp; struct monst *who; const char *whose, *what; @@ -134,8 +134,8 @@ unsigned int stealmid; /* monster doing the stealing */ static int stealarm(void) { - register struct monst *mtmp; - register struct obj *otmp; + struct monst *mtmp; + struct obj *otmp; for(otmp = invent; otmp; otmp = otmp->nobj) { if(otmp->o_id == stealoid) { @@ -463,7 +463,7 @@ steal(struct monst *mtmp, char *objnambuf) /* Returns 1 if otmp is free'd, 0 otherwise. */ int -mpickobj(register struct monst *mtmp, register struct obj *otmp) +mpickobj(struct monst *mtmp, struct obj *otmp) { int freed_otmp; boolean snuff_otmp = FALSE; diff --git a/src/teleport.c b/src/teleport.c index 12ca2bb39..77470b244 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -193,7 +193,7 @@ goodpos(int x, int y, struct monst *mtmp, unsigned int gpflags) * Return TRUE and the position chosen when successful, FALSE otherwise. */ boolean -enexto(coord *cc, register xchar xx, register xchar yy, struct permonst *mdat) +enexto(coord *cc, xchar xx, xchar yy, struct permonst *mdat) { return enexto_core(cc, xx, yy, mdat, NO_MM_FLAGS); } @@ -333,7 +333,7 @@ coord epathto_debug_cc[100]; #endif int -epathto(coord *cc, int nc, register xchar xx, register xchar yy, struct permonst *mdat) +epathto(coord *cc, int nc, xchar xx, xchar yy, struct permonst *mdat) { int i, j, dir, ndirs, xy, x, y, r; int path_len, postype; @@ -481,7 +481,7 @@ tele_jump_ok(int x1, int y1, int x2, int y2) } static boolean -teleok(register int x, register int y, boolean trapok) +teleok(int x, int y, boolean trapok) { if (!trapok) { /* allow teleportation onto vibrating square, it's not a real trap */ @@ -498,7 +498,7 @@ teleok(register int x, register int y, boolean trapok) } void -teleds(register int nux, register int nuy, boolean allow_drag) +teleds(int nux, int nuy, boolean allow_drag) { if (u.utraptype == TT_BURIEDBALL) { /* unearth it */ @@ -633,7 +633,7 @@ teleds(register int nux, register int nuy, boolean allow_drag) boolean safe_teleds(boolean allow_drag) { - register int nux, nuy, tcnt = 0; + int nux, nuy, tcnt = 0; do { nux = rnd(COLNO-1); @@ -650,7 +650,7 @@ safe_teleds(boolean allow_drag) static void vault_tele(void) { - register struct mkroom *croom = search_special(VAULT); + struct mkroom *croom = search_special(VAULT); coord c; if (croom && somexy(croom, &c) && teleok(c.x, c.y, FALSE)) { @@ -661,9 +661,9 @@ vault_tele(void) } boolean -teleport_pet(register struct monst *mtmp, boolean force_it) +teleport_pet(struct monst *mtmp, boolean force_it) { - register struct obj *otmp; + struct obj *otmp; if (mtmp == u.usteed) return (FALSE); @@ -893,7 +893,7 @@ dotele(boolean break_the_rules) /**< TRUE: wizard mode ^T */ } if (!trap) { boolean castit = FALSE; - register int sp_no = 0, energy = 0; + int sp_no = 0, energy = 0; if (!Teleportation || (u.ulevel < (Role_if(PM_WIZARD) ? 8 : 12) && !can_teleport(youmonst.data))) { @@ -990,7 +990,7 @@ dotele(boolean break_the_rules) /**< TRUE: wizard mode ^T */ void level_tele(void) { - register int newlev; + int newlev; d_level newlevel; const char *escape_by_flying = 0; /* when surviving dest of -N */ char buf[BUFSZ]; @@ -1274,7 +1274,7 @@ level_tele(void) } void -domagicportal(register struct trap *ttmp) +domagicportal(struct trap *ttmp) { struct d_level target_level; @@ -1364,11 +1364,11 @@ level_tele_trap(struct trap *trap, unsigned int trflags) /* check whether monster can arrive at location via Tport (or fall) */ static boolean -rloc_pos_ok(register int x, register int y, struct monst *mtmp) +rloc_pos_ok(int x, int y, struct monst *mtmp) /* coordinates of candidate location */ { - register int xx, yy; + int xx, yy; if (!goodpos(x, y, mtmp, 0)) return FALSE; /* @@ -1428,9 +1428,9 @@ rloc_pos_ok(register int x, register int y, struct monst *mtmp) * the worm. */ void -rloc_to(struct monst *mtmp, register int x, register int y) +rloc_to(struct monst *mtmp, int x, int y) { - register int oldx = mtmp->mx, oldy = mtmp->my; + int oldx = mtmp->mx, oldy = mtmp->my; boolean resident_shk = mtmp->isshk && inhishop(mtmp); if (x == mtmp->mx && y == mtmp->my && m_at(x, y) == mtmp) { @@ -1480,7 +1480,7 @@ rloc(struct monst *mtmp, boolean suppress_impossible) /* mx==0 implies migrating monster arrival */ { - register int x, y, trycount; + int x, y, trycount; if (mtmp == u.usteed) { tele(); @@ -1682,9 +1682,9 @@ mlevel_tele_trap(struct monst *mtmp, struct trap *trap, boolean force_it, int in /* place object randomly, returns False if it's gone (eg broken) */ boolean -rloco(register struct obj *obj) +rloco(struct obj *obj) { - register xchar tx, ty, otx, oty; + xchar tx, ty, otx, oty; boolean restricted_fall; int try_limit = 4000; diff --git a/src/timeout.c b/src/timeout.c index 5308a73c3..ddec7d7cc 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -109,7 +109,7 @@ static NEARDATA const char * const stoned_texts[] = { static void stoned_dialogue(void) { - register long i = (Stoned & TIMEOUT); + long i = (Stoned & TIMEOUT); if (i > 0L && i <= SIZE(stoned_texts)) { char buf[BUFSZ]; @@ -290,7 +290,7 @@ static NEARDATA const char * const choke_texts2[] = { static void choke_dialogue(void) { - register long i = (Strangled & TIMEOUT); + long i = (Strangled & TIMEOUT); if(i > 0 && i <= SIZE(choke_texts)) { if (Breathless || !rn2(50)) @@ -382,7 +382,7 @@ static NEARDATA const char * const slime_texts[] = { static void slime_dialogue(void) { - register long i = (Slimed & TIMEOUT) / 2L; + long i = (Slimed & TIMEOUT) / 2L; if (i == 1L) { /* display as green slime during "You have become green slime." @@ -499,7 +499,7 @@ done_timeout(int how, int which) void nh_timeout(void) { - register struct prop *upp; + struct prop *upp; struct kinfo *kptr; boolean was_flying; int sleeptime; @@ -1620,7 +1620,7 @@ void do_storms(void) { int nstrike; - register int x, y; + int x, y; int dirx, diry; int count; diff --git a/src/topten.c b/src/topten.c index fcb7cb812..20d24ab33 100644 --- a/src/topten.c +++ b/src/topten.c @@ -539,10 +539,10 @@ topten(int how) int uid = getuid(); int rank, rank0 = -1, rank1 = 0; int occ_cnt = PERSMAX; - register struct toptenentry *t0, *tprev; + struct toptenentry *t0, *tprev; struct toptenentry *t1; FILE *rfile; - register int flg = 0; + int flg = 0; boolean t0_used; #ifdef LOGFILE FILE *lfile; @@ -893,7 +893,7 @@ static void outheader(void) { char linebuf[BUFSZ]; - register char *bp; + char *bp; Strcpy(linebuf, " No Points Name"); bp = eos(linebuf); @@ -1230,10 +1230,10 @@ prscore(int argc, char **argv) const char **players; int playerct, rank; boolean current_ver = TRUE, init_done = FALSE; - register struct toptenentry *t1; + struct toptenentry *t1; FILE *rfile; boolean match_found = FALSE; - register int i; + int i; char pbuf[BUFSZ]; int uid = -1; #ifndef PERS_IS_UID @@ -1393,8 +1393,8 @@ struct obj * tt_oname(struct obj *otmp) { int rank; - register int i; - register struct toptenentry *tt; + int i; + struct toptenentry *tt; FILE *rfile; struct toptenentry tt_buf; diff --git a/src/track.c b/src/track.c index 762c5c6ba..fe4d9febd 100644 --- a/src/track.c +++ b/src/track.c @@ -28,10 +28,10 @@ settrack(void) } coord * -gettrack(register int x, register int y) +gettrack(int x, int y) { - register int cnt, ndist; - register coord *tc; + int cnt, ndist; + coord *tc; cnt = utcnt; for(tc = &utrack[utpnt]; cnt--; ) { if(tc == utrack) tc = &utrack[UTSZ-1]; diff --git a/src/trap.c b/src/trap.c index 116bcfacc..cbcbc815b 100644 --- a/src/trap.c +++ b/src/trap.c @@ -881,9 +881,9 @@ reset_utrap(boolean msg) } void -dotrap(register struct trap *trap, unsigned int trflags) +dotrap(struct trap *trap, unsigned int trflags) { - register int ttype = trap->ttyp; + int ttype = trap->ttyp; struct obj *otmp; boolean already_seen = trap->tseen; boolean forcetrap = ((trflags & FORCETRAP) != 0 || (trflags & FAILEDUNTRAP) != 0); @@ -1730,11 +1730,11 @@ force_launch_placement(void) * 2 if an object was launched, but used up. */ int -launch_obj(short int otyp, register int x1, register int y1, register int x2, register int y2, int style) +launch_obj(short int otyp, int x1, int y1, int x2, int y2, int style) { - register struct monst *mtmp; - register struct obj *otmp, *otmp2; - register int dx, dy; + struct monst *mtmp; + struct obj *otmp, *otmp2; + int dx, dy; struct obj *singleobj; boolean used_up = FALSE; boolean otherside = FALSE; @@ -2003,7 +2003,7 @@ static int mkroll_launch(struct trap *ttmp, xchar x, xchar y, short int otyp, long int ocount) { struct obj *otmp; - register int tmp; + int tmp; schar dx, dy; int distance; coord cc; @@ -2149,7 +2149,7 @@ mintrap(struct monst *mtmp, unsigned mintrapflags) } } } else { - register int tt = trap->ttyp; + int tt = trap->ttyp; boolean in_sight, tear_web, see_it, #ifdef WEBB_DISINT trap_visible = (trap->tseen && cansee(trap->tx, trap->ty)), @@ -2976,7 +2976,7 @@ fill_pit(int x, int y) int float_down(long int hmask, long int emask) /**< might cancel timeout */ { - register struct trap *trap = (struct trap *)0; + struct trap *trap = (struct trap *)0; d_level current_dungeon_level; boolean no_msg = FALSE; @@ -3263,7 +3263,7 @@ dofiretrap(struct obj *box) /**< NULL for floor trap */ static void domagictrap(void) { - register int fate = rnd(20); + int fate = rnd(20); /* What happened to the poor sucker? */ @@ -3339,8 +3339,8 @@ domagictrap(void) case 19: /* tame nearby monsters */ - { register int i, j; - register struct monst *mtmp; + { int i, j; + struct monst *mtmp; (void) adjattrib(A_CHA, 1, FALSE); for(i = -1; i <= 1; i++) for(j = -1; j <= 1; j++) { @@ -3783,8 +3783,8 @@ emergency_disrobe(boolean *lostsome) int invc = inv_cnt(TRUE); while (near_capacity() > (Punished ? UNENCUMBERED : SLT_ENCUMBER)) { - register struct obj *obj, *otmp = (struct obj *)0; - register int i; + struct obj *obj, *otmp = (struct obj *)0; + int i; /* Pick a random object */ if (invc > 0) { @@ -3990,7 +3990,7 @@ drown(void) } void -drain_en(register int n) +drain_en(int n) { if (!u.uenmax) { /* energy is completely gone */ @@ -4470,9 +4470,9 @@ help_monster_out(struct monst *mtmp, struct trap *ttmp) int untrap(boolean force) { - register struct obj *otmp; - register boolean confused = (Confusion > 0 || Hallucination > 0); - register int x, y; + struct obj *otmp; + boolean confused = (Confusion > 0 || Hallucination > 0); + int x, y; int ch; struct trap *ttmp; struct monst *mtmp; @@ -4925,9 +4925,9 @@ openfallingtrap(struct monst *mon, boolean trapdoor_only, boolean *noticed) /* only called when the player is doing something to the chest directly */ boolean -chest_trap(register struct obj *obj, register int bodypart, boolean disarm) +chest_trap(struct obj *obj, int bodypart, boolean disarm) { - register struct obj *otmp = obj, *otmp2; + struct obj *otmp = obj, *otmp2; char buf[80]; const char *msg; coord cc; @@ -4969,7 +4969,7 @@ chest_trap(register struct obj *obj, register int bodypart, boolean disarm) struct monst *shkp = 0; long loss = 0L; boolean costly, insider; - register xchar ox = obj->ox, oy = obj->oy; + xchar ox = obj->ox, oy = obj->oy; /* the obj location need not be that of player */ costly = (costly_spot(ox, oy) && @@ -5094,9 +5094,9 @@ chest_trap(register struct obj *obj, register int bodypart, boolean disarm) } struct trap * -t_at(register int x, register int y) +t_at(int x, int y) { - register struct trap *trap = ftrap; + struct trap *trap = ftrap; while(trap) { if(trap->tx == x && trap->ty == y) return(trap); trap = trap->ntrap; @@ -5105,7 +5105,7 @@ t_at(register int x, register int y) } void -deltrap(register struct trap *trap) +deltrap(struct trap *trap) { struct trap *ttmp; @@ -5227,7 +5227,7 @@ uescaped_shaft(struct trap *trap) /* Destroy a trap that emanates from the floor. */ boolean -delfloortrap(register struct trap *ttmp) +delfloortrap(struct trap *ttmp) { /* Destroy a trap that emanates from the floor. */ /* some of these are arbitrary -dlc */ @@ -5242,7 +5242,7 @@ delfloortrap(register struct trap *ttmp) (ttmp->ttyp == WEB) || (ttmp->ttyp == MAGIC_TRAP) || (ttmp->ttyp == ANTI_MAGIC))) { - register struct monst *mtmp; + struct monst *mtmp; if (ttmp->tx == u.ux && ttmp->ty == u.uy) { if (u.utraptype != TT_BURIEDBALL) { @@ -5259,9 +5259,9 @@ delfloortrap(register struct trap *ttmp) /* used for doors (also tins). can be used for anything else that opens. */ void -b_trapped(register const char *item, register int bodypart) +b_trapped(const char *item, int bodypart) { - register int lvl = level_difficulty(); + int lvl = level_difficulty(); int dmg = rnd(5 + (lvl < 5 ? lvl : 2+lvl/2)); pline("KABOOM!! %s was booby-trapped!", The(item)); @@ -5356,7 +5356,7 @@ static const char lava_killer[] = "molten lava"; boolean lava_effects(void) { - register struct obj *obj, *obj2; + struct obj *obj, *obj2; int dmg = d(6, 6); /* only applicable for water walking */ boolean usurvive, boil_away; diff --git a/src/u_init.c b/src/u_init.c index 853e7e0df..c4484b001 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -617,7 +617,7 @@ static const struct def_skill Skill_W[] = { static void -knows_object(register int obj) +knows_object(int obj) { discover_object(obj, TRUE, FALSE); objects[obj].oc_pre_discovered = 1; /* not a "discovery" */ @@ -675,7 +675,7 @@ knows_class(char sym) void u_init(void) { - register int i; + int i; struct permonst* shambler = &mons[PM_SHAMBLING_HORROR]; struct attack* attkptr; @@ -1061,7 +1061,7 @@ u_init(void) */ for(i = 0; i < A_MAX; i++) if(!rn2(20)) { - register int xd = rn2(7) - 2; /* biased variation */ + int xd = rn2(7) - 2; /* biased variation */ (void) adjattrib(i, xd, TRUE); if (ABASE(i) < AMAX(i)) AMAX(i) = ABASE(i); } @@ -1176,7 +1176,7 @@ restricted_spell_discipline(int otyp) } static void -ini_inv(register struct trobj *trop) +ini_inv(struct trobj *trop) { struct obj *obj; int otyp, i; diff --git a/src/uhitm.c b/src/uhitm.c index 61407f49f..7ddde34fe 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -256,7 +256,7 @@ check_caitiff(struct monst *mtmp) } int -find_roll_to_hit(register struct monst *mtmp, uchar aatyp, struct obj *weapon, int *attk_count, int *role_roll_penalty) +find_roll_to_hit(struct monst *mtmp, uchar aatyp, struct obj *weapon, int *attk_count, int *role_roll_penalty) /* usually AT_WEAP or AT_KICK */ /* uwep or uswapwep or NULL */ @@ -359,9 +359,9 @@ find_roll_to_hit(register struct monst *mtmp, uchar aatyp, struct obj *weapon, i /* try to attack; return FALSE if monster evaded */ /* u.dx and u.dy must be set */ boolean -attack(register struct monst *mtmp) +attack(struct monst *mtmp) { - register struct permonst *mdat = mtmp->data; + struct permonst *mdat = mtmp->data; /* This section of code provides protection against accidentally * hitting peaceful (like '@') and tame (like 'd') monsters. @@ -492,7 +492,7 @@ attack(register struct monst *mtmp) /* really hit target monster; returns TRUE if it still lives */ static boolean -known_hitum(register struct monst *mon, struct obj *weapon, int *mhit, int rollneeded, int armorpenalty, struct attack *uattk, int dieroll) +known_hitum(struct monst *mon, struct obj *weapon, int *mhit, int rollneeded, int armorpenalty, struct attack *uattk, int dieroll) @@ -1817,8 +1817,8 @@ damageum( struct attack *mattk, /**< hero's attack */ int specialdmg) /**< blessed and/or silver bonus against various things */ { - register struct permonst *pd = mdef->data; - register int tmp = d((int)mattk->damn, (int)mattk->damd); + struct permonst *pd = mdef->data; + int tmp = d((int)mattk->damn, (int)mattk->damd); boolean negated; struct obj *mongold; @@ -2302,9 +2302,9 @@ damageum( } static int -explum(register struct monst *mdef, register struct attack *mattk) +explum(struct monst *mdef, struct attack *mattk) { - register int tmp = d((int)mattk->damn, (int)mattk->damd); + int tmp = d((int)mattk->damn, (int)mattk->damd); You("explode!"); switch (mattk->adtyp) { @@ -2382,10 +2382,10 @@ end_engulf(void) } static int -gulpum(register struct monst *mdef, register struct attack *mattk) +gulpum(struct monst *mdef, struct attack *mattk) { - register int tmp; - register int dam = d((int)mattk->damn, (int)mattk->damd); + int tmp; + int dam = d((int)mattk->damn, (int)mattk->damd); struct obj *otmp; struct permonst *pd = mdef->data; /* Not totally the same as for real monsters. Specifically, these @@ -2596,7 +2596,7 @@ missum(struct monst *mdef, struct attack *mattk, boolean wouldhavehit) /* attack monster as a monster; returns true if mon survives */ static boolean -hmonas(register struct monst *mon) +hmonas(struct monst *mon) { struct attack *mattk, alt_attk; struct obj *weapon, **originalweapon; @@ -3062,8 +3062,8 @@ passive(struct monst *mon, struct obj *weapon, boolean mhit, int malive, uchar a { - register struct permonst *ptr = mon->data; - register int i, tmp; + struct permonst *ptr = mon->data; + int i, tmp; if (mhit && aatyp == AT_BITE && is_vampiric(youmonst.data)) { if (bite_monster(mon)) diff --git a/src/vault.c b/src/vault.c index 2cc184804..788582c64 100644 --- a/src/vault.c +++ b/src/vault.c @@ -209,7 +209,7 @@ in_fcorridor(struct monst *grd, int x, int y) struct monst * findgd(void) { - register struct monst *mtmp; + struct monst *mtmp; for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) { @@ -233,7 +233,7 @@ vault_summon_gd(void) char vault_occupied(char *array) { - register char *ptr; + char *ptr; for (ptr = array; *ptr; ptr++) if (rooms[*ptr - ROOMOFFSET].rtype == VAULT) @@ -270,7 +270,7 @@ uleftvault(struct monst *grd) static boolean find_guard_dest(struct monst *guard, xchar *rx, xchar *ry) { - register int x, y, dd, lx = 0, ly = 0; + int x, y, dd, lx = 0, ly = 0; for (dd = 2; (dd < ROWNO || dd < COLNO); dd++) { for (y = u.uy - dd; y <= u.uy + dd; ly = y, y++) { @@ -354,7 +354,7 @@ invault(void) } } while(levl[x][y].typ == ROOM) { - register int dx, dy; + int dx, dy; dx = (gx > x) ? 1 : (gx < x) ? -1 : 0; dy = (gy > y) ? 1 : (gy < y) ? -1 : 0; @@ -636,7 +636,7 @@ wallify_vault(struct monst *grd) } static void -gd_mv_monaway(register struct monst *grd, int nx, int ny) +gd_mv_monaway(struct monst *grd, int nx, int ny) { if (MON_AT(nx, ny) && !(nx == grd->mx && ny == grd->my)) { if (!Deaf) @@ -739,7 +739,7 @@ gd_pick_corridor_gold(struct monst *grd, int goldx, int goldy) * return 1: guard moved, 0: guard didn't, -1: let m_move do it, -2: died */ int -gd_move(register struct monst *grd) +gd_move(struct monst *grd) { int x, y, nx, ny, m, n; int dx, dy, gx = 0, gy = 0, fci; @@ -752,7 +752,7 @@ gd_move(register struct monst *grd) boolean semi_dead = DEADMONSTER(grd); boolean newspot = FALSE; long umoney = money_cnt(invent); - register boolean u_carry_gold = ((umoney + hidden_gold()) > 0L); + boolean u_carry_gold = ((umoney + hidden_gold()) > 0L); boolean see_guard; if (!on_level(&(egrd->gdlevel), &u.uz)) { @@ -1090,7 +1090,7 @@ nextnxy: ; void paygd(boolean silently) { - register struct monst *grd = findgd(); + struct monst *grd = findgd(); long umoney = money_cnt(invent); struct obj *coins, *nextcoins; int gx, gy; @@ -1138,8 +1138,8 @@ paygd(boolean silently) long hidden_gold(void) { - register long value = 0L; - register struct obj *obj; + long value = 0L; + struct obj *obj; for (obj = invent; obj; obj = obj->nobj) if (Has_contents(obj)) @@ -1153,7 +1153,7 @@ hidden_gold(void) boolean gd_sound(void) { - register struct monst *grd = findgd(); + struct monst *grd = findgd(); if (vault_occupied(u.urooms)) return(FALSE); else return((boolean)(grd == (struct monst *)0)); diff --git a/src/vision.c b/src/vision.c index d60c28524..48aedcb1a 100644 --- a/src/vision.c +++ b/src/vision.c @@ -153,7 +153,7 @@ vision_init(void) * sight. */ int -does_block(int x, int y, register struct rm *lev) +does_block(int x, int y, struct rm *lev) { struct obj *obj; struct monst *mon; @@ -194,8 +194,8 @@ void vision_reset(void) { int y; - register int x, i, dig_left, block; - register struct rm *lev; + int x, i, dig_left, block; + struct rm *lev; /* Start out with cs0 as our current array */ viz_array = cs_rows0; @@ -255,8 +255,8 @@ vision_reset(void) static void get_unused_cs(char ***rows, char **rmin, char **rmax) { - register int row; - register char *nrmin, *nrmax; + int row; + char *nrmin, *nrmax; if (viz_array == cs_rows0) { *rows = cs_rows1; @@ -300,7 +300,7 @@ rogue_vision(char **next, char *rmin, char *rmax) { int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET; /* no SHARED... */ int start, stop, in_door, xhi, xlo, yhi, ylo; - register int zx, zy; + int zx, zy; /* If in a lit room, we are able to see to its boundaries. */ /* If dark, set COULD_SEE so various spells work -dlc */ @@ -399,7 +399,7 @@ struct rm *lev; unsigned char *sv; int row, col; { - register int res = *sv; + int res = *sv; /* * Do extra checks for crosswalls and T walls if we see them from @@ -497,8 +497,8 @@ vision_recalc(int control) int row = 0; /* row counter (outer loop) */ int start, stop; /* inner loop starting/stopping index */ int dx, dy; /* one step from a lit door or lit wall (see below) */ - register int col; /* inner loop counter */ - register struct rm *lev; /* pointer to current pos */ + int col; /* inner loop counter */ + struct rm *lev; /* pointer to current pos */ struct rm *flev; /* pointer to position in "front" of current pos */ extern unsigned char seenv_matrix[3][3]; /* from display.c */ static unsigned char colbump[COLNO+1]; /* cols to bump sv */ @@ -1133,7 +1133,7 @@ static genericptr_t varg; #define q1_path(srow, scol, y2, x2, label) \ { \ int dx, dy; \ - register int k, err, x, y, dxs, dys; \ + int k, err, x, y, dxs, dys; \ \ x = (scol); y = (srow); \ dx = (x2) - x; dy = y - (y2); \ @@ -1177,7 +1177,7 @@ static genericptr_t varg; #define q4_path(srow, scol, y2, x2, label) \ { \ int dx, dy; \ - register int k, err, x, y, dxs, dys; \ + int k, err, x, y, dxs, dys; \ \ x = (scol); y = (srow); \ dx = (x2) - x; dy = (y2) - y; \ @@ -1222,7 +1222,7 @@ static genericptr_t varg; #define q2_path(srow, scol, y2, x2, label) \ { \ int dx, dy; \ - register int k, err, x, y, dxs, dys; \ + int k, err, x, y, dxs, dys; \ \ x = (scol); y = (srow); \ dx = x - (x2); dy = y - (y2); \ @@ -1266,7 +1266,7 @@ static genericptr_t varg; #define q3_path(srow, scol, y2, x2, label) \ { \ int dx, dy; \ - register int k, err, x, y, dxs, dys; \ + int k, err, x, y, dxs, dys; \ \ x = (scol); y = (srow); \ dx = x - (x2); dy = (y2) - y; \ @@ -1325,7 +1325,7 @@ _q1_path(srow, scol, y2, x2) int scol, srow, y2, x2; { int dx, dy; - register int k, err, x, y, dxs, dys; + int k, err, x, y, dxs, dys; x = scol; y = srow; dx = x2 - x; dy = y - y2; @@ -1369,7 +1369,7 @@ _q4_path(srow, scol, y2, x2) int scol, srow, y2, x2; { int dx, dy; - register int k, err, x, y, dxs, dys; + int k, err, x, y, dxs, dys; x = scol; y = srow; dx = x2 - x; dy = y2 - y; @@ -1413,7 +1413,7 @@ _q2_path(srow, scol, y2, x2) int scol, srow, y2, x2; { int dx, dy; - register int k, err, x, y, dxs, dys; + int k, err, x, y, dxs, dys; x = scol; y = srow; dx = x - x2; dy = y - y2; @@ -1457,7 +1457,7 @@ _q3_path(srow, scol, y2, x2) int scol, srow, y2, x2; { int dx, dy; - register int k, err, x, y, dxs, dys; + int k, err, x, y, dxs, dys; x = scol; y = srow; dx = x - x2; dy = y2 - y; @@ -1585,7 +1585,7 @@ static int close_shadow(side, this_row, block_row, block_col) int side, this_row, block_row, block_col; { - register int sdy, sdx, pdy, offset; + int sdy, sdx, pdy, offset; /* * If on the same column (block_row = -1), then we can see it. @@ -1614,7 +1614,7 @@ static int far_shadow(side, this_row, block_row, block_col) int side, this_row, block_row, block_col; { - register int sdy, sdx, pdy, offset; + int sdy, sdx, pdy, offset; /* * Take care of a bug that shows up only on the borders. @@ -1659,7 +1659,7 @@ right_side( int right_mark, /**< right mark of previous row */ char *limits) /**< points at range limit for current row, or NULL */ { - register int i; + int i; char *rowp = NULL; int hit_stone = 0; int left_shadow, right_shadow, loc_right; @@ -1911,7 +1911,7 @@ int left_mark; /* left mark of previous row */ int right; /* right mark of the previous row */ char *limits; { - register int i; + int i; char *rowp = NULL; int hit_stone = 0; int left_shadow, right_shadow, loc_left; @@ -2089,7 +2089,7 @@ int range; /* 0 if unlimited */ void (*func)(int, int, genericptr_t); genericptr_t arg; { - register int i; + int i; char *rowp; int nrow, left, right, left_row, right_row; char *limits; @@ -2196,7 +2196,7 @@ right_side( int nrow; /* new row (calculate once) */ int deeper; /* if TRUE, call self as needed */ int result; /* set by q?_path() */ - register int i; /* loop counter */ + int i; /* loop counter */ char *rowp = NULL; /* row optimization */ char *row_min = NULL; /* left most [used by macro set_min()] */ char *row_max = NULL; /* right most [used by macro set_max()] */ @@ -2368,7 +2368,7 @@ static void left_side(int row, int left_mark, int right, char *limits) { int left, left_edge, nrow, deeper, result; - register int i; + int i; char *rowp = NULL; char *row_min = NULL; char *row_max = NULL; @@ -2492,7 +2492,7 @@ view_from(int srow, int scol, char **loc_cs_rows, char *left_most, char *right_m { - register int i; /* loop counter */ + int i; /* loop counter */ char *rowp; /* optimization for setting could_see */ int nrow; /* the next row */ int left; /* the left-most visible column */ @@ -2585,7 +2585,7 @@ do_clear_area(int scol, int srow, int range, void (*func) (int, int, genericptr_ view_from(srow, scol, (char **)0, (char *)0, (char *)0, range, func, arg); else { - register int x; + int x; int y, min_x, max_x, max_y, offset; char *limits; boolean override_vision; diff --git a/src/weapon.c b/src/weapon.c index 95e1667fa..dee8df964 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -576,9 +576,9 @@ static struct obj *propellor; /* select a ranged weapon for the monster */ struct obj * -select_rwep(register struct monst *mtmp) +select_rwep(struct monst *mtmp) { - register struct obj *otmp; + struct obj *otmp; int i; #ifdef KOPS @@ -830,7 +830,7 @@ possibly_unwield(struct monst *mon, boolean polyspot) * Returns 1 if the monster took time to do it, 0 if it did not. */ int -mon_wield_item(register struct monst *mon) +mon_wield_item(struct monst *mon) { struct obj *obj; @@ -1754,7 +1754,7 @@ skill_init(const struct def_skill *class_skill) } void -setmnotwielded(register struct monst *mon, register struct obj *obj) +setmnotwielded(struct monst *mon, struct obj *obj) { if (!obj) return; if (artifact_light(obj) && obj->lamplit) { diff --git a/src/were.c b/src/were.c index 71970fde8..850d20f4c 100644 --- a/src/were.c +++ b/src/were.c @@ -4,7 +4,7 @@ #include "hack.h" void -were_change(register struct monst *mon) +were_change(struct monst *mon) { if (!is_were(mon->data)) return; @@ -75,9 +75,9 @@ were_beastie(int pm) } void -new_were(register struct monst *mon) +new_were(struct monst *mon) { - register int pm; + int pm; pm = counter_were(monsndx(mon->data)); if (pm < LOW_PM) { diff --git a/src/wield.c b/src/wield.c index 8c80f5182..640f2eccd 100644 --- a/src/wield.c +++ b/src/wield.c @@ -84,7 +84,7 @@ static int wield(boolean prompt_for_obj); * to print the appropriate messages. */ void -setuwep(register struct obj *obj) +setuwep(struct obj *obj) { struct obj *olduwep = uwep; int oldcon = acurr(A_CON); @@ -254,13 +254,13 @@ ready_weapon(struct obj *wep) } void -setuqwep(register struct obj *obj) +setuqwep(struct obj *obj) { setworn(obj, W_QUIVER); } void -setuswapwep(register struct obj *obj) +setuswapwep(struct obj *obj) { if (obj) { obj->quiver_priority = 0; @@ -298,7 +298,7 @@ dowield(void) static int wield(boolean prompt_for_obj) { - register struct obj *wep=&zeroobj, *oldwep; + struct obj *wep=&zeroobj, *oldwep; int result; /* May we attempt this? */ @@ -352,7 +352,7 @@ wield(boolean prompt_for_obj) int doswapweapon(void) { - register struct obj *oldwep, *oldswap; + struct obj *oldwep, *oldswap; int result = 0; /* May we attempt this? */ @@ -685,7 +685,7 @@ untwoweapon(void) } int -chwepon(register struct obj *otmp, register int amount) +chwepon(struct obj *otmp, int amount) { const char *color = hcolor((amount < 0) ? NH_BLACK : NH_BLUE); const char *xtime; @@ -828,7 +828,7 @@ chwepon(register struct obj *otmp, register int amount) } int -welded(register struct obj *obj) +welded(struct obj *obj) { if (obj && obj == uwep && will_weld(obj)) { set_bknown(obj, 1); @@ -838,7 +838,7 @@ welded(register struct obj *obj) } void -weldmsg(register struct obj *obj) +weldmsg(struct obj *obj) { long savewornmask; diff --git a/src/windows.c b/src/windows.c index 8f9266590..37550be71 100644 --- a/src/windows.c +++ b/src/windows.c @@ -112,7 +112,7 @@ def_raw_print(const char *s) void choose_windows(const char *s) { - register int i; + int i; for(i=0; winchoices[i].procs; i++) if (!strcmpi(s, winchoices[i].procs->name)) { diff --git a/src/wizard.c b/src/wizard.c index 2d058c1ed..e3042fa32 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -95,9 +95,9 @@ amulet(void) } int -mon_has_amulet(register struct monst *mtmp) +mon_has_amulet(struct monst *mtmp) { - register struct obj *otmp; + struct obj *otmp; for(otmp = mtmp->minvent; otmp; otmp = otmp->nobj) if(otmp->otyp == AMULET_OF_YENDOR) return(1); @@ -105,9 +105,9 @@ mon_has_amulet(register struct monst *mtmp) } int -mon_has_special(register struct monst *mtmp) +mon_has_special(struct monst *mtmp) { - register struct obj *otmp; + struct obj *otmp; for(otmp = mtmp->minvent; otmp; otmp = otmp->nobj) if(otmp->otyp == AMULET_OF_YENDOR || @@ -130,7 +130,7 @@ mon_has_special(register struct monst *mtmp) #define M_Wants(mask) (mtmp->data->mflags3 & (mask)) static short -which_arti(register int mask) +which_arti(int mask) { switch(mask) { case M3_WANTSAMUL: return(AMULET_OF_YENDOR); @@ -150,7 +150,7 @@ which_arti(register int mask) static boolean mon_has_arti(struct monst *mtmp, short int otyp) { - register struct obj *otmp; + struct obj *otmp; for(otmp = mtmp->minvent; otmp; otmp = otmp->nobj) { if(otyp) { @@ -166,7 +166,7 @@ mon_has_arti(struct monst *mtmp, short int otyp) static struct monst * other_mon_has_arti(struct monst *mtmp, short int otyp) { - register struct monst *mtmp2; + struct monst *mtmp2; for(mtmp2 = fmon; mtmp2; mtmp2 = mtmp2->nmon) /* no need for !DEADMONSTER check here since they have no inventory */ @@ -177,9 +177,9 @@ other_mon_has_arti(struct monst *mtmp, short int otyp) } static struct obj * -on_ground(register short int otyp) +on_ground(short int otyp) { - register struct obj *otmp; + struct obj *otmp; for (otmp = fobj; otmp; otmp = otmp->nobj) if (otyp) { @@ -191,7 +191,7 @@ on_ground(register short int otyp) } static boolean -you_have(register int mask) +you_have(int mask) { switch(mask) { case M3_WANTSAMUL: return (boolean)(u.uhave.amulet); @@ -205,11 +205,11 @@ you_have(register int mask) } static unsigned long -target_on(register int mask, register struct monst *mtmp) +target_on(int mask, struct monst *mtmp) { - register short otyp; - register struct obj *otmp; - register struct monst *mtmp2; + short otyp; + struct obj *otmp; + struct monst *mtmp2; if(!M_Wants(mask)) return(STRAT_NONE); @@ -234,7 +234,7 @@ target_on(register int mask, register struct monst *mtmp) } static unsigned long -strategy(register struct monst *mtmp) +strategy(struct monst *mtmp) { unsigned long strat, dstrat; @@ -326,7 +326,7 @@ choose_stairs(xchar *sx, xchar *sy) } int -tactics(register struct monst *mtmp) +tactics(struct monst *mtmp) { unsigned long strat = strategy(mtmp); xchar sx = 0, sy = 0, mx, my; @@ -454,7 +454,7 @@ has_aggravatables(struct monst *mon) void aggravate(void) { - register struct monst *mtmp; + struct monst *mtmp; boolean in_w_tower = In_W_tower(u.ux, u.uy, &u.uz); for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { @@ -476,7 +476,7 @@ aggravate(void) void clonewiz(void) { - register struct monst *mtmp2; + struct monst *mtmp2; if ((mtmp2 = makemon(&mons[PM_WIZARD_OF_YENDOR], u.ux, u.uy, NO_MM_FLAGS)) != 0) { @@ -734,7 +734,7 @@ const char * const random_malediction[] = { /* Insult or intimidate the player */ void -cuss(register struct monst *mtmp) +cuss(struct monst *mtmp) { if (mtmp->iswiz) { if (!rn2(5)) /* typical bad guy action */ diff --git a/src/worm.c b/src/worm.c index f43087bd3..55d153cae 100644 --- a/src/worm.c +++ b/src/worm.c @@ -84,7 +84,7 @@ long wgrowtime[MAX_NUM_WORMS] = DUMMY; int get_wormno(void) { - register int new_wormno = 1; + int new_wormno = 1; while (new_wormno < MAX_NUM_WORMS) { if (!wheads[new_wormno]) { @@ -110,8 +110,8 @@ get_wormno(void) void initworm(struct monst *worm, int wseg_count) { - register struct wseg *seg, *new_tail = create_worm_tail(wseg_count); - register int wnum = worm->wormno; + struct wseg *seg, *new_tail = create_worm_tail(wseg_count); + int wnum = worm->wormno; if (!wnum) { warning("initworm: worm->wormno was 0"); @@ -139,9 +139,9 @@ initworm(struct monst *worm, int wseg_count) * The display may or may not need to be updated as we free the segments. */ static void -toss_wsegs(register struct wseg *curr, register boolean display_update) +toss_wsegs(struct wseg *curr, boolean display_update) { - register struct wseg *seg; + struct wseg *seg; while (curr) { seg = curr->nseg; @@ -191,8 +191,8 @@ shrink_worm(int wnum) /**< worm number */ void worm_move(struct monst *worm) { - register struct wseg *seg, *new_seg; /* new segment */ - register int wnum = worm->wormno; /* worm number */ + struct wseg *seg, *new_seg; /* new segment */ + int wnum = worm->wormno; /* worm number */ if (!wnum) { @@ -238,7 +238,7 @@ worm_move(struct monst *worm) * The worm don't move so it should shrink. */ void -worm_nomove(register struct monst *worm) +worm_nomove(struct monst *worm) { shrink_worm((int) worm->wormno); /* shrink */ @@ -256,9 +256,9 @@ worm_nomove(register struct monst *worm) * Kill a worm tail. */ void -wormgone(register struct monst *worm) +wormgone(struct monst *worm) { - register int wnum = worm->wormno; + int wnum = worm->wormno; if (!wnum) { warning("wormgone: worm->wormno was 0"); @@ -283,10 +283,10 @@ wormgone(register struct monst *worm) * If the hero is near any part of the worm, the worm will try to attack. */ void -wormhitu(register struct monst *worm) +wormhitu(struct monst *worm) { - register int wnum = worm->wormno; - register struct wseg *seg; + int wnum = worm->wormno; + struct wseg *seg; if (!wnum) { warning("wormhitu: worm->wormno was 0"); @@ -329,8 +329,8 @@ cutoff(struct monst *worm, struct wseg *tail) void cutworm(struct monst *worm, xchar x, xchar y, struct obj *weap) { - register struct wseg *curr, *new_tail; - register struct monst *new_worm; + struct wseg *curr, *new_tail; + struct monst *new_worm; int wnum = worm->wormno; int cut_chance, new_wnum; @@ -618,9 +618,9 @@ sanity_check_worm(struct monst *worm) * not remove the mon from the fmon chain. */ void -remove_worm(register struct monst *worm) +remove_worm(struct monst *worm) { - register struct wseg *curr = wtails[worm->wormno]; + struct wseg *curr = wtails[worm->wormno]; if (!worm->wormno) { warning("remove_worm: worm->wormno was 0"); @@ -652,7 +652,7 @@ place_worm_tail_randomly(struct monst *worm, xchar x, xchar y) int wnum = worm->wormno; struct wseg *curr = wtails[wnum]; struct wseg *new_tail; - register xchar ox = x, oy = y; + xchar ox = x, oy = y; if (!wnum) { warning("place_worm_tail_randomly: worm->wormno was 0"); @@ -704,7 +704,7 @@ place_worm_tail_randomly(struct monst *worm, xchar x, xchar y) * enexto() with a search radius. */ static void -random_dir(register xchar x, register xchar y, register xchar *nx, register xchar *ny) +random_dir(xchar x, xchar y, xchar *nx, xchar *ny) { *nx = x; *ny = y; @@ -746,8 +746,8 @@ size_wseg(struct monst *worm) int count_wsegs(struct monst *mtmp) { - register int i=0; - register struct wseg *curr = (wtails[mtmp->wormno])->nseg; + int i=0; + struct wseg *curr = (wtails[mtmp->wormno])->nseg; if (!mtmp->wormno) { warning("count_wsegs: mtmp->wormno was 0"); @@ -769,8 +769,8 @@ count_wsegs(struct monst *mtmp) static struct wseg * create_worm_tail(int num_segs) { - register int i=0; - register struct wseg *new_tail, *curr; + int i=0; + struct wseg *new_tail, *curr; if (!num_segs) return (struct wseg *)0; diff --git a/src/worn.c b/src/worn.c index 58aad3da4..267387a2f 100644 --- a/src/worn.c +++ b/src/worn.c @@ -41,11 +41,11 @@ const struct worn { /* Updated to use the extrinsic and blocked fields. */ void -setworn(register struct obj *obj, long int mask) +setworn(struct obj *obj, long int mask) { - register const struct worn *wp; - register struct obj *oobj; - register int p; + const struct worn *wp; + struct obj *oobj; + int p; if ((mask & (W_ARM|I_SPECIAL)) == (W_ARM|I_SPECIAL)) { /* restoring saved game; no properties are conferred via skin */ @@ -120,10 +120,10 @@ setworn(register struct obj *obj, long int mask) /* called e.g. when obj is destroyed */ /* Updated to use the extrinsic and blocked fields. */ void -setnotworn(register struct obj *obj) +setnotworn(struct obj *obj) { - register const struct worn *wp; - register int p; + const struct worn *wp; + int p; if (!obj) return; if (obj == uwep || obj == uswapwep) u.twoweap = 0; @@ -454,9 +454,9 @@ update_mon_intrinsics(struct monst *mon, struct obj *obj, boolean on, boolean si } int -find_mac(register struct monst *mon) +find_mac(struct monst *mon) { - register struct obj *obj; + struct obj *obj; int base = mon->data->ac; long mwflags = mon->misc_worn_check; @@ -494,7 +494,7 @@ find_mac(register struct monst *mon) * already worn body armor is too obviously buggy... */ void -m_dowear(register struct monst *mon, boolean creation) +m_dowear(struct monst *mon, boolean creation) { #define RACE_EXCEPTION TRUE /* Note the restrictions here are the same as in dowear in do_wear.c diff --git a/src/write.c b/src/write.c index 9dfd995f1..dfde978bc 100644 --- a/src/write.c +++ b/src/write.c @@ -97,11 +97,11 @@ static NEARDATA const char write_on[] = { SCROLL_CLASS, SPBOOK_CLASS, 0 }; /** write -- applying a magic marker */ int -dowrite(register struct obj *pen) +dowrite(struct obj *pen) { - register struct obj *paper; + struct obj *paper; char namebuf[BUFSZ] = DUMMY, *nm, *bp; - register struct obj *new_obj; + struct obj *new_obj; int basecost, actualcost; int curseval; char qbuf[QBUFSZ]; diff --git a/src/zap.c b/src/zap.c index ab29f4747..61820f280 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1069,7 +1069,7 @@ unturn_dead(struct monst *mon) return res; } -boolean cancellable(register struct obj *obj) +boolean cancellable(struct obj *obj) { return objects[obj->otyp].oc_magic || (obj->spe && @@ -1082,7 +1082,7 @@ boolean cancellable(register struct obj *obj) /* cancel obj, possibly carried by you or a monster */ void -cancel_item(register struct obj *obj) +cancel_item(struct obj *obj) { boolean u_ring = (obj == uleft) || (obj == uright); @@ -1379,7 +1379,7 @@ obj_shudders(struct obj *obj) static void polyuse(struct obj *objhdr, int mat, int minwt) { - register struct obj *otmp, *otmp2; + struct obj *otmp, *otmp2; for (otmp = objhdr; minwt > 0 && otmp; otmp = otmp2) { otmp2 = otmp->nexthere; @@ -2202,7 +2202,7 @@ int bhitpile(struct obj *obj, int (*fhito) (struct obj *, struct obj *), int tx, int ty, schar zz) { int hitanything = 0; - register struct obj *otmp, *next_obj; + struct obj *otmp, *next_obj; if (obj->otyp == SPE_FORCE_BOLT || obj->otyp == WAN_STRIKING) { struct trap *t = t_at(tx, ty); @@ -2239,7 +2239,7 @@ bhitpile(struct obj *obj, int (*fhito) (struct obj *, struct obj *), int tx, int * it removes a charge from the wand. */ int -zappable(register struct obj *wand) +zappable(struct obj *wand) { int zap_it = 1; if (wand->spe < 0) { @@ -2260,7 +2260,7 @@ zappable(register struct obj *wand) * added by GAN 11/03/86 */ void -zapnodir(register struct obj *obj) +zapnodir(struct obj *obj) { boolean known = FALSE; @@ -2323,7 +2323,7 @@ static NEARDATA const char zap_syms[] = { WAND_CLASS, 0 }; int dozap(void) { - register struct obj *obj; + struct obj *obj; int damage; if(check_capacity((char *)0)) return(0); @@ -2857,7 +2857,7 @@ zap_steed(struct obj *obj) /**< wand or spell */ * themselves with cancellation. */ boolean -cancel_monst(register struct monst *mdef, register struct obj *obj, boolean youattack, boolean allow_cancel_kill, boolean self_cancel) +cancel_monst(struct monst *mdef, struct obj *obj, boolean youattack, boolean allow_cancel_kill, boolean self_cancel) { boolean youdefend = (mdef == &youmonst); static const char writing_vanishes[] = @@ -3280,7 +3280,7 @@ zapwrapup(void) /* called for various wand and spell effects - M. Stephenson */ void -weffects(register struct obj *obj) +weffects(struct obj *obj) { int otyp = obj->otyp; boolean disclose = FALSE, was_unkn = !objects[otyp].oc_name_known; @@ -3391,7 +3391,7 @@ spell_hit_bonus(int skill) } const char * -exclam(register int force) +exclam(int force) { /* force == 0 occurs e.g. with sleep ray */ /* note that large force is usual with wands so that !! would @@ -3413,7 +3413,7 @@ hit(const char *str, /**< zap text or missile name */ } void -miss(register const char *str, register struct monst *mtmp) +miss(const char *str, struct monst *mtmp) { pline("%s %s %s.", The(str), vtense(str, "miss"), ((cansee(bhitpos.x, bhitpos.y) || canspotmon(mtmp)) @@ -3771,7 +3771,7 @@ bhit( struct monst * boomhit(struct obj *obj, int dx, int dy) { - register int i, ct; + int i, ct; int boom; /* showsym[] index */ struct monst *mtmp; boolean counterclockwise = TRUE; /* right-handed throw */ @@ -3852,8 +3852,8 @@ zhitm( int nd, /**< number of hit dice to use */ struct obj **ootmp) /**< to return worn armor for caller to disintegrate */ { - register int tmp = 0; - register int abstype = abs(type) % 10; + int tmp = 0; + int abstype = abs(type) % 10; boolean sho_shieldeff = FALSE; boolean spellcaster = is_hero_spell(type); /* maybe get a bonus! */ @@ -3977,7 +3977,7 @@ zhitm( #endif if (!resists_blnd(mon) && !(type > 0 && u.uswallow && mon == u.ustuck)) { - register unsigned rnd_tmp = rnd(50); + unsigned rnd_tmp = rnd(50); mon->mcansee = 0; if((mon->mblinded + rnd_tmp) > 127) mon->mblinded = 127; @@ -4345,11 +4345,11 @@ dobuzz( { int range, abstype = abs(type) % 10; struct rm *lev; - register xchar lsx, lsy; + xchar lsx, lsy; struct monst *mon; coord save_bhitpos; boolean shopdamage = FALSE; - register const char *fltxt; + const char *fltxt; struct obj *otmp; int spell_type; @@ -4358,7 +4358,7 @@ dobuzz( fltxt = flash_types[(type <= -30) ? abstype : abs(type)]; if(u.uswallow) { - register int tmp; + int tmp; if(type < 0) return; tmp = zhitm(u.ustuck, type, nd, &otmp); @@ -4722,7 +4722,7 @@ zap_over_floor(xchar x, xchar y, int type, boolean *shopdamage, short int explod if (lev->typ != POOL && lev->typ != BOG) { /* MOAT or DRAWBRIDGE_UP */ if (cansee(x, y)) msgtxt = "Some water evaporates."; } else { - register struct trap *ttmp; + struct trap *ttmp; rangemod -= 3; if (lev->typ == BOG) { @@ -5025,7 +5025,7 @@ fracture_rock(struct obj *obj) /* no texts here! */ /* handle statue hit by striking/force bolt/pick-axe */ boolean -break_statue(register struct obj *obj) +break_statue(struct obj *obj) { /* [obj is assumed to be on floor, so no get_obj_location() needed] */ struct trap *trap = t_at(obj->ox, obj->oy); diff --git a/sys/share/dgn_lex.c b/sys/share/dgn_lex.c index f79699d0f..84a1088b4 100644 --- a/sys/share/dgn_lex.c +++ b/sys/share/dgn_lex.c @@ -578,9 +578,9 @@ static int input(); int yylex(); int yylex() { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; @@ -625,7 +625,7 @@ int yylex() yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -951,9 +951,9 @@ case YY_STATE_EOF(INITIAL): static int yy_get_next_buffer() { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; + char *dest = yy_current_buffer->yy_ch_buf; + char *source = yytext_ptr; + int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) @@ -1082,15 +1082,15 @@ static int yy_get_next_buffer() static yy_state_type yy_get_previous_state() { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1118,10 +1118,10 @@ static yy_state_type yy_get_previous_state() static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + int yy_is_jam; + char *yy_cp = yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1143,9 +1143,9 @@ yy_state_type yy_current_state; #ifndef YY_NO_UNPUT static void yyunput( c, yy_bp ) int c; -register char *yy_bp; +char *yy_bp; { - register char *yy_cp = yy_c_buf_p; + char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; @@ -1153,10 +1153,10 @@ register char *yy_bp; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ + int number_to_move = yy_n_chars + 2; + char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; - register char *source = + char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) @@ -1414,7 +1414,7 @@ char *s1; const char *s2; int n; { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index 56d30e442..53c034d9e 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -859,9 +859,9 @@ static int input(); int yylex(); int yylex() { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; @@ -906,7 +906,7 @@ int yylex() yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1557,9 +1557,9 @@ case YY_STATE_EOF(MAPC): static int yy_get_next_buffer() { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; + char *dest = yy_current_buffer->yy_ch_buf; + char *source = yytext_ptr; + int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) @@ -1688,15 +1688,15 @@ static int yy_get_next_buffer() static yy_state_type yy_get_previous_state() { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1724,10 +1724,10 @@ static yy_state_type yy_get_previous_state() static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + int yy_is_jam; + char *yy_cp = yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1749,9 +1749,9 @@ yy_state_type yy_current_state; #ifndef YY_NO_UNPUT static void yyunput( c, yy_bp ) int c; -register char *yy_bp; +char *yy_bp; { - register char *yy_cp = yy_c_buf_p; + char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; @@ -1759,10 +1759,10 @@ register char *yy_bp; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ + int number_to_move = yy_n_chars + 2; + char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; - register char *source = + char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) @@ -2020,7 +2020,7 @@ char *s1; const char *s2; int n; { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index a5cb47f1a..1b5afb9b4 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -94,8 +94,8 @@ int argc; char *argv[]; { - register int fd; - register char *dir; + int fd; + char *dir; #if defined(WIN32) char fnamebuf[BUFSZ], encodedfnamebuf[BUFSZ]; #endif diff --git a/sys/share/pcunix.c b/sys/share/pcunix.c index 75b4feb4d..01a40ac76 100644 --- a/sys/share/pcunix.c +++ b/sys/share/pcunix.c @@ -75,7 +75,7 @@ int fd; static int eraseoldlocks() { - register int i; + int i; /* cannot use maxledgerno() here, because we need to find a lock name * before starting everything (including the dungeon initialization @@ -98,7 +98,7 @@ eraseoldlocks() void getlock() { - register int fd, c, ci, ct, ern; + int fd, c, ci, ct, ern; char tbuf[BUFSZ]; const char *fq_lock; # if defined(MSDOS) && defined(NO_TERMS) @@ -265,9 +265,9 @@ regularize(s) * normalize file name - we don't like .'s, /'s, spaces, and * lots of other things */ -register char *s; +char *s; { - register char *lp; + char *lp; for (lp = s; *lp; lp++) if (*lp <= ' ' || *lp == '"' || (*lp >= '*' && *lp <= ',') || diff --git a/sys/share/random.c b/sys/share/random.c index 02b50c5d4..e9e627acd 100644 --- a/sys/share/random.c +++ b/sys/share/random.c @@ -206,7 +206,7 @@ srandom( x ) unsigned x; { - register int i; + int i; if( rand_type == TYPE_0 ) { state[ 0 ] = x; @@ -247,7 +247,7 @@ initstate( seed, arg_state, n ) char *arg_state; /* pointer to state array */ int n; /* # bytes of state info */ { - register char *ostate = (char *)( &state[ -1 ] ); + char *ostate = (char *)( &state[ -1 ] ); if( rand_type == TYPE_0 ) state[ -1 ] = rand_type; else state[ -1 ] = MAX_TYPES*(rptr - state) + rand_type; @@ -314,9 +314,9 @@ setstate( arg_state ) char *arg_state; { - register long *new_state = (long *)arg_state; - register int type = new_state[0]%MAX_TYPES; - register int rear = new_state[0]/MAX_TYPES; + long *new_state = (long *)arg_state; + int type = new_state[0]%MAX_TYPES; + int rear = new_state[0]/MAX_TYPES; char *ostate = (char *)( &state[ -1 ] ); if( rand_type == TYPE_0 ) state[ -1 ] = rand_type; diff --git a/sys/share/tclib.c b/sys/share/tclib.c index fa33a8934..a1997521f 100644 --- a/sys/share/tclib.c +++ b/sys/share/tclib.c @@ -435,8 +435,8 @@ const char *string; /* characters to output */ int range; /* number of lines affected, used for `*' delays */ int (*output_func)(); /* actual output routine; return value ignored */ { - register int c, num = 0; - register const char *p = string; + int c, num = 0; + const char *p = string; if (!p || !*p) return; diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c index 8b0b4c2a8..705002859 100644 --- a/sys/share/unixtty.c +++ b/sys/share/unixtty.c @@ -214,13 +214,13 @@ settty(const char *s) void setftty(void) { -register int ef = 0; /* desired value of flags & ECHO */ +int ef = 0; /* desired value of flags & ECHO */ #ifdef LINT /* cf = CBRKON(CBRKMASK); const expr to initialize is ok */ -register int cf = 0; +int cf = 0; #else -register int cf = CBRKON(CBRKMASK); /* desired value of flags & CBREAK */ +int cf = CBRKON(CBRKMASK); /* desired value of flags & CBREAK */ #endif -register int change = 0; +int change = 0; iflags.cbreak = ON; iflags.echo = OFF; /* Should use (ECHO|CRMOD) here instead of ECHO */ diff --git a/sys/share/uudecode.c b/sys/share/uudecode.c index b5ef43abd..a5c9b9759 100644 --- a/sys/share/uudecode.c +++ b/sys/share/uudecode.c @@ -240,7 +240,7 @@ int n; char * index(sp, c) -register char *sp, c; +char *sp, c; { do { if (*sp == c) diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 13639c233..74dad7b3e 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -395,7 +395,7 @@ really_move_cursor() void cmov(x, y) -register int x, y; +int x, y; { ttyDisplay->cury = y; ttyDisplay->curx = x; @@ -889,7 +889,7 @@ void win32con_toggle_cursor_info() void map_subkeyvalue(op) -register char *op; +char *op; { char digits[] = "0123456789"; int length, i, idx, val; diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index 5fb80fc71..29c2ad71f 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -157,9 +157,9 @@ def_kbhit() void nt_regularize(s) /* normalize file name */ -register char *s; +char *s; { - register unsigned char *lp; + unsigned char *lp; for (lp = s; *lp; lp++) if ( *lp == '?' || *lp == '"' || *lp == '\\' || diff --git a/util/lev_main.c b/util/lev_main.c index 430329635..69c07ed0c 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -1010,7 +1010,7 @@ get_floor_type(char c) int get_room_type(char *s) { - register int i; + int i; SpinCursor(3); for(i=0; room_types[i].name; i++) @@ -1025,7 +1025,7 @@ get_room_type(char *s) int get_trap_type(char *s) { - register int i; + int i; SpinCursor(3); for (i=0; trap_types[i].name; i++) @@ -1040,7 +1040,7 @@ get_trap_type(char *s) int get_monster_id(char *s, char c) { - register int i, class; + int i, class; SpinCursor(3); class = c ? def_char_to_monclass(c) : 0; @@ -1203,8 +1203,8 @@ add_opcode(sp_lev *sp, int opc, genericptr_t dat) void scan_map(char *map, sp_lev *sp) { - register int i, len; - register char *s1, *s2; + int i, len; + char *s1, *s2; long max_len = 0; long max_hig = 0; char *tmpmap[ROWNO]; diff --git a/util/makedefs.c b/util/makedefs.c index 7dea87c54..3a592cd98 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -326,9 +326,9 @@ static char *xcrypt(const char *str) { /* duplicated in src/hacklib.c */ static char buf[BUFSZ]; - register const char *p; - register char *q; - register int bitmask; + const char *p; + char *q; + int bitmask; for (bitmask = 1, p = str, q = buf; *p; q++) { *q = *p++; @@ -419,7 +419,7 @@ do_rumors(void) static void make_version(void) { - register int i; + int i; /* * integer version number @@ -840,8 +840,8 @@ static const char *window_opts[] = { void do_options(void) { - register int i, length; - register const char *str, *indent = " "; + int i, length; + const char *str, *indent = " "; char versbuf[64]; filename[0]='\0'; @@ -1072,7 +1072,7 @@ do_oracles(void) boolean in_oracle, ok; long txt_offset, offset, fpos; int oracle_cnt; - register int i; + int i; Sprintf(tempfile, DATA_TEMPLATE, "oracles.tmp"); filename[0]='\0'; @@ -1286,8 +1286,8 @@ do_dungeon(void) static boolean ranged_attk(struct permonst *ptr) { - register int i, j; - register int atk_mask = (1<mattk[i].aatyp) >= AT_WEAP || (atk_mask & (1<dismiss_more : '\n'; + int c, x = ttyDisplay ? (int) ttyDisplay->dismiss_more : '\n'; morc = 0; diff --git a/win/tty/termcap.c b/win/tty/termcap.c index 04f69d15f..ea6918cab 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -192,10 +192,10 @@ convert_uchars( void tty_startup(int *wid, int *hgt) { - register int i; + int i; #ifdef TERMLIB - register const char *term; - register char *tptr; + const char *term; + char *tptr; char *tbufptr, *pc; #endif @@ -547,7 +547,7 @@ static void tty_ascgraphics_hilite_fixup(); static void tty_ascgraphics_hilite_fixup(void) { - register int c; + int c; for (c = 0; c < CLR_MAX / 2; c++) if (c != CLR_BLACK) { @@ -689,7 +689,7 @@ cl_end(void) else { /* no-CE fix - free after Harold Rynes */ /* this looks terrible, especially on a slow terminal but is better than nothing */ - register int cx = ttyDisplay->curx+1; + int cx = ttyDisplay->curx+1; while(cx < CO) { xputc(' '); @@ -815,7 +815,7 @@ void tty_delay_output(void) { #if defined(MICRO) - register int i; + int i; #endif if (iflags.debug_fuzzer) { return; @@ -845,9 +845,9 @@ tty_delay_output(void) else if(ospeed > 0 && ospeed < SIZE(tmspc10) && nh_CM) { /* delay by sending cm(here) an appropriate number of times */ - register int cmlen = strlen(tgoto(nh_CM, ttyDisplay->curx, + int cmlen = strlen(tgoto(nh_CM, ttyDisplay->curx, ttyDisplay->cury)); - register int i = 500 + tmspc10[ospeed]/2; + int i = 500 + tmspc10[ospeed]/2; while(i > 0) { cmov((int)ttyDisplay->curx, (int)ttyDisplay->cury); @@ -864,7 +864,7 @@ cl_eos(void) /* free after Robert Viduya */ if(nh_CD) xputs(nh_CD); else { - register int cy = ttyDisplay->cury+1; + int cy = ttyDisplay->cury+1; while(cy <= LI-2) { cl_end(); xputc('\n'); @@ -1243,7 +1243,7 @@ init_color_rgb(int color, uint64_t rgb) static void init_hilite(void) { - register int c; + int c; char *setf, *scratch; for (c = 0; c < SIZE(hilites); c++) { @@ -1360,7 +1360,7 @@ analyze_seq (str, fg, bg) char *str; int *fg, *bg; { - register int c, code; + int c, code; int len; # ifdef MICRO @@ -1418,7 +1418,7 @@ int *fg, *bg; static void init_hilite(void) { - register int c; + int c; # ifdef TOS extern unsigned long tos_numcolors; /* in tos.c */ static char NOCOL[] = "\033b0", COLHE[] = "\033q\033b0"; @@ -1501,7 +1501,7 @@ static void kill_hilite(void) { # ifndef TOS - register int c; + int c; for (c = 0; c < CLR_MAX / 2; c++) { if ((!iflags.wc2_newcolors) && diff --git a/win/tty/topl.c b/win/tty/topl.c index a264de109..d3a99ce42 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -21,7 +21,7 @@ static void removetopl(int); int tty_doprev_message(void) { - register struct WinDesc *cw = wins[WIN_MESSAGE]; + struct WinDesc *cw = wins[WIN_MESSAGE]; winid prevmsg_win; int i; @@ -157,7 +157,7 @@ show_topl(const char *str) void remember_topl(void) { - register struct WinDesc *cw = wins[WIN_MESSAGE]; + struct WinDesc *cw = wins[WIN_MESSAGE]; int idx = cw->maxrow; unsigned len = strlen(toplines) + 1; @@ -182,7 +182,7 @@ remember_topl(void) void addtopl(const char *s) { - register struct WinDesc *cw = wins[WIN_MESSAGE]; + struct WinDesc *cw = wins[WIN_MESSAGE]; tty_curs(BASE_WINDOW, cw->curx+1, cw->cury); putsyms(s); @@ -231,8 +231,8 @@ more(void) void update_topl(const char *bp) { - register char *tl, *otl; - register int n0; + char *tl, *otl; + int n0; int notdied = 1; struct WinDesc *cw = wins[WIN_MESSAGE]; @@ -278,7 +278,7 @@ update_topl(const char *bp) static void topl_putsym(char c) { - register struct WinDesc *cw = wins[WIN_MESSAGE]; + struct WinDesc *cw = wins[WIN_MESSAGE]; if(cw == (struct WinDesc *) 0) panic("Putsym window MESSAGE nonexistant"); @@ -344,7 +344,7 @@ tty_yn_function(const char *query, const char *resp, char def) * be shown in the prompt to the user but will be acceptable as input. */ { - register char q; + char q; char rtmp[40]; boolean digit_ok, allow_num; struct WinDesc *cw = wins[WIN_MESSAGE]; diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 364fdb7ea..e7f8500ca 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -252,7 +252,7 @@ static void winch(void) { int oldLI = LI, oldCO = CO, i; - register struct WinDesc *cw; + struct WinDesc *cw; getwindowsz(); if((oldLI != LI || oldCO != CO) && ttyDisplay) { @@ -1294,7 +1294,7 @@ void tty_askname(void) { static char who_are_you[] = "Who are you? "; - register int c, ct, tryct = 0; + int c, ct, tryct = 0; tty_putstr(BASE_WINDOW, 0, ""); do { @@ -1610,7 +1610,7 @@ free_window_info(struct WinDesc *cw, boolean free_data) void tty_clear_nhwindow(winid window) { - register struct WinDesc *cw = 0; + struct WinDesc *cw = 0; if(window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0) panic(winpanicstr, window); @@ -2158,7 +2158,7 @@ static void process_text_window(winid window, struct WinDesc *cw) { int i, n, attr; - register char *cp; + char *cp; for (n = 0, i = 0; i < cw->maxrow; i++) { if (!cw->offx && (n + cw->offy == ttyDisplay->rows - 1)) { @@ -2232,7 +2232,7 @@ tty_display_nhwindow( winid window, boolean blocking) /**< with ttys, all windows are blocking */ { - register struct WinDesc *cw = 0; + struct WinDesc *cw = 0; if(window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0) panic(winpanicstr, window); @@ -2311,7 +2311,7 @@ tty_display_nhwindow( void tty_dismiss_nhwindow(winid window) { - register struct WinDesc *cw = 0; + struct WinDesc *cw = 0; if(window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0) panic(winpanicstr, window); @@ -2355,7 +2355,7 @@ tty_dismiss_nhwindow(winid window) void tty_destroy_nhwindow(winid window) { - register struct WinDesc *cw = 0; + struct WinDesc *cw = 0; if(window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0) panic(winpanicstr, window); @@ -2454,7 +2454,7 @@ tty_curs( static void tty_putsym(winid window, int x, int y, char ch) { - register struct WinDesc *cw = 0; + struct WinDesc *cw = 0; if(window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0) panic(winpanicstr, window); @@ -2493,8 +2493,8 @@ compress_str(const char *str) static char cbuf[BUFSZ]; /* compress in case line too long */ if((int)strlen(str) >= CO) { - register const char *bp0 = str; - register char *bp1 = cbuf; + const char *bp0 = str; + char *bp1 = cbuf; do { #ifdef CLIPPING @@ -2517,10 +2517,10 @@ tty_putstr_extended( const char *str, const int *attributes) { - register struct WinDesc *cw = 0; - register char *ob; - register const char *nb; - register long i, j, n0; + struct WinDesc *cw = 0; + char *ob; + const char *nb; + long i, j, n0; /* Assume there's a real problem if the window is missing -- * probably a panic message @@ -2721,9 +2721,9 @@ boolean complain) { /* use external pager; this may give security problems */ #ifdef FILE_AREAS - register int fd = open_area(farea, fname, 0, 0); + int fd = open_area(farea, fname, 0, 0); #else - register int fd = open(fname, 0); + int fd = open(fname, 0); #endif if(fd < 0) { @@ -2823,7 +2823,7 @@ tty_add_menu( unsigned int itemflags) /**< itemflags such as MENU_ITEMFLAGS_SELECTED */ { boolean preselected = ((itemflags & MENU_ITEMFLAGS_SELECTED) != 0); - register struct WinDesc *cw = 0; + struct WinDesc *cw = 0; tty_menu_item *item; if (str == (const char*) 0) @@ -2981,7 +2981,7 @@ tty_end_menu( int tty_select_menu(winid window, int how, menu_item **menu_list) { - register struct WinDesc *cw = 0; + struct WinDesc *cw = 0; tty_menu_item *curr; menu_item *mi; int n, cancelled; @@ -3086,8 +3086,8 @@ tty_wait_synch(void) void docorner(int xmin, int ymax) { - register int y; - register struct WinDesc *cw = wins[WIN_MAP]; + int y; + struct WinDesc *cw = wins[WIN_MAP]; #if defined(SIGWINCH) && defined(CLIPPING) if(ymax > LI) ymax = LI; /* can happen if window gets smaller */ @@ -3140,7 +3140,7 @@ end_glyphout(void) void g_putch(int in_ch) { - register char ch = (char)in_ch; + char ch = (char)in_ch; # if defined(ASCIIGRAPH) && !defined(NO_TERMS) if (iflags.IBMgraphics || iflags.eight_bit_tty) { From f1ac6f3781cb24587ff4c147c0856dbd843abb9c Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 1 Jul 2022 05:48:18 +0200 Subject: [PATCH 5/7] Change xchar to other typedefs One of the drivers of this change was that screen coordinates require a type that can hold values greater than 127. Parameters to the window port routines require a large type in order to be able to have values a fair bit larger than COLNO and ROWNO passed to them, particularly for their use to the right of the map window. This splits the uses of xchar into 3 different situations, and adjusts their type and size: xchar | ----------------------- | | | coordxy xint16 xint8 coordxy: Actual x or y coordinates for various things (moved to 16-bits). xint16: Same data size as coordxy, but for non-coordinate use (16-bits). xint8: There are only a few use cases initially, where it was very plain to see that the variable could remain as 8-bits, rather than be bumped to 16-bits. There are probably more such cases that could be changed after additional review. UnNetHack specific note: First all xint8 and xint16 instances were copied over from vanilla. Then all remaining instances of xchar were replaced with coordxy and all type mismatching catched by the compiler fixed. Mostly equivalent with nethack/nethack@30b557f7d5 and nethack/nethack@3004cf2d3 --- include/color.h | 2 +- include/coord.h | 2 +- include/decl.h | 18 +- include/dungeon.h | 20 +- include/engrave.h | 4 +- include/extern.h | 4594 ++++++++++++++++----------------- include/global.h | 47 +- include/lev.h | 6 +- include/mextra.h | 8 +- include/mkroom.h | 2 +- include/monst.h | 10 +- include/obj.h | 8 +- include/rect.h | 4 +- include/skills.h | 8 +- include/sp_lev.h | 56 +- include/spell.h | 6 +- include/tradstdc.h | 27 - include/trap.h | 2 +- include/winami.h | 4 +- include/wincurs.h | 6 +- include/winlisp.h | 4 +- include/winprocs.h | 4 +- include/wintty.h | 18 +- include/wintype.h | 6 + include/you.h | 30 +- src/allmain.c | 2 +- src/apply.c | 26 +- src/artifact.c | 8 +- src/attrib.c | 2 +- src/ball.c | 14 +- src/bones.c | 4 +- src/cmd.c | 19 +- src/dbridge.c | 57 +- src/detect.c | 34 +- src/dig.c | 38 +- src/display.c | 74 +- src/do.c | 12 +- src/do_name.c | 20 +- src/dog.c | 17 +- src/dogmove.c | 26 +- src/dokick.c | 30 +- src/dothrow.c | 26 +- src/dungeon.c | 107 +- src/engrave.c | 32 +- src/exper.c | 2 +- src/explode.c | 16 +- src/extralev.c | 14 +- src/files.c | 6 +- src/fountain.c | 8 +- src/hack.c | 84 +- src/hacklib.c | 2 +- src/invent.c | 22 +- src/light.c | 6 +- src/lock.c | 14 +- src/mail.c | 4 +- src/makemon.c | 12 +- src/mapglyph.c | 2 +- src/mhitm.c | 2 +- src/mhitu.c | 2 +- src/mklev.c | 56 +- src/mkmap.c | 6 +- src/mkmaze.c | 66 +- src/mkobj.c | 34 +- src/mkroom.c | 6 +- src/mksheol.c | 8 +- src/mon.c | 31 +- src/monmove.c | 19 +- src/mplayer.c | 4 +- src/mthrowu.c | 20 +- src/muse.c | 2 +- src/music.c | 2 +- src/objnam.c | 2 +- src/pager.c | 20 +- src/pickup.c | 10 +- src/pray.c | 6 +- src/priest.c | 14 +- src/read.c | 18 +- src/region.c | 30 +- src/restore.c | 14 +- src/save.c | 10 +- src/shk.c | 46 +- src/sp_lev.c | 216 +- src/steed.c | 2 +- src/teleport.c | 36 +- src/timeout.c | 16 +- src/topten.c | 4 +- src/track.c | 2 +- src/trap.c | 42 +- src/tutorial.c | 4 +- src/vault.c | 24 +- src/vision.c | 145 +- src/wizard.c | 8 +- src/worm.c | 30 +- src/worn.c | 2 +- src/zap.c | 53 +- tests/options/mocks.h | 4 +- tests/wishing/mocks.h | 40 +- util/recover.c | 478 ++-- win/X11/winmap.c | 2 +- win/curses/cursmain.c | 6 +- win/curses/cursmisc.c | 2 +- win/curses/cursmisc.h | 2 +- win/dummy/dummy_graphics.c | 6 +- win/dummy/dummy_graphics.h | 4 +- win/lisp/winlisp.c | 4 +- win/tty/wintty.c | 7 +- win/unsupported/gem/wingem1.c | 10 - win/win32/mhmsg.h | 6 +- win/win32/mswproc.c | 6 +- win/win32/winMS.h | 4 +- 110 files changed, 3627 insertions(+), 3602 deletions(-) diff --git a/include/color.h b/include/color.h index 6faefc019..efbaa7d37 100644 --- a/include/color.h +++ b/include/color.h @@ -89,7 +89,7 @@ struct color_option { struct percent_color_option { - xchar statclrtype; + coordxy statclrtype; int percentage; struct color_option color_option; const struct percent_color_option *next; diff --git a/include/coord.h b/include/coord.h index 7531213f8..85188faad 100644 --- a/include/coord.h +++ b/include/coord.h @@ -6,7 +6,7 @@ #define COORD_H typedef struct nhcoord { - int8_t x, y; + coordxy x, y; } coord; #endif /* COORD_H */ diff --git a/include/decl.h b/include/decl.h index 1ee6a6810..b995656e1 100644 --- a/include/decl.h +++ b/include/decl.h @@ -70,13 +70,13 @@ E struct dgn_topology { /* special dungeon levels for speed */ d_level d_fire_level; d_level d_air_level; d_level d_astral_level; - xchar d_tower_dnum; - xchar d_sokoban_dnum; - xchar d_mines_dnum, d_quest_dnum; - xchar d_mall_dnum; - xchar d_sheol_dnum; - xchar d_moria_dnum; - xchar d_dragon_caves_dnum; + xint16 d_tower_dnum; + xint16 d_sokoban_dnum; + xint16 d_mines_dnum, d_quest_dnum; + xint16 d_mall_dnum; + xint16 d_sheol_dnum; + xint16 d_moria_dnum; + xint16 d_dragon_caves_dnum; d_level d_qstart_level, d_qlocate_level, d_nemesis_level; d_level d_knox_level; d_level d_nymph_level; @@ -506,7 +506,7 @@ E char *fqn_prefix_names[PREFIX_COUNT]; #endif struct opvar { - xchar spovartyp; /* one of SPOVAR_foo */ + xint16 spovartyp; /* one of SPOVAR_foo */ union { char *str; long l; @@ -524,7 +524,7 @@ extern struct autopickup_exception *apelist; #endif /* AUTOPICKUP_EXCEPTIONS */ struct _plinemsg { - xchar msgtype; + xint16 msgtype; char *pattern; struct _plinemsg *next; }; diff --git a/include/dungeon.h b/include/dungeon.h index 8d97dd613..85d3244f0 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -15,8 +15,8 @@ typedef struct d_flags { /* dungeon/level type flags */ } d_flags; typedef struct d_level { /* basic dungeon level element */ - xchar dnum; /* dungeon number */ - xchar dlevel; /* level number */ + xint16 dnum; /* dungeon number */ + xint16 dlevel; /* level number */ } d_level; typedef struct s_level { /* special dungeon level element */ @@ -29,7 +29,7 @@ typedef struct s_level { /* special dungeon level element */ } s_level; typedef struct stairway { /* basic stairway identifier */ - xchar sx, sy; /* x / y location of the stair */ + coordxy sx, sy; /* x / y location of the stair */ d_level tolev; /* where does it go */ char up; /* what type of stairway (up/down) */ } stairway; @@ -44,10 +44,10 @@ typedef struct stairway { /* basic stairway identifier */ #define LR_DOWNTELE 6 typedef struct dest_area { /* non-stairway level change indentifier */ - xchar lx, ly; /* "lower" left corner (near [0,0]) */ - xchar hx, hy; /* "upper" right corner (near [COLNO,ROWNO]) */ - xchar nlx, nly; /* outline of invalid area */ - xchar nhx, nhy; /* opposite corner of invalid area */ + coordxy lx, ly; /* "lower" left corner (near [0,0]) */ + coordxy hx, hy; /* "upper" right corner (near [COLNO,ROWNO]) */ + coordxy nlx, nly; /* outline of invalid area */ + coordxy nhx, nhy; /* opposite corner of invalid area */ } dest_area; typedef struct dungeon { /* basic dungeon identifier */ @@ -55,9 +55,9 @@ typedef struct dungeon { /* basic dungeon identifier */ char proto[15]; /* name of prototype file (eg. "tower") */ char boneid; /* character to id dungeon in bones files */ d_flags flags; /* dungeon flags */ - xchar entry_lev; /* entry level */ - xchar num_dunlevs; /* number of levels in this dungeon */ - xchar dunlev_ureached; /* how deep you have been in this dungeon */ + xint16 entry_lev; /* entry level */ + xint16 num_dunlevs; /* number of levels in this dungeon */ + xint16 dunlev_ureached; /* how deep you have been in this dungeon */ int ledger_start, /* the starting depth in "real" terms */ depth_start; /* the starting depth in "logical" terms */ } dungeon; diff --git a/include/engrave.h b/include/engrave.h index 44b238662..6091cd6f8 100644 --- a/include/engrave.h +++ b/include/engrave.h @@ -8,10 +8,10 @@ struct engr { struct engr *nxt_engr; char *engr_txt; - xchar engr_x, engr_y; + coordxy engr_x, engr_y; unsigned engr_lth; /* for save & restore; not length of text */ long engr_time; /* moment engraving was (will be) finished */ - xchar engr_type; + xint8 engr_type; #define DUST 1 #define ENGRAVE 2 #define BURN 3 diff --git a/include/extern.h b/include/extern.h index 9bab54619..da99bb982 100644 --- a/include/extern.h +++ b/include/extern.h @@ -9,9 +9,9 @@ /* ### alloc.c ### */ #if 0 -E long *alloc(unsigned int); +extern long *alloc(unsigned int); #endif -E char *fmt_ptr(const genericptr); +extern char *fmt_ptr(const genericptr); /* This next pre-processor directive covers almost the entire file, * interrupted only occasionally to pick up specific functions as needed. */ @@ -20,999 +20,999 @@ E char *fmt_ptr(const genericptr); /* ### allmain.c ### */ extern void early_init(void); -E void moveloop(boolean); -E void stop_occupation(void); -E void display_gamewindows(void); -E void newgame(void); -E void welcome(boolean); -E boolean can_regenerate(void); +extern void moveloop(boolean); +extern void stop_occupation(void); +extern void display_gamewindows(void); +extern void newgame(void); +extern void welcome(boolean); +extern boolean can_regenerate(void); #if defined(RECORD_REALTIME) || defined(REALTIME_ON_BOTL) -E time_t get_realtime(void); +extern time_t get_realtime(void); #endif /* ### apply.c ### */ -E int doapply(void); -E int dorub(void); -E int dojump(void); -E int jump(int); -E int number_leashed(void); -E void o_unleash(struct obj *); -E void m_unleash(struct monst *, boolean); -E void unleash_all(void); -E boolean leashable(struct monst *); -E boolean next_to_u(void); -E struct obj *get_mleash(struct monst *); -E void check_leash(xchar, xchar); -E boolean um_dist(xchar, xchar, xchar); -E boolean snuff_candle(struct obj *); -E boolean snuff_lit(struct obj *); -E boolean catch_lit(struct obj *); -E void fix_attributes_and_properties(struct obj *, int); -E boolean tinnable(struct obj *); -E void reset_trapset(void); -E void fig_transform(ANY_P *, long); -E int unfixable_trouble_count(boolean); +extern int doapply(void); +extern int dorub(void); +extern int dojump(void); +extern int jump(int); +extern int number_leashed(void); +extern void o_unleash(struct obj *); +extern void m_unleash(struct monst *, boolean); +extern void unleash_all(void); +extern boolean leashable(struct monst *); +extern boolean next_to_u(void); +extern struct obj *get_mleash(struct monst *); +extern void check_leash(coordxy, coordxy); +extern boolean um_dist(coordxy, coordxy, xint16); +extern boolean snuff_candle(struct obj *); +extern boolean snuff_lit(struct obj *); +extern boolean catch_lit(struct obj *); +extern void fix_attributes_and_properties(struct obj *, int); +extern boolean tinnable(struct obj *); +extern void reset_trapset(void); +extern void fig_transform(ANY_P *, long); +extern int unfixable_trouble_count(boolean); /* ### artifact.c ### */ -E void init_artifacts(void); -E void save_artifacts(int); -E void restore_artifacts(int); -E const char *artiname(int); -E struct obj *mk_artifact(struct obj *, aligntyp); -E const char *artifact_name(const char *, short *); -E boolean exist_artifact(int, const char *); -E void artifact_exists(struct obj *, const char *, boolean); -E int nartifact_exist(void); -E boolean spec_ability(struct obj *, unsigned long); -E boolean confers_luck(struct obj *); -E boolean arti_reflects(struct obj *); -E boolean shade_glare(struct obj *); -E boolean restrict_name(struct obj *, const char *, boolean); -E boolean defends(int, struct obj *); -E boolean defends_when_carried(int, struct obj *); -E boolean protects(struct obj *, boolean); -E void set_artifact_intrinsic(struct obj *, boolean, long); -E int touch_artifact(struct obj *, struct monst *); -E int spec_abon(struct obj *, struct monst *); -E int spec_dbon(struct obj *, struct monst *, int); -E void discover_artifact(xchar); -E boolean undiscovered_artifact(xchar); -E int disp_artifact_discoveries(winid); -E boolean artifact_hit(struct monst *, struct monst *, struct obj *, int *, int); -E int doinvoke(void); -E void arti_speak(struct obj *); -E boolean artifact_light(struct obj *); -E long spec_m2(struct obj *); -E boolean artifact_has_invprop(struct obj *, uchar); -E long arti_cost(struct obj *); -E boolean MATCH_WARN_OF_MON(struct monst *); -E struct obj *what_gives(long *); -E const char *get_warned_of_monster(struct obj *); -E const char *glow_color(int); -E const char *glow_verb(int, boolean); -E void Sting_effects(int); -E int retouch_object(struct obj **, boolean); -E void retouch_equipment(int); -E void mkot_trap_warn(void); -E boolean is_magic_key(struct monst *, struct obj *); -E struct obj *has_magic_key(struct monst *); +extern void init_artifacts(void); +extern void save_artifacts(int); +extern void restore_artifacts(int); +extern const char *artiname(int); +extern struct obj *mk_artifact(struct obj *, aligntyp); +extern const char *artifact_name(const char *, short *); +extern boolean exist_artifact(int, const char *); +extern void artifact_exists(struct obj *, const char *, boolean); +extern int nartifact_exist(void); +extern boolean spec_ability(struct obj *, unsigned long); +extern boolean confers_luck(struct obj *); +extern boolean arti_reflects(struct obj *); +extern boolean shade_glare(struct obj *); +extern boolean restrict_name(struct obj *, const char *, boolean); +extern boolean defends(int, struct obj *); +extern boolean defends_when_carried(int, struct obj *); +extern boolean protects(struct obj *, boolean); +extern void set_artifact_intrinsic(struct obj *, boolean, long); +extern int touch_artifact(struct obj *, struct monst *); +extern int spec_abon(struct obj *, struct monst *); +extern int spec_dbon(struct obj *, struct monst *, int); +extern void discover_artifact(xint16); +extern boolean undiscovered_artifact(xint16); +extern int disp_artifact_discoveries(winid); +extern boolean artifact_hit(struct monst *, struct monst *, struct obj *, int *, int); +extern int doinvoke(void); +extern void arti_speak(struct obj *); +extern boolean artifact_light(struct obj *); +extern long spec_m2(struct obj *); +extern boolean artifact_has_invprop(struct obj *, uchar); +extern long arti_cost(struct obj *); +extern boolean MATCH_WARN_OF_MON(struct monst *); +extern struct obj *what_gives(long *); +extern const char *get_warned_of_monster(struct obj *); +extern const char *glow_color(int); +extern const char *glow_verb(int, boolean); +extern void Sting_effects(int); +extern int retouch_object(struct obj **, boolean); +extern void retouch_equipment(int); +extern void mkot_trap_warn(void); +extern boolean is_magic_key(struct monst *, struct obj *); +extern struct obj *has_magic_key(struct monst *); /* ### attrib.c ### */ -E boolean adjattrib(int, int, int); -E void change_luck(schar); -E int stone_luck(boolean); -E boolean has_luckitem(void); -E void set_moreluck(void); -E void gainstr(struct obj *, int); -E void losestr(int); -E void restore_attrib(void); -E void exercise(int, boolean); -E void exerchk(void); -E void reset_attribute_clock(void); -E void init_attr(int); -E void redist_attr(void); -E void adjabil(int, int); -E int newhp(void); -E schar acurr(int); -E schar acurrstr(void); -E void adjalign(int); -E const char * beautiful(void); -E int uhp(void); -E int uhpmax(void); -E boolean extremeattr(int); -E void uchangealign(int, int); +extern boolean adjattrib(int, int, int); +extern void change_luck(schar); +extern int stone_luck(boolean); +extern boolean has_luckitem(void); +extern void set_moreluck(void); +extern void gainstr(struct obj *, int); +extern void losestr(int); +extern void restore_attrib(void); +extern void exercise(int, boolean); +extern void exerchk(void); +extern void reset_attribute_clock(void); +extern void init_attr(int); +extern void redist_attr(void); +extern void adjabil(int, int); +extern int newhp(void); +extern schar acurr(int); +extern schar acurrstr(void); +extern void adjalign(int); +extern const char * beautiful(void); +extern int uhp(void); +extern int uhpmax(void); +extern boolean extremeattr(int); +extern void uchangealign(int, int); /* ### ball.c ### */ -E void ballrelease(boolean); -E void ballfall(void); -E void placebc(void); -E void unplacebc(void); -E void set_bc(int); -E void move_bc(int, int, xchar, xchar, xchar, xchar); -E boolean drag_ball(xchar, xchar, int *, xchar *, xchar *, xchar *, xchar *, boolean *, boolean); -E void drop_ball(xchar, xchar); -E void drag_down(void); -E void bc_sanity_check(void); +extern void ballrelease(boolean); +extern void ballfall(void); +extern void placebc(void); +extern void unplacebc(void); +extern void set_bc(int); +extern void move_bc(int, int, coordxy, coordxy, coordxy, coordxy); +extern boolean drag_ball(coordxy, coordxy, int *, coordxy *, coordxy *, coordxy *, coordxy *, boolean *, boolean); +extern void drop_ball(coordxy, coordxy); +extern void drag_down(void); +extern void bc_sanity_check(void); /* ### bones.c ### */ -E void sanitize_name(char *); -E void drop_upon_death(struct monst *, struct obj *, int, int); -E boolean can_make_bones(void); -E void savebones(struct obj *); -E int getbones(void); +extern void sanitize_name(char *); +extern void drop_upon_death(struct monst *, struct obj *, coordxy, coordxy); +extern boolean can_make_bones(void); +extern void savebones(struct obj *); +extern int getbones(void); /* ### botl.c ### */ -E int xlev_to_rank(int); -E int title_to_mon(const char *, int *, int *); -E void max_rank_sz(void); +extern int xlev_to_rank(int); +extern int title_to_mon(const char *, int *, int *); +extern void max_rank_sz(void); #ifdef SCORE_ON_BOTL -E long botl_score(void); +extern long botl_score(void); #endif -E int describe_level(char *); -E const char *rank(void); -E const char *rank_of(int, short, boolean); +extern int describe_level(char *); +extern const char *rank(void); +extern const char *rank_of(int, short, boolean); extern const char* botl_realtime(void); -E void bot(void); +extern void bot(void); #ifdef DUMP_LOG -E void bot1str(char *); -E void bot2str(char *); -E void bot3str(char *); +extern void bot1str(char *); +extern void bot2str(char *); +extern void bot3str(char *); #endif /* ### cmd.c ### */ -E char randomkey(void); +extern char randomkey(void); extern boolean redraw_cmd(char); extern char cmd_from_func(int(*)(void)); #ifdef USE_TRAMPOLI -E int doextcmd(void); -E int domonability(void); -E int doprev_message(void); -E int timed_occupation(void); -E int wiz_attributes(void); -E int enter_explore_mode(void); +extern int doextcmd(void); +extern int domonability(void); +extern int doprev_message(void); +extern int timed_occupation(void); +extern int wiz_attributes(void); +extern int enter_explore_mode(void); # ifdef WIZARD -E int wiz_detect(void); -E int wiz_genesis(void); -E int wiz_identify(void); -E int wiz_level_tele(void); -E int wiz_map(void); -E int wiz_where(void); -E int wiz_wish(void); +extern int wiz_detect(void); +extern int wiz_genesis(void); +extern int wiz_identify(void); +extern int wiz_level_tele(void); +extern int wiz_map(void); +extern int wiz_where(void); +extern int wiz_wish(void); # endif /* WIZARD */ #endif /* USE_TRAMPOLI */ -E void reset_occupations(void); -E void set_occupation(int (*)(void), const char *, int); +extern void reset_occupations(void); +extern void set_occupation(int (*)(void), const char *, int); #ifdef REDO -E char pgetchar(void); -E void pushch(char); -E void savech(char); +extern char pgetchar(void); +extern void pushch(char); +extern void savech(char); #endif #ifdef WIZARD -E void add_debug_extended_commands(void); +extern void add_debug_extended_commands(void); #endif /* WIZARD */ extern boolean bind_specialkey(uchar, const char *); extern char txt2key(char *); -E void parseautocomplete(char *, boolean); -E void reset_commands(boolean); -E void rhack(char *); -E int doextlist(void); -E int extcmd_via_menu(void); +extern void parseautocomplete(char *, boolean); +extern void reset_commands(boolean); +extern void rhack(char *); +extern int doextlist(void); +extern int extcmd_via_menu(void); extern boolean bind_key(uchar, const char *); -E void enlightenment(int, boolean); -E void show_conduct(int, boolean); -E int xytod(schar, schar); -E void dtoxy(coord *, int); -E int movecmd(char); -E int dxdy_moveok(void); -E int getdir(const char *); -E void confdir(void); -E const char *directionname(int); -E int isok(int, int); -E int get_adjacent_loc(const char *, const char *, xchar, xchar, coord *); -E const char *click_to_cmd(int, int, int); -E char readchar(void); -E int do_stair_travel(char); +extern void enlightenment(int, boolean); +extern void show_conduct(int, boolean); +extern int xytod(schar, schar); +extern void dtoxy(coord *, int); +extern int movecmd(char); +extern int dxdy_moveok(void); +extern int getdir(const char *); +extern void confdir(void); +extern const char *directionname(int); +extern int isok(coordxy, coordxy); +extern int get_adjacent_loc(const char *, const char *, coordxy, coordxy, coord *); +extern const char *click_to_cmd(coordxy, coordxy, int); +extern char readchar(void); +extern int do_stair_travel(char); #ifdef WIZARD -E void sanity_check(void); -#endif -E char* key2txt(uchar, char *); -E char yn_function(const char *, const char *, char); -E char paranoid_yn(const char *, boolean); -E void sokoban_trickster(void); -E void list_vanquished(char, boolean); -E void list_vanquishedonly(void); +extern void sanity_check(void); +#endif +extern char* key2txt(uchar, char *); +extern char yn_function(const char *, const char *, char); +extern char paranoid_yn(const char *, boolean); +extern void sokoban_trickster(void); +extern void list_vanquished(char, boolean); +extern void list_vanquishedonly(void); #ifdef TTY_GRAPHICS -E int tty_debug_show_colors(void); +extern int tty_debug_show_colors(void); #endif #ifdef CURSES_GRAPHICS -E int curses_debug_show_colors(void); +extern int curses_debug_show_colors(void); #endif /* ### dbridge.c ### */ -E boolean is_pool(int, int); -E boolean is_lava(int, int); -E boolean is_pool_or_lava(int, int); -E boolean is_ice(int, int); -E boolean is_moat(int, int); -E boolean is_swamp(int, int); -E boolean is_icewall(int, int); -E boolean is_any_icewall(int, int); -E schar db_under_typ(struct rm *lev); -E int is_drawbridge_wall(int, int); -E boolean is_db_wall(int, int); -E boolean find_drawbridge(int *, int*); -E boolean create_drawbridge(int, int, int, int); -E void open_drawbridge(int, int); -E boolean close_drawbridge(int, int); -E void destroy_drawbridge(int, int); +extern boolean is_pool(coordxy, coordxy); +extern boolean is_lava(coordxy, coordxy); +extern boolean is_pool_or_lava(coordxy, coordxy); +extern boolean is_ice(coordxy, coordxy); +extern boolean is_moat(coordxy, coordxy); +extern boolean is_swamp(coordxy, coordxy); +extern boolean is_icewall(coordxy, coordxy); +extern boolean is_any_icewall(coordxy, coordxy); +extern schar db_under_typ(struct rm *lev); +extern int is_drawbridge_wall(coordxy, coordxy); +extern boolean is_db_wall(coordxy, coordxy); +extern boolean find_drawbridge(coordxy *, coordxy *); +extern boolean create_drawbridge(coordxy, coordxy, int, int); +extern void open_drawbridge(coordxy, coordxy); +extern boolean close_drawbridge(coordxy, coordxy); +extern void destroy_drawbridge(coordxy, coordxy); /* ### decl.c ### */ -E void decl_init(void); +extern void decl_init(void); /* ### detect.c ### */ -E boolean trapped_chest_at(int, int, int); -E boolean trapped_door_at(int, int, int); -E struct obj *o_in(struct obj*, char); -E struct obj *o_material(struct obj*, unsigned); -E int gold_detect(struct obj *); -E int food_detect(struct obj *); -E int object_detect(struct obj *, int, boolean); -E int monster_detect(struct obj *, int); -E int trap_detect(struct obj *); -E const char *level_distance(d_level *); -E void use_crystal_ball(struct obj **); -E void do_mapping(void); -E void do_vicinity_map(void); -E void cvt_sdoor_to_door(struct rm *); +extern boolean trapped_chest_at(int, coordxy, coordxy); +extern boolean trapped_door_at(int, coordxy, coordxy); +extern struct obj *o_in(struct obj*, char); +extern struct obj *o_material(struct obj*, unsigned); +extern int gold_detect(struct obj *); +extern int food_detect(struct obj *); +extern int object_detect(struct obj *, int, boolean); +extern int monster_detect(struct obj *, int); +extern int trap_detect(struct obj *); +extern const char *level_distance(d_level *); +extern void use_crystal_ball(struct obj **); +extern void do_mapping(void); +extern void do_vicinity_map(void); +extern void cvt_sdoor_to_door(struct rm *); #ifdef USE_TRAMPOLI -E void findone(int, int, genericptr_t); -E void openone(int, int, genericptr_t); -#endif -E int findit(void); -E int openit(void); -E boolean detecting(void (*)(int, int, void *)); -E void find_trap(struct trap *); -E int dosearch0(int); -E int dosearch(void); -E void sokoban_detect(void); +extern void findone(coordxy, coordxy, genericptr_t); +extern void openone(coordxy, coordxy, genericptr_t); +#endif +extern int findit(void); +extern int openit(void); +extern boolean detecting(void(*)(coordxy, coordxy, void *)); +extern void find_trap(struct trap *); +extern int dosearch0(int); +extern int dosearch(void); +extern void sokoban_detect(void); extern void reveal_terrain(int, int); /* ### dig.c ### */ -E int dig_typ(struct obj *, xchar, xchar); -E boolean is_digging(void); +extern int dig_typ(struct obj *, coordxy, coordxy); +extern boolean is_digging(void); #ifdef USE_TRAMPOLI -E int dig(void); -#endif -E int holetime(void); -E boolean dig_check(struct monst *, boolean, int, int); -E void digactualhole(int, int, struct monst *, int); -E boolean dighole(boolean, boolean, coord *); -E int use_pick_axe(struct obj *); -E int use_pick_axe2(struct obj *); -E boolean mdig_tunnel(struct monst *); -E void draft_message(boolean); -E void watch_dig(struct monst *, xchar, xchar, boolean); -E void zap_dig(void); -E struct obj *bury_an_obj(struct obj *, boolean *); -E void bury_objs(int, int); -E void unearth_objs(int, int); -E void rot_organic(ANY_P *, long); -E void rot_corpse(ANY_P *, long); -E struct obj *buried_ball(coord *); -E void buried_ball_to_punishment(void); -E void buried_ball_to_freedom(void); -E schar fillholetyp(int, int, boolean); -E void liquid_flow(xchar, xchar, schar, struct trap *, const char *); -E boolean conjoined_pits(struct trap *, struct trap *, boolean); +extern int dig(void); +#endif +extern int holetime(void); +extern boolean dig_check(struct monst *, boolean, coordxy, coordxy); +extern void digactualhole(coordxy, coordxy, struct monst *, int); +extern boolean dighole(boolean, boolean, coord *); +extern int use_pick_axe(struct obj *); +extern int use_pick_axe2(struct obj *); +extern boolean mdig_tunnel(struct monst *); +extern void draft_message(boolean); +extern void watch_dig(struct monst *, coordxy, coordxy, boolean); +extern void zap_dig(void); +extern struct obj *bury_an_obj(struct obj *, boolean *); +extern void bury_objs(coordxy, coordxy); +extern void unearth_objs(coordxy, coordxy); +extern void rot_organic(ANY_P *, long); +extern void rot_corpse(ANY_P *, long); +extern struct obj *buried_ball(coord *); +extern void buried_ball_to_punishment(void); +extern void buried_ball_to_freedom(void); +extern schar fillholetyp(int, int, boolean); +extern void liquid_flow(coordxy, coordxy, schar, struct trap *, const char *); +extern boolean conjoined_pits(struct trap *, struct trap *, boolean); #if 0 -E void bury_monst(struct monst *); -E void bury_you(void); -E void unearth_you(void); -E void escape_tomb(void); -E void bury_obj(struct obj *); +extern void bury_monst(struct monst *); +extern void bury_you(void); +extern void unearth_you(void); +extern void escape_tomb(void); +extern void bury_obj(struct obj *); #endif /* ### display.c ### */ #ifdef INVISIBLE_OBJECTS -E struct obj * vobj_at(xchar, xchar); +extern struct obj * vobj_at(coordxy, coordxy); #endif /* INVISIBLE_OBJECTS */ extern int is_safemon(struct monst *); -E void magic_map_background(xchar, xchar, int); -E void map_background(xchar, xchar, int); -E void map_trap(struct trap *, int); -E void map_object(struct obj *, int); -E void map_invisible(xchar, xchar); -E boolean unmap_invisible(int, int); -E void unmap_object(int, int); -extern struct obj *vobj_at(int, int); -E void map_location(int, int, int); -E void feel_newsym(xchar, xchar); -E void feel_location(xchar, xchar); -E void newsym(int, int); -E void newsym_force(int, int); -E void shieldeff(xchar, xchar); -E void tmp_at(int, int); -extern void flash_glyph_at(int, int, int, int); -E void swallowed(int); -E void under_ground(int); -E void under_water(int); -E void see_monsters(void); -E void set_mimic_blocking(void); -E void see_objects(void); -E void see_traps(void); -E void curs_on_u(void); -E int doredraw(void); -E void docrt(void); -E void show_glyph(int, int, int); -E void clear_glyph_buffer(void); -E void row_refresh(int, int, int); -E void cls(void); -E void flush_screen(int); +extern void magic_map_background(coordxy, coordxy, int); +extern void map_background(coordxy, coordxy, int); +extern void map_trap(struct trap *, int); +extern void map_object(struct obj *, int); +extern void map_invisible(coordxy, coordxy); +extern boolean unmap_invisible(coordxy, coordxy); +extern void unmap_object(coordxy, coordxy); +extern struct obj *vobj_at(coordxy, coordxy); +extern void map_location(coordxy, coordxy, int); +extern void feel_newsym(coordxy, coordxy); +extern void feel_location(coordxy, coordxy); +extern void newsym(coordxy, coordxy); +extern void newsym_force(coordxy, coordxy); +extern void shieldeff(coordxy, coordxy); +extern void tmp_at(coordxy, coordxy); +extern void flash_glyph_at(coordxy, coordxy, int, int); +extern void swallowed(int); +extern void under_ground(int); +extern void under_water(int); +extern void see_monsters(void); +extern void set_mimic_blocking(void); +extern void see_objects(void); +extern void see_traps(void); +extern void curs_on_u(void); +extern int doredraw(void); +extern void docrt(void); +extern void show_glyph(coordxy, coordxy, int); +extern void clear_glyph_buffer(void); +extern void row_refresh(int, int, int); +extern void cls(void); +extern void flush_screen(int); #ifdef DUMP_LOG -E void dump_screen(void); +extern void dump_screen(void); #endif -E int back_to_glyph(xchar, xchar); -E int zapdir_to_glyph(int, int, int); -E int glyph_at(xchar, xchar); -E void set_wall_state(void); -E void unset_seenv(struct rm *, int, int, int, int); -E int warning_of(struct monst *); +extern int back_to_glyph(coordxy, coordxy); +extern int zapdir_to_glyph(int, int, int); +extern int glyph_at(coordxy, coordxy); +extern void set_wall_state(void); +extern void unset_seenv(struct rm *, int, int, int, int); +extern int warning_of(struct monst *); /* ### do.c ### */ #ifdef USE_TRAMPOLI -E int drop(struct obj *); -E int wipeoff(void); -#endif -E int dodrop(void); -E boolean boulder_hits_pool(struct obj *, int, int, boolean); -E boolean flooreffects(struct obj *, int, int, const char *); -E void doaltarobj(struct obj *); -E boolean canletgo(struct obj *, const char *); -E void dropx(struct obj *); -E void dropy(struct obj *); -E void dropz(struct obj *, boolean); -E void obj_no_longer_held(struct obj *); -E int doddrop(void); -E int dodown(void); -E int doup(void); +extern int drop(struct obj *); +extern int wipeoff(void); +#endif +extern int dodrop(void); +extern boolean boulder_hits_pool(struct obj *, int, int, boolean); +extern boolean flooreffects(struct obj *, coordxy, coordxy, const char *); +extern void doaltarobj(struct obj *); +extern boolean canletgo(struct obj *, const char *); +extern void dropx(struct obj *); +extern void dropy(struct obj *); +extern void dropz(struct obj *, boolean); +extern void obj_no_longer_held(struct obj *); +extern int doddrop(void); +extern int dodown(void); +extern int doup(void); #ifdef INSURANCE -E void save_currentstate(void); +extern void save_currentstate(void); #endif -E void goto_level(d_level *, boolean, boolean, boolean); -E void schedule_goto(d_level *, boolean, boolean, int, const char *, const char *); -E void deferred_goto(void); -E boolean revive_corpse(struct obj *); -E void revive_mon(ANY_P *, long); +extern void goto_level(d_level *, boolean, boolean, boolean); +extern void schedule_goto(d_level *, boolean, boolean, int, const char *, const char *); +extern void deferred_goto(void); +extern boolean revive_corpse(struct obj *); +extern void revive_mon(ANY_P *, long); extern void zombify_mon(union any *, long); -E int donull(void); -E int dowipe(void); -E void set_wounded_legs(long, int); -E void heal_legs(int); +extern int donull(void); +extern int dowipe(void); +extern void set_wounded_legs(long, int); +extern void heal_legs(int); /* ### do_name.c ### */ -E void do_oname(struct obj *); -E char *coord_desc(int, int, char *, char); -E boolean getpos_menu(coord *, int); +extern void do_oname(struct obj *); +extern char *coord_desc(coordxy, coordxy, char *, char); +extern boolean getpos_menu(coord *, int); extern int getpos(coord *, boolean, const char *); -E void getpos_sethilite(void (*f)(int), boolean (*d)(int,int)); +extern void getpos_sethilite(void (*f)(int), boolean (*d)(coordxy, coordxy)); extern void new_mgivenname(struct monst *, int); extern void free_mgivenname(struct monst *); -E void new_oname(struct obj *, int); -E void free_oname(struct obj *); -E const char *safe_oname(struct obj *); -E struct monst *christen_monst(struct monst *, const char *); -E int do_mname(void); -E struct obj *oname(struct obj *, const char *); -E boolean objtyp_is_callable(int); -E int ddocall(void); -E void docall(struct obj *); -E void docall_input(int); +extern void new_oname(struct obj *, int); +extern void free_oname(struct obj *); +extern const char *safe_oname(struct obj *); +extern struct monst *christen_monst(struct monst *, const char *); +extern int do_mname(void); +extern struct obj *oname(struct obj *, const char *); +extern boolean objtyp_is_callable(int); +extern int ddocall(void); +extern void docall(struct obj *); +extern void docall_input(int); void namefloorobj(void); -E const char *rndghostname(void); -E char *x_monnam(struct monst *, int, const char *, int, boolean); -E char *l_monnam(struct monst *); -E char *mon_nam(struct monst *); -E char *noit_mon_nam(struct monst *); -E char *Monnam(struct monst *); -E char *noit_Monnam(struct monst *); -E char *noname_monnam(struct monst *, int); -E char *m_monnam(struct monst *); -E char *y_monnam(struct monst *); -E char *Adjmonnam(struct monst *, const char *); -E char *Amonnam(struct monst *); -E char *a_monnam(struct monst *); -E char *distant_monnam(struct monst *, int, char *); -E char *mon_nam_too(struct monst *, struct monst *); -E char *minimal_monnam(struct monst *, boolean); -E const char *rndmonnam(void); -E const char *hcolor(const char *); -E const char *rndcolor(void); -E const char *hliquid(const char *); +extern const char *rndghostname(void); +extern char *x_monnam(struct monst *, int, const char *, int, boolean); +extern char *l_monnam(struct monst *); +extern char *mon_nam(struct monst *); +extern char *noit_mon_nam(struct monst *); +extern char *Monnam(struct monst *); +extern char *noit_Monnam(struct monst *); +extern char *noname_monnam(struct monst *, int); +extern char *m_monnam(struct monst *); +extern char *y_monnam(struct monst *); +extern char *Adjmonnam(struct monst *, const char *); +extern char *Amonnam(struct monst *); +extern char *a_monnam(struct monst *); +extern char *distant_monnam(struct monst *, int, char *); +extern char *mon_nam_too(struct monst *, struct monst *); +extern char *minimal_monnam(struct monst *, boolean); +extern const char *rndmonnam(void); +extern const char *hcolor(const char *); +extern const char *rndcolor(void); +extern const char *hliquid(const char *); #ifdef REINCARNATION -E const char *roguename(void); -#endif -E struct obj *realloc_obj(struct obj *, int, genericptr_t, int, const char *); -E char *coyotename(struct monst *, char *); -E char *rndorcname(char *); -E struct monst *christen_orc(struct monst *, const char *, const char *); -E const char *noveltitle(int *); -E const char *lookup_novel(const char *, int *); +extern const char *roguename(void); +#endif +extern struct obj *realloc_obj(struct obj *, int, genericptr_t, int, const char *); +extern char *coyotename(struct monst *, char *); +extern char *rndorcname(char *); +extern struct monst *christen_orc(struct monst *, const char *, const char *); +extern const char *noveltitle(int *); +extern const char *lookup_novel(const char *, int *); extern char *mon_wounds(struct monst *); extern void print_mon_wounded(struct monst *, int); /* ### do_wear.c ### */ -E int lucky_fedora(void); +extern int lucky_fedora(void); #ifdef USE_TRAMPOLI -E int Armor_on(void); -E int Boots_on(void); -E int Gloves_on(void); -E int Helmet_on(void); -E int select_off(struct obj *); -E int take_off(void); -#endif -E const char *fingers_or_gloves(boolean); -E void off_msg(struct obj *); -E void set_wear(void); -E boolean donning(struct obj *); -E boolean doffing(struct obj *); -E void cancel_doff(struct obj *, long); -E void cancel_don(void); -E int stop_donning(struct obj *); -E int Armor_off(void); -E int Armor_gone(void); -E int Helmet_off(void); -E int Gloves_off(void); -E int Boots_on(void); -E int Boots_off(void); -E int Cloak_off(void); -E int Shield_off(void); -E int Shirt_off(void); -E void Amulet_off(void); -E void Ring_on(struct obj *); -E void Ring_off(struct obj *); -E void Ring_gone(struct obj *); -E void Blindf_on(struct obj *); -E void Blindf_off(struct obj *); -E int dotakeoff(void); -E int doremring(void); -E int cursed(struct obj *); -E int armoroff(struct obj *); -E int canwearobj(struct obj *, long *, boolean); -E int dowear(void); -E int doputon(void); -E void find_ac(void); -E void glibr(void); -E struct obj *some_armor(struct monst *); -E void erode_armor(struct monst *, int); -E struct obj *stuck_ring(struct obj *, int); -E struct obj *unchanger(void); -E void reset_remarm(void); -E int doddoremarm(void); -E int destroy_arm(struct obj *); -E void adj_abon(struct obj *, schar); -E boolean inaccessible_equipment(struct obj *, const char *, boolean); +extern int Armor_on(void); +extern int Boots_on(void); +extern int Gloves_on(void); +extern int Helmet_on(void); +extern int select_off(struct obj *); +extern int take_off(void); +#endif +extern const char *fingers_or_gloves(boolean); +extern void off_msg(struct obj *); +extern void set_wear(void); +extern boolean donning(struct obj *); +extern boolean doffing(struct obj *); +extern void cancel_doff(struct obj *, long); +extern void cancel_don(void); +extern int stop_donning(struct obj *); +extern int Armor_off(void); +extern int Armor_gone(void); +extern int Helmet_off(void); +extern int Gloves_off(void); +extern int Boots_on(void); +extern int Boots_off(void); +extern int Cloak_off(void); +extern int Shield_off(void); +extern int Shirt_off(void); +extern void Amulet_off(void); +extern void Ring_on(struct obj *); +extern void Ring_off(struct obj *); +extern void Ring_gone(struct obj *); +extern void Blindf_on(struct obj *); +extern void Blindf_off(struct obj *); +extern int dotakeoff(void); +extern int doremring(void); +extern int cursed(struct obj *); +extern int armoroff(struct obj *); +extern int canwearobj(struct obj *, long *, boolean); +extern int dowear(void); +extern int doputon(void); +extern void find_ac(void); +extern void glibr(void); +extern struct obj *some_armor(struct monst *); +extern void erode_armor(struct monst *, int); +extern struct obj *stuck_ring(struct obj *, int); +extern struct obj *unchanger(void); +extern void reset_remarm(void); +extern int doddoremarm(void); +extern int destroy_arm(struct obj *); +extern void adj_abon(struct obj *, schar); +extern boolean inaccessible_equipment(struct obj *, const char *, boolean); /* ### dog.c ### */ -E void newedog(struct monst *); -E void free_edog(struct monst *); -E void initedog(struct monst *); -E struct monst *make_familiar(struct obj *, xchar, xchar, boolean); -E struct monst *makedog(void); -E void update_mlstmv(void); -E void losedogs(void); -E void mon_arrive(struct monst *, boolean); -E void mon_catchup_elapsed_time(struct monst *, long); -E void keepdogs(boolean); -E void migrate_to_level(struct monst *, xchar, xchar, coord *); -E int dogfood(struct monst *, struct obj *); -E boolean tamedog(struct monst *, struct obj *); -E void abuse_dog(struct monst *); -E void wary_dog(struct monst *, boolean); +extern void newedog(struct monst *); +extern void free_edog(struct monst *); +extern void initedog(struct monst *); +extern struct monst *make_familiar(struct obj *, coordxy, coordxy, boolean); +extern struct monst *makedog(void); +extern void update_mlstmv(void); +extern void losedogs(void); +extern void mon_arrive(struct monst *, boolean); +extern void mon_catchup_elapsed_time(struct monst *, long); +extern void keepdogs(boolean); +extern void migrate_to_level(struct monst *, xint16, xint16, coord *); +extern int dogfood(struct monst *, struct obj *); +extern boolean tamedog(struct monst *, struct obj *); +extern void abuse_dog(struct monst *); +extern void wary_dog(struct monst *, boolean); /* ### dogmove.c ### */ -E struct obj *droppables(struct monst *); -E int dog_nutrition(struct monst *, struct obj *); -E int dog_eat(struct monst *, struct obj *, int, int, boolean); -E int dog_move(struct monst *, int); +extern struct obj *droppables(struct monst *); +extern int dog_nutrition(struct monst *, struct obj *); +extern int dog_eat(struct monst *, struct obj *, coordxy, coordxy, boolean); +extern int dog_move(struct monst *, int); #ifdef USE_TRAMPOLI -E void wantdoor(int, int, genericptr_t); +extern void wantdoor(coordxy, coordxy, genericptr_t); #endif -E void finish_meating(struct monst *); -E boolean cursed_object_at(int, int); +extern void finish_meating(struct monst *); +extern boolean cursed_object_at(coordxy, coordxy); /* ### dokick.c ### */ -E boolean ghitm(struct monst *, struct obj *); -E void container_impact_dmg(struct obj *, xchar, xchar); -E int dokick(void); -E boolean ship_object(struct obj *, xchar, xchar, boolean); -E void obj_delivery(boolean); -E void deliver_obj_to_mon(struct monst *mtmp, int, unsigned long); -E schar down_gate(xchar, xchar); -E void impact_drop(struct obj *, xchar, xchar, xchar); +extern boolean ghitm(struct monst *, struct obj *); +extern void container_impact_dmg(struct obj *, coordxy, coordxy); +extern int dokick(void); +extern boolean ship_object(struct obj *, coordxy, coordxy, boolean); +extern void obj_delivery(boolean); +extern void deliver_obj_to_mon(struct monst *mtmp, int, unsigned long); +extern schar down_gate(coordxy, coordxy); +extern void impact_drop(struct obj *, coordxy, coordxy, xint16); /* ### dothrow.c ### */ -E int dothrow(void); -E int dofire(void); -E void endmultishot(boolean); -E void hitfloor(struct obj *, boolean); -E void hurtle(int, int, int, boolean); -E void mhurtle(struct monst *, int, int, int); -E boolean throwing_weapon(struct obj *); -E void throwit(struct obj *, long, boolean); -E int omon_adj(struct monst *, struct obj *, boolean); -E int thitmonst(struct monst *, struct obj *); -E int hero_breaks(struct obj *, xchar, xchar, boolean); -E int breaks(struct obj *, xchar, xchar); -E void breakobj(struct obj *, xchar, xchar, boolean, boolean); -E boolean breaktest(struct obj *); -E boolean walk_path(coord *, coord *, boolean (*)(genericptr_t, int, int), genericptr_t); -E boolean hurtle_jump(void *, int, int); -E boolean hurtle_step(void *, int, int); +extern int dothrow(void); +extern int dofire(void); +extern void endmultishot(boolean); +extern void hitfloor(struct obj *, boolean); +extern void hurtle(int, int, int, boolean); +extern void mhurtle(struct monst *, int, int, int); +extern boolean throwing_weapon(struct obj *); +extern void throwit(struct obj *, long, boolean); +extern int omon_adj(struct monst *, struct obj *, boolean); +extern int thitmonst(struct monst *, struct obj *); +extern int hero_breaks(struct obj *, coordxy, coordxy, boolean); +extern int breaks(struct obj *, coordxy, coordxy); +extern void breakobj(struct obj *, coordxy, coordxy, boolean, boolean); +extern boolean breaktest(struct obj *); +extern boolean walk_path(coord *, coord *, boolean (*)(genericptr_t, coordxy, coordxy), genericptr_t); +extern boolean hurtle_jump(void *, coordxy, coordxy); +extern boolean hurtle_step(void *, coordxy, coordxy); /* ### drawing.c ### */ #endif /* !MAKEDEFS_C && !LEV_LEX_C */ -E int def_char_to_objclass(char); -E int def_char_to_monclass(char); +extern int def_char_to_objclass(char); +extern int def_char_to_monclass(char); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) -E void assign_graphics(glyph_t *, int, int, int); -E void switch_graphics(int); +extern void assign_graphics(glyph_t *, int, int, int); +extern void switch_graphics(int); #ifdef REINCARNATION -E void assign_rogue_graphics(boolean); +extern void assign_rogue_graphics(boolean); #endif -E void assign_utf8graphics_symbol(int, glyph_t); -E void assign_moria_graphics(boolean); +extern void assign_utf8graphics_symbol(int, glyph_t); +extern void assign_moria_graphics(boolean); /* ### dump.c ### */ -E void dump(const char *, const char *); -E void dump_blockquote_start(void); -E void dump_blockquote_end(void); -E void dump_text(const char *, const char *); -E void dump_header_html(const char *); -E void dump_html(const char *, const char *); -E void dump_init(void); -E void dump_exit(void); -E void dump_object(const char, const struct obj *, const char *); -E void dump_title(char *); -E void dump_subtitle(const char *); -E void dump_line(const char *, const char *); -E void dump_list_start(void); -E void dump_list_item(const char *); -E void dump_list_item_object(struct obj *); -E void dump_list_item_link(const char *, const char *); -E void dump_list_end(void); -E void dump_definition_list_start(void); -E void dump_definition_list_dd(const char *); -E void dump_definition_list_dt(const char *); -E void dump_definition_list_end(void); -E void dump_containerconts(struct obj *, boolean, boolean, boolean); +extern void dump(const char *, const char *); +extern void dump_blockquote_start(void); +extern void dump_blockquote_end(void); +extern void dump_text(const char *, const char *); +extern void dump_header_html(const char *); +extern void dump_html(const char *, const char *); +extern void dump_init(void); +extern void dump_exit(void); +extern void dump_object(const char, const struct obj *, const char *); +extern void dump_title(char *); +extern void dump_subtitle(const char *); +extern void dump_line(const char *, const char *); +extern void dump_list_start(void); +extern void dump_list_item(const char *); +extern void dump_list_item_object(struct obj *); +extern void dump_list_item_link(const char *, const char *); +extern void dump_list_end(void); +extern void dump_definition_list_start(void); +extern void dump_definition_list_dd(const char *); +extern void dump_definition_list_dt(const char *); +extern void dump_definition_list_end(void); +extern void dump_containerconts(struct obj *, boolean, boolean, boolean); extern const char* html_escape_character(const char); -E char* html_link(const char *, const char *); +extern char* html_link(const char *, const char *); #ifdef DUMP_LOG -E int dump_screenshot(void); -E int dumpoverview(void); +extern int dump_screenshot(void); +extern int dumpoverview(void); #endif /* ### dungeon.c ### */ -E void save_dungeon(int, boolean, boolean); -E void restore_dungeon(int); -E void insert_branch(branch *, boolean); -E void init_dungeons(void); -E s_level *find_level(const char *); -E s_level *Is_special(d_level *); +extern void save_dungeon(int, boolean, boolean); +extern void restore_dungeon(int); +extern void insert_branch(branch *, boolean); +extern void init_dungeons(void); +extern s_level *find_level(const char *); +extern s_level *Is_special(d_level *); #ifdef RANDOMIZED_PLANES -E s_level *get_next_elemental_plane(d_level *); -E d_level *get_first_elemental_plane(void); -#endif -E branch *Is_branchlev(d_level *); -E boolean builds_up(d_level *); -E xchar ledger_no(d_level *); -E xchar maxledgerno(void); -E schar depth(d_level *); -E xchar dunlev(d_level *); -E xchar dunlevs_in_dungeon(d_level *); -E xchar ledger_to_dnum(xchar); -E xchar ledger_to_dlev(xchar); -E xchar deepest_lev_reached(boolean); -E boolean on_level(d_level *, d_level *); -E void next_level(boolean); -E void prev_level(boolean); -E void u_on_newpos(int, int); -E void u_on_rndspot(int); -E void u_on_sstairs(int); -E void u_on_upstairs(void); -E void u_on_dnstairs(void); -E boolean On_stairs(xchar, xchar); -E void get_level(d_level *, int); -E boolean Is_botlevel(d_level *); -E boolean Can_fall_thru(d_level *); -E boolean Can_dig_down(d_level *); -E boolean Can_rise_up(int, int, d_level *); -E boolean has_ceiling(d_level *); -E boolean In_quest(d_level *); -E boolean In_mines(d_level *); -E boolean In_sheol(d_level *); -E branch *dungeon_branch(const char *); -E boolean at_dgn_entrance(const char *); -E boolean In_hell(d_level *); -E boolean In_V_tower(d_level *); -E boolean On_W_tower_level(d_level *); -E boolean In_W_tower(int, int, d_level *); -E void find_hell(d_level *); -E void goto_hell(boolean, boolean); -E void assign_level(d_level *, d_level *); -E void assign_rnd_level(d_level *, d_level *, int); -E int induced_align(int); -E boolean Invocation_lev(d_level *); -E xchar level_difficulty(void); -E schar lev_by_name(const char *); +extern s_level *get_next_elemental_plane(d_level *); +extern d_level *get_first_elemental_plane(void); +#endif +extern branch *Is_branchlev(d_level *); +extern boolean builds_up(d_level *); +extern xint16 ledger_no(d_level *); +extern xint16 maxledgerno(void); +extern schar depth(d_level *); +extern xint16 dunlev(d_level *); +extern xint16 dunlevs_in_dungeon(d_level *); +extern xint16 ledger_to_dnum(xint16); +extern xint16 ledger_to_dlev(xint16); +extern xint16 deepest_lev_reached(boolean); +extern boolean on_level(d_level *, d_level *); +extern void next_level(boolean); +extern void prev_level(boolean); +extern void u_on_newpos(coordxy, coordxy); +extern void u_on_rndspot(int); +extern void u_on_sstairs(int); +extern void u_on_upstairs(void); +extern void u_on_dnstairs(void); +extern boolean On_stairs(coordxy, coordxy); +extern void get_level(d_level *, int); +extern boolean Is_botlevel(d_level *); +extern boolean Can_fall_thru(d_level *); +extern boolean Can_dig_down(d_level *); +extern boolean Can_rise_up(coordxy, coordxy, d_level *); +extern boolean has_ceiling(d_level *); +extern boolean In_quest(d_level *); +extern boolean In_mines(d_level *); +extern boolean In_sheol(d_level *); +extern branch *dungeon_branch(const char *); +extern boolean at_dgn_entrance(const char *); +extern boolean In_hell(d_level *); +extern boolean In_V_tower(d_level *); +extern boolean On_W_tower_level(d_level *); +extern boolean In_W_tower(coordxy, coordxy, d_level *); +extern void find_hell(d_level *); +extern void goto_hell(boolean, boolean); +extern void assign_level(d_level *, d_level *); +extern void assign_rnd_level(d_level *, d_level *, int); +extern int induced_align(int); +extern boolean Invocation_lev(d_level *); +extern xint16 level_difficulty(void); +extern schar lev_by_name(const char *); #ifdef WIZARD -E schar print_dungeon(boolean, schar *, xchar *); -#endif -E int donamelevel(void); -E int dooverview(void); -E void show_overview(int, int); -E void forget_mapseen(int); -E void init_mapseen(d_level *); -E void recalc_mapseen(void); -E void mapseen_temple(struct monst *); -E void recbranch_mapseen(d_level *, d_level *); -E void room_discovered(int); -E void overview_stats(winid, const char *, long *, long *); -E void remdun_mapseen(int); -E char *get_annotation(d_level *); -E const char *get_generic_level_description(d_level *); -E const char *endgame_level_name(char *, int); +extern schar print_dungeon(boolean, schar *, xint16 *); +#endif +extern int donamelevel(void); +extern int dooverview(void); +extern void show_overview(int, int); +extern void forget_mapseen(int); +extern void init_mapseen(d_level *); +extern void recalc_mapseen(void); +extern void mapseen_temple(struct monst *); +extern void recbranch_mapseen(d_level *, d_level *); +extern void room_discovered(int); +extern void overview_stats(winid, const char *, long *, long *); +extern void remdun_mapseen(int); +extern char *get_annotation(d_level *); +extern const char *get_generic_level_description(d_level *); +extern const char *endgame_level_name(char *, int); /* ### eat.c ### */ #ifdef USE_TRAMPOLI -E int eatmdone(void); -E int eatfood(void); -E int opentin(void); -E int unfaint(void); -#endif -E boolean is_edible(struct obj *); -E void init_uhunger(void); -E int Hear_again(void); -E void reset_eat(void); -E int doeat(void); -E void gethungry(void); -E void morehungry(int); -E void lesshungry(int); -E boolean is_fainted(void); -E void reset_faint(void); -E void violated_vegetarian(void); +extern int eatmdone(void); +extern int eatfood(void); +extern int opentin(void); +extern int unfaint(void); +#endif +extern boolean is_edible(struct obj *); +extern void init_uhunger(void); +extern int Hear_again(void); +extern void reset_eat(void); +extern int doeat(void); +extern void gethungry(void); +extern void morehungry(int); +extern void lesshungry(int); +extern boolean is_fainted(void); +extern void reset_faint(void); +extern void violated_vegetarian(void); #if 0 -E void sync_hunger(void); -#endif -E void newuhs(boolean); -E struct obj *floorfood(const char *, int); -E void vomit(void); -E int eaten_stat(int, struct obj *); -E void food_disappears(struct obj *); -E void food_substitution(struct obj *, struct obj *); -E boolean bite_monster(struct monst *mon); -E void fix_petrification(void); +extern void sync_hunger(void); +#endif +extern void newuhs(boolean); +extern struct obj *floorfood(const char *, int); +extern void vomit(void); +extern int eaten_stat(int, struct obj *); +extern void food_disappears(struct obj *); +extern void food_substitution(struct obj *, struct obj *); +extern boolean bite_monster(struct monst *mon); +extern void fix_petrification(void); extern int intrinsic_possible(int, struct permonst *); -E void consume_oeaten(struct obj *, int); -E boolean maybe_finished_meal(boolean); -E void set_tin_variety(struct obj *, int); -E int tin_variety_txt(char *, int *); -E void tin_details(struct obj *, int, char *); -E boolean Popeye(int); +extern void consume_oeaten(struct obj *, int); +extern boolean maybe_finished_meal(boolean); +extern void set_tin_variety(struct obj *, int); +extern int tin_variety_txt(char *, int *); +extern void tin_details(struct obj *, int, char *); +extern boolean Popeye(int); /* ### end.c ### */ -E void done1(int); -E int done2(void); +extern void done1(int); +extern int done2(void); #ifdef USE_TRAMPOLI -E void done_intr(int); +extern void done_intr(int); #endif -E void done_in_by(struct monst *); +extern void done_in_by(struct monst *); #endif /* !MAKEDEFS_C && !LEV_LEX_C */ -E void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) -E void done(int); -E void container_contents(struct obj *, boolean, boolean, boolean); -E void nh_terminate(int) NORETURN; -E int num_genocides(void); -E void delayed_killer(int, int, const char *); -E struct kinfo *find_delayed_killer(int); -E void dealloc_killer(struct kinfo *); -E void save_killers(int, int); -E void restore_killers(int); -E char *build_english_list(char *); +extern void done(int); +extern void container_contents(struct obj *, boolean, boolean, boolean); +extern void nh_terminate(int) NORETURN; +extern int num_genocides(void); +extern void delayed_killer(int, int, const char *); +extern struct kinfo *find_delayed_killer(int); +extern void dealloc_killer(struct kinfo *); +extern void save_killers(int, int); +extern void restore_killers(int); +extern char *build_english_list(char *); /* ### engrave.c ### */ -E char *random_engraving(char *); -E void wipeout_text(char *, int, unsigned); -E boolean can_reach_floor(boolean); -E void You_cant_reach_the_floor(int, int, boolean); -E void You_cant_reach_the_ceiling(int, int); -E void cant_reach_floor(int, int, boolean, boolean); -E const char *surface(int, int); -E const char *ceiling(int, int); -E struct engr *engr_at(xchar, xchar); -E int sengr_at(const char *, xchar, xchar); -E void u_wipe_engr(int); -E void wipe_engr_at(xchar, xchar, xchar); -E void read_engr_at(int, int); -E void make_engr_at(int, int, const char *, long, xchar); -E void del_engr_at(int, int); -E int freehand(void); -E int doengrave(void); -E int doengrave_elbereth(void); -E void sanitize_engravings(void); -E void save_engravings(int, int); -E void rest_engravings(int); -E void engr_stats(const char *, char *, long *, long *); -E void del_engr(struct engr *); -E void rloc_engr(struct engr *); -E void make_grave(int, int, const char *); +extern char *random_engraving(char *); +extern void wipeout_text(char *, int, unsigned); +extern boolean can_reach_floor(boolean); +extern void You_cant_reach_the_floor(coordxy, coordxy, boolean); +extern void You_cant_reach_the_ceiling(coordxy, coordxy); +extern void cant_reach_floor(coordxy, coordxy, boolean, boolean); +extern const char *surface(coordxy, coordxy); +extern const char *ceiling(coordxy, coordxy); +extern struct engr *engr_at(coordxy, coordxy); +extern int sengr_at(const char *, coordxy, coordxy); +extern void u_wipe_engr(int); +extern void wipe_engr_at(coordxy, coordxy, xint16); +extern void read_engr_at(coordxy, coordxy); +extern void make_engr_at(coordxy, coordxy, const char *, long, xint16); +extern void del_engr_at(coordxy, coordxy); +extern int freehand(void); +extern int doengrave(void); +extern int doengrave_elbereth(void); +extern void sanitize_engravings(void); +extern void save_engravings(int, int); +extern void rest_engravings(int); +extern void engr_stats(const char *, char *, long *, long *); +extern void del_engr(struct engr *); +extern void rloc_engr(struct engr *); +extern void make_grave(coordxy, coordxy, const char *); /* ### exper.c ### */ -E long newuexp(int); -E int newpw(void); -E int experience(struct monst *, int); -E void more_experienced(int, int, int); -E void losexp(const char *); -E void newexplevel(void); -E void pluslvl(boolean); -E long rndexp(boolean); +extern long newuexp(int); +extern int newpw(void); +extern int experience(struct monst *, int); +extern void more_experienced(int, int, int); +extern void losexp(const char *); +extern void newexplevel(void); +extern void pluslvl(boolean); +extern long rndexp(boolean); /* ### explode.c ### */ -E void explode(int, int, int, int, char, int); -E long scatter(int, int, int, unsigned int, struct obj *); -E void splatter_burning_oil(int, int, boolean); -E void explode_oil(struct obj *, int, int); +extern void explode(coordxy, coordxy, int, int, char, int); +extern long scatter(int, int, int, unsigned int, struct obj *); +extern void splatter_burning_oil(coordxy, coordxy, boolean); +extern void explode_oil(struct obj *, coordxy, coordxy); /* ### extralev.c ### */ #ifdef REINCARNATION -E void makeroguerooms(void); -E void corr(int, int); -E void makerogueghost(void); +extern void makeroguerooms(void); +extern void corr(coordxy, coordxy); +extern void makerogueghost(void); #endif /* ### files.c ### */ -E char *fname_encode(const char *, char, char *, char *, int); -E char *fname_decode(char, char *, char *, int); -E const char *fqname(const char *, int, int); +extern char *fname_encode(const char *, char, char *, char *, int); +extern char *fname_decode(char, char *, char *, int); +extern const char *fqname(const char *, int, int); #ifndef FILE_AREAS -E FILE *fopen_datafile(const char *, const char *, int); +extern FILE *fopen_datafile(const char *, const char *, int); #endif -E boolean uptodate(int, const char *); -E void store_version(int); +extern boolean uptodate(int, const char *); +extern void store_version(int); #ifdef MFLOPPY -E void set_lock_and_bones(void); -#endif -E void set_levelfile_name(char *, int); -E int create_levelfile(int, char *); -E int open_levelfile(int, char *); -E void delete_levelfile(int); -E void clearlocks(void); -E int create_bonesfile(d_level*, char **, char *); +extern void set_lock_and_bones(void); +#endif +extern void set_levelfile_name(char *, int); +extern int create_levelfile(int, char *); +extern int open_levelfile(int, char *); +extern void delete_levelfile(int); +extern void clearlocks(void); +extern int create_bonesfile(d_level*, char **, char *); #ifdef MFLOPPY -E void cancel_bonesfile(void); +extern void cancel_bonesfile(void); #endif -E void commit_bonesfile(d_level *); -E int open_bonesfile(d_level*, char **); -E int delete_bonesfile(d_level*); -E void compress_bonesfile(void); -E void set_savefile_name(void); +extern void commit_bonesfile(d_level *); +extern int open_bonesfile(d_level*, char **); +extern int delete_bonesfile(d_level*); +extern void compress_bonesfile(void); +extern void set_savefile_name(void); #ifdef INSURANCE -E void save_savefile_name(int); +extern void save_savefile_name(int); #endif #if defined(WIZARD) && !defined(MICRO) -E void set_error_savefile(void); -#endif -E int create_savefile(void); -E int open_savefile(void); -E int delete_savefile(void); -E int restore_saved_game(void); -E void compress(const char *); -E void uncompress(const char *); -E void compress_area(const char *, const char *); -E void uncompress_area(const char *, const char *); +extern void set_error_savefile(void); +#endif +extern int create_savefile(void); +extern int open_savefile(void); +extern int delete_savefile(void); +extern int restore_saved_game(void); +extern void compress(const char *); +extern void uncompress(const char *); +extern void compress_area(const char *, const char *); +extern void uncompress_area(const char *, const char *); #ifndef FILE_AREAS -E boolean lock_file(const char *, int, int); -E void unlock_file(const char *); +extern boolean lock_file(const char *, int, int); +extern void unlock_file(const char *); #endif #ifdef USER_SOUNDS -E boolean can_read_file(const char *); +extern boolean can_read_file(const char *); #endif extern boolean read_config_file(const char *, int); -E void check_recordfile(const char *); +extern void check_recordfile(const char *); #if defined(WIZARD) -E void read_wizkit(void); +extern void read_wizkit(void); #endif -E void paniclog(const char *, const char *); -E int validate_prefix_locations(char *); -E char** get_saved_games(void); -E void free_saved_games(char**); +extern void paniclog(const char *, const char *); +extern int validate_prefix_locations(char *); +extern char** get_saved_games(void); +extern void free_saved_games(char**); #ifdef SELF_RECOVER -E boolean recover_savefile(void); +extern boolean recover_savefile(void); #endif #ifdef SYSCF_FILE extern void assure_syscf_file(void); #endif -E int nhclose(int); +extern int nhclose(int); #ifdef HOLD_LOCKFILE_OPEN -E void really_close(void); +extern void really_close(void); #endif #ifdef WHEREIS_FILE -E void touch_whereis(void); -E void delete_whereis(void); -E void signal_whereis(int); +extern void touch_whereis(void); +extern void delete_whereis(void); +extern void signal_whereis(int); #endif /* ### fountain.c ### */ -E void floating_above(const char *); -E void dogushforth(int); +extern void floating_above(const char *); +extern void dogushforth(int); # ifdef USE_TRAMPOLI -E void gush(int, int, genericptr_t); +extern void gush(int, int, genericptr_t); # endif -E void dryup(xchar, xchar, boolean); -E void drinkfountain(void); -E void dipfountain(struct obj *); +extern void dryup(coordxy, coordxy, boolean); +extern void drinkfountain(void); +extern void dipfountain(struct obj *); #ifdef SINKS -E void breaksink(int, int); -E void drinksink(void); +extern void breaksink(coordxy, coordxy); +extern void drinksink(void); #endif /* ### hack.c ### */ #ifdef DUNGEON_GROWTH -E void catchup_dgn_growths(int); -E void dgn_growths(boolean, boolean); -#endif -extern boolean is_valid_travelpt(int,int); -E anything *uint_to_any(unsigned); -E anything *long_to_any(long); -E anything *monst_to_any(struct monst *); -E anything *obj_to_any(struct obj *); -E boolean revive_nasty(int, int, const char*); -E void movobj(struct obj *, xchar, xchar); -E boolean may_dig(xchar, xchar); -E boolean may_passwall(xchar, xchar); -E boolean bad_rock(struct permonst *, xchar, xchar); -E int cant_squeeze_thru(struct monst *); -E boolean invocation_pos(xchar, xchar); -E boolean test_move(int, int, int, int, int); -E boolean u_rooted(void); -E void domove(void); +extern void catchup_dgn_growths(int); +extern void dgn_growths(boolean, boolean); +#endif +extern boolean is_valid_travelpt(coordxy, coordxy); +extern anything *uint_to_any(unsigned); +extern anything *long_to_any(long); +extern anything *monst_to_any(struct monst *); +extern anything *obj_to_any(struct obj *); +extern boolean revive_nasty(coordxy, coordxy, const char*); +extern void movobj(struct obj *, coordxy, coordxy); +extern boolean may_dig(coordxy, coordxy); +extern boolean may_passwall(coordxy, coordxy); +extern boolean bad_rock(struct permonst *, coordxy, coordxy); +extern int cant_squeeze_thru(struct monst *); +extern boolean invocation_pos(coordxy, coordxy); +extern boolean test_move(int, int, int, int, int); +extern boolean u_rooted(void); +extern void domove(void); extern void runmode_delay_output(void); -E boolean overexertion(void); -E void invocation_message(void); -E void switch_terrain(void); -E boolean pooleffects(boolean); -E void wounds_message(struct monst *); -E char *mon_wounds(struct monst *); -E void spoteffects(boolean); -E char *in_rooms(xchar, xchar, int); -E boolean in_town(int, int); -E void check_special_room(boolean); -E int dopickup(void); -E void lookaround(void); -E boolean crawl_destination(int, int); -E int monster_nearby(void); -E void nomul(int, const char *); -E void unmul(const char *); -E void showdmg(int, boolean); -E void losehp(int, const char *, boolean); -E void losehp_how(int, const char *, boolean, int); -E void set_uhpmax(int, boolean); -E void check_uhpmax(void); -E int weight_cap(void); -E int inv_weight(void); -E int near_capacity(void); -E int calc_capacity(int); -E int max_capacity(void); -E boolean check_capacity(const char *); -E int inv_cnt(boolean); -E long money_cnt(struct obj *); -extern boolean MON_AT(int, int); -extern boolean OBJ_AT(int, int); +extern boolean overexertion(void); +extern void invocation_message(void); +extern void switch_terrain(void); +extern boolean pooleffects(boolean); +extern void wounds_message(struct monst *); +extern char *mon_wounds(struct monst *); +extern void spoteffects(boolean); +extern char *in_rooms(coordxy, coordxy, int); +extern boolean in_town(coordxy, coordxy); +extern void check_special_room(boolean); +extern int dopickup(void); +extern void lookaround(void); +extern boolean crawl_destination(coordxy, coordxy); +extern int monster_nearby(void); +extern void nomul(int, const char *); +extern void unmul(const char *); +extern void showdmg(int, boolean); +extern void losehp(int, const char *, boolean); +extern void losehp_how(int, const char *, boolean, int); +extern void set_uhpmax(int, boolean); +extern void check_uhpmax(void); +extern int weight_cap(void); +extern int inv_weight(void); +extern int near_capacity(void); +extern int calc_capacity(int); +extern int max_capacity(void); +extern boolean check_capacity(const char *); +extern int inv_cnt(boolean); +extern long money_cnt(struct obj *); +extern boolean MON_AT(coordxy, coordxy); +extern boolean OBJ_AT(coordxy, coordxy); /* ### hacklib.c ### */ -E boolean digit(char); -E boolean letter(char); -E char highc(char); -E char lowc(char); -E char *lcase(char *); -E char *ucase(char *); -E char *upstart(char *); -E char *mungspaces(char *); -E char *trimspaces(char *); -E char *strip_newline(char *); -E char *eos(char *); -E void sanitizestr(char *); -E boolean str_end_is(const char *, const char *); -E char *strkitten(char *, char); -E void copynchars(char *, const char *, int); -E char *strcasecpy(char *, const char *); -E char *s_suffix(const char *); -E char *xcrypt(const char *, char *); -E boolean onlyspace(const char *); -E char *tabexpand(char *); -E char *visctrl(char); -E char *strsubst(char *, const char *, const char *); -E int strNsubst(char *, const char *, const char *, int); -E const char *ordin(int); -E char *sitoa(int); -E int sgn(int); -E int rounddiv(long, int); -E int dist2(int, int, int, int); -E int isqrt(int); -E int ilog2(int); -E int distmin(int, int, int, int); -E boolean online2(int, int, int, int); -E boolean pmatch(const char *, const char *); -E boolean pmatchi(const char *, const char *); +extern boolean digit(char); +extern boolean letter(char); +extern char highc(char); +extern char lowc(char); +extern char *lcase(char *); +extern char *ucase(char *); +extern char *upstart(char *); +extern char *mungspaces(char *); +extern char *trimspaces(char *); +extern char *strip_newline(char *); +extern char *eos(char *); +extern void sanitizestr(char *); +extern boolean str_end_is(const char *, const char *); +extern char *strkitten(char *, char); +extern void copynchars(char *, const char *, int); +extern char *strcasecpy(char *, const char *); +extern char *s_suffix(const char *); +extern char *xcrypt(const char *, char *); +extern boolean onlyspace(const char *); +extern char *tabexpand(char *); +extern char *visctrl(char); +extern char *strsubst(char *, const char *, const char *); +extern int strNsubst(char *, const char *, const char *, int); +extern const char *ordin(int); +extern char *sitoa(int); +extern int sgn(int); +extern int rounddiv(long, int); +extern int dist2(int, int, int, int); +extern int isqrt(int); +extern int ilog2(int); +extern int distmin(int, int, int, int); +extern boolean online2(int, int, int, int); +extern boolean pmatch(const char *, const char *); +extern boolean pmatchi(const char *, const char *); #ifndef STRNCMPI -E int strncmpi(const char *, const char *, int); +extern int strncmpi(const char *, const char *, int); #endif #ifndef STRSTRI -E char *strstri(const char *, const char *); -#endif -E boolean fuzzymatch(const char *, const char *, const char *, boolean); -E void init_random(unsigned int); -E void reseed_random(void); -E void set_random_state(unsigned int); -E int getyear(void); -E int getmonth(void); -E int getmday(void); +extern char *strstri(const char *, const char *); +#endif +extern boolean fuzzymatch(const char *, const char *, const char *, boolean); +extern void init_random(unsigned int); +extern void reseed_random(void); +extern void set_random_state(unsigned int); +extern int getyear(void); +extern int getmonth(void); +extern int getmday(void); #if 0 -E char *yymmdd(time_t); -#endif -E long yyyymmdd(time_t); -E int phase_of_the_moon(void); -E boolean friday_13th(void); -E boolean towelday(void); -E boolean pirateday(void); -E int night(void); -E int midnight(void); -E boolean piday(void); -E boolean aprilfoolsday(void); -E boolean discordian_holiday(void); +extern char *yymmdd(time_t); +#endif +extern long yyyymmdd(time_t); +extern int phase_of_the_moon(void); +extern boolean friday_13th(void); +extern boolean towelday(void); +extern boolean pirateday(void); +extern int night(void); +extern int midnight(void); +extern boolean piday(void); +extern boolean aprilfoolsday(void); +extern boolean discordian_holiday(void); extern boolean is_june(void); -E char *iso8601(time_t); -E char *iso8601_duration(long); +extern char *iso8601(time_t); +extern char *iso8601_duration(long); extern char* format_duration(long); -E char *get_formatted_time(time_t, const char *); -E time_t current_epoch(void); -E void strbuf_init(strbuf_t *); -E void strbuf_append(strbuf_t *, const char *); -E void strbuf_reserve(strbuf_t *, int); -E void strbuf_empty(strbuf_t *); -E void strbuf_nl_to_crlf(strbuf_t *); +extern char *get_formatted_time(time_t, const char *); +extern time_t current_epoch(void); +extern void strbuf_init(strbuf_t *); +extern void strbuf_append(strbuf_t *, const char *); +extern void strbuf_reserve(strbuf_t *, int); +extern void strbuf_empty(strbuf_t *); +extern void strbuf_nl_to_crlf(strbuf_t *); extern int swapbits(int, int, int); extern void strip_brackets(char *); /* note: the snprintf CPP wrapper includes the "fmt" argument in "..." @@ -1024,147 +1024,147 @@ extern void nh_snprintf(const char *func, int line, char *str, size_t size, /* ### invent.c ### */ -E void assigninvlet(struct obj *); -E struct obj *merge_choice(struct obj *, struct obj *); -E int merged(struct obj **, struct obj **); +extern void assigninvlet(struct obj *); +extern struct obj *merge_choice(struct obj *, struct obj *); +extern int merged(struct obj **, struct obj **); #ifdef USE_TRAMPOLI -E int ckunpaid(struct obj *); -#endif -E void addinv_core1(struct obj *); -E void addinv_core2(struct obj *); -E struct obj *addinv(struct obj *); -E struct obj *hold_another_object(struct obj *, const char *, const char *, const char *); -E void useupall(struct obj *); -E void useup(struct obj *); -E void consume_obj_charge(struct obj *, boolean); -E void freeinv_core(struct obj *); -E void freeinv(struct obj *); -E void delallobj(int, int); -E void delobj(struct obj *); -E struct obj *sobj_at(int, int, int); -E struct obj *nxtobj(struct obj *, int, boolean); -E struct obj *carrying(int); -E boolean have_lizard(void); -E struct obj *o_on(unsigned int, struct obj *); -E boolean obj_here(struct obj *, int, int); -E boolean wearing_armor(void); -E boolean is_worn(struct obj *); -E struct obj *g_at(int, int); -E struct obj *mkgoldobj(long); -E struct obj *getobj(const char *, const char *); -E int ggetobj(const char *, int (*)(OBJ_P), int, boolean, unsigned *); -E void fully_identify_obj(struct obj *); -E int identify(struct obj *); -E void identify_pack(int, boolean); -E int askchain(struct obj **, const char *, int, int (*)(OBJ_P), int (*)(OBJ_P), int, const char *); -E void prinv(const char *, struct obj *, long); -E char *xprname(struct obj *, const char *, char, boolean, long, long); -E int ddoinv(void); -E char display_inventory(const char *, boolean); -E char dump_inventory(const char *, boolean, boolean); -E int display_binventory(int, int, boolean); -E struct obj *display_cinventory(struct obj *); -E struct obj *display_minventory(struct monst *, int, char *); -E int dotypeinv(void); -E const char *dfeature_at(int, int, char *); -E int look_here(int, boolean); -E int dolook(void); -E boolean will_feel_cockatrice(struct obj *, boolean); -E void feel_cockatrice(struct obj *, boolean); -E void stackobj(struct obj *); -E boolean mergable(struct obj *, struct obj *); -E int doprgold(void); -E int doprwep(void); -E int doprarm(void); -E int doprring(void); -E int dopramulet(void); -E int doprtool(void); -E int doprinuse(void); -E void useupf(struct obj *, long); -E char *let_to_name(char, boolean); -E void free_invbuf(void); -E void reassign(void); -E int doorganize(void); -E int count_objects(struct obj *); -E int count_unidentified(struct obj *); -E void learn_unseen_invent(void); -E void update_inventory(void); -E int count_unpaid(struct obj *); -E int count_buc(struct obj *, int, boolean (*)(OBJ_P)); -E void tally_BUCX(struct obj *, boolean, int *, int *, int *, int *, int *); -E long count_contents(struct obj *, boolean, boolean, boolean, boolean); -E void carry_obj_effects(struct obj *); -E const char *currency(long); -E void silly_thing(const char *, struct obj *); -E struct obj *getnextgetobj(void); +extern int ckunpaid(struct obj *); +#endif +extern void addinv_core1(struct obj *); +extern void addinv_core2(struct obj *); +extern struct obj *addinv(struct obj *); +extern struct obj *hold_another_object(struct obj *, const char *, const char *, const char *); +extern void useupall(struct obj *); +extern void useup(struct obj *); +extern void consume_obj_charge(struct obj *, boolean); +extern void freeinv_core(struct obj *); +extern void freeinv(struct obj *); +extern void delallobj(coordxy, coordxy); +extern void delobj(struct obj *); +extern struct obj *sobj_at(int, coordxy, coordxy); +extern struct obj *nxtobj(struct obj *, int, boolean); +extern struct obj *carrying(int); +extern boolean have_lizard(void); +extern struct obj *o_on(unsigned int, struct obj *); +extern boolean obj_here(struct obj *, coordxy, coordxy); +extern boolean wearing_armor(void); +extern boolean is_worn(struct obj *); +extern struct obj *g_at(coordxy, coordxy); +extern struct obj *mkgoldobj(long); +extern struct obj *getobj(const char *, const char *); +extern int ggetobj(const char *, int (*)(OBJ_P), int, boolean, unsigned *); +extern void fully_identify_obj(struct obj *); +extern int identify(struct obj *); +extern void identify_pack(int, boolean); +extern int askchain(struct obj **, const char *, int, int (*)(OBJ_P), int (*)(OBJ_P), int, const char *); +extern void prinv(const char *, struct obj *, long); +extern char *xprname(struct obj *, const char *, char, boolean, long, long); +extern int ddoinv(void); +extern char display_inventory(const char *, boolean); +extern char dump_inventory(const char *, boolean, boolean); +extern int display_binventory(coordxy, coordxy, boolean); +extern struct obj *display_cinventory(struct obj *); +extern struct obj *display_minventory(struct monst *, int, char *); +extern int dotypeinv(void); +extern const char *dfeature_at(coordxy, coordxy, char *); +extern int look_here(int, boolean); +extern int dolook(void); +extern boolean will_feel_cockatrice(struct obj *, boolean); +extern void feel_cockatrice(struct obj *, boolean); +extern void stackobj(struct obj *); +extern boolean mergable(struct obj *, struct obj *); +extern int doprgold(void); +extern int doprwep(void); +extern int doprarm(void); +extern int doprring(void); +extern int dopramulet(void); +extern int doprtool(void); +extern int doprinuse(void); +extern void useupf(struct obj *, long); +extern char *let_to_name(char, boolean); +extern void free_invbuf(void); +extern void reassign(void); +extern int doorganize(void); +extern int count_objects(struct obj *); +extern int count_unidentified(struct obj *); +extern void learn_unseen_invent(void); +extern void update_inventory(void); +extern int count_unpaid(struct obj *); +extern int count_buc(struct obj *, int, boolean (*)(OBJ_P)); +extern void tally_BUCX(struct obj *, boolean, int *, int *, int *, int *, int *); +extern long count_contents(struct obj *, boolean, boolean, boolean, boolean); +extern void carry_obj_effects(struct obj *); +extern const char *currency(long); +extern void silly_thing(const char *, struct obj *); +extern struct obj *getnextgetobj(void); #ifdef SORTLOOT -E int sortloot_cmp(struct obj *, struct obj *); +extern int sortloot_cmp(struct obj *, struct obj *); #endif -E boolean is_racial_armor(struct obj *); -E boolean is_racial_weapon(struct obj *); +extern boolean is_racial_armor(struct obj *); +extern boolean is_racial_weapon(struct obj *); extern boolean is_dragon_identified(struct permonst *); -E void identify_dragon(int); +extern void identify_dragon(int); /* ### ioctl.c ### */ #if defined(UNIX) || defined(__BEOS__) -E void getwindowsz(void); -E void getioctls(void); -E void setioctls(void); +extern void getwindowsz(void); +extern void getioctls(void); +extern void setioctls(void); # ifdef SUSPEND -E int dosuspend(void); +extern int dosuspend(void); # endif /* SUSPEND */ #endif /* UNIX || __BEOS__ */ /* ### light.c ### */ -E void new_light_source(xchar, xchar, int, int, ANY_P *); -E void del_light_source(int, ANY_P *); -E void do_light_sources(char **); -E void show_transient_light(struct obj *, int, int); -E void transient_light_cleanup(void); -E struct monst *find_mid(unsigned, unsigned); -E void save_light_sources(int, int, int); -E void restore_light_sources(int); -E void light_stats(const char *, char *, long *, long *); -E void relink_light_sources(boolean); -E void light_sources_sanity_check(void); -E void obj_move_light_source(struct obj *, struct obj *); -E boolean any_light_source(void); -E void snuff_light_source(int, int); -E boolean obj_sheds_light(struct obj *); -E boolean obj_is_burning(struct obj *); -E void obj_split_light_source(struct obj *, struct obj *); -E void obj_merge_light_sources(struct obj *, struct obj *); -E void obj_adjust_light_radius(struct obj *, int); -E int candle_light_range(struct obj *); -E int arti_light_radius(struct obj *); -E const char *arti_light_description(struct obj *); +extern void new_light_source(coordxy, coordxy, int, int, ANY_P *); +extern void del_light_source(int, ANY_P *); +extern void do_light_sources(char **); +extern void show_transient_light(struct obj *, coordxy, coordxy); +extern void transient_light_cleanup(void); +extern struct monst *find_mid(unsigned, unsigned); +extern void save_light_sources(int, int, int); +extern void restore_light_sources(int); +extern void light_stats(const char *, char *, long *, long *); +extern void relink_light_sources(boolean); +extern void light_sources_sanity_check(void); +extern void obj_move_light_source(struct obj *, struct obj *); +extern boolean any_light_source(void); +extern void snuff_light_source(coordxy, coordxy); +extern boolean obj_sheds_light(struct obj *); +extern boolean obj_is_burning(struct obj *); +extern void obj_split_light_source(struct obj *, struct obj *); +extern void obj_merge_light_sources(struct obj *, struct obj *); +extern void obj_adjust_light_radius(struct obj *, int); +extern int candle_light_range(struct obj *); +extern int arti_light_radius(struct obj *); +extern const char *arti_light_description(struct obj *); #ifdef WIZARD -E int wiz_light_sources(void); +extern int wiz_light_sources(void); #endif /* ### lock.c ### */ #ifdef USE_TRAMPOLI -E int forcelock(void); -E int picklock(void); -#endif -E boolean picking_lock(int *, int *); -E boolean picking_at(int, int); -E void breakchestlock(struct obj *, boolean); -E void reset_pick(void); -E void maybe_reset_pick(struct obj *); -E int pick_lock(struct obj *, int, int, boolean); -E int doforce(void); -E boolean boxlock(struct obj *, struct obj *); -E boolean doorlock(struct obj *, int, int); -E int doopen(void); -E int doclose(void); -E int artifact_door(int, int); -E boolean stumble_on_door_mimic(int, int); +extern int forcelock(void); +extern int picklock(void); +#endif +extern boolean picking_lock(int *, int *); +extern boolean picking_at(coordxy, coordxy); +extern void breakchestlock(struct obj *, boolean); +extern void reset_pick(void); +extern void maybe_reset_pick(struct obj *); +extern int pick_lock(struct obj *, int, int, boolean); +extern int doforce(void); +extern boolean boxlock(struct obj *, struct obj *); +extern boolean doorlock(struct obj *, coordxy, coordxy); +extern int doopen(void); +extern int doclose(void); +extern int artifact_door(coordxy, coordxy); +extern boolean stumble_on_door_mimic(coordxy, coordxy); #ifdef AUTO_OPEN -E int doopen_indir(int, int); +extern int doopen_indir(coordxy, coordxy); #endif #ifdef MAC @@ -1172,38 +1172,38 @@ E int doopen_indir(int, int); /* ### macfile.c ### */ -E int maccreat(const char *, long); -E int macopen(const char *, int, long); -E int macclose(int); -E int macread(int, void *, unsigned); -E int macwrite(int, void *, unsigned); -E long macseek(int, long, short); -E int macunlink(const char *); +extern int maccreat(const char *, long); +extern int macopen(const char *, int, long); +extern int macclose(int); +extern int macread(int, void *, unsigned); +extern int macwrite(int, void *, unsigned); +extern long macseek(int, long, short); +extern int macunlink(const char *); /* ### macsnd.c ### */ -E void mac_speaker(struct obj *, char *); +extern void mac_speaker(struct obj *, char *); /* ### macunix.c ### */ -E void regularize(char *); -E void getlock(void); +extern void regularize(char *); +extern void getlock(void); /* ### macwin.c ### */ -E void lock_mouse_cursor(Boolean); -E int SanePositions(void); +extern void lock_mouse_cursor(Boolean); +extern int SanePositions(void); /* ### mttymain.c ### */ -E void getreturn(char *); -E void VDECL(msmsg, (const char *, ...)); -E void gettty(void); -E void setftty(void); -E void settty(const char *); -E int tgetch(void); -E void cmov(int x, int y); -E void nocmov(int x, int y); +extern void getreturn(char *); +extern void VDECL(msmsg, (const char *, ...)); +extern void gettty(void); +extern void setftty(void); +extern void settty(const char *); +extern int tgetch(void); +extern void cmov(int x, int y); +extern void nocmov(int x, int y); #endif /* MAC */ @@ -1211,142 +1211,142 @@ E void nocmov(int x, int y); #ifdef MAIL # ifdef UNIX -E void getmailstatus(void); +extern void getmailstatus(void); # endif -E void ckmailstatus(void); -E void read_hint(struct obj *); -E void readmail(struct obj *); -E void maybe_hint(void); +extern void ckmailstatus(void); +extern void read_hint(struct obj *); +extern void readmail(struct obj *); +extern void maybe_hint(void); #endif /* MAIL */ /* ### makemon.c ### */ -E void mon_sanity_check(void); -E void dealloc_monst(struct monst *); -E boolean is_home_elemental(struct permonst *); -E struct monst *clone_mon(struct monst *, xchar, xchar); -E int monhp_per_lvl(struct monst *); -E void newmonhp(struct monst *, int); -E struct mextra *newmextra(void); -E void copy_mextra(struct monst *, struct monst *); -E void dealloc_mextra(struct monst *); -E struct monst *makemon(struct permonst *, int, int, int); -E boolean create_critters(int, struct permonst *); -E struct permonst *rndmonst(void); -E void reset_rndmonst(int); -E struct permonst *mkclass(char, int); -E struct permonst *mkclass_aligned(char, int, aligntyp); -E int mkclass_poly(int); -E int adj_lev(struct permonst *); -E struct permonst *grow_up(struct monst *, struct monst *); -E int mongets(struct monst *, int); -E int golemhp(int); -E boolean peace_minded(struct permonst *); -E void set_malign(struct monst *); -E void newmcorpsenm(struct monst *); -E void freemcorpsenm(struct monst *); -E void set_mimic_sym(struct monst *); -E int mbirth_limit(int); -E void mimic_hit_msg(struct monst *, short); -E void mkmonmoney(struct monst *, long); -E int bagotricks(struct obj *); -E boolean propagate(int, boolean, boolean); -E void create_camera_demon(struct obj *, int, int); -E int min_monster_difficulty(void); -E int max_monster_difficulty(void); -E boolean prohibited_by_generation_flags(struct permonst *); -E boolean usmellmon(struct permonst *); +extern void mon_sanity_check(void); +extern void dealloc_monst(struct monst *); +extern boolean is_home_elemental(struct permonst *); +extern struct monst *clone_mon(struct monst *, coordxy, coordxy); +extern int monhp_per_lvl(struct monst *); +extern void newmonhp(struct monst *, int); +extern struct mextra *newmextra(void); +extern void copy_mextra(struct monst *, struct monst *); +extern void dealloc_mextra(struct monst *); +extern struct monst *makemon(struct permonst *, coordxy, coordxy, int); +extern boolean create_critters(int, struct permonst *); +extern struct permonst *rndmonst(void); +extern void reset_rndmonst(int); +extern struct permonst *mkclass(char, int); +extern struct permonst *mkclass_aligned(char, int, aligntyp); +extern int mkclass_poly(int); +extern int adj_lev(struct permonst *); +extern struct permonst *grow_up(struct monst *, struct monst *); +extern int mongets(struct monst *, int); +extern int golemhp(int); +extern boolean peace_minded(struct permonst *); +extern void set_malign(struct monst *); +extern void newmcorpsenm(struct monst *); +extern void freemcorpsenm(struct monst *); +extern void set_mimic_sym(struct monst *); +extern int mbirth_limit(int); +extern void mimic_hit_msg(struct monst *, short); +extern void mkmonmoney(struct monst *, long); +extern int bagotricks(struct obj *); +extern boolean propagate(int, boolean, boolean); +extern void create_camera_demon(struct obj *, coordxy, coordxy); +extern int min_monster_difficulty(void); +extern int max_monster_difficulty(void); +extern boolean prohibited_by_generation_flags(struct permonst *); +extern boolean usmellmon(struct permonst *); /* ### mapglyph.c ### */ -E void mapglyph(int, glyph_t *, int *, unsigned *, int, int, unsigned); -E char *encglyph(int); +extern void mapglyph(int, glyph_t *, int *, unsigned *, coordxy, coordxy, unsigned); +extern char *encglyph(int); extern glyph_t get_monsym(int glyph); /* ### mcastu.c ### */ -E int castmu(struct monst *, struct attack *, boolean, boolean); -E int buzzmu(struct monst *, struct attack *); +extern int castmu(struct monst *, struct attack *, boolean, boolean); +extern int buzzmu(struct monst *, struct attack *); /* ### mhitm.c ### */ -E int fightm(struct monst *); -E int mattackm(struct monst *, struct monst *); -E boolean engulf_target(struct monst *, struct monst *); -E int mdisplacem(struct monst *, struct monst *, boolean); -E void paralyze_monst(struct monst *, int); -E int sleep_monst(struct monst *, int, int); -E void slept_monst(struct monst *); -E long attk_protection(int); -E void rustm(struct monst *, struct obj *); -E void maybe_freeze_m(struct monst *, int, int*); +extern int fightm(struct monst *); +extern int mattackm(struct monst *, struct monst *); +extern boolean engulf_target(struct monst *, struct monst *); +extern int mdisplacem(struct monst *, struct monst *, boolean); +extern void paralyze_monst(struct monst *, int); +extern int sleep_monst(struct monst *, int, int); +extern void slept_monst(struct monst *); +extern long attk_protection(int); +extern void rustm(struct monst *, struct obj *); +extern void maybe_freeze_m(struct monst *, int, int*); /* ### mhitu.c ### */ -E const char *mpoisons_subj(struct monst *, struct attack *); -E void u_slow_down(void); -E struct monst *cloneu(void); -E void expels(struct monst *, struct permonst *, boolean); -E struct attack *getmattk(struct monst *, struct monst *, int, int *, struct attack *); -E int mattacku(struct monst *); -E int magic_negation(struct monst *); -E boolean gulp_blnd_check(void); -E int gazemu(struct monst *, struct attack *); -E void mdamageu(struct monst *, int); -E int could_seduce(struct monst *, struct monst *, struct attack *); +extern const char *mpoisons_subj(struct monst *, struct attack *); +extern void u_slow_down(void); +extern struct monst *cloneu(void); +extern void expels(struct monst *, struct permonst *, boolean); +extern struct attack *getmattk(struct monst *, struct monst *, int, int *, struct attack *); +extern int mattacku(struct monst *); +extern int magic_negation(struct monst *); +extern boolean gulp_blnd_check(void); +extern int gazemu(struct monst *, struct attack *); +extern void mdamageu(struct monst *, int); +extern int could_seduce(struct monst *, struct monst *, struct attack *); #ifdef SEDUCE -E int doseduce(struct monst *); +extern int doseduce(struct monst *); #endif -E void maybe_freeze_u(int*); -E void spore_dies(struct monst *); +extern void maybe_freeze_u(int*); +extern void spore_dies(struct monst *); /* ### minion.c ### */ -E void newemin(struct monst *); -E void free_emin(struct monst *); -E int monster_census(boolean); -E int msummon(struct monst *); -E void summon_minion(aligntyp, boolean); -E int demon_talk(struct monst *); -E long bribe(struct monst *); -E int dprince(aligntyp); -E int dlord(aligntyp); -E int llord(void); -E int ndemon(aligntyp); -E int lminion(void); -E void lose_guardian_angel(struct monst *); -E void gain_guardian_angel(void); +extern void newemin(struct monst *); +extern void free_emin(struct monst *); +extern int monster_census(boolean); +extern int msummon(struct monst *); +extern void summon_minion(aligntyp, boolean); +extern int demon_talk(struct monst *); +extern long bribe(struct monst *); +extern int dprince(aligntyp); +extern int dlord(aligntyp); +extern int llord(void); +extern int ndemon(aligntyp); +extern int lminion(void); +extern void lose_guardian_angel(struct monst *); +extern void gain_guardian_angel(void); /* ### mklev.c ### */ -E void mineralize(int, int, int, int, boolean); +extern void mineralize(int, int, int, int, boolean); #ifdef USE_TRAMPOLI -E int do_comp(genericptr_t, genericptr_t); -#endif -E void sort_rooms(void); -E void add_room(int, int, int, int, boolean, schar, boolean); -E void add_subroom(struct mkroom *, int, int, int, int, boolean, schar, boolean); -E void makecorridors(int); -E void add_door(int, int, struct mkroom *); -E void mkpoolroom(void); -E void mklev(void); +extern int do_comp(genericptr_t, genericptr_t); +#endif +extern void sort_rooms(void); +extern void add_room(int, int, int, int, boolean, schar, boolean); +extern void add_subroom(struct mkroom *, int, int, int, int, boolean, schar, boolean); +extern void makecorridors(int); +extern void add_door(coordxy, coordxy, struct mkroom *); +extern void mkpoolroom(void); +extern void mklev(void); #ifdef SPECIALIZATION -E void topologize(struct mkroom *, boolean); +extern void topologize(struct mkroom *, boolean); #else -E void topologize(struct mkroom *); -#endif -E void place_branch(branch *, xchar, xchar); -E boolean occupied(xchar, xchar); -E int okdoor(xchar, xchar); -E void dodoor(int, int, struct mkroom *); -E void mktrap(int, int, struct mkroom *, coord*); -E void mkstairs(xchar, xchar, char, struct mkroom *); -E void mkinvokearea(void); -E void wallwalk_right(xchar, xchar, schar, schar, schar, int); +extern void topologize(struct mkroom *); +#endif +extern void place_branch(branch *, coordxy, coordxy); +extern boolean occupied(coordxy, coordxy); +extern int okdoor(coordxy, coordxy); +extern void dodoor(coordxy, coordxy, struct mkroom *); +extern void mktrap(int, int, struct mkroom *, coord*); +extern void mkstairs(coordxy, coordxy, char, struct mkroom *); +extern void mkinvokearea(void); +extern void wallwalk_right(coordxy, coordxy, schar, schar, schar, int); #ifdef ADVENT_CALENDAR -E boolean mk_advcal_portal(void); +extern boolean mk_advcal_portal(void); #endif -extern void mk_knox_vault(int, int, int, int); +extern void mk_knox_vault(coordxy, coordxy, int, int); extern d_level * get_floating_branch(d_level *, branch *); /* ### mkmap.c ### */ @@ -1356,277 +1356,277 @@ void remove_rooms(int, int, int, int); /* ### mkmaze.c ### */ -E void wallification(int, int, int, int); -E void wall_extends(int, int, int, int); -E void walkfrom(int, int, schar); -E void makemaz(const char *); -E void mazexy(coord *); +extern void wallification(int, int, int, int); +extern void wall_extends(int, int, int, int); +extern void walkfrom(coordxy, coordxy, schar); +extern void makemaz(const char *); +extern void mazexy(coord *); extern void get_level_extends(int *, int *, int *, int *); -E void bound_digging(void); -E void mkportal(xchar, xchar, xchar, xchar); -E boolean bad_location(xchar, xchar, xchar, xchar, xchar, xchar, xchar); -E int place_lregion(xchar, xchar, xchar, xchar, - xchar, xchar, xchar, xchar, - xchar, d_level *); -E void fixup_special(void); -E void movebubbles(void); -E void water_friction(void); -E void save_waterlevel(int, int); -E void restore_waterlevel(int); -E const char *waterbody_name(xchar, xchar); +extern void bound_digging(void); +extern void mkportal(coordxy, coordxy, xint16, xint16); +extern boolean bad_location(coordxy, coordxy, coordxy, coordxy, coordxy, coordxy, coordxy); +extern int place_lregion(coordxy, coordxy, coordxy, coordxy, + coordxy, coordxy, coordxy, coordxy, + xint16, d_level *); +extern void fixup_special(void); +extern void movebubbles(void); +extern void water_friction(void); +extern void save_waterlevel(int, int); +extern void restore_waterlevel(int); +extern const char *waterbody_name(coordxy, coordxy); #ifdef ADVENT_CALENDAR -E void fill_advent_calendar(boolean); +extern void fill_advent_calendar(boolean); #endif /* ### mkobj.c ### */ -E struct oextra *newoextra(void); -E void copy_oextra(struct obj *, struct obj *); -E void dealloc_oextra(struct obj *); -E void newomonst(struct obj *); -E void free_omonst(struct obj *); -E void newomid(struct obj *); -E void free_omid(struct obj *); -E void newolong(struct obj *); -E void free_olong(struct obj *); -E void new_omailcmd(struct obj *, const char *); -E void free_omailcmd(struct obj *); -E struct obj *mkobj_at(char, int, int, boolean); -E void costly_alteration(struct obj *, int); -E struct obj *mksobj_at(int, int, int, boolean, boolean); -E struct obj *mksobj_migr_to_species(int, unsigned, boolean, boolean); -E struct obj *mkobj(char, boolean); -E int rndmonnum(void); -E boolean bogon_is_pname(char); -E struct obj *splitobj(struct obj *, long); -E struct obj *unsplitobj(struct obj *); -E void clear_splitobjs(void); -E void replace_object(struct obj *, struct obj *); -E void bill_dummy_object(struct obj *); -E struct obj *mksobj(int, boolean, boolean); -E int bcsign(struct obj *); -E int weight(struct obj *); -E struct obj *mkgold(long, int, int); -E struct obj *mkcorpstat(int, struct monst *, struct permonst *, int, int, boolean); -E struct obj *obj_attach_mid(struct obj *, unsigned); -E struct monst *get_mtraits(struct obj *, boolean); -E struct obj *mk_tt_object(int, int, int); -E struct obj *mk_named_object(int, struct permonst *, int, int, const char *); -E struct obj *rnd_treefruit_at(int, int); -E void rnd_treesticks_at(int, int); -E void set_corpsenm(struct obj *, int); -E void start_corpse_timeout(struct obj *); -E void bless(struct obj *); -E void unbless(struct obj *); -E void curse(struct obj *); -E void uncurse(struct obj *); -E void blessorcurse(struct obj *, int); -E void set_bknown(struct obj *, unsigned); -E boolean is_flammable(struct obj *); -E boolean is_rottable(struct obj *); -E void place_object(struct obj *, int, int); -E void remove_object(struct obj *); -E void discard_minvent(struct monst *); -E void obj_extract_self(struct obj *); -E void extract_nobj(struct obj *, struct obj **); -E void extract_nexthere(struct obj *, struct obj **); -E int add_to_minv(struct monst *, struct obj *); -E struct obj *add_to_container(struct obj *, struct obj *); -E void add_to_migration(struct obj *); -E void add_to_buried(struct obj *); -E void dealloc_obj(struct obj *); -E void obj_ice_effects(int, int, boolean); -E long peek_at_iced_corpse_age(struct obj *); -E int hornoplenty(struct obj *, boolean); -E int do_stair_travel(char); +extern struct oextra *newoextra(void); +extern void copy_oextra(struct obj *, struct obj *); +extern void dealloc_oextra(struct obj *); +extern void newomonst(struct obj *); +extern void free_omonst(struct obj *); +extern void newomid(struct obj *); +extern void free_omid(struct obj *); +extern void newolong(struct obj *); +extern void free_olong(struct obj *); +extern void new_omailcmd(struct obj *, const char *); +extern void free_omailcmd(struct obj *); +extern struct obj *mkobj_at(char, coordxy, coordxy, boolean); +extern void costly_alteration(struct obj *, int); +extern struct obj *mksobj_at(int, coordxy, coordxy, boolean, boolean); +extern struct obj *mksobj_migr_to_species(int, unsigned, boolean, boolean); +extern struct obj *mkobj(char, boolean); +extern int rndmonnum(void); +extern boolean bogon_is_pname(char); +extern struct obj *splitobj(struct obj *, long); +extern struct obj *unsplitobj(struct obj *); +extern void clear_splitobjs(void); +extern void replace_object(struct obj *, struct obj *); +extern void bill_dummy_object(struct obj *); +extern struct obj *mksobj(int, boolean, boolean); +extern int bcsign(struct obj *); +extern int weight(struct obj *); +extern struct obj *mkgold(long, coordxy, coordxy); +extern struct obj *mkcorpstat(int, struct monst *, struct permonst *, coordxy, coordxy, boolean); +extern struct obj *obj_attach_mid(struct obj *, unsigned); +extern struct monst *get_mtraits(struct obj *, boolean); +extern struct obj *mk_tt_object(int, coordxy, coordxy); +extern struct obj *mk_named_object(int, struct permonst *, coordxy, coordxy, const char *); +extern struct obj *rnd_treefruit_at(coordxy, coordxy); +extern void rnd_treesticks_at(coordxy, coordxy); +extern void set_corpsenm(struct obj *, int); +extern void start_corpse_timeout(struct obj *); +extern void bless(struct obj *); +extern void unbless(struct obj *); +extern void curse(struct obj *); +extern void uncurse(struct obj *); +extern void blessorcurse(struct obj *, int); +extern void set_bknown(struct obj *, unsigned); +extern boolean is_flammable(struct obj *); +extern boolean is_rottable(struct obj *); +extern void place_object(struct obj *, coordxy, coordxy); +extern void remove_object(struct obj *); +extern void discard_minvent(struct monst *); +extern void obj_extract_self(struct obj *); +extern void extract_nobj(struct obj *, struct obj **); +extern void extract_nexthere(struct obj *, struct obj **); +extern int add_to_minv(struct monst *, struct obj *); +extern struct obj *add_to_container(struct obj *, struct obj *); +extern void add_to_migration(struct obj *); +extern void add_to_buried(struct obj *); +extern void dealloc_obj(struct obj *); +extern void obj_ice_effects(coordxy, coordxy, boolean); +extern long peek_at_iced_corpse_age(struct obj *); +extern int hornoplenty(struct obj *, boolean); +extern int do_stair_travel(char); #ifdef WIZARD -E void obj_sanity_check(void); +extern void obj_sanity_check(void); #endif -E struct obj *obj_nexto(struct obj *); -E struct obj *obj_nexto_xy(struct obj *, int, int, boolean); -E struct obj *obj_absorb(struct obj **, struct obj **); -E struct obj *obj_meld(struct obj **, struct obj **); -E void pudding_merge_message(struct obj *, struct obj *); -E struct obj *init_dummyobj(struct obj *, short, long); +extern struct obj *obj_nexto(struct obj *); +extern struct obj *obj_nexto_xy(struct obj *, coordxy, coordxy, boolean); +extern struct obj *obj_absorb(struct obj **, struct obj **); +extern struct obj *obj_meld(struct obj **, struct obj **); +extern void pudding_merge_message(struct obj *, struct obj *); +extern struct obj *init_dummyobj(struct obj *, short, long); /* ### mkroom.c ### */ -E struct mkroom * pick_room(boolean); -E void mkroom(int); -E void fill_zoo(struct mkroom *); -E boolean nexttodoor(int, int); -E boolean bydoor(xchar, xchar); -E boolean somexyspace(struct mkroom *, coord *, int); -E boolean has_dnstairs(struct mkroom *); -E boolean has_upstairs(struct mkroom *); -E int somex(struct mkroom *); -E int somey(struct mkroom *); -E boolean inside_room(struct mkroom *, xchar, xchar); -E boolean somexy(struct mkroom *, coord *); -E void mkundead(coord *, boolean, int); -E struct permonst *courtmon(void); -E void save_rooms(int); -E void rest_rooms(int); -E struct mkroom *search_special(schar); -E int cmap_to_type(int); +extern struct mkroom * pick_room(boolean); +extern void mkroom(int); +extern void fill_zoo(struct mkroom *); +extern boolean nexttodoor(int, int); +extern boolean bydoor(coordxy, coordxy); +extern boolean somexyspace(struct mkroom *, coord *, int); +extern boolean has_dnstairs(struct mkroom *); +extern boolean has_upstairs(struct mkroom *); +extern int somex(struct mkroom *); +extern int somey(struct mkroom *); +extern boolean inside_room(struct mkroom *, coordxy, coordxy); +extern boolean somexy(struct mkroom *, coord *); +extern void mkundead(coord *, boolean, int); +extern struct permonst *courtmon(void); +extern void save_rooms(int); +extern void rest_rooms(int); +extern struct mkroom *search_special(schar); +extern int cmap_to_type(int); extern boolean is_rainbow_shop(struct mkroom *); /* #### mksheol.c ### */ -E void mksheol(void*); +extern void mksheol(void*); /* ### mon.c ### */ extern boolean zombie_maker(struct monst *); extern int zombie_form(struct permonst *); -E int select_newcham_form(struct monst *); -E void remove_monster(int, int); -E int m_poisongas_ok(struct monst *); -E int undead_to_corpse(int); -E int genus(int, int); -E int pm_to_cham(int); -E int minliquid(struct monst *); -E int movemon(void); -E int meatmetal(struct monst *); -E int meatobj(struct monst *); -E void mpickgold(struct monst *); -E boolean mpickstuff(struct monst *, const char *); -E void mpickup_obj(struct monst *, struct obj *); -E int curr_mon_load(struct monst *); -E int max_mon_load(struct monst *); -E int can_carry(struct monst *, struct obj *); -E int mfndpos(struct monst *, coord *, long *, long); -E boolean monnear(struct monst *, int, int); -E void dmonsfree(void); -E void elemental_clog(struct monst *); -E int mcalcmove(struct monst*); -E void mcalcdistress(void); -E void replmon(struct monst *, struct monst *); -E void relmon(struct monst *, struct monst **); -E struct obj *mlifesaver(struct monst *); -E boolean corpse_chance(struct monst *, struct monst *, boolean); +extern int select_newcham_form(struct monst *); +extern void remove_monster(coordxy, coordxy); +extern int m_poisongas_ok(struct monst *); +extern int undead_to_corpse(int); +extern int genus(int, int); +extern int pm_to_cham(int); +extern int minliquid(struct monst *); +extern int movemon(void); +extern int meatmetal(struct monst *); +extern int meatobj(struct monst *); +extern void mpickgold(struct monst *); +extern boolean mpickstuff(struct monst *, const char *); +extern void mpickup_obj(struct monst *, struct obj *); +extern int curr_mon_load(struct monst *); +extern int max_mon_load(struct monst *); +extern int can_carry(struct monst *, struct obj *); +extern int mfndpos(struct monst *, coord *, long *, long); +extern boolean monnear(struct monst *, coordxy, coordxy); +extern void dmonsfree(void); +extern void elemental_clog(struct monst *); +extern int mcalcmove(struct monst*); +extern void mcalcdistress(void); +extern void replmon(struct monst *, struct monst *); +extern void relmon(struct monst *, struct monst **); +extern struct obj *mlifesaver(struct monst *); +extern boolean corpse_chance(struct monst *, struct monst *, boolean); #ifdef WEBB_DISINT -E void mondead_helper(struct monst *, uchar); -#endif -E void mondead(struct monst *); -E void mondied(struct monst *); -E void mongone(struct monst *); -E void monstone(struct monst *); -E void monkilled(struct monst *, const char *, int); -E void unstuck(struct monst *); -E void killed(struct monst *); -E void xkilled(struct monst *, int); -E void mon_to_stone(struct monst*); -E void m_into_limbo(struct monst *); -E void mnexto(struct monst *); -E void maybe_mnexto(struct monst *); -E int mnearto(struct monst *, xchar, xchar, boolean); -E void poisontell(int); -E void poisoned(const char *, int, const char *, int); -E void m_respond(struct monst *); -E void setmangry(struct monst *, boolean); -E void wakeup(struct monst *, boolean); -E void wake_nearby(void); -E void wake_nearto(int, int, int); -E void seemimic(struct monst *); -E void rescham(void); -E void restartcham(void); -E void restore_cham(struct monst *); -E boolean hideunder(struct monst *); -E void mon_animal_list(boolean); -E boolean validvamp(struct monst *, int *, int); -E void mgender_from_permonst(struct monst *, struct permonst *); -E int newcham(struct monst *, struct permonst *, boolean, boolean); -E int can_be_hatched(int); -E int egg_type_from_parent(int, boolean); -E boolean dead_species(int, boolean); -E void kill_genocided_monsters(void); -E void kill_monster_on_level(int); -E void golemeffects(struct monst *, int, int); -E boolean angry_guards(boolean); -E void pacify_guards(void); -E void decide_to_shapeshift(struct monst *, int); +extern void mondead_helper(struct monst *, uchar); +#endif +extern void mondead(struct monst *); +extern void mondied(struct monst *); +extern void mongone(struct monst *); +extern void monstone(struct monst *); +extern void monkilled(struct monst *, const char *, int); +extern void unstuck(struct monst *); +extern void killed(struct monst *); +extern void xkilled(struct monst *, int); +extern void mon_to_stone(struct monst*); +extern void m_into_limbo(struct monst *); +extern void mnexto(struct monst *); +extern void maybe_mnexto(struct monst *); +extern int mnearto(struct monst *, coordxy, coordxy, boolean); +extern void poisontell(int); +extern void poisoned(const char *, int, const char *, int); +extern void m_respond(struct monst *); +extern void setmangry(struct monst *, boolean); +extern void wakeup(struct monst *, boolean); +extern void wake_nearby(void); +extern void wake_nearto(coordxy, coordxy, int); +extern void seemimic(struct monst *); +extern void rescham(void); +extern void restartcham(void); +extern void restore_cham(struct monst *); +extern boolean hideunder(struct monst *); +extern void mon_animal_list(boolean); +extern boolean validvamp(struct monst *, int *, int); +extern void mgender_from_permonst(struct monst *, struct permonst *); +extern int newcham(struct monst *, struct permonst *, boolean, boolean); +extern int can_be_hatched(int); +extern int egg_type_from_parent(int, boolean); +extern boolean dead_species(int, boolean); +extern void kill_genocided_monsters(void); +extern void kill_monster_on_level(int); +extern void golemeffects(struct monst *, int, int); +extern boolean angry_guards(boolean); +extern void pacify_guards(void); +extern void decide_to_shapeshift(struct monst *, int); /* ### mondata.c ### */ -E void set_mon_data(struct monst *, struct permonst *); -E struct attack *attacktype_fordmg(struct permonst *, int, int); -E boolean attacktype(struct permonst *, int); -E boolean noattacks(struct permonst *); -E boolean poly_when_stoned(struct permonst *); -E boolean resists_drli(struct monst *); -E boolean resists_magm(struct monst *); -E boolean resists_blnd(struct monst *); -E boolean can_blnd(struct monst *, struct monst *, uchar, struct obj *); -E boolean ranged_attk(struct permonst *); -E boolean hates_silver(struct permonst *); -E boolean mon_hates_silver(struct monst *); -E boolean mon_hates_light(struct monst *); -E boolean passes_bars(struct permonst *); -E boolean can_blow(struct monst *); -E boolean can_chant(struct monst *); -E boolean can_be_strangled(struct monst *); -E boolean can_track(struct permonst *); -E boolean breakarm(struct permonst *); -E boolean sliparm(struct permonst *); -E boolean sticks(struct permonst *); -E boolean cantvomit(struct permonst *); -E int num_horns(struct permonst *); +extern void set_mon_data(struct monst *, struct permonst *); +extern struct attack *attacktype_fordmg(struct permonst *, int, int); +extern boolean attacktype(struct permonst *, int); +extern boolean noattacks(struct permonst *); +extern boolean poly_when_stoned(struct permonst *); +extern boolean resists_drli(struct monst *); +extern boolean resists_magm(struct monst *); +extern boolean resists_blnd(struct monst *); +extern boolean can_blnd(struct monst *, struct monst *, uchar, struct obj *); +extern boolean ranged_attk(struct permonst *); +extern boolean hates_silver(struct permonst *); +extern boolean mon_hates_silver(struct monst *); +extern boolean mon_hates_light(struct monst *); +extern boolean passes_bars(struct permonst *); +extern boolean can_blow(struct monst *); +extern boolean can_chant(struct monst *); +extern boolean can_be_strangled(struct monst *); +extern boolean can_track(struct permonst *); +extern boolean breakarm(struct permonst *); +extern boolean sliparm(struct permonst *); +extern boolean sticks(struct permonst *); +extern boolean cantvomit(struct permonst *); +extern int num_horns(struct permonst *); /* E boolean canseemon(struct monst *); */ -E struct attack *dmgtype_fromattack(struct permonst *, int, int); -E boolean dmgtype(struct permonst *, int); -E int max_passive_dmg(struct monst *, struct monst *); -E boolean same_race(struct permonst *, struct permonst *); -E int monsndx(struct permonst *); -E int name_to_mon(const char *); -E int name_to_monclass(const char *, int *); -E int gender(struct monst *); -E int pronoun_gender(struct monst *, boolean); -E boolean levl_follower(struct monst *); -E int little_to_big(int); -E int big_to_little(int); -E const char *locomotion(const struct permonst *, const char *); -E const char *stagger(const struct permonst *, const char *); -E const char *on_fire(struct permonst *, struct attack *); -E const struct permonst *raceptr(struct monst *); -E boolean olfaction(struct permonst *); +extern struct attack *dmgtype_fromattack(struct permonst *, int, int); +extern boolean dmgtype(struct permonst *, int); +extern int max_passive_dmg(struct monst *, struct monst *); +extern boolean same_race(struct permonst *, struct permonst *); +extern int monsndx(struct permonst *); +extern int name_to_mon(const char *); +extern int name_to_monclass(const char *, int *); +extern int gender(struct monst *); +extern int pronoun_gender(struct monst *, boolean); +extern boolean levl_follower(struct monst *); +extern int little_to_big(int); +extern int big_to_little(int); +extern const char *locomotion(const struct permonst *, const char *); +extern const char *stagger(const struct permonst *, const char *); +extern const char *on_fire(struct permonst *, struct attack *); +extern const struct permonst *raceptr(struct monst *); +extern boolean olfaction(struct permonst *); extern boolean is_fleshy(const struct permonst *); /* ### monmove.c ### */ -E boolean itsstuck(struct monst *); -E boolean mb_trapped(struct monst *); -E boolean mon_has_key(struct monst *, boolean); -E void mon_regen(struct monst *, boolean); -E int dochugw(struct monst *); -E boolean onscary(int, int, struct monst *); -E void monflee(struct monst *, int, boolean, boolean); -E int dochug(struct monst *); -E boolean m_digweapon_check(struct monst *, xchar, xchar); -E int m_move(struct monst *, int); -extern int m_move_aggress(struct monst *, xchar, xchar); -E boolean closed_door(int, int); -E boolean accessible(int, int); -E void set_apparxy(struct monst *); -E boolean can_ooze(struct monst *); -E boolean can_fog(struct monst *); -E boolean should_displace(struct monst *, coord *, long *, int, xchar, xchar); -E boolean undesirable_disp(struct monst *, xchar, xchar); +extern boolean itsstuck(struct monst *); +extern boolean mb_trapped(struct monst *); +extern boolean mon_has_key(struct monst *, boolean); +extern void mon_regen(struct monst *, boolean); +extern int dochugw(struct monst *); +extern boolean onscary(coordxy, coordxy, struct monst *); +extern void monflee(struct monst *, int, boolean, boolean); +extern int dochug(struct monst *); +extern boolean m_digweapon_check(struct monst *, coordxy, coordxy); +extern int m_move(struct monst *, int); +extern int m_move_aggress(struct monst *, coordxy, coordxy); +extern boolean closed_door(coordxy, coordxy); +extern boolean accessible(coordxy, coordxy); +extern void set_apparxy(struct monst *); +extern boolean can_ooze(struct monst *); +extern boolean can_fog(struct monst *); +extern boolean should_displace(struct monst *, coord *, long *, int, coordxy, coordxy); +extern boolean undesirable_disp(struct monst *, coordxy, coordxy); /* ### monst.c ### */ -E void monst_init(void); +extern void monst_init(void); /* ### monstr.c ### */ -E void monstr_init(void); +extern void monstr_init(void); /* ### mplayer.c ### */ -E struct monst *mk_mplayer(struct permonst *, xchar, xchar, boolean); -E void create_mplayers(int, boolean); -E void mplayer_talk(struct monst *); +extern struct monst *mk_mplayer(struct permonst *, coordxy, coordxy, boolean); +extern void create_mplayers(int, boolean); +extern void mplayer_talk(struct monst *); extern const char* dev_name(void); #if defined(MICRO) || defined(WIN32) @@ -1634,249 +1634,249 @@ extern const char* dev_name(void); /* ### msdos.c,os2.c,tos.c,winnt.c ### */ # ifndef WIN32 -E int tgetch(void); +extern int tgetch(void); # endif # ifndef TOS -E char switchar(void); +extern char switchar(void); # endif # ifndef __GO32__ -E long freediskspace(char *); +extern long freediskspace(char *); # ifdef MSDOS -E int findfirst_file(char *); -E int findnext_file(void); -E long filesize_nh(char *); +extern int findfirst_file(char *); +extern int findnext_file(void); +extern long filesize_nh(char *); # else -E int findfirst(char *); -E int findnext(void); -E long filesize(char *); +extern int findfirst(char *); +extern int findnext(void); +extern long filesize(char *); # endif /* MSDOS */ -E char *foundfile_buffer(void); +extern char *foundfile_buffer(void); # endif /* __GO32__ */ -E void chdrive(char *); +extern void chdrive(char *); # ifndef TOS -E void disable_ctrlP(void); -E void enable_ctrlP(void); +extern void disable_ctrlP(void); +extern void enable_ctrlP(void); # endif # if defined(MICRO) && !defined(WINNT) -E void get_scr_size(void); +extern void get_scr_size(void); # ifndef TOS -E void gotoxy(int, int); +extern void gotoxy(int, int); # endif # endif # ifdef TOS -E int _copyfile(char *, char *); -E int kbhit(void); -E void set_colors(void); -E void restore_colors(void); +extern int _copyfile(char *, char *); +extern int kbhit(void); +extern void set_colors(void); +extern void restore_colors(void); # ifdef SUSPEND -E int dosuspend(void); +extern int dosuspend(void); # endif # endif /* TOS */ # ifdef WIN32 -E char *get_username(int *); -E void nt_regularize(char *); -E int (*nt_kbhit)(); -E void Delay(int); +extern char *get_username(int *); +extern void nt_regularize(char *); +extern int (*nt_kbhit)(void); +extern void Delay(int); # endif /* WIN32 */ #endif /* MICRO || WIN32 */ /* ### mthrowu.c ### */ -E int thitu(int, int, struct obj **, const char *); -E int ohitmon(struct monst *, struct obj *, int, boolean); -E void thrwmu(struct monst *); -E int spitmu(struct monst *, struct attack *); -E int breamu(struct monst *, struct attack *); -E boolean linedup(xchar, xchar, xchar, xchar, int); -E boolean lined_up(struct monst *); -E struct obj *m_carrying(struct monst *, int); -E int thrwmm(struct monst *, struct monst *); -E int spitmm(struct monst *, struct attack *, struct monst *); -E int breamm(struct monst *, struct attack *, struct monst *); -E void m_useupall(struct monst *, struct obj *); -E void m_useup(struct monst *, struct obj *); -E void m_throw(struct monst *, int, int, int, int, int, struct obj *); -E boolean hits_bars(struct obj **, int, int, int, int, int, int); -E void hit_bars(struct obj **, int, int, int, int, boolean, boolean); -E void dissolve_bars(int, int); +extern int thitu(int, int, struct obj **, const char *); +extern int ohitmon(struct monst *, struct obj *, int, boolean); +extern void thrwmu(struct monst *); +extern int spitmu(struct monst *, struct attack *); +extern int breamu(struct monst *, struct attack *); +extern boolean linedup(coordxy, coordxy, coordxy, coordxy, int); +extern boolean lined_up(struct monst *); +extern struct obj *m_carrying(struct monst *, int); +extern int thrwmm(struct monst *, struct monst *); +extern int spitmm(struct monst *, struct attack *, struct monst *); +extern int breamm(struct monst *, struct attack *, struct monst *); +extern void m_useupall(struct monst *, struct obj *); +extern void m_useup(struct monst *, struct obj *); +extern void m_throw(struct monst *, coordxy, coordxy, int, int, int, struct obj *); +extern boolean hits_bars(struct obj **, int, int, int, int, int, int); +extern void hit_bars(struct obj **, int, int, int, int, boolean, boolean); +extern void dissolve_bars(coordxy, coordxy); /* ### muse.c ### */ -E boolean find_defensive(struct monst *); -E int use_defensive(struct monst *); -E int rnd_defensive_item(struct monst *); -E boolean find_offensive(struct monst *); +extern boolean find_defensive(struct monst *); +extern int use_defensive(struct monst *); +extern int rnd_defensive_item(struct monst *); +extern boolean find_offensive(struct monst *); #ifdef USE_TRAMPOLI -E int mbhitm(struct monst *, struct obj *); -#endif -E int use_offensive(struct monst *); -E int rnd_offensive_item(struct monst *); -E boolean find_misc(struct monst *); -E int use_misc(struct monst *); -E int rnd_misc_item(struct monst *); -E boolean searches_for_item(struct monst *, struct obj *); -E boolean mon_reflects(struct monst *, const char *); -E boolean ureflects(const char *, const char *); -E void mcureblindness(struct monst *, boolean); -E boolean munstone(struct monst *, boolean); -E boolean munslime(struct monst *, boolean); +extern int mbhitm(struct monst *, struct obj *); +#endif +extern int use_offensive(struct monst *); +extern int rnd_offensive_item(struct monst *); +extern boolean find_misc(struct monst *); +extern int use_misc(struct monst *); +extern int rnd_misc_item(struct monst *); +extern boolean searches_for_item(struct monst *, struct obj *); +extern boolean mon_reflects(struct monst *, const char *); +extern boolean ureflects(const char *, const char *); +extern void mcureblindness(struct monst *, boolean); +extern boolean munstone(struct monst *, boolean); +extern boolean munslime(struct monst *, boolean); /* ### music.c ### */ -E void awaken_monsters(int); -E void do_earthquake(int); -E void awaken_soldiers(struct monst *); -E int do_play_instrument(struct obj *); +extern void awaken_monsters(int); +extern void do_earthquake(int); +extern void awaken_soldiers(struct monst *); +extern int do_play_instrument(struct obj *); /* ### nhlan.c ### */ #ifdef LAN_FEATURES -E void init_lan_features(void); -E char *lan_username(void); +extern void init_lan_features(void); +extern char *lan_username(void); # ifdef LAN_MAIL -E boolean lan_mail_check(void); -E void lan_mail_read(struct obj *); -E void lan_mail_init(void); -E void lan_mail_finish(void); -E void lan_mail_terminate(void); +extern boolean lan_mail_check(void); +extern void lan_mail_read(struct obj *); +extern void lan_mail_init(void); +extern void lan_mail_finish(void); +extern void lan_mail_terminate(void); # endif #endif /* ### nhregex.c ### */ -E struct nhregex *regex_init(void); -E boolean regex_compile(const char *, struct nhregex *); -E const char *regex_error_desc(struct nhregex *); -E boolean regex_match(const char *, struct nhregex *); -E void regex_free(struct nhregex *); +extern struct nhregex *regex_init(void); +extern boolean regex_compile(const char *, struct nhregex *); +extern const char *regex_error_desc(struct nhregex *); +extern boolean regex_match(const char *, struct nhregex *); +extern void regex_free(struct nhregex *); /* ### nttty.c ### */ #ifdef WIN32CON -E void get_scr_size(void); -E int nttty_kbhit(void); -E void nttty_open(void); -E void nttty_rubout(void); -E int tgetch(void); -E int ntposkey(int *, int *, int *); -E void set_output_mode(int); -E void synch_cursor(void); +extern void get_scr_size(void); +extern int nttty_kbhit(void); +extern void nttty_open(void); +extern void nttty_rubout(void); +extern int tgetch(void); +extern int ntposkey(int *, int *, int *); +extern void set_output_mode(int); +extern void synch_cursor(void); #endif /* ### o_init.c ### */ -E void init_objects(void); -E int find_skates(void); -E void oinit(void); -E void savenames(int, int); -E void restnames(int); -E void discover_object(int, boolean, boolean); -E void undiscover_object(int); -E int dodiscovered(void); -E void dragons_init(void); -E void makeknown_msg(int); -E int doclassdisco(void); -E void rename_disco(void); +extern void init_objects(void); +extern int find_skates(void); +extern void oinit(void); +extern void savenames(int, int); +extern void restnames(int); +extern void discover_object(int, boolean, boolean); +extern void undiscover_object(int); +extern int dodiscovered(void); +extern void dragons_init(void); +extern void makeknown_msg(int); +extern int doclassdisco(void); +extern void rename_disco(void); /* ### objects.c ### */ -E void objects_init(void); +extern void objects_init(void); /* ### objnam.c ### */ -E char *obj_typename(int); -E char *simple_typename(int); -E char *dump_typename(int); -E char *safe_typename(int); -E boolean obj_is_pname(struct obj *); -E char *distant_name(struct obj *, char *(*)(OBJ_P)); -E char *fruitname(boolean); -E struct fruit *fruit_from_indx(int); -E char *xname(struct obj *); -E char *mshot_xname(struct obj *); -E boolean the_unique_obj(struct obj *obj); -E boolean the_unique_pm(struct permonst *); -E boolean erosion_matters(struct obj *); +extern char *obj_typename(int); +extern char *simple_typename(int); +extern char *dump_typename(int); +extern char *safe_typename(int); +extern boolean obj_is_pname(struct obj *); +extern char *distant_name(struct obj *, char *(*)(OBJ_P)); +extern char *fruitname(boolean); +extern struct fruit *fruit_from_indx(int); +extern char *xname(struct obj *); +extern char *mshot_xname(struct obj *); +extern boolean the_unique_obj(struct obj *obj); +extern boolean the_unique_pm(struct permonst *); +extern boolean erosion_matters(struct obj *); extern long display_weight(struct obj *); -E char *doname(struct obj *); -E char *doname_with_price(struct obj *); -E boolean not_fully_identified(struct obj *); -E char *corpse_xname(struct obj *, const char *, unsigned); -E char *cxname(struct obj *); +extern char *doname(struct obj *); +extern char *doname_with_price(struct obj *); +extern boolean not_fully_identified(struct obj *); +extern char *corpse_xname(struct obj *, const char *, unsigned); +extern char *cxname(struct obj *); #ifdef SORTLOOT -E char *cxname_singular(struct obj *); +extern char *cxname_singular(struct obj *); #endif extern char *cxname_unidentified(struct obj *); -E char *killer_xname(struct obj *); -E char *short_oname(struct obj *, char *(*)(OBJ_P), char *(*)(OBJ_P), unsigned); -E const char *singular(struct obj *, char *(*)(OBJ_P)); -E char *an(const char *); -E char *An(const char *); -E char *The(const char *); -E char *the(const char *); -E char *aobjnam(struct obj *, const char *); -E char *yobjnam(struct obj *, const char *); -E char *Yobjnam2(struct obj *, const char *); -E char *Tobjnam(struct obj *, const char *); -E char *otense(struct obj *, const char *); -E char *vtense(const char *, const char *); -E char *Doname2(struct obj *); -E char *yname(struct obj *); -E char *Yname2(struct obj *); -E char *ysimple_name(struct obj *); -E char *Ysimple_name2(struct obj *); -E char *simpleonames(struct obj *); -E char *ansimpleoname(struct obj *); -E char *thesimpleoname(struct obj *); -E char *bare_artifactname(struct obj *); -E char *makeplural(const char *); -E char *makesingular(const char *); +extern char *killer_xname(struct obj *); +extern char *short_oname(struct obj *, char *(*)(OBJ_P), char *(*)(OBJ_P), unsigned); +extern const char *singular(struct obj *, char *(*)(OBJ_P)); +extern char *an(const char *); +extern char *An(const char *); +extern char *The(const char *); +extern char *the(const char *); +extern char *aobjnam(struct obj *, const char *); +extern char *yobjnam(struct obj *, const char *); +extern char *Yobjnam2(struct obj *, const char *); +extern char *Tobjnam(struct obj *, const char *); +extern char *otense(struct obj *, const char *); +extern char *vtense(const char *, const char *); +extern char *Doname2(struct obj *); +extern char *yname(struct obj *); +extern char *Yname2(struct obj *); +extern char *ysimple_name(struct obj *); +extern char *Ysimple_name2(struct obj *); +extern char *simpleonames(struct obj *); +extern char *ansimpleoname(struct obj *); +extern char *thesimpleoname(struct obj *); +extern char *bare_artifactname(struct obj *); +extern char *makeplural(const char *); +extern char *makesingular(const char *); extern short name_to_otyp(const char *); -E struct obj *readobjnam(char *, struct obj *); -E int rnd_class(int, int); -E const char *suit_simple_name(struct obj *); -E const char *cloak_simple_name(struct obj *); -E const char *helm_simple_name(struct obj *); -E const char *gloves_simple_name(struct obj *); -E const char *mimic_obj_name(struct monst *); -E char *safe_qbuf(char *, const char *, const char *, struct obj *, +extern struct obj *readobjnam(char *, struct obj *); +extern int rnd_class(int, int); +extern const char *suit_simple_name(struct obj *); +extern const char *cloak_simple_name(struct obj *); +extern const char *helm_simple_name(struct obj *); +extern const char *gloves_simple_name(struct obj *); +extern const char *mimic_obj_name(struct monst *); +extern char *safe_qbuf(char *, const char *, const char *, struct obj *, char *(*)(OBJ_P), char *(*)(OBJ_P), const char *); -E int shiny_obj(char); +extern int shiny_obj(char); /* ### options.c ### */ -E boolean match_optname(const char *, const char *, int, boolean); -E void initoptions(void); +extern boolean match_optname(const char *, const char *, int, boolean); +extern void initoptions(void); extern boolean parseoptions(char *, boolean, boolean); -E boolean parse_monster_color(char *); -E boolean parse_symbol(const char *); -E boolean parse_monster_symbol(const char *); -E boolean parse_object_symbol(const char *); -E boolean parse_color_definition(const char *); -E int doset(void); -E int dotogglepickup(void); -E void option_help(void); -E void next_opt(winid, const char *); -E int fruitadd(char *); -E int choose_classes_menu(const char *, int, boolean, char *, char *); +extern boolean parse_monster_color(char *); +extern boolean parse_symbol(const char *); +extern boolean parse_monster_symbol(const char *); +extern boolean parse_object_symbol(const char *); +extern boolean parse_color_definition(const char *); +extern int doset(void); +extern int dotogglepickup(void); +extern void option_help(void); +extern void next_opt(winid, const char *); +extern int fruitadd(char *); +extern int choose_classes_menu(const char *, int, boolean, char *, char *); extern boolean parsebindings(char *); -E void add_menu_cmd_alias(char, char); -E char map_menu_cmd(char); -E void assign_warnings(uchar *); -E char *nh_getenv(const char *); -E void set_duplicate_opt_detection(int); -E void set_wc_option_mod_status(unsigned long, int); -E void set_wc2_option_mod_status(unsigned long, int); -E void set_option_mod_status(const char *, int); +extern void add_menu_cmd_alias(char, char); +extern char map_menu_cmd(char); +extern void assign_warnings(uchar *); +extern char *nh_getenv(const char *); +extern void set_duplicate_opt_detection(int); +extern void set_wc_option_mod_status(unsigned long, int); +extern void set_wc2_option_mod_status(unsigned long, int); +extern void set_option_mod_status(const char *, int); #ifdef AUTOPICKUP_EXCEPTIONS -E int add_autopickup_exception(const char *); -E void free_autopickup_exceptions(void); +extern int add_autopickup_exception(const char *); +extern void free_autopickup_exceptions(void); #endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef MENU_COLOR -E boolean add_menu_coloring(char *); +extern boolean add_menu_coloring(char *); #endif /* MENU_COLOR */ -E void free_menu_coloring(void); -E const char * clr2colorname(int); -E int query_color(const char *); -E int query_attr(const char *); +extern void free_menu_coloring(void); +extern const char * clr2colorname(int); +extern int query_color(const char *); +extern int query_attr(const char *); #if defined(STATUS_COLORS) && defined(TEXTCOLOR) extern boolean parse_status_color_options(char *); extern void free_status_colors(void); @@ -1884,66 +1884,66 @@ extern void free_status_colors(void); /* ### pager.c ### */ -E void mhidden_description(struct monst *, boolean, char *); -E boolean object_from_map(int,int,int,struct obj **); -E int do_screen_description(coord, boolean, glyph_t, char *, const char **, struct permonst **); +extern void mhidden_description(struct monst *, boolean, char *); +extern boolean object_from_map(int, coordxy, coordxy, struct obj **); +extern int do_screen_description(coord, boolean, glyph_t, char *, const char **, struct permonst **); extern int do_look(int, coord *); -E int dowhatis(void); -E int doquickwhatis(void); -E int doidtrap(void); -E int dowhatdoes(void); -E char *dowhatdoes_core(char, char *); -E int dohelp(void); -E int dohistory(void); -E void checkfile(struct obj *, char *, struct permonst *, boolean, boolean, char *); +extern int dowhatis(void); +extern int doquickwhatis(void); +extern int doidtrap(void); +extern int dowhatdoes(void); +extern char *dowhatdoes_core(char, char *); +extern int dohelp(void); +extern int dohistory(void); +extern void checkfile(struct obj *, char *, struct permonst *, boolean, boolean, char *); /* ### pcmain.c ### */ #if defined(MICRO) || defined(WIN32) # ifdef CHDIR -E void chdirx(char *, boolean); +extern void chdirx(char *, boolean); # endif /* CHDIR */ #endif /* MICRO || WIN32 */ /* ### pcsys.c ### */ #if defined(MICRO) || defined(WIN32) -E void flushout(void); -E int dosh(void); +extern void flushout(void); +extern int dosh(void); # ifdef MFLOPPY -E void eraseall(const char *, const char *); -E void copybones(int); -E void playwoRAMdisk(void); -E int saveDiskPrompt(int); -E void gameDiskPrompt(void); +extern void eraseall(const char *, const char *); +extern void copybones(int); +extern void playwoRAMdisk(void); +extern int saveDiskPrompt(int); +extern void gameDiskPrompt(void); # endif -E void append_slash(char *); -E void getreturn(const char *); +extern void append_slash(char *); +extern void getreturn(const char *); # ifndef AMIGA -E void VDECL(msmsg, (const char *, ...)); +extern void VDECL(msmsg, (const char *, ...)); # endif -E FILE *fopenp(const char *, const char *); +extern FILE *fopenp(const char *, const char *); #endif /* MICRO || WIN32 */ /* ### pctty.c ### */ #if defined(MICRO) || defined(WIN32) -E void gettty(void); -E void settty(const char *); -E void setftty(void); -E void VDECL(error, (const char *, ...)); +extern void gettty(void); +extern void settty(const char *); +extern void setftty(void); +extern void VDECL(error, (const char *, ...)); #if defined(TIMED_DELAY) && defined(_MSC_VER) -E void msleep(unsigned); +extern void msleep(unsigned); #endif #endif /* MICRO || WIN32 */ /* ### pcunix.c ### */ #if defined(MICRO) -E void regularize(char *); +extern void regularize(char *); #endif /* MICRO */ #if defined(PC_LOCKING) -E void getlock(void); +extern void getlock(void); #endif /* ### pickup.c ### */ @@ -1951,115 +1951,115 @@ E void getlock(void); extern int get_most_recently_picked_up_turn(void); extern int count_most_recently_picked_up(struct obj *); extern struct obj *find_most_recently_picked_up_obj(struct obj *); -E void observe_quantum_cat(struct obj *, boolean); -E boolean container_gone(int (*)(OBJ_P)); -E boolean u_handsy(void); -E void open_coffin(struct obj *, boolean); +extern void observe_quantum_cat(struct obj *, boolean); +extern boolean container_gone(int (*)(OBJ_P)); +extern boolean u_handsy(void); +extern void open_coffin(struct obj *, boolean); extern int collect_obj_classes(char *, struct obj *, boolean, boolean(*)(struct obj *), int *); -E boolean rider_corpse_revival(struct obj *, boolean); -E boolean menu_class_present(int); -E void add_valid_menu_class(int); -E boolean allow_all(struct obj *); -E boolean allow_category(struct obj *); -E boolean is_worn_by_type(struct obj *); +extern boolean rider_corpse_revival(struct obj *, boolean); +extern boolean menu_class_present(int); +extern void add_valid_menu_class(int); +extern boolean allow_all(struct obj *); +extern boolean allow_category(struct obj *); +extern boolean is_worn_by_type(struct obj *); #ifdef USE_TRAMPOLI -E int ck_bag(struct obj *); -E int in_container(struct obj *); -E int out_container(struct obj *); +extern int ck_bag(struct obj *); +extern int in_container(struct obj *); +extern int out_container(struct obj *); #endif -E int pickup(int); -E int pickup_object(struct obj *, long, boolean); +extern int pickup(int); +extern int pickup_object(struct obj *, long, boolean); extern int query_category(const char *, struct obj *, int, menu_item **, int); extern int query_objlist(const char *, struct obj *, int, menu_item **, int, boolean (*)(OBJ_P)); -E struct obj *pick_obj(struct obj *); -E int encumber_msg(void); -E int container_at(int, int, boolean); -E int doloot(void); -E int dotip(void); -E int use_container(struct obj **, int, boolean); -E int loot_mon(struct monst *, int *, boolean *); -E boolean is_autopickup_exception(struct obj *, boolean); -E boolean autopick_testobj(struct obj *, boolean); +extern struct obj *pick_obj(struct obj *); +extern int encumber_msg(void); +extern int container_at(coordxy, coordxy, boolean); +extern int doloot(void); +extern int dotip(void); +extern int use_container(struct obj **, int, boolean); +extern int loot_mon(struct monst *, int *, boolean *); +extern boolean is_autopickup_exception(struct obj *, boolean); +extern boolean autopick_testobj(struct obj *, boolean); /* ### pline.c ### */ -E void msgpline_add(int, char *); -E void msgpline_free(void); -E void VDECL(pline, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(custompline, (unsigned, const char *, ...)) PRINTF_F(2, 3); -E void VDECL(Norep, (const char *, ...)) PRINTF_F(1, 2); -E void free_youbuf(void); -E void VDECL(You, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(Your, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(You_feel, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(You_cant, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(You_hear, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(You_see, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(pline_The, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(There, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(verbalize, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(raw_printf, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(impossible, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(warning, (const char *, ...)) PRINTF_F(1, 2); -E const char *align_str(aligntyp); -E void mstatusline(struct monst *); -E void ustatusline(void); -E void self_invis_message(void); +extern void msgpline_add(int, char *); +extern void msgpline_free(void); +extern void VDECL(pline, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(custompline, (unsigned, const char *, ...)) PRINTF_F(2, 3); +extern void VDECL(Norep, (const char *, ...)) PRINTF_F(1, 2); +extern void free_youbuf(void); +extern void VDECL(You, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(Your, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(You_feel, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(You_cant, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(You_hear, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(You_see, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(pline_The, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(There, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(verbalize, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(raw_printf, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(impossible, (const char *, ...)) PRINTF_F(1, 2); +extern void VDECL(warning, (const char *, ...)) PRINTF_F(1, 2); +extern const char *align_str(aligntyp); +extern void mstatusline(struct monst *); +extern void ustatusline(void); +extern void self_invis_message(void); /* ### polyself.c ### */ -E void init_uasmon(void); -E void set_uasmon(void); -E void float_vs_flight(void); -E void change_sex(void); -E void polyself(boolean); -E int polymon(int); -E void rehumanize(void); -E int dobreathe(void); -E int dospit(void); -E int doremove(void); -E int dospinweb(void); -E int dosummon(void); -E int dogaze(void); -E int dohide(void); -E int domindblast(void); -E void uunstick(void); -E void skinback(boolean); -E const char *mbodypart(struct monst *, int); -E const char *body_part(int); -E int poly_gender(void); -E void ugolemeffects(int, int); -E boolean is_playermon_genocided(void); -E boolean ugenocided(void); -E const char *udeadinside(void); +extern void init_uasmon(void); +extern void set_uasmon(void); +extern void float_vs_flight(void); +extern void change_sex(void); +extern void polyself(boolean); +extern int polymon(int); +extern void rehumanize(void); +extern int dobreathe(void); +extern int dospit(void); +extern int doremove(void); +extern int dospinweb(void); +extern int dosummon(void); +extern int dogaze(void); +extern int dohide(void); +extern int domindblast(void); +extern void uunstick(void); +extern void skinback(boolean); +extern const char *mbodypart(struct monst *, int); +extern const char *body_part(int); +extern int poly_gender(void); +extern void ugolemeffects(int, int); +extern boolean is_playermon_genocided(void); +extern boolean ugenocided(void); +extern const char *udeadinside(void); /* ### potion.c ### */ -E void set_itimeout(long *, long); -E void incr_itimeout(long *, int); -E void make_confused(long, boolean); -E void make_stunned(long, boolean); -E void make_blinded(long, boolean); -E void make_sick(long, const char *, boolean, int); -E void make_slimed(long, const char *); -E void make_stoned(long, const char *, int, const char *); -E void make_vomiting(long, boolean); -E void toggle_blindness(void); -E boolean make_hallucinated(long, boolean, long); -E void make_glib(int); -E int dodrink(void); -E int dopotion(struct obj *); -E int peffects(struct obj *); -E void healup(int, int, boolean, boolean); -E void strange_feeling(struct obj *, const char *); -E void potionhit(struct monst *, struct obj *, int); -E void potionbreathe(struct obj *); -E boolean get_wet(struct obj *); -E int dodip(void); -E void mongrantswish(struct monst **); -E void djinni_from_bottle(struct obj *); -E struct monst *split_mon(struct monst *, struct monst *); -E const char *bottlename(void); +extern void set_itimeout(long *, long); +extern void incr_itimeout(long *, int); +extern void make_confused(long, boolean); +extern void make_stunned(long, boolean); +extern void make_blinded(long, boolean); +extern void make_sick(long, const char *, boolean, int); +extern void make_slimed(long, const char *); +extern void make_stoned(long, const char *, int, const char *); +extern void make_vomiting(long, boolean); +extern void toggle_blindness(void); +extern boolean make_hallucinated(long, boolean, long); +extern void make_glib(int); +extern int dodrink(void); +extern int dopotion(struct obj *); +extern int peffects(struct obj *); +extern void healup(int, int, boolean, boolean); +extern void strange_feeling(struct obj *, const char *); +extern void potionhit(struct monst *, struct obj *, int); +extern void potionbreathe(struct obj *); +extern boolean get_wet(struct obj *); +extern int dodip(void); +extern void mongrantswish(struct monst **); +extern void djinni_from_bottle(struct obj *); +extern struct monst *split_mon(struct monst *, struct monst *); +extern const char *bottlename(void); extern boolean is_dark_mix_color(struct obj *); extern boolean is_colorless_mix_potion(struct obj *); extern const char* get_base_mix_color(struct obj *); @@ -2068,428 +2068,428 @@ extern short mixtype(struct obj *, struct obj *); /* ### pray.c ### */ #ifdef USE_TRAMPOLI -E int prayer_done(void); -#endif -E int dosacrifice(void); -E boolean can_pray(boolean); -E int dopray(void); -E const char *u_gname(void); -E int doturn(void); -E int altarmask_at(int, int); -E const char *a_gname(void); -E const char *a_gname_at(xchar x, xchar y); -E const char *align_gname(aligntyp); -E const char *halu_gname(aligntyp); -E const char *rnd_gname(int); -E const char *align_gtitle(aligntyp); -E void altar_wrath(int, int); +extern int prayer_done(void); +#endif +extern int dosacrifice(void); +extern boolean can_pray(boolean); +extern int dopray(void); +extern const char *u_gname(void); +extern int doturn(void); +extern int altarmask_at(coordxy, coordxy); +extern const char *a_gname(void); +extern const char *a_gname_at(coordxy x, coordxy y); +extern const char *align_gname(aligntyp); +extern const char *halu_gname(aligntyp); +extern const char *rnd_gname(int); +extern const char *align_gtitle(aligntyp); +extern void altar_wrath(coordxy, coordxy); #ifdef ASTRAL_ESCAPE -E int invoke_amulet(struct obj *); +extern int invoke_amulet(struct obj *); #endif -E int in_trouble(void); +extern int in_trouble(void); extern void msg_luck_change(int change); /* ### priest.c ### */ -E int move_special(struct monst *, boolean, schar, boolean, boolean, - xchar, xchar, xchar, xchar); -E char temple_occupied(char *); -E boolean inhistemple(struct monst *); -E int pri_move(struct monst *); -E void priestini(d_level *, struct mkroom *, int, int, boolean); -E aligntyp mon_aligntyp(struct monst *); -E char *priestname(struct monst *, char *); -E boolean p_coaligned(struct monst *); -E struct monst *findpriest(char); -E void intemple(int); -E void forget_temple_entry(struct monst *); -E void priest_talk(struct monst *); -E struct monst *mk_roamer(struct permonst *, aligntyp, - xchar, xchar, boolean); -E void reset_hostility(struct monst *); -E boolean in_your_sanctuary(struct monst *, xchar, xchar); -E void ghod_hitsu(struct monst *); -E void angry_priest(void); -E void clearpriests(void); -E void restpriest(struct monst *, boolean); -E void newepri(struct monst *); -E void free_epri(struct monst *); -E char *piousness(boolean, const char *); +extern int move_special(struct monst *, boolean, schar, boolean, boolean, + coordxy, coordxy, coordxy, coordxy); +extern char temple_occupied(char *); +extern boolean inhistemple(struct monst *); +extern int pri_move(struct monst *); +extern void priestini(d_level *, struct mkroom *, int, int, boolean); +extern aligntyp mon_aligntyp(struct monst *); +extern char *priestname(struct monst *, char *); +extern boolean p_coaligned(struct monst *); +extern struct monst *findpriest(char); +extern void intemple(int); +extern void forget_temple_entry(struct monst *); +extern void priest_talk(struct monst *); +extern struct monst *mk_roamer(struct permonst *, aligntyp, + coordxy, coordxy, boolean); +extern void reset_hostility(struct monst *); +extern boolean in_your_sanctuary(struct monst *, coordxy, coordxy); +extern void ghod_hitsu(struct monst *); +extern void angry_priest(void); +extern void clearpriests(void); +extern void restpriest(struct monst *, boolean); +extern void newepri(struct monst *); +extern void free_epri(struct monst *); +extern char *piousness(boolean, const char *); /* ### quest.c ### */ -E void onquest(void); -E void nemdead(void); -E void artitouch(void); -E boolean ok_to_quest(void); -E void leader_speaks(struct monst *); -E void nemesis_speaks(void); -E void quest_chat(struct monst *); -E void quest_talk(struct monst *); -E void quest_stat_check(struct monst *); -E void finish_quest(struct obj *); +extern void onquest(void); +extern void nemdead(void); +extern void artitouch(void); +extern boolean ok_to_quest(void); +extern void leader_speaks(struct monst *); +extern void nemesis_speaks(void); +extern void quest_chat(struct monst *); +extern void quest_talk(struct monst *); +extern void quest_stat_check(struct monst *); +extern void finish_quest(struct obj *); /* ### questpgr.c ### */ -E void load_qtlist(void); -E void unload_qtlist(void); -E short quest_info(int); -E const char *ldrname(void); -E boolean is_quest_artifact(struct obj*); -E void com_pager(int); -E void qt_pager(int); -E char *string_subst(char *); -E void qt_com_firstline(int, char*); -E void deliver_splev_message(void); +extern void load_qtlist(void); +extern void unload_qtlist(void); +extern short quest_info(int); +extern const char *ldrname(void); +extern boolean is_quest_artifact(struct obj*); +extern void com_pager(int); +extern void qt_pager(int); +extern char *string_subst(char *); +extern void qt_com_firstline(int, char*); +extern void deliver_splev_message(void); /* ### random.c ### */ #if defined(RANDOM) && !defined(__GO32__) /* djgpp has its own random */ -E void srandom(unsigned); -E char *initstate(unsigned, char *, int); -E char *setstate(char *); -E long random(void); +extern void srandom(unsigned); +extern char *initstate(unsigned, char *, int); +extern char *setstate(char *); +extern long random(void); #endif /* RANDOM */ /* ### read.c ### */ -E void learn_scroll(struct obj *); -E char *tshirt_text(struct obj *, char *); +extern void learn_scroll(struct obj *); +extern char *tshirt_text(struct obj *, char *); extern char *hawaiian_motif(struct obj *, char *); extern char *apron_text(struct obj *, char *); -E int doread(void); -E boolean is_chargeable(struct obj *); -E void recharge(struct obj *, int); -E void forget_objects(int); -E void forget_levels(int); -E void forget_traps(void); -E void forget_map(int); -E int seffects(struct obj *); +extern int doread(void); +extern boolean is_chargeable(struct obj *); +extern void recharge(struct obj *, int); +extern void forget_objects(int); +extern void forget_levels(int); +extern void forget_traps(void); +extern void forget_map(int); +extern int seffects(struct obj *); #ifdef USE_TRAMPOLI -E void set_lit(int, int, genericptr_t); +extern void set_lit(int, int, genericptr_t); #endif -E void litroom(boolean, struct obj *); -E void do_genocide(int, boolean); -E void punish(struct obj *); -E void unpunish(void); -E boolean cant_revive(int *, boolean, struct obj *); +extern void litroom(boolean, struct obj *); +extern void do_genocide(int, boolean); +extern void punish(struct obj *); +extern void unpunish(void); +extern boolean cant_revive(int *, boolean, struct obj *); #ifdef WIZARD -E boolean create_particular(void); +extern boolean create_particular(void); #endif -E void drop_boulder_on_player(boolean, boolean, boolean, boolean); -E int drop_boulder_on_monster(int, int, boolean, boolean); +extern void drop_boulder_on_player(boolean, boolean, boolean, boolean); +extern int drop_boulder_on_monster(int, int, boolean, boolean); extern boolean create_particular_from_buffer(const char*); /* ### rect.c ### */ -E void init_rect(void); -E NhRect *get_rect(NhRect *); -E NhRect *rnd_rect(void); -E void remove_rect(NhRect *); -E void add_rect(NhRect *); -E void split_rects(NhRect *, NhRect *); +extern void init_rect(void); +extern NhRect *get_rect(NhRect *); +extern NhRect *rnd_rect(void); +extern void remove_rect(NhRect *); +extern void add_rect(NhRect *); +extern void split_rects(NhRect *, NhRect *); /* ## region.c ### */ -E void clear_regions(void); -E void run_regions(void); -E boolean in_out_region(xchar, xchar); -E boolean m_in_out_region(struct monst *, xchar, xchar); -E void update_player_regions(void); -E void update_monster_region(struct monst *); -E NhRegion *visible_region_at(xchar, xchar); -E void show_region(NhRegion*, xchar, xchar); -E void save_regions(int, int); -E void rest_regions(int, boolean); -E NhRegion* create_gas_cloud(xchar, xchar, int, size_t, int); -E NhRegion* create_cthulhu_death_cloud(xchar, xchar, int, size_t, int); -E boolean region_danger(void); -E void region_safety(void); +extern void clear_regions(void); +extern void run_regions(void); +extern boolean in_out_region(coordxy, coordxy); +extern boolean m_in_out_region(struct monst *, coordxy, coordxy); +extern void update_player_regions(void); +extern void update_monster_region(struct monst *); +extern NhRegion *visible_region_at(coordxy, coordxy); +extern void show_region(NhRegion*, coordxy, coordxy); +extern void save_regions(int, int); +extern void rest_regions(int, boolean); +extern NhRegion* create_gas_cloud(coordxy, coordxy, int, size_t, int); +extern NhRegion* create_cthulhu_death_cloud(coordxy, coordxy, int, size_t, int); +extern boolean region_danger(void); +extern void region_safety(void); /* ### restore.c ### */ -E void inven_inuse(boolean); -E int dorecover(int); -E void restcemetery(int, struct cemetery **); -E void trickery(char *); -E void getlev(int, int, xchar, boolean); -E void minit(void); -E boolean lookup_id_mapping(unsigned, unsigned *); +extern void inven_inuse(boolean); +extern int dorecover(int); +extern void restcemetery(int, struct cemetery **); +extern void trickery(char *); +extern void getlev(int, int, xint8, boolean); +extern void minit(void); +extern boolean lookup_id_mapping(unsigned, unsigned *); #ifdef ZEROCOMP -E int mread(int, genericptr_t, unsigned int); +extern int mread(int, genericptr_t, unsigned int); #else -E void mread(int, genericptr_t, unsigned int); +extern void mread(int, genericptr_t, unsigned int); #endif /* ### rip.c ### */ -E void genl_outrip(winid, int); +extern void genl_outrip(winid, int); /* ### rnd.c ### */ -E int rn2(int); -E int rnl(int); -E int rnd(int); -E int d(int, int); -E int rne(int); -E int rnz(int); -E int rnf(int, int); +extern int rn2(int); +extern int rnl(int); +extern int rnd(int); +extern int d(int, int); +extern int rne(int); +extern int rnz(int); +extern int rnf(int, int); /* ### role.c ### */ -E boolean validrole(int); -E boolean validrace(int, int); -E boolean validgend(int, int, int); -E boolean validalign(int, int, int); -E int randrole(void); -E int randrace(int); -E int randgend(int, int); -E int randalign(int, int); +extern boolean validrole(int); +extern boolean validrace(int, int); +extern boolean validgend(int, int, int); +extern boolean validalign(int, int, int); +extern int randrole(void); +extern int randrace(int); +extern int randgend(int, int); +extern int randalign(int, int); extern int str2role(const char *); extern int str2race(const char *); extern int str2gend(const char *); extern int str2align(const char *); -E boolean ok_role(int, int, int, int); -E int pick_role(int, int, int, int); -E boolean ok_race(int, int, int, int); -E int pick_race(int, int, int, int); -E boolean ok_gend(int, int, int, int); -E int pick_gend(int, int, int, int); -E boolean ok_align(int, int, int, int); -E int pick_align(int, int, int, int); -E void role_selection_prolog(int, winid); -E void role_menu_extra(int, winid, boolean); -E void role_init(void); -E void rigid_role_checks(void); -E boolean setrolefilter(const char *); -E boolean gotrolefilter(void); -E void clearrolefilter(void); -E void plnamesuffix(void); -E const char *Hello(struct monst *); -E const char *Goodbye(void); -E char *build_plselection_prompt(char *, int, int, int, int, int); -E char *root_plselection_prompt(char *, int, int, int, int, int); -E void violated(int); -E boolean successful_cdt(int); -E boolean intended_cdt(int); -E boolean superfluous_cdt(int); -E boolean failed_cdt(int); +extern boolean ok_role(int, int, int, int); +extern int pick_role(int, int, int, int); +extern boolean ok_race(int, int, int, int); +extern int pick_race(int, int, int, int); +extern boolean ok_gend(int, int, int, int); +extern int pick_gend(int, int, int, int); +extern boolean ok_align(int, int, int, int); +extern int pick_align(int, int, int, int); +extern void role_selection_prolog(int, winid); +extern void role_menu_extra(int, winid, boolean); +extern void role_init(void); +extern void rigid_role_checks(void); +extern boolean setrolefilter(const char *); +extern boolean gotrolefilter(void); +extern void clearrolefilter(void); +extern void plnamesuffix(void); +extern const char *Hello(struct monst *); +extern const char *Goodbye(void); +extern char *build_plselection_prompt(char *, int, int, int, int, int); +extern char *root_plselection_prompt(char *, int, int, int, int, int); +extern void violated(int); +extern boolean successful_cdt(int); +extern boolean intended_cdt(int); +extern boolean superfluous_cdt(int); +extern boolean failed_cdt(int); /* ### rumors.c ### */ -E char *getrumor(int, char *, boolean); -E void outrumor(int, int); -E void outoracle(boolean, boolean); -E void save_oracles(int, int); -E void restore_oracles(int); -E int doconsult(struct monst *); +extern char *getrumor(int, char *, boolean); +extern void outrumor(int, int); +extern void outoracle(boolean, boolean); +extern void save_oracles(int, int); +extern void restore_oracles(int); +extern int doconsult(struct monst *); /* ### save.c ### */ -E int dosave(void); +extern int dosave(void); #if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32) -E void hangup(int); +extern void hangup(int); #endif -E int dosave0(void); +extern int dosave0(void); #ifdef INSURANCE -E void savestateinlock(void); +extern void savestateinlock(void); #endif #ifdef MFLOPPY -E boolean savelev(int, xchar, int); -E boolean swapin_file(int); -E void co_false(void); +extern boolean savelev(int, xint8, int); +extern boolean swapin_file(int); +extern void co_false(void); #else -E void savelev(int, xchar, int); -#endif -E void bufon(int); -E void bufoff(int); -E void bflush(int); -E void bwrite(int, genericptr_t, unsigned int); -E void bclose(int); -E void savecemetery(int, int, struct cemetery **); -E void savefruitchn(int, int); -E void free_dungeons(void); -E void freedynamicdata(void); +extern void savelev(int, xint8, int); +#endif +extern void bufon(int); +extern void bufoff(int); +extern void bflush(int); +extern void bwrite(int, genericptr_t, unsigned int); +extern void bclose(int); +extern void savecemetery(int, int, struct cemetery **); +extern void savefruitchn(int, int); +extern void free_dungeons(void); +extern void freedynamicdata(void); /* ### shk.c ### */ -E void neweshk(struct monst *); -E void free_eshk(struct monst *); -E long money2mon(struct monst *, long); -E void money2u(struct monst *, long); -E char *Shknam(struct monst *); -E char *shkname(struct monst *); -E void shkgone(struct monst *); -E void set_residency(struct monst *, boolean); -E void replshk(struct monst *, struct monst *); -E void restshk(struct monst *, boolean); -E char inside_shop(xchar, xchar); -E void u_left_shop(char *, boolean); -E void remote_burglary(xchar, xchar); -E void u_entered_shop(char *); -E void pick_pick(struct obj *); -E boolean same_price(struct obj *, struct obj *); -E void shopper_financial_report(void); -E int inhishop(struct monst *); -E struct monst *shop_keeper(char); -E boolean tended_shop(struct mkroom *); -E boolean is_unpaid(struct obj *); -E void delete_contents(struct obj *); -E void obfree(struct obj *, struct obj *); -E void home_shk(struct monst *, boolean); -E void make_happy_shk(struct monst *, boolean); -E void make_happy_shoppers(boolean); -E void hot_pursuit(struct monst *); -E void make_angry_shk(struct monst *, xchar, xchar); -E int dopay(void); -E boolean paybill(int, boolean); -E void finish_paybill(void); -E struct obj *find_oid(unsigned); -E long contained_cost(struct obj *, struct monst *, long, boolean, boolean); -E long contained_gold(struct obj *); -E void picked_container(struct obj *); -E void alter_cost(struct obj *, long); -E long unpaid_cost(struct obj *, boolean); -E boolean billable(struct monst **, struct obj *, char, boolean); -E void addtobill(struct obj *, boolean, boolean, boolean); -E void append_honorific(char *); -E void splitbill(struct obj *, struct obj *); -E void subfrombill(struct obj *, struct monst *); -E long stolen_value(struct obj *, xchar, xchar, boolean, boolean); -E void sellobj_state(int); -E void sellobj(struct obj *, xchar, xchar); -E int doinvbill(int); -E struct monst *shkcatch(struct obj *, xchar, xchar); -E void add_damage(xchar, xchar, long); -E int repair_damage(struct monst *, struct damage *, boolean); -E int shk_move(struct monst *); -E void after_shk_move(struct monst *); -E boolean is_fshk(struct monst *); -E void shopdig(int); -E void pay_for_damage(const char *, boolean); -E boolean costly_spot(xchar, xchar); -E struct obj *shop_object(xchar, xchar); -E void price_quote(struct obj *); -E void shk_chat(struct monst *); -E void check_unpaid_usage(struct obj *, boolean); -E void check_unpaid(struct obj *); -E void costly_gold(xchar, xchar, long); -E long get_cost_of_shop_item(struct obj *); -E int oid_price_adjustment(struct obj *, unsigned); -E boolean block_door(xchar, xchar); -E boolean block_entry(xchar, xchar); +extern void neweshk(struct monst *); +extern void free_eshk(struct monst *); +extern long money2mon(struct monst *, long); +extern void money2u(struct monst *, long); +extern char *Shknam(struct monst *); +extern char *shkname(struct monst *); +extern void shkgone(struct monst *); +extern void set_residency(struct monst *, boolean); +extern void replshk(struct monst *, struct monst *); +extern void restshk(struct monst *, boolean); +extern char inside_shop(coordxy, coordxy); +extern void u_left_shop(char *, boolean); +extern void remote_burglary(coordxy, coordxy); +extern void u_entered_shop(char *); +extern void pick_pick(struct obj *); +extern boolean same_price(struct obj *, struct obj *); +extern void shopper_financial_report(void); +extern int inhishop(struct monst *); +extern struct monst *shop_keeper(char); +extern boolean tended_shop(struct mkroom *); +extern boolean is_unpaid(struct obj *); +extern void delete_contents(struct obj *); +extern void obfree(struct obj *, struct obj *); +extern void home_shk(struct monst *, boolean); +extern void make_happy_shk(struct monst *, boolean); +extern void make_happy_shoppers(boolean); +extern void hot_pursuit(struct monst *); +extern void make_angry_shk(struct monst *, coordxy, coordxy); +extern int dopay(void); +extern boolean paybill(int, boolean); +extern void finish_paybill(void); +extern struct obj *find_oid(unsigned); +extern long contained_cost(struct obj *, struct monst *, long, boolean, boolean); +extern long contained_gold(struct obj *); +extern void picked_container(struct obj *); +extern void alter_cost(struct obj *, long); +extern long unpaid_cost(struct obj *, boolean); +extern boolean billable(struct monst **, struct obj *, char, boolean); +extern void addtobill(struct obj *, boolean, boolean, boolean); +extern void append_honorific(char *); +extern void splitbill(struct obj *, struct obj *); +extern void subfrombill(struct obj *, struct monst *); +extern long stolen_value(struct obj *, coordxy, coordxy, boolean, boolean); +extern void sellobj_state(int); +extern void sellobj(struct obj *, coordxy, coordxy); +extern int doinvbill(int); +extern struct monst *shkcatch(struct obj *, coordxy, coordxy); +extern void add_damage(coordxy, coordxy, long); +extern int repair_damage(struct monst *, struct damage *, boolean); +extern int shk_move(struct monst *); +extern void after_shk_move(struct monst *); +extern boolean is_fshk(struct monst *); +extern void shopdig(int); +extern void pay_for_damage(const char *, boolean); +extern boolean costly_spot(coordxy, coordxy); +extern struct obj *shop_object(coordxy, coordxy); +extern void price_quote(struct obj *); +extern void shk_chat(struct monst *); +extern void check_unpaid_usage(struct obj *, boolean); +extern void check_unpaid(struct obj *); +extern void costly_gold(coordxy, coordxy, long); +extern long get_cost_of_shop_item(struct obj *); +extern int oid_price_adjustment(struct obj *, unsigned); +extern boolean block_door(coordxy, coordxy); +extern boolean block_entry(coordxy, coordxy); #ifdef BLACKMARKET -E void blkmar_guards(struct monst *); -E void set_black_marketeer_angry(void); -E void bars_around_portal(boolean); +extern void blkmar_guards(struct monst *); +extern void set_black_marketeer_angry(void); +extern void bars_around_portal(boolean); #endif /* BLACKMARKET */ -E char *shk_your(char *, struct obj *); -E char *Shk_Your(char *, struct obj *); +extern char *shk_your(char *, struct obj *); +extern char *Shk_Your(char *, struct obj *); extern void sanity_check_shopkeepers(void); /* ### shknam.c ### */ -E void stock_room(int, struct mkroom *); -E boolean saleable(struct monst *, struct obj *); -E int get_shop_item(int); -E void shop_selection_init(void); -E boolean is_izchak(struct monst *, boolean); +extern void stock_room(int, struct mkroom *); +extern boolean saleable(struct monst *, struct obj *); +extern int get_shop_item(int); +extern void shop_selection_init(void); +extern boolean is_izchak(struct monst *, boolean); /* ### sit.c ### */ -E void take_gold(void); -E int dosit(void); -E void rndcurse(void); -E void attrcurse(void); +extern void take_gold(void); +extern int dosit(void); +extern void rndcurse(void); +extern void attrcurse(void); /* ### sounds.c ### */ -E void dosounds(void); -E const char *growl_sound(struct monst *); -E void growl(struct monst *); -E void yelp(struct monst *); -E void whimper(struct monst *); -E void beg(struct monst *); -E int dotalk(void); +extern void dosounds(void); +extern const char *growl_sound(struct monst *); +extern void growl(struct monst *); +extern void yelp(struct monst *); +extern void whimper(struct monst *); +extern void beg(struct monst *); +extern int dotalk(void); #ifdef USER_SOUNDS -E int add_sound_mapping(const char *); -E void play_sound_for_message(const char *); +extern int add_sound_mapping(const char *); +extern void play_sound_for_message(const char *); #endif /* ### sys/msdos/sound.c ### */ #ifdef MSDOS -E int assign_soundcard(char *); +extern int assign_soundcard(char *); #endif /* ### sp_lev.c ### */ -E boolean check_room(xchar *, xchar *, xchar *, xchar *, boolean); -E boolean create_room(xchar, xchar, xchar, xchar, - xchar, xchar, xchar, xchar); -E void create_secret_door(struct mkroom *, xchar); -E boolean dig_corridor(coord *, coord *, boolean, schar, schar); -E void fill_room(struct mkroom *, boolean); -E boolean load_special(const char *); -E xchar selection_getpoint(int, int, struct opvar *); -E struct opvar *selection_opvar(char *); -E void opvar_free_x(struct opvar *); -E void set_selection_floodfillchk(int(*)(int,int)); -E void selection_floodfill(struct opvar *, int, int, boolean); +extern boolean check_room(coordxy *, coordxy *, coordxy *, coordxy *, boolean); +extern boolean create_room(coordxy, coordxy, coordxy, coordxy, + coordxy, coordxy, xint16, xint16); +extern void create_secret_door(struct mkroom *, coordxy); +extern boolean dig_corridor(coord *, coord *, boolean, schar, schar); +extern void fill_room(struct mkroom *, boolean); +extern boolean load_special(const char *); +extern coordxy selection_getpoint(coordxy, coordxy, struct opvar *); +extern struct opvar *selection_opvar(char *); +extern void opvar_free_x(struct opvar *); +extern void set_selection_floodfillchk(int(*)(coordxy, coordxy)); +extern void selection_floodfill(struct opvar *, coordxy, coordxy, boolean); /* ### spell.c ### */ -E void book_cursed(struct obj *); +extern void book_cursed(struct obj *); #ifdef USE_TRAMPOLI -E int learn(void); -#endif -E int study_book(struct obj *); -E void book_disappears(struct obj *); -E void book_substitution(struct obj *, struct obj *); -E void age_spells(void); -E int docast(void); -E int spell_skilltype(int); -E int spelleffects(int, boolean); -E int tport_spell(int); -E void losespells(void); -E int dovspell(void); -E void initialspell(struct obj *); -E void dump_spells(void); -E boolean parse_spellorder(char *); +extern int learn(void); +#endif +extern int study_book(struct obj *); +extern void book_disappears(struct obj *); +extern void book_substitution(struct obj *, struct obj *); +extern void age_spells(void); +extern int docast(void); +extern int spell_skilltype(int); +extern int spelleffects(int, boolean); +extern int tport_spell(int); +extern void losespells(void); +extern int dovspell(void); +extern void initialspell(struct obj *); +extern void dump_spells(void); +extern boolean parse_spellorder(char *); extern const char* spelltypemnemonic(int); extern int num_spells(void); /* ### steal.c ### */ #ifdef USE_TRAMPOLI -E int stealarm(void); -#endif -E long somegold(long); -E void stealgold(struct monst *); -E void remove_worn_item(struct obj *, boolean); -E int steal(struct monst *, char *); -E int mpickobj(struct monst *, struct obj *); -E void stealamulet(struct monst *); -E void maybe_absorb_item(struct monst *, struct obj *, int, int); -E void mdrop_obj(struct monst *, struct obj *, boolean); -E void mdrop_special_objs(struct monst *); -E void relobj(struct monst *, int, boolean); -E struct obj *findgold(struct obj *); +extern int stealarm(void); +#endif +extern long somegold(long); +extern void stealgold(struct monst *); +extern void remove_worn_item(struct obj *, boolean); +extern int steal(struct monst *, char *); +extern int mpickobj(struct monst *, struct obj *); +extern void stealamulet(struct monst *); +extern void maybe_absorb_item(struct monst *, struct obj *, int, int); +extern void mdrop_obj(struct monst *, struct obj *, boolean); +extern void mdrop_special_objs(struct monst *); +extern void relobj(struct monst *, int, boolean); +extern struct obj *findgold(struct obj *); /* ### steed.c ### */ -E void rider_cant_reach(void); -E boolean can_saddle(struct monst *); -E int use_saddle(struct obj *); -E void put_saddle_on_mon(struct obj *, struct monst *); -E boolean can_ride(struct monst *); -E int doride(void); -E boolean mount_steed(struct monst *, boolean); -E void exercise_steed(void); -E void kick_steed(void); -E void dismount_steed(int); -E void place_monster(struct monst *, int, int); -E boolean stucksteed(boolean); +extern void rider_cant_reach(void); +extern boolean can_saddle(struct monst *); +extern int use_saddle(struct obj *); +extern void put_saddle_on_mon(struct obj *, struct monst *); +extern boolean can_ride(struct monst *); +extern int doride(void); +extern boolean mount_steed(struct monst *, boolean); +extern void exercise_steed(void); +extern void kick_steed(void); +extern void dismount_steed(int); +extern void place_monster(struct monst *, coordxy, coordxy); +extern boolean stucksteed(boolean); /* ### sys.c ### */ @@ -2497,171 +2497,171 @@ extern void sys_early_init(void); /* ### teleport.c ### */ -E boolean goodpos(int, int, struct monst *, unsigned); -E boolean enexto(coord *, xchar, xchar, struct permonst *); -E boolean enexto_core(coord *, xchar, xchar, struct permonst *, unsigned); -E boolean enexto_core_range(coord *, xchar, xchar, struct permonst *, unsigned, int); -E int epathto(coord *, int, xchar, xchar, struct permonst *); -E void teleds(int, int, boolean); -E boolean safe_teleds(boolean); -E boolean teleport_pet(struct monst *, boolean); -E int dotelecmd(void); -E void tele(void); -E int dotele(boolean); -E void level_tele(void); -E void domagicportal(struct trap *); -E void tele_trap(struct trap *); -E void level_tele_trap(struct trap *, unsigned); -E void rloc_to(struct monst *, int, int); -E boolean rloc(struct monst *, boolean); -E boolean tele_restrict(struct monst *); -E void mtele_trap(struct monst *, struct trap *, int); -E int mlevel_tele_trap(struct monst *, struct trap *, boolean, int); -E boolean rloco(struct obj *); -E int random_teleport_level(void); -E boolean u_teleport_mon(struct monst *, boolean); +extern boolean goodpos(coordxy, coordxy, struct monst *, unsigned); +extern boolean enexto(coord *, coordxy, coordxy, struct permonst *); +extern boolean enexto_core(coord *, coordxy, coordxy, struct permonst *, unsigned); +extern boolean enexto_core_range(coord *, coordxy, coordxy, struct permonst *, unsigned, int); +extern int epathto(coord *, int, coordxy, coordxy, struct permonst *); +extern void teleds(coordxy, coordxy, boolean); +extern boolean safe_teleds(boolean); +extern boolean teleport_pet(struct monst *, boolean); +extern int dotelecmd(void); +extern void tele(void); +extern int dotele(boolean); +extern void level_tele(void); +extern void domagicportal(struct trap *); +extern void tele_trap(struct trap *); +extern void level_tele_trap(struct trap *, unsigned); +extern void rloc_to(struct monst *, coordxy, coordxy); +extern boolean rloc(struct monst *, boolean); +extern boolean tele_restrict(struct monst *); +extern void mtele_trap(struct monst *, struct trap *, int); +extern int mlevel_tele_trap(struct monst *, struct trap *, boolean, int); +extern boolean rloco(struct obj *); +extern int random_teleport_level(void); +extern boolean u_teleport_mon(struct monst *, boolean); /* ### termcap.c ### */ -E void term_start_color(int); -E void term_end_color(void); -E void term_start_attr(int); -E void term_end_attr(int); +extern void term_start_color(int); +extern void term_end_color(void); +extern void term_start_attr(int); +extern void term_end_attr(int); /* ### tile.c ### */ #ifdef USE_TILES -E void substitute_tiles(d_level *); +extern void substitute_tiles(d_level *); #endif /* ### timeout.c ### */ -E void burn_away_slime(void); -E void nh_timeout(void); -E void fall_asleep(int, boolean); -E void attach_egg_hatch_timeout(struct obj *, long); -E void attach_fig_transform_timeout(struct obj *); -E void kill_egg(struct obj *); -E void hatch_egg(ANY_P *, long); -E void learn_egg_type(int); -E void burn_object(ANY_P *, long); -E void begin_burn(struct obj *, boolean); -E void end_burn(struct obj *, boolean); -E void do_storms(void); -E boolean start_timer(long, short, short, ANY_P *); -E long stop_timer(short, ANY_P *); -E long peek_timer(short, ANY_P *); -E void run_timers(void); -E void obj_move_timers(struct obj *, struct obj *); -E void obj_split_timers(struct obj *, struct obj *); -E void obj_stop_timers(struct obj *); -E boolean obj_has_timer(struct obj *, short); -E void spot_stop_timers(xchar, xchar, short); -E long spot_time_expires(xchar, xchar, short); -E long spot_time_left(xchar, xchar, short); -E boolean obj_is_local(struct obj *); -E void save_timers(int, int, int); -E void restore_timers(int, int, boolean, long); -E void timer_stats(const char *, char *, long *, long *); -E void relink_timers(boolean); +extern void burn_away_slime(void); +extern void nh_timeout(void); +extern void fall_asleep(int, boolean); +extern void attach_egg_hatch_timeout(struct obj *, long); +extern void attach_fig_transform_timeout(struct obj *); +extern void kill_egg(struct obj *); +extern void hatch_egg(ANY_P *, long); +extern void learn_egg_type(int); +extern void burn_object(ANY_P *, long); +extern void begin_burn(struct obj *, boolean); +extern void end_burn(struct obj *, boolean); +extern void do_storms(void); +extern boolean start_timer(long, short, short, ANY_P *); +extern long stop_timer(short, ANY_P *); +extern long peek_timer(short, ANY_P *); +extern void run_timers(void); +extern void obj_move_timers(struct obj *, struct obj *); +extern void obj_split_timers(struct obj *, struct obj *); +extern void obj_stop_timers(struct obj *); +extern boolean obj_has_timer(struct obj *, short); +extern void spot_stop_timers(coordxy, coordxy, short); +extern long spot_time_expires(coordxy, coordxy, short); +extern long spot_time_left(coordxy, coordxy, short); +extern boolean obj_is_local(struct obj *); +extern void save_timers(int, int, int); +extern void restore_timers(int, int, boolean, long); +extern void timer_stats(const char *, char *, long *, long *); +extern void relink_timers(boolean); #ifdef WIZARD -E int wiz_timeout_queue(void); -E void timer_sanity_check(void); +extern int wiz_timeout_queue(void); +extern void timer_sanity_check(void); #endif /* ### topten.c ### */ #ifdef RECORD_CONDUCT -E long encodeconduct(void); +extern long encodeconduct(void); #endif -E void topten(int); -E void prscore(int, char **); -E struct obj *tt_oname(struct obj *); +extern void topten(int); +extern void prscore(int, char **); +extern struct obj *tt_oname(struct obj *); /* ### track.c ### */ -E void initrack(void); -E void settrack(void); -E coord *gettrack(int, int); +extern void initrack(void); +extern void settrack(void); +extern coord *gettrack(coordxy, coordxy); /* ### trap.c ### */ -E boolean burnarmor(struct monst *); -E int erode_obj(struct obj *, const char *, int, int); -E boolean grease_protect(struct obj *, const char *, struct monst *); -E struct trap *maketrap(int, int, int); -E void fall_through(boolean, unsigned); -E struct monst *animate_statue(struct obj *, xchar, xchar, int, int *); -E struct monst *activate_statue_trap(struct trap *, xchar, xchar, boolean); -E void set_utrap(unsigned, unsigned); -E void reset_utrap(boolean); -E void dotrap(struct trap *, unsigned); -E void seetrap(struct trap *); -E void feeltrap(struct trap *); +extern boolean burnarmor(struct monst *); +extern int erode_obj(struct obj *, const char *, int, int); +extern boolean grease_protect(struct obj *, const char *, struct monst *); +extern struct trap *maketrap(coordxy, coordxy, int); +extern void fall_through(boolean, unsigned); +extern struct monst *animate_statue(struct obj *, coordxy, coordxy, int, int *); +extern struct monst *activate_statue_trap(struct trap *, coordxy, coordxy, boolean); +extern void set_utrap(unsigned, unsigned); +extern void reset_utrap(boolean); +extern void dotrap(struct trap *, unsigned); +extern void seetrap(struct trap *); +extern void feeltrap(struct trap *); extern int mintrap(struct monst *, unsigned); -E void instapetrify(const char *); -E void minstapetrify(struct monst *, boolean); +extern void instapetrify(const char *); +extern void minstapetrify(struct monst *, boolean); #ifdef WEBB_DISINT -E int instadisintegrate(const char *); -E int minstadisintegrate(struct monst *); -#endif -E void selftouch(const char *); -E void mselftouch(struct monst *, const char *, boolean); -E void float_up(void); -E void fill_pit(int, int); -E int float_down(long, long); -E void climb_pit(void); -E boolean fire_damage(struct obj *, boolean, xchar, xchar); -E int fire_damage_chain(struct obj *, boolean, boolean, xchar, xchar); -E boolean lava_damage(struct obj *, xchar, xchar); -E void acid_damage(struct obj *); -E int water_damage(struct obj *, const char *, boolean); -E void water_damage_chain(struct obj *, boolean); -E boolean drown(void); -E void drain_en(int); -E int dountrap(void); -E void cnv_trap_obj(int, int, struct trap *, boolean); -E int untrap(boolean); -E boolean openholdingtrap(struct monst *, boolean *); -E boolean closeholdingtrap(struct monst *, boolean *); -E boolean openfallingtrap(struct monst *, boolean, boolean *); -E boolean chest_trap(struct obj *, int, boolean); -E void deltrap(struct trap *); -E boolean delfloortrap(struct trap *); -E struct trap *t_at(int, int); -E void b_trapped(const char *, int); -E boolean unconscious(void); -E boolean uteetering_at_seen_pit(struct trap *); -E boolean uescaped_shaft(struct trap *); -E boolean lava_effects(void); -E boolean swamp_effects(void); -E void blow_up_landmine(struct trap *); -E int launch_obj(short, int, int, int, int, int); +extern int instadisintegrate(const char *); +extern int minstadisintegrate(struct monst *); +#endif +extern void selftouch(const char *); +extern void mselftouch(struct monst *, const char *, boolean); +extern void float_up(void); +extern void fill_pit(coordxy, coordxy); +extern int float_down(long, long); +extern void climb_pit(void); +extern boolean fire_damage(struct obj *, boolean, coordxy, coordxy); +extern int fire_damage_chain(struct obj *, boolean, boolean, coordxy, coordxy); +extern boolean lava_damage(struct obj *, coordxy, coordxy); +extern void acid_damage(struct obj *); +extern int water_damage(struct obj *, const char *, boolean); +extern void water_damage_chain(struct obj *, boolean); +extern boolean drown(void); +extern void drain_en(int); +extern int dountrap(void); +extern void cnv_trap_obj(int, int, struct trap *, boolean); +extern int untrap(boolean); +extern boolean openholdingtrap(struct monst *, boolean *); +extern boolean closeholdingtrap(struct monst *, boolean *); +extern boolean openfallingtrap(struct monst *, boolean, boolean *); +extern boolean chest_trap(struct obj *, int, boolean); +extern void deltrap(struct trap *); +extern boolean delfloortrap(struct trap *); +extern struct trap *t_at(coordxy, coordxy); +extern void b_trapped(const char *, int); +extern boolean unconscious(void); +extern boolean uteetering_at_seen_pit(struct trap *); +extern boolean uescaped_shaft(struct trap *); +extern boolean lava_effects(void); +extern boolean swamp_effects(void); +extern void blow_up_landmine(struct trap *); +extern int launch_obj(short, coordxy, coordxy, coordxy, coordxy, int); /* ### u_init.c ### */ -E void u_init(void); +extern void u_init(void); /* ### uhitm.c ### */ -E void hurtmarmor(struct monst *, int); -E boolean attack_checks(struct monst *, struct obj *); -E void check_caitiff(struct monst *); -E int find_roll_to_hit(struct monst *, uchar, struct obj *, int *, int *); -E boolean attack(struct monst *); -E boolean hmon(struct monst *, struct obj *, int, int); -E boolean shade_miss(struct monst *, struct monst *, struct obj *, boolean, boolean); -E int damageum(struct monst *, struct attack *, int); -E void missum(struct monst *, struct attack *, boolean); -E int passive(struct monst *, struct obj *, boolean, int, uchar, boolean); -E void passive_obj(struct monst *, struct obj *, struct attack *); -E void stumble_onto_mimic(struct monst *); -E int flash_hits_mon(struct monst *, struct obj *); -E void light_hits_gremlin(struct monst *, int); +extern void hurtmarmor(struct monst *, int); +extern boolean attack_checks(struct monst *, struct obj *); +extern void check_caitiff(struct monst *); +extern int find_roll_to_hit(struct monst *, uchar, struct obj *, int *, int *); +extern boolean attack(struct monst *); +extern boolean hmon(struct monst *, struct obj *, int, int); +extern boolean shade_miss(struct monst *, struct monst *, struct obj *, boolean, boolean); +extern int damageum(struct monst *, struct attack *, int); +extern void missum(struct monst *, struct attack *, boolean); +extern int passive(struct monst *, struct obj *, boolean, int, uchar, boolean); +extern void passive_obj(struct monst *, struct obj *, struct attack *); +extern void stumble_onto_mimic(struct monst *); +extern int flash_hits_mon(struct monst *, struct obj *); +extern void light_hits_gremlin(struct monst *, int); /* ### unixmain.c ### */ #ifdef UNIX # ifdef PORT_HELP -E void port_help(void); +extern void port_help(void); # endif #endif /* UNIX */ @@ -2669,39 +2669,39 @@ E void port_help(void); /* ### unixtty.c ### */ #if defined(UNIX) || defined(__BEOS__) -E void gettty(void); -E void settty(const char *); -E void setftty(void); -E void intron(void); -E void introff(void); -E void VDECL(error, (const char *, ...)) PRINTF_F(1, 2); +extern void gettty(void); +extern void settty(const char *); +extern void setftty(void); +extern void intron(void); +extern void introff(void); +extern void VDECL(error, (const char *, ...)) PRINTF_F(1, 2); #endif /* UNIX || __BEOS__ */ /* ### unixunix.c ### */ #ifdef UNIX -E void getlock(void); -E void regularize(char *); +extern void getlock(void); +extern void regularize(char *); # if defined(TIMED_DELAY) && !defined(msleep) && defined(SYSV) -E void msleep(unsigned); +extern void msleep(unsigned); # endif # ifdef SHELL -E int dosh(void); +extern int dosh(void); # endif /* SHELL */ # if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER) -E int child(int); +extern int child(int); # endif #ifdef FILE_AREAS -E char *make_file_name(const char *, const char *); -E FILE *fopen_datafile_area(const char *, const char *, const char *, boolean); -E FILE *freopen_area(const char *, const char *, const char *, FILE *); -E int chmod_area(const char *, const char *, int); -E int open_area(const char *, const char *, int, int); -E int creat_area(const char *, const char *, int); -E boolean lock_file_area(const char *, const char *, int); -E void unlock_file_area(const char *, const char *); -E int rename_area(const char *, const char *, const char *); -E int remove_area(const char *, const char *); +extern char *make_file_name(const char *, const char *); +extern FILE *fopen_datafile_area(const char *, const char *, const char *, boolean); +extern FILE *freopen_area(const char *, const char *, const char *, FILE *); +extern int chmod_area(const char *, const char *, int); +extern int open_area(const char *, const char *, int, int); +extern int creat_area(const char *, const char *, int); +extern boolean lock_file_area(const char *, const char *, int); +extern void unlock_file_area(const char *, const char *); +extern int rename_area(const char *, const char *, const char *); +extern int remove_area(const char *, const char *); #endif #endif /* UNIX */ @@ -2709,376 +2709,376 @@ E int remove_area(const char *, const char *); #ifdef UNIX # ifdef GNOME_GRAPHICS -E int hide_privileges(boolean); +extern int hide_privileges(boolean); # endif #endif /* UNIX */ /* ### vault.c ### */ -E void newegd(struct monst *); -E void free_egd(struct monst *); -E boolean grddead(struct monst *); -E struct monst *findgd(void); -E void vault_summon_gd(void); -E char vault_occupied(char *); -E void uleftvault(struct monst *); -E void invault(void); -E int gd_move(struct monst *); -E void paygd(boolean); -E long hidden_gold(void); -E boolean gd_sound(void); -E void vault_gd_watching(unsigned int); +extern void newegd(struct monst *); +extern void free_egd(struct monst *); +extern boolean grddead(struct monst *); +extern struct monst *findgd(void); +extern void vault_summon_gd(void); +extern char vault_occupied(char *); +extern void uleftvault(struct monst *); +extern void invault(void); +extern int gd_move(struct monst *); +extern void paygd(boolean); +extern long hidden_gold(void); +extern boolean gd_sound(void); +extern void vault_gd_watching(unsigned int); /* ### version.c ### */ -E char *version_string(char *); -E char *getversionstring(char *); -E int doversion(void); -E int doextversion(void); +extern char *version_string(char *); +extern char *getversionstring(char *); +extern int doversion(void); +extern int doextversion(void); #ifdef MICRO -E boolean comp_times(long); +extern boolean comp_times(long); #endif -E boolean check_version(struct version_info *, const char *, boolean); -E unsigned long get_feature_notice_ver(char *); -E unsigned long get_current_feature_ver(void); +extern boolean check_version(struct version_info *, const char *, boolean); +extern unsigned long get_feature_notice_ver(char *); +extern unsigned long get_current_feature_ver(void); #ifdef RUNTIME_PORT_ID -E void append_port_id(char *); +extern void append_port_id(char *); #endif /* ### video.c ### */ #ifdef MSDOS -E int assign_video(char *); +extern int assign_video(char *); # ifdef NO_TERMS -E void gr_init(void); -E void gr_finish(void); +extern void gr_init(void); +extern void gr_finish(void); # endif -E void tileview(boolean); +extern void tileview(boolean); #endif #ifdef VIDEOSHADES -E int assign_videoshades(char *); -E int assign_videocolors(char *); +extern int assign_videoshades(char *); +extern int assign_videocolors(char *); #endif /* ### vis_tab.c ### */ #ifdef VISION_TABLES -E void vis_tab_init(void); +extern void vis_tab_init(void); #endif /* ### vision.c ### */ -E void vision_init(void); -E int does_block(int, int, struct rm*); -E void vision_reset(void); -E void vision_recalc(int); -E void block_point(int, int); -E void unblock_point(int, int); -E boolean clear_path(int, int, int, int); -E void do_clear_area(int, int, int, void (*)(int, int, genericptr_t), genericptr_t); -E unsigned how_mon_is_seen(struct monst *); +extern void vision_init(void); +extern int does_block(coordxy, coordxy, struct rm*); +extern void vision_reset(void); +extern void vision_recalc(int); +extern void block_point(coordxy, coordxy); +extern void unblock_point(coordxy, coordxy); +extern boolean clear_path(int, int, int, int); +extern void do_clear_area(coordxy, coordxy, int, void (*)(coordxy, coordxy, genericptr_t), genericptr_t); +extern unsigned how_mon_is_seen(struct monst *); #ifdef VMS /* ### vmsfiles.c ### */ -E int vms_link(const char *, const char *); -E int vms_unlink(const char *); -E int vms_creat(const char *, unsigned int); -E int vms_open(const char *, int, unsigned int); -E boolean same_dir(const char *, const char *); -E int c__translate(int); -E char *vms_basename(const char *); +extern int vms_link(const char *, const char *); +extern int vms_unlink(const char *); +extern int vms_creat(const char *, unsigned int); +extern int vms_open(const char *, int, unsigned int); +extern boolean same_dir(const char *, const char *); +extern int c__translate(int); +extern char *vms_basename(const char *); /* ### vmsmail.c ### */ -E unsigned long init_broadcast_trapping(void); -E unsigned long enable_broadcast_trapping(void); -E unsigned long disable_broadcast_trapping(void); +extern unsigned long init_broadcast_trapping(void); +extern unsigned long enable_broadcast_trapping(void); +extern unsigned long disable_broadcast_trapping(void); # if 0 -E struct mail_info *parse_next_broadcast(void); +extern struct mail_info *parse_next_broadcast(void); # endif /*0*/ /* ### vmsmain.c ### */ -E int main(int, char **); +extern int main(int, char **); # ifdef CHDIR -E void chdirx(const char *, boolean); +extern void chdirx(const char *, boolean); # endif /* CHDIR */ /* ### vmsmisc.c ### */ -E void vms_abort(void); -E void vms_exit(int); +extern void vms_abort(void); +extern void vms_exit(int); /* ### vmstty.c ### */ -E int vms_getchar(void); -E void gettty(void); -E void settty(const char *); -E void shuttty(const char *); -E void setftty(void); -E void intron(void); -E void introff(void); -E void VDECL(error, (const char *, ...)) PRINTF_F(1, 2); +extern int vms_getchar(void); +extern void gettty(void); +extern void settty(const char *); +extern void shuttty(const char *); +extern void setftty(void); +extern void intron(void); +extern void introff(void); +extern void VDECL(error, (const char *, ...)) PRINTF_F(1, 2); #ifdef TIMED_DELAY -E void msleep(unsigned); +extern void msleep(unsigned); #endif /* ### vmsunix.c ### */ -E void getlock(void); -E void regularize(char *); -E int vms_getuid(void); -E boolean file_is_stmlf(int); -E int vms_define(const char *, const char *, int); -E int vms_putenv(const char *); -E char *verify_termcap(void); +extern void getlock(void); +extern void regularize(char *); +extern int vms_getuid(void); +extern boolean file_is_stmlf(int); +extern int vms_define(const char *, const char *, int); +extern int vms_putenv(const char *); +extern char *verify_termcap(void); # if defined(CHDIR) || defined(SHELL) || defined(SECURE) -E void privoff(void); -E void privon(void); +extern void privoff(void); +extern void privon(void); # endif # ifdef SHELL -E int dosh(void); +extern int dosh(void); # endif # if defined(SHELL) || defined(MAIL) -E int vms_doshell(const char *, boolean); +extern int vms_doshell(const char *, boolean); # endif # ifdef SUSPEND -E int dosuspend(void); +extern int dosuspend(void); # endif #endif /* VMS */ /* ### weapon.c ### */ -E const char *weapon_descr(struct obj *); -E int hitval(struct obj *, struct monst *); -E int dmgval(struct obj *, struct monst *); -E int special_dmgval(struct monst *, struct monst *, long, long *); +extern const char *weapon_descr(struct obj *); +extern int hitval(struct obj *, struct monst *); +extern int dmgval(struct obj *, struct monst *); +extern int special_dmgval(struct monst *, struct monst *, long, long *); extern struct damage_info_t dmgval_info(struct obj*); -E void silver_sears(struct monst *, struct monst *, long); -E struct obj *select_rwep(struct monst *); -E boolean mon_might_throw_wep(struct obj *); -E struct obj *select_hwep(struct monst *); -E void possibly_unwield(struct monst *, boolean); -E int mon_wield_item(struct monst *); -E void mwepgone(struct monst *); -E int abon(void); -E int dbon(void); -E void wet_a_towel(struct obj *, int, boolean); -E void dry_a_towel(struct obj *, int, boolean); +extern void silver_sears(struct monst *, struct monst *, long); +extern struct obj *select_rwep(struct monst *); +extern boolean mon_might_throw_wep(struct obj *); +extern struct obj *select_hwep(struct monst *); +extern void possibly_unwield(struct monst *, boolean); +extern int mon_wield_item(struct monst *); +extern void mwepgone(struct monst *); +extern int abon(void); +extern int dbon(void); +extern void wet_a_towel(struct obj *, int, boolean); +extern void dry_a_towel(struct obj *, int, boolean); extern const char* skill_name(int); -E int enhance_weapon_skill(void); +extern int enhance_weapon_skill(void); #ifdef DUMP_LOG -E void dump_weapon_skill(void); -#endif -E void unrestrict_weapon_skill(int); -E void use_skill(int, int); -E void add_weapon_skill(int); -E void lose_weapon_skill(int); -E int weapon_type(struct obj *); -E int uwep_skill_type(void); -E int weapon_hit_bonus(struct obj *); -E int weapon_dam_bonus(struct obj *); -E void skill_init(const struct def_skill *); -E boolean can_advance_something(void); +extern void dump_weapon_skill(void); +#endif +extern void unrestrict_weapon_skill(int); +extern void use_skill(int, int); +extern void add_weapon_skill(int); +extern void lose_weapon_skill(int); +extern int weapon_type(struct obj *); +extern int uwep_skill_type(void); +extern int weapon_hit_bonus(struct obj *); +extern int weapon_dam_bonus(struct obj *); +extern void skill_init(const struct def_skill *); +extern boolean can_advance_something(void); /* ### were.c ### */ -E void were_change(struct monst *); -E int counter_were(int); -E int were_beastie(int); -E void new_were(struct monst *); -E int were_summon(struct permonst *, boolean, int *, char *); -E void you_were(void); -E void you_unwere(boolean); -E void set_ulycn(int); +extern void were_change(struct monst *); +extern int counter_were(int); +extern int were_beastie(int); +extern void new_were(struct monst *); +extern int were_summon(struct permonst *, boolean, int *, char *); +extern void you_were(void); +extern void you_unwere(boolean); +extern void set_ulycn(int); /* ### wield.c ### */ -E void setuwep(struct obj *); -E void setuqwep(struct obj *); -E void setuswapwep(struct obj *); -E int dowield(void); -E int doswapweapon(void); -E int dowieldquiver(void); -E int dounwield(void); -E boolean wield_tool(struct obj *, const char *); -E int can_twoweapon(void); -E void drop_uswapwep(void); -E int dotwoweapon(void); -E void uwepgone(void); -E void uswapwepgone(void); -E void uqwepgone(void); -E void untwoweapon(void); -E int chwepon(struct obj *, int); -E int welded(struct obj *); -E void weldmsg(struct obj *); -E void setmnotwielded(struct monst *, struct obj *); -E boolean mwelded(struct obj *); -E void unwield_weapons_silently(void); +extern void setuwep(struct obj *); +extern void setuqwep(struct obj *); +extern void setuswapwep(struct obj *); +extern int dowield(void); +extern int doswapweapon(void); +extern int dowieldquiver(void); +extern int dounwield(void); +extern boolean wield_tool(struct obj *, const char *); +extern int can_twoweapon(void); +extern void drop_uswapwep(void); +extern int dotwoweapon(void); +extern void uwepgone(void); +extern void uswapwepgone(void); +extern void uqwepgone(void); +extern void untwoweapon(void); +extern int chwepon(struct obj *, int); +extern int welded(struct obj *); +extern void weldmsg(struct obj *); +extern void setmnotwielded(struct monst *, struct obj *); +extern boolean mwelded(struct obj *); +extern void unwield_weapons_silently(void); /* ### windows.c ### */ -E void choose_windows(const char *); -E char genl_message_menu(char, int, const char *); -E void genl_preference_update(const char *); +extern void choose_windows(const char *); +extern char genl_message_menu(char, int, const char *); +extern void genl_preference_update(const char *); /* ### wizard.c ### */ -E void amulet(void); -E int mon_has_amulet(struct monst *); -E int mon_has_special(struct monst *); -E int tactics(struct monst *); -E boolean has_aggravatables(struct monst *); -E void aggravate(void); -E void clonewiz(void); -E int pick_nasty(void); -E int nasty(struct monst*); -E void resurrect(void); -E void intervene(void); -E void wizdead(void); -E void cuss(struct monst *); +extern void amulet(void); +extern int mon_has_amulet(struct monst *); +extern int mon_has_special(struct monst *); +extern int tactics(struct monst *); +extern boolean has_aggravatables(struct monst *); +extern void aggravate(void); +extern void clonewiz(void); +extern int pick_nasty(void); +extern int nasty(struct monst*); +extern void resurrect(void); +extern void intervene(void); +extern void wizdead(void); +extern void cuss(struct monst *); /* ### worm.c ### */ -E int get_wormno(void); -E void initworm(struct monst *, int); -E void worm_move(struct monst *); -E void worm_nomove(struct monst *); -E void wormgone(struct monst *); -E void wormhitu(struct monst *); -E void cutworm(struct monst *, xchar, xchar, struct obj *); -E void see_wsegs(struct monst *); -E void detect_wsegs(struct monst *, boolean); -E void save_worm(int, int); -E void rest_worm(int); -E void place_wsegs(struct monst *, struct monst *); -E void sanity_check_worm(struct monst *); -E void remove_worm(struct monst *); -E void place_worm_tail_randomly(struct monst *, xchar, xchar); -E int size_wseg(struct monst *); -E int count_wsegs(struct monst *); -E boolean worm_known(struct monst *); -E int wseg_at(struct monst *, int, int); +extern int get_wormno(void); +extern void initworm(struct monst *, int); +extern void worm_move(struct monst *); +extern void worm_nomove(struct monst *); +extern void wormgone(struct monst *); +extern void wormhitu(struct monst *); +extern void cutworm(struct monst *, coordxy, coordxy, struct obj *); +extern void see_wsegs(struct monst *); +extern void detect_wsegs(struct monst *, boolean); +extern void save_worm(int, int); +extern void rest_worm(int); +extern void place_wsegs(struct monst *, struct monst *); +extern void sanity_check_worm(struct monst *); +extern void remove_worm(struct monst *); +extern void place_worm_tail_randomly(struct monst *, coordxy, coordxy); +extern int size_wseg(struct monst *); +extern int count_wsegs(struct monst *); +extern boolean worm_known(struct monst *); +extern int wseg_at(struct monst *, coordxy, coordxy); extern void flip_worm_segs_vertical(struct monst *, int, int); extern void flip_worm_segs_horizontal(struct monst *, int, int); /* ### worn.c ### */ -E void setworn(struct obj *, long); -E void setnotworn(struct obj *); -E struct obj *wearmask_to_obj(long); -E long wearslot(struct obj *); -E void mon_set_minvis(struct monst *); -E void mon_adjust_speed(struct monst *, int, struct obj *); -E void update_mon_intrinsics(struct monst *, struct obj *, boolean, boolean); -E int find_mac(struct monst *); -E void m_dowear(struct monst *, boolean); -E struct obj *which_armor(struct monst *, long); -E void mon_break_armor(struct monst *, boolean); -E void bypass_obj(struct obj *); -E void clear_bypasses(void); -E void bypass_objlist(struct obj *, boolean); -E struct obj *nxt_unbypassed_obj(struct obj *); -E int racial_exception(struct monst *, struct obj *); +extern void setworn(struct obj *, long); +extern void setnotworn(struct obj *); +extern struct obj *wearmask_to_obj(long); +extern long wearslot(struct obj *); +extern void mon_set_minvis(struct monst *); +extern void mon_adjust_speed(struct monst *, int, struct obj *); +extern void update_mon_intrinsics(struct monst *, struct obj *, boolean, boolean); +extern int find_mac(struct monst *); +extern void m_dowear(struct monst *, boolean); +extern struct obj *which_armor(struct monst *, long); +extern void mon_break_armor(struct monst *, boolean); +extern void bypass_obj(struct obj *); +extern void clear_bypasses(void); +extern void bypass_objlist(struct obj *, boolean); +extern struct obj *nxt_unbypassed_obj(struct obj *); +extern int racial_exception(struct monst *, struct obj *); /* ### write.c ### */ extern int ink_cost(struct obj *); -E int dowrite(struct obj *); +extern int dowrite(struct obj *); /* ### zap.c ### */ -E void learn_wand(struct obj *); -E int bhitm(struct monst *, struct obj *); -E void probe_monster(struct monst *); -E boolean get_obj_location(struct obj *, xchar *, xchar *, int); -E boolean get_mon_location(struct monst *, xchar *, xchar *, int); -E struct monst *get_container_location(struct obj *obj, int *, int *); -E struct monst *montraits(struct obj *, coord *, boolean); -E struct monst *revive(struct obj *, boolean); -E int unturn_dead(struct monst *); -E void cancel_item(struct obj *); -E boolean drain_item(struct obj *, boolean); -E struct obj *poly_obj(struct obj *, int); -E boolean obj_resists(struct obj *, int, int); -E boolean obj_shudders(struct obj *); -E void do_osshock(struct obj *); -E int bhito(struct obj *, struct obj *); -E int bhitpile(struct obj *, int (*)(OBJ_P, OBJ_P), int, int, schar); -E int zappable(struct obj *); -E void zapnodir(struct obj *); -E int dozap(void); -E int zapyourself(struct obj *, boolean); -E void ubreatheu(struct attack *); -E int lightdamage(struct obj *, boolean, int); -E boolean flashburn(long); -E boolean cancel_monst(struct monst *, struct obj *, boolean, boolean, boolean); -E void zapsetup(void); -E void zapwrapup(void); -E void weffects(struct obj *); -E int spell_damage_bonus(int); -E const char *exclam(int force); -E void hit(const char *, struct monst *, const char *); -E void miss(const char *, struct monst *); -E struct monst *bhit(int, int, int, int, int (*)(MONST_P, OBJ_P), +extern void learn_wand(struct obj *); +extern int bhitm(struct monst *, struct obj *); +extern void probe_monster(struct monst *); +extern boolean get_obj_location(struct obj *, coordxy *, coordxy *, int); +extern boolean get_mon_location(struct monst *, coordxy *, coordxy *, int); +extern struct monst *get_container_location(struct obj *obj, int *, int *); +extern struct monst *montraits(struct obj *, coord *, boolean); +extern struct monst *revive(struct obj *, boolean); +extern int unturn_dead(struct monst *); +extern void cancel_item(struct obj *); +extern boolean drain_item(struct obj *, boolean); +extern struct obj *poly_obj(struct obj *, int); +extern boolean obj_resists(struct obj *, int, int); +extern boolean obj_shudders(struct obj *); +extern void do_osshock(struct obj *); +extern int bhito(struct obj *, struct obj *); +extern int bhitpile(struct obj *, int (*)(OBJ_P, OBJ_P), int, int, schar); +extern int zappable(struct obj *); +extern void zapnodir(struct obj *); +extern int dozap(void); +extern int zapyourself(struct obj *, boolean); +extern void ubreatheu(struct attack *); +extern int lightdamage(struct obj *, boolean, int); +extern boolean flashburn(long); +extern boolean cancel_monst(struct monst *, struct obj *, boolean, boolean, boolean); +extern void zapsetup(void); +extern void zapwrapup(void); +extern void weffects(struct obj *); +extern int spell_damage_bonus(int); +extern const char *exclam(int force); +extern void hit(const char *, struct monst *, const char *); +extern void miss(const char *, struct monst *); +extern struct monst *bhit(int, int, int, int, int (*)(MONST_P, OBJ_P), int (*)(OBJ_P, OBJ_P), struct obj *, boolean *); -E struct monst *boomhit(struct obj *, int, int); -E int zhitm(struct monst *, int, int, struct obj **); -E int burn_floor_objects(int, int, boolean, boolean); -E void buzz(int, int, xchar, xchar, int, int); -E void dobuzz(int, int, xchar, xchar, int, int, boolean); -E void melt_ice(xchar, xchar, const char *); -E void melt_ice_away(ANY_P *, long); -E int zap_over_floor(xchar, xchar, int, boolean *, short); -E void fracture_rock(struct obj *); -E boolean break_statue(struct obj *); -E void destroy_item(int, int); -E int destroy_mitem(struct monst *, int, int); -E int resist(struct monst *, char, int, int); -E void makewish(boolean); -E void remove_corpse(struct obj *); +extern struct monst *boomhit(struct obj *, int, int); +extern int zhitm(struct monst *, int, int, struct obj **); +extern int burn_floor_objects(coordxy, coordxy, boolean, boolean); +extern void buzz(int, int, coordxy, coordxy, int, int); +extern void dobuzz(int, int, coordxy, coordxy, int, int, boolean); +extern void melt_ice(coordxy, coordxy, const char *); +extern void melt_ice_away(ANY_P *, long); +extern int zap_over_floor(coordxy, coordxy, int, boolean *, short); +extern void fracture_rock(struct obj *); +extern boolean break_statue(struct obj *); +extern void destroy_item(int, int); +extern int destroy_mitem(struct monst *, int, int); +extern int resist(struct monst *, char, int, int); +extern void makewish(boolean); +extern void remove_corpse(struct obj *); /* ### livelog.c ### */ #ifdef LIVELOGFILE -E boolean livelog_start(void); -E void livelog_achieve_update(void); -E void livelog_wish(char*); +extern boolean livelog_start(void); +extern void livelog_achieve_update(void); +extern void livelog_wish(char*); # ifdef LIVELOG_SHOUT -E int doshout(void); +extern int doshout(void); # endif # ifdef LIVELOG_BONES_KILLER -E void livelog_bones_killed(struct monst *); +extern void livelog_bones_killed(struct monst *); # endif -E void livelog_shoplifting(const char*, const char*, long); +extern void livelog_shoplifting(const char*, const char*, long); #endif -E void livelog_game_started(const char*, const char*, const char*, const char*); -E void livelog_game_action(const char*); -E void livelog_generic(const char*, const char*); -E void livelog_genocide(const char*, int); +extern void livelog_game_started(const char*, const char*, const char*, const char*); +extern void livelog_game_action(const char*); +extern void livelog_generic(const char*, const char*); +extern void livelog_genocide(const char*, int); extern void livelog_printf(unsigned int, const char *, ...) PRINTF_F(2, 3); #endif /* !MAKEDEFS_C && !LEV_LEX_C */ /* ### tutorial.c ### */ -E boolean check_tutorial_message(int); -E void maybe_tutorial(void); -E int tutorial_redisplay(void); -E void tutorial_redisplay_message(void); -E void check_tutorial_farlook(int, int); -E void check_tutorial_command(char); -E int check_tutorial_location(int, int, boolean); -E int check_tutorial_oclass(int); +extern boolean check_tutorial_message(int); +extern void maybe_tutorial(void); +extern int tutorial_redisplay(void); +extern void tutorial_redisplay_message(void); +extern void check_tutorial_farlook(coordxy, coordxy); +extern void check_tutorial_command(char); +extern int check_tutorial_location(coordxy, coordxy, boolean); +extern int check_tutorial_oclass(int); /* ### base32.c ### */ long decode_base32(const char*); const char* encode_base32(unsigned long); /* ### unicode.c ### */ -E glyph_t get_unicode_codepoint(int); -E int pututf8char(glyph_t); +extern glyph_t get_unicode_codepoint(int); +extern int pututf8char(glyph_t); #undef E diff --git a/include/global.h b/include/global.h index 71efe62b0..57248086a 100644 --- a/include/global.h +++ b/include/global.h @@ -81,13 +81,25 @@ #endif /* DUMB */ /* - * type xchar: small integers in the range 0 - 127, usually coordinates - * although they are nonnegative they must not be declared unsigned - * since otherwise comparisons with signed quantities are done incorrectly + * type xint8: small integers (typedef'd as signed, + * in the range -127 - 127). */ -typedef schar xchar; +typedef int8_t xint8; +/* + * type coordxy: integers (typedef'd as signed, + * in the range -32768 to 32767), mostly coordinates. + * Note that in 2022, screen coordinates easily + * surpass an upper limit of 127. + */ +typedef int16_t coordxy; +/* + * type xint16: integers (typedef'd as signed, + * in the range -32768 to 32767), non-coordinates. + */ +typedef int16_t xint16; + #ifndef SKIP_BOOLEAN -typedef xchar boolean; /* 0 or 1 */ +typedef coordxy boolean; /* 0 or 1 */ #endif #ifndef TRUE /* defined in some systems' native include files */ @@ -125,31 +137,8 @@ typedef glyph_t nhsym; #define Bitfield(x, n) uchar x #endif -#ifdef UNWIDENED_PROTOTYPES -# define CHAR_P char -# define SCHAR_P schar -# define UCHAR_P uchar -# define XCHAR_P xchar -# define SHORT_P short -#ifndef SKIP_BOOLEAN -# define BOOLEAN_P boolean -#endif -# define ALIGNTYP_P aligntyp -#else -# ifdef WIDENED_PROTOTYPES -# define CHAR_P int -# define SCHAR_P int -# define UCHAR_P int -# define XCHAR_P int -# define SHORT_P int -# define BOOLEAN_P int -# define ALIGNTYP_P int -# endif -#endif - #define SIZE(x) (int)(sizeof(x) / sizeof(x[0])) - /* A limit for some NetHack int variables. It need not, and for comparable * scoring should not, depend on the actual limit on integers for a * particular machine, although it is set to the minimum required maximum @@ -157,12 +146,10 @@ typedef glyph_t nhsym; */ #define LARGEST_INT 32767 - #ifdef REDO #define Getchar pgetchar #endif - #include "coord.h" /* * Automatic inclusions for the subsidiary files. diff --git a/include/lev.h b/include/lev.h index b7c021b38..31e551e4d 100644 --- a/include/lev.h +++ b/include/lev.h @@ -20,7 +20,7 @@ /* The following are used in mkmaze.c */ struct container { struct container *next; - xchar x, y; + coordxy x, y; short what; genericptr_t list; }; @@ -31,7 +31,7 @@ struct container { #define CONS_TRAP 3 struct bubble { - xchar x, y; /* coordinates of the upper left corner */ + coordxy x, y; /* coordinates of the upper left corner */ schar dx, dy; /* the general direction of the bubble's movement */ uchar bm[MAX_BMASK+2]; /* bubble bit mask */ struct bubble *prev, *next; /* need to traverse the list up and down */ @@ -41,7 +41,7 @@ struct bubble { /* used in light.c */ typedef struct ls_t { struct ls_t *next; - xchar x, y; /* source's position */ + coordxy x, y; /* source's position */ short range; /* source's current range */ short flags; short type; /* type of light source */ diff --git a/include/mextra.h b/include/mextra.h index 9c3dfd018..20cc581fb 100644 --- a/include/mextra.h +++ b/include/mextra.h @@ -67,16 +67,16 @@ #define GD_DESTROYGOLD 0x02 struct fakecorridor { - xchar fx, fy, ftyp; + coordxy fx, fy, ftyp; }; struct egd { int fcbeg, fcend; /* fcend: first unused pos */ int vroom; /* room number of the vault */ - xchar gdx, gdy; /* goal of guard's walk */ - xchar ogx, ogy; /* guard's last position */ + coordxy gdx, gdy; /* goal of guard's walk */ + coordxy ogx, ogy; /* guard's last position */ d_level gdlevel; /* level (& dungeon) guard was created in */ - xchar warncnt; /* number of warnings to follow */ + xint16 warncnt; /* number of warnings to follow */ Bitfield(gddone, 1); /* true iff guard has released player */ Bitfield(witness, 2); /* the guard saw you do something */ Bitfield(unused, 5); diff --git a/include/mkroom.h b/include/mkroom.h index a4ce6b3b1..674fa4d7a 100644 --- a/include/mkroom.h +++ b/include/mkroom.h @@ -8,7 +8,7 @@ /* mkroom.h - types and structures for room and shop initialization */ struct mkroom { - schar lx, hx, ly, hy; /* usually xchar, but hx may be -1 */ + schar lx, hx, ly, hy; /* usually coordxy, but hx may be -1 */ schar rtype; /* type of room (zoo, throne, etc...) */ schar orig_rtype; /* same as rtype, but not zeroed later */ schar rlit; /* is the room lit ? */ diff --git a/include/monst.h b/include/monst.h index a7c3d7e71..6216925e0 100644 --- a/include/monst.h +++ b/include/monst.h @@ -79,8 +79,8 @@ struct monst { uchar m_lev; /* adjusted difficulty level of monster */ aligntyp malign; /* alignment of this monster, relative to the player (positive = good to kill) */ - xchar mx, my; - xchar mux, muy; /* where the monster thinks you are */ + coordxy mx, my; + coordxy mux, muy; /* where the monster thinks you are */ #define MTSZ 4 coord mtrack[MTSZ]; /* monster track */ int mhp, mhpmax; @@ -157,8 +157,8 @@ struct monst { #define STRAT_XMASK 0x00ff0000L #define STRAT_YMASK 0x0000ff00L #define STRAT_GOAL 0x000000ffL -#define STRAT_GOALX(s) ((xchar)((s & STRAT_XMASK) >> 16)) -#define STRAT_GOALY(s) ((xchar)((s & STRAT_YMASK) >> 8)) +#define STRAT_GOALX(s) ((coordxy)((s & STRAT_XMASK) >> 16)) +#define STRAT_GOALY(s) ((coordxy)((s & STRAT_YMASK) >> 8)) long mtrapseen; /* bitmap of traps we've been trapped in */ long mlstmv; /* for catching up with lost time */ @@ -167,7 +167,7 @@ struct monst { struct obj *minvent; /* mon's inventory */ struct obj *mw; /* mon's weapon */ long misc_worn_check; /* mon's wornmask */ - xchar weapon_check; /* flag for whether to try switching weapons */ + xint16 weapon_check; /* flag for whether to try switching weapons */ long mgrlastattack; /* turn when a grouper last attacked. at certain points, the attackers decide diff --git a/include/obj.h b/include/obj.h index 9c7c530a8..0c50043dd 100644 --- a/include/obj.h +++ b/include/obj.h @@ -34,7 +34,7 @@ struct obj { struct obj *cobj; /* contents list for containers */ size_t o_id; - xchar ox, oy; + coordxy ox, oy; short otyp; /* object class number */ unsigned owt; long quan; /* number of items */ @@ -58,7 +58,7 @@ struct obj { char invlet; /* designation in inventory */ int oartifact; /* artifact array index */ int mrevived; /* keep track of revivification from former monster */ - xchar where; /* where the object thinks it is */ + xint8 where; /* where the object thinks it is */ #define OBJ_FREE 0 /* object not attached to anything */ #define OBJ_FLOOR 1 /* object on floor */ #define OBJ_CONTAINED 2 /* object in a container */ @@ -68,7 +68,7 @@ struct obj { #define OBJ_BURIED 6 /* object buried */ #define OBJ_ONBILL 7 /* object on shk bill */ #define NOBJ_STATES 8 - xchar timed; /* # of fuses (timers) attached to this obj */ + xint16 timed; /* # of fuses (timers) attached to this obj */ Bitfield(cursed, 1); Bitfield(blessed, 1); @@ -118,7 +118,7 @@ struct obj { #define fromsink corpsenm /* a potion from a sink */ #ifdef RECORD_ACHIEVE - xchar record_achieve_special; + coordxy record_achieve_special; #endif int usecount; /* overloaded for various things that tally */ unsigned oeaten; /* nutrition left in food, if partly eaten */ diff --git a/include/rect.h b/include/rect.h index 86d66c184..275993832 100644 --- a/include/rect.h +++ b/include/rect.h @@ -6,8 +6,8 @@ #define RECT_H typedef struct nhrect { - xchar lx, ly; - xchar hx, hy; + coordxy lx, ly; + coordxy hx, hy; } NhRect; #endif /* RECT_H */ diff --git a/include/skills.h b/include/skills.h index 8e3abfae2..48c253403 100644 --- a/include/skills.h +++ b/include/skills.h @@ -107,8 +107,8 @@ /* The hero's skill in various weapons. */ struct skills { - xchar skill; - xchar max_skill; + xint16 skill; + xint16 max_skill; unsigned short advance; }; @@ -121,8 +121,8 @@ struct skills { /* Initial skill matrix structure; used in u_init.c and weapon.c */ struct def_skill { - xchar skill; - xchar skmax; + xint16 skill; + xint16 skmax; }; #endif /* SKILLS_H */ diff --git a/include/sp_lev.h b/include/sp_lev.h index 794e04599..c72adcf0e 100644 --- a/include/sp_lev.h +++ b/include/sp_lev.h @@ -302,7 +302,7 @@ enum corefuncs { struct splev_var { struct splev_var *next; char *name; - xchar svtyp; /* SPOVAR_foo */ + coordxy svtyp; /* SPOVAR_foo */ union { struct opvar *value; struct opvar **arrayvalues; @@ -355,7 +355,7 @@ struct sp_coder { #define packed_coord long typedef struct { - xchar is_random; + xint16 is_random; long getloc_flags; int x, y; } unpacked_coord; @@ -375,23 +375,24 @@ typedef union str_or_len { } Str_or_Len; typedef struct { - xchar init_style; /* one of LVLINIT_foo */ + xint16 init_style; /* one of LVLINIT_foo */ long flags; schar filling; boolean init_present, padding; char fg, bg; boolean smoothed, joined; - xchar lit, walled; + xint16 lit, walled; boolean icedpools; } lev_init; typedef struct { - xchar wall, pos, secret, mask; + xint16 wall, pos, secret, mask; } room_door; typedef struct { packed_coord coord; - xchar x, y, type; + coordxy x, y; + xint16 type; } trap; typedef struct { @@ -399,7 +400,8 @@ typedef struct { short id; aligntyp align; packed_coord coord; - xchar x, y, class, appear; + coordxy x, y; + xint16 class, appear; schar peaceful, asleep; short female, invis, cancelled, revived, avenge, fleeing, blinded, paralyzed, stunned, confused; long seentraps; @@ -411,7 +413,8 @@ typedef struct { int corpsenm; short id, spe; packed_coord coord; - xchar x, y, class, containment; + coordxy x, y; + xint16 class, containment; schar curse_state; int quan; short buried; @@ -421,41 +424,42 @@ typedef struct { typedef struct { packed_coord coord; - xchar x, y; + coordxy x, y; aligntyp align; - xchar shrine; + xint16 shrine; } altar; typedef struct { - xchar x1, y1, x2, y2; - xchar rtype, rlit, rirreg; + coordxy x1, y1, x2, y2; + xint16 rtype, rlit, rirreg; } region; typedef struct { - xchar ter, tlit; + xint16 ter, tlit; } terrain; typedef struct { - xchar chance; - xchar x1, y1, x2, y2; - xchar fromter, toter, tolit; + coordxy chance; + coordxy x1, y1, x2, y2; + coordxy fromter, toter, tolit; } replaceterrain; /* values for rtype are defined in dungeon.h */ typedef struct { - struct { xchar x1, y1, x2, y2; } inarea; - struct { xchar x1, y1, x2, y2; } delarea; + struct { coordxy x1, y1, x2, y2; } inarea; + struct { coordxy x1, y1, x2, y2; } delarea; boolean in_islev, del_islev; - xchar rtype, padding; + xint16 rtype, padding; Str_or_Len rname; } lev_region; typedef struct _room { Str_or_Len name; Str_or_Len parent; - xchar x, y, w, h; - xchar xalign, yalign; - xchar rtype, chance, rlit, filled, joined; + coordxy x, y; + xint16 w, h; + xint16 xalign, yalign; + xint16 rtype, chance, rlit, filled, joined; } room; typedef struct { @@ -468,9 +472,9 @@ typedef struct { typedef struct { struct { - xchar room; - xchar wall; - xchar door; + xint16 room; + xint16 wall; + xint16 door; } src, dest; } corridor; @@ -485,7 +489,7 @@ typedef struct { } sp_lev; typedef struct { - xchar x, y, direction, count, lit; + coordxy x, y, direction, count, lit; char typ; } spill; diff --git a/include/spell.h b/include/spell.h index 96c69fc48..cfd2fc7b0 100644 --- a/include/spell.h +++ b/include/spell.h @@ -6,9 +6,9 @@ #define SPELL_H struct spell { - short sp_id; /* spell id (== object.otyp) */ - xchar sp_lev; /* power level */ - int sp_know; /* knowlege of spell */ + short sp_id; /* spell id (== object.otyp) */ + xint16 sp_lev; /* power level */ + int sp_know; /* knowlege of spell */ }; /* levels of memory destruction with a scroll of amnesia */ diff --git a/include/tradstdc.h b/include/tradstdc.h index b4e6def11..a13f608d8 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -311,45 +311,18 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ # endif #endif -/* this applies to both VMS and Digital Unix/HP Tru64 */ -#ifdef WIDENED_PROTOTYPES -/* ANSI C uses "value preserving rules", where 'unsigned char' and - 'unsigned short' promote to 'int' if signed int is big enough to hold - all possible values, rather than traditional "sign preserving rules" - where 'unsigned char' and 'unsigned short' promote to 'unsigned int'. - However, the ANSI C rules aren't binding on non-ANSI compilers. - When DEC C (aka Compaq C, then HP C) is in non-standard 'common' mode - it supports prototypes that expect widened types, but it uses the old - sign preserving rules for how to widen narrow unsigned types. (In its - default 'relaxed' mode, __STDC__ is 1 and uchar widens to 'int'.) */ -#if defined(__DECC) && (!defined(__STDC__) || !__STDC__) -#define UCHAR_P unsigned int -#endif -#endif - /* These are used for arguments within VDECL prototype declarations. */ #ifdef UNWIDENED_PROTOTYPES #define CHAR_P char #define SCHAR_P schar -#define UCHAR_P uchar -#define XCHAR_P xchar -#define SHORT_P short #ifndef SKIP_BOOLEAN #define BOOLEAN_P boolean #endif -#define ALIGNTYP_P aligntyp #else #ifdef WIDENED_PROTOTYPES #define CHAR_P int #define SCHAR_P int -#ifndef UCHAR_P -#define UCHAR_P int -#endif -#define XCHAR_P int -#define SHORT_P int -#define BOOLEAN_P int -#define ALIGNTYP_P int #else /* Neither widened nor unwidened prototypes. Argument list expansion * by VDECL always empty; all xxx_P vanish so defs aren't needed. */ diff --git a/include/trap.h b/include/trap.h index 6f33c44af..efb427627 100644 --- a/include/trap.h +++ b/include/trap.h @@ -16,7 +16,7 @@ union vlaunchinfo { struct trap { struct trap *ntrap; - xchar tx, ty; + coordxy tx, ty; d_level dst; /* destination for portals */ coord launch; Bitfield(ttyp, 5); diff --git a/include/winami.h b/include/winami.h index 6098156ae..be3e3d1f5 100644 --- a/include/winami.h +++ b/include/winami.h @@ -38,12 +38,12 @@ struct amii_menu * tty-style windows also, then things will need to change. */ /* per-window data */ struct amii_WinDesc { - xchar type; /* type of window */ + xint16 type; /* type of window */ struct amii_menu menu; boolean active; /* true if window is active */ boolean wasup; /* true if menu/text window was already open */ short disprows; /* Rows displayed so far (used for paging in message win) */ - xchar offx, offy; /* offset from topleft of display */ + coordxy offx, offy; /* offset from topleft of display */ short vwx, vwy, vcx, vcy; /* View cursor location */ short rows, cols; /* dimensions */ short curx, cury; /* current cursor position */ diff --git a/include/wincurs.h b/include/wincurs.h index 6077dd032..481fb9ceb 100644 --- a/include/wincurs.h +++ b/include/wincurs.h @@ -107,7 +107,7 @@ extern void curses_wait_synch(void); extern void curses_cliparound(int x, int y); -extern void curses_print_glyph(winid wid, xchar x, xchar y, int glyph, int bg_glyph); +extern void curses_print_glyph(winid wid, coordxy x, coordxy y, int glyph, int bg_glyph); extern void curses_raw_print(const char *str); @@ -115,7 +115,7 @@ extern void curses_raw_print_bold(const char *str); extern int curses_nhgetch(void); -extern int curses_nh_poskey(int *x, int *y, int *mod); +extern int curses_nh_poskey(coordxy *x, coordxy *y, int *mod); extern void curses_nhbell(void); @@ -223,7 +223,7 @@ extern int curses_read_attrs(char *attrs); extern int curses_convert_keys(int key); -extern int curses_get_mouse(int *mousex, int *mousey, int *mod); +extern int curses_get_mouse(coordxy *mousex, coordxy *mousey, int *mod); /* cursdial.c */ diff --git a/include/winlisp.h b/include/winlisp.h index d59ffb20d..6628dcb25 100644 --- a/include/winlisp.h +++ b/include/winlisp.h @@ -52,11 +52,11 @@ E void lisp_cliparound(int, int); #ifdef POSITIONBAR E void lisp_update_positionbar(char *); #endif -E void lisp_print_glyph(winid, xchar, xchar, int, int); +E void lisp_print_glyph(winid, coordxy, coordxy, int, int); E void lisp_raw_print(const char *); E void lisp_raw_print_bold(const char *); E int lisp_nhgetch(void); -E int lisp_nh_poskey(int *, int *, int *); +E int lisp_nh_poskey(coordxy *, coordxy *, int *); E void lisp_nhbell(void); E int lisp_doprev_message(void); E char lisp_yn_function(const char *, const char *, char); diff --git a/include/winprocs.h b/include/winprocs.h index 9523682ce..5dd687871 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -42,11 +42,11 @@ struct window_procs { #ifdef POSITIONBAR void (*win_update_positionbar)(char *); #endif - void (*win_print_glyph)(winid, xchar, xchar, int, int); + void (*win_print_glyph)(winid, coordxy, coordxy, int, int); void (*win_raw_print)(const char *); void (*win_raw_print_bold)(const char *); int (*win_nhgetch)(void); - int (*win_nh_poskey)(int *, int *, int *); + int (*win_nh_poskey)(coordxy *, coordxy *, int *); void (*win_nhbell)(void); int (*win_doprev_message)(void); char (*win_yn_function)(const char *, const char *, char); diff --git a/include/wintty.h b/include/wintty.h index 4a2a9f9a8..fec93495b 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -26,13 +26,13 @@ typedef struct tty_mi { /* descriptor for tty-based windows */ struct WinDesc { - int flags; /* window flags */ - xchar type; /* type of window */ - boolean active; /* true if window is active */ - short offx, offy; /* offset from topleft of display */ - long rows, cols; /* dimensions */ - long curx, cury; /* current cursor position */ - long maxrow, maxcol; /* the maximum size used -- for MENU wins */ + int flags; /* window flags */ + xint16 type; /* type of window */ + boolean active; /* true if window is active */ + short offx, offy; /* offset from topleft of display */ + long rows, cols; /* dimensions */ + long curx, cury; /* current cursor position */ + long maxrow, maxcol; /* the maximum size used -- for MENU wins */ /* maxcol is also used by WIN_MESSAGE for */ /* tracking the ^P command */ short *datlen; /* allocation size for *data */ @@ -205,11 +205,11 @@ E void tty_cliparound(int, int); #ifdef POSITIONBAR E void tty_update_positionbar(char *); #endif -E void tty_print_glyph(winid, xchar, xchar, int, int); +E void tty_print_glyph(winid, coordxy, coordxy, int, int); E void tty_raw_print(const char *); E void tty_raw_print_bold(const char *); E int tty_nhgetch(void); -E int tty_nh_poskey(int *, int *, int *); +E int tty_nh_poskey(coordxy *, coordxy *, int *); E void tty_nhbell(void); E int tty_doprev_message(void); E char tty_yn_function(const char *, const char *, char); diff --git a/include/wintype.h b/include/wintype.h index 0ac7f52b2..4aabb1bfb 100644 --- a/include/wintype.h +++ b/include/wintype.h @@ -13,14 +13,20 @@ typedef union any { struct obj *a_obj; struct monst *a_monst; int a_int; + int a_xint16; + int a_xint8; char a_char; schar a_schar; uchar a_uchar; unsigned int a_uint; long a_long; unsigned long a_ulong; + coordxy a_coordxy; int *a_iptr; + xint16 *a_xint16ptr; + xint8 *a_xint8ptr; long *a_lptr; + coordxy *a_coordxyptr; unsigned long *a_ulptr; unsigned *a_uptr; const char *a_string; diff --git a/include/you.h b/include/you.h index 0540c3a87..52e6f44e9 100644 --- a/include/you.h +++ b/include/you.h @@ -21,9 +21,9 @@ struct RoleName { struct RoleAdvance { /* "fix" is the fixed amount, "rnd" is the random amount */ - xchar infix, inrnd; /* at character initialization */ - xchar lofix, lornd; /* gained per level < urole.xlev */ - xchar hifix, hirnd; /* gained per level >= urole.xlev */ + xint16 infix, inrnd; /* at character initialization */ + xint16 lofix, lornd; /* gained per level < urole.xlev */ + xint16 hifix, hirnd; /* gained per level >= urole.xlev */ }; struct u_have { @@ -172,12 +172,12 @@ struct Role { #define ROLE_CHAOTIC AM_CHAOTIC /*** Attributes (from attrib.c and exper.c) ***/ - xchar attrbase[A_MAX]; /* lowest initial attributes */ - xchar attrdist[A_MAX]; /* distribution of initial attributes */ + xint16 attrbase[A_MAX]; /* lowest initial attributes */ + xint16 attrdist[A_MAX]; /* distribution of initial attributes */ struct RoleAdvance hpadv; /* hit point advancement */ struct RoleAdvance enadv; /* energy advancement */ - xchar xlev; /* cutoff experience level */ - xchar initrecord; /* initial alignment record */ + xint16 xlev; /* cutoff experience level */ + xint16 initrecord; /* initial alignment record */ /*** Spell statistics (from spell.c) ***/ int spelbase; /* base spellcasting penalty */ @@ -234,8 +234,8 @@ struct Race { hatemask; /* bit mask of always hostile */ /*** Attributes ***/ - xchar attrmin[A_MAX]; /* minimum allowable attribute */ - xchar attrmax[A_MAX]; /* maximum allowable attribute */ + xint16 attrmin[A_MAX]; /* minimum allowable attribute */ + xint16 attrmax[A_MAX]; /* maximum allowable attribute */ struct RoleAdvance hpadv; /* hit point advancement */ struct RoleAdvance enadv; /* energy advancement */ #if 0 /* DEFERRED */ @@ -354,11 +354,11 @@ extern const struct Conduct conducts[];/* table of available roleplay conducts*/ /*** Information about the player ***/ struct you { - xchar ux, uy; + coordxy ux, uy; schar dx, dy, dz; /* direction of move (or zap or ... ) */ schar di; /* direction of FF */ - xchar tx, ty; /* destination of travel */ - xchar ux0, uy0; /* initial position FF */ + coordxy tx, ty; /* destination of travel */ + coordxy ux0, uy0; /* initial position FF */ d_level uz, uz0; /* your level on this and the previous turn */ d_level utolev; /* level monster teleported you to, or uz */ uchar utotype; /* bitmask of goto_level() flags for utolev */ @@ -456,8 +456,8 @@ struct you { uchar uspmtime; /* #moves between uspellprot-- */ int uhp, uhpmax; int uen, uenmax; /* magical energy - M. Stephenson */ - xchar uhpinc[MAXULEV]; /* increases to uhpmax for each level gain */ - xchar ueninc[MAXULEV]; /* increases to uenmax for each level gain */ + xint16 uhpinc[MAXULEV]; /* increases to uhpmax for each level gain */ + xint16 ueninc[MAXULEV]; /* increases to uenmax for each level gain */ int ugangr; /* if the gods are angry at you */ int ugifts; /* number of artifacts bestowed */ int ublessed, ublesscnt; /* blessing/duration from #pray */ @@ -480,7 +480,7 @@ struct you { int weapon_slots; /* unused skill slots */ int skills_advanced; /* # of advances made so far */ - xchar skill_record[P_SKILL_LIMIT]; /* skill advancements */ + xint16 skill_record[P_SKILL_LIMIT]; /* skill advancements */ struct skills weapon_skills[P_NUM_SKILLS]; boolean twoweap; /* KMH -- Using two-weapon combat */ boolean incloud; /* used for blindness in stinking clouds */ diff --git a/src/allmain.c b/src/allmain.c index c59f9a7e9..e2e2919b5 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -415,7 +415,7 @@ moveloop(boolean resuming) if(!u.uinvulnerable) { if(Teleportation && !rn2(85)) { - xchar old_ux = u.ux, old_uy = u.uy; + coordxy old_ux = u.ux, old_uy = u.uy; tele(); if (u.ux != old_ux || u.uy != old_uy) { if (!next_to_u()) { diff --git a/src/apply.c b/src/apply.c index 89732f8e2..f62653c73 100644 --- a/src/apply.c +++ b/src/apply.c @@ -564,7 +564,7 @@ use_magic_whistle(struct obj *obj) } boolean -um_dist(xchar x, xchar y, xchar n) +um_dist(coordxy x, coordxy y, xint16 n) { return((boolean)(abs(u.ux - x) > n || abs(u.uy - y) > n)); } @@ -772,7 +772,7 @@ next_to_u(void) } void -check_leash(xchar x, xchar y) +check_leash(coordxy x, coordxy y) { struct obj *otmp; struct monst *mtmp; @@ -1280,7 +1280,7 @@ snuff_candle(struct obj *otmp) if ((candle || otmp->otyp == CANDELABRUM_OF_INVOCATION) && otmp->lamplit) { char buf[BUFSZ]; - xchar x, y; + coordxy x, y; boolean many = candle ? otmp->quan > 1L : otmp->spe > 1; (void) get_obj_location(otmp, &x, &y, 0); @@ -1301,7 +1301,7 @@ snuff_candle(struct obj *otmp) boolean snuff_lit(struct obj *obj) { - xchar x, y; + coordxy x, y; if (obj->lamplit) { if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP || @@ -1322,7 +1322,7 @@ snuff_lit(struct obj *obj) boolean catch_lit(struct obj *obj) { - xchar x, y; + coordxy x, y; if (!obj->lamplit && (obj->otyp == MAGIC_LAMP || ignitable(obj))) { if ((obj->otyp == MAGIC_LAMP || @@ -1535,7 +1535,7 @@ enum jump_trajectory { /* callback routine for walk_path() */ static boolean -check_jump(void *arg, int x, int y) +check_jump(void *arg, coordxy x, coordxy y) { int traj = *(int *) arg; struct rm *lev = &levl[x][y]; @@ -1571,7 +1571,7 @@ check_jump(void *arg, int x, int y) } static boolean -is_valid_jump_pos(int x, int y, int magic, boolean showmsg) +is_valid_jump_pos(coordxy x, coordxy y, int magic, boolean showmsg) { if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && distu(x, y) != 5) { /* The Knight jumping restriction still applies when riding a @@ -1648,7 +1648,7 @@ is_valid_jump_pos(int x, int y, int magic, boolean showmsg) static int jumping_is_magic; static boolean -get_valid_jump_position(int x, int y) +get_valid_jump_position(coordxy x, coordxy y) { return (isok(x, y) && (ACCESSIBLE(levl[x][y].typ) || Passes_walls) && @@ -2200,7 +2200,7 @@ fig_transform(anything *arg, long int timeout) static boolean figurine_location_checks(struct obj *obj, coord *cc, boolean quietly) { - xchar x, y; + coordxy x, y; if (carried(obj) && u.uswallow) { if (!quietly) @@ -2234,7 +2234,7 @@ static void use_figurine(struct obj **optr) { struct obj *obj = *optr; - xchar x, y; + coordxy x, y; coord cc; if (u.uswallow) { @@ -2328,7 +2328,7 @@ use_grease(struct obj *obj) static struct trapinfo { struct obj *tobj; - xchar tx, ty; + coordxy tx, ty; int time_needed; boolean force_bungle; } trapinfo; @@ -2924,7 +2924,7 @@ static int polearm_range_min = -1; static int polearm_range_max = -1; static boolean -get_valid_polearm_position(int x, int y) +get_valid_polearm_position(coordxy x, coordxy y) { return (isok(x, y) && ACCESSIBLE(levl[x][y].typ) && @@ -3687,7 +3687,7 @@ do_flip_coin(struct obj *obj) ((ACURR(A_DEX) + Luck) > 0) && rn2((ACURR(A_DEX) + Luck))) { /* coin flipping is independent of other random functions, so use rand() intentionally here */ - xchar ht = rand() % 2; + coordxy ht = rand() % 2; if (!Hallucination) { pline("%s.", ht ? "Heads" : "Tails"); } else { diff --git a/src/artifact.c b/src/artifact.c index 88693a33e..630cb5ea3 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -38,7 +38,7 @@ static int spec_dbon_applies = 0; /* flags including which artifacts have already been created */ static boolean artiexist[1+NROFARTIFACTS+1]; /* and a discovery list for them (no dummy first entry here) */ -static xchar artidisco[NROFARTIFACTS]; +static xint16 artidisco[NROFARTIFACTS]; static void hack_artifacts(void); static boolean attacks(int, struct obj *); @@ -858,7 +858,7 @@ spec_dbon(struct obj *otmp, struct monst *mon, int tmp) /* add identified artifact to discoveries list */ void -discover_artifact(xchar m) +discover_artifact(xint16 m) { int i; @@ -876,7 +876,7 @@ discover_artifact(xchar m) /* used to decide whether an artifact has been fully identified */ boolean -undiscovered_artifact(xchar m) +undiscovered_artifact(xint16 m) { int i; @@ -2287,7 +2287,7 @@ retouch_equipment(int dropflag) /**< 0==don't drop, 1==drop all, 2==drop weapon static int mkot_trap_warn_count = 0; static int -count_surround_traps(int x, int y) +count_surround_traps(coordxy x, coordxy y) { struct rm *levp; struct obj *otmp; diff --git a/src/attrib.c b/src/attrib.c index a44eefe0f..025840fa6 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -668,7 +668,7 @@ newhp(void) hp = 1; } if (u.ulevel < MAXULEV) { - u.uhpinc[u.ulevel] = (xchar) hp; + u.uhpinc[u.ulevel] = (xint16) hp; } return hp; } diff --git a/src/ball.c b/src/ball.c index ff1c0bb9f..7d37e6c2a 100644 --- a/src/ball.c +++ b/src/ball.c @@ -438,7 +438,7 @@ void move_bc( int before, int control, - xchar ballx, xchar bally, xchar chainx, xchar chainy) /* only matter !before */ + coordxy ballx, coordxy bally, coordxy chainx, coordxy chainy) /* only matter !before */ { if (Blind) { /* @@ -554,9 +554,9 @@ move_bc( /** return TRUE if the caller needs to place the ball and chain down again */ boolean drag_ball( - xchar x, xchar y, + coordxy x, coordxy y, int *bc_control, - xchar *ballx, xchar *bally, xchar *chainx, xchar *chainy, + coordxy *ballx, coordxy *bally, coordxy *chainx, coordxy *chainy, boolean *cause_delay, boolean allow_drag) { @@ -591,7 +591,7 @@ drag_ball( /* only need to move the chain? */ if (carried(uball) || distmin(x, y, uball->ox, uball->oy) <= 2) { - xchar oldchainx = uchain->ox, oldchainy = uchain->oy; + coordxy oldchainx = uchain->ox, oldchainy = uchain->oy; *bc_control = BC_CHAIN; move_bc(1, *bc_control, *ballx, *bally, *chainx, *chainy); if (carried(uball)) { @@ -643,7 +643,7 @@ drag_ball( * 0 */ case 5: { - xchar tempx, tempy, tempx2, tempy2; + coordxy tempx, tempy, tempx2, tempy2; /* find position closest to current position of chain */ /* no effect if current position is already OK */ @@ -833,7 +833,7 @@ drag_ball( *ballx = *chainx = x; *bally = *chainy = y; } else { - xchar newchainx = u.ux, newchainy = u.uy; + coordxy newchainx = u.ux, newchainy = u.uy; /* * Generally, chain moves to hero's previous location and ball @@ -873,7 +873,7 @@ drag_ball( * Should not be called while swallowed. */ void -drop_ball(xchar x, xchar y) +drop_ball(coordxy x, coordxy y) { if (Blind) { /* get the order */ diff --git a/src/bones.c b/src/bones.c index 3cd77caae..4068f8557 100644 --- a/src/bones.c +++ b/src/bones.c @@ -85,7 +85,7 @@ resetobjs(struct obj *ochain, boolean restore) if (otmp->oclass == FOOD_CLASS && otmp->oeaten) { struct obj *top; char *p; - xchar ox, oy; + coordxy ox, oy; for (top = otmp; top->where == OBJ_CONTAINED; top = top->ocontainer) @@ -257,7 +257,7 @@ sanitize_name(char *namebuf) /* called by savebones(); also by finish_paybill(shk.c) */ void -drop_upon_death(struct monst *mtmp, struct obj *cont, int x, int y) +drop_upon_death(struct monst *mtmp, struct obj *cont, coordxy x, coordxy y) /* monster if hero turned into one (other than ghost) */ /* container if hero is turned into a statue */ diff --git a/src/cmd.c b/src/cmd.c index 6512ae6e3..a6e297602 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -207,7 +207,7 @@ static const char unavailcmd[] = "Unavailable command '%s'."; static const char cmdnotavail[] = "'%s' command not available."; static char here_cmd_menu(boolean); -static char there_cmd_menu(boolean, int, int); +static char there_cmd_menu(boolean, coordxy, coordxy); static char *parse(void); static boolean help_dir(char, uchar, const char *); static int dosuspend_core(void); @@ -869,7 +869,7 @@ static int wiz_where(void) { if (wizard) { - (void) print_dungeon(FALSE, (schar *)0, (xchar *)0); + (void) print_dungeon(FALSE, (schar *)0, (xint16 *)0); } else { pline(unavailcmd, visctrl((int) cmd_from_func(wiz_where))); } @@ -3857,9 +3857,9 @@ prefix_cmd(char c) * Returns non-zero if coordinates in cc are valid. */ int -get_adjacent_loc(const char *prompt, const char *emsg, xchar x, xchar y, coord *cc) +get_adjacent_loc(const char *prompt, const char *emsg, coordxy x, coordxy y, coord *cc) { - xchar new_x, new_y; + coordxy new_x, new_y; if (!getdir(prompt)) { pline("%s", Never_mind); return 0; @@ -4148,7 +4148,7 @@ directionname(int dir) } int -isok(int x, int y) +isok(coordxy x, coordxy y) { /* x corresponds to curx, so x==1 is the first column. Ach. %% */ return x >= 1 && x <= COLNO-1 && y >= 0 && y <= ROWNO-1; @@ -4196,7 +4196,7 @@ add_herecmd_menuitem(winid win, int (*func)(void), const char *text) } static char -there_cmd_menu(boolean doit, int x, int y) +there_cmd_menu(boolean doit, coordxy x, coordxy y) { winid win; char ch; @@ -4393,7 +4393,7 @@ static NEARDATA int last_multi; * convert a MAP window position into a movecmd */ const char * -click_to_cmd(int x, int y, int mod) +click_to_cmd(coordxy x, coordxy y, int mod) { int dir; static char cmd[4]; @@ -4714,7 +4714,8 @@ char readchar(void) { int sym; - int x = u.ux, y = u.uy, mod = 0; + coordxy x = u.ux, y = u.uy; + int mod = 0; if (iflags.debug_fuzzer) { return randomkey(); @@ -4771,7 +4772,7 @@ readchar(void) static int find_remembered_stairs(boolean upstairs, coord *cc) { - xchar x, y; + coordxy x, y; int stair, ladder, branch; if (upstairs) { stair = S_upstair; diff --git a/src/dbridge.c b/src/dbridge.c index 2b11a6417..1a036cb03 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -18,14 +18,14 @@ #include "hack.h" -static void get_wall_for_db(int *, int *); -static struct entity *e_at(int, int); -static void m_to_e(struct monst *, int, int, struct entity *); +static void get_wall_for_db(coordxy *, coordxy *); +static struct entity *e_at(coordxy, coordxy); +static void m_to_e(struct monst *, coordxy, coordxy, struct entity *); static void u_to_e(struct entity *); -static void set_entity(int, int, struct entity *); +static void set_entity(coordxy, coordxy, struct entity *); static const char *e_nam(struct entity *); static const char *E_phrase(struct entity *, const char *); -static boolean e_survives_at(struct entity *, int, int); +static boolean e_survives_at(struct entity *, coordxy, coordxy); static void e_died(struct entity *, int, int); static boolean automiss(struct entity *); static boolean e_missed(struct entity *, boolean); @@ -33,7 +33,7 @@ static boolean e_jumps(struct entity *); static void do_entity(struct entity *); boolean -is_pool(int x, int y) +is_pool(coordxy x, coordxy y) { schar ltyp; @@ -49,7 +49,7 @@ is_pool(int x, int y) } boolean -is_lava(int x, int y) +is_lava(coordxy x, coordxy y) { schar ltyp; @@ -62,7 +62,7 @@ is_lava(int x, int y) } boolean -is_pool_or_lava(int x, int y) +is_pool_or_lava(coordxy x, coordxy y) { if (is_pool(x, y) || is_lava(x, y)) { return TRUE; @@ -72,7 +72,7 @@ is_pool_or_lava(int x, int y) } boolean -is_any_icewall(int x, int y) +is_any_icewall(coordxy x, coordxy y) { if (!isok(x, y)) return FALSE; if (IS_ANY_ICEWALL(levl[x][y].typ)) @@ -81,7 +81,7 @@ is_any_icewall(int x, int y) } boolean -is_ice(int x, int y) +is_ice(coordxy x, coordxy y) { schar ltyp; @@ -94,7 +94,7 @@ is_ice(int x, int y) } boolean -is_swamp(int x, int y) +is_swamp(coordxy x, coordxy y) { schar ltyp; @@ -108,7 +108,7 @@ is_swamp(int x, int y) } boolean -is_moat(int x, int y) +is_moat(coordxy x, coordxy y) { schar ltyp; @@ -149,7 +149,7 @@ db_under_typ(struct rm *lev) */ int -is_drawbridge_wall(int x, int y) +is_drawbridge_wall(coordxy x, coordxy y) { struct rm *lev; @@ -179,7 +179,7 @@ is_drawbridge_wall(int x, int y) * (instead of UP or DOWN, as with is_drawbridge_wall). */ boolean -is_db_wall(int x, int y) +is_db_wall(coordxy x, coordxy y) { return((boolean)( levl[x][y].typ == DBWALL )); } @@ -189,7 +189,7 @@ is_db_wall(int x, int y) * a drawbridge or drawbridge wall. */ boolean -find_drawbridge(int *x, int *y) +find_drawbridge(coordxy *x, coordxy *y) { int dir; @@ -212,7 +212,7 @@ find_drawbridge(int *x, int *y) * Find the drawbridge wall associated with a drawbridge. */ static void -get_wall_for_db(int *x, int *y) +get_wall_for_db(coordxy *x, coordxy *y) { switch (levl[*x][*y].drawbridgemask & DB_DIR) { case DB_NORTH: (*y)--; break; @@ -228,7 +228,7 @@ get_wall_for_db(int *x, int *y) * flag must be put to TRUE if we want the drawbridge to be opened. */ boolean -create_drawbridge(int x, int y, int dir, int flag) +create_drawbridge(coordxy x, coordxy y, int dir, int flag) { int x2, y2; boolean horiz; @@ -287,7 +287,7 @@ struct entity { static NEARDATA struct entity occupants[ENTITIES]; static struct entity * -e_at(int x, int y) +e_at(coordxy x, coordxy y) { int entitycnt; @@ -305,7 +305,7 @@ e_at(int x, int y) } static void -m_to_e(struct monst *mtmp, int x, int y, struct entity *etmp) +m_to_e(struct monst *mtmp, coordxy x, coordxy y, struct entity *etmp) { etmp->emon = mtmp; if (mtmp) { @@ -329,7 +329,7 @@ u_to_e(struct entity *etmp) } static void -set_entity(int x, int y, struct entity *etmp) +set_entity(coordxy x, coordxy y, struct entity *etmp) { if ((x == u.ux) && (y == u.uy)) u_to_e(etmp); @@ -380,7 +380,7 @@ E_phrase(struct entity *etmp, const char *verb) * Simple-minded "can it be here?" routine */ static boolean -e_survives_at(struct entity *etmp, int x, int y) +e_survives_at(struct entity *etmp, coordxy x, coordxy y) { if (noncorporeal(etmp->edata)) return(TRUE); @@ -533,7 +533,8 @@ e_jumps(struct entity *etmp) static void do_entity(struct entity *etmp) { - int newx, newy, at_portcullis, oldx, oldy; + coordxy newx, newy, oldx, oldy; + int at_portcullis; boolean must_jump = FALSE, relocates = FALSE, e_inview; struct rm *crm; @@ -745,11 +746,11 @@ do_entity(struct entity *etmp) * @return TRUE when drawbridge got closed, FALSE otherwise */ boolean -close_drawbridge(int x, int y) +close_drawbridge(coordxy x, coordxy y) { struct rm *lev1, *lev2; struct trap *t; - int x2, y2; + coordxy x2, y2; lev1 = &levl[x][y]; if (lev1->typ != DRAWBRIDGE_DOWN) return FALSE; @@ -815,11 +816,11 @@ close_drawbridge(int x, int y) * Open the drawbridge located at x,y */ void -open_drawbridge(int x, int y) +open_drawbridge(coordxy x, coordxy y) { struct rm *lev1, *lev2; struct trap *t; - int x2, y2; + coordxy x2, y2; lev1 = &levl[x][y]; if (lev1->typ != DRAWBRIDGE_UP) return; @@ -859,12 +860,12 @@ open_drawbridge(int x, int y) * Let's destroy the drawbridge located at x,y */ void -destroy_drawbridge(int x, int y) +destroy_drawbridge(coordxy x, coordxy y) { struct rm *lev1, *lev2; struct trap *t; struct obj *otmp; - int x2, y2, i; + coordxy x2, y2, i; int db_u; boolean e_inview; struct entity *etmp1 = &(occupants[0]), *etmp2 = &(occupants[1]); diff --git a/src/detect.c b/src/detect.c index 378db0975..7c7aedef9 100644 --- a/src/detect.c +++ b/src/detect.c @@ -12,12 +12,12 @@ extern boolean known; /* from read.c */ static void do_dknown_of(struct obj *); -static boolean check_map_spot(int, int, char, unsigned); +static boolean check_map_spot(coordxy, coordxy, char, unsigned); static boolean clear_stale_map(char, unsigned); -static void sense_trap(struct trap *, xchar, xchar, int); -static void show_map_spot(int, int); -static void findone(int, int, genericptr_t); -static void openone(int, int, genericptr_t); +static void sense_trap(struct trap *, coordxy, coordxy, int); +static void show_map_spot(coordxy, coordxy); +static void findone(coordxy, coordxy, genericptr_t); +static void openone(coordxy, coordxy, genericptr_t); /* bring hero out from underwater or underground or being engulfed; return True iff any change occurred */ @@ -78,7 +78,7 @@ map_monst(struct monst *mtmp, boolean showtail) /* this is checking whether a trap symbol represents a trapped chest, not whether a trapped chest is actually present */ boolean -trapped_chest_at(int ttyp, int x, int y) +trapped_chest_at(int ttyp, coordxy x, coordxy y) { struct monst *mtmp; struct obj *otmp; @@ -132,7 +132,7 @@ trapped_chest_at(int ttyp, int x, int y) /* this is checking whether a trap symbol represents a trapped door, not whether the door here is actually trapped */ boolean -trapped_door_at(int ttyp, int x, int y) +trapped_door_at(int ttyp, coordxy x, coordxy y) { struct rm *lev; @@ -209,7 +209,7 @@ do_dknown_of(struct obj *obj) /* Check whether the location has an outdated object displayed on it. */ static boolean -check_map_spot(int x, int y, char oclass, unsigned int material) +check_map_spot(coordxy x, coordxy y, char oclass, unsigned int material) { int glyph; struct obj *otmp; @@ -817,7 +817,7 @@ monster_detect( } static void -sense_trap(struct trap *trap, xchar x, xchar y, int src_cursed) +sense_trap(struct trap *trap, coordxy x, coordxy y, int src_cursed) { if (Hallucination || src_cursed) { struct obj obj; /* fake object */ @@ -865,7 +865,7 @@ detect_obj_traps( int how) /**< 1 for misleading map feedback */ { struct obj *otmp; - xchar x, y; + coordxy x, y; int result = OTRAP_NONE; /* @@ -1170,7 +1170,7 @@ use_crystal_ball(struct obj **optr) } static void -show_map_spot(int x, int y) +show_map_spot(coordxy x, coordxy y) { struct rm *lev; struct trap *t; @@ -1278,7 +1278,7 @@ cvt_sdoor_to_door(struct rm *lev) /* find something at one location; it should find all somethings there since it is used for magical detection rather than physical searching */ static void -findone(int zx, int zy, genericptr_t num) +findone(coordxy zx, coordxy zy, genericptr_t num) { struct trap *ttmp; struct monst *mtmp; @@ -1334,7 +1334,7 @@ findone(int zx, int zy, genericptr_t num) } static void -openone(int zx, int zy, genericptr_t num) +openone(coordxy zx, coordxy zy, genericptr_t num) { struct trap *ttmp; struct obj *otmp; @@ -1416,7 +1416,7 @@ openit(void) /* callback hack for overriding vision in do_clear_area() */ boolean -detecting(void (*func) (int, int, void *)) +detecting(void (*func)(coordxy, coordxy, genericptr_t)) { return (func == findone || func == openone); } @@ -1506,9 +1506,9 @@ dosearch0(int aflag) /**< intrinsic autosearch vs explicit searching */ #define GCC_BUG in *conf.h (or adding -DGCC_BUG to CFLAGS in the makefile). */ - volatile xchar x, y; + volatile coordxy x, y; #else - xchar x, y; + coordxy x, y; #endif struct trap *trap; struct monst *mtmp; @@ -1639,7 +1639,7 @@ sokoban_detect(void) } static int -reveal_terrain_getglyph(int x, int y, int full, unsigned int swallowed, int default_glyph, int which_subset) +reveal_terrain_getglyph(coordxy x, coordxy y, int full, unsigned int swallowed, int default_glyph, int which_subset) { int glyph, levl_glyph; uchar seenv; diff --git a/src/dig.c b/src/dig.c index 71980e141..664a417be 100644 --- a/src/dig.c +++ b/src/dig.c @@ -6,7 +6,7 @@ static NEARDATA boolean did_dig_msg; static boolean rm_waslit(void); -static void mkcavepos(xchar, xchar, int, boolean, boolean); +static void mkcavepos(coordxy, coordxy, int, boolean, boolean); static void mkcavearea(boolean); static int dig(void); static int adj_pit_checks(coord *, char *); @@ -34,7 +34,7 @@ enum dig_types { static boolean rm_waslit(void) { - xchar x, y; + coordxy x, y; if (levl[u.ux][u.uy].typ == ROOM && levl[u.ux][u.uy].waslit) { return TRUE; @@ -53,7 +53,7 @@ rm_waslit(void) * immediately after the effect is complete. */ static void -mkcavepos(xchar x, xchar y, int dist, boolean waslit, boolean rockit) +mkcavepos(coordxy x, coordxy y, int dist, boolean waslit, boolean rockit) { struct rm *lev; @@ -105,9 +105,9 @@ static void mkcavearea(boolean rockit) { int dist; - xchar xmin = u.ux, xmax = u.ux; - xchar ymin = u.uy, ymax = u.uy; - xchar i; + coordxy xmin = u.ux, xmax = u.ux; + coordxy ymin = u.uy, ymax = u.uy; + coordxy i; boolean waslit = rm_waslit(); if (rockit) { @@ -155,7 +155,7 @@ mkcavearea(boolean rockit) /* When digging into location , what are you actually digging into? */ int -dig_typ(struct obj *otmp, xchar x, xchar y) +dig_typ(struct obj *otmp, coordxy x, coordxy y) { boolean ispick; @@ -193,7 +193,7 @@ is_digging(void) #define BY_OBJECT ((struct monst *)0) boolean -dig_check(struct monst *madeby, boolean verbose, int x, int y) +dig_check(struct monst *madeby, boolean verbose, coordxy x, coordxy y) { struct trap *ttmp = t_at(x, y); const char *verb = (madeby == BY_YOU && uwep && is_axe(uwep)) ? "chop" : "dig in"; @@ -267,7 +267,7 @@ static int dig(void) { struct rm *lev; - xchar dpx = digging.pos.x, dpy = digging.pos.y; + coordxy dpx = digging.pos.x, dpy = digging.pos.y; boolean ispick = uwep && is_pick(uwep); const char *verb = (!uwep || is_pick(uwep)) ? "dig into" : "chop through"; @@ -630,7 +630,7 @@ fillholetyp( } void -digactualhole(int x, int y, struct monst *madeby, int ttyp) +digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp) { struct obj *oldobjs, *newobjs; struct trap *ttmp; @@ -665,7 +665,7 @@ digactualhole(int x, int y, struct monst *madeby, int ttyp) #endif } else if (lev->typ == DRAWBRIDGE_DOWN || (is_drawbridge_wall(x, y) >= 0)) { - int bx = x, by = y; + coordxy bx = x, by = y; /* if under the portcullis, the bridge is adjacent */ (void) find_drawbridge(&bx, &by); destroy_drawbridge(bx, by); @@ -852,7 +852,7 @@ digactualhole(int x, int y, struct monst *madeby, int ttyp) * in apply.c. */ void -liquid_flow(xchar x, xchar y, schar typ, struct trap *ttmp, const char *fillmsg) +liquid_flow(coordxy x, coordxy y, schar typ, struct trap *ttmp, const char *fillmsg) { boolean u_spot = (x == u.ux && y == u.uy); @@ -882,7 +882,7 @@ dighole(boolean pit_only, boolean by_magic, coord *cc) struct rm *lev; struct obj *boulder_here; schar typ; - xchar dig_x, dig_y; + coordxy dig_x, dig_y; boolean nohole; if (!cc) { @@ -923,7 +923,7 @@ dighole(boolean pit_only, boolean by_magic, coord *cc) pline_The("drawbridge seems too hard to dig through."); return FALSE; } else { - int x = dig_x, y = dig_y; + coordxy x = dig_x, y = dig_y; /* if under the portcullis, the bridge is adjacent */ (void) find_drawbridge(&x, &y); destroy_drawbridge(x, y); @@ -1031,7 +1031,7 @@ static void dig_up_grave(coord *cc, enum grave_type type) { struct obj *otmp; - xchar dig_x, dig_y; + coordxy dig_x, dig_y; if (!cc) { dig_x = u.ux; @@ -1385,7 +1385,7 @@ use_pick_axe2(struct obj *obj) * zap == TRUE if wand/spell of digging, FALSE otherwise (chewing) */ void -watch_dig(struct monst *mtmp, xchar x, xchar y, boolean zap) +watch_dig(struct monst *mtmp, coordxy x, coordxy y, boolean zap) { struct rm *lev = &levl[x][y]; @@ -2136,7 +2136,7 @@ bury_an_obj( } void -bury_objs(int x, int y) +bury_objs(coordxy x, coordxy y) { struct obj *otmp, *otmp2; struct monst *shkp; @@ -2171,7 +2171,7 @@ bury_objs(int x, int y) /* move objects from buriedobjlist to fobj/nexthere lists */ void -unearth_objs(int x, int y) +unearth_objs(coordxy x, coordxy y) { struct obj *otmp, *otmp2, *bball; coord cc; @@ -2234,7 +2234,7 @@ rot_organic(anything *arg, long int timeout UNUSED) void rot_corpse(anything *arg, long int timeout UNUSED) { - xchar x = 0, y = 0; + coordxy x = 0, y = 0; struct obj *obj = arg->a_obj; boolean on_floor = obj->where == OBJ_FLOOR; boolean in_invent = obj->where == OBJ_INVENT; diff --git a/src/display.c b/src/display.c index 7bd703a30..d67fbe8b6 100644 --- a/src/display.c +++ b/src/display.c @@ -122,22 +122,22 @@ */ #include "hack.h" -static void show_mon_or_warn(int, int, int); -static void display_monster(xchar, xchar, struct monst *, int, xchar); +static void show_mon_or_warn(coordxy, coordxy, int); +static void display_monster(coordxy, coordxy, struct monst *, int, coordxy); static int swallow_to_glyph(int, int); static void display_warning(struct monst *); -static int check_pos(int, int, int); -static int get_bk_glyph(xchar, xchar); -static int tether_glyph(int, int); +static int check_pos(coordxy, coordxy, int); +static int get_bk_glyph(coordxy, coordxy); +static int tether_glyph(coordxy, coordxy); #ifdef WA_VERBOSE static boolean more_than_one(int, int, int, int, int); #endif static int set_twall(int, int, int, int, int, int, int, int); -static int set_wall(int, int, int); +static int set_wall(coordxy, coordxy, int); static int set_corn(int, int, int, int, int, int, int, int); -static int set_crosswall(int, int); -static void set_seenv(struct rm *, int, int, int, int); +static int set_crosswall(coordxy, coordxy); +static void set_seenv(struct rm *, int, int, coordxy, coordxy); static void t_warn(struct rm *); static int wall_angle(struct rm *); @@ -155,7 +155,7 @@ is_safemon(struct monst *mon) * attention to and correct unexplored, lit ROOM and CORR spots. */ void -magic_map_background(xchar x, xchar y, int show) +magic_map_background(coordxy x, coordxy y, int show) { int glyph = back_to_glyph(x, y); /* assumes hero can see x,y */ struct rm *lev = &levl[x][y]; @@ -199,7 +199,7 @@ magic_map_background(xchar x, xchar y, int show) * the hero can physically see the location. Update the screen if directed. */ void -map_background(xchar x, xchar y, int show) +map_background(coordxy x, coordxy y, int show) { int glyph = back_to_glyph(x, y); @@ -264,7 +264,7 @@ map_object(struct obj *obj, int show) * by newsym() if necessary. */ void -map_invisible(xchar x, xchar y) +map_invisible(coordxy x, coordxy y) { assert_valid_coordinates(x, y); @@ -276,7 +276,7 @@ map_invisible(xchar x, xchar y) } boolean -unmap_invisible(int x, int y) +unmap_invisible(coordxy x, coordxy y) { if (isok(x,y) && glyph_is_invisible(levl[x][y].glyph)) { unmap_object(x, y); @@ -296,7 +296,7 @@ unmap_invisible(int x, int y) * to call newsym(). */ void -unmap_object(int x, int y) +unmap_object(coordxy x, coordxy y) { struct trap *trap; @@ -326,7 +326,7 @@ unmap_object(int x, int y) * at location (x,y). */ struct obj * -vobj_at(int x, int y) +vobj_at(coordxy x, coordxy y) { assert_valid_coordinates(x, y); @@ -356,7 +356,7 @@ vobj_at(int x, int y) } void -map_location(int x, int y, int show) +map_location(coordxy x, coordxy y, int show) { assert_valid_coordinates(x, y); _map_location(x, y, show); @@ -364,7 +364,7 @@ map_location(int x, int y, int show) /* display something on monster layer; may need to fixup object layer */ static void -show_mon_or_warn(int x, int y, int monglyph) +show_mon_or_warn(coordxy x, coordxy y, int monglyph) { struct obj *o; @@ -397,7 +397,7 @@ show_mon_or_warn(int x, int y, int monglyph) * */ static void -display_monster(xchar x, xchar y, /**< display position */ +display_monster(coordxy x, coordxy y, /**< display position */ struct monst *mon, /**< monster to display */ int sightflags, /**< 1 if the monster is physically seen; 2 if detected using Detect_monsters */ @@ -557,7 +557,7 @@ warning_of(struct monst *mon) * When hero knows what happened to location, even when blind. */ void -feel_newsym(xchar x, xchar y) +feel_newsym(coordxy x, coordxy y) { if (Blind) { feel_location(x, y); @@ -577,7 +577,7 @@ feel_newsym(xchar x, xchar y) * searching only finds one monster per turn so we must check that separately. */ void -feel_location(xchar x, xchar y) +feel_location(coordxy x, coordxy y) { struct rm *lev; struct obj *boulder; @@ -744,12 +744,12 @@ feel_location(xchar x, xchar y) * Possibly put a new glyph at the given location. */ void -newsym(int x, int y) +newsym(coordxy x, coordxy y) { struct monst *mon; struct rm *lev = &(levl[x][y]); int see_it; - xchar worm_tail; + coordxy worm_tail; if (in_mklev) return; @@ -909,7 +909,7 @@ newsym(int x, int y) * pulled into a platform dependent routine for fancier graphics if desired. */ void -shieldeff(xchar x, xchar y) +shieldeff(coordxy x, coordxy y) { int i; @@ -925,7 +925,7 @@ shieldeff(xchar x, xchar y) } static int -tether_glyph(int x, int y) +tether_glyph(coordxy x, coordxy y) { int tdx, tdy; tdx = u.ux - x; @@ -970,7 +970,7 @@ static struct tmp_glyph { } tgfirst; void -tmp_at(int x, int y) +tmp_at(coordxy x, coordxy y) { static struct tmp_glyph *tglyph = (struct tmp_glyph *)0; struct tmp_glyph *tmp; @@ -1101,7 +1101,7 @@ tmp_at(int x, int y) * meant to be at the location. */ void -flash_glyph_at(int x, int y, int tg, int rpt) +flash_glyph_at(coordxy x, coordxy y, int tg, int rpt) { int i, glyph[2]; @@ -1129,7 +1129,7 @@ flash_glyph_at(int x, int y, int tg, int rpt) void swallowed(int first) { - static xchar lastx, lasty; /* last swallowed position */ + static coordxy lastx, lasty; /* last swallowed position */ int swallower, left_ok, rght_ok; if (first) { @@ -1187,7 +1187,7 @@ swallowed(int first) void under_water(int mode) { - static xchar lastx, lasty; + static coordxy lastx, lasty; static boolean dela; int x, y; @@ -1470,7 +1470,7 @@ redraw_map(void) /* Glyph Buffering (3rd screen) ============================================ */ typedef struct { - xchar new; /* perhaps move this bit into the rm strucure. */ + coordxy new; /* perhaps move this bit into the rm strucure. */ int glyph; } gbuf_entry; @@ -1482,7 +1482,7 @@ static char gbuf_stop[ROWNO]; * between object piles and single objects, it doesn't mark the location * for update. */ void -newsym_force(int x, int y) +newsym_force(coordxy x, coordxy y) { newsym(x,y); gbuf[y][x].new = 1; @@ -1497,7 +1497,7 @@ newsym_force(int x, int y) * Store the glyph in the 3rd screen for later flushing. */ void -show_glyph(int x, int y, int glyph) +show_glyph(coordxy x, coordxy y, int glyph) { /* * Check for bad positions and glyphs. @@ -1914,7 +1914,7 @@ dump_screen(void) * variables. */ int -back_to_glyph(xchar x, xchar y) +back_to_glyph(coordxy x, coordxy y) { assert_valid_coordinates(x, y); @@ -2061,7 +2061,7 @@ zapdir_to_glyph(int dx, int dy, int beam_type) * structure, so we must check the "third screen". */ int -glyph_at(xchar x, xchar y) +glyph_at(coordxy x, coordxy y) { if(x < 0 || y < 0 || x >= COLNO || y >= ROWNO) return cmap_to_glyph(S_room); /* XXX */ @@ -2082,7 +2082,7 @@ glyph_at(xchar x, xchar y) */ static int -get_bk_glyph(xchar x, xchar y) +get_bk_glyph(coordxy x, coordxy y) { assert_valid_coordinates(x, y); @@ -2197,7 +2197,7 @@ int x, y, a, b, c, dd; * Things that are ambigious: lava */ static int -check_pos(int x, int y, int which) +check_pos(coordxy x, coordxy y, int which) { int type; if (!isok(x, y)) return which; @@ -2248,7 +2248,7 @@ set_twall(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) /* Return wall mode for a horizontal or vertical wall. */ static int -set_wall(int x, int y, int horiz) +set_wall(coordxy x, coordxy y, int horiz) { int wmode, is_1, is_2; @@ -2298,7 +2298,7 @@ set_corn(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) /* Return mode for a crosswall. */ static int -set_crosswall(int x, int y) +set_crosswall(coordxy x, coordxy y) { int wmode, is_1, is_2, is_3, is_4; @@ -2418,7 +2418,7 @@ static void set_seenv( struct rm *lev, int x0, int y0, /**< from */ - int x, int y) /**< to */ + coordxy x, coordxy y) /**< to */ { int dx = x-x0, dy = y0-y; lev->seenv |= seenv_matrix[sign(dy)+1][sign(dx)+1]; diff --git a/src/do.c b/src/do.c index 73e75a3fa..7ed666511 100644 --- a/src/do.c +++ b/src/do.c @@ -20,7 +20,7 @@ static int wipeoff(void); static int menu_drop(int); static int currentlevel_rewrite(void); static void final_level(void); -/* static boolean badspot(xchar,xchar); */ +/* static boolean badspot(coordxy,coordxy); */ static boolean unique_item_check(void); static void levelport_monsters(void); @@ -133,7 +133,7 @@ boulder_hits_pool(struct obj *otmp, int rx, int ry, boolean pushing) * away. */ boolean -flooreffects(struct obj *obj, int x, int y, const char *verb) +flooreffects(struct obj *obj, coordxy x, coordxy y, const char *verb) { struct trap *t; struct monst *mtmp; @@ -1257,7 +1257,7 @@ save_currentstate(void) /* static boolean badspot(x, y) - xchar x, y; + coordxy x, y; { return((levl[x][y].typ != ROOM && levl[x][y].typ != AIR && levl[x][y].typ != CORR) || MON_AT(x, y)); @@ -1311,7 +1311,7 @@ void goto_level(d_level *newlevel, boolean at_stairs, boolean falling, boolean portal) { int fd, l_idx; - xchar new_ledger; + xint16 new_ledger; boolean cant_go_back, up = (depth(newlevel) < depth(&u.uz)), newdungeon = (u.uz.dnum != newlevel->dnum), @@ -1511,7 +1511,7 @@ goto_level(d_level *newlevel, boolean at_stairs, boolean falling, boolean portal } else { if (newdungeon) { if (Is_stronghold(&u.uz)) { - xchar x, y; + coordxy x, y; int trycnt = 0; do { @@ -1958,7 +1958,7 @@ revive_corpse(struct obj *corpse) { struct monst *mtmp = 0, *mcarry; boolean is_uwep, chewed; - xchar where; + xint16 where; char cname[BUFSZ]; struct obj *container = (struct obj *)0; int container_where = 0; diff --git a/src/do_name.c b/src/do_name.c index cfe93e936..4c3a8f4b0 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -28,10 +28,10 @@ nextmbuf(void) * parameter value 0 = initialize, 1 = highlight, 2 = done */ static void (*getpos_hilitefunc)(int) = (void (*)(int)) 0; -static boolean (*getpos_getvalid)(int, int) = (boolean (*)(int, int)) 0; +static boolean (*getpos_getvalid)(coordxy, coordxy) = (boolean (*)(coordxy, coordxy)) 0; void -getpos_sethilite(void (*gp_hilitef) (int), boolean (*gp_getvalidf) (int, int)) +getpos_sethilite(void (*gp_hilitef) (int), boolean (*gp_getvalidf) (coordxy, coordxy)) { getpos_hilitefunc = gp_hilitef; getpos_getvalid = gp_getvalidf; @@ -347,7 +347,7 @@ gloc_filter_classify_glyph(int glyph) } static int -gloc_filter_floodfill_matcharea(int x, int y) +gloc_filter_floodfill_matcharea(coordxy x, coordxy y) { int glyph = back_to_glyph(x, y); @@ -367,7 +367,7 @@ gloc_filter_floodfill_matcharea(int x, int y) } void -gloc_filter_floodfill(int x, int y) +gloc_filter_floodfill(coordxy x, coordxy y) { gloc_filter_floodfill_match_glyph = back_to_glyph(x, y); @@ -408,7 +408,7 @@ gloc_filter_done(void) } static boolean -gather_locs_interesting(int x, int y, int gloc) +gather_locs_interesting(coordxy x, coordxy y, int gloc) { /* TODO: if glyph is a pile glyph, convert to ordinary one * in order to keep tail/boulder/rock check simple. @@ -496,7 +496,8 @@ gather_locs_interesting(int x, int y, int gloc) static void gather_locs(coord **arr_p, int *cnt_p, int gloc) { - int x, y, pass, idx; + int pass, idx; + coordxy x, y; /* * We always include the hero's location even if there is no monster @@ -577,7 +578,7 @@ dxdy_to_dist_descr(int dx, int dy, boolean fulldir) /* coordinate formatting for 'whatis_coord' option */ char * -coord_desc(int x, int y, char *outbuf, char cmode) +coord_desc(coordxy x, coordxy y, char *outbuf, char cmode) { static char screen_fmt[16]; /* [12] suffices: "[%02d,%02d]" */ int dx, dy; @@ -731,7 +732,8 @@ getpos(coord *ccp, boolean force, const char *goal) char mMoOdDxX[NUM_GLOCS*2 + 1]; int result = 0; int cx, cy, i, c; - int sidx, tx, ty; + int sidx; + coordxy tx = u.ux, ty = u.uy; boolean msg_given = TRUE; /* clear message window by default */ boolean show_goal_msg = FALSE; boolean hilite_state = FALSE; @@ -1073,7 +1075,7 @@ getpos(coord *ccp, boolean force, const char *goal) } } getpos_hilitefunc = (void (*)(int)) 0; - getpos_getvalid = (boolean (*)(int, int)) 0; + getpos_getvalid = (boolean (*)(coordxy, coordxy)) 0; return result; } diff --git a/src/dog.c b/src/dog.c index fe1c744b7..cfc966a83 100644 --- a/src/dog.c +++ b/src/dog.c @@ -74,7 +74,7 @@ pet_type(void) } struct monst * -make_familiar(struct obj *otmp, xchar x, xchar y, boolean quietly) +make_familiar(struct obj *otmp, coordxy x, coordxy y, boolean quietly) { struct permonst *pm; struct monst *mtmp = 0; @@ -343,7 +343,8 @@ void mon_arrive(struct monst *mtmp, boolean with_you) { struct trap *t; - xchar xlocale, ylocale, xyloc, xyflags, wander; + coordxy xlocale, ylocale, xyloc, xyflags; + xint16 wander; int num_segs; boolean failed_to_place = FALSE; @@ -406,7 +407,7 @@ mon_arrive(struct monst *mtmp, boolean with_you) mtmp->mlstmv = monstermoves - 1L; /* let monster move a bit on new level (see placement code below) */ - wander = (xchar) min(nmv, 8); + wander = (xint16) min(nmv, 8); } else { wander = 0; } @@ -738,13 +739,13 @@ keepdogs(boolean pets_only) /**< TRUE for ascension or final escape */ void migrate_to_level( struct monst *mtmp, - xchar tolev, /**< destination level */ - xchar xyloc, /**< MIGR_xxx destination xy location: */ + xint16 tolev, /**< destination level */ + xint16 xyloc, /**< MIGR_xxx destination xy location: */ coord *cc) /**< optional destination coordinates */ { struct obj *obj; d_level new_lev; - xchar xyflags; + coordxy xyflags; int num_segs = 0; /* count of worm segments */ if (mtmp->isshk) @@ -773,8 +774,8 @@ migrate_to_level( } relmon(mtmp, &migrating_mons); /* move it from map to migrating_mons */ - new_lev.dnum = ledger_to_dnum((xchar)tolev); - new_lev.dlevel = ledger_to_dlev((xchar)tolev); + new_lev.dnum = ledger_to_dnum((xint16)tolev); + new_lev.dlevel = ledger_to_dlev((xint16)tolev); /* overload mtmp->[mx,my], mtmp->[mux,muy], and mtmp->mtrack[] as */ /* destination codes (setup flag bits before altering mx or my) */ xyflags = (depth(&new_lev) < depth(&u.uz)); /* 1 => up */ diff --git a/src/dogmove.c b/src/dogmove.c index 4b0795183..e5adadb25 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -16,8 +16,8 @@ static int find_friends(struct monst *, struct monst *, int); static struct monst *best_target(struct monst *); static long score_targ(struct monst *, struct monst *); -static boolean can_reach_location(struct monst *, xchar, xchar, xchar, xchar); -static boolean could_reach_item(struct monst *, xchar, xchar); +static boolean can_reach_location(struct monst *, coordxy, coordxy, coordxy, coordxy); +static boolean could_reach_item(struct monst *, coordxy, coordxy); static void quickmimic(struct monst *); /* pick a carried item for pet to drop */ @@ -136,12 +136,12 @@ droppables(struct monst *mon) static NEARDATA const char nofetch[] = { BALL_CLASS, CHAIN_CLASS, ROCK_CLASS, 0 }; -static xchar gtyp, gx, gy; /* type and position of dog's current goal */ +static coordxy gtyp, gx, gy; /* type and position of dog's current goal */ -static void wantdoor(int, int, genericptr_t); +static void wantdoor(coordxy, coordxy, genericptr_t); boolean -cursed_object_at(int x, int y) +cursed_object_at(coordxy x, coordxy y) { struct obj *otmp; @@ -199,7 +199,7 @@ dog_nutrition(struct monst *mtmp, struct obj *obj) /* returns 2 if pet dies, otherwise 1 */ int -dog_eat(struct monst *mtmp, struct obj *obj, int x, int y, boolean devour) +dog_eat(struct monst *mtmp, struct obj *obj, coordxy x, coordxy y, boolean devour) /* if unpaid, then thrown or kicked by hero */ /* dog's starting location, might be different from current */ @@ -501,7 +501,7 @@ dog_goal(struct monst *mtmp, struct edog *edog, int after, int udist, int whappr int omx, omy; boolean in_masters_sight, dog_has_minvent; struct obj *obj; - xchar otyp; + xint16 otyp; int appr; /* Steeds don't move on their own will */ @@ -900,12 +900,12 @@ dog_move(struct monst *mtmp, int i, j, k; struct edog *edog = EDOG(mtmp); struct obj *obj = (struct obj *) 0; - xchar otyp; + xint16 otyp; boolean has_edog, cursemsg[9], do_eat = FALSE; boolean better_with_displacing = FALSE; - xchar nix, niy; /* position mtmp is (considering) moving to */ + coordxy nix, niy; /* position mtmp is (considering) moving to */ int nx, ny; /* temporary coordinates */ - xchar cnt, uncursedcnt, chcnt; + xint16 cnt, uncursedcnt, chcnt; int chi = -1, nidist, ndist; coord poss[9]; long info[9], allowflags; @@ -1303,7 +1303,7 @@ nxti: ; /* check if a monster could pick up objects from a location */ static boolean -could_reach_item(struct monst *mon, xchar nx, xchar ny) +could_reach_item(struct monst *mon, coordxy nx, coordxy ny) { if ((!is_pool(nx, ny) || is_swimmer(mon->data)) && (!is_lava(nx, ny) || likes_lava(mon->data)) && @@ -1320,7 +1320,7 @@ could_reach_item(struct monst *mon, xchar nx, xchar ny) * deep. */ static boolean -can_reach_location(struct monst *mon, xchar mx, xchar my, xchar fx, xchar fy) +can_reach_location(struct monst *mon, coordxy mx, coordxy my, coordxy fx, coordxy fy) { int i, j; int dist; @@ -1352,7 +1352,7 @@ can_reach_location(struct monst *mon, xchar mx, xchar my, xchar fx, xchar fy) /* do_clear_area client */ static void -wantdoor(int x, int y, genericptr_t distance) +wantdoor(coordxy x, coordxy y, genericptr_t distance) { int ndist; diff --git a/src/dokick.c b/src/dokick.c index 55c9735e6..10b113518 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -13,11 +13,11 @@ static NEARDATA const char *gate_str; extern boolean notonhead; /* for long worms */ static void kickdmg(struct monst *, boolean); -static boolean maybe_kick_monster(struct monst *, xchar, xchar); -static void kick_monster(struct monst *, xchar, xchar); +static boolean maybe_kick_monster(struct monst *, coordxy, coordxy); +static void kick_monster(struct monst *, coordxy, coordxy); static void lawful_bribery_alignment(schar); -static int kick_object(xchar, xchar, char *); -static int kick_object_core(xchar, xchar); +static int kick_object(coordxy, coordxy, char *); +static int kick_object_core(coordxy, coordxy); static char *kickstr(char *, const char *); static void otransit_msg(struct obj *, boolean, long); static void drop_to(coord *, schar); @@ -118,7 +118,7 @@ kickdmg(struct monst *mon, boolean clumsy) } static boolean -maybe_kick_monster(struct monst *mon, xchar x, xchar y) +maybe_kick_monster(struct monst *mon, coordxy x, coordxy y) { if (mon) { boolean save_forcefight = flags.forcefight; @@ -140,7 +140,7 @@ maybe_kick_monster(struct monst *mon, xchar x, xchar y) } static void -kick_monster(struct monst *mon, xchar x, xchar y) +kick_monster(struct monst *mon, coordxy x, coordxy y) { boolean clumsy = FALSE; int i, j; @@ -424,7 +424,7 @@ lawful_bribery_alignment(schar penalty) void container_impact_dmg( struct obj *obj, - xchar x, xchar y) /**< coordinates where object was before the impact, not after */ + coordxy x, coordxy y) /**< coordinates where object was before the impact, not after */ { struct monst *shkp; struct obj *otmp, *otmp2; @@ -491,7 +491,7 @@ container_impact_dmg( /* jacket around kick_object_core */ static int -kick_object(xchar x, xchar y, char *kickobjnam) +kick_object(coordxy x, coordxy y, char *kickobjnam) { int res = 0; @@ -509,7 +509,7 @@ kick_object(xchar x, xchar y, char *kickobjnam) /* guts of kick_object */ static int -kick_object_core(xchar x, xchar y) +kick_object_core(coordxy x, coordxy y) { int range; struct monst *mon, *shkp = 0; @@ -809,7 +809,7 @@ kickstr(char *buf, const char *kickobjnam) int dokick(void) { - int x, y; + coordxy x, y; int avrg_attrib; int dmg = 0, glyph, oldglyph = -1; struct monst *mtmp; @@ -1440,8 +1440,8 @@ drop_to(coord *cc, schar loc) void impact_drop( struct obj *missile, /**< caused impact, won't drop itself */ - xchar x, xchar y, /**< location affected */ - xchar dlev) /**< if !0 send to dlev near player */ + coordxy x, coordxy y, /**< location affected */ + xint16 dlev) /**< if !0 send to dlev near player */ { schar toloc; struct obj *obj, *obj2; @@ -1567,10 +1567,10 @@ impact_drop( * otmp is either a kicked, dropped, or thrown object. */ boolean -ship_object(struct obj *otmp, xchar x, xchar y, boolean shop_floor_obj) +ship_object(struct obj *otmp, coordxy x, coordxy y, boolean shop_floor_obj) { schar toloc; - xchar ox, oy; + coordxy ox, oy; coord cc; struct obj *obj; struct trap *t; @@ -1833,7 +1833,7 @@ otransit_msg(struct obj *otmp, boolean nodrop, long int num) /* migration destination for objects which fall down to next level */ schar -down_gate(xchar x, xchar y) +down_gate(coordxy x, coordxy y) { struct trap *ttmp; diff --git a/src/dothrow.c b/src/dothrow.c index 6da8a2713..b529bf694 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -11,11 +11,11 @@ static void autoquiver(void); static int gem_accept(struct monst *, struct obj *); static void tmiss(struct obj *, struct monst *, boolean); static int throw_gold(struct obj *); -static void check_shop_obj(struct obj *, xchar, xchar, boolean); +static void check_shop_obj(struct obj *, coordxy, coordxy, boolean); static void breakmsg(struct obj *, boolean); static boolean toss_up(struct obj *, boolean); static void sho_obj_return_to_u(struct obj *obj); -static boolean mhurtle_step(genericptr_t, int, int); +static boolean mhurtle_step(genericptr_t, coordxy, coordxy); static NEARDATA const char toss_objs[] = { ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, WEAPON_CLASS, 0 }; @@ -511,7 +511,11 @@ hitfloor( * before the failed callback. */ boolean -walk_path(coord *src_cc, coord *dest_cc, boolean (*check_proc) (genericptr_t, int, int), genericptr_t arg) +walk_path( + coord *src_cc, + coord *dest_cc, + boolean (*check_proc) (genericptr_t, coordxy, coordxy), + genericptr_t arg) { int x, y, dx, dy, x_change, y_change, err, i, prev_x, prev_y; boolean keep_going = TRUE; @@ -592,7 +596,7 @@ walk_path(coord *src_cc, coord *dest_cc, boolean (*check_proc) (genericptr_t, in vs drag-to-dest; original callers use first mode, jumping wants second, grappling hook backfire and thrown chained ball need third */ boolean -hurtle_jump(genericptr_t arg, int x, int y) +hurtle_jump(genericptr_t arg, coordxy x, coordxy y) { boolean res; long save_EWwalking = EWwalking; @@ -623,7 +627,7 @@ hurtle_jump(genericptr_t arg, int x, int y) * o let jumps go over boulders */ boolean -hurtle_step(genericptr_t arg, int x, int y) +hurtle_step(genericptr_t arg, coordxy x, coordxy y) { int ox, oy, *range = (int *)arg; struct obj *obj; @@ -749,7 +753,7 @@ hurtle_step(genericptr_t arg, int x, int y) /* Caller has already determined that dragging the ball is allowed */ if (Punished && uball->where == OBJ_FLOOR) { int bc_control; - xchar ballx, bally, chainx, chainy; + coordxy ballx, bally, chainx, chainy; boolean cause_delay; if (drag_ball(x, y, &bc_control, &ballx, &bally, &chainx, &chainy, &cause_delay, TRUE)) { @@ -825,7 +829,7 @@ hurtle_step(genericptr_t arg, int x, int y) } static boolean -mhurtle_step(genericptr_t arg, int x, int y) +mhurtle_step(genericptr_t arg, coordxy x, coordxy y) { struct monst *mon = (struct monst *)arg; @@ -943,7 +947,7 @@ mhurtle(struct monst *mon, int dx, int dy, int range) } static void -check_shop_obj(struct obj *obj, xchar x, xchar y, boolean broken) +check_shop_obj(struct obj *obj, coordxy x, coordxy y, boolean broken) { boolean costly_xy; struct monst *shkp = shop_keeper(*u.ushops); @@ -2055,7 +2059,7 @@ gem_accept(struct monst *mon, struct obj *obj) */ int hero_breaks(struct obj *obj, - xchar x, xchar y, /**< object location (ox, oy may not be right) */ + coordxy x, coordxy y, /**< object location (ox, oy may not be right) */ boolean from_invent) /**< thrown or dropped by player; maybe on shop bill */ { boolean in_view = Blind ? FALSE : (from_invent || cansee(x, y)); @@ -2072,7 +2076,7 @@ hero_breaks(struct obj *obj, * Return 0 if the object doesn't break, 1 if the object broke. */ int -breaks(struct obj *obj, xchar x, xchar y) +breaks(struct obj *obj, coordxy x, coordxy y) /* object location (ox, oy may not be right) */ { @@ -2089,7 +2093,7 @@ breaks(struct obj *obj, xchar x, xchar y) * and break messages have been delivered prior to getting here. */ void -breakobj(struct obj *obj, xchar x, xchar y, boolean hero_caused, boolean from_invent) +breakobj(struct obj *obj, coordxy x, coordxy y, boolean hero_caused, boolean from_invent) /* object location (ox, oy may not be right) */ /* is this the hero's fault? */ diff --git a/src/dungeon.c b/src/dungeon.c index 543366e65..17cc0d4a2 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -33,23 +33,23 @@ struct lchoice { int idx; schar lev[MAXLINFO]; schar playerlev[MAXLINFO]; - xchar dgn[MAXLINFO]; + xint16 dgn[MAXLINFO]; char menuletter; }; static void Fread(genericptr_t, int, int, dlb *); -static xchar dname_to_dnum(const char *); +static xint16 dname_to_dnum(const char *); static int find_branch(const char *, struct proto_dungeon *); static mapseen* find_level_by_custom_name(const char *); -static xchar parent_dnum(const char *, struct proto_dungeon *); -static int level_range(xchar, int, int, int, struct proto_dungeon *, int *); -static xchar parent_dlevel(const char *, struct proto_dungeon *); +static xint16 parent_dnum(const char *, struct proto_dungeon *); +static int level_range(xint16, int, int, int, struct proto_dungeon *, int *); +static xint16 parent_dlevel(const char *, struct proto_dungeon *); static int correct_branch_type(struct tmpbranch *); static branch *add_branch(int, int, struct proto_dungeon *); static void add_level(s_level *); static void init_level(int, int, struct proto_dungeon *); static int possible_places(int, boolean *, struct proto_dungeon *); -static xchar pick_level(boolean *, int); +static xint16 pick_level(boolean *, int); static boolean place_level(int, struct proto_dungeon *); #ifdef WIZARD static const char *br_string(int); @@ -66,7 +66,7 @@ static void save_mapseen(int, mapseen *); static mapseen *find_mapseen(d_level *); static void print_mapseen(winid, mapseen *, boolean, boolean, boolean); static boolean interest_mapseen(mapseen *, boolean); -static const char *seen_string(xchar, const char *); +static const char *seen_string(xint16, const char *); static const char *br_string2(branch *); #ifdef DEBUG @@ -240,17 +240,17 @@ Fread(genericptr_t ptr, int size, int nitems, dlb *stream) } } -static xchar +static xint16 dname_to_dnum(const char *s) { - xchar i; + xint16 i; for (i = 0; i < n_dgns; i++) if (!strcmp(dungeons[i].dname, s)) return i; panic("Couldn't resolve dungeon number for name \"%s\".", s); /*NOT REACHED*/ - return (xchar)0; + return (xint16)0; } s_level * @@ -346,13 +346,13 @@ find_branch(const char *s, struct proto_dungeon *pd) * Find the "parent" by searching the prototype branch list for the branch * listing, then figuring out to which dungeon it belongs. */ -static xchar +static xint16 parent_dnum(const char *s, struct proto_dungeon *pd) /* dungeon name */ { int i; - xchar pdnum; + xint16 pdnum; i = find_branch(s, pd); /* @@ -365,7 +365,7 @@ parent_dnum(const char *s, struct proto_dungeon *pd) panic("parent_dnum: couldn't resolve branch."); /*NOT REACHED*/ - return (xchar)0; + return (xint16)0; } /* @@ -379,7 +379,7 @@ parent_dnum(const char *s, struct proto_dungeon *pd) * end of the dungeon. */ static int -level_range(xchar dgn, int base, int rand, int chain, struct proto_dungeon *pd, int *adjusted_base) +level_range(xint16 dgn, int base, int rand, int chain, struct proto_dungeon *pd, int *adjusted_base) { int lmax = dungeons[dgn].num_dunlevs; @@ -407,7 +407,7 @@ level_range(xchar dgn, int base, int rand, int chain, struct proto_dungeon *pd, return 1; } -static xchar +static xint16 parent_dlevel(const char *s, struct proto_dungeon *pd) { int i, j, num, base, dnum = parent_dnum(s, pd); @@ -609,14 +609,17 @@ possible_places(int idx, boolean *map, struct proto_dungeon *pd) } /* Pick the nth TRUE entry in the given boolean array. */ -static xchar +static xint16 pick_level(boolean *map, int nth) /* an array MAXLEVEL+1 in size */ { int i; - for (i = 1; i <= MAXLEVEL; i++) - if (map[i] && !nth--) return (xchar) i; + for (i = 1; i <= MAXLEVEL; i++) { + if (map[i] && !nth--) { + return (xint16) i; + } + } panic("pick_level: ran out of valid levels"); return 0; } @@ -805,9 +808,9 @@ init_dungeons(void) dungeons[i].boneid = pd.tmpdungeon[i].boneschar; if(pd.tmpdungeon[i].lev.rand) - dungeons[i].num_dunlevs = (xchar)rn1(pd.tmpdungeon[i].lev.rand, + dungeons[i].num_dunlevs = (xint16)rn1(pd.tmpdungeon[i].lev.rand, pd.tmpdungeon[i].lev.base); - else dungeons[i].num_dunlevs = (xchar)pd.tmpdungeon[i].lev.base; + else dungeons[i].num_dunlevs = (xint16)pd.tmpdungeon[i].lev.base; if(!i) { dungeons[i].ledger_start = 0; @@ -1038,21 +1041,21 @@ shuffle_planes(void) #endif /* return the lowest level number for *this* dungeon */ -xchar +xint16 dunlev(d_level *lev) { return(lev->dlevel); } /* return the lowest level number for *this* dungeon */ -xchar +xint16 dunlevs_in_dungeon(d_level *lev) { return(dungeons[lev->dnum].num_dunlevs); } /* return the lowest level explored in the game*/ -xchar +xint16 deepest_lev_reached(boolean noquest) { /* this function is used for three purposes: to provide a factor @@ -1072,24 +1075,24 @@ deepest_lev_reached(boolean noquest) */ int i; d_level tmp; - schar ret = 0; + xint16 ret = 0; - for(i = 0; i < n_dgns; i++) { + for (i = 0; i < n_dgns; i++) { if((tmp.dlevel = dungeons[i].dunlev_ureached) == 0) continue; if(!strcmp(dungeons[i].dname, "The Quest") && noquest) continue; tmp.dnum = i; if(depth(&tmp) > ret) ret = depth(&tmp); } - return((xchar) ret); + return ret; } /* return a bookkeeping level number for purpose of comparisons and * save/restore */ -xchar +xint16 ledger_no(d_level *lev) { - return((xchar)(lev->dlevel + dungeons[lev->dnum].ledger_start)); + return (xint16) (lev->dlevel + dungeons[lev->dnum].ledger_start); } /* @@ -1102,35 +1105,35 @@ ledger_no(d_level *lev) * not be confused with deepest_lev_reached() -- which returns the lowest * depth visited by the player. */ -xchar +xint16 maxledgerno(void) { - return (xchar) (dungeons[n_dgns-1].ledger_start + - dungeons[n_dgns-1].num_dunlevs); + return (xint16) (dungeons[n_dgns-1].ledger_start + + dungeons[n_dgns-1].num_dunlevs); } /* return the dungeon that this ledgerno exists in */ -xchar -ledger_to_dnum(xchar ledgerno) +xint16 +ledger_to_dnum(xint16 ledgerno) { - int i; + xint16 i; /* find i such that (i->base + 1) <= ledgerno <= (i->base + i->count) */ for (i = 0; i < n_dgns; i++) if (dungeons[i].ledger_start < ledgerno && ledgerno <= dungeons[i].ledger_start + dungeons[i].num_dunlevs) - return (xchar)i; + return i; panic("level number out of range [ledger_to_dnum(%d)]", (int)ledgerno); /*NOT REACHED*/ - return (xchar)0; + return (xint16) 0; } /* return the level of the dungeon this ledgerno exists in */ -xchar -ledger_to_dlev(xchar ledgerno) +xint16 +ledger_to_dlev(xint16 ledgerno) { - return((xchar)(ledgerno - dungeons[ledger_to_dnum(ledgerno)].ledger_start)); + return (xint16) (ledgerno - dungeons[ledger_to_dnum(ledgerno)].ledger_start); } /* returns the depth of a level, in floors below the surface */ @@ -1226,7 +1229,7 @@ prev_level(boolean at_stairs) } void -u_on_newpos(int x, int y) +u_on_newpos(coordxy x, coordxy y) { /* validate location */ if (!isok(x, y)) { @@ -1320,7 +1323,7 @@ u_on_dnstairs(void) } boolean -On_stairs(xchar x, xchar y) +On_stairs(coordxy x, coordxy y) { return((boolean)((x == xupstair && y == yupstair) || (x == xdnstair && y == ydnstair) || @@ -1360,7 +1363,7 @@ Can_fall_thru(d_level *lev) * Checks for amulets and such must be done elsewhere. */ boolean -Can_rise_up(int x, int y, d_level *lev) +Can_rise_up(coordxy x, coordxy y, d_level *lev) { /* can't rise up from inside the top of the Wizard's tower */ /* KMH -- or in sokoban */ @@ -1393,7 +1396,7 @@ void get_level(d_level *newlevel, int levnum) { branch *br; - xchar dgn = u.uz.dnum; + xint16 dgn = u.uz.dnum; if (levnum <= 0) { /* can only currently happen in endgame */ @@ -1468,7 +1471,7 @@ branch * dungeon_branch(const char *s) { branch *br; - xchar dnum; + xint16 dnum; dnum = dname_to_dnum(s); @@ -1517,7 +1520,7 @@ On_W_tower_level(d_level *lev) /* is `lev' a level containing the Wizard's tow /* is of `lev' inside the Wizard's tower? */ boolean -In_W_tower(int x, int y, d_level *lev) +In_W_tower(coordxy x, coordxy y, d_level *lev) { if (!On_W_tower_level(lev)) return FALSE; /* @@ -1604,20 +1607,20 @@ Invocation_lev(d_level *lev) /* use instead of depth() wherever a degree of difficulty is made * dependent on the location in the dungeon (eg. monster creation). */ -xchar +xint16 level_difficulty(void) { if (In_sokoban(&u.uz)) { - return (xchar)depth(&oracle_level)+1; + return (xint16)depth(&oracle_level)+1; } if (In_endgame(&u.uz)) - return((xchar)(depth(&sanctum_level) + u.ulevel/2)); + return ((xint16)(depth(&sanctum_level) + u.ulevel/2)); else if (u.uhave.amulet) - return(deepest_lev_reached(FALSE)); + return (deepest_lev_reached(FALSE)); else - return((xchar) depth(&u.uz)); + return ((xint16) depth(&u.uz)); } /* Take one word and try to match it to a level. @@ -1824,7 +1827,7 @@ print_branch(winid win, int dnum, int lower_bound, int upper_bound, boolean byme /* Print available dungeon information. */ schar -print_dungeon(boolean bymenu, schar *rlev, xchar *rdgn) +print_dungeon(boolean bymenu, schar *rlev, xint16 *rdgn) { int i, last_level, nlev; char buf[BUFSZ]; @@ -2706,7 +2709,7 @@ dumpoverview(void) #endif static const char * -seen_string(xchar x, const char *obj) +seen_string(xint16 x, const char *obj) { /* players are computer scientists: 0, 1, 2, n */ switch(x) { diff --git a/src/engrave.c b/src/engrave.c index 10e92ccad..354c66ed9 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -232,21 +232,21 @@ can_reach_floor(boolean check_pit) } void -You_cant_reach_the_floor(int x, int y, boolean check_pit) +You_cant_reach_the_floor(coordxy x, coordxy y, boolean check_pit) { You("can't reach the %s.", (check_pit && can_reach_floor(FALSE)) ? "bottom of the pit" : surface(x, y)); } void -You_cant_reach_the_ceiling(int x, int y) +You_cant_reach_the_ceiling(coordxy x, coordxy y) { You("can't reach the %s.", ceiling(x, y)); } /* give a message after caller has determined that hero can't reach */ void -cant_reach_floor(int x, int y, boolean up, boolean check_pit) +cant_reach_floor(coordxy x, coordxy y, boolean up, boolean check_pit) { You("can't reach the %s.", up ? ceiling(x, y) @@ -256,7 +256,7 @@ cant_reach_floor(int x, int y, boolean up, boolean check_pit) } const char * -surface(int x, int y) +surface(coordxy x, coordxy y) { struct rm *lev = &levl[x][y]; @@ -289,7 +289,7 @@ surface(int x, int y) } const char * -ceiling(int x, int y) +ceiling(coordxy x, coordxy y) { struct rm *lev = &levl[x][y]; const char *what; @@ -317,7 +317,7 @@ ceiling(int x, int y) } struct engr * -engr_at(xchar x, xchar y) +engr_at(coordxy x, coordxy y) { struct engr *ep = head_engr; @@ -336,7 +336,7 @@ engr_at(xchar x, xchar y) * Returns the type of engraving. */ int -sengr_at(const char *s, xchar x, xchar y) +sengr_at(const char *s, coordxy x, coordxy y) { struct engr *ep = engr_at(x, y); @@ -358,7 +358,7 @@ sengr_at(const char *s, xchar x, xchar y) */ static unsigned -nengr_at(xchar x, xchar y) +nengr_at(coordxy x, coordxy y) { const char *s = "Elbereth"; struct engr *ep = engr_at(x, y); @@ -386,7 +386,7 @@ u_wipe_engr(int cnt) } void -wipe_engr_at(xchar x, xchar y, xchar cnt) +wipe_engr_at(coordxy x, coordxy y, xint16 cnt) { struct engr *ep = engr_at(x, y); @@ -405,7 +405,7 @@ wipe_engr_at(xchar x, xchar y, xchar cnt) } void -read_engr_at(int x, int y) +read_engr_at(coordxy x, coordxy y) { struct engr *ep = engr_at(x, y); int sensed = 0; @@ -484,7 +484,7 @@ read_engr_at(int x, int y) } void -make_engr_at(int x, int y, const char *s, long int e_time, xchar e_type) +make_engr_at(coordxy x, coordxy y, const char *s, long int e_time, xint16 e_type) { struct engr *ep; size_t smem = strlen(s) + 1; @@ -510,7 +510,7 @@ make_engr_at(int x, int y, const char *s, long int e_time, xchar e_type) /* delete any engraving at location */ void -del_engr_at(int x, int y) +del_engr_at(coordxy x, coordxy y) { struct engr *ep = engr_at(x, y); @@ -591,8 +591,8 @@ engrave(const char *engraving, boolean fingers) boolean ptext = TRUE; /* TRUE if we must prompt for engrave text */ boolean teleengr =FALSE;/* TRUE if we move the old engraving */ boolean zapwand = FALSE;/* TRUE if we remove a wand charge */ - xchar type = DUST; /* Type of engraving made */ - xchar oetype = 0; /* will be set to type of current engraving */ + xint16 type = DUST; /* Type of engraving made */ + xint16 oetype = 0; /* will be set to type of current engraving */ char buf[BUFSZ]; /* Buffer for final/poly engraving text */ char ebuf[BUFSZ]; /* Buffer for initial engraving text */ char fbuf[BUFSZ]; /* Buffer for "your fingers" */ @@ -817,7 +817,7 @@ engrave(const char *engraving, boolean fingers) case WAN_POLYMORPH: if (oep) { if (!Blind) { - type = (xchar)0; /* random */ + type = (xint16) 0; /* random */ (void) random_engraving(buf); doknown = TRUE; } else { @@ -1613,7 +1613,7 @@ static const char *epitaphs[] = { * The caller is responsible for newsym(x, y). */ void -make_grave(int x, int y, const char *str) +make_grave(coordxy x, coordxy y, const char *str) { /* Can we put a grave here? */ if ((levl[x][y].typ != ROOM && levl[x][y].typ != GRAVE) || t_at(x, y)) return; diff --git a/src/exper.c b/src/exper.c index 95481f7ea..a906774d7 100644 --- a/src/exper.c +++ b/src/exper.c @@ -107,7 +107,7 @@ newpw(void) en = 1; } if (u.ulevel < MAXULEV) { - u.ueninc[u.ulevel] = (xchar) en; + u.ueninc[u.ulevel] = (xint16) en; } return en; } diff --git a/src/explode.c b/src/explode.c index bcd89dc13..e4d7c096b 100644 --- a/src/explode.c +++ b/src/explode.c @@ -26,7 +26,7 @@ static int expl[3][3] = { * that Half_physical_damage only affects the damage applied to the hero. */ void -explode(int x, int y, int type, int dam, char olet, int expltype) +explode(coordxy x, coordxy y, int type, int dam, char olet, int expltype) /* the same as in zap.c; passes -(wand typ) for some WAND_CLASS */ @@ -318,7 +318,7 @@ explode(int x, int y, int type, int dam, char olet, int expltype) } idamres = idamnonres = 0; if (type >= 0 && !u.uswallow) { - (void)zap_over_floor((xchar)(i+x-1), (xchar)(j+y-1), + (void)zap_over_floor((coordxy)(i+x-1), (coordxy)(j+y-1), type, &shopdamage, exploding_wand_typ); } @@ -554,8 +554,8 @@ explode(int x, int y, int type, int dam, char olet, int expltype) struct scatter_chain { struct scatter_chain *next; /* pointer to next scatter item */ struct obj *obj; /* pointer to the object */ - xchar ox; /* location of */ - xchar oy; /* item */ + coordxy ox; /* location of */ + coordxy oy; /* item */ schar dx; /* direction of */ schar dy; /* travel */ int range; /* range of object */ @@ -652,7 +652,9 @@ scatter(int sx, int sy, /**< location of objects to scatter */ } else if ((scflags & MAY_DESTROY) && (!rn2(10) || (objects[otmp->otyp].oc_material == GLASS || otmp->otyp == EGG))) { - if (breaks(otmp, (xchar)sx, (xchar)sy)) used_up = TRUE; + if (breaks(otmp, (coordxy)sx, (coordxy)sy)) { + used_up = TRUE; + } } if (!used_up) { @@ -768,7 +770,7 @@ scatter(int sx, int sy, /**< location of objects to scatter */ * For now, just perform a "regular" explosion. */ void -splatter_burning_oil(int x, int y, boolean diluted_oil) +splatter_burning_oil(coordxy x, coordxy y, boolean diluted_oil) { int dmg = d(diluted_oil ? 3 : 4, 4); @@ -780,7 +782,7 @@ splatter_burning_oil(int x, int y, boolean diluted_oil) /* lit potion of oil is exploding; extinguish it as a light source before possibly killing the hero and attempting to save bones */ void -explode_oil(struct obj *obj, int x, int y) +explode_oil(struct obj *obj, coordxy x, coordxy y) { boolean diluted_oil = obj->odiluted; diff --git a/src/extralev.c b/src/extralev.c index a15020590..1758601f9 100644 --- a/src/extralev.c +++ b/src/extralev.c @@ -10,8 +10,8 @@ #ifdef REINCARNATION struct rogueroom { - xchar rlx, rly; - xchar dx, dy; + coordxy rlx, rly; + coordxy dx, dy; boolean real; uchar doortable; int nroom; /* Only meaningful for "real" rooms */ @@ -23,8 +23,8 @@ struct rogueroom { static NEARDATA struct rogueroom r[3][3]; static void roguejoin(int, int, int, int, int); -static void roguecorr(int, int, int); -static void miniwalk(int, int); +static void roguecorr(coordxy, coordxy, int); +static void miniwalk(coordxy, coordxy); static void roguejoin(int x1, int y1, int x2, int y2, int horiz) @@ -56,7 +56,7 @@ roguejoin(int x1, int y1, int x2, int y2, int horiz) } static void -roguecorr(int x, int y, int dir) +roguecorr(coordxy x, coordxy y, int dir) { int fromx, fromy, tox, toy; @@ -153,7 +153,7 @@ roguecorr(int x, int y, int dir) /* Modified walkfrom() from mkmaze.c */ static void -miniwalk(int x, int y) +miniwalk(coordxy x, coordxy y) { int q, dir; int dirs[4]; @@ -285,7 +285,7 @@ makeroguerooms(void) { } void -corr(int x, int y) +corr(coordxy x, coordxy y) { levl[x][y].typ = CORR; } diff --git a/src/files.c b/src/files.c index afbf66910..386d50d48 100644 --- a/src/files.c +++ b/src/files.c @@ -2776,7 +2776,7 @@ recover_savefile() { int gfd, lfd, sfd; int lev, savelev, hpid; - xchar levc; + xint16 levc; struct version_info version_data; int processed[256]; char savename[SAVESIZE], errbuf[BUFSZ]; @@ -2868,14 +2868,14 @@ recover_savefile() processed[0] = 1; for (lev = 1; lev < 256; lev++) { - /* level numbers are kept in xchars in save.c, so the + /* level numbers are kept in xint16s in save.c, so the * maximum level number (for the endlevel) must be < 256 */ if (lev != savelev) { lfd = open_levelfile(lev, (char *)0); if (lfd >= 0) { /* any or all of these may not exist */ - levc = (xchar) lev; + levc = (xint16) lev; write(sfd, (genericptr_t) &levc, sizeof(levc)); if (!copy_bytes(lfd, sfd)) { (void) close(lfd); diff --git a/src/fountain.c b/src/fountain.c index 391dd062b..053569707 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -8,7 +8,7 @@ static void dowatersnakes(void); static void dowaterdemon(void); static void dowaternymph(void); -static void gush(int, int, genericptr_t); +static void gush(coordxy, coordxy, genericptr_t); static void dofindgem(void); /* used when trying to dip in or drink from fountain or sink or pool while @@ -114,7 +114,7 @@ dogushforth(int drinking) } static void -gush(int x, int y, genericptr_t poolcnt) +gush(coordxy x, coordxy y, genericptr_t poolcnt) { struct monst *mtmp; struct trap *ttmp; @@ -158,7 +158,7 @@ dofindgem(void) } void -dryup(xchar x, xchar y, boolean isyou) +dryup(coordxy x, coordxy y, boolean isyou) { if (IS_FOUNTAIN(levl[x][y].typ) && (!rn2(3) || FOUNTAIN_IS_WARNED(x, y))) { @@ -519,7 +519,7 @@ dipfountain(struct obj *obj) #ifdef SINKS void -breaksink(int x, int y) +breaksink(coordxy x, coordxy y) { if(cansee(x, y) || (x == u.ux && y == u.uy)) pline_The("pipes break! Water spurts out!"); diff --git a/src/hack.c b/src/hack.c index 6201484d6..74823ec16 100644 --- a/src/hack.c +++ b/src/hack.c @@ -9,17 +9,17 @@ static void maybe_wail(void); static int moverock(void); -static int still_chewing(xchar, xchar); +static int still_chewing(coordxy, coordxy); #ifdef SINKS static void dosinkfall(void); #endif -static boolean findtravelpath(boolean (*)(int, int)); -static boolean trapmove(int, int, struct trap *); +static boolean findtravelpath(boolean (*)(coordxy, coordxy)); +static boolean trapmove(coordxy, coordxy, struct trap *); static struct monst *monstinroom(struct permonst *, int); -static boolean doorless_door(int, int); +static boolean doorless_door(coordxy, coordxy); static void move_update(boolean); -static void check_buried_zombies(xchar, xchar); -static boolean domove_swap_with_pet(struct monst *, xchar, xchar); +static void check_buried_zombies(coordxy, coordxy); +static boolean domove_swap_with_pet(struct monst *, coordxy, coordxy); static void struggle_sub(const char *); static boolean check_interrupt(struct monst *mtmp); @@ -35,7 +35,7 @@ static anything tmp_anything; #ifdef DUNGEON_GROWTH void -rndmappos(xchar *x, xchar *y) /* guaranteed to return a valid coord */ +rndmappos(coordxy *x, coordxy *y) /* guaranteed to return a valid coord */ { @@ -61,7 +61,7 @@ static const struct herb_info { }; long -count_herbs_at(xchar x, xchar y, boolean watery) +count_herbs_at(coordxy x, coordxy y, boolean watery) { int dd; long count = 0; @@ -80,7 +80,7 @@ count_herbs_at(xchar x, xchar y, boolean watery) /* returns TRUE if a herb can grow at (x,y) */ boolean -herb_can_grow_at(xchar x, xchar y, boolean watery) +herb_can_grow_at(coordxy x, coordxy y, boolean watery) { struct rm *lev = &levl[x][y]; if (inside_shop(x, y)) return FALSE; @@ -97,7 +97,7 @@ herb_can_grow_at(xchar x, xchar y, boolean watery) /* grow herbs in water. return true if did something. */ boolean -grow_water_herbs(int herb, xchar x, xchar y) +grow_water_herbs(int herb, coordxy x, coordxy y) { struct obj *otmp; @@ -117,7 +117,7 @@ grow_water_herbs(int herb, xchar x, xchar y) /* grow herb on ground at (x,y), or maybe spread out. return true if did something. */ boolean -grow_herbs(int herb, xchar x, xchar y, boolean showmsg, boolean update) +grow_herbs(int herb, coordxy x, coordxy y, boolean showmsg, boolean update) { struct obj *otmp; @@ -174,7 +174,7 @@ grow_herbs(int herb, xchar x, xchar y, boolean showmsg, boolean update) /* moves topmost object in water at (x,y) to dir. return true if did something. */ boolean -water_current(xchar x, xchar y, int dir, unsigned int waterforce, boolean showmsg, boolean update) +water_current(coordxy x, coordxy y, int dir, unsigned int waterforce, boolean showmsg, boolean update) /* strength of the water current */ @@ -219,7 +219,7 @@ water_current(xchar x, xchar y, int dir, unsigned int waterforce, boolean showms /* a tree at (x,y) spontaneously drops a ripe fruit */ boolean -drop_ripe_treefruit(xchar x, xchar y, boolean showmsg, boolean update) +drop_ripe_treefruit(coordxy x, coordxy y, boolean showmsg, boolean update) { struct rm *lev; @@ -272,7 +272,7 @@ drop_ripe_treefruit(xchar x, xchar y, boolean showmsg, boolean update) * Creates a kind of forest, with (hopefully) most places available. */ boolean -seed_tree(xchar x, xchar y) +seed_tree(coordxy x, coordxy y) { coord pos, pos2; struct rm *lev; @@ -375,7 +375,7 @@ obj_to_any(struct obj *obj) } boolean -revive_nasty(int x, int y, const char *msg) +revive_nasty(coordxy x, coordxy y, const char *msg) { struct obj *otmp, *otmp2; struct monst *mtmp; @@ -414,7 +414,7 @@ revive_nasty(int x, int y, const char *msg) static int moverock(void) { - xchar rx, ry, sx, sy; + coordxy rx, ry, sx, sy; struct obj *otmp; struct trap *ttmp; struct monst *mtmp; @@ -708,7 +708,7 @@ moverock(void) * Returns TRUE if still eating, FALSE when done. */ static int -still_chewing(xchar x, xchar y) +still_chewing(coordxy x, coordxy y) { struct rm *lev = &levl[x][y]; struct obj *boulder = sobj_at(BOULDER, x, y); @@ -854,7 +854,7 @@ still_chewing(xchar x, xchar y) } void -movobj(struct obj *obj, xchar ox, xchar oy) +movobj(struct obj *obj, coordxy ox, coordxy oy) { /* optimize by leaving on the fobj chain? */ remove_object(obj); @@ -953,7 +953,7 @@ dosinkfall(void) /* intended to be called only on ROCKs */ boolean -may_dig(xchar x, xchar y) +may_dig(coordxy x, coordxy y) { struct rm *lev = &levl[x][y]; @@ -964,14 +964,14 @@ may_dig(xchar x, xchar y) } boolean -may_passwall(xchar x, xchar y) +may_passwall(coordxy x, coordxy y) { return (boolean)(!((IS_STWALL(levl[x][y].typ) || IS_TREES(levl[x][y].typ)) && (levl[x][y].wall_info & W_NONPASSWALL))); } boolean -bad_rock(struct permonst *mdat, xchar x, xchar y) +bad_rock(struct permonst *mdat, coordxy x, coordxy y) { return((boolean) ((Sokoban && sobj_at(BOULDER, x, y)) || (IS_ROCK(levl[x][y].typ) @@ -1011,7 +1011,7 @@ cant_squeeze_thru(struct monst *mon) } boolean -invocation_pos(xchar x, xchar y) +invocation_pos(coordxy x, coordxy y) { return((boolean)(Invocation_lev(&u.uz) && x == inv_pos.x && y == inv_pos.y)); } @@ -1281,7 +1281,7 @@ test_move(int ux, int uy, int dx, int dy, int mode) avoid treating traps and doors known to be locked as valid explore targets (although they are still valid travel intermediates). */ static boolean -unexplored(int x, int y) +unexplored(coordxy x, coordxy y) { int i, j, k, l; struct trap *ttmp = t_at(x, y); @@ -1328,7 +1328,7 @@ unexplored(int x, int y) /** Returns a distance modified by a constant factor. * The lower the value the better.*/ int -autotravel_weighting(int x, int y, unsigned int distance) +autotravel_weighting(coordxy x, coordxy y, unsigned int distance) { int glyph = levl[x][y].glyph; @@ -1371,7 +1371,7 @@ autotravel_weighting(int x, int y, unsigned int distance) * Returns TRUE if a path was found. */ static boolean -findtravelpath(boolean (*guess) (int, int)) +findtravelpath(boolean (*guess) (coordxy, coordxy)) { /* if travel to adjacent, reachable location, use normal movement rules */ if (!guess && iflags.travel1 && distmin(u.ux, u.uy, u.tx, u.ty) == 1) { @@ -1387,9 +1387,9 @@ findtravelpath(boolean (*guess) (int, int)) } if (u.tx != u.ux || u.ty != u.uy || guess == unexplored) { unsigned travel[COLNO][ROWNO]; - xchar travelstepx[2][COLNO*ROWNO]; - xchar travelstepy[2][COLNO*ROWNO]; - xchar tx, ty, ux, uy; + coordxy travelstepx[2][COLNO*ROWNO]; + coordxy travelstepy[2][COLNO*ROWNO]; + coordxy tx, ty, ux, uy; int n = 1; /* max offset in travelsteps */ int set = 0; /* two sets current and previous */ int radius = 1; /* search radius */ @@ -1541,7 +1541,7 @@ findtravelpath(boolean (*guess) (int, int)) } boolean -is_valid_travelpt(int x, int y) +is_valid_travelpt(coordxy x, coordxy y) { int tx = u.tx; int ty = u.ty; @@ -1564,7 +1564,7 @@ is_valid_travelpt(int x, int y) /* A function version of couldsee, so we can take a pointer to it. */ static boolean -couldsee_func(int x, int y) +couldsee_func(coordxy x, coordxy y) { return couldsee(x, y); } @@ -1577,7 +1577,7 @@ couldsee_func(int x, int y) * It should only leak information about "obvious" coordinates, e.g. * unexplored rooms or big areas not reachable by the player. */ static boolean -interesting_to_explore(int x, int y) +interesting_to_explore(coordxy x, coordxy y) { if (!goodpos(x, y, &youmonst, 0)) return FALSE; @@ -1602,7 +1602,7 @@ interesting_to_explore(int x, int y) (all failures and most successful escapes leave hero at original spot) */ static boolean trapmove( - int x, int y, /**< targetted destination, */ + coordxy x, coordxy y, /**< targetted destination, */ struct trap *desttrap) /**< nonnull if another trap at */ { boolean anchored = FALSE; @@ -1765,7 +1765,7 @@ u_rooted(void) /* reduce zombification timeout of buried zombies around px, py */ static void -check_buried_zombies(xchar x, xchar y) +check_buried_zombies(coordxy x, coordxy y) { struct obj *otmp; long t; @@ -1786,7 +1786,7 @@ check_buried_zombies(xchar x, xchar y) /** Maybe swap places with a monster? returns TRUE if swapped places */ static boolean -domove_swap_with_pet(struct monst *mtmp, xchar x, xchar y) +domove_swap_with_pet(struct monst *mtmp, coordxy x, coordxy y) { struct trap *trap; /* if it turns out we can't actually move */ @@ -1913,11 +1913,11 @@ domove(void) { struct monst *mtmp; struct rm *tmpr; - xchar x, y; + coordxy x, y; struct trap *trap = NULL; int wtcap; boolean on_ice; - xchar chainx = 0, chainy = 0, + coordxy chainx = 0, chainy = 0, ballx = 0, bally = 0; /* ball&chain new positions */ int bc_control = 0; /* control for ball&chain */ boolean cause_delay = FALSE; /* dragging ball will skip a move */ @@ -3078,7 +3078,7 @@ monstinroom(struct permonst *mdat, int roomno) } char * -in_rooms(xchar x, xchar y, int typewanted) +in_rooms(coordxy x, coordxy y, int typewanted) { static char buf[5]; char rno, *ptr = &buf[4]; @@ -3144,7 +3144,7 @@ in_rooms(xchar x, xchar y, int typewanted) /* is (x,y) in a town? */ boolean -in_town(int x, int y) +in_town(coordxy x, coordxy y) { s_level *slev = Is_special(&u.uz); struct mkroom *sroom; @@ -3691,7 +3691,7 @@ lookaround(void) /* check for a doorway which lacks its door (NODOOR or BROKEN) */ static boolean -doorless_door(int x, int y) +doorless_door(coordxy x, coordxy y) { struct rm *lev_p = &levl[x][y]; @@ -3726,7 +3726,7 @@ check_interrupt(struct monst *mtmp) /* used by drown() to check whether hero can crawl from water to */ boolean -crawl_destination(int x, int y) +crawl_destination(coordxy x, coordxy y) { /* is location ok in general? */ if (!goodpos(x, y, &youmonst, 0)) @@ -4102,7 +4102,7 @@ money_cnt(struct obj *otmp) } boolean -MON_AT(int x, int y) +MON_AT(coordxy x, coordxy y) { assert_valid_coordinates(x, y); @@ -4110,7 +4110,7 @@ MON_AT(int x, int y) } boolean -OBJ_AT(int x, int y) +OBJ_AT(coordxy x, coordxy y) { assert_valid_coordinates(x, y); diff --git a/src/hacklib.c b/src/hacklib.c index 00756c6a5..bea7f9dc0 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -514,7 +514,7 @@ sgn(int n) /* calculate x/y, rounding as appropriate */ int -rounddiv(long int x, int y) +rounddiv(long x, int y) { int r, m; int divsgn = 1; diff --git a/src/invent.c b/src/invent.c index bbdf6f661..f54a3beab 100644 --- a/src/invent.c +++ b/src/invent.c @@ -618,7 +618,7 @@ freeinv(struct obj *obj) } void -delallobj(int x, int y) +delallobj(coordxy x, coordxy y) { struct obj *otmp, *otmp2; @@ -658,7 +658,7 @@ delobj(struct obj *obj) /* try to find a particular type of object at designated map location */ struct obj * -sobj_at(int otyp, int x, int y) +sobj_at(int otyp, coordxy x, coordxy y) { struct obj *otmp; @@ -763,7 +763,7 @@ o_on(unsigned int id, struct obj *objchn) } boolean -obj_here(struct obj *obj, int x, int y) +obj_here(struct obj *obj, coordxy x, coordxy y) { struct obj *otmp; @@ -773,7 +773,7 @@ obj_here(struct obj *obj, int x, int y) } struct obj * -g_at(int x, int y) +g_at(coordxy x, coordxy y) { struct obj *obj = level.objects[x][y]; @@ -875,12 +875,12 @@ getobj(const char *let, const char *word) char lets[BUFSZ], altlets[BUFSZ], *ap; int foo = 0; char *bp = buf; - xchar allowcnt = 0; /* 0, 1 or 2 */ + coordxy allowcnt = 0; /* 0, 1 or 2 */ boolean usegold = FALSE; /* can't use gold because its illegal */ boolean allowall = FALSE; boolean allownone = FALSE; boolean useboulder = FALSE; - xchar foox = 0; + coordxy foox = 0; long cnt; boolean msggiven = FALSE; boolean oneloop = FALSE; @@ -1745,7 +1745,9 @@ void fully_identify_obj(struct obj *otmp) { makeknown(otmp->otyp); - if (otmp->oartifact) discover_artifact((xchar)otmp->oartifact); + if (otmp->oartifact) { + discover_artifact((coordxy)otmp->oartifact); + } otmp->known = otmp->dknown = otmp->bknown = otmp->rknown = 1; if (Is_container(otmp) || otmp->otyp == STATUE) { otmp->cknown = otmp->lknown = 1; @@ -2966,7 +2968,7 @@ count_contents(struct obj *container, boolean nested, boolean quantity, boolean long count = 0L; if (!everything && !newdrop) { - xchar x, y; + coordxy x, y; for (topc = container; topc->where == OBJ_CONTAINED; topc = topc->ocontainer) { continue; @@ -3263,7 +3265,7 @@ dotypeinv(void) /* return a string describing the dungeon feature at if there is one worth mentioning at that location; otherwise null */ const char * -dfeature_at(int x, int y, char *buf) +dfeature_at(coordxy x, coordxy y, char *buf) { struct rm *lev = &levl[x][y]; int ltyp = lev->typ, cmap = -1; @@ -4272,7 +4274,7 @@ only_here(struct obj *obj) * Currently, this is only used with a wand of probing zapped downwards. */ int -display_binventory(int x, int y, boolean as_if_seen) +display_binventory(coordxy x, coordxy y, boolean as_if_seen) { struct obj *obj; menu_item *selected = 0; diff --git a/src/light.c b/src/light.c index e5317ae0f..3f654ec91 100644 --- a/src/light.c +++ b/src/light.c @@ -54,7 +54,7 @@ extern char circle_start[]; /* Create a new light source. */ void -new_light_source(xchar x, xchar y, int range, int type, anything *id) +new_light_source(coordxy x, coordxy y, int range, int type, anything *id) { light_source *ls; @@ -207,7 +207,7 @@ do_light_sources(char **cs_rows) way to its destination; show its light so that hero has a chance to remember terrain, objects, and monsters being revealed */ void -show_transient_light(struct obj *obj, int x, int y) +show_transient_light(struct obj *obj, coordxy x, coordxy y) { light_source *ls; struct monst *mon; @@ -561,7 +561,7 @@ any_light_source(void) * only for burning light sources. */ void -snuff_light_source(int x, int y) +snuff_light_source(coordxy x, coordxy y) { light_source *ls; struct obj *obj; diff --git a/src/lock.c b/src/lock.c index faa8f84e9..7605985a4 100644 --- a/src/lock.c +++ b/src/lock.c @@ -17,7 +17,7 @@ static int picklock(void); static int forcelock(void); static const char *lock_action(void); -static boolean obstructed(int, int, boolean); +static boolean obstructed(coordxy, coordxy, boolean); static void chest_shatter_msg(struct obj *); boolean @@ -34,7 +34,7 @@ picking_lock(int *x, int *y) } boolean -picking_at(int x, int y) +picking_at(coordxy x, coordxy y) { return (boolean)(occupation == picklock && xlock.door == &levl[x][y]); } @@ -650,7 +650,7 @@ doforce(void) } boolean -stumble_on_door_mimic(int x, int y) +stumble_on_door_mimic(coordxy x, coordxy y) { struct monst *mtmp = m_at(x, y); @@ -671,7 +671,7 @@ doopen(void) /* try to open a door in direction u.dx/u.dy */ int -doopen_indir(int x, int y) +doopen_indir(coordxy x, coordxy y) { #endif /* AUTO_OPEN */ coord cc; @@ -783,7 +783,7 @@ doopen_indir(int x, int y) } static boolean -obstructed(int x, int y, boolean quietly) +obstructed(coordxy x, coordxy y, boolean quietly) { struct monst *mtmp = m_at(x, y); @@ -962,7 +962,7 @@ boxlock(struct obj *obj, struct obj *otmp) /* obj *is* a box */ /* Door/secret door was hit with spell or wand effect otmp; returns true if something happened */ boolean -doorlock(struct obj *otmp, int x, int y) +doorlock(struct obj *otmp, coordxy x, coordxy y) { struct rm *door = &levl[x][y]; boolean res = TRUE; @@ -1174,7 +1174,7 @@ chest_shatter_msg(struct obj *otmp) */ int -artifact_door(int x UNUSED, int y UNUSED) +artifact_door(coordxy x UNUSED, coordxy y UNUSED) { #ifdef ADVENT_CALENDAR /* on the advent calendar level all doors are indestructible */ diff --git a/src/mail.c b/src/mail.c index af33b0617..c1ade0571 100644 --- a/src/mail.c +++ b/src/mail.c @@ -191,7 +191,7 @@ md_start(coord *startp) startp->y = row; startp->x = viz_rmin[row]; - } else if (enexto(&testcc, (xchar)viz_rmin[row], row, + } else if (enexto(&testcc, (coordxy)viz_rmin[row], row, (struct permonst *) 0) && !cansee(testcc.x, testcc.y) && couldsee(testcc.x, testcc.y)) { @@ -206,7 +206,7 @@ md_start(coord *startp) startp->y = row; startp->x = viz_rmax[row]; - } else if (enexto(&testcc, (xchar)viz_rmax[row], row, + } else if (enexto(&testcc, (coordxy)viz_rmax[row], row, (struct permonst *) 0) && !cansee(testcc.x, testcc.y) && couldsee(testcc.x, testcc.y)) { diff --git a/src/makemon.c b/src/makemon.c index 59b5550a2..9464dcdc0 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -17,7 +17,7 @@ static boolean uncommon(int); static int align_shift(struct permonst *); static boolean mk_gen_ok(int, int, int); static boolean wrong_elem_type(struct permonst *); -static void m_initgrp(struct monst *, int, int, int, int); +static void m_initgrp(struct monst *, coordxy, coordxy, int, int); static void m_initthrow(struct monst *, int, int); static void m_initweap(struct monst *); static void m_inityour(struct monst *, struct obj *); @@ -71,7 +71,7 @@ wrong_elem_type(struct permonst *ptr) } /* make a group just like mtmp */ static void -m_initgrp(struct monst *mtmp, int x, int y, int n, int mmflags) +m_initgrp(struct monst *mtmp, coordxy x, coordxy y, int n, int mmflags) { coord mm; int cnt = rnd(n); @@ -884,7 +884,7 @@ m_initinv(struct monst *mtmp) /* Note: for long worms, always call cutworm (cutworm calls clone_mon) */ struct monst * clone_mon(struct monst *mon, - xchar x, xchar y) /**< clone's preferred location or 0 (near mon) */ + coordxy x, coordxy y) /**< clone's preferred location or 0 (near mon) */ { coord mm; struct monst *m2; @@ -1120,7 +1120,7 @@ makemon_rnd_goodpos(struct monst *mon, unsigned int gpflags, coord *cc) static struct monst * -_makemon(struct permonst *ptr, int x, int y, int mmflags) +_makemon(struct permonst *ptr, coordxy x, coordxy y, int mmflags) { struct monst *mtmp; int mndx, mcham, ct, mitem, xlth, mhitdie; @@ -1529,7 +1529,7 @@ newmextra(void) * In case we make a monster group, only return the one at [x,y]. */ struct monst * -makemon(struct permonst *ptr, int x, int y, int mmflags) +makemon(struct permonst *ptr, coordxy x, coordxy y, int mmflags) { use_mon_rng++; struct monst *mtmp = _makemon(ptr, x, y, mmflags); @@ -2592,7 +2592,7 @@ bagotricks(struct obj *bag) /** May create a camera demon emerging from camera around position x,y. */ void -create_camera_demon(struct obj *camera, int x, int y) +create_camera_demon(struct obj *camera, coordxy x, coordxy y) { struct monst *mtmp; diff --git a/src/mapglyph.c b/src/mapglyph.c index 808d83a08..260a385c9 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -89,7 +89,7 @@ get_objsym(int glyph) /*ARGSUSED*/ void -mapglyph(int glyph, glyph_t *ochar, int *ocolor, unsigned int *ospecial, int x, int y, +mapglyph(int glyph, glyph_t *ochar, int *ocolor, unsigned int *ospecial, coordxy x, coordxy y, unsigned int mgflags UNUSED) { int offset; diff --git a/src/mhitm.c b/src/mhitm.c index 7af34685f..42140aba2 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -786,7 +786,7 @@ engulf_target(struct monst *magr, struct monst *mdef) static int gulpmm(struct monst *magr, struct monst *mdef, struct attack *mattk) { - xchar ax, ay, dx, dy; + coordxy ax, ay, dx, dy; int status; char buf[BUFSZ]; struct obj *obj; diff --git a/src/mhitu.c b/src/mhitu.c index 5dcbd4f69..37d196673 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -2652,7 +2652,7 @@ could_seduce( { struct permonst *pagr; boolean agrinvis, defperc; - xchar genagr, gendef; + xint16 genagr, gendef; int adtyp; if (is_animal(magr->data)) return (0); diff --git a/src/mklev.c b/src/mklev.c index 6b17bab61..9c65cc3c8 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -29,28 +29,28 @@ static void makevtele(void); static void clear_level_structures(void); static void makelevel(void); static struct mkroom *find_branch_room(coord *); -static struct mkroom *pos_to_room(xchar, xchar); +static struct mkroom *pos_to_room(coordxy, coordxy); static boolean place_niche(struct mkroom *, int*, int*, int*); static void makeniche(int); static void make_niches(void); static int CFDECLSPEC do_comp(const genericptr, const genericptr); -static void dosdoor(xchar, xchar, struct mkroom *, int); +static void dosdoor(coordxy, coordxy, struct mkroom *, int); static void join(int, int, boolean); static void do_room_or_subroom(struct mkroom *, int, int, int, int, boolean, schar, boolean, boolean); static void makerooms(void); -static void finddpos(coord *, xchar, xchar, xchar, xchar); -static void mkinvpos(xchar, xchar, int); -static void mk_knox_portal(xchar, xchar); +static void finddpos(coord *, coordxy, coordxy, coordxy, coordxy); +static void mkinvpos(coordxy, coordxy, int); +static void mk_knox_portal(coordxy, coordxy); static void place_random_engravings(void); #define create_vault() create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE) #define init_vault() vault_x = -1 #define do_vault() (vault_x != -1) -static xchar vault_x, vault_y; +static coordxy vault_x, vault_y; boolean goldseen; static boolean made_branch; /* used only during level creation */ @@ -76,9 +76,9 @@ do_comp(const void *vx, const void *vy) } static void -finddpos(coord *cc, xchar xl, xchar yl, xchar xh, xchar yh) +finddpos(coord *cc, coordxy xl, coordxy yl, coordxy xh, coordxy yh) { - xchar x, y; + coordxy x, y; x = (xl == xh) ? xl : (xl + rn2(xh-xl+1)); y = (yl == yh) ? yl : (yl + rn2(yh-yl+1)); @@ -308,7 +308,7 @@ static void join(int a, int b, boolean nxcor) { coord cc, tt, org, dest; - xchar tx, ty, xx, yy; + coordxy tx, ty, xx, yy; struct mkroom *croom, *troom; int dx, dy; @@ -456,7 +456,7 @@ makecorridors(int style) } void -add_door(int x, int y, struct mkroom *aroom) +add_door(coordxy x, coordxy y, struct mkroom *aroom) { struct mkroom *broom; int tmp; @@ -475,7 +475,7 @@ add_door(int x, int y, struct mkroom *aroom) } static void -dosdoor(xchar x, xchar y, struct mkroom *aroom, int type) +dosdoor(coordxy x, coordxy y, struct mkroom *aroom, int type) { boolean shdoor = ((*in_rooms(x, y, SHOPBASE)) ? TRUE : FALSE); @@ -652,7 +652,7 @@ makeniche(int trap_type) void make_ironbarwalls(int chance) { - xchar x, y; + coordxy x, y; if (chance < 1) return; @@ -775,7 +775,7 @@ clear_level_structures(void) /** Create a vault with the magic portal to Fort Ludios. */ void -mk_knox_vault(int x, int y, int w, int h) +mk_knox_vault(coordxy x, coordxy y, int w, int h) { add_room(x, y, x+w, y+h, TRUE, VAULT, FALSE); level.flags.has_vault = 1; @@ -902,7 +902,7 @@ makelevel(void) /* make a secret treasure vault, not connected to the rest */ if(do_vault()) { - xchar w, h; + coordxy w, h; #ifdef DEBUG debugpline("trying to make a vault..."); #endif @@ -1147,7 +1147,7 @@ mineralize(int kelp_pool, int kelp_moat, int goldprob, int gemprob, boolean skip void -wallwalk_right(xchar x, xchar y, schar fgtyp, schar fglit, schar bgtyp, int chance) +wallwalk_right(coordxy x, coordxy y, schar fgtyp, schar fglit, schar bgtyp, int chance) { int sx, sy, nx, ny, dir, cnt; schar tmptyp; @@ -1387,7 +1387,7 @@ find_branch_room(coord *mp) /* Find the room for (x,y). Return null if not in a room. */ static struct mkroom * -pos_to_room(xchar x, xchar y) +pos_to_room(coordxy x, coordxy y) { int i; struct mkroom *curr; @@ -1402,7 +1402,7 @@ pos_to_room(xchar x, xchar y) void place_branch( branch *br, /**< branch to place */ - xchar x, xchar y) /**< location */ + coordxy x, coordxy y) /**< location */ { coord m; d_level *dest; @@ -1458,7 +1458,7 @@ place_branch( } boolean -bydoor(xchar x, xchar y) +bydoor(coordxy x, coordxy y) { int typ; @@ -1483,7 +1483,7 @@ bydoor(xchar x, xchar y) /* see whether it is allowable to create a door at [x,y] */ int -okdoor(xchar x, xchar y) +okdoor(coordxy x, coordxy y) { boolean near_door = bydoor(x, y); @@ -1492,7 +1492,7 @@ okdoor(xchar x, xchar y) } void -dodoor(int x, int y, struct mkroom *aroom) +dodoor(coordxy x, coordxy y, struct mkroom *aroom) { if(doorindex >= DOORMAX) { impossible("DOORMAX exceeded?"); @@ -1503,7 +1503,7 @@ dodoor(int x, int y, struct mkroom *aroom) } boolean -occupied(xchar x, xchar y) +occupied(coordxy x, coordxy y) { return((boolean)(t_at(x, y) || IS_FURNITURE(levl[x][y].typ) @@ -1640,7 +1640,7 @@ mktrap(int num, int mazeflag, struct mkroom *croom, coord *tm) } void -mkstairs(xchar x, xchar y, char up, struct mkroom *croom) +mkstairs(coordxy x, coordxy y, char up, struct mkroom *croom) { if (!x) { impossible("mkstairs: bogus stair attempt at <%d,%d>", x, y); @@ -1781,9 +1781,9 @@ void mkinvokearea(void) { int dist; - xchar xmin = inv_pos.x, xmax = inv_pos.x; - xchar ymin = inv_pos.y, ymax = inv_pos.y; - xchar i; + coordxy xmin = inv_pos.x, xmax = inv_pos.x; + coordxy ymin = inv_pos.y, ymax = inv_pos.y; + coordxy i; pline_The("floor shakes violently under you!"); pline_The("walls around you begin to bend and crumble!"); @@ -1830,7 +1830,7 @@ mkinvokearea(void) * Temporarily overrides vision in the name of a nice effect. */ static void -mkinvpos(xchar x, xchar y, int dist) +mkinvpos(coordxy x, coordxy y, int dist) { struct trap *ttmp; struct obj *otmp; @@ -1934,7 +1934,7 @@ get_floating_branch(d_level *target, branch *br) * Ludios will remain isolated until the branch is corrected by this function. */ static void -mk_knox_portal(xchar x, xchar y) +mk_knox_portal(coordxy x, coordxy y) { extern int n_dgns; /* from dungeon.c */ d_level *source; @@ -1976,7 +1976,7 @@ place_random_engraving( ) { struct mkroom *some_room; - xchar sx, sy; + coordxy sx, sy; char const *engraving = engravings[rn2(size)]; int trycount=0; diff --git a/src/mkmap.c b/src/mkmap.c index be78f8b99..eb4b875df 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -16,7 +16,7 @@ static void pass_two(schar, schar); static void pass_three(schar, schar); static void wallify_map(void); static void join_map(schar, schar); -static void finish_map(schar, schar, xchar, xchar); +static void finish_map(schar, schar, coordxy, coordxy); static void remove_room(unsigned); static void backfill(schar, schar); void mkmap(lev_init *); @@ -179,7 +179,7 @@ pass_three(schar bg_typ, schar fg_typ) } boolean -check_flood_anyroom(int x, int y, schar fg_typ, boolean anyroom) +check_flood_anyroom(coordxy x, coordxy y, schar fg_typ, boolean anyroom) { if (!isok(x, y)) return FALSE; return (anyroom ? IS_ROOM(levl[x][y].typ) : levl[x][y].typ == fg_typ); @@ -465,7 +465,7 @@ mkmap(lev_init *init_lev) fg_typ = init_lev->fg; boolean smooth = init_lev->smoothed, join = init_lev->joined; - xchar lit = init_lev->lit, + xint16 lit = init_lev->lit, walled = init_lev->walled; int i; diff --git a/src/mkmaze.c b/src/mkmaze.c index daa2501f4..86fbf3896 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -12,15 +12,15 @@ extern int num_lregions; static lev_region bughack = { { COLNO, ROWNO, 0, 0 }, { COLNO, ROWNO, 0, 0 }, 0, 0, 0, 0, { 0 } }; extern char SpLev_Map[COLNO][ROWNO]; -static int iswall(int, int); -static int iswall_or_stone(int, int); -static boolean is_solid(int, int); +static int iswall(coordxy, coordxy); +static int iswall_or_stone(coordxy, coordxy); +static boolean is_solid(coordxy, coordxy); static int extend_spine(int [3][3], int, int, int); -static boolean okay(int, int, int); +static boolean okay(coordxy, coordxy, int); static void maze0xy(coord *); -static boolean put_lregion_here(xchar, xchar, xchar, - xchar, xchar, xchar, xchar, boolean, d_level *, xchar); -static void move(int *, int *, int); +static boolean put_lregion_here(coordxy, coordxy, coordxy, + coordxy, coordxy, coordxy, xint16, boolean, d_level *, coordxy); +static void move(coordxy *, coordxy *, int); static void setup_waterlevel(void); static void unsetup_waterlevel(void); @@ -28,6 +28,8 @@ static void check_ransacked(char *); static void migr_booty_item(int, const char *); static void migrate_orc(struct monst *, unsigned long); static void stolen_booty(void); +static boolean maze_inbounds(coordxy, coordxy); +static void maze_remove_deadends(xint16); /* adjust a coordinate one step in the specified direction */ #define mz_move(X, Y, dir) \ @@ -42,7 +44,7 @@ static void stolen_booty(void); } while (0) static int -iswall(int x, int y) +iswall(coordxy x, coordxy y) { int type; @@ -55,7 +57,7 @@ iswall(int x, int y) } static int -iswall_or_stone(int x, int y) +iswall_or_stone(coordxy x, coordxy y) { /* out of bounds = stone */ if (!isok(x, y)) { @@ -67,7 +69,7 @@ iswall_or_stone(int x, int y) /* return TRUE if out of bounds, wall or rock */ static boolean -is_solid(int x, int y) +is_solid(coordxy x, coordxy y) { return (!isok(x, y) || IS_STWALL(levl[x][y].typ)); } @@ -174,7 +176,7 @@ wall_extends(int x1, int y1, int x2, int y2) * so even though this table says VWALL, we actually leave whatever * typ was there alone. */ - static xchar spine_array[16] = { + static coordxy spine_array[16] = { VWALL, HWALL, HWALL, HWALL, VWALL, TRCORNER, TLCORNER, TDWALL, VWALL, BRCORNER, BLCORNER, TUWALL, @@ -217,7 +219,7 @@ wall_extends(int x1, int y1, int x2, int y2) } static boolean -okay(int x, int y, int dir) +okay(coordxy x, coordxy y, int dir) { move(&x, &y, dir); move(&x, &y, dir); @@ -237,7 +239,7 @@ maze0xy(coord *cc) } boolean -bad_location(xchar x, xchar y, xchar lx, xchar ly, xchar hx, xchar hy, xchar lax) +bad_location(coordxy x, coordxy y, coordxy lx, coordxy ly, coordxy hx, coordxy hy, coordxy lax) { return((boolean)(t_at(x, y) || invocation_pos(x, y) || within_bounded_area(x, y, lx, ly, hx, hy) || @@ -259,11 +261,15 @@ bad_location(xchar x, xchar y, xchar lx, xchar ly, xchar hx, xchar hy, xchar lax * * Returns TRUE if it could place the location. */ int -place_lregion(xchar lx, xchar ly, xchar hx, xchar hy, xchar nlx, xchar nly, xchar nhx, xchar nhy, xchar rtype, d_level *lev) +place_lregion( + coordxy lx, coordxy ly, coordxy hx, coordxy hy, + coordxy nlx, coordxy nly, coordxy nhx, coordxy nhy, + xint16 rtype, + d_level *lev) { int trycnt; boolean oneshot; - xchar x, y; + coordxy x, y; int lax = 0; if (!lx) { /* default to whole level */ @@ -304,7 +310,13 @@ place_lregion(xchar lx, xchar ly, xchar hx, xchar hy, xchar nlx, xchar nly, xcha } static boolean -put_lregion_here(xchar x, xchar y, xchar nlx, xchar nly, xchar nhx, xchar nhy, xchar rtype, boolean oneshot, d_level *lev, xchar lax) +put_lregion_here( + coordxy x, coordxy y, coordxy nlx, coordxy nly, + coordxy nhx, coordxy nhy, + xint16 rtype, + boolean oneshot, + d_level *lev, + coordxy lax) { struct monst *mtmp; @@ -985,7 +997,7 @@ stolen_booty(void) #undef ORC_LEADER boolean -maze_inbounds(int x, int y) +maze_inbounds(coordxy x, coordxy y) { return (x >= 2 && y >= 2 && x < x_maze_max && y < y_maze_max && @@ -993,7 +1005,7 @@ maze_inbounds(int x, int y) } void -maze_remove_deadends(xchar typ) +maze_remove_deadends(xint16 typ) { char dirok[4]; int x, y, dir, idx, idx2, dx, dy, dx2, dy2; @@ -1367,7 +1379,7 @@ schar typ; #else void -walkfrom(int x, int y, schar typ) +walkfrom(coordxy x, coordxy y, schar typ) { int q, a, dir; int dirs[4]; @@ -1404,7 +1416,7 @@ walkfrom(int x, int y, schar typ) #endif /* MICRO */ static void -move(int *x, int *y, int dir) +move(coordxy *x, coordxy *y, int dir) { switch(dir) { case 0: --(*y); break; @@ -1558,7 +1570,7 @@ bound_digging(void) } void -mkportal(xchar x, xchar y, xchar todnum, xchar todlevel) +mkportal(coordxy x, coordxy y, xint16 todnum, xint16 todlevel) { /* a portal "trap" must be matched by a */ /* portal in the destination dungeon/dlevel */ @@ -1580,12 +1592,12 @@ mkportal(xchar x, xchar y, xchar todnum, xchar todlevel) void fumaroles(void) { - xchar n; + xint16 n; boolean snd = FALSE, loud = FALSE; for (n = rn2(3) + 2; n; n--) { - xchar x = rn1(COLNO - 4, 3); - xchar y = rn1(ROWNO - 4, 3); + coordxy x = rn1(COLNO - 4, 3); + coordxy y = rn1(ROWNO - 4, 3); if (levl[x][y].typ == LAVAPOOL) { NhRegion *r = create_gas_cloud(x, y, 4+rn2(5), rn1(10, 5), rn1(3,4)); @@ -1628,7 +1640,7 @@ static int xmin, ymin, xmax, ymax; /* level boundaries */ #define bymax (ymax - 1) static void set_wportal(void); -static void mk_bubble(int, int, int); +static void mk_bubble(coordxy, coordxy, int); static void mv_bubble(struct bubble *, int, int, boolean); void @@ -1843,7 +1855,7 @@ restore_waterlevel(int fd) } const char * -waterbody_name(xchar x, xchar y) +waterbody_name(coordxy x, coordxy y) { struct rm *lev; schar ltyp; @@ -1932,7 +1944,7 @@ unsetup_waterlevel(void) } static void -mk_bubble(int x, int y, int n) +mk_bubble(coordxy x, coordxy y, int n) { /* * These bit masks make visually pleasing bubbles on a normal aspect diff --git a/src/mkobj.c b/src/mkobj.c index b0df66595..baf9ba5b1 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -6,7 +6,7 @@ static void mkbox_cnts(struct obj *); static unsigned nextoid(struct obj *, struct obj *); static void maybe_adjust_light(struct obj *, int); -static void obj_timer_checks(struct obj *, xchar, xchar, int); +static void obj_timer_checks(struct obj *, coordxy, coordxy, int); static void container_weight(struct obj *); static struct obj *save_mtraits(struct obj *, struct monst *); static void objlist_sanity(struct obj *, int, const char *); @@ -204,7 +204,7 @@ free_omailcmd(struct obj *otmp) } struct obj * -mkobj_at(char let, int x, int y, boolean artif) +mkobj_at(char let, coordxy x, coordxy y, boolean artif) { struct obj *otmp; @@ -214,7 +214,7 @@ mkobj_at(char let, int x, int y, boolean artif) } struct obj * -mksobj_at(int otyp, int x, int y, boolean init, boolean artif) +mksobj_at(int otyp, coordxy x, coordxy y, boolean init, boolean artif) { struct obj *otmp; @@ -694,7 +694,7 @@ static const char *const alteration_verbs[] = { void costly_alteration(struct obj *obj, int alter_type) { - xchar ox, oy; + coordxy ox, oy; char objroom; boolean learn_bknown; const char *those, *them; @@ -1256,7 +1256,7 @@ static void maybe_adjust_light(struct obj *obj, int old_range) { char buf[BUFSZ]; - xchar ox, oy; + coordxy ox, oy; int new_range = arti_light_radius(obj), delta = new_range - old_range; /* radius of light emitting artifact varies by curse/bless state @@ -1512,13 +1512,13 @@ static int treefruits[] = { APPLE, ORANGE, PEAR, BANANA, EUCALYPTUS_LEAF }; /* called when a tree is kicked; never returns Null */ struct obj * -rnd_treefruit_at(int x, int y) +rnd_treefruit_at(coordxy x, coordxy y) { return mksobj_at(treefruits[rn2(SIZE(treefruits))], x, y, TRUE, FALSE); } void -rnd_treesticks_at(int x, int y) +rnd_treesticks_at(coordxy x, coordxy y) { int num = rnd(3); while(num--) @@ -1527,7 +1527,7 @@ rnd_treesticks_at(int x, int y) /* create a stack of N gold pieces; never returns Null */ struct obj * -mkgold(long int amount, int x, int y) +mkgold(long int amount, coordxy x, coordxy y) { struct obj *gold = g_at(x, y); @@ -1561,7 +1561,7 @@ mkgold(long int amount, int x, int y) * resurrection. */ struct obj * -mkcorpstat(int objtype, struct monst *mtmp, struct permonst *ptr, int x, int y, boolean init) +mkcorpstat(int objtype, struct monst *mtmp, struct permonst *ptr, coordxy x, coordxy y, boolean init) /* CORPSE or STATUE */ @@ -1701,7 +1701,7 @@ get_mtraits(struct obj *obj, boolean copyof) /* make an object named after someone listed in the scoreboard file */ struct obj * -mk_tt_object(int objtype, int x, int y) +mk_tt_object(int objtype, coordxy x, coordxy y) /* CORPSE or STATUE */ { @@ -1722,7 +1722,7 @@ mk_tt_object(int objtype, int x, int y) /* make a new corpse or statue, uninitialized if a statue (i.e. no books); never returns Null */ struct obj * -mk_named_object(int objtype, struct permonst *ptr, int x, int y, const char *nm) +mk_named_object(int objtype, struct permonst *ptr, coordxy x, coordxy y, const char *nm) /* CORPSE or STATUE */ @@ -1772,7 +1772,7 @@ is_rottable(struct obj *otmp) /* put the object at the given location */ void -place_object(struct obj *otmp, int x, int y) +place_object(struct obj *otmp, coordxy x, coordxy y) { struct obj *otmp2 = level.objects[x][y]; @@ -1832,7 +1832,7 @@ place_object(struct obj *otmp, int x, int y) * Also used for starting ice effects too. [zap.c] */ void -obj_ice_effects(int x, int y, boolean do_buried) +obj_ice_effects(coordxy x, coordxy y, boolean do_buried) { struct obj *otmp; @@ -1877,7 +1877,7 @@ peek_at_iced_corpse_age(struct obj *otmp) static void obj_timer_checks( struct obj *otmp, - xchar x, xchar y, + coordxy x, coordxy y, int force) /**< 0 = no force so do checks, <0 = force off, >0 force on */ { long tleft = 0L; @@ -1947,8 +1947,8 @@ obj_timer_checks( void remove_object(struct obj *otmp) { - xchar x = otmp->ox; - xchar y = otmp->oy; + coordxy x = otmp->ox; + coordxy y = otmp->oy; if (otmp->where != OBJ_FLOOR) panic("remove_object: obj not on floor"); @@ -2817,7 +2817,7 @@ obj_nexto(struct obj *otmp) * reliably predict which one we want to 'find' first */ struct obj * -obj_nexto_xy(struct obj *obj, int x, int y, boolean recurs) +obj_nexto_xy(struct obj *obj, coordxy x, coordxy y, boolean recurs) { struct obj *otmp; int fx, fy, ex, ey, otyp = obj->otyp; diff --git a/src/mkroom.c b/src/mkroom.c index 6317b62f8..26e3062e0 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -246,7 +246,7 @@ mkzoo(int type) } void -mk_zoo_thronemon(int x, int y) +mk_zoo_thronemon(coordxy x, coordxy y) { int i = rnd(level_difficulty()); int pm = (i > 9) ? PM_OGRE_KING : @@ -292,7 +292,7 @@ fill_zoo(struct mkroom *sroom) (void) somexy(sroom, &mm); tx = mm.x; ty = mm.y; - } while (occupied((xchar)tx, (xchar)ty) && --i > 0); + } while (occupied((coordxy)tx, (coordxy)ty) && --i > 0); throne_placed: mk_zoo_thronemon(tx, ty); break; @@ -739,7 +739,7 @@ somey(struct mkroom *croom) } boolean -inside_room(struct mkroom *croom, xchar x, xchar y) +inside_room(struct mkroom *croom, coordxy x, coordxy y) { return((boolean)(x >= croom->lx-1 && x <= croom->hx+1 && y >= croom->ly-1 && y <= croom->hy+1)); diff --git a/src/mksheol.c b/src/mksheol.c index 9d55594cc..4bda3f132 100644 --- a/src/mksheol.c +++ b/src/mksheol.c @@ -46,9 +46,9 @@ static schar opentyps[10] = { ICEWALL, static void init_level_base_voronoi(schar* vtyps, int numtyps, int numpoints); static int check_voronoi_winner(patchcoord* coords, int num_coords, - int x, int y); + coordxy x, coordxy y); static void carve_path(floorprob* probs); -static void fuzzy_circle(int x, int y, +static void fuzzy_circle(coordxy x, coordxy y, int guaranteed_passage_radius, int fallout, floorprob* floorprobs); static void wallify_map(void); @@ -188,7 +188,7 @@ init_level_base_voronoi(schar* vtyps, int numtyps, int numpoints) } static int -check_voronoi_winner(patchcoord *coords, int num_coords, int x, int y) +check_voronoi_winner(patchcoord *coords, int num_coords, coordxy x, coordxy y) { int i1; int winner = 0, winner_distance; @@ -325,7 +325,7 @@ carve_path(floorprob *floorprobs) * After that, linearly makes it less likely that a passable square is * made. This makes a sort of "rough" edge. */ static void -fuzzy_circle(int x, int y, int guaranteed_passage_radius, int fallout, floorprob *floorprobs) +fuzzy_circle(coordxy x, coordxy y, int guaranteed_passage_radius, int fallout, floorprob *floorprobs) { int i1, i2; int fallout_2 = fallout * fallout; diff --git a/src/mon.c b/src/mon.c index 1ba1176e4..67e1693bd 100644 --- a/src/mon.c +++ b/src/mon.c @@ -30,7 +30,7 @@ static void lifesaved_monster(struct monst *, uchar); #else static void lifesaved_monster(struct monst *); #endif -static void migrate_mon(struct monst *, xchar, xchar); +static void migrate_mon(struct monst *, xint16, xint16); static boolean ok_to_obliterate(struct monst *); static void deal_with_overcrowding(struct monst *); @@ -161,7 +161,7 @@ mon_sanity_check(void) } void -remove_monster(int x, int y) +remove_monster(coordxy x, coordxy y) { if (level.monsters[x][y] && (level.monsters[x][y]->data == &mons[PM_GIANT_TURTLE] && @@ -1373,7 +1373,7 @@ mfndpos(struct monst *mon, coord *poss, long int *info, long int flag) { struct permonst *mdat = mon->data; - xchar x, y, nx, ny; + coordxy x, y, nx, ny; int cnt = 0; uchar ntyp; uchar nowtyp; @@ -1744,7 +1744,7 @@ mm_displacement( /* Is the square close enough for the monster to move or attack into? */ boolean -monnear(struct monst *mon, int x, int y) +monnear(struct monst *mon, coordxy x, coordxy y) { int distance = dist2(mon->mx, mon->my, x, y); @@ -2529,7 +2529,7 @@ void monstone(struct monst *mdef) { struct obj *otmp, *obj, *oldminvent; - xchar x = mdef->mx, y = mdef->my; + coordxy x = mdef->mx, y = mdef->my; boolean wasinside = FALSE; /* we have to make the statue before calling mondead, to be able to @@ -3007,14 +3007,17 @@ vamp_stone(struct monst *mtmp) void m_into_limbo(struct monst *mtmp) { - xchar target_lev = ledger_no(&u.uz), xyloc = MIGR_APPROX_XY; + xint16 target_lev = ledger_no(&u.uz), xyloc = MIGR_APPROX_XY; mtmp->mstate |= MON_LIMBO; migrate_mon(mtmp, target_lev, xyloc); } static void -migrate_mon(struct monst *mtmp, xchar target_lev, xchar xyloc) +migrate_mon( + struct monst *mtmp, + xint16 target_lev, /**< destination level */ + xint16 xyloc) /**< MIGR_xxx flag for location within destination */ { unstuck(mtmp); mdrop_special_objs(mtmp); @@ -3109,7 +3112,7 @@ elemental_clog(struct monst *mon) /* last resort - migrate mon to the next plane */ } else if (!Is_astralevel(&u.uz)) { d_level dest; - xchar target_lev; + coordxy target_lev; dest = u.uz; dest.dlevel--; @@ -3197,12 +3200,12 @@ maybe_mnexto(struct monst *mtmp) int mnearto( struct monst *mtmp, - xchar x, - xchar y, + coordxy x, + coordxy y, boolean move_other) /**< make sure mtmp gets to x, y! so move m_at(x, y) */ { struct monst *othermon = (struct monst *)0; - xchar newx, newy; + coordxy newx, newy; coord mm; int res = 1; @@ -3475,7 +3478,7 @@ wake_nearby(void) /* Wake up monsters near some particular location. */ void -wake_nearto(int x, int y, int distance) +wake_nearto(coordxy x, coordxy y, int distance) { struct monst *mtmp; @@ -3628,7 +3631,7 @@ hideunder(struct monst *mtmp) { struct trap *t; boolean undetected = FALSE, is_u = (mtmp == &youmonst); - xchar x = is_u ? u.ux : mtmp->mx, y = is_u ? u.uy : mtmp->my; + coordxy x = is_u ? u.ux : mtmp->mx, y = is_u ? u.uy : mtmp->my; if (mtmp == u.ustuck) { ; /* can't hide if holding you or held by you */ @@ -3664,7 +3667,7 @@ hide_monst(struct monst *mon) if ((is_hider(mon->data) || hider_under) && !(mon->mundetected || M_AP_TYPE(mon))) { - xchar x = mon->mx, y = mon->my; + coordxy x = mon->mx, y = mon->my; char save_viz = viz_array[y][x]; /* override vision, forcing hero to be unable to see monster's spot */ diff --git a/src/monmove.c b/src/monmove.c index 1c71a7f50..4075efcc6 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -139,7 +139,7 @@ dochugw(struct monst *mtmp) } boolean -onscary(int x, int y, struct monst *mtmp) +onscary(coordxy x, coordxy y, struct monst *mtmp) { /* creatures who are directly resistant to magical scaring: * @@ -794,7 +794,7 @@ itsstuck(struct monst *mtmp) * those should be used instead. This function does that evaluation. */ boolean -should_displace(struct monst *mtmp, coord *poss, long int *info, int cnt, xchar gx, xchar gy) +should_displace(struct monst *mtmp, coord *poss, long int *info, int cnt, coordxy gx, coordxy gy) /* coord poss[9] */ /* long info[9] */ @@ -833,7 +833,7 @@ should_displace(struct monst *mtmp, coord *poss, long int *info, int cnt, xchar } boolean -m_digweapon_check(struct monst *mtmp, xchar nix, xchar niy) +m_digweapon_check(struct monst *mtmp, coordxy nix, coordxy niy) { boolean can_tunnel = 0; struct obj *mw_tmp = MON_WEP(mtmp); @@ -877,7 +877,8 @@ int m_move(struct monst *mtmp, int after) { int appr; - xchar gx, gy, nix, niy, chcnt; + coordxy gx, gy, nix, niy; + xint16 chcnt; int chi; /* could be schar except for stupid Sun-2 compiler */ boolean likegold=0, likegems=0, likeobjs=0, likemagic=0, conceals=0; boolean likerock=0, can_tunnel=0, breakrock=0; @@ -961,7 +962,7 @@ m_move(struct monst *mtmp, int after) /* and the acquisitive monsters get special treatment */ if (is_covetous(ptr)) { - xchar tx = STRAT_GOALX(mtmp->mstrategy), + coordxy tx = STRAT_GOALX(mtmp->mstrategy), ty = STRAT_GOALY(mtmp->mstrategy); struct monst *intruder = m_at(tx, ty); /* @@ -1634,7 +1635,7 @@ nxti: ; * (mtmp died) or 3 (mtmp made its move). */ int -m_move_aggress(struct monst* mtmp, xchar x, xchar y) +m_move_aggress(struct monst* mtmp, coordxy x, coordxy y) { struct monst *mtmp2; int mstatus; @@ -1665,14 +1666,14 @@ m_move_aggress(struct monst* mtmp, xchar x, xchar y) } boolean -closed_door(int x, int y) +closed_door(coordxy x, coordxy y) { return((boolean)(IS_DOOR(levl[x][y].typ) && (levl[x][y].doormask & (D_LOCKED | D_CLOSED)))); } boolean -accessible(int x, int y) +accessible(coordxy x, coordxy y) { int levtyp = levl[x][y].typ; @@ -1755,7 +1756,7 @@ set_apparxy(struct monst *mtmp) boolean undesirable_disp( struct monst *mtmp, /**< barging creature */ - xchar x, xchar y) /**< spot 'mtmp' is considering moving to */ + coordxy x, coordxy y) /**< spot 'mtmp' is considering moving to */ { boolean is_pet = (mtmp && mtmp->mtame && !mtmp->isminion); struct trap *trap = t_at(x, y); diff --git a/src/mplayer.c b/src/mplayer.c index cc44e4826..e4929a37a 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -103,7 +103,7 @@ mk_mplayer_armor(struct monst *mon, short int typ) } struct monst * -mk_mplayer(struct permonst *ptr, xchar x, xchar y, boolean special) +mk_mplayer(struct permonst *ptr, coordxy x, coordxy y, boolean special) { struct monst *mtmp; char nam[PL_NSIZ]; @@ -311,7 +311,7 @@ create_mplayers(int num, boolean special) /* if pos not found in 50 tries, don't bother to continue */ if(tryct > 50) return; - (void) mk_mplayer(&mons[pm], (xchar)x, (xchar)y, special); + (void) mk_mplayer(&mons[pm], (coordxy)x, (coordxy)y, special); num--; } } diff --git a/src/mthrowu.c b/src/mthrowu.c index 57ad6c9b7..400e872dc 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -5,7 +5,7 @@ static int monmulti(struct monst *, struct obj *, struct obj *); static void monshoot(struct monst *, struct obj *, struct obj *); -static int drop_throw(struct obj *, boolean, int, int); +static int drop_throw(struct obj *, boolean, coordxy, coordxy); static boolean m_lined_up(struct monst *, struct monst *); #define URETREATING(x, y) (distmin(u.ux, u.uy, x, y) > distmin(u.ux0, u.uy0, x, y)) @@ -112,7 +112,7 @@ thitu( */ static int -drop_throw(struct obj *obj, boolean ohit, int x, int y) +drop_throw(struct obj *obj, boolean ohit, coordxy x, coordxy y) { int retvalu = 1; int create; @@ -490,7 +490,7 @@ ohitmon( void m_throw( struct monst *mon, /**< launching monster */ - int x, int y, /**< launch point */ + coordxy x, coordxy y, /**< launch point */ int dx, int dy, /**< direction */ int range, /**< maximum distance */ struct obj *obj) /**< missile (or stack providing it) */ @@ -719,7 +719,7 @@ int thrwmm(struct monst *mtmp, struct monst *mtarg) { struct obj *otmp, *mwep; - xchar x, y; + coordxy x, y; boolean ispole; /* Polearms won't be applied by monsters against other monsters */ @@ -907,7 +907,7 @@ void thrwmu(struct monst *mtmp) { struct obj *otmp, *mwep; - xchar x, y; + coordxy x, y; const char *onm; /* Rearranged beginning so monsters can use polearms not in a line */ @@ -1061,10 +1061,10 @@ breamu(struct monst *mtmp, struct attack *mattk) /* monster breathes at boolean linedup( - xchar ax, - xchar ay, - xchar bx, - xchar by, + coordxy ax, + coordxy ay, + coordxy bx, + coordxy by, int boulderhandling) /**< 0=block, 1=ignore, 2=conditionally block */ { int dx, dy, boulderspots; @@ -1255,7 +1255,7 @@ hit_bars(struct obj **obj_p, int objx, int objy, int barsx, int barsy, boolean y } void -dissolve_bars(int x, int y) +dissolve_bars(coordxy x, coordxy y) { levl[x][y].typ = (Is_special(&u.uz) || *in_rooms(x, y, 0)) ? ROOM : CORR; levl[x][y].flags = 0; diff --git a/src/muse.c b/src/muse.c index ea0eafa4c..1e56abc21 100644 --- a/src/muse.c +++ b/src/muse.c @@ -1328,7 +1328,7 @@ mbhit( ddy = sgn(mon->muy - mon->my); while(range-- > 0) { - int x, y; + coordxy x, y; bhitpos.x += ddx; bhitpos.y += ddy; diff --git a/src/music.c b/src/music.c index 93f033ffb..1073d2062 100644 --- a/src/music.c +++ b/src/music.c @@ -663,7 +663,7 @@ do_play_instrument(struct obj *instr) { char buf[BUFSZ] = DUMMY, c = 'y'; char *s; - int x, y; + coordxy x, y; boolean ok; if (Underwater) { diff --git a/src/objnam.c b/src/objnam.c index 40ec63d3a..8ef21132c 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1485,7 +1485,7 @@ doname_base(struct obj *obj, boolean with_price) if (iflags.suppress_price || restoring) { ; /* don't attempt to obtain any stop pricing, even if 'with_price' */ } else if (obj->unpaid) { - xchar ox, oy; + coordxy ox, oy; long quotedprice = unpaid_cost(obj, TRUE); struct monst *shkp = (struct monst *)0; diff --git a/src/pager.c b/src/pager.c index a2ffcb38a..31d3be9dc 100644 --- a/src/pager.c +++ b/src/pager.c @@ -9,7 +9,7 @@ static boolean is_swallow_sym(int); static int append_str(char *, const char *); -static struct permonst * lookat(int, int, char *, char *); +static struct permonst * lookat(coordxy, coordxy, char *, char *); static void look_all(boolean, boolean, boolean); static void add_obj_info(winid, struct obj *, short); static void add_mon_info(winid, struct permonst *); @@ -81,9 +81,9 @@ self_lookat(char *outbuf) detection and for probing; also when looking at self */ void mhidden_description(struct monst *mon, boolean altmon, char *outbuf) - + /* for probing: if mimicking a monster, say so */ - + { struct obj *otmp; boolean fakeobj, isyou = (mon == &youmonst); @@ -138,7 +138,7 @@ mhidden_description(struct monst *mon, boolean altmon, char *outbuf) /* extracted from lookat(); also used by namefloorobj() */ boolean -object_from_map(int glyph, int x, int y, struct obj **obj_p) +object_from_map(int glyph, coordxy x, coordxy y, struct obj **obj_p) { boolean fakeobj = FALSE, mimic_obj = FALSE; struct monst *mtmp; @@ -223,9 +223,9 @@ object_from_map(int glyph, int x, int y, struct obj **obj_p) } static void -look_at_object(char *buf, int x, int y, int glyph) +look_at_object(char *buf, coordxy x, coordxy y, int glyph) /* output buffer */ - + { struct obj *otmp = 0; boolean fakeobj = object_from_map(glyph, x, y, &otmp); @@ -258,10 +258,10 @@ look_at_object(char *buf, int x, int y, int glyph) } static void -look_at_monster(char *buf, char *monbuf, struct monst *mtmp, int x, int y) +look_at_monster(char *buf, char *monbuf, struct monst *mtmp, coordxy x, coordxy y) /* buf: output, monbuf: optional output */ - - + + { char *name, monnambuf[BUFSZ]; boolean accurate = !Hallucination; @@ -388,7 +388,7 @@ look_at_monster(char *buf, char *monbuf, struct monst *mtmp, int x, int y) * If not hallucinating and the glyph is a monster, also monster data. */ static struct permonst * -lookat(int x, int y, char *buf, char *monbuf) +lookat(coordxy x, coordxy y, char *buf, char *monbuf) { struct monst *mtmp = (struct monst *) 0; struct permonst *pm = (struct permonst *) 0; diff --git a/src/pickup.c b/src/pickup.c index fd573a4c3..cbfe57854 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -32,7 +32,7 @@ static int traditional_loot(boolean); static int menu_loot(int, boolean); static char in_or_out_menu(const char *, struct obj *, boolean, boolean, boolean, boolean); static boolean able_to_loot(int, int, boolean); -static boolean mon_beside(int, int); +static boolean mon_beside(coordxy, coordxy); static int do_loot_cont(struct obj **, int, int); static int dump_container(struct obj*, boolean); static void del_sokoprize(void); @@ -1717,7 +1717,7 @@ encumber_msg(void) /* Is there a container at x,y. Optional: return count of containers at x,y */ int -container_at(int x, int y, boolean countem) +container_at(coordxy x, coordxy y, boolean countem) { struct obj *cobj, *nobj; int container_count = 0; @@ -1773,7 +1773,7 @@ able_to_loot( } static boolean -mon_beside(int x, int y) +mon_beside(coordxy x, coordxy y) { int i, j, nx, ny; @@ -2544,7 +2544,7 @@ observe_quantum_cat(struct obj *box, boolean past) static NEARDATA const char sc[] = "Schroedinger's Cat"; struct obj *deadcat; struct monst *livecat = 0; - xchar ox, oy; + coordxy ox, oy; boolean itsalive = rn2(2); box->spe = 0; /* box->owt will be updated below */ @@ -2601,7 +2601,7 @@ open_coffin(struct obj *box, boolean past) /* static NEARDATA const char sc[] = "Schroedinger's Cat"; */ /* Would be nice to name the vampire and put the name on the coffin. But not today. */ struct monst *vampire; - xchar ox, oy; + coordxy ox, oy; pline("That %s %s, it%s a coffin!", past ? "wasn't" : "isn't", an(simple_typename(box->otyp)), past ? " was" : "'s"); diff --git a/src/pray.c b/src/pray.c index d4cb819fd..708a8219b 100644 --- a/src/pray.c +++ b/src/pray.c @@ -2087,7 +2087,7 @@ doturn(void) } int -altarmask_at(int x, int y) +altarmask_at(coordxy x, coordxy y) { int res = 0; @@ -2112,7 +2112,7 @@ a_gname(void) /* returns the name of an altar's deity */ const char * -a_gname_at(xchar x, xchar y) +a_gname_at(coordxy x, coordxy y) { if(!IS_ALTAR(levl[x][y].typ)) return((char *)0); @@ -2236,7 +2236,7 @@ align_gtitle(aligntyp alignment) } void -altar_wrath(int x, int y) +altar_wrath(coordxy x, coordxy y) { aligntyp altaralign = a_align(x, y); diff --git a/src/priest.c b/src/priest.c index 31219e9e4..5312df1a3 100644 --- a/src/priest.c +++ b/src/priest.c @@ -8,7 +8,7 @@ #define ALGN_SINNED (-4) /* worse than strayed */ #define ALGN_PIOUS 14 /* better than fervent (9..13) */ -static boolean histemple_at(struct monst *, xchar, xchar); +static boolean histemple_at(struct monst *, coordxy, coordxy); static boolean has_shrine(struct monst *); void @@ -37,9 +37,9 @@ free_epri(struct monst *mtmp) * Valid returns are 1: moved 0: didn't -1: let m_move do it -2: died. */ int -move_special(struct monst *mtmp, boolean in_his_shop, schar appr, boolean uondoor, boolean avoid, xchar omx, xchar omy, xchar gx, xchar gy) +move_special(struct monst *mtmp, boolean in_his_shop, schar appr, boolean uondoor, boolean avoid, coordxy omx, coordxy omy, coordxy gx, coordxy gy) { - xchar nx, ny, nix, niy; + coordxy nx, ny, nix, niy; schar i; schar chcnt, cnt; coord poss[9]; @@ -152,7 +152,7 @@ temple_occupied(char *array) } static boolean -histemple_at(struct monst *priest, xchar x, xchar y) +histemple_at(struct monst *priest, coordxy x, coordxy y) { return (boolean) (priest && priest->ispriest && (EPRI(priest)->shroom == *in_rooms(x, y, TEMPLE)) && @@ -180,7 +180,7 @@ inhistemple(struct monst *priest) int pri_move(struct monst *priest) { - xchar gx, gy, omx, omy; + coordxy gx, gy, omx, omy; schar temple; boolean avoid = TRUE; @@ -654,7 +654,7 @@ priest_talk(struct monst *priest) } struct monst * -mk_roamer(struct permonst *ptr, aligntyp alignment, xchar x, xchar y, boolean peaceful) +mk_roamer(struct permonst *ptr, aligntyp alignment, coordxy x, coordxy y, boolean peaceful) { struct monst *roamer; boolean coaligned = (u.ualign.type == alignment); @@ -697,7 +697,7 @@ reset_hostility(struct monst *roamer) } boolean -in_your_sanctuary(struct monst *mon, xchar x, xchar y) +in_your_sanctuary(struct monst *mon, coordxy x, coordxy y) /* if non-null, overrides */ { diff --git a/src/read.c b/src/read.c index d86cf4fdb..991580926 100644 --- a/src/read.c +++ b/src/read.c @@ -34,9 +34,9 @@ static void forget(int); #endif static int maybe_tame(struct monst *, struct obj *); -static void do_flood(int, int, genericptr_t); -static void undo_flood(int, int, genericptr_t); -static void set_lit(int, int, genericptr_t); +static void do_flood(coordxy, coordxy, genericptr_t); +static void undo_flood(coordxy, coordxy, genericptr_t); +static void set_lit(coordxy, coordxy, genericptr_t); static boolean learn_scroll_typ(short scrolltyp, boolean verbose) @@ -1020,7 +1020,7 @@ void forget_levels(int percent) { int i, count; - xchar maxl, this_lev; + coordxy maxl, this_lev; int indices[MAXLINFO]; if (percent == 0) return; @@ -1134,7 +1134,7 @@ maybe_tame(struct monst *mtmp, struct obj *sobj) /** Remove water tile at x,y. */ static void -undo_flood(int x, int y, genericptr_t roomcnt) +undo_flood(coordxy x, coordxy y, genericptr_t roomcnt) { if ((levl[x][y].typ != POOL) && (levl[x][y].typ != MOAT) && @@ -1150,7 +1150,7 @@ undo_flood(int x, int y, genericptr_t roomcnt) } static void -do_flood(int x, int y, genericptr_t poolcnt) +do_flood(coordxy x, coordxy y, genericptr_t poolcnt) { struct monst *mtmp; struct trap *ttmp; @@ -1182,7 +1182,7 @@ do_flood(int x, int y, genericptr_t poolcnt) } static boolean -get_valid_stinking_cloud_pos(int x, int y) +get_valid_stinking_cloud_pos(coordxy x, coordxy y) { return (!(!isok(x,y) || !cansee(x, y) || @@ -1191,7 +1191,7 @@ get_valid_stinking_cloud_pos(int x, int y) } static boolean -is_valid_stinking_cloud_pos(int x, int y, boolean showmsg) +is_valid_stinking_cloud_pos(coordxy x, coordxy y, boolean showmsg) { if (!get_valid_stinking_cloud_pos(x,y)) { if (showmsg) { @@ -2149,7 +2149,7 @@ static struct litmon *gremlins = 0; * Low-level lit-field update routine. */ static void -set_lit(int x, int y, genericptr_t val) +set_lit(coordxy x, coordxy y, genericptr_t val) { struct monst *mtmp; struct litmon *gremlin; diff --git a/src/region.c b/src/region.c index f14d1ef0d..b1bb6561c 100644 --- a/src/region.c +++ b/src/region.c @@ -20,8 +20,8 @@ static int max_regions = 0; boolean inside_gas_cloud(genericptr, genericptr); boolean expire_gas_cloud(genericptr, genericptr); boolean revive_cthulhu(genericptr, genericptr); -boolean inside_rect(NhRect *, int, int); -boolean inside_region(NhRegion *, int, int); +boolean inside_rect(NhRect *, coordxy, coordxy); +boolean inside_region(NhRegion *, coordxy, coordxy); NhRegion *create_region(NhRect *, int); void add_rect_to_reg(NhRegion *, NhRect *); void add_mon_to_reg(NhRegion *, struct monst *); @@ -38,9 +38,9 @@ void remove_region(NhRegion *); #if 0 void replace_mon_regions(struct monst *, struct monst *); void remove_mon_from_regions(struct monst *); -NhRegion *create_msg_region(xchar, xchar, xchar, xchar, const char *, const char *); +NhRegion *create_msg_region(coordxy, coordxy, coordxy, coordxy, const char *, const char *); boolean enter_force_field(genericptr, genericptr); -NhRegion *create_force_field(xchar, xchar, int, int); +NhRegion *create_force_field(coordxy, coordxy, int, int); #endif static void reset_region_mids(NhRegion *); @@ -56,7 +56,7 @@ static callback_proc callbacks[] = { /* Should be inlined. */ boolean -inside_rect(NhRect *r, int x, int y) +inside_rect(NhRect *r, coordxy x, coordxy y) { return (x >= r->lx && x <= r->hx && y >= r->ly && y <= r->hy); } @@ -65,7 +65,7 @@ inside_rect(NhRect *r, int x, int y) * Check if a point is inside a region. */ boolean -inside_region(NhRegion *reg, int x, int y) +inside_region(NhRegion *reg, coordxy x, coordxy y) { int i; @@ -415,7 +415,7 @@ run_regions(void) * check whether player enters/leaves one or more regions. */ boolean -in_out_region(xchar x, xchar y) +in_out_region(coordxy x, coordxy y) { int i, f_indx; @@ -464,7 +464,7 @@ in_out_region(xchar x, xchar y) * check whether a monster enters/leaves one or more regions. */ boolean -m_in_out_region(struct monst *mon, xchar x, xchar y) +m_in_out_region(struct monst *mon, coordxy x, coordxy y) { int i, f_indx; @@ -582,7 +582,7 @@ struct monst *mon; * Returns NULL if not, otherwise returns region. */ NhRegion * -visible_region_at(xchar x, xchar y) +visible_region_at(coordxy x, coordxy y) { int i; @@ -598,7 +598,7 @@ visible_region_at(xchar x, xchar y) } void -show_region(NhRegion *reg, xchar x, xchar y) +show_region(NhRegion *reg, coordxy x, coordxy y) { show_glyph(x, y, reg->glyph); } @@ -797,8 +797,8 @@ reset_region_mids(NhRegion *reg) NhRegion * create_msg_region(x, y, w, h, msg_enter, msg_leave) -xchar x, y; -xchar w, h; +coordxy x, y; +coordxy w, h; const char *msg_enter; const char *msg_leave; { @@ -851,7 +851,7 @@ genericptr_t p2; NhRegion * create_force_field(x, y, radius, ttl) -xchar x, y; +coordxy x, y; int radius, ttl; { int i; @@ -1014,7 +1014,7 @@ inside_gas_cloud(genericptr_t p1, genericptr_t p2) } NhRegion * -create_cthulhu_death_cloud(xchar x, xchar y, int radius, size_t damage, int duration) +create_cthulhu_death_cloud(coordxy x, coordxy y, int radius, size_t damage, int duration) { NhRegion *cloud; @@ -1025,7 +1025,7 @@ create_cthulhu_death_cloud(xchar x, xchar y, int radius, size_t damage, int dura } NhRegion * -create_gas_cloud(xchar x, xchar y, int radius, size_t damage, int duration) +create_gas_cloud(coordxy x, coordxy y, int radius, size_t damage, int duration) { NhRegion *cloud; int i, nrect; diff --git a/src/restore.c b/src/restore.c index 86b1aeb81..a58f2fa83 100644 --- a/src/restore.c +++ b/src/restore.c @@ -30,7 +30,7 @@ static void freefruitchn(struct fruit *); static void ghostfruit(struct obj *); static boolean restgamestate(int, unsigned int *, unsigned int *); static void restlevelstate(unsigned int, unsigned int); -static int restlevelfile(int, xchar); +static int restlevelfile(int, xint8); static void reset_oattached_mids(boolean); /* @@ -673,7 +673,7 @@ restlevelstate(unsigned int stuckid, unsigned int steedid) static int restlevelfile( int fd UNUSED, /**< fd used in MFLOPPY only */ - xchar ltmp + xint8 ltmp ) #if defined(macintosh) && (defined(__SC__) || defined(__MRC__)) # pragma unused(fd) @@ -737,7 +737,7 @@ int dorecover(int fd) { unsigned int stuckid = 0, steedid = 0; /* not a */ - xchar ltmp; + xint8 ltmp; int rtmp; struct obj *otmp; @@ -746,7 +746,7 @@ dorecover(int fd) #endif restoring = TRUE; - getlev(fd, 0, (xchar)0, FALSE); + getlev(fd, 0, (xint8)0, FALSE); if (!restgamestate(fd, &stuckid, &steedid)) { display_nhwindow(WIN_MESSAGE, TRUE); savelev(-1, 0, FREE_SAVE); /* discard current level */ @@ -825,7 +825,7 @@ dorecover(int fd) #ifdef STORE_PLNAME_IN_FILE mread(fd, (genericptr_t) plname, PL_NSIZ); #endif - getlev(fd, 0, (xchar)0, FALSE); + getlev(fd, 0, (xint8)0, FALSE); (void) close(fd); if (!wizard && !discover) @@ -924,13 +924,13 @@ trickery(char *reason) } void -getlev(int fd, int pid, xchar lev, boolean ghostly) +getlev(int fd, int pid, xint8 lev, boolean ghostly) { struct trap *trap; struct monst *mtmp; branch *br; int hpid; - xchar dlvl; + xint8 dlvl; int x, y; #ifdef TOS short tlev; diff --git a/src/save.c b/src/save.c index fc2caab22..ec8e49265 100644 --- a/src/save.c +++ b/src/save.c @@ -36,7 +36,7 @@ static void savegamestate(int, int); void save_mongen_override(int, struct mon_gen_override *, int); void save_lvl_sounds(int, struct lvl_sounds *, int); #ifdef MFLOPPY -static void savelev0(int, xchar, int); +static void savelev0(int, xint8, int); static boolean swapout_oldest(); static void copyfile(char *, char *); #endif /* MFLOPPY */ @@ -135,7 +135,7 @@ dosave0(void) { const char *fq_save; int fd, ofd; - xchar ltmp; + xint8 ltmp; d_level uz_save; char whynot[BUFSZ]; @@ -266,7 +266,7 @@ dosave0(void) u.ustuck = (struct monst *)0; u.usteed = (struct monst *)0; - for(ltmp = (xchar)1; ltmp <= maxledgerno(); ltmp++) { + for (ltmp = (xint8)1; ltmp <= maxledgerno(); ltmp++) { if (ltmp == ledger_no(&uz_save)) continue; if (!(level_info[ltmp].flags & LFILE_EXISTS)) continue; #ifdef MICRO @@ -450,7 +450,7 @@ savestateinlock(void) boolean savelev(fd, lev, mode) int fd; -xchar lev; +xint8 lev; int mode; { if (mode & COUNT_SAVE) { @@ -481,7 +481,7 @@ static void savelev0(fd, lev, mode) #else void -savelev(int fd, xchar lev, int mode) +savelev(int fd, xint8 lev, int mode) #endif diff --git a/src/shk.c b/src/shk.c index b5f24ad81..7ee865988 100644 --- a/src/shk.c +++ b/src/shk.c @@ -483,7 +483,7 @@ bars_around_portal(boolean removebars) /* x,y is strictly inside shop */ char -inside_shop(xchar x, xchar y) +inside_shop(coordxy x, coordxy y) { char rno; @@ -554,7 +554,7 @@ u_left_shop(char *leavestring, boolean newlev) /* robbery from outside the shop via telekinesis or grappling hook */ void -remote_burglary(xchar x, xchar y) +remote_burglary(coordxy x, coordxy y) { struct monst *shkp; struct eshk *eshkp; @@ -1172,7 +1172,7 @@ pay(long int tmp, struct monst *shkp) void home_shk(struct monst *shkp, boolean killkops) { - xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y; + coordxy x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y; (void) mnearto(shkp, x, y, TRUE); level.flags.has_shop = 1; @@ -1315,7 +1315,7 @@ hot_pursuit(struct monst *shkp) * must be checked by the calling function. */ void -make_angry_shk(struct monst *shkp, xchar ox UNUSED, xchar oy UNUSED) +make_angry_shk(struct monst *shkp, coordxy ox UNUSED, coordxy oy UNUSED) /* predate 'noit_Monnam()', let alone Shknam() */ { struct eshk *eshkp = ESHK(shkp); @@ -2019,7 +2019,7 @@ inherits(struct monst *shkp, int numsk, int croaked, boolean silently) static void set_repo_loc(struct monst *shkp) { - xchar ox, oy; + coordxy ox, oy; struct eshk *eshkp = ESHK(shkp); /* if you're not in this shk's shop room, or if you're in its doorway @@ -2137,7 +2137,7 @@ long get_cost_of_shop_item(struct obj *obj) { struct monst *shkp; - xchar x, y; + coordxy x, y; int cost=0; if (get_obj_location(obj, &x, &y, 0) && @@ -2260,7 +2260,7 @@ long contained_cost(struct obj *obj, struct monst *shkp, long int price, boolean usell, boolean unpaid_only) { struct obj *otmp, *top; - xchar x, y; + coordxy x, y; boolean on_floor, freespot; for (top = obj; top->where == OBJ_CONTAINED; top = top->ocontainer) { @@ -2496,7 +2496,7 @@ unpaid_cost(struct obj *unp_obj, boolean include_contents) struct bill_x *bp = (struct bill_x *)0; struct monst *shkp; long amt = 0L; - xchar ox, oy; + coordxy ox, oy; if (!get_obj_location(unp_obj, &ox, &oy, BURIED_TOO | CONTAINED_TOO)) { ox = u.ux, oy = u.uy; /* (shouldn't happen) */ @@ -2939,7 +2939,7 @@ stolen_container(struct obj *obj, struct monst *shkp, long int price, boolean in } long -stolen_value(struct obj *obj, xchar x, xchar y, boolean peaceful, boolean silent) +stolen_value(struct obj *obj, coordxy x, coordxy y, boolean peaceful, boolean silent) { long value = 0L, gvalue = 0L, billamt = 0L; char roomno = *in_rooms(x, y, SHOPBASE); @@ -3069,7 +3069,7 @@ sellobj_state(int deliberate) auto_credit = FALSE; } void -sellobj(struct obj *obj, xchar x, xchar y) +sellobj(struct obj *obj, coordxy x, coordxy y) { struct monst *shkp; struct eshk *eshkp; @@ -3454,7 +3454,7 @@ getprice(struct obj *obj, boolean shk_buying) /* shk catches thrown pick-axe */ struct monst * -shkcatch(struct obj *obj, xchar x, xchar y) +shkcatch(struct obj *obj, coordxy x, coordxy y) { struct monst *shkp; @@ -3487,7 +3487,7 @@ shkcatch(struct obj *obj, xchar x, xchar y) } void -add_damage(xchar x, xchar y, long int cost) +add_damage(coordxy x, coordxy y, long int cost) { struct damage *tmp_dam; char *shops; @@ -3656,8 +3656,8 @@ repair_damage( struct damage *tmp_dam, boolean catchup) /**< restoring a level */ { - xchar x, y; - xchar litter[9]; + coordxy x, y; + xint16 litter[9]; struct monst *mtmp; struct obj *otmp; struct trap *ttmp; @@ -3821,7 +3821,7 @@ repair_damage( int shk_move(struct monst *shkp) { - xchar gx, gy, omx, omy; + coordxy gx, gy, omx, omy; int udist; schar appr; struct eshk *eshkp = ESHK(shkp); @@ -4108,7 +4108,7 @@ pay_for_damage(const char *dmgstr, boolean cant_mollify) char shops_affected[5]; boolean uinshp = (*u.ushops != '\0'); char qbuf[80]; - xchar x, y; + coordxy x, y; boolean dugwall = !strcmp(dmgstr, "dig into") || /* wand */ !strcmp(dmgstr, "damage"); /* pick-axe */ boolean animal, pursue; @@ -4292,7 +4292,7 @@ pay_for_damage(const char *dmgstr, boolean cant_mollify) /* called in dokick.c when we kick an object that might be in a store */ boolean -costly_spot(xchar x, xchar y) +costly_spot(coordxy x, coordxy y) { struct monst *shkp; @@ -4312,7 +4312,7 @@ costly_spot(xchar x, xchar y) /* called by dotalk(sounds.c) when #chatting; returns obj if location contains shop goods and shopkeeper is willing & able to speak */ struct obj * -shop_object(xchar x, xchar y) +shop_object(coordxy x, coordxy y) { struct obj *otmp; struct monst *shkp; @@ -4655,7 +4655,7 @@ check_unpaid(struct obj *otmp) } void -costly_gold(xchar x, xchar y, long int amount) +costly_gold(coordxy x, coordxy y, long int amount) { long delta; struct monst *shkp; @@ -4690,7 +4690,7 @@ costly_gold(xchar x, xchar y, long int amount) /* used in domove to block diagonal shop-exit */ /* x,y should always be a door */ boolean -block_door(xchar x, xchar y) +block_door(coordxy x, coordxy y) { int roomno = *in_rooms(x, y, SHOPBASE); struct monst *shkp; @@ -4720,9 +4720,9 @@ block_door(xchar x, xchar y) /* used in domove to block diagonal shop-entry */ /* u.ux, u.uy should always be a door */ boolean -block_entry(xchar x, xchar y) +block_entry(coordxy x, coordxy y) { - xchar sx, sy; + coordxy sx, sy; int roomno; struct monst *shkp; @@ -4777,7 +4777,7 @@ static char * shk_owns(char *buf, struct obj *obj) { struct monst *shkp; - xchar x, y; + coordxy x, y; if (get_obj_location(obj, &x, &y, 0) && (obj->unpaid || diff --git a/src/sp_lev.c b/src/sp_lev.c index 18f97ae2c..e91bd1bdc 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -26,20 +26,20 @@ extern void mkmap(lev_init *); -static void get_room_loc(schar *, schar *, struct mkroom *); -static void get_free_room_loc(schar *, schar *, struct mkroom *, packed_coord); +static void get_room_loc(coordxy *, coordxy *, struct mkroom *); +static void get_free_room_loc(coordxy *, coordxy *, struct mkroom *, packed_coord); static void create_trap(trap *, struct mkroom *); static int noncoalignment(aligntyp); static void create_monster(monster *, struct mkroom *); static void create_object(object *, struct mkroom *); static void create_altar(altar *, struct mkroom *); -static boolean search_door(struct mkroom *, xchar *, xchar *, xchar, int); +static boolean search_door(struct mkroom *, coordxy *, coordxy *, xint16, int); static void fix_stair_rooms(void); static void create_corridor(corridor *); static void count_features(void); -static boolean create_subroom(struct mkroom *, xchar, xchar, - xchar, xchar, xchar, xchar); +static boolean create_subroom(struct mkroom *, coordxy, coordxy, + coordxy, coordxy, xint16, xint16); long opvar_array_length(struct sp_coder *); @@ -71,13 +71,13 @@ extern int min_rx, max_rx, min_ry, max_ry; /* from mkmap.c */ char SpLev_Map[COLNO][ROWNO]; static aligntyp ralign[3] = { AM_CHAOTIC, AM_NEUTRAL, AM_LAWFUL }; -static NEARDATA xchar xstart, ystart; -static NEARDATA char xsize, ysize; +static coordxy xstart, ystart; +static char xsize, ysize; -static void set_wall_property(xchar, xchar, xchar, xchar, int); +static void set_wall_property(coordxy, coordxy, coordxy, coordxy, int); static int rnddoor(void); static int rndtrap(void); -static void get_location(schar *, schar *, int, struct mkroom *); +static void get_location(coordxy *, coordxy *, int, struct mkroom *); static void light_region(region *); static void maze1xy(coord *, int); static boolean sp_level_loader(dlb *, sp_lev *); @@ -101,7 +101,7 @@ static struct monst *invent_carrying_monster = NULL; void solidify_map(void) { - xchar x, y; + coordxy x, y; for (x = 0; x < COLNO; x++) { for (y = 0; y < ROWNO; y++) { @@ -254,7 +254,7 @@ opvar_new_int(long int i) } struct opvar * -opvar_new_coord(int x, int y) +opvar_new_coord(coordxy x, coordxy y) { struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); if (!tmpov) panic("could not alloc opvar struct"); @@ -389,7 +389,7 @@ opvar_var_defined(struct sp_coder *coder, char *name) } struct opvar * -splev_stack_getdat(struct sp_coder *coder, xchar typ) +splev_stack_getdat(struct sp_coder *coder, coordxy typ) { if (coder && coder->stack) { struct opvar *tmp = splev_stack_pop(coder->stack); @@ -860,9 +860,9 @@ flip_level_rnd(int flp) * Make walls of the area (x1, y1, x2, y2) non diggable/non passwall-able */ static void -set_wall_property(xchar x1, xchar y1, xchar x2, xchar y2, int prop) +set_wall_property(coordxy x1, coordxy y1, coordxy x2, coordxy y2, int prop) { - xchar x, y; + coordxy x, y; struct rm *lev; x1 = max(x1, 1); @@ -898,7 +898,7 @@ shuffle_alignments(void) static void count_features(void) { - xchar x, y; + coordxy x, y; level.flags.nfountains = level.flags.nsinks = 0; for (y = 0; y < ROWNO; y++) @@ -919,7 +919,7 @@ remove_boundary_syms(void) * are laid out. CROSSWALLS are used to specify "invisible" * boundaries where DOOR syms look bad or aren't desirable. */ - xchar x, y; + coordxy x, y; boolean has_bounds = FALSE; for (x = 0; x < COLNO-1; x++) @@ -938,7 +938,7 @@ remove_boundary_syms(void) } /* used by sel_set_door() and link_doors_rooms() */ static void -set_door_orientation(int x, int y) +set_door_orientation(coordxy x, coordxy y) { boolean wleft, wright, wup, wdown; @@ -984,7 +984,7 @@ set_door_orientation(int x, int y) } static void -maybe_add_door(int x, int y, struct mkroom *droom) +maybe_add_door(coordxy x, coordxy y, struct mkroom *droom) { if (droom->hx >= 0 && doorindex < DOORMAX && inside_room(droom, x, y)) { int i; @@ -1087,7 +1087,10 @@ rndtrap(void) static boolean is_ok_location(schar, schar, int); static void -get_location(schar *x, schar *y, int humidity, struct mkroom *croom) +get_location( + coordxy *x, coordxy *y, + int humidity, + struct mkroom *croom) { int cpt = 0; int mx, my, sx, sy; @@ -1194,7 +1197,11 @@ get_unpacked_coord(long int loc, int defhumidity) } static void -get_location_coord(schar *x, schar *y, int humidity, struct mkroom *croom, long int crd) +get_location_coord( + coordxy *x, coordxy *y, + int humidity, + struct mkroom *croom, + long crd) { unpacked_coord c; @@ -1213,7 +1220,7 @@ get_location_coord(schar *x, schar *y, int humidity, struct mkroom *croom, long */ static void -get_room_loc(schar *x, schar *y, struct mkroom *croom) +get_room_loc(coordxy *x, coordxy *y, struct mkroom *croom) { coord c; @@ -1239,9 +1246,12 @@ get_room_loc(schar *x, schar *y, struct mkroom *croom) */ static void -get_free_room_loc(schar *x, schar *y, struct mkroom *croom, long int pos) +get_free_room_loc( + coordxy *x, coordxy *y, + struct mkroom *croom, + long int pos) { - schar try_x, try_y; + coordxy try_x, try_y; int trycnt = 0; get_location_coord(&try_x, &try_y, DRY, croom, pos); @@ -1258,12 +1268,12 @@ get_free_room_loc(schar *x, schar *y, struct mkroom *croom, long int pos) } boolean -check_room(xchar *lowx, xchar *ddx, xchar *lowy, xchar *ddy, boolean vault) +check_room(coordxy *lowx, coordxy *ddx, coordxy *lowy, coordxy *ddy, boolean vault) { int x, y, hix = *lowx + *ddx, hiy = *lowy + *ddy; struct rm *lev; int xlim, ylim, ymax; - xchar s_lowx, s_ddx, s_lowy, s_ddy; + coordxy s_lowx, s_ddx, s_lowy, s_ddy; s_lowx = *lowx; s_ddx = *ddx; s_lowy = *lowy; s_ddy = *ddy; @@ -1324,9 +1334,13 @@ check_room(xchar *lowx, xchar *ddx, xchar *lowy, xchar *ddy, boolean vault) * This is still very incomplete... */ boolean -create_room(xchar x, xchar y, xchar w, xchar h, xchar xal, xchar yal, xchar rtype, xchar rlit) +create_room( + coordxy x, coordxy y, + coordxy w, coordxy h, + coordxy xal, coordxy yal, + xint16 rtype, xint16 rlit) { - xchar xabs, yabs; + coordxy xabs, yabs; int wtmp, htmp, xaltmp, yaltmp, xtmp, ytmp; NhRect *r1 = 0, r2; int trycnt = 0; @@ -1355,7 +1369,7 @@ create_room(xchar x, xchar y, xchar w, xchar h, xchar xal, xchar yal, xchar rtyp * it up. */ do { - xchar xborder, yborder; + coordxy xborder, yborder; wtmp = w; htmp = h; xtmp = x; ytmp = y; xaltmp = xal; yaltmp = yal; @@ -1364,7 +1378,7 @@ create_room(xchar x, xchar y, xchar w, xchar h, xchar xal, xchar yal, xchar rtyp if((xtmp < 0 && ytmp <0 && wtmp < 0 && xaltmp < 0 && yaltmp < 0) || vault) { - xchar hx, hy, lx, ly, dx, dy; + coordxy hx, hy, lx, ly, dx, dy; r1 = rnd_rect(); /* Get a random rectangle */ if (!r1) { /* No more free rectangles ! */ @@ -1412,7 +1426,7 @@ create_room(xchar x, xchar y, xchar w, xchar h, xchar xal, xchar yal, xchar rtyp r2.hy = yabs + htmp; } else { /* Only some parameters are random */ int rndpos = 0; - xchar dx, dy; + coordxy dx, dy; if (xtmp < 0 && ytmp < 0) { /* Position is RANDOM */ xtmp = rnd(5); ytmp = rnd(5); @@ -1498,9 +1512,13 @@ create_room(xchar x, xchar y, xchar w, xchar h, xchar xal, xchar yal, xchar rtyp * x & y are relative to the parent room. */ static boolean -create_subroom(struct mkroom *proom, xchar x, xchar y, xchar w, xchar h, xchar rtype, xchar rlit) +create_subroom( + struct mkroom *proom, + coordxy x, coordxy y, + coordxy w, coordxy h, + xint16 rtype, xint16 rlit) { - xchar width, height; + coordxy width, height; width = proom->hx - proom->lx + 1; height = proom->hy - proom->ly + 1; @@ -1633,9 +1651,9 @@ redoloop:; void create_secret_door( struct mkroom *croom, - xchar walls) /**< any of W_NORTH | W_SOUTH | W_EAST | W_WEST (or W_ANY) */ + coordxy walls) /**< any of W_NORTH | W_SOUTH | W_EAST | W_WEST (or W_ANY) */ { - xchar sx, sy; /* location of the secret door */ + coordxy sx, sy; /* location of the secret door */ int count; for(count = 0; count < 100; count++) { @@ -1674,7 +1692,7 @@ create_secret_door( static void create_trap(trap *t, struct mkroom *croom) { - schar x = -1, y = -1; + coordxy x = -1, y = -1; coord tm; if (croom) @@ -1696,7 +1714,7 @@ create_trap(trap *t, struct mkroom *croom) static void spill_terrain(spill *sp, struct mkroom *croom) { - schar x, y, nx, ny, qx, qy; + coordxy x, y, nx, ny, qx, qy; int j, k, lastdir, guard; boolean found = FALSE; @@ -1785,7 +1803,7 @@ noncoalignment(aligntyp alignment) /* attempt to screen out locations where a mimic-as-boulder shouldn't occur */ static boolean -m_bad_boulder_spot(int x, int y) +m_bad_boulder_spot(coordxy x, coordxy y) { struct rm *lev; @@ -1833,7 +1851,7 @@ static void create_monster(monster *m, struct mkroom *croom) { struct monst *mtmp; - schar x, y; + coordxy x, y; char class; aligntyp amask; coord cc; @@ -2080,7 +2098,7 @@ static void create_object(object *o, struct mkroom *croom) { struct obj *otmp; - schar x, y; + coordxy x, y; char c; boolean named; /* has a name been supplied in level description? */ @@ -2315,7 +2333,8 @@ create_object(object *o, struct mkroom *croom) static void create_altar(altar *a, struct mkroom *croom) { - schar sproom, x = -1, y = -1; + schar sproom; + coordxy x = -1, y = -1; aligntyp amask; boolean croom_is_temple = TRUE; int oldtyp; @@ -2369,7 +2388,7 @@ create_altar(altar *a, struct mkroom *croom) void replace_terrain(replaceterrain *terr, struct mkroom *croom) { - schar x, y, x1, y1, x2, y2; + coordxy x, y, x1, y1, x2, y2; if (terr->toter >= MAX_TYPE) return; @@ -2391,7 +2410,10 @@ replace_terrain(replaceterrain *terr, struct mkroom *croom) * Search for a door in a room on a specified wall. */ static boolean -search_door(struct mkroom *croom, xchar *x, xchar *y, xchar wall, int cnt) +search_door( + struct mkroom *croom, + coordxy *x, coordxy *y, + xint16 wall, int cnt) { int dx, dy; int xx, yy; @@ -2708,7 +2730,7 @@ build_room(room *r, struct mkroom *mkr) { boolean okroom; struct mkroom *aroom; - xchar rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM; + xint16 rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM; if(mkr) { aroom = &subrooms[nsubroom]; @@ -2812,7 +2834,7 @@ maze1xy(coord *m, int humidity) } while (!(x % 2) || !(y % 2) || !SpLev_Map[x][y] || !is_ok_location((schar)x, (schar)y, humidity)); - m->x = (xchar)x, m->y = (xchar)y; + m->x = (coordxy)x, m->y = (coordxy)y; } /* @@ -2826,7 +2848,7 @@ static void fill_empty_maze(void) { int mapcountmax, mapcount, mapfact; - xchar x, y; + coordxy x, y; coord mm; mapcountmax = mapcount = (x_maze_max - 2) * (y_maze_max - 2); @@ -3128,7 +3150,7 @@ spo_corefunc(struct sp_coder *coder, long int fn) struct opvar *obj; struct opvar *crd; int otyp; - schar ox, oy; + coordxy ox, oy; if (!OV_pop_c(crd) || !OV_pop_typ(obj, SPOVAR_OBJ)) { impossible("No coord and obj for obj_at()"); return; @@ -3149,7 +3171,7 @@ spo_corefunc(struct sp_coder *coder, long int fn) long rv = 0; struct opvar *mon; struct opvar *crd; - schar ox, oy; + coordxy ox, oy; if (!OV_pop_c(crd) || !OV_pop_typ(mon, SPOVAR_MONST)) { impossible("No coord and mon for mon_at()"); return; @@ -3780,7 +3802,7 @@ void spo_engraving(struct sp_coder *coder) { struct opvar *etyp, *txt, *coord; - xchar x, y; + coordxy x, y; if (!OV_pop_i(etyp) || !OV_pop_s(txt) || @@ -3904,7 +3926,7 @@ spo_endroom(struct sp_coder *coder) void spo_stair(struct sp_coder *coder) { - xchar x, y; + coordxy x, y; struct opvar *up, *coord; struct trap *badtrap; @@ -3925,7 +3947,7 @@ spo_stair(struct sp_coder *coder) void spo_ladder(struct sp_coder *coder) { - xchar x, y; + coordxy x, y; struct opvar *up, *coord; if (!OV_pop_i(up) || @@ -3950,7 +3972,7 @@ void spo_grave(struct sp_coder *coder) { struct opvar *coord, *typ, *txt; - schar x, y; + coordxy x, y; if (!OV_pop_i(typ) || !OV_pop_s(txt) || !OV_pop_c(coord)) return; @@ -3996,7 +4018,7 @@ void spo_wallwalk(struct sp_coder *coder) { struct opvar *coord, *fgtyp, *bgtyp, *chance; - xchar x, y; + coordxy x, y; if (!OV_pop_i(chance) || !OV_pop_typ(bgtyp, SPOVAR_MAPCHAR) || @@ -4038,7 +4060,7 @@ void spo_gold(struct sp_coder *coder) { struct opvar *coord, *amt; - schar x, y; + coordxy x, y; long amount; if (!OV_pop_c(coord) || !OV_pop_i(amt)) return; @@ -4099,8 +4121,8 @@ selection_opvar(char *nbuf) return ov; } -xchar -selection_getpoint(int x, int y, struct opvar *ov) +coordxy +selection_getpoint(coordxy x, coordxy y, struct opvar *ov) { if (!ov || ov->spovartyp != SPOVAR_SEL) return 0; if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO) return 0; @@ -4109,7 +4131,7 @@ selection_getpoint(int x, int y, struct opvar *ov) } void -selection_setpoint(int x, int y, struct opvar *ov, char c) +selection_setpoint(coordxy x, coordxy y, struct opvar *ov, char c) { if (!ov || ov->spovartyp != SPOVAR_SEL) return; if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO) return; @@ -4166,7 +4188,7 @@ selection_filter_mapchar(struct opvar *ov, struct opvar *mc) { int x, y; schar mapc; - xchar lit; + coordxy lit; struct opvar *ret = selection_opvar(NULL); if (!ov || !mc || !ret) return NULL; @@ -4261,23 +4283,23 @@ selection_do_grow(struct opvar *ov, int dir) if (tmp[x][y]) selection_setpoint(x, y, ov, 1); } -static int (*selection_flood_check_func)(int, int); +static int (*selection_flood_check_func)(coordxy, coordxy); static schar floodfillchk_match_under_typ; void -set_selection_floodfillchk(int (*f) (int, int)) +set_selection_floodfillchk(int (*f) (coordxy, coordxy)) { selection_flood_check_func = f; } static int -floodfillchk_match_under(int x, int y) +floodfillchk_match_under(coordxy x, coordxy y) { return (floodfillchk_match_under_typ == levl[x][y].typ); } static int -floodfillchk_match_accessible(int x, int y) +floodfillchk_match_accessible(coordxy x, coordxy y) { return (ACCESSIBLE(levl[x][y].typ) || levl[x][y].typ == SDOOR || @@ -4286,9 +4308,9 @@ floodfillchk_match_accessible(int x, int y) /* check whethere is already in xs[],ys[] */ static boolean -sel_flood_havepoint(int x, int y, xchar *xs, xchar *ys, int n) +sel_flood_havepoint(coordxy x, coordxy y, coordxy *xs, coordxy *ys, int n) { - xchar xx = (xchar) x, yy = (xchar) y; + coordxy xx = (coordxy) x, yy = (coordxy) y; while (n > 0) { --n; @@ -4300,7 +4322,7 @@ sel_flood_havepoint(int x, int y, xchar *xs, xchar *ys, int n) } void -selection_floodfill(struct opvar *ov, int x, int y, boolean diagonals) +selection_floodfill(struct opvar *ov, coordxy x, coordxy y, boolean diagonals) { struct opvar *tmp = selection_opvar(NULL); #define SEL_FLOOD_STACK (COLNO*ROWNO) @@ -4326,11 +4348,11 @@ selection_floodfill(struct opvar *ov, int x, int y, boolean diagonals) static const char floodfill_stack_overrun[] = "floodfill stack overrun"; int idx = 0; - xchar dx[SEL_FLOOD_STACK]; - xchar dy[SEL_FLOOD_STACK]; + coordxy dx[SEL_FLOOD_STACK]; + coordxy dy[SEL_FLOOD_STACK]; schar under = levl[x][y].typ; - if (selection_flood_check_func == (int (*) (int, int)) 0) { + if (selection_flood_check_func == (int (*) (coordxy, coordxy)) 0) { opvar_free(tmp); return; } @@ -4587,7 +4609,7 @@ selection_do_randline(schar x1, schar y1, schar x2, schar y2, schar rough, schar } void -selection_iterate(struct opvar *ov, void (*func) (int, int, genericptr_t), genericptr_t arg) +selection_iterate(struct opvar *ov, void (*func) (coordxy, coordxy, genericptr_t), genericptr_t arg) { int x, y; /* yes, this is very naive, but it's not _that_ expensive. */ @@ -4597,7 +4619,7 @@ selection_iterate(struct opvar *ov, void (*func) (int, int, genericptr_t), gener } void -sel_set_ter(int x, int y, genericptr_t arg) +sel_set_ter(coordxy x, coordxy y, genericptr_t arg) { if (levl[x][y].typ == STAIRS) { return; @@ -4617,18 +4639,18 @@ sel_set_ter(int x, int y, genericptr_t arg) } void -sel_set_feature(int x, int y, genericptr_t arg) +sel_set_feature(coordxy x, coordxy y, genericptr_t arg) { if (IS_FURNITURE(levl[x][y].typ)) return; levl[x][y].typ = (*(int *)arg); } void -sel_set_door(int dx, int dy, genericptr_t arg) +sel_set_door(coordxy dx, coordxy dy, genericptr_t arg) { - xchar typ = (*(xchar *)arg); - xchar x = dx; - xchar y = dy; + coordxy typ = (*(coordxy *)arg); + coordxy x = dx; + coordxy y = dy; /*get_location(&x, &y, DRY, (struct mkroom *)0);*/ if (!IS_DOOR(levl[x][y].typ) && levl[x][y].typ != SDOOR) { @@ -4648,12 +4670,12 @@ void spo_door(struct sp_coder *coder) { struct opvar *msk, *sel; - xchar typ; + coordxy typ; if (!OV_pop_i(msk) || !OV_pop_typ(sel, SPOVAR_SEL)) return; - typ = OV_i(msk) == -1 ? rnddoor() : (xchar)OV_i(msk); + typ = OV_i(msk) == -1 ? rnddoor() : (coordxy)OV_i(msk); selection_iterate(sel, sel_set_door, (genericptr_t)&typ); @@ -4973,7 +4995,7 @@ void spo_region(struct sp_coder *coder) { struct opvar *rtype, *rlit, *flags, *area; - xchar dx1, dy1, dx2, dy2; + coordxy dx1, dy1, dx2, dy2; struct mkroom *troom; boolean prefilled, room_not_needed, irregular, joined; @@ -5077,7 +5099,7 @@ spo_region(struct sp_coder *coder) void spo_drawbridge(struct sp_coder *coder) { - xchar x, y; + coordxy x, y; int dopen; struct opvar *dir, *db_open, *coord; @@ -5102,7 +5124,7 @@ spo_drawbridge(struct sp_coder *coder) void spo_mazewalk(struct sp_coder *coder) { - xchar x, y; + coordxy x, y; struct opvar *ftyp, *fstocked, *fdir, *coord; int dir; @@ -5171,7 +5193,7 @@ void spo_wall_property(struct sp_coder *coder) { struct opvar *r; - xchar dx1, dy1, dx2, dy2; + coordxy dx1, dy1, dx2, dy2; int wprop = (coder->opcode == SPO_NON_DIGGABLE) ? W_NONDIGGABLE : W_NONPASSWALL; if (!OV_pop_r(r)) return; @@ -5215,7 +5237,7 @@ spo_room_door(struct sp_coder *coder) } void -sel_set_wallify(int x, int y, void *arg UNUSED) +sel_set_wallify(coordxy x, coordxy y, void *arg UNUSED) { wallify_map(x, y, x, y); } @@ -5232,10 +5254,10 @@ spo_wallify(struct sp_coder *coder) case 0: { if (!OV_pop_r(r)) return; - dx1 = (xchar)SP_REGION_X1(OV_i(r)); - dy1 = (xchar)SP_REGION_Y1(OV_i(r)); - dx2 = (xchar)SP_REGION_X2(OV_i(r)); - dy2 = (xchar)SP_REGION_Y2(OV_i(r)); + dx1 = (coordxy)SP_REGION_X1(OV_i(r)); + dy1 = (coordxy)SP_REGION_Y1(OV_i(r)); + dx2 = (coordxy)SP_REGION_X2(OV_i(r)); + dy2 = (coordxy)SP_REGION_Y2(OV_i(r)); wallify_map(dx1 < 0 ? (xstart - 1) : dx1, dy1 < 0 ? (ystart - 1) : dy1, dx2 < 0 ? (xstart + xsize + 1) : dx2, @@ -5258,8 +5280,8 @@ spo_map(struct sp_coder *coder) { mazepart tmpmazepart; struct opvar *mpxs, *mpys, *mpmap, *mpa, *mpkeepr, *mpzalign; - xchar halign, valign; - xchar tmpxstart, tmpystart, tmpxsize, tmpysize; + coordxy halign, valign; + coordxy tmpxstart, tmpystart, tmpxsize, tmpysize; int tryct = 0; unpacked_coord upc; @@ -5338,13 +5360,13 @@ spo_map(struct sp_coder *coder) xsize = COLNO-1; ysize = ROWNO; } else { - xchar x, y; + coordxy x, y; /* random vault should never overwrite anything */ if (in_mk_rndvault) { boolean isokp = TRUE; for(y = ystart - 1; y < ystart+ysize + 1; y++) for(x = xstart - 1; x < xstart+xsize + 1; x++) { - xchar mptyp; + coordxy mptyp; if (!isok(x, y)) { isokp = FALSE; } else if (y < ystart || y >= (ystart+ysize) || @@ -5373,7 +5395,7 @@ spo_map(struct sp_coder *coder) /* Load the map */ for(y = ystart; y < ystart+ysize; y++) for(x = xstart; x < xstart+xsize; x++) { - xchar mptyp = (mpmap->vardata.str[(y-ystart) * xsize + (x-xstart)] - 1); + coordxy mptyp = (mpmap->vardata.str[(y-ystart) * xsize + (x-xstart)] - 1); if (mptyp >= MAX_TYPE) continue; levl[x][y].typ = mptyp; levl[x][y].lit = FALSE; @@ -6039,7 +6061,7 @@ sp_level_coder(sp_lev *lvl) { struct opvar *tmp; struct opvar *pt = selection_opvar(NULL); - schar x, y; + coordxy x, y; if (!OV_pop_c(tmp)) panic("no ter sel coord"); get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(tmp)); selection_setpoint(x, y, pt, 1); @@ -6051,7 +6073,7 @@ sp_level_coder(sp_lev *lvl) case SPO_SEL_FILLRECT: { struct opvar *tmp, *pt = selection_opvar(NULL); - schar x, y, x1, y1, x2, y2; + coordxy x, y, x1, y1, x2, y2; if (!OV_pop_r(tmp)) panic("no ter sel region"); x1 = min(SP_REGION_X1(OV_i(tmp)), SP_REGION_X2(OV_i(tmp))); y1 = min(SP_REGION_Y1(OV_i(tmp)), SP_REGION_Y2(OV_i(tmp))); @@ -6084,7 +6106,7 @@ sp_level_coder(sp_lev *lvl) case SPO_SEL_LINE: { struct opvar *tmp = NULL, *tmp2 = NULL, *pt = selection_opvar(NULL); - schar x1, y1, x2, y2; + coordxy x1, y1, x2, y2; if (!OV_pop_c(tmp) || !OV_pop_c(tmp2)) panic("no ter sel linecoord"); get_location_coord(&x1, &y1, ANY_LOC, coder->croom, OV_i(tmp)); get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(tmp2)); @@ -6101,7 +6123,7 @@ sp_level_coder(sp_lev *lvl) case SPO_SEL_RNDLINE: { struct opvar *tmp = NULL, *tmp2 = NULL, *tmp3 = NULL, *pt = selection_opvar(NULL); - schar x1, y1, x2, y2; + coordxy x1, y1, x2, y2; if (!OV_pop_i(tmp3) || !OV_pop_c(tmp) || !OV_pop_c(tmp2)) panic("no ter sel randline"); get_location_coord(&x1, &y1, ANY_LOC, coder->croom, OV_i(tmp)); get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(tmp2)); @@ -6129,7 +6151,7 @@ sp_level_coder(sp_lev *lvl) case SPO_SEL_FLOOD: { struct opvar *tmp; - schar x, y; + coordxy x, y; if (!OV_pop_c(tmp)) panic("no ter sel flood coord"); get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(tmp)); if (isok(x, y)) { @@ -6159,7 +6181,7 @@ sp_level_coder(sp_lev *lvl) { struct opvar *filled, *xaxis, *yaxis, *pt; struct opvar *sel = selection_opvar(NULL); - schar x, y; + coordxy x, y; if (!OV_pop_i(filled)) panic("no filled for ellipse"); if (!OV_pop_i(yaxis)) panic("no yaxis for ellipse"); if (!OV_pop_i(xaxis)) panic("no xaxis for ellipse"); @@ -6177,7 +6199,7 @@ sp_level_coder(sp_lev *lvl) { struct opvar *gtyp, *glim, *mind, *maxd, *coord, *coord2; struct opvar *sel; - schar x, y, x2, y2; + coordxy x, y, x2, y2; if (!OV_pop_i(gtyp)) panic("no gtyp for grad"); if (!OV_pop_i(glim)) panic("no glim for grad"); if (!OV_pop_c(coord2)) panic("no coord2 for grad"); diff --git a/src/steed.c b/src/steed.c index a3d77515f..2ac2f4b0d 100644 --- a/src/steed.c +++ b/src/steed.c @@ -752,7 +752,7 @@ stucksteed(boolean checkfeeding) } void -place_monster(struct monst *mon, int x, int y) +place_monster(struct monst *mon, coordxy x, coordxy y) { struct monst *othermon; const char *monnm, *othnm; diff --git a/src/teleport.c b/src/teleport.c index 77470b244..66bf1ccbb 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -3,10 +3,10 @@ #include "hack.h" -static boolean tele_jump_ok(int, int, int, int); -static boolean teleok(int, int, boolean); +static boolean tele_jump_ok(coordxy, coordxy, coordxy, coordxy); +static boolean teleok(coordxy, coordxy, boolean); static void vault_tele(void); -static boolean rloc_pos_ok(int, int, struct monst *); +static boolean rloc_pos_ok(coordxy, coordxy, struct monst *); static void mvault_tele(struct monst *); /* non-null when teleporting via having read this scroll */ @@ -21,7 +21,7 @@ static struct obj *telescroll = 0; * Returns: -1: Inaccessible, 0: Good pos, 1: Temporally inacessible */ static int -badpos(int x, int y, struct monst *mtmp, unsigned int gpflags) +badpos(coordxy x, coordxy y, struct monst *mtmp, unsigned int gpflags) { int is_badpos = 0, pool; struct permonst *mdat = NULL; @@ -96,7 +96,7 @@ badpos(int x, int y, struct monst *mtmp, unsigned int gpflags) * call it to generate new monster positions with fake monster structures. */ boolean -goodpos(int x, int y, struct monst *mtmp, unsigned int gpflags) +goodpos(coordxy x, coordxy y, struct monst *mtmp, unsigned int gpflags) { struct permonst *mdat = NULL; boolean ignorewater = ((gpflags & MM_IGNOREWATER) != 0); @@ -193,13 +193,13 @@ goodpos(int x, int y, struct monst *mtmp, unsigned int gpflags) * Return TRUE and the position chosen when successful, FALSE otherwise. */ boolean -enexto(coord *cc, xchar xx, xchar yy, struct permonst *mdat) +enexto(coord *cc, coordxy xx, coordxy yy, struct permonst *mdat) { return enexto_core(cc, xx, yy, mdat, NO_MM_FLAGS); } boolean -enexto_core(coord *cc, xchar xx, xchar yy, struct permonst *mdat, unsigned int entflags) +enexto_core(coord *cc, coordxy xx, coordxy yy, struct permonst *mdat, unsigned int entflags) { return enexto_core_range(cc, xx, yy, mdat, entflags, 1); } @@ -207,8 +207,8 @@ enexto_core(coord *cc, xchar xx, xchar yy, struct permonst *mdat, unsigned int e boolean enexto_core_range( coord *cc, - xchar xx, - xchar yy, + coordxy xx, + coordxy yy, struct permonst *mdat, unsigned int entflags, int start_range) /**< Distance of checked tiles to begin with. Should be >=1. */ @@ -333,7 +333,7 @@ coord epathto_debug_cc[100]; #endif int -epathto(coord *cc, int nc, xchar xx, xchar yy, struct permonst *mdat) +epathto(coord *cc, int nc, coordxy xx, coordxy yy, struct permonst *mdat) { int i, j, dir, ndirs, xy, x, y, r; int path_len, postype; @@ -446,7 +446,7 @@ epathto(coord *cc, int nc, xchar xx, xchar yy, struct permonst *mdat) * only for explicitly chosen destinations.) */ static boolean -tele_jump_ok(int x1, int y1, int x2, int y2) +tele_jump_ok(coordxy x1, coordxy y1, coordxy x2, coordxy y2) { if (!isok(x2, y2)) { return FALSE; @@ -481,7 +481,7 @@ tele_jump_ok(int x1, int y1, int x2, int y2) } static boolean -teleok(int x, int y, boolean trapok) +teleok(coordxy x, coordxy y, boolean trapok) { if (!trapok) { /* allow teleportation onto vibrating square, it's not a real trap */ @@ -498,7 +498,7 @@ teleok(int x, int y, boolean trapok) } void -teleds(int nux, int nuy, boolean allow_drag) +teleds(coordxy nux, coordxy nuy, boolean allow_drag) { if (u.utraptype == TT_BURIEDBALL) { /* unearth it */ @@ -559,7 +559,7 @@ teleds(int nux, int nuy, boolean allow_drag) if (ball_active) { if (ball_still_in_range || allow_drag) { int bc_control; - xchar ballx, bally, chainx, chainy; + coordxy ballx, bally, chainx, chainy; boolean cause_delay; if (drag_ball(nux, nuy, &bc_control, &ballx, &bally, @@ -1053,7 +1053,7 @@ level_tele(void) #ifdef WIZARD if (wizard && !strcmp(buf, "?")) { schar destlev; - xchar destdnum; + xint16 destdnum; levTport_menu: destlev = 0; @@ -1364,7 +1364,7 @@ level_tele_trap(struct trap *trap, unsigned int trflags) /* check whether monster can arrive at location via Tport (or fall) */ static boolean -rloc_pos_ok(int x, int y, struct monst *mtmp) +rloc_pos_ok(coordxy x, coordxy y, struct monst *mtmp) /* coordinates of candidate location */ { @@ -1428,7 +1428,7 @@ rloc_pos_ok(int x, int y, struct monst *mtmp) * the worm. */ void -rloc_to(struct monst *mtmp, int x, int y) +rloc_to(struct monst *mtmp, coordxy x, coordxy y) { int oldx = mtmp->mx, oldy = mtmp->my; boolean resident_shk = mtmp->isshk && inhishop(mtmp); @@ -1684,7 +1684,7 @@ mlevel_tele_trap(struct monst *mtmp, struct trap *trap, boolean force_it, int in boolean rloco(struct obj *obj) { - xchar tx, ty, otx, oty; + coordxy tx, ty, otx, oty; boolean restricted_fall; int try_limit = 4000; diff --git a/src/timeout.c b/src/timeout.c index ddec7d7cc..7bbd00464 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -842,7 +842,7 @@ hatch_egg(anything *arg, long int timeout) struct obj *egg; struct monst *mon, *mon2; coord cc; - xchar x, y; + coordxy x, y; boolean yours, silent, knows_egg = FALSE; boolean cansee_hatchspot = FALSE; int i, mnum, hatchcount = 0; @@ -1160,7 +1160,7 @@ burn_object(anything *arg, long int timeout) { struct obj *obj = arg->a_obj; boolean canseeit, many, menorah, need_newsym, need_invupdate; - xchar x, y; + coordxy x, y; char whose[BUFSZ]; menorah = obj->otyp == CANDELABRUM_OF_INVOCATION; @@ -1558,7 +1558,7 @@ begin_burn(struct obj *obj, boolean already_lit) } if (obj->lamplit && !already_lit) { - xchar x, y; + coordxy x, y; if (get_obj_location(obj, &x, &y, CONTAINED_TOO|BURIED_TOO)) new_light_source(x, y, radius, LS_OBJECT, obj_to_any(obj)); @@ -1885,8 +1885,8 @@ timer_sanity_check(void) } } else if (curr->kind == TIMER_LEVEL) { long where = curr->arg.a_long; - xchar x = (xchar) ((where >> 16) & 0xFFFF), - y = (xchar) (where & 0xFFFF); + coordxy x = (coordxy) ((where >> 16) & 0xFFFF), + y = (coordxy) (where & 0xFFFF); if (!isok(x, y)) { impossible("timer sanity: spot timer %lu at <%d,%d>", curr->tid, x, y); @@ -2112,7 +2112,7 @@ obj_has_timer(struct obj *object, short int timer_type) * */ void -spot_stop_timers(xchar x, xchar y, short int func_index) +spot_stop_timers(coordxy x, coordxy y, short int func_index) { timer_element *curr, *prev, *next_timer = 0; long where = (((long) x << 16) | ((long) y)); @@ -2140,7 +2140,7 @@ spot_stop_timers(xchar x, xchar y, short int func_index) * Returns 0L if no such timer. */ long -spot_time_expires(xchar x, xchar y, short int func_index) +spot_time_expires(coordxy x, coordxy y, short int func_index) { timer_element *curr; long where = (((long) x << 16) | ((long) y)); @@ -2156,7 +2156,7 @@ spot_time_expires(xchar x, xchar y, short int func_index) } long -spot_time_left(xchar x, xchar y, short int func_index) +spot_time_left(coordxy x, coordxy y, short int func_index) { long expires = spot_time_expires(x, y, func_index); return (expires > 0L) ? expires - monstermoves : 0L; diff --git a/src/topten.c b/src/topten.c index 20d24ab33..f2553beb6 100644 --- a/src/topten.c +++ b/src/topten.c @@ -63,7 +63,7 @@ struct toptenentry { static void topten_print(const char *); static void topten_print_bold(const char *); -static xchar observable_depth(d_level *); +static coordxy observable_depth(d_level *); static void outheader(void); static void outentry(int, struct toptenentry *, boolean); static void readentry(FILE *, struct toptenentry *); @@ -123,7 +123,7 @@ topten_print_bold(const char *x) putstr(toptenwin, ATR_BOLD, x); } -static xchar +static coordxy observable_depth(d_level *lev) { #ifdef RANDOMIZED_PLANES /* if we ever randomize the order of the elemental planes, we diff --git a/src/track.c b/src/track.c index fe4d9febd..6454d74e5 100644 --- a/src/track.c +++ b/src/track.c @@ -28,7 +28,7 @@ settrack(void) } coord * -gettrack(int x, int y) +gettrack(coordxy x, coordxy y) { int cnt, ndist; coord *tc; diff --git a/src/trap.c b/src/trap.c index cbcbc815b..bea018642 100644 --- a/src/trap.c +++ b/src/trap.c @@ -6,7 +6,7 @@ extern const char *const destroy_strings[][3]; /* from zap.c */ static struct obj *t_missile(int, struct trap *); -static void launch_drop_spot(struct obj *, xchar, xchar); +static void launch_drop_spot(struct obj *, coordxy, coordxy); static void decrease_mon_trapcounter(struct monst *); static void dofiretrap(struct obj *); static void doicetrap(struct obj *); @@ -29,7 +29,7 @@ static void join_adjacent_pits(struct trap *); #endif static boolean thitm(int, struct monst *, struct obj *, int, boolean); static void maybe_finish_sokoban(void); -static int mkroll_launch(struct trap *, xchar, xchar, short, long); +static int mkroll_launch(struct trap *, coordxy, coordxy, short, long); static boolean isclearpath(coord *, int, schar, schar); static int steedintrap(struct trap *, struct obj *); static boolean keep_saddle_with_steedcorpse(unsigned, struct obj *, struct obj *); @@ -304,7 +304,7 @@ grease_protect(struct obj *otmp, const char *ostr, struct monst *victim) } struct trap * -maketrap(int x, int y, int typ) +maketrap(coordxy x, coordxy y, int typ) { static union vlaunchinfo zero_vl; boolean oldplace; @@ -563,7 +563,7 @@ fall_through(boolean td, unsigned int ftflags) * shop status--it's not worth the hassle.] */ struct monst * -animate_statue(struct obj *statue, xchar x, xchar y, int cause, int *fail_reason) +animate_statue(struct obj *statue, coordxy x, coordxy y, int cause, int *fail_reason) { int mnum = statue->corpsenm; struct permonst *mptr = &mons[mnum]; @@ -739,7 +739,7 @@ animate_statue(struct obj *statue, xchar x, xchar y, int cause, int *fail_reason * or pick-axe. */ struct monst * -activate_statue_trap(struct trap *trap, xchar x, xchar y, boolean shatter) +activate_statue_trap(struct trap *trap, coordxy x, coordxy y, boolean shatter) { struct monst *mtmp = (struct monst *)0; struct obj *otmp = sobj_at(STATUE, x, y); @@ -777,7 +777,7 @@ keep_saddle_with_steedcorpse(unsigned int steed_mid, struct obj *objchn, struct if (mtmp->m_id == steed_mid) { /* move saddle */ - xchar x, y; + coordxy x, y; if (get_obj_location(objchn, &x, &y, 0)) { obj_extract_self(saddle); place_object(saddle, x, y); @@ -807,8 +807,8 @@ mu_maybe_destroy_web(struct monst *mtmp, boolean domsg, struct trap *trap) flaming(mptr) || unsolid(mptr) || mptr == &mons[PM_GELATINOUS_CUBE]) { - xchar x = trap->tx; - xchar y = trap->ty; + coordxy x = trap->tx; + coordxy y = trap->ty; if (flaming(mptr) || acidic(mptr)) { if (domsg) { @@ -1646,7 +1646,7 @@ steedintrap(struct trap *trap, struct obj *otmp) void blow_up_landmine(struct trap *trap) { - int x = trap->tx, y = trap->ty, dbx, dby; + coordxy x = trap->tx, y = trap->ty, dbx, dby; struct rm *lev = &levl[x][y]; (void)scatter(x, y, 4, @@ -1687,11 +1687,11 @@ blow_up_landmine(struct trap *trap) */ static struct { struct obj *obj; - xchar x, y; + coordxy x, y; } launchplace; static void -launch_drop_spot(struct obj *obj, xchar x, xchar y) +launch_drop_spot(struct obj *obj, coordxy x, coordxy y) { if (!obj) { launchplace.obj = (struct obj *) 0; @@ -1730,7 +1730,7 @@ force_launch_placement(void) * 2 if an object was launched, but used up. */ int -launch_obj(short int otyp, int x1, int y1, int x2, int y2, int style) +launch_obj(short int otyp, coordxy x1, coordxy y1, coordxy x2, coordxy y2, int style) { struct monst *mtmp; struct obj *otmp, *otmp2; @@ -2000,7 +2000,7 @@ feeltrap(struct trap *trap) } static int -mkroll_launch(struct trap *ttmp, xchar x, xchar y, short int otyp, long int ocount) +mkroll_launch(struct trap *ttmp, coordxy x, coordxy y, short int otyp, long int ocount) { struct obj *otmp; int tmp; @@ -2074,7 +2074,7 @@ static boolean isclearpath(coord *cc, int distance, schar dx, schar dy) { uchar typ; - xchar x, y; + coordxy x, y; x = cc->x; y = cc->y; @@ -2960,7 +2960,7 @@ float_up(void) } void -fill_pit(int x, int y) +fill_pit(coordxy x, coordxy y) { struct obj *otmp; struct trap *t; @@ -3375,7 +3375,7 @@ domagictrap(void) * Return whether the object was destroyed. */ boolean -fire_damage(struct obj *obj, boolean force, xchar x, xchar y) +fire_damage(struct obj *obj, boolean force, coordxy x, coordxy y) { int chance; struct obj *otmp, *ncobj; @@ -3465,7 +3465,7 @@ fire_damage(struct obj *obj, boolean force, xchar x, xchar y) * Return number of objects destroyed. --ALI */ int -fire_damage_chain(struct obj *chain, boolean force, boolean here, xchar x, xchar y) +fire_damage_chain(struct obj *chain, boolean force, boolean here, coordxy x, coordxy y) { struct obj *obj, *nobj; int num = 0; @@ -3485,7 +3485,7 @@ fire_damage_chain(struct obj *chain, boolean force, boolean here, xchar x, xchar /* obj has been thrown or dropped into lava; damage is worse than mere fire */ boolean -lava_damage(struct obj *obj, xchar x, xchar y) +lava_damage(struct obj *obj, coordxy x, coordxy y) { int otyp = obj->otyp, ocls = obj->oclass; @@ -4093,7 +4093,7 @@ static void move_into_trap(struct trap *ttmp) { int bc = 0; - xchar x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy; + coordxy x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy; boolean unused; bx = by = cx = cy = 0; @@ -4969,7 +4969,7 @@ chest_trap(struct obj *obj, int bodypart, boolean disarm) struct monst *shkp = 0; long loss = 0L; boolean costly, insider; - xchar ox = obj->ox, oy = obj->oy; + coordxy ox = obj->ox, oy = obj->oy; /* the obj location need not be that of player */ costly = (costly_spot(ox, oy) && @@ -5094,7 +5094,7 @@ chest_trap(struct obj *obj, int bodypart, boolean disarm) } struct trap * -t_at(int x, int y) +t_at(coordxy x, coordxy y) { struct trap *trap = ftrap; while(trap) { diff --git a/src/tutorial.c b/src/tutorial.c index 4b691350d..ee0e62baa 100644 --- a/src/tutorial.c +++ b/src/tutorial.c @@ -49,7 +49,7 @@ check_tutorial_oclass(int oclass) if there is a message and it hasn't been shown already. Returns TRUE if a message is shown. */ int -check_tutorial_location(int lx, int ly, boolean from_farlook) +check_tutorial_location(coordxy lx, coordxy ly, boolean from_farlook) { struct rm *l = &(levl[lx][ly]); if (!flags.tutorial) return FALSE; /* short-circuit */ @@ -103,7 +103,7 @@ check_tutorial_location(int lx, int ly, boolean from_farlook) } /* Display tutorial messages that may result from farlook data. */ void -check_tutorial_farlook(int x, int y) +check_tutorial_farlook(coordxy x, coordxy y) { int glyph = glyph_at(x, y); /* Monsters */ diff --git a/src/vault.c b/src/vault.c index 788582c64..9c5241cab 100644 --- a/src/vault.c +++ b/src/vault.c @@ -4,11 +4,11 @@ #include "hack.h" static boolean clear_fcorr(struct monst *, boolean); -static void blackout(int, int); +static void blackout(coordxy, coordxy); static void restfakecorr(struct monst *); static void parkguard(struct monst *); -static boolean in_fcorridor(struct monst *, int, int); -static boolean find_guard_dest(struct monst *, xchar *, xchar *); +static boolean in_fcorridor(struct monst *, coordxy, coordxy); +static boolean find_guard_dest(struct monst *, coordxy *, coordxy *); static void move_gold(struct obj *, int); static void wallify_vault(struct monst *); static void gd_mv_monaway(struct monst *, int, int); @@ -121,7 +121,7 @@ clear_fcorr(struct monst *grd, boolean forceshow) the corridor, we don't want the light to reappear if/when a new tunnel goes through the same area */ static void -blackout(int x, int y) +blackout(coordxy x, coordxy y) { struct rm *lev; int i, j; @@ -192,7 +192,7 @@ grddead(struct monst *grd) } static boolean -in_fcorridor(struct monst *grd, int x, int y) +in_fcorridor(struct monst *grd, coordxy x, coordxy y) { int fci; struct egd *egrd = EGD(grd); @@ -268,7 +268,7 @@ uleftvault(struct monst *grd) } static boolean -find_guard_dest(struct monst *guard, xchar *rx, xchar *ry) +find_guard_dest(struct monst *guard, coordxy *rx, coordxy *ry) { int x, y, dd, lx = 0, ly = 0; @@ -322,7 +322,7 @@ invault(void) /* if time ok and no guard now. */ char buf[BUFSZ]; int x, y, gx, gy; - xchar rx, ry; + coordxy rx, ry; long umoney; /* first find the goal for the guard */ @@ -524,8 +524,8 @@ invault(void) EGD(guard)->fakecorr[0].ftyp = levl[x][y].typ; } else { /* the initial guard location is a dug door */ int vlt = EGD(guard)->vroom; - xchar lowx = rooms[vlt].lx, hix = rooms[vlt].hx; - xchar lowy = rooms[vlt].ly, hiy = rooms[vlt].hy; + coordxy lowx = rooms[vlt].lx, hix = rooms[vlt].hx; + coordxy lowy = rooms[vlt].ly, hiy = rooms[vlt].hy; if(x == lowx-1 && y == lowy-1) EGD(guard)->fakecorr[0].ftyp = TLCORNER; @@ -551,7 +551,7 @@ invault(void) static void move_gold(struct obj *gold, int vroom) { - xchar nx, ny; + coordxy nx, ny; remove_object(gold); newsym(gold->ox, gold->oy); @@ -568,7 +568,7 @@ wallify_vault(struct monst *grd) int x, y, typ; int vlt = EGD(grd)->vroom; char tmp_viz; - xchar lox = rooms[vlt].lx - 1, hix = rooms[vlt].hx + 1, + coordxy lox = rooms[vlt].lx - 1, hix = rooms[vlt].hx + 1, loy = rooms[vlt].ly - 1, hiy = rooms[vlt].hy + 1; struct monst *mon; struct obj *gold; @@ -669,7 +669,7 @@ gd_pick_corridor_gold(struct monst *grd, int goldx, int goldy) gdelta = distu(guardx, guardy); if (gdelta > 2 && see_it) { /* skip if player won't see it */ bestdelta = gdelta; - bestcc.x = (xchar) guardx, bestcc.y = (xchar) guardy; + bestcc.x = (coordxy) guardx, bestcc.y = (coordxy) guardy; tryct = 9; do { /* pick an available spot nearest the hero and also try diff --git a/src/vision.c b/src/vision.c index 48aedcb1a..1eea3468e 100644 --- a/src/vision.c +++ b/src/vision.c @@ -21,7 +21,7 @@ * @...X +4 * */ -char circle_data[] = { +const coordxy circle_data[] = { /* 0*/ 1, 1, /* 2*/ 2, 2, 1, /* 5*/ 3, 3, 2, 1, @@ -76,31 +76,31 @@ boolean vision_full_recalc = 0; /* Pointers to the current vision array. */ char **viz_array; #endif -char *viz_rmin, *viz_rmax; /* current vision cs bounds */ +coordxy *viz_rmin, *viz_rmax; /* current vision cs bounds */ /*------ local variables ------*/ static char could_see[2][ROWNO][COLNO]; /* vision work space */ static char *cs_rows0[ROWNO], *cs_rows1[ROWNO]; -static char cs_rmin0[ROWNO], cs_rmax0[ROWNO]; -static char cs_rmin1[ROWNO], cs_rmax1[ROWNO]; +static coordxy cs_rmin0[ROWNO], cs_rmax0[ROWNO]; +static coordxy cs_rmin1[ROWNO], cs_rmax1[ROWNO]; static char viz_clear[ROWNO][COLNO]; /* vision clear/blocked map */ static char *viz_clear_rows[ROWNO]; -static char left_ptrs[ROWNO][COLNO]; /* LOS algorithm helpers */ -static char right_ptrs[ROWNO][COLNO]; +static coordxy left_ptrs[ROWNO][COLNO]; /* LOS algorithm helpers */ +static coordxy right_ptrs[ROWNO][COLNO]; /* Forward declarations. */ static void fill_point(int, int); static void dig_point(int, int); static void view_init(void); -static void view_from(int, int, char **, char *, char *, int, - void (*)(int, int, genericptr_t), +static void view_from(coordxy, coordxy, char **, coordxy *, coordxy *, int, + void (*)(coordxy, coordxy, genericptr_t), genericptr_t); -static void get_unused_cs(char ***, char **, char **); +static void get_unused_cs(char ***, coordxy **, coordxy **); #ifdef REINCARNATION -static void rogue_vision(char **, char *, char *); +static void rogue_vision(char **, coordxy *, coordxy *); #endif /* Macro definitions that I can't find anywhere. */ @@ -153,7 +153,7 @@ vision_init(void) * sight. */ int -does_block(int x, int y, struct rm *lev) +does_block(coordxy x, coordxy y, struct rm *lev) { struct obj *obj; struct monst *mon; @@ -253,10 +253,10 @@ vision_reset(void) * to the unused vision work area. */ static void -get_unused_cs(char ***rows, char **rmin, char **rmax) +get_unused_cs(char ***rows, coordxy **rmin, coordxy **rmax) { int row; - char *nrmin, *nrmax; + coordxy *nrmin, *nrmax; if (viz_array == cs_rows0) { *rows = cs_rows1; @@ -294,9 +294,7 @@ get_unused_cs(char ***rows, char **rmin, char **rmax) * due to the one-sided lit wall hack. */ static void -rogue_vision(char **next, char *rmin, char *rmax) - /* could_see array pointers */ - +rogue_vision(char **next, coordxy *rmin, coordxy *rmax) /* could_see array pointers */ { int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET; /* no SHARED... */ int start, stop, in_door, xhi, xlo, yhi, ylo; @@ -491,9 +489,9 @@ vision_recalc(int control) char **next_array; /* points to the new vision array */ char *next_row; /* row pointer for the new array */ char *old_row; /* row pointer for the old array */ - char *next_rmin; /* min pointer for the new array */ - char *next_rmax; /* max pointer for the new array */ - char *ranges; /* circle ranges -- used for xray & night vision */ + coordxy *next_rmin; /* min pointer for the new array */ + coordxy *next_rmax; /* max pointer for the new array */ + const coordxy *ranges; /* circle ranges -- used for xray & night vision */ int row = 0; /* row counter (outer loop) */ int start, stop; /* inner loop starting/stopping index */ int dx, dy; /* one step from a lit door or lit wall (see below) */ @@ -532,7 +530,7 @@ vision_recalc(int control) * + Monsters can see you even when you're in a pit. */ view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, - 0, (void (*)(int, int, genericptr_t)) 0, (genericptr_t)0); + 0, (void (*)(coordxy, coordxy, genericptr_t)) 0, (genericptr_t)0); /* * Our own version of the update loop below. We know we can't see @@ -601,7 +599,7 @@ vision_recalc(int control) } } else view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, - 0, (void (*)(int, int, genericptr_t)) 0, (genericptr_t)0); + 0, (void (*)(coordxy, coordxy, genericptr_t)) 0, (genericptr_t)0); /* * Set the IN_SIGHT bit for xray and night vision. @@ -810,7 +808,7 @@ vision_recalc(int control) newsym(u.ux, u.uy); /* Make sure the hero shows up! */ /* Set the new min and max pointers. */ - viz_rmin = next_rmin; + viz_rmin = next_rmin; viz_rmax = next_rmax; recalc_mapseen(); @@ -823,7 +821,7 @@ vision_recalc(int control) * Make the location opaque to light. */ void -block_point(int x, int y) +block_point(coordxy x, coordxy y) { fill_point(y, x); @@ -845,7 +843,7 @@ block_point(int x, int y) * Make the location transparent to light. */ void -unblock_point(int x, int y) +unblock_point(coordxy x, coordxy y) { dig_point(y, x); @@ -1075,10 +1073,10 @@ static int start_row; static int start_col; static int step; static char **cs_rows; -static char *cs_left; -static char *cs_right; +static coordxy *cs_left; +static coordxy *cs_right; -static void (*vis_func)(int, int, genericptr_t); +static void (*vis_func)(coordxy, coordxy, genericptr_t); static genericptr_t varg; /* @@ -1552,8 +1550,8 @@ clear_path(int col1, int row1, int col2, int row2) static close2d *close_dy[CLOSE_MAX_BC_DY]; static far2d *far_dy[FAR_MAX_BC_DY]; -static void right_side(int, int, int, int, int, int, int, char*); -static void left_side(int, int, int, int, int, int, int, char*); +static void right_side(int, int, int, int, int, int, int, coordxy *); +static void left_side(int, int, int, int, int, int, int, coordxy *); static int close_shadow(int, int, int, int); static int far_shadow(int, int, int, int); @@ -1657,7 +1655,7 @@ right_side( int fb_row, fb_col, /**< far block row and col */ int left, /**< left mark of the previous row */ int right_mark, /**< right mark of previous row */ - char *limits) /**< points at range limit for current row, or NULL */ + coordxy *limits) /**< points at range limit for current row, or NULL */ { int i; char *rowp = NULL; @@ -1665,9 +1663,9 @@ right_side( int left_shadow, right_shadow, loc_right; int lblock_col; /* local block column (current row) */ int nrow, deeper; - char *row_min = NULL; /* left most */ - char *row_max = NULL; /* right most */ - int lim_max; /* right most limit of circle */ + coordxy *row_min = NULL; /* left most */ + coordxy *row_max = NULL; /* right most */ + int lim_max; /* right most limit of circle */ nrow = row + step; deeper = good_row(nrow) && (!limits || (*limits >= *(limits+1))); @@ -1903,13 +1901,13 @@ right_side( * for blow by blow comments. */ static void -left_side(row, cb_row, cb_col, fb_row, fb_col, left_mark, right, limits) -int row; /* the current row */ -int cb_row, cb_col; /* close block row and col */ -int fb_row, fb_col; /* far block row and col */ -int left_mark; /* left mark of previous row */ -int right; /* right mark of the previous row */ -char *limits; +left_side( + int row, /* the current row */ + int cb_row, int cb_col, /* close block row and col */ + int fb_row, int fb_col, /* far block row and col */ + int left_mark, /* left mark of previous row */ + int right, /* right mark of the previous row */ + const coordxy *limits) { int i; char *rowp = NULL; @@ -2081,13 +2079,13 @@ char *limits; * and right most boundaries of what could be seen. */ static void -view_from(srow, scol, loc_cs_rows, left_most, right_most, range, func, arg) -int srow, scol; /* source row and column */ -char **loc_cs_rows; /* could_see array (row pointers) */ -char *left_most, *right_most; /* limits of what could be seen */ -int range; /* 0 if unlimited */ -void (*func)(int, int, genericptr_t); -genericptr_t arg; +view_from( + coordxy srow, coordxy scol, /* source row and column */ + char **loc_cs_rows, /* could_see array (row pointers) */ + coordxy *left_most, coordxy *right_most, /* limits of what could be seen */ + int range, /* 0 if unlimited */ + void (*func)(coordxy, coordxy, genericptr_t), + genericptr_t arg) { int i; char *rowp; @@ -2171,8 +2169,8 @@ genericptr_t arg; /* * Defines local to Algorithm C. */ -static void right_side(int, int, int, char*); -static void left_side(int, int, int, char*); +static void right_side(int, int, int, coordxy *); +static void left_side(int, int, int, coordxy *); /* Initialize algorithm C (nothing). */ static void @@ -2189,7 +2187,7 @@ right_side( int row, /**< current row */ int left, /**< first (left side) visible spot on prev row */ int right_mark, /**< last (right side) visible spot on prev row */ - char *limits) /**< points at range limit for current row, or NULL */ + coordxy *limits) /**< points at range limit for current row, or NULL */ { int right; /* right limit of "could see" */ int right_edge; /* right edge of an opening */ @@ -2198,11 +2196,10 @@ right_side( int result; /* set by q?_path() */ int i; /* loop counter */ char *rowp = NULL; /* row optimization */ - char *row_min = NULL; /* left most [used by macro set_min()] */ - char *row_max = NULL; /* right most [used by macro set_max()] */ + coordxy *row_min = NULL; /* left most [used by macro set_min()] */ + coordxy *row_max = NULL; /* right most [used by macro set_max()] */ int lim_max; /* right most limit of circle */ - rowp = row_min = row_max = 0; nrow = row + step; /* * Can go deeper if the row is in bounds and the next row is within @@ -2365,13 +2362,13 @@ right_side( * extensive comments. */ static void -left_side(int row, int left_mark, int right, char *limits) +left_side(int row, int left_mark, int right, coordxy *limits) { int left, left_edge, nrow, deeper, result; int i; char *rowp = NULL; - char *row_min = NULL; - char *row_max = NULL; + coordxy *row_min = NULL; + coordxy *row_max = NULL; int lim_min; nrow = row+step; @@ -2481,14 +2478,24 @@ left_side(int row, int left_mark, int right, char *limits) * Calculate all possible visible locations from the given location * (srow,scol). NOTE this is (y,x)! Mark the visible locations in the * array provided. + * + * Arguments + * srow, scol starting row and column + * loc_cs_rows pointers to the rows of the could_see array + * left_most min mark on each row + * right_most max mark on each row + * range 0 if unlimited + * func function to call on each spot + * arg argument for func */ static void -view_from(int srow, int scol, char **loc_cs_rows, char *left_most, char *right_most, int range, void (*func) (int, int, genericptr_t), genericptr_t arg) - /* starting row and column */ - /* pointers to the rows of the could_see array */ - /* min mark on each row */ - /* max mark on each row */ - /* 0 if unlimited */ +view_from( + coordxy srow, coordxy scol, + char **loc_cs_rows, + coordxy *left_most, coordxy *right_most, + int range, + void (*func)(coordxy, coordxy, genericptr_t), + genericptr_t arg) { @@ -2497,7 +2504,7 @@ view_from(int srow, int scol, char **loc_cs_rows, char *left_most, char *right_m int nrow; /* the next row */ int left; /* the left-most visible column */ int right; /* the right-most visible column */ - char *limits; /* range limit for next row */ + coordxy *limits; /* range limit for next row */ /* Set globals for q?_path(), left_side(), and right_side() to use. */ start_col = scol; @@ -2532,7 +2539,7 @@ view_from(int srow, int scol, char **loc_cs_rows, char *left_most, char *right_m if(left < scol - range) left = scol - range; if(right > scol + range) right = scol + range; } else - limits = (char*) 0; + limits = (coordxy *) 0; if(func) { for (i = left; i <= right; i++) (*func)(i, srow, arg); @@ -2578,16 +2585,20 @@ view_from(int srow, int scol, char **loc_cs_rows, char *left_most, char *right_m * vision matrix and reduce extra work. */ void -do_clear_area(int scol, int srow, int range, void (*func) (int, int, genericptr_t), genericptr_t arg) +do_clear_area( + coordxy scol, coordxy srow, + int range, + void (*func) (coordxy, coordxy, genericptr_t), + genericptr_t arg) { /* If not centered on hero, do the hard work of figuring the area */ if (scol != u.ux || srow != u.uy) - view_from(srow, scol, (char **)0, (char *)0, (char *)0, + view_from(srow, scol, (char **)0, (coordxy *)0, (coordxy *)0, range, func, arg); else { int x; int y, min_x, max_x, max_y, offset; - char *limits; + const coordxy *limits; boolean override_vision; /* vision doesn't pass through water or clouds, detection should diff --git a/src/wizard.c b/src/wizard.c index e3042fa32..fec72ae4d 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -292,9 +292,9 @@ strategy(struct monst *mtmp) } static void -choose_stairs(xchar *sx, xchar *sy) +choose_stairs(coordxy *sx, coordxy *sy) { - xchar x = 0, y = 0; + coordxy x = 0, y = 0; if (builds_up(&u.uz)) { if (xdnstair) { @@ -329,7 +329,7 @@ int tactics(struct monst *mtmp) { unsigned long strat = strategy(mtmp); - xchar sx = 0, sy = 0, mx, my; + coordxy sx = 0, sy = 0, mx, my; /* Cthulhu doesn't need to heal. He can't die! */ if ((mtmp->data == &mons[PM_CTHULHU]) && @@ -376,7 +376,7 @@ tactics(struct monst *mtmp) default: /* kill, maim, pillage! */ { long where = (strat & STRAT_STRATMASK); - xchar tx = STRAT_GOALX(strat), + coordxy tx = STRAT_GOALX(strat), ty = STRAT_GOALY(strat); int targ = strat & STRAT_GOAL; struct obj *otmp; diff --git a/src/worm.c b/src/worm.c index 55d153cae..ab1003399 100644 --- a/src/worm.c +++ b/src/worm.c @@ -10,12 +10,12 @@ /* worm segment structure */ struct wseg { struct wseg *nseg; - xchar wx, wy; /* the segment's position */ + coordxy wx, wy; /* the segment's position */ }; static void toss_wsegs(struct wseg *, boolean); static void shrink_worm(int); -static void random_dir(xchar, xchar, xchar *, xchar *); +static void random_dir(coordxy, coordxy, coordxy *, coordxy *); static struct wseg *create_worm_tail(int); /* Description of long worm implementation. @@ -327,7 +327,7 @@ cutoff(struct monst *worm, struct wseg *tail) * that both halves will survive. */ void -cutworm(struct monst *worm, xchar x, xchar y, struct obj *weap) +cutworm(struct monst *worm, coordxy x, coordxy y, struct obj *weap) { struct wseg *curr, *new_tail; struct monst *new_worm; @@ -494,8 +494,8 @@ save_worm(int fd, int mode) /* Save segment locations of the monster. */ if (count) { for (curr = wtails[i]; curr; curr = curr->nseg) { - bwrite(fd, (genericptr_t) &(curr->wx), sizeof(xchar)); - bwrite(fd, (genericptr_t) &(curr->wy), sizeof(xchar)); + bwrite(fd, (genericptr_t) &(curr->wx), sizeof(coordxy)); + bwrite(fd, (genericptr_t) &(curr->wy), sizeof(coordxy)); } } } @@ -538,8 +538,8 @@ rest_worm(int fd) for (curr = (struct wseg *) 0, j = 0; j < count; j++) { temp = newseg(); temp->nseg = (struct wseg *) 0; - mread(fd, (genericptr_t) &(temp->wx), sizeof(xchar)); - mread(fd, (genericptr_t) &(temp->wy), sizeof(xchar)); + mread(fd, (genericptr_t) &(temp->wx), sizeof(coordxy)); + mread(fd, (genericptr_t) &(temp->wy), sizeof(coordxy)); if (curr) curr->nseg = temp; else @@ -567,8 +567,8 @@ place_wsegs(struct monst *worm, struct monst *oldworm) } while (curr != wheads[worm->wormno]) { - xchar x = curr->wx; - xchar y = curr->wy; + coordxy x = curr->wx; + coordxy y = curr->wy; if (oldworm) { if (m_at(x,y) == oldworm) { @@ -647,12 +647,12 @@ remove_worm(struct monst *worm) * be, if somehow the head is disjoint from the tail. */ void -place_worm_tail_randomly(struct monst *worm, xchar x, xchar y) +place_worm_tail_randomly(struct monst *worm, coordxy x, coordxy y) { int wnum = worm->wormno; struct wseg *curr = wtails[wnum]; struct wseg *new_tail; - xchar ox = x, oy = y; + coordxy ox = x, oy = y; if (!wnum) { warning("place_worm_tail_randomly: worm->wormno was 0"); @@ -671,7 +671,7 @@ place_worm_tail_randomly(struct monst *worm, xchar x, xchar y) new_tail->wy = y; while(curr) { - xchar nx, ny; + coordxy nx, ny; char tryct = 0; /* pick a random direction from x, y and search for goodpos() */ @@ -704,7 +704,7 @@ place_worm_tail_randomly(struct monst *worm, xchar x, xchar y) * enexto() with a search radius. */ static void -random_dir(xchar x, xchar y, xchar *nx, xchar *ny) +random_dir(coordxy x, coordxy y, coordxy *nx, coordxy *ny) { *nx = x; *ny = y; @@ -866,14 +866,14 @@ worm_cross(int x1, int y1, int x2, int y2) /* construct an index number for a worm tail segment */ int -wseg_at(struct monst *worm, int x, int y) +wseg_at(struct monst *worm, coordxy x, coordxy y) { int res = 0; if (worm && worm->wormno && m_at(x, y) == worm) { struct wseg *curr; int i, n; - xchar wx = (xchar) x, wy = (xchar) y; + coordxy wx = (coordxy) x, wy = (coordxy) y; for (i = 0, curr = wtails[worm->wormno]; curr; curr = curr->nseg) { if (curr->wx == wx && curr->wy == wy) { diff --git a/src/worn.c b/src/worn.c index 267387a2f..1ea124d83 100644 --- a/src/worn.c +++ b/src/worn.c @@ -735,7 +735,7 @@ clear_bypasses(void) */ #if 0 if (objects[otmp->otyp].oc_merge) { - xchar ox, oy; + coordxy ox, oy; (void) get_obj_location(otmp, &ox, &oy, 0); stack_object(otmp); diff --git a/src/zap.c b/src/zap.c index 61820f280..14f1e3bac 100644 --- a/src/zap.c +++ b/src/zap.c @@ -19,11 +19,11 @@ extern boolean notonhead; /* for long worms */ /* kludge to use mondied instead of killed */ extern boolean m_using; -static boolean zombie_can_dig(xchar x, xchar y); +static boolean zombie_can_dig(coordxy x, coordxy y); static void polyuse(struct obj*, int, int); static void create_polymon(struct obj *, int); static boolean zap_updown(struct obj *); -static void zhitu(int, int, const char *, xchar, xchar); +static void zhitu(int, int, const char *, coordxy, coordxy); static void revive_egg(struct obj *); static boolean zap_steed(struct obj *); @@ -560,7 +560,7 @@ probe_monster(struct monst *mtmp) * is not available or subject to the constraints above. */ boolean -get_obj_location(struct obj *obj, xchar *xp, xchar *yp, int locflags) +get_obj_location(struct obj *obj, coordxy *xp, coordxy *yp, int locflags) { switch (obj->where) { case OBJ_INVENT: @@ -597,7 +597,7 @@ get_obj_location(struct obj *obj, xchar *xp, xchar *yp, int locflags) boolean get_mon_location( struct monst *mon, - xchar *xp, xchar *yp, + coordxy *xp, coordxy *yp, int locflags) /* non-zero means get location even if monster is buried */ { if (mon == &youmonst) { @@ -744,7 +744,7 @@ get_container_location(struct obj *obj, int *loc, int *container_nesting) /* can zombie dig the location at x,y */ static boolean -zombie_can_dig(xchar x, xchar y) +zombie_can_dig(coordxy x, coordxy y) { if (isok(x,y)) { schar typ = levl[x][y].typ; @@ -773,7 +773,7 @@ revive(struct obj *corpse, boolean by_hero) struct permonst *mptr; struct obj *container; coord xy; - xchar x, y; + coordxy x, y; boolean one_of; int montype, container_nesting = 0; boolean is_zomb = (mons[corpse->corpsenm].mlet == S_ZOMBIE); @@ -985,7 +985,7 @@ revive(struct obj *corpse, boolean by_hero) void remove_corpse(struct obj *corpse) { - xchar x, y; + coordxy x, y; boolean is_zomb = (mons[corpse->corpsenm].mlet == S_ZOMBIE); switch (corpse->where) { @@ -1568,7 +1568,7 @@ struct obj * poly_obj(struct obj *obj, int id) { struct obj *otmp; - xchar ox = 0, oy = 0; + coordxy ox = 0, oy = 0; long old_wornmask, new_wornmask = 0L; boolean can_merge = (id == STRANGE_OBJECT); int obj_location = obj->where; @@ -1841,7 +1841,7 @@ stone_to_flesh_obj(struct obj *obj) struct permonst *ptr; struct monst *mon, *shkp; struct obj *item; - xchar oox, ooy; + coordxy oox, ooy; boolean smell = FALSE, golem_xform = FALSE; if (objects[obj->otyp].oc_material != MINERAL && @@ -1968,7 +1968,7 @@ int bhito(struct obj *obj, struct obj *otmp) { int res = 1; /* affected object by default */ - xchar refresh_x, refresh_y; + coordxy refresh_x, refresh_y; boolean learn_it = FALSE, maybelearnit; @@ -3025,7 +3025,8 @@ static boolean zap_updown(struct obj *obj) /**< wand or spell */ { boolean striking = FALSE, disclose = FALSE; - int x, y, xx, yy, ptmp; + coordxy x, y, xx, yy; + int ptmp; struct obj *otmp; struct engr *e; struct trap *ttmp; @@ -3200,7 +3201,7 @@ zap_updown(struct obj *obj) /**< wand or spell */ /* fall through */ case SPE_POLYMORPH: del_engr(e); - make_engr_at(x, y, random_engraving(buf), moves, (xchar)0); + make_engr_at(x, y, random_engraving(buf), moves, (coordxy)0); break; case WAN_CANCELLATION: case WAN_MAKE_INVISIBLE: @@ -3496,7 +3497,7 @@ bhit( tmp_at(DISP_FLASH, obj_to_glyph(obj)); while(range-- > 0) { - int x, y; + coordxy x, y; bhitpos.x += ddx; bhitpos.y += ddy; @@ -4021,7 +4022,7 @@ zhitm( } static void -zhitu(int type, int nd, const char *fltxt, xchar sx, xchar sy) +zhitu(int type, int nd, const char *fltxt, coordxy sx, coordxy sy) { int dam = 0; @@ -4150,7 +4151,7 @@ zhitu(int type, int nd, const char *fltxt, xchar sx, xchar sy) } void -melt_icewall(xchar x, xchar y) +melt_icewall(coordxy x, coordxy y) { struct rm *lev = &levl[x][y]; if (cansee(x, y)) { @@ -4166,7 +4167,7 @@ melt_icewall(xchar x, xchar y) } void -melt_ice(xchar x, xchar y, const char *msg) +melt_ice(coordxy x, coordxy y, const char *msg) { struct rm *lev = &levl[x][y]; struct obj *otmp; @@ -4213,7 +4214,7 @@ melt_ice(xchar x, xchar y, const char *msg) * return the number of objects burned */ int -burn_floor_objects(int x, int y, boolean give_feedback, boolean u_caused) +burn_floor_objects(coordxy x, coordxy y, boolean give_feedback, boolean u_caused) /* caller needs to decide about visibility checks */ @@ -4323,7 +4324,7 @@ disintegrate_mon(struct monst *mon, int type, const char *fltxt) } void -buzz(int type, int nd, xchar sx, xchar sy, int dx, int dy) +buzz(int type, int nd, coordxy sx, coordxy sy, int dx, int dy) { dobuzz(type, nd, sx, sy, dx, dy, TRUE); } @@ -4339,13 +4340,13 @@ void dobuzz( int type, int nd, - xchar sx, xchar sy, + coordxy sx, coordxy sy, int dx, int dy, boolean say) /**< announce out of sight hit/miss events if true */ { int range, abstype = abs(type) % 10; struct rm *lev; - xchar lsx, lsy; + coordxy lsx, lsy; struct monst *mon; coord save_bhitpos; boolean shopdamage = FALSE; @@ -4633,7 +4634,7 @@ dobuzz( */ void start_melt_ice_timeout( - xchar x, xchar y, + coordxy x, coordxy y, long int min_time) /**< 's old melt timeout (deleted by time we get here) */ { int when; @@ -4667,14 +4668,14 @@ start_melt_ice_timeout( void melt_ice_away(anything *arg, long int timeout UNUSED) { - xchar x, y; + coordxy x, y; long where = arg->a_long; boolean save_mon_moving = flags.mon_moving; /* will be False */ /* melt_ice -> minliquid -> mondead|xkilled shouldn't credit/blame hero */ flags.mon_moving = TRUE; /* hero isn't causing this ice to melt */ - y = (xchar) (where & 0xFFFF); - x = (xchar) ((where >> 16) & 0xFFFF); + y = (coordxy) (where & 0xFFFF); + x = (coordxy) ((where >> 16) & 0xFFFF); /* melt_ice does newsym when appropriate */ melt_ice(x, y, "Some ice melts away."); flags.mon_moving = save_mon_moving; @@ -4686,7 +4687,7 @@ melt_ice_away(anything *arg, long int timeout UNUSED) * amount by which range is reduced (the latter is just ignored by fireballs) */ int -zap_over_floor(xchar x, xchar y, int type, boolean *shopdamage, short int exploding_wand_typ) +zap_over_floor(coordxy x, coordxy y, int type, boolean *shopdamage, short int exploding_wand_typ) { const char *zapverb; struct monst *mon; @@ -4986,7 +4987,7 @@ zap_over_floor(xchar x, xchar y, int type, boolean *shopdamage, short int explod void fracture_rock(struct obj *obj) /* no texts here! */ { - xchar x, y; + coordxy x, y; boolean by_you = !flags.mon_moving; if (by_you && get_obj_location(obj, &x, &y, 0) && costly_spot(x, y)) { diff --git a/tests/options/mocks.h b/tests/options/mocks.h index a85405c03..e3a2cb398 100644 --- a/tests/options/mocks.h +++ b/tests/options/mocks.h @@ -65,8 +65,8 @@ uint32_t isaac_next_uint32(isaac_ctx *_ctx) { return 0; } void isaac_init(isaac_ctx *_ctx,const unsigned char *_seed,int _nseed) {} void reset_commands(boolean b) {} -boolean is_pool(int i1, int i2) { return FALSE; } -boolean is_lava(int i1, int i3) { return FALSE; } +boolean is_pool(coordxy i1, coordxy i2) { return FALSE; } +boolean is_lava(coordxy i1, coordxy i3) { return FALSE; } char txt2key(char *txt) { return ' '; } boolean bind_key(uchar key, const char *command) { return FALSE; } diff --git a/tests/wishing/mocks.h b/tests/wishing/mocks.h index 1dd753b28..4f1885253 100644 --- a/tests/wishing/mocks.h +++ b/tests/wishing/mocks.h @@ -39,7 +39,7 @@ void verbalize(const char *str, ...) {} void panic(const char *str,...) {} void nh_terminate(int status) { exit(0); } void docrt() {} -int isok(int x, int y) { return 1; } +int isok(coordxy x, coordxy y) { return 1; } int str2role(const char *str) { return 0; } int str2race(const char *str) { return 0; } @@ -68,20 +68,20 @@ const char *align_str(aligntyp alignment) { return "unknown"; } const char* artifact_name(const char *name, short *typ) { return NULL; } void attach_egg_hatch_timeout(struct obj *obj, long i) {} -void block_point(int x, int y) {} -void unblock_point(int x, int y) {} +void block_point(coordxy x, coordxy y) {} +void unblock_point(coordxy x, coordxy y) {} const char* body_part(int typ) { return "body_part"; } int can_be_hatched(int typ) { return typ; } void consume_oeaten(struct obj *obj, int amount) {} boolean dead_species(int typ, boolean bool) { return FALSE; } -void del_engr_at(int x, int y) {} +void del_engr_at(coordxy x, coordxy y) {} void delete_contents(struct obj *obj) {} int genus(int typ, int number) { return 0; } boolean is_quest_artifact(struct obj *obj) { return FALSE; } void kill_egg(struct obj *obj) {} -void make_grave(int x, int y, const char *engraving) {} -struct trap* maketrap(int x, int y, int typ) { return NULL; } -void newsym(int x, int y) {} +void make_grave(coordxy x, coordxy y, const char *engraving) {} +struct trap* maketrap(coordxy x, coordxy y, int typ) { return NULL; } +void newsym(coordxy x, coordxy y) {} int title_to_mon(const char *str, int* number1, int* number2) { return NON_PM; } void obfree(struct obj *obj1, struct obj *obj2) {} @@ -107,12 +107,12 @@ boolean confers_luck(struct obj *obj) { return FALSE; } boolean defends(int number1, struct obj *obj) { return FALSE; } boolean defends_when_carried(int i, struct obj *o) { return FALSE; } boolean protects(struct obj *o, boolean b) { return FALSE; } -boolean undiscovered_artifact(xchar typ) { return FALSE; } +boolean undiscovered_artifact(coordxy typ) { return FALSE; } boolean MATCH_WARN_OF_MON(struct monst *monst) { return FALSE; } void set_moreluck() {} -boolean is_ice(int x, int y) { return FALSE; } +boolean is_ice(coordxy x, coordxy y) { return FALSE; } void obj_no_longer_held(struct obj *obj) {} @@ -121,15 +121,15 @@ struct obj* realloc_obj(struct obj *obj, int number1, genericptr_t generic, int boolean In_quest(d_level *level) { return FALSE; } boolean In_hell(d_level *level) { return FALSE; } -xchar level_difficulty() { return 1; } +coordxy level_difficulty() { return 1; } int eaten_stat(int number1, struct obj *obj) { return 0; } -char* in_rooms(xchar x, xchar y, int number) { return NULL; } +char* in_rooms(coordxy x, coordxy y, int number) { return NULL; } int merged(struct obj **obj1, struct obj **obj2) { return 0; } const char* currency(long number) { return "currency"; } -struct obj* g_at(int x, int y) { return NULL; } +struct obj* g_at(coordxy x, coordxy y) { return NULL; } void freeinv(struct obj *obj) {} void del_light_source(int number, ANY_P *generic) {} @@ -149,7 +149,7 @@ void addtobill(struct obj *obj, boolean bool1, boolean bool2, boolean bool3) {} void splitbill(struct obj *obj1, struct obj *obj2) {} void subfrombill(struct obj *obj, struct monst *monst) {} boolean is_fshk(struct monst *monst) { return FALSE; } -boolean costly_spot(xchar x, xchar y) { return FALSE; } +boolean costly_spot(coordxy x, coordxy y) { return FALSE; } long get_cost_of_shop_item(struct obj *obj) { return 0; } char* shk_your(char *buf, struct obj *obj) { return "shk_your"; } char* Shk_Your(char *buf, struct obj *obj) { return "Shk_Your"; } @@ -169,7 +169,7 @@ boolean lava_effects() { return FALSE; } boolean swamp_effects() { return FALSE; } void drop_uswapwep() {} -boolean get_obj_location(struct obj *obj, xchar *x, xchar *y, int number) { return FALSE; } +boolean get_obj_location(struct obj *obj, coordxy *x, coordxy *y, int number) { return FALSE; } void copy_mextra(struct monst *m1, struct monst *m2) {} void dealloc_mextra(struct monst *m) {} @@ -178,7 +178,7 @@ struct obj *hold_another_object(struct obj *o, const char *s1, const char *s2, c boolean can_reach_floor(boolean b) { return FALSE; } void hitfloor(struct obj *o, boolean b) {} void doaltarobj(struct obj *o) {} -const char *surface(int i1, int i2) { return NULL; } +const char *surface(coordxy i1, coordxy i2) { return NULL; } void dropy(struct obj *o) {} anything *obj_to_any(struct obj *o) { return NULL; } @@ -198,8 +198,8 @@ struct obj *nxtobj(struct obj *o, int i, boolean b) { return NULL; } void obj_adjust_light_radius(struct obj *o, int i) {} int oid_price_adjustment(struct obj *o, unsigned i) { return 0; } void set_tin_variety(struct obj *o, int i) {} -struct obj *sobj_at(int i1, int i2, int i3) { return NULL; } -long stolen_value(struct obj *o, xchar c1, xchar c2, boolean b1, boolean b2) { return 0; } +struct obj *sobj_at(int i1, coordxy i2, coordxy i3) { return NULL; } +long stolen_value(struct obj *o, coordxy c1, coordxy c2, boolean b1, boolean b2) { return 0; } void update_mon_intrinsics(struct monst *m, struct obj *o, boolean b1, boolean b2) {} char *x_monnam(struct monst *m, int i1, const char *s, int i2, boolean b) { return NULL; } const char *safe_oname(struct obj *o) { return NULL; } @@ -222,9 +222,9 @@ const char *glow_color(int i) { return NULL; } const char *glow_verb(int i, boolean b) { return NULL; } boolean restoring = FALSE; -boolean is_pool(int i1, int i2) { return FALSE; } -boolean is_lava(int i1, int i3) { return FALSE; } -void feel_newsym(xchar x, xchar y) {} +boolean is_pool(coordxy i1, coordxy i2) { return FALSE; } +boolean is_lava(coordxy i1, coordxy i3) { return FALSE; } +void feel_newsym(coordxy x, coordxy y) {} void reset_utrap(boolean b) {} boolean is_fainted() { return FALSE; } diff --git a/util/recover.c b/util/recover.c index f2d3de56b..24f6571b6 100644 --- a/util/recover.c +++ b/util/recover.c @@ -60,291 +60,291 @@ extern unsigned _stklen = STKSIZ; char savename[SAVESIZE]; /* holds relative path of save file from playground */ #ifndef NO_MAIN -int + int main(int argc, char *argv[]) { - int argno; - const char *dir = (char *)0; + int argno; + const char *dir = (char *)0; #ifdef AMIGA - char *startdir = (char *)0; + char *startdir = (char *)0; #endif - if (!dir) dir = getenv("NETHACKDIR"); - if (!dir) dir = getenv("HACKDIR"); + if (!dir) dir = getenv("NETHACKDIR"); + if (!dir) dir = getenv("HACKDIR"); #ifdef FILE_AREAS - if (!dir) dir = FILE_AREA_LEVL; + if (!dir) dir = FILE_AREA_LEVL; #endif #if defined(EXEPATH) - if (!dir) dir = exepath(argv[0]); + if (!dir) dir = exepath(argv[0]); #endif - if (argc == 1 || (argc == 2 && !strcmp(argv[1], "-"))) { - Fprintf(stderr, - "Usage: %s [ -d directory ] base1 [ base2 ... ]\n", argv[0]); + if (argc == 1 || (argc == 2 && !strcmp(argv[1], "-"))) { + Fprintf(stderr, + "Usage: %s [ -d directory ] base1 [ base2 ... ]\n", argv[0]); #if defined(WIN32) || defined(MSDOS) - if (dir) { - Fprintf(stderr, "\t(Unless you override it with -d, recover will look \n"); - Fprintf(stderr, "\t in the %s directory on your system)\n", dir); - } + if (dir) { + Fprintf(stderr, "\t(Unless you override it with -d, recover will look \n"); + Fprintf(stderr, "\t in the %s directory on your system)\n", dir); + } #endif - exit(EXIT_FAILURE); - } - - argno = 1; - if (!strncmp(argv[argno], "-d", 2)) { - dir = argv[argno]+2; - if (*dir == '=' || *dir == ':') dir++; - if (!*dir && argc > argno) { - argno++; - dir = argv[argno]; - } - if (!*dir) { - Fprintf(stderr, - "%s: flag -d must be followed by a directory name.\n", - argv[0]); - exit(EXIT_FAILURE); - } - argno++; - } + exit(EXIT_FAILURE); + } + + argno = 1; + if (!strncmp(argv[argno], "-d", 2)) { + dir = argv[argno]+2; + if (*dir == '=' || *dir == ':') dir++; + if (!*dir && argc > argno) { + argno++; + dir = argv[argno]; + } + if (!*dir) { + Fprintf(stderr, + "%s: flag -d must be followed by a directory name.\n", + argv[0]); + exit(EXIT_FAILURE); + } + argno++; + } #if defined(SECURE) && !defined(VMS) - if (dir + if (dir # ifdef HACKDIR - && strcmp(dir, HACKDIR) + && strcmp(dir, HACKDIR) # endif - ) { - (void) setgid(getgid()); - (void) setuid(getuid()); - } + ) { + (void) setgid(getgid()); + (void) setuid(getuid()); + } #endif /* SECURE && !VMS */ #ifdef HACKDIR - if (!dir) dir = HACKDIR; + if (!dir) dir = HACKDIR; #endif #ifdef AMIGA - startdir = getcwd(0,255); + startdir = getcwd(0,255); #endif - if (dir && chdir((char *) dir) < 0) { - Fprintf(stderr, "%s: cannot chdir to %s.\n", argv[0], dir); - exit(EXIT_FAILURE); - } - - while (argc > argno) { - if (restore_savefile(argv[argno], dir) == 0) - Fprintf(stderr, "recovered \"%s\" to %s\n", - argv[argno], savename); - argno++; - } + if (dir && chdir((char *) dir) < 0) { + Fprintf(stderr, "%s: cannot chdir to %s.\n", argv[0], dir); + exit(EXIT_FAILURE); + } + + while (argc > argno) { + if (restore_savefile(argv[argno], dir) == 0) + Fprintf(stderr, "recovered \"%s\" to %s\n", + argv[argno], savename); + argno++; + } #ifdef AMIGA - if (startdir) (void)chdir(startdir); + if (startdir) (void)chdir(startdir); #endif - exit(EXIT_SUCCESS); - /*NOTREACHED*/ - return 0; + exit(EXIT_SUCCESS); + /*NOTREACHED*/ + return 0; } #endif static char lock[256]; -static void + static void set_levelfile_name(int lev) { - char *tf; + char *tf; - tf = rindex(lock, '.'); - if (!tf) tf = lock + strlen(lock); - (void) sprintf(tf, ".%d", lev); + tf = rindex(lock, '.'); + if (!tf) tf = lock + strlen(lock); + (void) sprintf(tf, ".%d", lev); #ifdef VMS - (void) strcat(tf, ";1"); + (void) strcat(tf, ";1"); #endif } -static int + static int open_levelfile(int lev, const char *directory) { - int fd; - char levelfile[BUFSIZ]; - - set_levelfile_name(lev); - if (directory) { - snprintf(levelfile, BUFSIZ, "%s/%s", directory, lock); - } else { - strcpy(levelfile, lock); - } + int fd; + char levelfile[BUFSIZ]; + + set_levelfile_name(lev); + if (directory) { + snprintf(levelfile, BUFSIZ, "%s/%s", directory, lock); + } else { + strcpy(levelfile, lock); + } #if defined(MICRO) || defined(WIN32) || defined(MSDOS) - fd = open(levelfile, O_RDONLY | O_BINARY); + fd = open(levelfile, O_RDONLY | O_BINARY); #else - fd = open(levelfile, O_RDONLY, 0); + fd = open(levelfile, O_RDONLY, 0); #endif - return fd; + return fd; } -static int + static int create_savefile(void) { - int fd; - char savefile[BUFSIZ]; + int fd; + char savefile[BUFSIZ]; #ifdef FILE_AREAS - snprintf(savefile, BUFSIZ, "%s/%s", FILE_AREA_SAVE, savename); + snprintf(savefile, BUFSIZ, "%s/%s", FILE_AREA_SAVE, savename); #else - strcpy(savefile, savename); + strcpy(savefile, savename); #endif #if defined(MICRO) || defined(WIN32) || defined(MSDOS) - fd = open(savefile, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK); + fd = open(savefile, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, FCMASK); #else - fd = creat(savefile, FCMASK); + fd = creat(savefile, FCMASK); #endif - return fd; + return fd; } -void + void copy_bytes(int ifd, int ofd) { - char buf[BUFSIZ]; - int nfrom, nto; - - do { - nfrom = read(ifd, buf, BUFSIZ); - nto = write(ofd, buf, nfrom); - if (nto != nfrom) { - Fprintf(stderr, "file copy failed!\n"); - exit(EXIT_FAILURE); - } - } while (nfrom == BUFSIZ); + char buf[BUFSIZ]; + int nfrom, nto; + + do { + nfrom = read(ifd, buf, BUFSIZ); + nto = write(ofd, buf, nfrom); + if (nto != nfrom) { + Fprintf(stderr, "file copy failed!\n"); + exit(EXIT_FAILURE); + } + } while (nfrom == BUFSIZ); } -int + int restore_savefile(char *basename, const char *directory) { - int gfd, lfd, sfd; - int lev, savelev, hpid; - xchar levc; - struct version_info version_data; - - /* level 0 file contains: - * pid of creating process (ignored here) - * level number for current level of save file - * name of save file nethack would have created - * and game state - */ - (void) strcpy(lock, basename); - gfd = open_levelfile(0, directory); - if (gfd < 0) { + int gfd, lfd, sfd; + int lev, savelev, hpid; + xint8 levc; + struct version_info version_data; + + /* level 0 file contains: + * pid of creating process (ignored here) + * level number for current level of save file + * name of save file nethack would have created + * and game state + */ + (void) strcpy(lock, basename); + gfd = open_levelfile(0, directory); + if (gfd < 0) { #if defined(WIN32) && !defined(WIN_CE) - if(errno == EACCES) { - Fprintf(stderr, - "\nThere are files from a game in progress under your name."); - Fprintf(stderr,"\nThe files are locked or inaccessible."); - Fprintf(stderr,"\nPerhaps the other game is still running?\n"); - } else - Fprintf(stderr, - "\nTrouble accessing level 0 (errno = %d).\n", errno); + if(errno == EACCES) { + Fprintf(stderr, + "\nThere are files from a game in progress under your name."); + Fprintf(stderr,"\nThe files are locked or inaccessible."); + Fprintf(stderr,"\nPerhaps the other game is still running?\n"); + } else + Fprintf(stderr, + "\nTrouble accessing level 0 (errno = %d).\n", errno); #endif - Fprintf(stderr, "Cannot open level 0 for %s.\n", basename); - return(-1); - } - if (read(gfd, (genericptr_t) &hpid, sizeof hpid) != sizeof hpid) { - Fprintf(stderr, "%s\n%s%s%s\n", - "Checkpoint data incompletely written or subsequently clobbered;", - "recovery for \"", basename, "\" impossible."); - Close(gfd); - return(-1); - } - if (read(gfd, (genericptr_t) &savelev, sizeof(savelev)) - != sizeof(savelev)) { - Fprintf(stderr, - "Checkpointing was not in effect for %s -- recovery impossible.\n", - basename); - Close(gfd); - return(-1); - } - if ((read(gfd, (genericptr_t) savename, sizeof savename) - != sizeof savename) || - (read(gfd, (genericptr_t) &version_data, sizeof version_data) - != sizeof version_data)) { - Fprintf(stderr, "Error reading %s -- can't recover.\n", lock); - Close(gfd); - return(-1); - } - - /* save file should contain: - * version info - * current level (including pets) - * (non-level-based) game state - * other levels - */ - sfd = create_savefile(); - if (sfd < 0) { - Fprintf(stderr, "Cannot create savefile %s.\n", savename); - Close(gfd); - return(-1); - } - - lfd = open_levelfile(savelev, directory); - if (lfd < 0) { - Fprintf(stderr, "Cannot open level of save for %s.\n", basename); - Close(gfd); - Close(sfd); - return(-1); - } - - if (write(sfd, (genericptr_t) &version_data, sizeof version_data) - != sizeof version_data) { - Fprintf(stderr, "Error writing %s; recovery failed.\n", savename); - Close(gfd); - Close(sfd); - return(-1); - } - - copy_bytes(lfd, sfd); - Close(lfd); - (void) unlink(lock); - - copy_bytes(gfd, sfd); - Close(gfd); - set_levelfile_name(0); - (void) unlink(lock); - - for (lev = 1; lev < 256; lev++) { - /* level numbers are kept in xchars in save.c, so the - * maximum level number (for the endlevel) must be < 256 - */ - if (lev != savelev) { - lfd = open_levelfile(lev, directory); - if (lfd >= 0) { - /* any or all of these may not exist */ - levc = (xchar) lev; - write(sfd, (genericptr_t) &levc, sizeof(levc)); - copy_bytes(lfd, sfd); - Close(lfd); - (void) unlink(lock); - } - } - } - - Close(sfd); + Fprintf(stderr, "Cannot open level 0 for %s.\n", basename); + return(-1); + } + if (read(gfd, (genericptr_t) &hpid, sizeof hpid) != sizeof hpid) { + Fprintf(stderr, "%s\n%s%s%s\n", + "Checkpoint data incompletely written or subsequently clobbered;", + "recovery for \"", basename, "\" impossible."); + Close(gfd); + return(-1); + } + if (read(gfd, (genericptr_t) &savelev, sizeof(savelev)) + != sizeof(savelev)) { + Fprintf(stderr, + "Checkpointing was not in effect for %s -- recovery impossible.\n", + basename); + Close(gfd); + return(-1); + } + if ((read(gfd, (genericptr_t) savename, sizeof savename) + != sizeof savename) || + (read(gfd, (genericptr_t) &version_data, sizeof version_data) + != sizeof version_data)) { + Fprintf(stderr, "Error reading %s -- can't recover.\n", lock); + Close(gfd); + return(-1); + } + + /* save file should contain: + * version info + * current level (including pets) + * (non-level-based) game state + * other levels + */ + sfd = create_savefile(); + if (sfd < 0) { + Fprintf(stderr, "Cannot create savefile %s.\n", savename); + Close(gfd); + return(-1); + } + + lfd = open_levelfile(savelev, directory); + if (lfd < 0) { + Fprintf(stderr, "Cannot open level of save for %s.\n", basename); + Close(gfd); + Close(sfd); + return(-1); + } + + if (write(sfd, (genericptr_t) &version_data, sizeof version_data) + != sizeof version_data) { + Fprintf(stderr, "Error writing %s; recovery failed.\n", savename); + Close(gfd); + Close(sfd); + return(-1); + } + + copy_bytes(lfd, sfd); + Close(lfd); + (void) unlink(lock); + + copy_bytes(gfd, sfd); + Close(gfd); + set_levelfile_name(0); + (void) unlink(lock); + + for (lev = 1; lev < 256; lev++) { + /* level numbers are kept in 'xint8's in save.c, so the + * maximum level number (for the endlevel) must be < 256 + */ + if (lev != savelev) { + lfd = open_levelfile(lev, directory); + if (lfd >= 0) { + /* any or all of these may not exist */ + levc = (xint8) lev; + write(sfd, (genericptr_t) &levc, sizeof(levc)); + copy_bytes(lfd, sfd); + Close(lfd); + (void) unlink(lock); + } + } + } + + Close(sfd); #if 0 /* OBSOLETE, HackWB is no longer in use */ #ifdef AMIGA - /* we need to create an icon for the saved game - * or HackWB won't notice the file. - */ - { - char iconfile[FILENAME]; - int in, out; - - (void) sprintf(iconfile, "%s.info", savename); - in = open("NetHack:default.icon", O_RDONLY); - out = open(iconfile, O_WRONLY | O_TRUNC | O_CREAT); - if(in > -1 && out > -1){ - copy_bytes(in,out); - } - if(in > -1)close(in); - if(out > -1)close(out); - } + /* we need to create an icon for the saved game + * or HackWB won't notice the file. + */ + { + char iconfile[FILENAME]; + int in, out; + + (void) sprintf(iconfile, "%s.info", savename); + in = open("NetHack:default.icon", O_RDONLY); + out = open(iconfile, O_WRONLY | O_TRUNC | O_CREAT); + if(in > -1 && out > -1){ + copy_bytes(in,out); + } + if(in > -1)close(in); + if(out > -1)close(out); + } #endif #endif - return(0); + return(0); } #ifdef EXEPATH @@ -358,30 +358,30 @@ restore_savefile(char *basename, const char *directory) char exepathbuf[EXEPATHBUFSZ]; char *exepath(str) -char *str; + char *str; { - char *tmp, *tmp2; - int bsize; + char *tmp, *tmp2; + int bsize; - if (!str) return (char *)0; - bsize = EXEPATHBUFSZ; - tmp = exepathbuf; + if (!str) return (char *)0; + bsize = EXEPATHBUFSZ; + tmp = exepathbuf; #if !defined(WIN32) - strcpy (tmp, str); + strcpy (tmp, str); #else # if defined(WIN_CE) - { - TCHAR wbuf[EXEPATHBUFSZ]; - GetModuleFileName((HANDLE)0, wbuf, EXEPATHBUFSZ); - NH_W2A(wbuf, tmp, bsize); - } + { + TCHAR wbuf[EXEPATHBUFSZ]; + GetModuleFileName((HANDLE)0, wbuf, EXEPATHBUFSZ); + NH_W2A(wbuf, tmp, bsize); + } # else - *(tmp + GetModuleFileName((HANDLE)0, tmp, bsize)) = '\0'; + *(tmp + GetModuleFileName((HANDLE)0, tmp, bsize)) = '\0'; # endif #endif - tmp2 = strrchr(tmp, PATH_SEPARATOR); - if (tmp2) *tmp2 = '\0'; - return tmp; + tmp2 = strrchr(tmp, PATH_SEPARATOR); + if (tmp2) *tmp2 = '\0'; + return tmp; } #endif /* EXEPATH */ @@ -394,14 +394,14 @@ const char amiga_version_string[] = AMIGA_VERSION_STRING; void nhce_message(FILE* f, const char* str, ...) { va_list ap; - TCHAR wbuf[NHSTR_BUFSIZE]; - char buf[NHSTR_BUFSIZE]; + TCHAR wbuf[NHSTR_BUFSIZE]; + char buf[NHSTR_BUFSIZE]; va_start(ap, str); - vsprintf(buf, str, ap); + vsprintf(buf, str, ap); va_end(ap); - MessageBox(NULL, NH_A2W(buf, wbuf, NHSTR_BUFSIZE), TEXT("Recover"), MB_OK); + MessageBox(NULL, NH_A2W(buf, wbuf, NHSTR_BUFSIZE), TEXT("Recover"), MB_OK); } #endif diff --git a/win/X11/winmap.c b/win/X11/winmap.c index 3037a290e..c56bac765 100644 --- a/win/X11/winmap.c +++ b/win/X11/winmap.c @@ -77,7 +77,7 @@ static void display_cursor(struct xwindow *); void X11_print_glyph(window, x, y, glyph, bg_glyph) winid window; - xchar x, y; + coordxy x, y; int glyph; int bg_glyph UNUSED; { diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index 725be2b77..9f35ddb77 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -583,7 +583,7 @@ print_glyph(window, x, y, glyph) a 1-1 map between glyphs and distinct things on the map). */ void -curses_print_glyph(winid wid, xchar x, xchar y, int glyph, +curses_print_glyph(winid wid, coordxy x, coordxy y, int glyph, int bg_glyph UNUSED) { int ch, color; @@ -661,7 +661,7 @@ curses_nhgetch(void) } /* -int nh_poskey(int *x, int *y, int *mod) +int nh_poskey(coordxy *x, coordxy *y, int *mod) -- Returns a single character input from the user or a a positioning event (perhaps from a mouse). If the return value is non-zero, a character was typed, else, @@ -676,7 +676,7 @@ int nh_poskey(int *x, int *y, int *mod) routine always returns a non-zero character. */ int -curses_nh_poskey(int *x, int *y, int *mod) +curses_nh_poskey(coordxy *x, coordxy *y, int *mod) { int key = curses_nhgetch(); diff --git a/win/curses/cursmisc.c b/win/curses/cursmisc.c index d07df9466..fbf3ba4e2 100644 --- a/win/curses/cursmisc.c +++ b/win/curses/cursmisc.c @@ -808,7 +808,7 @@ event, or the first non-mouse key event in the case of mouse movement. */ int -curses_get_mouse(int *mousex, int *mousey, int *mod) +curses_get_mouse(coordxy *mousex, coordxy *mousey, int *mod) { int key = '\033'; diff --git a/win/curses/cursmisc.h b/win/curses/cursmisc.h index 479fab40a..4be725421 100644 --- a/win/curses/cursmisc.h +++ b/win/curses/cursmisc.h @@ -29,6 +29,6 @@ int curses_get_count(int first_digit); int curses_convert_attr(int attr); int curses_read_attrs(char *attrs); int curses_convert_keys(int key); -int curses_get_mouse(int *mousex, int *mousey, int *mod); +int curses_get_mouse(coordxy *mousex, coordxy *mousey, int *mod); #endif /* CURSMISC_H */ diff --git a/win/dummy/dummy_graphics.c b/win/dummy/dummy_graphics.c index b74ae38de..dc8a719df 100644 --- a/win/dummy/dummy_graphics.c +++ b/win/dummy/dummy_graphics.c @@ -456,7 +456,7 @@ print_glyph(window, x, y, glyph) port wants (symbol, font, color, attributes, ...there's a 1-1 map between glyphs and distinct things on the map). */ -void dummy_print_glyph(winid wid, xchar x, xchar y, int glyph, int bg_glyph) +void dummy_print_glyph(winid wid, coordxy x, coordxy y, int glyph, int bg_glyph) { if (wid != -1) { dummy_printf("winid %d; x %d, y %d, glyph: %d, bg_glyph: %d\n", wid, x, y, glyph, bg_glyph); @@ -516,7 +516,7 @@ int dummy_nhgetch(void) } /* -int nh_poskey(int *x, int *y, int *mod) +int nh_poskey(coordxy *x, coordxy *y, int *mod) -- Returns a single character input from the user or a a positioning event (perhaps from a mouse). If the return value is non-zero, a character was typed, else, @@ -530,7 +530,7 @@ int nh_poskey(int *x, int *y, int *mod) hardware supports. If no mouse is supported, this routine always returns a non-zero character. */ -int dummy_nh_poskey(int *x, int *y, int *mod) +int dummy_nh_poskey(coordxy *x, coordxy *y, int *mod) { nhUse(x); nhUse(y); diff --git a/win/dummy/dummy_graphics.h b/win/dummy/dummy_graphics.h index 056549792..5eebc65bb 100644 --- a/win/dummy/dummy_graphics.h +++ b/win/dummy/dummy_graphics.h @@ -41,11 +41,11 @@ void dummy_cliparound(int x, int y); * dummy_cliparound (which lacks the winid) simply calls this funtion. */ void dummy_cliparound_proper(winid wid, int x, int y); -void dummy_print_glyph(winid wid, xchar x, xchar y, int glyph, int bg_glyph); +void dummy_print_glyph(winid wid, coordxy x, coordxy y, int glyph, int bg_glyph); void dummy_raw_print(const char *str); void dummy_raw_print_bold(const char *str); int dummy_nhgetch(void); -int dummy_nh_poskey(int *x, int *y, int *mod); +int dummy_nh_poskey(coordxy *x, coordxy *y, int *mod); void dummy_nhbell(void); int dummy_doprev_message(void); char dummy_yn_function(const char *question, const char *choices, diff --git a/win/lisp/winlisp.c b/win/lisp/winlisp.c index 1b8da0f1f..3e68238f5 100644 --- a/win/lisp/winlisp.c +++ b/win/lisp/winlisp.c @@ -1408,7 +1408,7 @@ lisp_nhgetch(void) } int -lisp_nh_poskey(int *x, int *y, int *mod) +lisp_nh_poskey(coordxy *x, coordxy *y, int *mod) { nhUse(x); nhUse(y); @@ -1832,7 +1832,7 @@ lisp_update_positionbar(features) void lisp_print_glyph( winid window, - xchar x, xchar y, + coordxy x, coordxy y, int glyph, int bg_glyph UNUSED) { diff --git a/win/tty/wintty.c b/win/tty/wintty.c index e7f8500ca..6908b6bbb 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -2376,8 +2376,7 @@ void tty_curs( winid window, int x, - int y) /* not xchar: perhaps xchar is unsigned and - curx-x would be unsigned as well */ + int y) { struct WinDesc *cw = 0; int cx = ttyDisplay->curx; @@ -3221,7 +3220,7 @@ tty_cliparound(int x, int y) void tty_print_glyph( winid window, - xchar x, xchar y, + coordxy x, coordxy y, int glyph, int bg_glyph UNUSED) { @@ -3401,7 +3400,7 @@ tty_nhgetch(void) */ /*ARGSUSED*/ int -tty_nh_poskey(int *x, int *y, int *mod) +tty_nh_poskey(coordxy *x, coordxy *y, int *mod) { # if defined(WIN32CON) int i; diff --git a/win/unsupported/gem/wingem1.c b/win/unsupported/gem/wingem1.c index 633686562..3f2f732fc 100644 --- a/win/unsupported/gem/wingem1.c +++ b/win/unsupported/gem/wingem1.c @@ -24,20 +24,10 @@ typedef signed char schar; #define f() f(void) #define CHAR_P char #define SCHAR_P schar -#define UCHAR_P uchar -#define XCHAR_P xchar -#define SHORT_P short -#define BOOLEAN_P boolean -#define ALIGNTYP_P aligntyp typedef signed char xchar; #include "wingem.h" #undef CHAR_P #undef SCHAR_P -#undef UCHAR_P -#undef XCHAR_P -#undef SHORT_P -#undef BOOLEAN_P -#undef ALIGNTYP_P static char nullstr[]="", md[]="NetHack 3.4.3", strCancel[]="Cancel", strOk[]="Ok", strText[]="Text"; diff --git a/win/win32/mhmsg.h b/win/win32/mhmsg.h index 4f46974df..08209a9f4 100644 --- a/win/win32/mhmsg.h +++ b/win/win32/mhmsg.h @@ -30,9 +30,9 @@ typedef struct mswin_nhmsg_putstr { } MSNHMsgPutstr, *PMSNHMsgPutstr; typedef struct mswin_nhmsg_print_glyph { - XCHAR_P x; - XCHAR_P y; - int glyph; + coordxy x; + coordxy y; + int glyph; } MSNHMsgPrintGlyph, *PMSNHMsgPrintGlyph; typedef struct mswin_nhmsg_cliparound { diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index f77d630b2..1219a72f1 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -1232,7 +1232,7 @@ print_glyph(window, x, y, glyph) port wants (symbol, font, color, attributes, ...there's a 1-1 map between glyphs and distinct things on the map). */ -void mswin_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph) +void mswin_print_glyph(winid wid, coordxy x, coordxy y, int glyph) { logDebug("mswin_print_glyph(%d, %d, %d, %d)\n", wid, x, y, glyph); @@ -1306,7 +1306,7 @@ int mswin_nhgetch() } /* -int nh_poskey(int *x, int *y, int *mod) +int nh_poskey(coordxy *x, coordxy *y, int *mod) -- Returns a single character input from the user or a a positioning event (perhaps from a mouse). If the return value is non-zero, a character was typed, else, @@ -1320,7 +1320,7 @@ int nh_poskey(int *x, int *y, int *mod) hardware supports. If no mouse is supported, this routine always returns a non-zero character. */ -int mswin_nh_poskey(int *x, int *y, int *mod) +int mswin_nh_poskey(coordxy *x, coordxy *y, int *mod) { PMSNHEvent event; int key; diff --git a/win/win32/winMS.h b/win/win32/winMS.h index a8eb71163..700404203 100644 --- a/win/win32/winMS.h +++ b/win/win32/winMS.h @@ -112,11 +112,11 @@ void mswin_update_inventory(void); void mswin_mark_synch(void); void mswin_wait_synch(void); void mswin_cliparound(int x, int y); -void mswin_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph); +void mswin_print_glyph(winid wid,coordxy x,coordxy y,int glyph); void mswin_raw_print(const char *str); void mswin_raw_print_bold(const char *str); int mswin_nhgetch(void); -int mswin_nh_poskey(int *x, int *y, int *mod); +int mswin_nh_poskey(coordxy *x, coordxy *y, int *mod); void mswin_nhbell(void); int mswin_doprev_message(void); char mswin_yn_function(const char *question, const char *choices, From 3b16164b56eb1015a699c7f98c4f4a33f4b406b5 Mon Sep 17 00:00:00 2001 From: Patric Mueller Date: Wed, 10 Aug 2022 21:30:46 +0200 Subject: [PATCH 6/7] Fix unintended string concatenations --- src/do_name.c | 2 +- src/engrave.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/do_name.c b/src/do_name.c index 4c3a8f4b0..98de3d5cf 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -2277,7 +2277,7 @@ static const char * const bogusmons[] = { "amphitheatre", /* evil patch idea by yasdorian */ "banana peel golem", /* evil patch idea from DCSS */ "dissolved undead potato", - "dragonbreath nymph" + "dragonbreath nymph", "fart elemental", /* evil patch idea from DCSS */ "floating nose", /* evil patch idea by K2 */ "goldfish", /* evil patch idea from DCSS */ diff --git a/src/engrave.c b/src/engrave.c index 354c66ed9..4968aca60 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -94,7 +94,7 @@ static const char *random_mesg[] = { "Lorem ipsum dolor sit amet.", /* Typesetting */ "For truth, justice, and the Yendorian way!", "This engraving, no verb", /* Douglas Hofstadter */ - "You will curse my name to the heavens and the heavens will side with me" /* War of Omens */ + "You will curse my name to the heavens and the heavens will side with me", /* War of Omens */ /* From dNetHack */ "[REDACTED]", "[DATA EXPUNGED]", "[DATA PLUNGED]", /* SCP Foundation */ From cd47b9ac8809bb9cbc920ce885d168663b59224e Mon Sep 17 00:00:00 2001 From: Patric Mueller Date: Wed, 10 Aug 2022 21:29:49 +0200 Subject: [PATCH 7/7] Fix compilation with -std=c2x --- configure | 3 +++ include/system.h | 26 +++++++++++++++++--------- sys/autoconf/configure.ac | 3 +++ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 66ec89754..98926f117 100755 --- a/configure +++ b/configure @@ -4660,6 +4660,8 @@ printf "%s\n" "#define LINUX /**/" >>confdefs.h ;; esac +OLD_CFLAGS=$CFLAGS +CFLAGS="$CFLAGS -D_POSIX_SOURCE=1" for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -4878,6 +4880,7 @@ fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi +CFLAGS=$OLD_CFLAGS if test "$LEX" = ":"; then as_fn_error $? "cannot find flex or lex" "$LINENO" 5 fi diff --git a/include/system.h b/include/system.h index 623e6030b..cc4273cff 100644 --- a/include/system.h +++ b/include/system.h @@ -15,14 +15,20 @@ * autoconf.h which should override the defaults set earlier in * config.h and *conf.h */ -#include "autoconf_paths.h" -#include "autoconf.h" -#if HAVE_STRING_H -#include -#endif -#if HAVE_DECL_STRNICMP && !HAVE_DECL_STRNCMPI -#define strncmpi(a, b, c) strnicmp(a, b, c) -#endif +# include "autoconf_paths.h" +# include "autoconf.h" + +# if HAVE_STRING_H +# include +# endif + +# if HAVE_DECL_STRNICMP && !HAVE_DECL_STRNCMPI +# define strncmpi(a, b, c) strnicmp(a, b, c) +# endif + +# if HAVE_STRINGS_H +# include +# endif #endif /* some old may not define off_t and size_t; if your system is @@ -413,7 +419,9 @@ E int setuid(int); /* #includes ; so does defining POSIX_TYPES */ #if (defined(ULTRIX) || defined(NeXT)) && defined(__GNUC__) -#include +# ifndef _STRINGS_H +# include +# endif #else E char *strcpy(char *, const char *); E char *strncpy(char *, const char *, size_t); diff --git a/sys/autoconf/configure.ac b/sys/autoconf/configure.ac index 961c4328f..4d0f98ecd 100644 --- a/sys/autoconf/configure.ac +++ b/sys/autoconf/configure.ac @@ -100,7 +100,10 @@ case $host_os in esac dnl ----- Check for programs +dnl Workaround for finding old flex versions +OLD_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS -D_POSIX_SOURCE=1" AC_PROG_LEX(noyywrap) +CFLAGS=$OLD_CFLAGS if test "$LEX" = ":"; then AC_MSG_ERROR([cannot find flex or lex]) fi