diff --git a/include/amiconf.h b/include/amiconf.h index 21fe242af0..ca1367cb6f 100644 --- a/include/amiconf.h +++ b/include/amiconf.h @@ -70,34 +70,34 @@ 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(void); +extern void ami_wbench_args(void); +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(void); +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 FDECL(ami_wininit_data, (int)); +extern void exit(int); +extern void CleanUp(void); +extern void Abort(long); +extern int getpid(void); +extern char *CopyFile(const char *, const char *); +extern int kbhit(void); +extern int WindowGetchar(void); +extern void ami_argset(int *, char *[]); +extern void ami_mkargline(int *, char **[]); +extern void ami_wininit_data(int); #define FromWBench 0 /* A hint for compiler ... */ /* extern boolean FromWBench; /* how were we run? */ @@ -120,8 +120,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 @@ -179,7 +179,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 128413aaa2..078ed29c7b 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 5fca33acbf..2963356aae 100644 --- a/include/dlb.h +++ b/include/dlb.h @@ -67,16 +67,16 @@ typedef struct dlb_handle { #define DLB_P dlb * #endif -boolean NDECL(dlb_init); -void NDECL(dlb_cleanup); - -dlb *FDECL(dlb_fopen, (const char *, const char *)); -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)); +boolean dlb_init(void); +void dlb_cleanup(void); + +dlb *dlb_fopen(const char *, const char *); +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 */ #ifdef DLBRSRC diff --git a/include/extern.h b/include/extern.h index 3806f5be6a..8636c5ae10 100644 --- a/include/extern.h +++ b/include/extern.h @@ -10,9 +10,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,1037 +20,1029 @@ E char *FDECL(fmt_ptr, (const genericptr)); /* ### allmain.c ### */ -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 time_t NDECL(get_realtime); +E void moveloop(boolean); +E void stop_occupation(void); +E void display_gamewindows(void); +E void newgame(void); +E void welcome(boolean); +E time_t get_realtime(void); /* ### 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 NDECL(next_to_u); -E struct obj *FDECL(get_mleash, (struct monst *)); -E const char *NDECL(beautiful); -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(use_unicorn_horn, (struct obj *)); -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(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 next_to_u(void); +E struct obj *get_mleash(struct monst *); +E const char *beautiful(void); +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 use_unicorn_horn(struct obj *); +E boolean tinnable(struct obj *); +E void reset_trapset(void); +E void fig_transform(ANY_P *, long); +E int unfixable_trouble_count(boolean); /* ### 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(arti_immune, (struct obj *, int)); -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 *)); -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 boolean FDECL(finesse_ahriman, (struct obj *)); -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 struct obj *FDECL(what_gives, (long *)); -E const char *FDECL(glow_color, (int)); -E void FDECL(Sting_effects, (int)); -E int FDECL(retouch_object, (struct obj **, BOOLEAN_P)); -E void FDECL(retouch_equipment, (int)); +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 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 arti_immune(struct obj *, int); +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 *); +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 boolean finesse_ahriman(struct obj *); +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 struct obj *what_gives(long *); +E const char *glow_color(int); +E void Sting_effects(int); +E int retouch_object(struct obj **, boolean); +E void retouch_equipment(int); /* ### attrib.c ### */ -E boolean FDECL(adjattrib, (int, int, int)); -E void FDECL(gainstr, (struct obj *, int, BOOLEAN_P)); -E void FDECL(losestr, (int)); -E void FDECL(poisontell, (int, BOOLEAN_P)); -E void FDECL(poisoned, (const char *, int, const char *, int, BOOLEAN_P)); -E void FDECL(change_luck, (SCHAR_P)); -E int FDECL(stone_luck, (BOOLEAN_P)); -E void NDECL(set_moreluck); -E void NDECL(restore_attrib); -E void FDECL(exercise, (int, BOOLEAN_P)); -E void NDECL(exerchk); -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 boolean FDECL(extremeattr, (int)); -E void FDECL(adjalign, (int)); -E int FDECL(is_innate, (int)); -E char *FDECL(from_what, (int)); -E void FDECL(uchangealign, (int, int)); +E boolean adjattrib(int, int, int); +E void gainstr(struct obj *, int, boolean); +E void losestr(int); +E void poisontell(int, boolean); +E void poisoned(const char *, int, const char *, int, boolean); +E void change_luck(schar); +E int stone_luck(boolean); +E void set_moreluck(void); +E void restore_attrib(void); +E void exercise(int, boolean); +E void exerchk(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 boolean extremeattr(int); +E void adjalign(int); +E int is_innate(int); +E char *from_what(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 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); /* ### 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, (int, time_t, 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(void); +E void savebones(int, time_t, struct obj *); +E int getbones(void); /* ### 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(void); #ifdef SCORE_ON_BOTL -E long NDECL(botl_score); +E long botl_score(void); #endif -E int FDECL(describe_level, (char *)); -E const char *FDECL(rank_of, (int, SHORT_P, BOOLEAN_P)); -E void NDECL(bot); +E int describe_level(char *); +E const char *rank_of(int, short, boolean); +E void bot(void); #ifdef STATUS_VIA_WINDOWPORT -E void FDECL(status_initialize, (BOOLEAN_P)); -E void NDECL(status_finish); -E void FDECL(status_notify_windowport, (BOOLEAN_P)); +E void status_initialize(boolean); +E void status_finish(void); +E void status_notify_windowport(boolean); #ifdef STATUS_HILITES -E boolean FDECL(set_status_hilites, (char *op, BOOLEAN_P)); -E void FDECL(clear_status_hilites, (BOOLEAN_P)); -E char *FDECL(get_status_hilites, (char *, int)); -E boolean NDECL(status_hilite_menu); +E boolean set_status_hilites(char *op, boolean); +E void clear_status_hilites(boolean); +E char *get_status_hilites(char *, int); +E boolean status_hilite_menu(void); #endif #endif /* ### cmd.c ### */ -E boolean FDECL(redraw_cmd, (CHAR_P)); +E boolean redraw_cmd(char); #ifdef USE_TRAMPOLI -E int NDECL(doextcmd); -E int NDECL(domonability); -E int NDECL(doprev_message); -E int NDECL(timed_occupation); -E int NDECL(doattributes); -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 doextcmd(void); +E int domonability(void); +E int doprev_message(void); +E int timed_occupation(void); +E int doattributes(void); +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 /* USE_TRAMPOLI */ -E void NDECL(reset_occupations); -E void FDECL(set_occupation, (int (*)(void), const char *, int)); -E char NDECL(pgetchar); -E void FDECL(pushch, (CHAR_P)); -E void FDECL(savech, (CHAR_P)); -E void NDECL(add_debug_extended_commands); -E void FDECL(reset_commands, (BOOLEAN_P)); -E void FDECL(rhack, (char *)); -E int NDECL(doextlist); -E int NDECL(extcmd_via_menu); -E int NDECL(enter_explore_mode); -E void FDECL(enlightenment, (int, int)); -E void FDECL(youhiding, (BOOLEAN_P, int)); -E void FDECL(show_conduct, (int)); -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 void reset_occupations(void); +E void set_occupation(int (*)(void), const char *, int); +E char pgetchar(void); +E void pushch(char); +E void savech(char); +E void add_debug_extended_commands(void); +E void reset_commands(boolean); +E void rhack(char *); +E int doextlist(void); +E int extcmd_via_menu(void); +E int enter_explore_mode(void); +E void enlightenment(int, int); +E void youhiding(boolean, int); +E void show_conduct(int); +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); #ifdef HANGUPHANDLING -E void FDECL(hangup, (int)); -E void NDECL(end_of_input); +E void hangup(int); +E void end_of_input(void); #endif -E char NDECL(readchar); -E void NDECL(sanity_check); -E char FDECL(yn_function, (const char *, const char *, CHAR_P)); -E boolean FDECL(paranoid_query, (BOOLEAN_P, const char *)); +E char readchar(void); +E void sanity_check(void); +E char yn_function(const char *, const char *, char); +E boolean paranoid_query(boolean, const char *); /* ### 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 schar FDECL(db_under_typ, (int)); -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, BOOLEAN_P)); -E void FDECL(open_drawbridge, (int, int)); -E void 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 schar db_under_typ(int); +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, boolean); +E void open_drawbridge(int, int); +E void close_drawbridge(int, int); +E void destroy_drawbridge(int, int); /* ### decl.c ### */ -E void NDECL(decl_init); +E void decl_init(void); /* ### detect.c ### */ -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)); -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 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); +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 *); #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, genericptr))); -E void FDECL(find_trap, (struct trap *)); -E int FDECL(dosearch0, (int)); -E int NDECL(dosearch); -E void NDECL(sokoban_detect); -E void FDECL(reveal_terrain, (int, int)); +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, genericptr)); +E void find_trap(struct trap *); +E int dosearch0(int); +E int dosearch(void); +E void sokoban_detect(void); +E 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, xchar); +E boolean is_digging(void); #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(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); #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(void); +E void unearth_you(void); +E void escape_tomb(void); +E void bury_obj(struct obj *); #endif /* ### display.c ### */ -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 void FDECL(unmap_object, (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(shieldeff, (XCHAR_P, XCHAR_P)); -E void FDECL(tmp_at, (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 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 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 void unmap_object(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 shieldeff(xchar, xchar); +E void tmp_at(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); +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); /* ### 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(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); #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 int NDECL(donull); -E int NDECL(dowipe); -E void FDECL(set_wounded_legs, (long, int)); -E void NDECL(heal_legs); +E 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); +E int donull(void); +E int dowipe(void); +E void set_wounded_legs(long, int); +E void heal_legs(void); /* ### do_name.c ### */ -E int FDECL(getpos, (coord *, BOOLEAN_P, const char *)); -E void FDECL(getpos_sethilite, (void (*f)(int))); -E void FDECL(new_mname, (struct monst *, int)); -E void FDECL(free_mname, (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 struct obj *FDECL(oname, (struct obj *, const char *)); -E boolean FDECL(objtyp_is_callable, (int)); -E int NDECL(docallcmd); -E void FDECL(docall, (struct obj *)); -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(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(rndmonnam, (char *)); -E const char *FDECL(hcolor, (const char *)); -E const char *NDECL(rndcolor); -E const char *NDECL(roguename); -E struct obj *FDECL(realloc_obj, - (struct obj *, int, genericptr_t, int, const char *)); -E char *FDECL(coyotename, (struct monst *, char *)); -E const char *FDECL(noveltitle, (int *)); -E const char *FDECL(lookup_novel, (const char *, int *)); +E int getpos(coord *, boolean, const char *); +E void getpos_sethilite(void (*f)(int)); +E void new_mname(struct monst *, int); +E void free_mname(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 struct obj *oname(struct obj *, const char *); +E boolean objtyp_is_callable(int); +E int docallcmd(void); +E void docall(struct obj *); +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 *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 *rndmonnam(char *); +E const char *hcolor(const char *); +E const char *rndcolor(void); +E const char *roguename(void); +E struct obj *realloc_obj(struct obj *, int, genericptr_t, int, const char *); +E char *coyotename(struct monst *, char *); +E const char *noveltitle(int *); +E const char *lookup_novel(const char *, int *); /* ### do_wear.c ### */ #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 void FDECL(off_msg, (struct obj *)); -E void FDECL(set_wear, (struct obj *)); -E boolean FDECL(donning, (struct obj *)); -E boolean FDECL(doffing, (struct obj *)); -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_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 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 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 void off_msg(struct obj *); +E void set_wear(struct obj *); +E boolean donning(struct obj *); +E boolean doffing(struct obj *); +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_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 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 -FDECL(inaccessible_equipment, (struct obj *, const char *, BOOLEAN_P)); +inaccessible_equipment(struct obj *, const char *, boolean); /* ### 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, 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); /* ### 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); +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 void finish_meating(struct monst *); /* ### 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 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, xchar); +E int dokick(void); +E boolean ship_object(struct obj *, xchar, xchar, boolean); +E void obj_delivery(boolean); +E schar down_gate(xchar, xchar); +E void impact_drop(struct obj *, xchar, xchar, xchar); /* ### dothrow.c ### */ -E int NDECL(dothrow); -E int NDECL(dofire); -E void FDECL(endmultishot, (BOOLEAN_P)); -E void FDECL(hitfloor, (struct obj *)); -E void FDECL(hurtle, (int, int, int, BOOLEAN_P)); -E void FDECL(mhurtle, (struct monst *, int, int, int)); -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(release_camera_demon, (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, int, int), genericptr_t)); -E boolean FDECL(hurtle_step, (genericptr_t, int, int)); +E int dothrow(void); +E int dofire(void); +E void endmultishot(boolean); +E void hitfloor(struct obj *); +E void hurtle(int, int, int, boolean); +E void mhurtle(struct monst *, int, int, int); +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 release_camera_demon(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, int, int), genericptr_t); +E boolean hurtle_step(genericptr_t, 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); +E int def_char_to_monclass(char); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) -E void FDECL(switch_symbols, (int)); -E void FDECL(assign_graphics, (int)); -E void NDECL(init_r_symbols); -E void NDECL(init_symbols); -E void NDECL(update_bouldersym); -E void NDECL(init_showsyms); -E void NDECL(init_l_symbols); -E void FDECL(clear_symsetentry, (int, BOOLEAN_P)); -E void FDECL(update_l_symset, (struct symparse *, int)); -E void FDECL(update_r_symset, (struct symparse *, int)); -E boolean FDECL(cursed_object_at, (int, int)); +E void switch_symbols(int); +E void assign_graphics(int); +E void init_r_symbols(void); +E void init_symbols(void); +E void update_bouldersym(void); +E void init_showsyms(void); +E void init_l_symbols(void); +E void clear_symsetentry(int, boolean); +E void update_l_symset(struct symparse *, int); +E void update_r_symset(struct symparse *, int); +E boolean cursed_object_at(int, int); /* ### 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 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 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 schar FDECL(print_dungeon, (BOOLEAN_P, schar *, xchar *)); -E char *FDECL(get_annotation, (d_level *)); -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(room_discovered, (int)); -E void FDECL(recbranch_mapseen, (d_level *, d_level *)); -E void FDECL(remdun_mapseen, (int)); +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 *); +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 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 *); +E schar print_dungeon(boolean, schar *, xchar *); +E char *get_annotation(d_level *); +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 room_discovered(int); +E void recbranch_mapseen(d_level *, d_level *); +E void remdun_mapseen(int); /* ### eat.c ### */ #ifdef USE_TRAMPOLI -E int NDECL(eatmdone); -E int NDECL(eatfood); -E int NDECL(opentin); -E int NDECL(unfaint); -#endif -E void NDECL(eatmupdate); -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 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 void FDECL(eating_conducts, (struct permonst *)); -E int FDECL(eat_brains, (struct monst *, struct monst *, BOOLEAN_P, int *)); -E void NDECL(fix_petrification); -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 int eatmdone(void); +E int eatfood(void); +E int opentin(void); +E int unfaint(void); +#endif +E void eatmupdate(void); +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); +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 void eating_conducts(struct permonst *); +E int eat_brains(struct monst *, struct monst *, boolean, int *); +E void fix_petrification(void); +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); /* ### end.c ### */ -E void FDECL(done1, (int)); -E int NDECL(done2); +E void done1(int); +E int done2(void); #ifdef USE_TRAMPOLI -E void FDECL(done_intr, (int)); +E void done_intr(int); #endif -E void FDECL(done_in_by, (struct monst *, int)); +E void done_in_by(struct monst *, int); #endif /* !MAKEDEFS_C && !LEV_LEX_C */ -E void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2) NORETURN; +E void panic(const char *, ...) PRINTF_F(1, 2) NORETURN; #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(terminate, (int)) NORETURN; -E int NDECL(dovanquished); -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, + boolean, boolean); +E void terminate(int) NORETURN; +E int dovanquished(void); +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 *); #if defined(PANICTRACE) && !defined(NO_SIGNAL) -E void FDECL(panictrace_setsignals, (BOOLEAN_P)); +E void panictrace_setsignals(boolean); #endif /* ### 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(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, BOOLEAN_P)); -E void FDECL(u_wipe_engr, (int)); -E void FDECL(wipe_engr_at, (XCHAR_P, XCHAR_P, XCHAR_P, BOOLEAN_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 void NDECL(sanitize_engravings); -E void FDECL(save_engravings, (int, int)); -E void FDECL(rest_engravings, (int)); -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); +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, boolean); +E void u_wipe_engr(int); +E void wipe_engr_at(xchar, xchar, xchar, boolean); +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 void sanitize_engravings(void); +E void save_engravings(int, int); +E void rest_engravings(int); +E void del_engr(struct engr *); +E void rloc_engr(struct engr *); +E void make_grave(int, int, const char *); /* ### exper.c ### */ -E int NDECL(newpw); -E int FDECL(experience, (struct monst *, int)); -E void FDECL(more_experienced, (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 int newpw(void); +E int experience(struct monst *, int); +E void more_experienced(int, int); +E void losexp(const char *); +E void newexplevel(void); +E void pluslvl(boolean); +E long rndexp(boolean); /* ### 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)); -E void FDECL(explode_oil, (struct obj *, int, 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); +E void explode_oil(struct obj *, int, int); /* ### extralev.c ### */ -E void NDECL(makeroguerooms); -E void FDECL(corr, (int, int)); -E void NDECL(makerogueghost); +E void makeroguerooms(void); +E void corr(int, int); +E void makerogueghost(void); /* ### 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 FILE *FDECL(fopen_datafile, (const char *, const 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); +E FILE *fopen_datafile(const char *, const char *, 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(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 *); #ifdef MFLOPPY -E void NDECL(cancel_bonesfile); +E void cancel_bonesfile(void); #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 FDECL(set_savefile_name, (BOOLEAN_P)); +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(boolean); #ifdef INSURANCE -E void FDECL(save_savefile_name, (int)); +E void save_savefile_name(int); #endif #ifndef 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(nh_compress, (const char *)); -E void FDECL(nh_uncompress, (const char *)); -E boolean FDECL(lock_file, (const char *, int, int)); -E void FDECL(unlock_file, (const char *)); +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 nh_compress(const char *); +E void nh_uncompress(const char *); +E boolean lock_file(const char *, int, int); +E void unlock_file(const char *); #ifdef USER_SOUNDS -E boolean FDECL(can_read_file, (const char *)); -#endif -E boolean FDECL(read_config_file, (const char *, int)); -E void FDECL(check_recordfile, (const char *)); -E void NDECL(read_wizkit); -E int FDECL(read_sym_file, (int)); -E int FDECL(parse_sym_line, (char *, int)); -E void FDECL(paniclog, (const char *, const char *)); -E int FDECL(validate_prefix_locations, (char *)); +E boolean can_read_file(const char *); +#endif +E boolean read_config_file(const char *, int); +E void check_recordfile(const char *); +E void read_wizkit(void); +E int read_sym_file(int); +E int parse_sym_line(char *, int); +E void paniclog(const char *, const char *); +E int validate_prefix_locations(char *); #ifdef SELECTSAVED -E char *FDECL(plname_from_file, (const char *)); +E char *plname_from_file(const char *); #endif -E char **NDECL(get_saved_games); -E void FDECL(free_saved_games, (char **)); +E char **get_saved_games(void); +E void free_saved_games(char **); #ifdef SELF_RECOVER -E boolean NDECL(recover_savefile); +E boolean recover_savefile(void); #endif #ifdef SYSCF_FILE -E void NDECL(assure_syscf_file); +E 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(void); #endif #ifdef DEBUG -E boolean FDECL(debugcore, (const char *, BOOLEAN_P)); +E boolean debugcore(const char *, boolean); #endif -E boolean FDECL(read_tribute, (const char *, const char *, int, - char *, int, unsigned)); -E boolean FDECL(Death_quote, (char *, int)); +E boolean read_tribute(const char *, const char *, int, + char *, int, unsigned); +E boolean Death_quote(char *, int); /* ### 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 FDECL(breaksink, (int, int)); -E void NDECL(drinksink); +E void dryup(xchar, xchar, boolean); +E void drinkfountain(void); +E void dipfountain(struct obj *); +E void breaksink(int, int); +E void drinksink(void); /* ### hack.c ### */ -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 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); #ifdef DEBUG -E int NDECL(wiz_debug_cmd_traveldisplay); -#endif -E boolean NDECL(u_rooted); -E void NDECL(domove); -E boolean NDECL(overexertion); -E void NDECL(invocation_message); -E boolean FDECL(pooleffects, (BOOLEAN_P)); -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)); -E void FDECL(unmul, (const char *)); -E void FDECL(losehp, (int, const char *, BOOLEAN_P)); -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 int wiz_debug_cmd_traveldisplay(void); +#endif +E boolean u_rooted(void); +E void domove(void); +E boolean overexertion(void); +E void invocation_message(void); +E boolean pooleffects(boolean); +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); +E void unmul(const char *); +E void losehp(int, const char *, boolean); +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 *); /* ### 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(eos, (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(chrcasecpy, (int, int)); -E char *FDECL(strcasecpy, (char *, const char *)); -E char *FDECL(s_suffix, (const char *)); -E char *FDECL(ing_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 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(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 FDECL(pmatchz, (const char *, const char *)); +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 *eos(char *); +E boolean str_end_is(const char *, const char *); +E char *strkitten(char *, char); +E void copynchars(char *, const char *, int); +E char chrcasecpy(int, int); +E char *strcasecpy(char *, const char *); +E char *s_suffix(const char *); +E char *ing_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 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 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 *); +E boolean pmatchz(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 *)); +E char *strstri(const char *, const char *); #endif E boolean -FDECL(fuzzymatch, (const char *, const char *, const char *, BOOLEAN_P)); -E void NDECL(setrandom); -E time_t NDECL(getnow); -E int NDECL(getyear); +fuzzymatch(const char *, const char *, const char *, boolean); +E void setrandom(void); +E time_t getnow(void); +E int getyear(void); #if 0 -E char *FDECL(yymmdd, (time_t)); +E char *yymmdd(time_t); #endif -E long FDECL(yyyymmdd, (time_t)); -E long FDECL(hhmmss, (time_t)); -E char *FDECL(yyyymmddhhmmss, (time_t)); -E time_t FDECL(time_from_yyyymmddhhmmss, (char *)); -E int NDECL(phase_of_the_moon); -E boolean NDECL(friday_13th); -E int NDECL(night); -E int NDECL(midnight); +E long yyyymmdd(time_t); +E long hhmmss(time_t); +E char *yyyymmddhhmmss(time_t); +E time_t time_from_yyyymmddhhmmss(char *); +E int phase_of_the_moon(void); +E boolean friday_13th(void); +E int night(void); +E int midnight(void); /* ### invent.c ### */ -E struct obj **FDECL(objarr_init, (int)); -E void FDECL(objarr_set, (struct obj *, int, struct obj **, BOOLEAN_P)); -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 struct obj **objarr_init(int); +E void objarr_set(struct obj *, int, struct obj **, boolean); +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 *NDECL(u_have_novel); -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(getobj, (const char *, const char *)); -E int FDECL(ggetobj, (const char *, int (*)(OBJ_P), int, - BOOLEAN_P, unsigned *)); -E int FDECL(askchain, (struct obj **, const char *, int, int (*)(OBJ_P), - int (*)(OBJ_P), int, const char *)); -E void FDECL(fully_identify_obj, (struct obj *)); -E int FDECL(identify, (struct obj *)); -E void FDECL(identify_pack, (int, BOOLEAN_P)); -E void NDECL(learn_unseen_invent); -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 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 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, BOOLEAN_P)); -E void NDECL(free_invbuf); -E void NDECL(reassign); -E int NDECL(doorganize); -E void NDECL(free_pickinv_cache); -E int FDECL(count_unpaid, (struct obj *)); -E int FDECL(count_buc, (struct obj *, int)); -E long FDECL(count_contents, (struct obj *, 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 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 *u_have_novel(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 *getobj(const char *, const char *); +E int ggetobj(const char *, int (*)(OBJ_P), int, + boolean, unsigned *); +E int askchain(struct obj **, const char *, int, int (*)(OBJ_P), + int (*)(OBJ_P), int, const char *); +E void fully_identify_obj(struct obj *); +E int identify(struct obj *); +E void identify_pack(int, boolean); +E void learn_unseen_invent(void); +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 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 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, boolean); +E void free_invbuf(void); +E void reassign(void); +E int doorganize(void); +E void free_pickinv_cache(void); +E int count_unpaid(struct obj *); +E int count_buc(struct obj *, int); +E long count_contents(struct obj *, boolean, boolean, boolean); +E void carry_obj_effects(struct obj *); +E const char *currency(long); +E void silly_thing(const char *, struct obj *); /* ### ioctl.c ### */ #if defined(UNIX) || defined(__BEOS__) -E void NDECL(getwindowsz); -E void NDECL(getioctls); -E void NDECL(setioctls); +E void getwindowsz(void); +E void getioctls(void); +E void setioctls(void); #ifdef SUSPEND -E int NDECL(dosuspend); +E int dosuspend(void); #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 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(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 int NDECL(wiz_light_sources); +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 struct monst *find_mid(unsigned, unsigned); +E void save_light_sources(int, int, int); +E void restore_light_sources(int); +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 *); +E int wiz_light_sources(void); /* ### 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 int FDECL(pick_lock, (struct obj *)); -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 boolean FDECL(stumble_on_door_mimic, (int, int)); -E int FDECL(doopen_indir, (int, int)); -E int NDECL(doclose); +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 int pick_lock(struct obj *); +E int doforce(void); +E boolean boxlock(struct obj *, struct obj *); +E boolean doorlock(struct obj *, int, int); +E int doopen(void); +E boolean stumble_on_door_mimic(int, int); +E int doopen_indir(int, int); +E int doclose(void); #ifdef MAC /* These declarations are here because the main code calls them. */ /* ### 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 *); /* ### macmain.c ### */ -E boolean NDECL(authorize_wizard_mode); +E boolean authorize_wizard_mode(void); /* ### 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(void); /* ### macwin.c ### */ -E void FDECL(lock_mouse_cursor, (Boolean)); -E int NDECL(SanePositions); +E void lock_mouse_cursor(Boolean); +E int SanePositions(void); /* ### mttymain.c ### */ -E void FDECL(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 getreturn(char *); +E void 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); #endif /* MAC */ @@ -1058,1363 +1050,1345 @@ E void FDECL(nocmov, (int x, int y)); #ifdef MAIL #ifdef UNIX -E void NDECL(getmailstatus); +E void getmailstatus(void); #endif -E void NDECL(ckmailstatus); -E void FDECL(readmail, (struct obj *)); +E void ckmailstatus(void); +E void readmail(struct obj *); #endif /* MAIL */ /* ### makemon.c ### */ -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 *, BOOLEAN_P)); -E struct permonst *NDECL(rndmonst); -E void FDECL(reset_rndmonst, (int)); -E struct permonst *FDECL(mkclass, (CHAR_P, int)); -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 *, BOOLEAN_P, int *)); -E boolean FDECL(propagate, (int, BOOLEAN_P, BOOLEAN_P)); -E boolean FDECL(usmellmon, (struct permonst *)); +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 *, boolean); +E struct permonst *rndmonst(void); +E void reset_rndmonst(int); +E struct permonst *mkclass(char, int); +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 *, boolean, int *); +E boolean propagate(int, boolean, boolean); +E boolean usmellmon(struct permonst *); /* ### mapglyph.c ### */ -E int FDECL(mapglyph, (int, int *, int *, unsigned *, int, int)); -E char *FDECL(encglyph, (int)); -E void FDECL(genl_putmixed, (winid, int, const char *)); +E int mapglyph(int, int *, int *, unsigned *, int, int); +E char *encglyph(int); +E void genl_putmixed(winid, int, const char *); /* ### 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, boolean); +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 void FDECL(xdrainenergym, (struct monst *, BOOLEAN_P)); -E long FDECL(attk_protection, (int)); -E void FDECL(rustm, (struct monst *, struct obj *)); +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 void xdrainenergym(struct monst *, boolean); +E long attk_protection(int); +E void rustm(struct monst *, struct obj *); /* ### 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 permonst *, 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 int FDECL(doseduce, (struct monst *)); +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 permonst *, 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 *); +E int doseduce(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); +E int msummon(struct monst *); +E void summon_minion(ALIGNTYP_P, 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(void); +E int ndemon(ALIGNTYP_P); +E int lminion(void); +E void lose_guardian_angel(struct monst *); +E void gain_guardian_angel(void); /* ### mklev.c ### */ #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 NDECL(makecorridors); -E void FDECL(add_door, (int, int, struct mkroom *)); -E void NDECL(mklev); +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(void); +E void add_door(int, int, struct mkroom *); +E void mklev(void); #ifdef SPECIALIZATION -E void FDECL(topologize, (struct mkroom *, BOOLEAN_P)); +E void topologize(struct mkroom *, boolean); #else -E void FDECL(topologize, (struct mkroom *)); +E void 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(mineralize, (int, int, int, int, BOOLEAN_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, xchar, char, struct mkroom *); +E void mkinvokearea(void); +E void mineralize(int, int, int, int, boolean); /* ### mkmap.c ### */ -E void FDECL(flood_fill_rm, (int, int, int, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(remove_rooms, (int, int, int, int)); -/* E void FDECL(mkmap, (lev_init *)); -- need sp_lev.h for lev_init */ +E void flood_fill_rm(int, int, int, boolean, boolean); +E void remove_rooms(int, int, int, int); +/* E void mkmap(lev_init *); -- need sp_lev.h for lev_init */ /* ### mkmaze.c ### */ -E void FDECL(wallification, (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 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)); -E void 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(fumaroles); -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 wallification(int, int, int, int); +E void walkfrom(int, int, schar); +E void makemaz(const char *); +E void mazexy(coord *); +E void bound_digging(void); +E void mkportal(xchar, xchar, xchar, xchar); +E boolean bad_location(xchar, xchar, xchar, xchar, + xchar, xchar); +E void place_lregion(xchar, xchar, xchar, xchar, xchar, + xchar, xchar, xchar, xchar, d_level *); +E void fumaroles(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); /* ### 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 struct obj *FDECL(mksobj_at, (int, int, int, 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 void FDECL(costly_alteration, (struct obj *, int)); -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, unsigned)); -E int FDECL(corpse_revive_type, (struct obj *)); -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(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 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 void NDECL(obj_sanity_check); -E struct obj *FDECL(obj_nexto, (struct obj *)); -E struct obj *FDECL(obj_nexto_xy, (int, int, int, unsigned)); -E struct obj *FDECL(obj_absorb, (struct obj **, struct obj **)); -E struct obj *FDECL(obj_meld, (struct obj **, struct obj **)); +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 struct obj *mksobj_at(int, int, int, 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 void costly_alteration(struct obj *, int); +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, unsigned); +E int corpse_revive_type(struct obj *); +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 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 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 void obj_sanity_check(void); +E struct obj *obj_nexto(struct obj *); +E struct obj *obj_nexto_xy(int, int, int, unsigned); +E struct obj *obj_absorb(struct obj **, struct obj **); +E struct obj *obj_meld(struct obj **, struct obj **); /* ### mkroom.c ### */ -E void FDECL(mkroom, (int)); -E void FDECL(fill_zoo, (struct mkroom *)); -E struct permonst *NDECL(antholemon); -E boolean FDECL(nexttodoor, (int, 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 void mkroom(int); +E void fill_zoo(struct mkroom *); +E struct permonst *antholemon(void); +E boolean nexttodoor(int, 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); /* ### mon.c ### */ -E void NDECL(mon_sanity_check); -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 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 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 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(mnexto, (struct monst *)); -E void FDECL(maybe_mnexto, (struct monst *)); -E boolean FDECL(mnearto, (struct monst *, XCHAR_P, XCHAR_P, BOOLEAN_P)); -E void FDECL(m_respond, (struct monst *)); -E void FDECL(setmangry, (struct monst *)); -E void FDECL(wakeup, (struct monst *)); -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(hide_monst, (struct monst *)); -E void FDECL(mon_animal_list, (BOOLEAN_P)); -E int FDECL(select_newcham_form, (struct monst *)); -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(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 mon_sanity_check(void); +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 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 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); +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 mnexto(struct monst *); +E void maybe_mnexto(struct monst *); +E boolean mnearto(struct monst *, xchar, xchar, boolean); +E void m_respond(struct monst *); +E void setmangry(struct monst *); +E void wakeup(struct monst *); +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 hide_monst(struct monst *); +E void mon_animal_list(boolean); +E int select_newcham_form(struct monst *); +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 golemeffects(struct monst *, int, int); +E boolean angry_guards(boolean); +E void pacify_guards(void); +E void decide_to_shapeshift(struct monst *, int); /* ### mondata.c ### */ -E void FDECL(set_mon_data, (struct monst *, struct permonst *, int)); -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 void set_mon_data(struct monst *, struct permonst *, int); +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 -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(passes_bars, (struct permonst *)); -E boolean FDECL(can_blow, (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 *)); -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 *)); +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 passes_bars(struct permonst *); +E boolean can_blow(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 *); +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 *); /* ### monmove.c ### */ -E boolean FDECL(itsstuck, (struct monst *)); -E boolean FDECL(mb_trapped, (struct monst *)); -E boolean FDECL(monhaskey, (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 void FDECL(mon_yells, (struct monst *, const char *)); -E int FDECL(dochug, (struct monst *)); -E int FDECL(m_move, (struct monst *, int)); -E void FDECL(dissolve_bars, (int, int)); -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 itsstuck(struct monst *); +E boolean mb_trapped(struct monst *); +E boolean monhaskey(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 void mon_yells(struct monst *, const char *); +E int dochug(struct monst *); +E int m_move(struct monst *, int); +E void dissolve_bars(int, int); +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); /* ### monst.c ### */ -E void NDECL(monst_init); +E void monst_init(void); /* ### monstr.c ### */ -E void NDECL(monstr_init); +E void monstr_init(void); /* ### 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, xchar, boolean); +E void create_mplayers(int, boolean); +E void mplayer_talk(struct monst *); #if defined(MICRO) || defined(WIN32) /* ### msdos.c,os2.c,tos.c,winnt.c ### */ #ifndef WIN32 -E int NDECL(tgetch); +E int tgetch(void); #endif #ifndef TOS -E char NDECL(switchar); +E char switchar(void); #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(void); +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(void); +E long filesize(char *); #endif /* MSDOS */ -E char *NDECL(foundfile_buffer); +E char *foundfile_buffer(void); #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(void); +E void enable_ctrlP(void); #endif #if defined(MICRO) && !defined(WINNT) -E void NDECL(get_scr_size); +E void get_scr_size(void); #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(void); +E void set_colors(void); +E void restore_colors(void); #ifdef SUSPEND -E int NDECL(dosuspend); +E int dosuspend(void); #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)(void); +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 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)); +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 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); /* ### 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 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 boolean munstone(struct monst *, boolean); +E boolean munslime(struct monst *, boolean); /* ### music.c ### */ -E void FDECL(awaken_soldiers, (struct monst *)); -E int FDECL(do_play_instrument, (struct obj *)); +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(void); +E char *lan_username(void); #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(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 *); /* ### nttty.c ### */ #ifdef WIN32 -E void NDECL(get_scr_size); -E int NDECL(nttty_kbhit); -E void FDECL(nttty_open, (int)); -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(void); +E int nttty_kbhit(void); +E void nttty_open(int); +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); #endif /* ### o_init.c ### */ -E void NDECL(init_objects); -E void FDECL(obj_shuffle_range, (int, int *, int *)); -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 int NDECL(doclassdisco); -E void NDECL(rename_disco); +E void init_objects(void); +E void obj_shuffle_range(int, int *, int *); +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 int doclassdisco(void); +E void rename_disco(void); /* ### objects.c ### */ -E void NDECL(objects_init); +E void objects_init(void); /* ### objnam.c ### */ -E char *FDECL(obj_typename, (int)); -E char *FDECL(simple_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 char *FDECL(xname, (struct obj *)); -E char *FDECL(mshot_xname, (struct obj *)); -E boolean FDECL(the_unique_obj, (struct obj *)); -E boolean FDECL(the_unique_pm, (struct permonst *)); -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 *FDECL(cxname_singular, (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 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(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 char *obj_typename(int); +E char *simple_typename(int); +E boolean obj_is_pname(struct obj *); +E char *distant_name(struct obj *, char *(*)(OBJ_P)); +E char *fruitname(boolean); +E char *xname(struct obj *); +E char *mshot_xname(struct obj *); +E boolean the_unique_obj(struct obj *); +E boolean the_unique_pm(struct permonst *); +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 *); +E char *cxname_singular(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 *); +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 *mimic_obj_name(struct monst *); +E char *safe_qbuf(char *, const char *, const char *, struct obj *, + char *(*)(OBJ_P), char *(*)(OBJ_P), const char *); /* ### options.c ### */ -E void NDECL(reglyph_darkroom); -E boolean FDECL(match_optname, (const char *, const char *, int, BOOLEAN_P)); -E void NDECL(initoptions); -E void NDECL(initoptions_init); -E void NDECL(initoptions_finish); -E void FDECL(parseoptions, (char *, BOOLEAN_P, BOOLEAN_P)); -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 *, struct fruit *)); -E int FDECL(choose_classes_menu, - (const char *, int, BOOLEAN_P, char *, 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 int FDECL(add_autopickup_exception, (const char *)); -E void NDECL(free_autopickup_exceptions); -E int FDECL(load_symset, (const char *, int)); -E void NDECL(free_symsets); -E void FDECL(parsesymbols, (char *)); -E struct symparse *FDECL(match_sym, (char *)); -E void NDECL(set_playmode); -E int FDECL(sym_val, (char *)); -E const char *FDECL(clr2colorname, (int)); -E boolean FDECL(add_menu_coloring, (char *)); -E boolean FDECL(get_menu_coloring, (char *, int *, int *)); -E void NDECL(free_menu_coloring); -E boolean FDECL(msgtype_parse_add, (char *)); -E int FDECL(msgtype_type, (const char *)); -E void NDECL(msgtype_free); +E void reglyph_darkroom(void); +E boolean match_optname(const char *, const char *, int, boolean); +E void initoptions(void); +E void initoptions_init(void); +E void initoptions_finish(void); +E void parseoptions(char *, boolean, boolean); +E int doset(void); +E int dotogglepickup(void); +E void option_help(void); +E void next_opt(winid, const char *); +E int fruitadd(char *, struct fruit *); +E int choose_classes_menu(const char *, int, boolean, char *, 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); +E int add_autopickup_exception(const char *); +E void free_autopickup_exceptions(void); +E int load_symset(const char *, int); +E void free_symsets(void); +E void parsesymbols(char *); +E struct symparse *match_sym(char *); +E void set_playmode(void); +E int sym_val(char *); +E const char *clr2colorname(int); +E boolean add_menu_coloring(char *); +E boolean get_menu_coloring(char *, int *, int *); +E void free_menu_coloring(void); +E boolean msgtype_parse_add(char *); +E int msgtype_type(const char *); +E void msgtype_free(void); /* ### pager.c ### */ -E char *FDECL(self_lookat, (char *)); -E boolean FDECL(object_from_map, (int,int,int,struct obj **)); -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 int FDECL(do_screen_description, - (coord, BOOLEAN_P, int, char *, const char **)); -E int FDECL(do_look, (int, coord *)); +E char *self_lookat(char *); +E boolean object_from_map(int,int,int,struct obj **); +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 int do_screen_description(coord, boolean, int, char *, const char **); +E int do_look(int, coord *); /* ### pcmain.c ### */ #if defined(MICRO) || defined(WIN32) #ifdef CHDIR -E void FDECL(chdirx, (char *, BOOLEAN_P)); +E void chdirx(char *, boolean); #endif /* CHDIR */ -E boolean NDECL(authorize_wizard_mode); +E boolean authorize_wizard_mode(void); #endif /* MICRO || WIN32 */ /* ### pcsys.c ### */ #if defined(MICRO) || defined(WIN32) -E void NDECL(flushout); -E int NDECL(dosh); +E void flushout(void); +E int dosh(void); #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); -#endif -E void FDECL(append_slash, (char *)); -E void FDECL(getreturn, (const char *)); +E void eraseall(const char *, const char *); +E void copybones(int); +E void playwoRAMdisk(void); +E int saveDiskPrompt(int); +E void gameDiskPrompt(void); +#endif +E void append_slash(char *); +E void getreturn(const char *); #ifndef AMIGA -E void VDECL(msmsg, (const char *, ...)); +E void 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 VDECL(error, (const char *, ...)); +E void gettty(void); +E void settty(const char *); +E void setftty(void); +E void 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(void); #endif /* ### pickup.c ### */ -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 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 int FDECL(ck_bag, (struct obj *)); +E int collect_obj_classes(char *, struct obj *, boolean, + boolean (*)(OBJ_P), int *); +E boolean rider_corpse_revival(struct obj *, boolean); +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 *); +E int ck_bag(struct obj *); #ifdef USE_TRAMPOLI -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 NDECL(doloot); -E boolean FDECL(container_gone, (int (*)(OBJ_P))); -E boolean NDECL(u_handsy); -E int FDECL(use_container, (struct obj **, int)); -E int FDECL(loot_mon, (struct monst *, int *, boolean *)); -E int NDECL(dotip); -E boolean FDECL(is_autopickup_exception, (struct obj *, BOOLEAN_P)); +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); +E int query_category(const char *, struct obj *, int, menu_item **, int); +E 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 doloot(void); +E boolean container_gone(int (*)(OBJ_P)); +E boolean u_handsy(void); +E int use_container(struct obj **, int); +E int loot_mon(struct monst *, int *, boolean *); +E int dotip(void); +E boolean is_autopickup_exception(struct obj *, boolean); /* ### pline.c ### */ -E void VDECL(pline, (const char *, ...)) PRINTF_F(1, 2); -E void VDECL(Norep, (const char *, ...)) PRINTF_F(1, 2); -E void NDECL(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); -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 const char *FDECL(align_str, (ALIGNTYP_P)); -E void FDECL(mstatusline, (struct monst *)); -E void NDECL(ustatusline); -E void NDECL(self_invis_message); -E void FDECL(pudding_merge_message, (struct obj *, struct obj *)); +E void pline(const char *, ...) PRINTF_F(1, 2); +E void Norep(const char *, ...) PRINTF_F(1, 2); +E void free_youbuf(void); +E void You(const char *, ...) PRINTF_F(1, 2); +E void Your(const char *, ...) PRINTF_F(1, 2); +E void You_feel(const char *, ...) PRINTF_F(1, 2); +E void You_cant(const char *, ...) PRINTF_F(1, 2); +E void You_hear(const char *, ...) PRINTF_F(1, 2); +E void You_see(const char *, ...) PRINTF_F(1, 2); +E void pline_The(const char *, ...) PRINTF_F(1, 2); +E void There(const char *, ...) PRINTF_F(1, 2); +E void verbalize(const char *, ...) PRINTF_F(1, 2); +E void raw_printf(const char *, ...) PRINTF_F(1, 2); +E void impossible(const char *, ...) PRINTF_F(1, 2); +E const char *align_str(ALIGNTYP_P); +E void mstatusline(struct monst *); +E void ustatusline(void); +E void self_invis_message(void); +E void pudding_merge_message(struct obj *, struct obj *); /* ### polyself.c ### */ -E void NDECL(set_uasmon); -E void NDECL(float_vs_flight); -E void NDECL(change_sex); -E void FDECL(polyself, (int)); -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(dopoly); -E int NDECL(domindblast); -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 void set_uasmon(void); +E void float_vs_flight(void); +E void change_sex(void); +E void polyself(int); +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 dopoly(void); +E int domindblast(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); /* ### 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 boolean FDECL(make_hallucinated, (long, BOOLEAN_P, long)); -E void FDECL(make_deaf, (long, BOOLEAN_P)); -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 *, BOOLEAN_P)); -E void FDECL(potionbreathe, (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); +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 boolean make_hallucinated(long, boolean, long); +E void make_deaf(long, boolean); +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 *, boolean); +E void potionbreathe(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); /* ### pray.c ### */ -E boolean FDECL(critically_low_hp, (BOOLEAN_P)); +E boolean critically_low_hp(boolean); #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 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(align_gtitle, (ALIGNTYP_P)); -E void FDECL(altar_wrath, (int, int)); +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 const char *a_gname(void); +E const char *a_gname_at(xchar x, xchar y); +E const char *align_gname(ALIGNTYP_P); +E const char *halu_gname(ALIGNTYP_P); +E const char *align_gtitle(ALIGNTYP_P); +E void altar_wrath(int, int); /* ### 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 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_P, 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 *); /* ### quest.c ### */ -E void NDECL(onquest); -E void NDECL(nemdead); -E void FDECL(artitouch, (struct obj *)); -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(void); +E void nemdead(void); +E void artitouch(struct obj *); +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 *); /* ### 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 struct permonst *NDECL(qt_montype); -E void NDECL(deliver_splev_message); +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 struct permonst *qt_montype(void); +E void deliver_splev_message(void); /* ### 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(void); #endif /* RANDOM */ /* ### read.c ### */ -E void FDECL(learnscroll, (struct obj *)); -E char *FDECL(tshirt_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 void FDECL(drop_boulder_on_player, - (BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); -E boolean FDECL(drop_boulder_on_monster, (int, int, BOOLEAN_P, BOOLEAN_P)); -E void FDECL(wand_explode, (struct obj *, int)); +E void learnscroll(struct obj *); +E char *tshirt_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 *); +E void drop_boulder_on_player(boolean, boolean, boolean, boolean); +E boolean drop_boulder_on_monster(int, int, boolean, boolean); +E void wand_explode(struct obj *, int); #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)); -E void FDECL(punish, (struct obj *)); -E void NDECL(unpunish); -E boolean FDECL(cant_revive, (int *, BOOLEAN_P, struct obj *)); -E boolean NDECL(create_particular); +E void litroom(boolean, struct obj *); +E void do_genocide(int); +E void punish(struct obj *); +E void unpunish(void); +E boolean cant_revive(int *, boolean, struct obj *); +E boolean create_particular(void); /* ### 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(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 *); /* ## 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, int)); -E boolean NDECL(region_danger); -E void NDECL(region_safety); +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, int); +E boolean region_danger(void); +E void region_safety(void); /* ### 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 FDECL(get_plname_from_file, (int, char *)); +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 get_plname_from_file(int, char *); #ifdef SELECTSAVED -E int FDECL(restore_menu, (winid)); +E int restore_menu(winid); #endif -E void NDECL(minit); -E boolean FDECL(lookup_id_mapping, (unsigned, unsigned *)); -E void FDECL(mread, (int, genericptr_t, unsigned int)); -E int FDECL(validate, (int, const char *)); -E void NDECL(reset_restpref); -E void FDECL(set_restpref, (const char *)); -E void FDECL(set_savepref, (const char *)); +E void minit(void); +E boolean lookup_id_mapping(unsigned, unsigned *); +E void mread(int, genericptr_t, unsigned int); +E int validate(int, const char *); +E void reset_restpref(void); +E void set_restpref(const char *); +E void set_savepref(const char *); /* ### rip.c ### */ -E void FDECL(genl_outrip, (winid, int, time_t)); +E void genl_outrip(winid, int, time_t); /* ### 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 rn2(int); +E int rnl(int); +E int rnd(int); +E int d(int, int); +E int rne(int); +E int rnz(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 int FDECL(str2role, (const char *)); -E int FDECL(str2race, (const char *)); -E int FDECL(str2gend, (const char *)); -E int FDECL(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 NDECL(rigid_role_checks); -E boolean FDECL(setrolefilter, (const char *)); -E boolean NDECL(gotrolefilter); -E void NDECL(clearrolefilter); -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 NDECL(plnamesuffix); -E void FDECL(role_selection_prolog, (int, winid)); -E void FDECL(role_menu_extra, (int, winid)); -E void NDECL(role_init); -E const char *FDECL(Hello, (struct monst *)); -E const char *NDECL(Goodbye); +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); +E int str2role(const char *); +E int str2race(const char *); +E int str2gend(const char *); +E 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 rigid_role_checks(void); +E boolean setrolefilter(const char *); +E boolean gotrolefilter(void); +E void clearrolefilter(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 plnamesuffix(void); +E void role_selection_prolog(int, winid); +E void role_menu_extra(int, winid); +E void role_init(void); +E const char *Hello(struct monst *); +E const char *Goodbye(void); /* ### rumors.c ### */ -E char *FDECL(getrumor, (int, char *, BOOLEAN_P)); -E char *FDECL(get_rnd_text, (const char *, char *)); -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 void NDECL(rumor_check); +E char *getrumor(int, char *, boolean); +E char *get_rnd_text(const char *, char *); +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 *); +E void rumor_check(void); /* ### save.c ### */ -E int NDECL(dosave); -E int NDECL(dosave0); -E boolean FDECL(tricked_fileremoved, (int, char *)); +E int dosave(void); +E int dosave0(void); +E boolean tricked_fileremoved(int, char *); #ifdef INSURANCE -E void NDECL(savestateinlock); +E void savestateinlock(void); #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, int); +E boolean swapin_file(int); +E void co_false(void); #else -E void FDECL(savelev, (int, XCHAR_P, int)); -#endif -E genericptr_t FDECL(mon_to_buffer, (struct monst *, int *)); -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(def_bclose, (int)); +E void savelev(int, xchar, int); +#endif +E genericptr_t mon_to_buffer(struct monst *, int *); +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 def_bclose(int); #if defined(ZEROCOMP) -E void FDECL(zerocomp_bclose, (int)); +E void zerocomp_bclose(int); #endif -E void FDECL(savecemetery, (int, int, struct cemetery **)); -E void FDECL(savefruitchn, (int, int)); -E void FDECL(store_plname_in_file, (int)); -E void NDECL(free_dungeons); -E void NDECL(freedynamicdata); -E void FDECL(store_savefileinfo, (int)); +E void savecemetery(int, int, struct cemetery **); +E void savefruitchn(int, int); +E void store_plname_in_file(int); +E void free_dungeons(void); +E void freedynamicdata(void); +E void store_savefileinfo(int); /* ### shk.c ### */ -E long FDECL(money2mon, (struct monst *, long)); -E void FDECL(money2u, (struct monst *, long)); -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)); -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(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 boolean FDECL(block_door, (XCHAR_P, XCHAR_P)); -E boolean FDECL(block_entry, (XCHAR_P, XCHAR_P)); -E char *FDECL(shk_your, (char *, struct obj *)); -E char *FDECL(Shk_Your, (char *, struct obj *)); +E long money2mon(struct monst *, long); +E void money2u(struct monst *, long); +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); +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 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 boolean block_door(xchar, xchar); +E boolean block_entry(xchar, xchar); +E char *shk_your(char *, struct obj *); +E char *Shk_Your(char *, struct obj *); /* ### shknam.c ### */ -E void FDECL(neweshk, (struct monst *)); -E void FDECL(free_eshk, (struct monst *)); -E void FDECL(stock_room, (int, struct mkroom *)); -E boolean FDECL(saleable, (struct monst *, struct obj *)); -E int FDECL(get_shop_item, (int)); -E const char *FDECL(shkname, (struct monst *)); -E boolean FDECL(shkname_is_pname, (struct monst *)); -E boolean FDECL(is_izchak, (struct monst *, BOOLEAN_P)); +E void neweshk(struct monst *); +E void free_eshk(struct monst *); +E void stock_room(int, struct mkroom *); +E boolean saleable(struct monst *, struct obj *); +E int get_shop_item(int); +E const char *shkname(struct monst *); +E boolean shkname_is_pname(struct monst *); +E boolean is_izchak(struct monst *, boolean); /* ### sit.c ### */ -E void NDECL(take_gold); -E int NDECL(dosit); -E void NDECL(rndcurse); -E void NDECL(attrcurse); +E void take_gold(void); +E int dosit(void); +E void rndcurse(void); +E void attrcurse(void); /* ### 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(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); #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.c ### */ -E void NDECL(sys_early_init); -E void NDECL(sysopt_release); -E void FDECL(sysopt_seduce_set, (int)); +E void sys_early_init(void); +E void sysopt_release(void); +E void sysopt_seduce_set(int); /* ### 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 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 -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 *)); +dig_corridor(coord *, coord *, boolean, schar, schar); +E void fill_room(struct mkroom *, boolean); +E boolean load_special(const char *); /* ### spell.c ### */ #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 void NDECL(losespells); -E int NDECL(dovspell); -E void FDECL(initialspell, (struct obj *)); +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 void losespells(void); +E int dovspell(void); +E void initialspell(struct obj *); /* ### 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(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 *); /* ### steed.c ### */ -E void NDECL(rider_cant_reach); -E boolean FDECL(can_saddle, (struct monst *)); -E int FDECL(use_saddle, (struct obj *)); -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(void); +E boolean can_saddle(struct monst *); +E int use_saddle(struct obj *); +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); /* ### teleport.c ### */ -E boolean FDECL(goodpos, (int, int, struct monst *, unsigned)); -E boolean FDECL(enexto, (coord *, XCHAR_P, XCHAR_P, struct permonst *)); +E boolean goodpos(int, int, struct monst *, unsigned); +E boolean enexto(coord *, xchar, xchar, struct permonst *); E boolean -FDECL(enexto_core, (coord *, XCHAR_P, XCHAR_P, struct permonst *, unsigned)); -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 void NDECL(tele); -E boolean FDECL(scrolltele, (struct obj *)); -E int NDECL(dotele); -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 *)); -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)); +enexto_core(coord *, xchar, xchar, struct permonst *, unsigned); +E void teleds(int, int, boolean); +E boolean safe_teleds(boolean); +E boolean teleport_pet(struct monst *, boolean); +E void tele(void); +E boolean scrolltele(struct obj *); +E int dotele(void); +E void level_tele(void); +E void domagicportal(struct trap *); +E void tele_trap(struct trap *); +E void level_tele_trap(struct trap *); +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); /* ### 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(relink_timers, (BOOLEAN_P)); -E int NDECL(wiz_timeout_queue); -E void NDECL(timer_sanity_check); +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 relink_timers(boolean); +E int wiz_timeout_queue(void); +E void timer_sanity_check(void); /* ### topten.c ### */ -E void FDECL(formatkiller, (char *, unsigned, int)); -E void FDECL(topten, (int, time_t)); -E void FDECL(prscore, (int, char **)); -E struct obj *FDECL(tt_oname, (struct obj *)); +E void formatkiller(char *, unsigned, int); +E void topten(int, time_t); +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(void); +E void settrack(void); +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)); -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(dotrap, (struct trap *, unsigned)); -E void FDECL(seetrap, (struct trap *)); -E void FDECL(feeltrap, (struct trap *)); -E int FDECL(mintrap, (struct monst *)); -E void FDECL(instapetrify, (const char *)); -E void FDECL(minstapetrify, (struct monst *, BOOLEAN_P)); -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 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); +E struct monst *animate_statue(struct obj *, xchar, xchar, int, int *); +E struct monst *activate_statue_trap(struct trap *, xchar, xchar, boolean); +E void dotrap(struct trap *, unsigned); +E void seetrap(struct trap *); +E void feeltrap(struct trap *); +E int mintrap(struct monst *); +E void instapetrify(const char *); +E void minstapetrify(struct monst *, boolean); +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 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 void FDECL(blow_up_landmine, (struct trap *)); -E int FDECL(launch_obj, (SHORT_P, int, int, int, int, int)); -E boolean NDECL(launch_in_progress); -E void NDECL(force_launch_placement); -E boolean FDECL(uteetering_at_seen_pit, (struct trap *)); -E boolean NDECL(lava_effects); -E void NDECL(sink_into_lava); -E void NDECL(sokoban_guilt); +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 void blow_up_landmine(struct trap *); +E int launch_obj(short, int, int, int, int, int); +E boolean launch_in_progress(void); +E void force_launch_placement(void); +E boolean uteetering_at_seen_pit(struct trap *); +E boolean lava_effects(void); +E void sink_into_lava(void); +E void sokoban_guilt(void); /* ### u_init.c ### */ -E void NDECL(u_init); +E void u_init(void); /* ### uhitm.c ### */ -E void FDECL(erode_armor, (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)); -E int FDECL(damageum, (struct monst *, struct attack *)); -E void FDECL(missum, (struct monst *, struct attack *, BOOLEAN_P)); -E int FDECL(passive, (struct monst *, 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 erode_armor(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); +E int damageum(struct monst *, struct attack *); +E void missum(struct monst *, struct attack *, boolean); +E int passive(struct monst *, 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); /* ### unixmain.c ### */ #ifdef UNIX #ifdef PORT_HELP -E void NDECL(port_help); +E void port_help(void); #endif -E void FDECL(sethanguphandler, (void (*)(int))); -E boolean NDECL(authorize_wizard_mode); -E boolean FDECL(check_user_string, (char *)); +E void sethanguphandler(void (*)(int)); +E boolean authorize_wizard_mode(void); +E boolean check_user_string(char *); #endif /* UNIX */ /* ### 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 VDECL(error, (const char *, ...)) PRINTF_F(1, 2); +E void gettty(void); +E void settty(const char *); +E void setftty(void); +E void intron(void); +E void introff(void); +E void 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(void); +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(void); #endif /* SHELL */ #if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER) -E int FDECL(child, (int)); +E int child(int); #endif #ifdef PANICTRACE -E boolean FDECL(file_exists, (const char *)); +E boolean file_exists(const char *); #endif #endif /* UNIX */ @@ -2422,353 +2396,350 @@ E boolean FDECL(file_exists, (const char *)); #ifdef UNIX #ifdef GNOME_GRAPHICS -E int FDECL(hide_privileges, (BOOLEAN_P)); +E int hide_privileges(boolean); #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 char FDECL(vault_occupied, (char *)); -E void NDECL(invault); -E int FDECL(gd_move, (struct monst *)); -E void NDECL(paygd); -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 char vault_occupied(char *); +E void invault(void); +E int gd_move(struct monst *); +E void paygd(void); +E long hidden_gold(void); +E boolean gd_sound(void); +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(void); +E int doextversion(void); #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 boolean FDECL(uptodate, (int, const char *)); -E void FDECL(store_version, (int)); -E unsigned long FDECL(get_feature_notice_ver, (char *)); -E unsigned long NDECL(get_current_feature_ver); -E const char *FDECL(copyright_banner_line, (int)); +check_version(struct version_info *, const char *, boolean); +E boolean uptodate(int, const char *); +E void store_version(int); +E unsigned long get_feature_notice_ver(char *); +E unsigned long get_current_feature_ver(void); +E const char *copyright_banner_line(int); #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(void); +E void gr_finish(void); #endif -E void FDECL(tileview, (BOOLEAN_P)); +E void tileview(boolean); #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(void); #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), genericptr_t)); -E unsigned FDECL(howmonseen, (struct monst *)); +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), genericptr_t); +E unsigned howmonseen(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(void); +E unsigned long enable_broadcast_trapping(void); +E unsigned long disable_broadcast_trapping(void); #if 0 -E struct mail_info *NDECL(parse_next_broadcast); +E struct mail_info *parse_next_broadcast(void); #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); #endif /* CHDIR */ -E void FDECL(sethanguphandler, (void (*)(int))); -E boolean NDECL(authorize_wizard_mode); +E void sethanguphandler(void (*)(int)); +E boolean authorize_wizard_mode(void); /* ### vmsmisc.c ### */ -E void NDECL(vms_abort) NORETURN; -E void FDECL(vms_exit, (int)) NORETURN; +E void vms_abort(void) NORETURN; +E void vms_exit(int) NORETURN; #ifdef PANICTRACE -E void FDECL(vms_traceback, (int)); +E void vms_traceback(int); #endif /* ### 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 void VDECL(error, (const char *, ...)) PRINTF_F(1, 2); +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 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(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); #if defined(CHDIR) || defined(SHELL) || defined(SECURE) -E void NDECL(privoff); -E void NDECL(privon); +E void privoff(void); +E void privon(void); #endif #ifdef SHELL -E int NDECL(dosh); +E int dosh(void); #endif #if defined(SHELL) || defined(MAIL) -E int FDECL(vms_doshell, (const char *, BOOLEAN_P)); +E int vms_doshell(const char *, boolean); #endif #ifdef SUSPEND -E int NDECL(dosuspend); +E int dosuspend(void); #endif #ifdef SELECTSAVED -E int FDECL(vms_get_saved_games, (const char *, char ***)); +E int vms_get_saved_games(const char *, char ***); #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 struct obj *FDECL(select_rwep, (struct monst *)); -E struct obj *FDECL(select_hwep, (struct monst *)); -E void FDECL(possibly_unwield, (struct monst *, BOOLEAN_P)); -E void FDECL(mwepgone, (struct monst *)); -E int FDECL(mon_wield_item, (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 int NDECL(enhance_weapon_skill); -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 const char *weapon_descr(struct obj *); +E int hitval(struct obj *, struct monst *); +E int dmgval(struct obj *, struct monst *); +E struct obj *select_rwep(struct monst *); +E struct obj *select_hwep(struct monst *); +E void possibly_unwield(struct monst *, boolean); +E void mwepgone(struct monst *); +E int mon_wield_item(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); +E int enhance_weapon_skill(void); +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 *); /* ### 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 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); /* ### 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 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 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 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 *); /* ### windows.c ### */ -E void FDECL(choose_windows, (const char *)); +E void choose_windows(const char *); #ifdef WINCHAIN -void FDECL(addto_windowchain, (const char *s)); -void NDECL(commit_windowchain); -#endif -E boolean NDECL(genl_can_suspend_no); -E boolean NDECL(genl_can_suspend_yes); -E char FDECL(genl_message_menu, (CHAR_P, int, const char *)); -E void FDECL(genl_preference_update, (const char *)); -E char *FDECL(genl_getmsghistory, (BOOLEAN_P)); -E void FDECL(genl_putmsghistory, (const char *, BOOLEAN_P)); +void addto_windowchain(const char *s); +void commit_windowchain(void); +#endif +E boolean genl_can_suspend_no(void); +E boolean genl_can_suspend_yes(void); +E char genl_message_menu(char, int, const char *); +E void genl_preference_update(const char *); +E char *genl_getmsghistory(boolean); +E void genl_putmsghistory(const char *, boolean); #ifdef HANGUPHANDLING -E void NDECL(nhwindows_hangup); +E void nhwindows_hangup(void); #endif #ifdef STATUS_VIA_WINDOWPORT -E void NDECL(genl_status_init); -E void NDECL(genl_status_finish); -E void FDECL(genl_status_enablefield, - (int, const char *, const char *, BOOLEAN_P)); -E void FDECL(genl_status_update, (int, genericptr_t, int, int)); +E void genl_status_init(void); +E void genl_status_finish(void); +E void genl_status_enablefield + (int, const char *, const char *, boolean); +E void genl_status_update(int, genericptr_t, int, int); #ifdef STATUS_HILITES -E void FDECL(genl_status_threshold, (int, int, anything, int, int, int)); +E void genl_status_threshold(int, int, anything, int, int, int); #endif #endif /* ### 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 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(void); +E int mon_has_amulet(struct monst *); +E int mon_has_special(struct monst *); +E int tactics(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 *); /* ### 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 *)); -E void FDECL(remove_worm, (struct monst *)); -E void FDECL(place_worm_tail_randomly, (struct monst *, XCHAR_P, XCHAR_P)); -E int FDECL(count_wsegs, (struct monst *)); -E boolean FDECL(worm_known, (struct monst *)); -E boolean FDECL(worm_cross, (int, int, int, int)); +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 *); +E void remove_worm(struct monst *); +E void place_worm_tail_randomly(struct monst *, xchar, xchar); +E int count_wsegs(struct monst *); +E boolean worm_known(struct monst *); +E boolean worm_cross(int, int, int, int); /* ### worn.c ### */ -E void FDECL(setworn, (struct obj *, long)); -E void FDECL(setnotworn, (struct obj *)); -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 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 *); /* ### write.c ### */ -E int FDECL(dowrite, (struct obj *)); +E int dowrite(struct obj *); /* ### zap.c ### */ -E void FDECL(learnwand, (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 *)); -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 *)); -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 **)); -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(melt_ice, (XCHAR_P, XCHAR_P, const char *)); -E void FDECL(start_melt_ice_timeout, (XCHAR_P, XCHAR_P, long)); -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 NDECL(makewish); +E void learnwand(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 *); +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 *); +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), + int (*)(OBJ_P, OBJ_P), struct obj **); +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 melt_ice(xchar, xchar, const char *); +E void start_melt_ice_timeout(xchar, xchar, long); +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(void); #endif /* !MAKEDEFS_C && !LEV_LEX_C */ diff --git a/include/func_tab.h b/include/func_tab.h index bb5c16b43e..51a2072ee5 100644 --- a/include/func_tab.h +++ b/include/func_tab.h @@ -8,13 +8,13 @@ struct func_tab { char f_char; boolean can_if_buried; - int NDECL((*f_funct)); + int (*f_funct)(void); const char *f_text; }; struct ext_func_tab { const char *ef_txt, *ef_desc; - int NDECL((*ef_funct)); + int (*ef_funct)(void); boolean can_if_buried; }; diff --git a/include/global.h b/include/global.h index b7a61bd16c..5d1873d0af 100644 --- a/include/global.h +++ b/include/global.h @@ -252,9 +252,9 @@ typedef uchar 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 @@ -265,8 +265,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/macwin.h b/include/macwin.h index a8a3cd85b8..140fb1970c 100644 --- a/include/macwin.h +++ b/include/macwin.h @@ -166,7 +166,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 ### */ @@ -182,8 +182,8 @@ extern void popattempt(void); /* ### 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 ### */ @@ -195,51 +195,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(void); 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(void); +E void mac_get_nh_event(void); +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); +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, char, int, + const char *, boolean); +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(void); +E int mac_nh_poskey(int *, int *, int *); +E int mac_doprev_message(void); +E char mac_yn_function(const char *, const char *, char); +E void mac_getlin(const char *, char *); +E int mac_get_ext_cmd(void); +E void mac_number_pad(int); +E void mac_delay_output(void); #undef E diff --git a/include/mextra.h b/include/mextra.h index e2cde882cd..1c41f113cd 100644 --- a/include/mextra.h +++ b/include/mextra.h @@ -24,8 +24,8 @@ * 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 48b149bfa3..cd7a04e712 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -74,9 +74,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); /* *=============================================== @@ -194,12 +193,12 @@ extern char hackdir[]; #define ABORT C('a') #define getuid() 1 #define getlogin() ((char *) 0) -extern void NDECL(win32_abort); -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 NDECL(raw_clear_screen); +extern void win32_abort(void); +extern void nttty_preference_update(const char *); +extern void toggle_mouse_support(void); +extern void map_subkeyvalue(char *); +extern void load_keyboard_handler(void); +extern void raw_clear_screen(void); #include #ifndef __BORLANDC__ @@ -232,13 +231,13 @@ int _RTLENTRY _EXPFUNC read(int __handle, void _FAR *__buf, unsigned __len); #define ALLOCA_HACK /* used in util/panic.c */ #endif -extern int FDECL(set_win32_option, (const char *, const char *)); +extern int set_win32_option(const char *, const char *); #define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED #define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED #define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON) #ifdef CHANGE_COLOR -extern int FDECL(alternative_palette, (char *)); +extern int alternative_palette(char *); #endif #endif /* NTCONF_H */ diff --git a/include/obj.h b/include/obj.h index 487907cc5e..5c37da3633 100644 --- a/include/obj.h +++ b/include/obj.h @@ -380,8 +380,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/qt_win.h b/include/qt_win.h index 136e8a6ef4..2ccc41b9f7 100644 --- a/include/qt_win.h +++ b/include/qt_win.h @@ -846,15 +846,15 @@ class NetHackQtBind : NetHackQtBindBase static void qt_resume_nhwindows(); static winid qt_create_nhwindow(int type); static void qt_clear_nhwindow(winid wid); - static void qt_display_nhwindow(winid wid, BOOLEAN_P block); + static void qt_display_nhwindow(winid wid, boolean block); static void qt_destroy_nhwindow(winid wid); static void qt_curs(winid wid, int x, int y); static void qt_putstr(winid wid, int attr, const char *text); - static void qt_display_file(const char *filename, BOOLEAN_P must_exist); + static void qt_display_file(const char *filename, boolean must_exist); static void qt_start_menu(winid wid); static void qt_add_menu(winid wid, int glyph, const ANY_P *identifier, - CHAR_P ch, CHAR_P gch, int attr, const char *str, - BOOLEAN_P presel); + char ch, char gch, int attr, const char *str, + boolean presel); static void qt_end_menu(winid wid, const char *prompt); static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list); static void qt_update_inventory(); @@ -863,7 +863,7 @@ class NetHackQtBind : NetHackQtBindBase static void qt_cliparound(int x, int y); static void qt_cliparound_window(winid wid, int x, int y); - static void qt_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, + static void qt_print_glyph(winid wid, xchar x, xchar y, int glyph, int bkglyph); static void qt_raw_print(const char *str); static void qt_raw_print_bold(const char *str); @@ -872,7 +872,7 @@ class NetHackQtBind : NetHackQtBindBase static void qt_nhbell(); static int qt_doprev_message(); static char qt_yn_function(const char *question, const char *choices, - CHAR_P def); + char def); static void qt_getlin(const char *prompt, char *line); static int qt_get_ext_cmd(); static void qt_number_pad(int); diff --git a/include/region.h b/include/region.h index dd1534fc2a..6d86d5f6a3 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); /* * player_flags diff --git a/include/system.h b/include/system.h index 21ccf8b721..769331d41d 100644 --- a/include/system.h +++ b/include/system.h @@ -79,14 +79,14 @@ typedef long off_t; #undef random #endif #if !defined(__SC__) && !defined(LINUX) -E long NDECL(random); +E long random(void); #endif #if (!defined(SUNOS4) && !defined(bsdi) && !defined(__FreeBSD__)) \ || defined(RANDOM) -E void FDECL(srandom, (unsigned int)); +E void srandom(unsigned int); #else #if !defined(bsdi) && !defined(__FreeBSD__) -E int FDECL(srandom, (unsigned int)); +E int srandom(unsigned int); #endif #endif #else @@ -97,7 +97,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) @@ -116,31 +116,31 @@ 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 #endif #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 @@ -152,37 +152,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 @@ -190,89 +190,89 @@ 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(void); #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 long FDECL(atol, (const char *)); -E int FDECL(chdir, (const char *)); +E int close(int); +E int atoi(const char *); +E long atol(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(void); #else -E long NDECL(fork); +E long fork(void); #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 long FDECL(atol, (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 long atol(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 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 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 close(int); +E int creat(const char *, unsigned, ...); +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 open(const char *, int, 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 */ @@ -282,19 +282,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(void); +E void _exit(int); +E int system(const char *); #endif #if defined(HPUX) && !defined(_POSIX_SOURCE) -E long NDECL(fork); +E long fork(void); #endif #ifdef POSIX_TYPES @@ -305,9 +305,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*() */ @@ -322,27 +322,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 */ @@ -354,40 +354,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(void); +E long getgid(void); +E long getpid(void); #else #ifdef POSIX_TYPES -E pid_t NDECL(getpid); -E uid_t NDECL(getuid); -E gid_t NDECL(getgid); +E pid_t getpid(void); +E uid_t getuid(void); +E gid_t getgid(void); #ifdef VMS -E pid_t NDECL(getppid); +E pid_t getppid(void); #endif #else /*!POSIX_TYPES*/ #ifndef getpid /* Borland C defines getpid() as a macro */ -E int NDECL(getpid); +E int getpid(void); #endif #ifdef VMS -E int NDECL(getppid); -E unsigned NDECL(getuid); -E unsigned NDECL(getgid); +E int getppid(void); +E unsigned getuid(void); +E unsigned getgid(void); #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(void); +E unsigned getgid(void); +E int setgid(int); +E int setuid(int); #endif #endif /*?POSIX_TYPES*/ #endif /*?(HPUX && !_POSIX_SOURCE)*/ @@ -404,31 +404,31 @@ 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 */ @@ -437,8 +437,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(). @@ -466,7 +466,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(); @@ -482,9 +482,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 @@ -497,58 +497,58 @@ E int FDECL(vprintf, (const char *, va_list)); #endif #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 #if defined(ALLOC_C) || defined(MAKEDEFS_C) -E genericptr_t FDECL(malloc, (size_t)); -E genericptr_t FDECL(realloc, (genericptr_t, size_t)); +E genericptr_t malloc(size_t); +E genericptr_t realloc(genericptr_t, size_t); #endif /* time functions */ #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 */ #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 #ifdef MICRO #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 e405b5e148..b1f5a69cdf 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 */ #define TIMER_LEVEL 0 /* event specific to level */ diff --git a/include/tosconf.h b/include/tosconf.h index 1ccf132bd5..8dc9254490 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 26ce81ad5e..a7b246b0dd 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -23,166 +23,9 @@ #define NHSTDC #endif -#if defined(ultrix) && defined(__STDC__) && !defined(__LANGUAGE_C) -/* Ultrix seems to be in a constant state of flux. This check attempts to - * set up ansi compatibility if it wasn't set up correctly by the compiler. - */ -#ifdef mips -#define __mips mips -#endif -#ifdef LANGUAGE_C -#define __LANGUAGE_C LANGUAGE_C -#endif -#endif - -/* - * ANSI X3J11 detection. - * Makes substitutes for compatibility with the old C standard. - */ - -/* Decide how to handle variable parameter lists: - * USE_STDARG means use the ANSI facilities (only ANSI compilers - * should do this, and only if the library supports it). - * USE_VARARGS means use the facilities. Again, this should only - * be done if the library supports it. ANSI is *not* required for this. - * Otherwise, the kludgy old methods are used. - * The defaults are USE_STDARG for ANSI compilers, and USE_OLDARGS for - * others. - */ - -/* #define USE_VARARGS */ /* use instead of */ -/* #define USE_OLDARGS */ /* don't use any variable argument facilities */ - -#if defined(apollo) /* Apollos have stdarg(3) but not stdarg.h */ +#include #define USE_VARARGS -#endif - -#if defined(NHSTDC) || defined(ULTRIX_PROTO) || defined(MAC) -#if !defined(USE_VARARGS) && !defined(USE_OLDARGS) && !defined(USE_STDARG) #define USE_STDARG -#endif -#endif - -#ifdef NEED_VARARGS /* only define these if necessary */ -/* - * These have changed since 3.4.3. VA_END() now provides an explicit - * closing brace to complement VA_DECL()'s hidden opening brace, so code - * started with VA_DECL() needs an extra opening brace to complement - * the explicit final closing brace. This was done so that the source - * would look less strange, where VA_DECL() appeared to introduce a - * function whose opening brace was missing; there are now visible and - * invisible braces at beginning and end. Sample usage: - void foo VA_DECL(int, arg) --macro expansion has a hidden opening brace - { --new, explicit opening brace (actually introduces a nested block) - VA_START(bar); - ...code for foo... - VA_END(); --expansion now provides a closing brace for the nested block - } --existing closing brace, still pairs with the hidden one in VA_DECL() - * Reading the code--or using source browsing tools which match braces-- - * results in seeing a matched set of braces. Usage of VA_END() is - * potentially trickier, but nethack uses it in a straightforward manner. - */ - -#ifdef USE_STDARG -#include -#define VA_DECL(typ1, var1) \ - (typ1 var1, ...) \ - { \ - va_list the_args; -#define VA_DECL2(typ1, var1, typ2, var2) \ - (typ1 var1, typ2 var2, ...) \ - { \ - va_list the_args; -#define VA_INIT(var1, typ1) -#define VA_NEXT(var1, typ1) var1 = va_arg(the_args, typ1) -#define VA_ARGS the_args -#define VA_START(x) va_start(the_args, x) -#define VA_END() \ - va_end(the_args); \ - } -#if defined(ULTRIX_PROTO) && !defined(_VA_LIST_) -#define _VA_LIST_ /* prevents multiple def in stdio.h */ -#endif -#else - -#ifdef USE_VARARGS -#include -#define VA_DECL(typ1, var1) \ - (va_alist) va_dcl \ - { \ - va_list the_args; \ - typ1 var1; -#define VA_DECL2(typ1, var1, typ2, var2) \ - (va_alist) va_dcl \ - { \ - va_list the_args; \ - typ1 var1; \ - typ2 var2; -#define VA_ARGS the_args -#define VA_START(x) va_start(the_args) -#define VA_INIT(var1, typ1) var1 = va_arg(the_args, typ1) -#define VA_NEXT(var1, typ1) var1 = va_arg(the_args, typ1) -#define VA_END() \ - va_end(the_args); \ - } -#else - -/*USE_OLDARGS*/ -#define VA_ARGS arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 -#define VA_DECL(typ1, var1) \ - (var1, VA_ARGS) typ1 var1; \ - char *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7, *arg8, *arg9; \ - { -#define VA_DECL2(typ1, var1, typ2, var2) \ - (var1, var2, VA_ARGS) typ1 var1; \ - typ2 var2; \ - char *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7, *arg8, *arg9; \ - { -#define VA_START(x) -#define VA_INIT(var1, typ1) -/* This is inherently risky, and should only be attempted as a - very last resort; manipulating arguments which haven't actually - been passed may or may not cause severe trouble depending on - the function-calling/argument-passing mechanism being used. - - [nethack's core doesn't use VA_NEXT() so doesn't use VA_SHIFT() - either, and this definition is just retained for completeness. - lev_comp does use VA_NEXT(), but it passes all 'argX' arguments.] - */ -#define VA_SHIFT() \ - (arg1 = arg2, arg2 = arg3, arg3 = arg4, arg4 = arg5, arg5 = arg6, \ - arg6 = arg7, arg7 = arg8, arg8 = arg9) -#define VA_NEXT(var1, typ1) ((var1 = (typ1) arg1), VA_SHIFT(), var1) -#define VA_END() } -#endif -#endif - -#endif /* NEED_VARARGS */ - -#if defined(NHSTDC) || defined(MSDOS) || defined(MAC) \ - || defined(ULTRIX_PROTO) || defined(__BEOS__) - -/* - * 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 -#define VDECL(f, p) f() -#endif /* * Used for definitions of functions which take no arguments to force @@ -202,12 +45,6 @@ */ /* And IBM CSet/2. The redeclaration of free hoses the compile. */ #define genericptr_t genericptr -#else -#if !defined(NHSTDC) && !defined(MAC) -#define const -#define signed -#define volatile -#endif #endif /* @@ -223,31 +60,6 @@ #endif #endif -#else /* NHSTDC */ /* a "traditional" C compiler */ - -#define NDECL(f) f() -#define FDECL(f, p) f() -#define VDECL(f, p) f() - -#define VOID_ARGS /*empty*/ - -#if defined(AMIGA) || defined(HPUX) || defined(POSIX_TYPES) \ - || defined(__DECC) || defined(__BORLANDC__) -#define genericptr void * -#endif -#ifndef genericptr -#define genericptr char * -#endif - -/* - * Traditional C compilers don't have "signed", "const", or "volatile". - */ -#define signed -#define const -#define volatile - -#endif /* NHSTDC */ - #ifndef genericptr_t typedef genericptr genericptr_t; /* (void *) or (char *) */ #endif @@ -304,30 +116,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ /* These are used for arguments within FDECL/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 -#define UCHAR_P int -#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 FDECL/VDECL always empty; all xxx_P vanish so defs aren't needed. */ -#endif -#endif /* OBJ_P and MONST_P should _only_ be used for declaring function pointers. */ @@ -361,7 +150,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ #undef NDECL #undef FDECL #undef VDECL -#define NDECL(f) f() +#define f(void) f() #define FDECL(f, p) f() #define VDECL(f, p) f() #undef VOID_ARGS diff --git a/include/vmsconf.h b/include/vmsconf.h index 75e732a2d7..c41f8e9e40 100644 --- a/include/vmsconf.h +++ b/include/vmsconf.h @@ -284,10 +284,10 @@ 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 FILE *FDECL(vms_fopen, (const char *, const char *)); -char *FDECL(vms_basename, (const char *)); /* vmsfiles.c */ +extern void vms_exit(int); +extern int vms_open(const char *, int, unsigned); +extern FILE *vms_fopen(const char *, const char *); +char *vms_basename(const char *); /* vmsfiles.c */ #endif /* VMSCONF_H */ #endif /* VMS */ diff --git a/include/wceconf.h b/include/wceconf.h index 7ab03f672b..57854c80af 100644 --- a/include/wceconf.h +++ b/include/wceconf.h @@ -175,10 +175,10 @@ extern char hackdir[]; #define ABORT C('a') #define getuid() 1 #define getlogin() ((char *) 0) -extern void NDECL(win32_abort); +extern void win32_abort(void); #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(void); #endif #ifndef alloca @@ -211,7 +211,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 diff --git a/include/winX.h b/include/winX.h index 4b13f4f78c..6831394c29 100644 --- a/include/winX.h +++ b/include/winX.h @@ -13,15 +13,11 @@ #define E extern #endif -#if defined(BOS) || defined(NHSTDC) +#if defined(BOS) #define DIMENSION_P int #else -#ifdef WIDENED_PROTOTYPES -#define DIMENSION_P unsigned int -#else #define DIMENSION_P Dimension #endif -#endif /* * Generic text buffer. @@ -277,148 +273,147 @@ 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)); +CreateDialog(Widget, String, XtCallbackProc, XtCallbackProc); +E void SetDialogPrompt(Widget, String); +E String GetDialogResponse(Widget); +E void SetDialogResponse(Widget, String); +E void positionpopup(Widget, boolean); /* ### 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 FDECL(win_X11_init, (int)); -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(int); +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, 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(void); +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, 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, Widget); +E void destroy_status_window(struct xwindow *); +E void adjust_status(struct xwindow *, const char *); +E void null_out_status(void); +E void check_turn_events(void); /* ### 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); +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); /* 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, time_t)); +E void calculate_rip_text(int, time_t); #endif /* ### winval.c ### */ -E Widget FDECL(create_value, (Widget, const char *)); -E void FDECL(set_name, (Widget, const 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, const 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 FDECL(X11_display_file, (const char *, BOOLEAN_P)); -E void FDECL(X11_start_menu, (winid)); -E void FDECL(X11_add_menu, (winid, int, const ANY_P *, CHAR_P, CHAR_P, int, - const char *, BOOLEAN_P)); -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_init_nhwindows(int *, char **); +E void X11_player_selection(void); +E void X11_askname(void); +E void X11_get_nh_event(void); +E void X11_exit_nhwindows(const char *); +E void X11_suspend_nhwindows(const char *); +E void X11_resume_nhwindows(void); +E winid X11_create_nhwindow(int); +E void X11_clear_nhwindow(winid); +E void X11_display_nhwindow(winid, boolean); +E void X11_destroy_nhwindow(winid); +E void X11_curs(winid, int, int); +E void X11_putstr(winid, int, const char *); +E void X11_display_file(const char *, boolean); +E void X11_start_menu(winid); +E void X11_add_menu(winid, int, const ANY_P *, char, char, int, + const char *, boolean); +E void X11_end_menu(winid, const char *); +E int X11_select_menu(winid, int, MENU_ITEM_P **); +E void X11_update_inventory(void); +E void X11_mark_synch(void); +E void X11_wait_synch(void); #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, xchar, int, int); +E void X11_raw_print(const char *); +E void X11_raw_print_bold(const char *); +E int X11_nhgetch(void); +E int X11_nh_poskey(int *, int *, int *); +E void X11_nhbell(void); +E int X11_doprev_message(void); +E char X11_yn_function(const char *, const char *, char); +E void X11_getlin(const char *, char *); +E int X11_get_ext_cmd(void); +E void X11_number_pad(int); +E void X11_delay_output(void); /* 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(void); +E void X11_end_screen(void); #ifdef GRAPHIC_TOMBSTONE -E void FDECL(X11_outrip, (winid, int, time_t)); +E void X11_outrip(winid, int, time_t); #else -E void FDECL(genl_outrip, (winid, int, time_t)); +E void genl_outrip(winid, int, time_t); #endif -E void FDECL(X11_preference_update, (const char *)); +E void X11_preference_update(const char *); #endif /* WINX_H */ diff --git a/include/wingem.h b/include/wingem.h index 61c7e7c87d..69d671cfc1 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(void); #endif -E void FDECL(docorner, (int, int)); -E void NDECL(end_glyphout); -E void FDECL(g_putch, (int)); -E void FDECL(win_Gem_init, (int)); -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, 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(void); +E void g_putch(int); +E void win_Gem_init(int); +E int mar_gem_init(void); +E char mar_ask_class(void); +E char *mar_ask_name(void); +E int mar_create_window(int); +E void mar_destroy_nhwindow(int); +E void mar_print_glyph(int, 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(void); +E void mar_set_menu_type(int); +E void mar_reverse_menu(void); +E void mar_set_menu_title(const char *); +E void mar_set_accelerators(void); +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(void); +E int mar_hol_win_type(int); +E void mar_clear_messagewin(void); +E void mar_set_no_glyph(int); +E void mar_map_curs_weiter(void); /* 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(void); +E void Gem_askname(void); +E void Gem_get_nh_event(void); +E void Gem_exit_nhwindows(const char *); +E void Gem_suspend_nhwindows(const char *); +E void Gem_resume_nhwindows(void); +E winid Gem_create_nhwindow(int); +E void Gem_clear_nhwindow(winid); +E void Gem_display_nhwindow(winid, boolean); +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); +E void Gem_start_menu(winid); +E void Gem_add_menu(winid, int, const ANY_P *, char, char, int, + const char *, boolean); +E void Gem_end_menu(winid, const char *); +E int Gem_select_menu(winid, int, MENU_ITEM_P **); +E char Gem_message_menu(char, int, const char *); +E void Gem_update_inventory(void); +E void Gem_mark_synch(void); +E void Gem_wait_synch(void); #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, 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, xchar, int, int); +E void Gem_raw_print(const char *); +E void Gem_raw_print_bold(const char *); +E int Gem_nhgetch(void); +E int Gem_nh_poskey(int *, int *, int *); +E void Gem_nhbell(void); +E int Gem_doprev_message(void); +E char Gem_yn_function(const char *, const char *, char); +E void Gem_getlin(const char *, char *); +E int Gem_get_ext_cmd(void); +E void Gem_number_pad(int); +E void Gem_delay_output(void); #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(void); #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(void); +E void Gem_end_screen(void); -E void FDECL(genl_outrip, (winid, int, time_t)); +E void genl_outrip(winid, int, time_t); #undef E diff --git a/include/winprocs.h b/include/winprocs.h index b76d9e1ded..a626e85884 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -15,76 +15,74 @@ struct window_procs { 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 FDECL((*win_putmixed), (winid, int, const char *)); - void FDECL((*win_display_file), (const char *, BOOLEAN_P)); - void FDECL((*win_start_menu), (winid)); - void FDECL((*win_add_menu), (winid, int, const ANY_P *, CHAR_P, CHAR_P, - int, const char *, BOOLEAN_P)); - 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_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); + void (*win_destroy_nhwindow)(winid); + void (*win_curs)(winid, int, int); + void (*win_putstr)(winid, int, const char *); + void (*win_putmixed)(winid, int, const char *); + void (*win_display_file)(const char *, boolean); + void (*win_start_menu)(winid); + void (*win_add_menu)(winid, int, const ANY_P *, char, char, int, const char *, boolean); + void (*win_end_menu)(winid, const char *); + int (*win_select_menu)(winid, int, MENU_ITEM_P **); + char (*win_message_menu)(char, 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, 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); + 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, time_t)); - void FDECL((*win_preference_update), (const char *)); - char *FDECL((*win_getmsghistory), (BOOLEAN_P)); - void FDECL((*win_putmsghistory), (const char *, BOOLEAN_P)); + void (*win_outrip)(winid, int, time_t); + void (*win_preference_update)(const char *); + char *(*win_getmsghistory)(boolean); + void (*win_putmsghistory)(const char *, boolean); #ifdef STATUS_VIA_WINDOWPORT - void NDECL((*win_status_init)); - void NDECL((*win_status_finish)); - void FDECL((*win_status_enablefield), - (int, const char *, const char *, BOOLEAN_P)); - void FDECL((*win_status_update), (int, genericptr_t, int, int)); + void (*win_status_init)(void); + void (*win_status_finish)(void); + void (*win_status_enablefield)(int, const char *, const char *, boolean)); + void (*win_status_update)(int, genericptr_t, int, int); #ifdef STATUS_HILITES - void FDECL((*win_status_threshold), (int, int, anything, int, int, int)); + void (*win_status_threshold)(int, int, anything, int, int, int); #endif #endif - boolean NDECL((*win_can_suspend)); + boolean (*win_can_suspend)(void); }; extern @@ -323,78 +321,74 @@ struct chain_procs { unsigned long wincap; /* window port capability options supported */ unsigned long wincap2; /* additional window port capability options supported */ - void FDECL((*win_init_nhwindows), (CARGS, int *, char **)); - void FDECL((*win_player_selection), (CARGS)); - void FDECL((*win_askname), (CARGS)); - void FDECL((*win_get_nh_event), (CARGS)); - void FDECL((*win_exit_nhwindows), (CARGS, const char *)); - void FDECL((*win_suspend_nhwindows), (CARGS, const char *)); - void FDECL((*win_resume_nhwindows), (CARGS)); - winid FDECL((*win_create_nhwindow), (CARGS, int)); - void FDECL((*win_clear_nhwindow), (CARGS, winid)); - void FDECL((*win_display_nhwindow), (CARGS, winid, BOOLEAN_P)); - void FDECL((*win_destroy_nhwindow), (CARGS, winid)); - void FDECL((*win_curs), (CARGS, winid, int, int)); - void FDECL((*win_putstr), (CARGS, winid, int, const char *)); - void FDECL((*win_putmixed), (CARGS, winid, int, const char *)); - void FDECL((*win_display_file), (CARGS, const char *, BOOLEAN_P)); - void FDECL((*win_start_menu), (CARGS, winid)); - void FDECL((*win_add_menu), (CARGS, winid, int, const ANY_P *, CHAR_P, - CHAR_P, int, const char *, BOOLEAN_P)); - void FDECL((*win_end_menu), (CARGS, winid, const char *)); - int FDECL((*win_select_menu), (CARGS, winid, int, MENU_ITEM_P **)); - char FDECL((*win_message_menu), (CARGS, CHAR_P, int, const char *)); - void FDECL((*win_update_inventory), (CARGS)); - void FDECL((*win_mark_synch), (CARGS)); - void FDECL((*win_wait_synch), (CARGS)); + void (*win_init_nhwindows)(CARGS, int *, char **); + void (*win_player_selection)(CARGS); + void (*win_askname)(CARGS); + void (*win_get_nh_event)(CARGS); + void (*win_exit_nhwindows)(CARGS, const char *); + void (*win_suspend_nhwindows)(CARGS, const char *); + void (*win_resume_nhwindows)(CARGS); + winid (*win_create_nhwindow)(CARGS, int); + void (*win_clear_nhwindow)(CARGS, winid); + void (*win_display_nhwindow)(CARGS, winid, boolean); + void (*win_destroy_nhwindow)(CARGS, winid); + void (*win_curs)(CARGS, winid, int, int); + void (*win_putstr)(CARGS, winid, int, const char *); + void (*win_putmixed)(CARGS, winid, int, const char *); + void (*win_display_file)(CARGS, const char *, boolean); + void (*win_start_menu)(CARGS, winid); + void (*win_add_menu)(CARGS, winid, int, const ANY_P *, char, char, int, const char *, boolean); + void (*win_end_menu)(CARGS, winid, const char *); + int (*win_select_menu)(CARGS, winid, int, MENU_ITEM_P **); + char (*win_message_menu)(CARGS, char, int, const char *); + void (*win_update_inventory)(CARGS); + void (*win_mark_synch)(CARGS); + void (*win_wait_synch)(CARGS); #ifdef CLIPPING - void FDECL((*win_cliparound), (CARGS, int, int)); + void (*win_cliparound)(CARGS, int, int); #endif #ifdef POSITIONBAR - void FDECL((*win_update_positionbar), (CARGS, char *)); + void (*win_update_positionbar)(CARGS, char *); #endif - void FDECL((*win_print_glyph), (CARGS, winid, XCHAR_P, XCHAR_P, int, int)); - void FDECL((*win_raw_print), (CARGS, const char *)); - void FDECL((*win_raw_print_bold), (CARGS, const char *)); - int FDECL((*win_nhgetch), (CARGS)); - int FDECL((*win_nh_poskey), (CARGS, int *, int *, int *)); - void FDECL((*win_nhbell), (CARGS)); - int FDECL((*win_doprev_message), (CARGS)); - char FDECL((*win_yn_function), - (CARGS, const char *, const char *, CHAR_P)); - void FDECL((*win_getlin), (CARGS, const char *, char *)); - int FDECL((*win_get_ext_cmd), (CARGS)); - void FDECL((*win_number_pad), (CARGS, int)); - void FDECL((*win_delay_output), (CARGS)); + void (*win_print_glyph)(CARGS, winid, xchar, xchar, int, int); + void (*win_raw_print)(CARGS, const char *); + void (*win_raw_print_bold)(CARGS, const char *); + int (*win_nhgetch)(CARGS); + int (*win_nh_poskey)(CARGS, int *, int *, int *); + void (*win_nhbell)(CARGS); + int (*win_doprev_message)(CARGS); + char (*win_yn_function)(CARGS, const char *, const char *, char)); + void (*win_getlin)(CARGS, const char *, char *); + int (*win_get_ext_cmd)(CARGS); + void (*win_number_pad)(CARGS, int); + void (*win_delay_output)(CARGS); #ifdef CHANGE_COLOR - void FDECL((*win_change_color), (CARGS, int, long, int)); + void (*win_change_color)(CARGS, int, long, int); #ifdef MAC - void FDECL((*win_change_background), (CARGS, int)); - short FDECL((*win_set_font_name), (CARGS, winid, char *)); + void (*win_change_background)(CARGS, int); + short (*win_set_font_name)(CARGS, winid, char *); #endif - char *FDECL((*win_get_color_string), (CARGS)); + char *(*win_get_color_string)(CARGS); #endif /* other defs that really should go away (they're tty specific) */ - void FDECL((*win_start_screen), (CARGS)); - void FDECL((*win_end_screen), (CARGS)); + void (*win_start_screen)(CARGS); + void (*win_end_screen)(CARGS); - void FDECL((*win_outrip), (CARGS, winid, int, time_t)); - void FDECL((*win_preference_update), (CARGS, const char *)); - char *FDECL((*win_getmsghistory), (CARGS, BOOLEAN_P)); - void FDECL((*win_putmsghistory), (CARGS, const char *, BOOLEAN_P)); + void (*win_outrip)(CARGS, winid, int, time_t); + void (*win_preference_update)(CARGS, const char *); + char *(*win_getmsghistory)(CARGS, boolean); + void (*win_putmsghistory)(CARGS, const char *, boolean); #ifdef STATUS_VIA_WINDOWPORT - void FDECL((*win_status_init), (CARGS)); - void FDECL((*win_status_finish), (CARGS)); - void FDECL((*win_status_enablefield), - (CARGS, int, const char *, const char *, BOOLEAN_P)); - void FDECL((*win_status_update), (CARGS, int, genericptr_t, int, int)); + void (*win_status_init)(CARGS); + void (*win_status_finish)(CARGS); + void (*win_status_enablefield)(CARGS, int, const char *, const char *, boolean)); + void (*win_status_update)(CARGS, int, genericptr_t, int, int); #ifdef STATUS_HILITES - void FDECL((*win_status_threshold), - (CARGS, int, int, anything, int, int, int)); + void (*win_status_threshold)(CARGS, int, int, anything, int, int, int)); #endif #endif - boolean FDECL((*win_can_suspend), (CARGS)); + boolean (*win_can_suspend)(CARGS); }; #endif /* WINCHAIN */ diff --git a/include/wintty.h b/include/wintty.h index 4191cf3496..537dd34fe2 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -92,44 +92,44 @@ 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(void); #endif #if defined(apollo) /* Apollos don't widen old-style function definitions properly -- they try to * be smart and use the prototype, or some such strangeness. So we have to - * define UNWIDENDED_PROTOTYPES (in tradstdc.h), which makes CHAR_P below a + * define UNWIDENDED_PROTOTYPES (in tradstdc.h), which makes char below a * char. But the tputs termcap call was compiled as if xputc's argument * actually would be expanded. So here, we have to make an exception. */ -E void FDECL(xputc, (int)); +E void xputc(int); #else -E void FDECL(xputc, (CHAR_P)); +E void xputc(char); #endif -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(void); +E void clear_screen(void); +E void home(void); +E void standoutbeg(void); +E void standoutend(void); #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(void); +E void boldbeg(void); +E void blinkbeg(void); +E void dimbeg(void); +E void m_end(void); #endif -E void NDECL(backsp); -E void NDECL(graph_on); -E void NDECL(graph_off); -E void NDECL(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 @@ -137,100 +137,100 @@ 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(void); +E void term_end_raw_bold(void); #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(void); +E void term_start_color(int color); +E int has_color(int color); #endif /* TEXTCOLOR */ /* ### topl.c ### */ -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(void); +E void update_topl(const char *); +E void putsyms(const char *); /* ### wintty.c ### */ #ifdef CLIPPING -E void NDECL(setclipped); +E void setclipped(void); #endif -E void FDECL(docorner, (int, int)); -E void NDECL(end_glyphout); -E void FDECL(g_putch, (int)); -E void FDECL(win_tty_init, (int)); +E void docorner(int, int); +E void end_glyphout(void); +E void g_putch(int); +E void win_tty_init(int); /* 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 FDECL(tty_display_file, (const char *, BOOLEAN_P)); -E void FDECL(tty_start_menu, (winid)); -E void FDECL(tty_add_menu, (winid, int, const ANY_P *, CHAR_P, CHAR_P, int, - const char *, BOOLEAN_P)); -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_init_nhwindows(int *, char **); +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(void); +E winid tty_create_nhwindow(int); +E void tty_clear_nhwindow(winid); +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 *); +E void tty_display_file(const char *, boolean); +E void tty_start_menu(winid); +E void tty_add_menu(winid, int, const ANY_P *, char, char, int, + const char *, boolean); +E void tty_end_menu(winid, const char *); +E int tty_select_menu(winid, int, MENU_ITEM_P **); +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 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, xchar, 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 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(void); +E void tty_number_pad(int); +E void tty_delay_output(void); #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(void); #endif #ifdef STATUS_VIA_WINDOWPORT -E void NDECL(tty_status_init); -E void FDECL(tty_status_update, (int, genericptr_t, int, int)); +E void tty_status_init(void); +E void tty_status_update(int, genericptr_t, int, int); #ifdef STATUS_HILITES -E void FDECL(tty_status_threshold, (int, int, anything, int, int, int)); +E void tty_status_threshold(int, int, anything, int, int, int); #endif #endif /* 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(void); +E void tty_end_screen(void); -E void FDECL(genl_outrip, (winid, int, time_t)); +E void genl_outrip(winid, int, time_t); -E char *FDECL(tty_getmsghistory, (BOOLEAN_P)); -E void FDECL(tty_putmsghistory, (const char *, BOOLEAN_P)); +E char *tty_getmsghistory(boolean); +E void tty_putmsghistory(const char *, boolean); #ifdef NO_TERMS #ifdef MAC @@ -241,9 +241,9 @@ E void FDECL(tty_putmsghistory, (const char *, BOOLEAN_P)); #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(WIN32) #if defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST) || defined(WIN32) @@ -255,7 +255,7 @@ E int FDECL(term_puts, (const char *str)); #define puts(x) xputs(x) #endif /*SCREEN_BIOS || SCREEN_DJGPPFAST || WIN32 */ #ifdef POSITIONBAR -E void FDECL(video_update_positionbar, (char *)); +E void video_update_positionbar(char *); #endif #endif /*MSDOS*/ #endif /*NO_TERMS*/ diff --git a/src/allmain.c b/src/allmain.c index 962df4c688..32b898e919 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -11,12 +11,11 @@ #endif #ifdef POSITIONBAR -STATIC_DCL void NDECL(do_positionbar); +STATIC_DCL void do_positionbar(void); #endif void -moveloop(resuming) -boolean resuming; +moveloop(boolean resuming) { #if defined(MICRO) || defined(WIN32) char ch; @@ -605,9 +604,9 @@ newgame() } /* show "welcome [back] to nethack" message at program startup */ +/* false => restoring an old game */ void -welcome(new_game) -boolean new_game; /* false => restoring an old game */ +welcome(boolean new_game) { char buf[BUFSZ]; boolean currentgend = Upolyd ? u.mfemale : flags.female; diff --git a/src/alloc.c b/src/alloc.c index 2d51fc7865..afcf923762 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -10,26 +10,25 @@ #define EXTERN_H /* comment line for pre-compiled headers */ #include "config.h" -char *FDECL(fmt_ptr, (const genericptr)); +char *fmt_ptr(const genericptr); #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 *, ...)) +panic(const char *, ...) PRINTF_F(1, 2); long * -alloc(lth) -register unsigned int lth; +alloc(register unsigned int lth) { #ifdef LINT /* @@ -78,8 +77,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 genericptr ptr) { char *buf; @@ -106,10 +104,7 @@ heapmon_init() } long * -nhalloc(lth, file, line) -unsigned int lth; -const char *file; -int line; +nhalloc(unsigned int lth, const char *file, int line) { long *ptr = alloc(lth); @@ -126,10 +121,7 @@ int line; } void -nhfree(ptr, file, line) -genericptr_t ptr; -const char *file; -int line; +nhfree(genericptr_t ptr, const char *file, int line) { if (!tried_heaplog) heapmon_init(); @@ -143,10 +135,7 @@ int line; /* strdup() which uses our alloc() rather than libc's malloc(), with caller tracking */ char * -nhdupstr(string, file, line) -const char *string; -const char *file; -int line; +nhdupstr(const char *string, const char *file, int line) { return strcpy((char *) nhalloc(strlen(string) + 1, file, line), string); } @@ -158,8 +147,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 22cef7f5a0..15c556b41b 100644 --- a/src/apply.c +++ b/src/apply.c @@ -6,49 +6,48 @@ extern boolean notonhead; /* for long worms */ -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 *)); -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 void FDECL(use_leash, (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(light_cocktail, (struct obj *)); -STATIC_PTR void FDECL(display_jump_positions, (int)); -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_PTR void FDECL(display_polearm_positions, (int)); -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 boolean FDECL(figurine_location_checks, (struct obj *, - coord *, BOOLEAN_P)); -STATIC_DCL void FDECL(add_class, (char *, CHAR_P)); -STATIC_DCL void FDECL(setapplyclasses, (char *)); -STATIC_DCL boolean FDECL(is_valid_jump_pos, (int, int, int, BOOLEAN_P)); -STATIC_DCL boolean FDECL(find_poleable_mon, (coord *, int, int)); +STATIC_DCL int use_camera(struct obj *); +STATIC_DCL int use_towel(struct obj *); +STATIC_DCL boolean its_dead(int, int, int *); +STATIC_DCL int use_stethoscope(struct obj *); +STATIC_DCL void use_whistle(struct obj *); +STATIC_DCL void use_magic_whistle(struct obj *); +STATIC_DCL void use_leash(struct obj *); +STATIC_DCL int use_mirror(struct obj *); +STATIC_DCL void use_bell(struct obj **); +STATIC_DCL void use_candelabrum(struct obj *); +STATIC_DCL void use_candle(struct obj **); +STATIC_DCL void use_lamp(struct obj *); +STATIC_DCL void light_cocktail(struct obj *); +STATIC_PTR void display_jump_positions(int); +STATIC_DCL void use_tinning_kit(struct obj *); +STATIC_DCL void use_figurine(struct obj **); +STATIC_DCL void use_grease(struct obj *); +STATIC_DCL void use_trap(struct obj *); +STATIC_DCL void use_stone(struct obj *); +STATIC_PTR int set_trap(void); /* occupation callback */ +STATIC_DCL int use_whip(struct obj *); +STATIC_PTR void display_polearm_positions(int); +STATIC_DCL int use_pole(struct obj *); +STATIC_DCL int use_cream_pie(struct obj *); +STATIC_DCL int use_grapple(struct obj *); +STATIC_DCL int do_break_wand(struct obj *); +STATIC_DCL boolean figurine_location_checks(struct obj *, + coord *, boolean); +STATIC_DCL void add_class(char *, char); +STATIC_DCL void setapplyclasses(char *); +STATIC_DCL boolean is_valid_jump_pos(int, int, int, boolean); +STATIC_DCL boolean find_poleable_mon(coord *, int, int); #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 -use_camera(obj) -struct obj *obj; +use_camera(struct obj *obj) { struct monst *mtmp; @@ -76,8 +75,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, &obj)) != 0) { + (int (*)(MONST_P, OBJ_P)) 0, + (int (*)(OBJ_P, OBJ_P)) 0, &obj)) != 0) { obj->ox = u.ux, obj->oy = u.uy; (void) flash_hits_mon(mtmp, obj); } @@ -85,8 +84,7 @@ struct obj *obj; } STATIC_OVL int -use_towel(obj) -struct obj *obj; +use_towel(struct obj *obj) { boolean drying_feedback = (obj == uwep); @@ -171,8 +169,7 @@ struct obj *obj; /* maybe give a stethoscope message based on floor objects */ STATIC_OVL boolean -its_dead(rx, ry, resp) -int rx, ry, *resp; +its_dead(int rx, int ry, int*resp) { char buf[BUFSZ]; boolean more_corpses; @@ -289,8 +286,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_OVL int -use_stethoscope(obj) -register struct obj *obj; +use_stethoscope(register struct obj *obj) { struct monst *mtmp; struct rm *lev; @@ -419,8 +415,7 @@ register struct obj *obj; static const char whistle_str[] = "produce a %s whistling sound."; STATIC_OVL void -use_whistle(obj) -struct obj *obj; +use_whistle(struct obj *obj) { if (!can_blow(&youmonst)) { You("are incapable of using the whistle."); @@ -433,8 +428,7 @@ struct obj *obj; } STATIC_OVL void -use_magic_whistle(obj) -struct obj *obj; +use_magic_whistle(struct obj *obj) { register struct monst *mtmp, *nextmon; @@ -486,8 +480,7 @@ struct obj *obj; } boolean -um_dist(x, y, n) -xchar x, y, n; +um_dist(xchar x, xchar y, xchar n) { return (boolean) (abs(u.ux - x) > n || abs(u.uy - y) > n); } @@ -506,8 +499,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; @@ -519,9 +511,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; @@ -554,16 +544,14 @@ unleash_all() #define MAXLEASHED 2 static boolean -leashable(mtmp) -struct monst *mtmp; +leashable(struct monst *mtmp) { return (boolean) (mtmp->mnum != PM_LONG_WORM); } /* ARGSUSED */ STATIC_OVL void -use_leash(obj) -struct obj *obj; +use_leash(struct obj *obj) { coord cc; register struct monst *mtmp; @@ -641,8 +629,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; @@ -688,8 +675,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; @@ -771,8 +757,7 @@ beautiful() static const char look_str[] = "look %s."; STATIC_OVL int -use_mirror(obj) -struct obj *obj; +use_mirror(struct obj *obj) { const char *mirror, *uvisage; struct monst *mtmp; @@ -844,8 +829,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, &obj); + (int (*)(MONST_P, OBJ_P)) 0, + (int (*)(OBJ_P, OBJ_P)) 0, &obj); if (!mtmp || !haseyes(mtmp->data) || notonhead) return 1; @@ -933,8 +918,7 @@ struct obj *obj; } STATIC_OVL void -use_bell(optr) -struct obj **optr; +use_bell(struct obj **optr) { register struct obj *obj = *optr; struct monst *mtmp; @@ -1065,8 +1049,7 @@ struct obj **optr; } STATIC_OVL void -use_candelabrum(obj) -register struct obj *obj; +use_candelabrum(register struct obj *obj) { const char *s = (obj->spe != 1) ? "candles" : "candle"; @@ -1118,8 +1101,7 @@ register struct obj *obj; } STATIC_OVL void -use_candle(optr) -struct obj **optr; +use_candle(struct obj **optr) { register struct obj *obj = *optr; register struct obj *otmp; @@ -1187,8 +1169,7 @@ struct obj **optr; /* call in drop, throw, and put in box, etc. */ boolean -snuff_candle(otmp) -struct obj *otmp; +snuff_candle(struct obj *otmp) { boolean candle = Is_candle(otmp); @@ -1213,8 +1194,7 @@ 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; @@ -1236,8 +1216,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; @@ -1272,8 +1251,7 @@ struct obj *obj; } STATIC_OVL void -use_lamp(obj) -struct obj *obj; +use_lamp(struct obj *obj) { char buf[BUFSZ]; @@ -1324,9 +1302,9 @@ struct obj *obj; } } +/* obj is a potion of oil */ STATIC_OVL void -light_cocktail(obj) -struct obj *obj; /* obj is a potion of oil */ +light_cocktail(struct obj *obj) { char buf[BUFSZ]; boolean split1off; @@ -1438,9 +1416,7 @@ dojump() } 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 @@ -1468,8 +1444,7 @@ boolean showmsg; static int jumping_is_magic; void -display_jump_positions(state) -int state; +display_jump_positions(int state) { if (state == 0) { tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos)); @@ -1489,9 +1464,9 @@ int state; } } +/* 0=Physical, otherwise skill level */ int -jump(magic) -int magic; /* 0=Physical, otherwise skill level */ +jump(int magic) { coord cc; @@ -1640,8 +1615,7 @@ int magic; /* 0=Physical, otherwise skill level */ } boolean -tinnable(corpse) -struct obj *corpse; +tinnable(struct obj *corpse) { if (corpse->oeaten) return 0; @@ -1651,8 +1625,7 @@ struct obj *corpse; } STATIC_OVL void -use_tinning_kit(obj) -struct obj *obj; +use_tinning_kit(struct obj *obj) { struct obj *corpse, *can; @@ -1723,8 +1696,7 @@ struct obj *obj; } void -use_unicorn_horn(obj) -struct obj *obj; +use_unicorn_horn(struct obj *obj) { #define PROP_COUNT 7 /* number of properties we're dealing with */ #define ATTR_COUNT (A_MAX * 3) /* number of attribute points we might fix */ @@ -1913,9 +1885,7 @@ struct obj *obj; * Timer callback routine: turn figurine into monster */ void -fig_transform(arg, timeout) -anything *arg; -long timeout; +fig_transform(anything *arg, long timeout) { struct obj *figurine = arg->a_obj; struct monst *mtmp; @@ -2024,10 +1994,7 @@ long timeout; } STATIC_OVL 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; @@ -2060,8 +2027,7 @@ boolean quietly; } STATIC_OVL void -use_figurine(optr) -struct obj **optr; +use_figurine(struct obj **optr) { register struct obj *obj = *optr; xchar x, y; @@ -2099,8 +2065,7 @@ struct obj **optr; static NEARDATA const char lubricables[] = { ALL_CLASSES, ALLOW_NONE, 0 }; STATIC_OVL void -use_grease(obj) -struct obj *obj; +use_grease(struct obj *obj) { struct obj *otmp; @@ -2164,8 +2129,7 @@ reset_trapset() /* touchstones - by Ken Arnold */ STATIC_OVL void -use_stone(tstone) -struct obj *tstone; +use_stone(struct obj *tstone) { struct obj *obj; boolean do_scratch; @@ -2293,8 +2257,7 @@ struct obj *tstone; /* Place a landmine/bear trap. Helge Hafting */ STATIC_OVL void -use_trap(otmp) -struct obj *otmp; +use_trap(struct obj *otmp) { int ttyp, tmp; const char *what = (char *) 0; @@ -2433,8 +2396,7 @@ set_trap() } STATIC_OVL int -use_whip(obj) -struct obj *obj; +use_whip(struct obj *obj) { char buf[BUFSZ]; struct monst *mtmp; @@ -2708,9 +2670,7 @@ static const char /* find pos of monster in range, if only one monster */ 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; struct monst *selmon = (struct monst *) 0; @@ -2735,8 +2695,7 @@ static int polearm_range_min = -1; static int polearm_range_max = -1; void -display_polearm_positions(state) -int state; +display_polearm_positions(int state) { if (state == 0) { tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos)); @@ -2760,8 +2719,7 @@ int state; /* Distance attacks by pole-weapons */ STATIC_OVL int -use_pole(obj) -struct obj *obj; +use_pole(struct obj *obj) { int res = 0, typ, max_range, min_range, glyph; coord cc; @@ -2881,8 +2839,7 @@ struct obj *obj; } STATIC_OVL int -use_cream_pie(obj) -struct obj *obj; +use_cream_pie(struct obj *obj) { boolean wasblind = Blind; boolean wascreamed = u.ucreamed; @@ -2919,8 +2876,7 @@ struct obj *obj; } STATIC_OVL int -use_grapple(obj) -struct obj *obj; +use_grapple(struct obj *obj) { int res = 0, typ, max_range = 4, tohit; boolean save_confirm; @@ -3069,8 +3025,7 @@ struct obj *obj; /* return 1 if the wand is broken, hence some time elapsed */ STATIC_OVL 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; @@ -3292,9 +3247,7 @@ struct obj *obj; } STATIC_OVL void -add_class(cl, class) -char *cl; -char class; +add_class(char *cl, char class) { char tmp[2]; @@ -3307,8 +3260,7 @@ static const char tools[] = { TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, 0 }; /* augment tools[] if various items are carried */ STATIC_OVL void -setapplyclasses(class_list) -char class_list[]; +setapplyclasses(char class_list[]) { register struct obj *otmp; int otyp; @@ -3554,8 +3506,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 23c7c49c2b..96d7e3983d 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -19,15 +19,15 @@ extern boolean notonhead; /* for long worms */ (((o) && (o)->oartifact) ? &artilist[(int) (o)->oartifact] : 0) STATIC_DCL 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 *)); +bane_applies(const struct artifact *, struct monst *); +STATIC_DCL int spec_applies(const struct artifact *, struct monst *); +STATIC_DCL int arti_invoke(struct obj *); STATIC_DCL boolean -FDECL(Mb_hit, (struct monst * magr, struct monst *mdef, struct obj *, int *, - int, BOOLEAN_P, char *)); -STATIC_DCL unsigned long FDECL(abil_to_spfx, (long *)); -STATIC_DCL uchar FDECL(abil_to_adtyp, (long *)); -STATIC_DCL boolean FDECL(untouchable, (struct obj *, BOOLEAN_P)); +Mb_hit(struct monst * magr, struct monst *mdef, struct obj *, int *, + int, boolean, char *); +STATIC_DCL unsigned long abil_to_spfx(long *); +STATIC_DCL uchar abil_to_adtyp(long *); +STATIC_DCL boolean untouchable(struct obj *, boolean); /* The amount added to the victim's total hit points to insure that the victim will be killed even after damage bonus/penalty adjustments. @@ -47,8 +47,8 @@ static boolean artiexist[1 + NROFARTIFACTS + 1]; /* and a discovery list for them (no dummy first entry here) */ STATIC_OVL xchar artidisco[NROFARTIFACTS]; -STATIC_DCL void NDECL(hack_artifacts); -STATIC_DCL boolean FDECL(attacks, (int, struct obj *)); +STATIC_DCL void hack_artifacts(void); +STATIC_DCL boolean attacks(int, struct obj *); /* handle some special cases; must be called after u_init() */ STATIC_OVL void @@ -84,16 +84,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); @@ -101,8 +99,7 @@ int fd; } const char * -artiname(artinum) -int artinum; +artiname(int artinum) { if (artinum <= 0 || artinum > NROFARTIFACTS) return ""; @@ -120,10 +117,10 @@ int artinum; For the 2nd case, caller should use ``obj = mk_artifact(obj, A_NONE);'' for the 1st, ``obj = mk_artifact((struct obj *)0, some_alignment);''. */ +/* existing object; ignored if alignment specified */ +/* target alignment, or A_NONE */ 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, aligntyp alignment) { const struct artifact *a; int m, n, altn; @@ -214,9 +211,7 @@ aligntyp alignment; /* target alignment, or A_NONE */ * is non-NULL. */ const char * -artifact_name(name, otyp) -const char *name; -short *otyp; +artifact_name(const char *name, short *otyp) { register const struct artifact *a; register const char *aname; @@ -238,9 +233,7 @@ short *otyp; } boolean -exist_artifact(otyp, name) -int otyp; -const char *name; +exist_artifact(int otyp, const char *name) { register const struct artifact *a; boolean *arex; @@ -253,10 +246,7 @@ 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; @@ -288,9 +278,7 @@ nartifact_exist() } boolean -spec_ability(otmp, abil) -struct obj *otmp; -unsigned long abil; +spec_ability(struct obj *otmp, unsigned long abil) { const struct artifact *arti = get_artifact(otmp); @@ -299,8 +287,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) @@ -311,8 +298,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); @@ -330,8 +316,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; @@ -350,9 +335,7 @@ struct obj *obj; /* returns 1 if name is restricted for otmp->otyp */ boolean -restrict_name(otmp, name) -struct obj *otmp; -const char *name; +restrict_name(struct obj *otmp, const char *name) { register const struct artifact *a; const char *aname, *odesc, *other; @@ -403,9 +386,7 @@ const char *name; } STATIC_OVL boolean -attacks(adtyp, otmp) -int adtyp; -struct obj *otmp; +attacks(int adtyp, struct obj *otmp) { register const struct artifact *weap; @@ -415,9 +396,7 @@ struct obj *otmp; } boolean -defends(adtyp, otmp) -int adtyp; -struct obj *otmp; +defends(int adtyp, struct obj *otmp) { register const struct artifact *weap; @@ -428,9 +407,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; @@ -441,9 +418,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; @@ -461,10 +436,7 @@ boolean being_worn; * unworn/unwielded/dropped. Pickup/drop only set/reset the W_ART mask. */ void -set_artifact_intrinsic(otmp, on, wp_mask) -register struct obj *otmp; -boolean on; -long wp_mask; +set_artifact_intrinsic(register struct obj *otmp, boolean on, long wp_mask) { long *mask = 0; register const struct artifact *oart = get_artifact(otmp); @@ -640,9 +612,7 @@ STATIC_VAR 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; @@ -712,9 +682,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); @@ -728,9 +696,7 @@ int dtyp; } STATIC_OVL boolean -bane_applies(oart, mon) -const struct artifact *oart; -struct monst *mon; +bane_applies(const struct artifact *oart, struct monst *mon) { struct artifact atmp; @@ -745,9 +711,7 @@ struct monst *mon; /* decide whether an artifact's special attacks apply against mtmp */ STATIC_OVL 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; @@ -805,8 +769,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); @@ -817,9 +780,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); @@ -833,10 +794,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); @@ -857,8 +815,7 @@ int tmp; /* add identified artifact to discoveries list */ void -discover_artifact(m) -xchar m; +discover_artifact(xchar m) { int i; @@ -876,8 +833,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; @@ -892,9 +848,9 @@ xchar m; } /* display a list of discovered artifacts; return their count */ +/* supplied by dodiscover() */ int -disp_artifact_discoveries(tmpwin) -winid tmpwin; /* supplied by dodiscover() */ +disp_artifact_discoveries(winid tmpwin) { int i, m, otyp; char buf[BUFSZ]; @@ -948,13 +904,13 @@ static const char *const mb_verb[2][4] = { /* called when someone is being hit by Magicbane */ STATIC_OVL 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 and defender */ + struct monst *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) */ { struct permonst *old_uasmon; const char *verb, *fakename; @@ -1137,11 +1093,11 @@ 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); @@ -1400,8 +1356,7 @@ doinvoke() } STATIC_OVL int -arti_invoke(obj) -struct obj *obj; +arti_invoke(struct obj *obj) { register const struct artifact *oart = get_artifact(obj); if (!obj) { @@ -1646,8 +1601,7 @@ struct obj *obj; /* will freeing this object from inventory cause levitation to end? */ boolean -finesse_ahriman(obj) -struct obj *obj; +finesse_ahriman(struct obj *obj) { const struct artifact *oart; struct prop save_Lev; @@ -1674,16 +1628,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 (boolean) (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; @@ -1702,9 +1654,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); @@ -1713,8 +1663,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; @@ -1725,8 +1674,7 @@ struct obj *otmp; } STATIC_OVL uchar -abil_to_adtyp(abil) -long *abil; +abil_to_adtyp(long *abil) { struct abil2adtyp_tag { long *abil; @@ -1749,8 +1697,7 @@ long *abil; } STATIC_OVL unsigned long -abil_to_spfx(abil) -long *abil; +abil_to_spfx(long *abil) { static const struct abil2spfx_tag { long *abil; @@ -1782,8 +1729,7 @@ long *abil; * Return the first item that is conveying a particular intrinsic. */ struct obj * -what_gives(abil) -long *abil; +what_gives(long *abil) { struct obj *obj; uchar dtyp; @@ -1829,8 +1775,7 @@ long *abil; } 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); @@ -1840,8 +1785,7 @@ int arti_indx; /* 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 @@ -1871,9 +1815,8 @@ 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; @@ -1942,9 +1885,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_OVL 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; @@ -1981,8 +1922,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; diff --git a/src/attrib.c b/src/attrib.c index 3866dbf26e..cf5e79b555 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -88,17 +88,17 @@ static const struct innate { orc_abil[] = { { 1, &(HPoison_resistance), "", "" }, { 0, 0, 0, 0 } }; -STATIC_DCL void NDECL(exerper); -STATIC_DCL void FDECL(postadjabil, (long *)); -STATIC_DCL const struct innate *FDECL(check_innate_abil, (long *, long)); -STATIC_DCL int FDECL(innately, (long *)); +STATIC_DCL void exerper(void); +STATIC_DCL void postadjabil(long *); +STATIC_DCL const struct innate *check_innate_abil(long *, long); +STATIC_DCL int innately(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 */ -{ /* negative => conditional (msg if change made) */ +adjattrib(int ndx, + int incr, + int msgflg) /* positive => no message, zero => message, and */ +{ /* negative => conditional (msg if change made) */ int old_acurr; boolean abonflg; const char *attrstr; @@ -152,10 +152,7 @@ int msgflg; /* positive => no message, zero => message, and */ } void -gainstr(otmp, incr, givemsg) -struct obj *otmp; -int incr; -boolean givemsg; +gainstr(struct obj *otmp, int incr, boolean givemsg) { int num = incr; @@ -173,8 +170,7 @@ boolean givemsg; /* may kill you; cause may be poison or monster like 'a' */ void -losestr(num) -register int num; +losestr(register int num) { int ustr = ABASE(A_STR) - num; @@ -193,7 +189,7 @@ register int num; } static const struct poison_effect_message { - void VDECL((*delivery_func), (const char *, ...)); + void (*delivery_func)(const char *, ...); const char *effect_msg; } poiseff[] = { { You_feel, "weaker" }, /* A_STR */ @@ -206,11 +202,10 @@ static const struct poison_effect_message { /* feedback for attribute loss due to poisoning */ void -poisontell(typ, exclaim) -int typ; /* which attribute */ -boolean exclaim; /* emphasis */ +poisontell(int typ, /* which attribute */ + boolean exclaim) /* emphasis */ { - void VDECL((*func), (const char *, ...)) = poiseff[typ].delivery_func; + void (*func)(const char *, ...) = poiseff[typ].delivery_func; (*func)("%s%c", poiseff[typ].effect_msg, exclaim ? '!' : '.'); } @@ -218,11 +213,11 @@ boolean exclaim; /* emphasis */ /* called when an attack or trap has poisoned the hero (used to be in mon.c) */ void -poisoned(reason, typ, pkiller, fatal, thrown_weapon) -const char *reason, /* controls what messages we display */ - *pkiller; /* for score+log file if fatal */ -int typ, fatal; /* if fatal is 0, limit damage to adjattrib */ -boolean thrown_weapon; /* thrown weapons are less deadly */ +poisoned(const char *reason, /* controls what messages we display */ + int typ, /* 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 */ + boolean thrown_weapon) /* thrown weapons are less deadly */ { int i, loss, kprefix = KILLED_BY_AN; @@ -283,8 +278,7 @@ boolean thrown_weapon; /* thrown weapons are less deadly */ } void -change_luck(n) -register schar n; +change_luck(register schar n) { u.uluck += n; if (u.uluck < 0 && u.uluck < LUCKMIN) @@ -294,8 +288,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; @@ -349,9 +342,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) { debugpline0("Exercise:"); if (i == A_INT || i == A_CHA) @@ -550,8 +541,7 @@ exerchk() } void -init_attr(np) -register int np; +init_attr(register int np) { register int i, x, tryct; @@ -624,8 +614,7 @@ redist_attr() STATIC_OVL void -postadjabil(ability) -long *ability; +postadjabil(long *ability) { if (!ability) return; @@ -634,9 +623,7 @@ long *ability; } STATIC_OVL const struct innate * -check_innate_abil(ability, frommask) -long *ability; -long frommask; +check_innate_abil(long *ability, long frommask) { const struct innate *abil = 0; @@ -713,8 +700,7 @@ long frommask; * otherwise returns 0 */ STATIC_OVL int -innately(ability) -long *ability; +innately(long *ability) { const struct innate *iptr; @@ -726,8 +712,7 @@ long *ability; } int -is_innate(propidx) -int propidx; +is_innate(int propidx) { if (propidx == BLINDED && !haseyes(youmonst.data)) return 1; @@ -735,8 +720,7 @@ int propidx; } char * -from_what(propidx) -int propidx; /* special cases can have negative values */ +from_what(int propidx) /* special cases can have negative values */ { static char buf[BUFSZ]; @@ -800,8 +784,7 @@ int propidx; /* special cases can have negative values */ } void -adjabil(oldlevel, newlevel) -int oldlevel, newlevel; +adjabil(int oldlevel, int newlevel) { register const struct innate *abil, *rabil; long prevabil, mask = FROMEXPER; @@ -970,8 +953,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]); @@ -1022,8 +1004,7 @@ acurrstr() 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); @@ -1049,8 +1030,7 @@ int attrindx; /* avoid possible problems with alignment overflow, and provide a centralized location for any future alignment limits */ void -adjalign(n) -int n; +adjalign(int n) { int newalign = u.ualign.record + n; @@ -1066,9 +1046,8 @@ int n; /* 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 1a35eea1c8..4f0148b8af 100644 --- a/src/ball.c +++ b/src/ball.c @@ -7,12 +7,11 @@ #include "hack.h" -STATIC_DCL int NDECL(bc_order); -STATIC_DCL void NDECL(litter); +STATIC_DCL int bc_order(void); +STATIC_DCL void litter(void); void -ballrelease(showmsg) -boolean showmsg; +ballrelease(boolean showmsg) { if (carried(uball)) { if (showmsg) @@ -191,8 +190,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); @@ -249,9 +247,7 @@ 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) { /* @@ -384,13 +380,9 @@ xchar ballx, bally, chainx, chainy; /* only matter !before */ * and chain. */ 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; @@ -690,8 +682,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 */ diff --git a/src/bones.c b/src/bones.c index 7ca192599b..aeab605c4d 100644 --- a/src/bones.c +++ b/src/bones.c @@ -10,14 +10,13 @@ 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_DCL boolean FDECL(fixuporacle, (struct monst *)); +STATIC_DCL boolean no_bones_level(d_level *); +STATIC_DCL void goodfruit(int); +STATIC_DCL void resetobjs(struct obj *, boolean); +STATIC_DCL boolean fixuporacle(struct monst *); STATIC_OVL 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; @@ -42,8 +41,7 @@ d_level *lev; * chain of fruit types, we know to only save the types that exist. */ STATIC_OVL void -goodfruit(id) -int id; +goodfruit(int id) { register struct fruit *f; @@ -56,9 +54,7 @@ int id; } STATIC_OVL void -resetobjs(ochain, restore) -struct obj *ochain; -boolean restore; +resetobjs(struct obj *ochain, boolean restore) { struct obj *otmp, *nobj; @@ -180,8 +176,7 @@ boolean restore; /* 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 = @@ -207,10 +202,7 @@ char *namebuf; /* called by savebones(); also by finish_paybill(shk.c) */ void -drop_upon_death(mtmp, cont, x, y) -struct monst *mtmp; -struct obj *cont; -int x, y; +drop_upon_death(struct monst *mtmp, struct obj *cont, int x, int y) { struct obj *otmp; @@ -243,8 +235,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_OVL boolean -fixuporacle(oracle) -struct monst *oracle; +fixuporacle(struct monst *oracle) { coord cc; int ridx, o_ridx; @@ -325,10 +316,7 @@ can_make_bones() /* save bones and possessions of a deceased adventurer */ void -savebones(how, when, corpse) -int how; -time_t when; -struct obj *corpse; +savebones(int how, time_t when, struct obj *corpse) { int fd, x, y; struct trap *ttmp; diff --git a/src/botl.c b/src/botl.c index 422f6d4efc..e564d069cd 100644 --- a/src/botl.c +++ b/src/botl.c @@ -11,12 +11,12 @@ const char *const enc_stat[] = { "", "Burdened", "Stressed", "Strained", "Overtaxed", "Overloaded" }; STATIC_OVL NEARDATA int mrank_sz = 0; /* loaded by max_rank_sz (from u_init) */ -STATIC_DCL const char *NDECL(rank); +STATIC_DCL const char *rank(void); #ifndef STATUS_VIA_WINDOWPORT -STATIC_DCL void NDECL(bot1); -STATIC_DCL void NDECL(bot2); +STATIC_DCL void bot1(void); +STATIC_DCL void bot2(void); STATIC_OVL void bot1() @@ -142,8 +142,7 @@ bot() /* 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; } @@ -151,18 +150,14 @@ int xlev; #if 0 /* not currently needed */ /* convert rank index (0..8) to experience level (1..30) */ int -rank_to_xlev(rank) -int rank; +rank_to_xlev(int rank) { return (rank <= 0) ? 1 : (rank <= 8) ? ((rank * 4) - 2) : 30; } #endif const char * -rank_of(lev, monnum, female) -int lev; -short monnum; -boolean female; +rank_of(int lev, short monnum, boolean female) { register const struct Role *role; register int i; @@ -197,9 +192,7 @@ rank() } 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; @@ -263,8 +256,7 @@ botl_score() /* 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; @@ -298,16 +290,16 @@ struct istat_s { }; -STATIC_DCL void NDECL(init_blstats); -STATIC_DCL char *FDECL(anything_to_s, (char *, anything *, int)); -STATIC_DCL void FDECL(s_to_anything, (anything *, char *, int)); -STATIC_OVL int FDECL(percentage, (struct istat_s *, struct istat_s *)); -STATIC_OVL int FDECL(compare_blstats, (struct istat_s *, struct istat_s *)); +STATIC_DCL void init_blstats(void); +STATIC_DCL char *anything_to_s(char *, anything *, int); +STATIC_DCL void s_to_anything(anything *, char *, int); +STATIC_OVL int percentage(struct istat_s *, struct istat_s *); +STATIC_OVL int compare_blstats(struct istat_s *, struct istat_s *); #ifdef STATUS_HILITES -STATIC_DCL boolean FDECL(assign_hilite, (char *, char *, char *, char *, - BOOLEAN_P)); -STATIC_DCL const char *FDECL(clridx_to_s, (char *, int)); +STATIC_DCL boolean assign_hilite(char *, char *, char *, char *, + boolean); +STATIC_DCL const char *clridx_to_s(char *, int); #endif /* If entries are added to this, botl.h will require updating too */ @@ -625,9 +617,9 @@ bot() } void -status_initialize(reassessment) -boolean - reassessment; /* TRUE = just reassess fields w/o other initialization*/ +status_initialize(boolean + reassessment) + /* TRUE = just reassess fields w/o other initialization*/ { int i; const char *fieldfmt = (const char *)0; @@ -816,10 +808,7 @@ init_blstats() } STATIC_OVL char * -anything_to_s(buf, a, anytype) -char *buf; -anything *a; -int anytype; +anything_to_s(char *buf, anything *a, int anytype) { if (!buf) return (char *) 0; @@ -862,10 +851,7 @@ int anytype; } STATIC_OVL void -s_to_anything(a, buf, anytype) -anything *a; -char *buf; -int anytype; +s_to_anything(anything *a, char *buf, int anytype) { if (!buf || !a) return; @@ -910,8 +896,7 @@ int anytype; } STATIC_OVL int -compare_blstats(bl1, bl2) -struct istat_s *bl1, *bl2; +compare_blstats(struct istat_s *bl1, struct istat_s *bl2) { int anytype, result = 0; @@ -989,8 +974,7 @@ struct istat_s *bl1, *bl2; } STATIC_OVL int -percentage(bl, maxbl) -struct istat_s *bl, *maxbl; +percentage(struct istat_s *bl, struct istat_s *maxbl) { int result = 0; int anytype; @@ -1059,9 +1043,7 @@ struct hilite_s status_hilites[MAXBLSTATS]; * strings, then calls assign_hilite() to make the adjustments. */ boolean -set_status_hilites(op, from_configfile) -char *op; -boolean from_configfile; +set_status_hilites(char *op, boolean from_configfile) { char hsbuf[4][QBUFSZ]; boolean rslt, badopt = FALSE; @@ -1106,8 +1088,7 @@ boolean from_configfile; } void -clear_status_hilites(from_configfile) -boolean from_configfile; +clear_status_hilites(boolean from_configfile) { int i; anything it; @@ -1122,9 +1103,7 @@ boolean from_configfile; } STATIC_OVL boolean -assign_hilite(sa, sb, sc, sd, from_configfile) -char *sa, *sb, *sc, *sd; -boolean from_configfile; +assign_hilite(char *sa, char *sb, char *sc, char *sd, boolean from_configfile) { char *tmp, *how; int i = -1, dt = -1, idx = -1; @@ -1265,8 +1244,7 @@ boolean from_configfile; } void -status_notify_windowport(all) -boolean all; +status_notify_windowport(boolean all) { int idx; anything it; @@ -1293,9 +1271,7 @@ boolean all; * in the config file. */ char * -get_status_hilites(buf, bufsiz) -char *buf; -int bufsiz; +get_status_hilites(char *buf, int bufsiz) { int i, j, k, coloridx; const char *text = (char *) 0; @@ -1380,9 +1356,7 @@ int bufsiz; } STATIC_OVL const char * -clridx_to_s(buf, idx) -char *buf; -int idx; +clridx_to_s(char *buf, int idx) { static const char *a[] = { "bold", "inverse", "normal" }; char* p = 0; diff --git a/src/cmd.c b/src/cmd.c index 8fd20ef0c9..cc3a609c99 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -28,160 +28,160 @@ extern const char *enc_stat[]; /* encumbrance status from botl.c */ #define CMD_CLICKLOOK (char) 0x8F #ifdef DEBUG -extern int NDECL(wiz_debug_cmd_bury); -extern int NDECL(wiz_debug_cmd_traveldisplay); +extern int wiz_debug_cmd_bury(void); +extern int wiz_debug_cmd_traveldisplay(void); #endif #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(enter_explore_mode); /**/ -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(docallcnd); /**/ -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(vanquished); /**/ -extern int NDECL(doengrave); /**/ -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(dosh); /**/ -extern int NDECL(dodiscovered); /**/ -extern int NDECL(doclassdisco); /**/ -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(dotip); /**/ -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(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 doapply(void); /**/ +extern int dorub(void); /**/ +extern int dojump(void); /**/ +extern int doextlist(void); /**/ +extern int enter_explore_mode(void); /**/ +extern int dodrop(void); /**/ +extern int doddrop(void); /**/ +extern int dodown(void); /**/ +extern int doup(void); /**/ +extern int donull(void); /**/ +extern int dowipe(void); /**/ +extern int docallcnd(void); /**/ +extern int dotakeoff(void); /**/ +extern int doremring(void); /**/ +extern int dowear(void); /**/ +extern int doputon(void); /**/ +extern int doddoremarm(void); /**/ +extern int dokick(void); /**/ +extern int dofire(void); /**/ +extern int dothrow(void); /**/ +extern int doeat(void); /**/ +extern int done2(void); /**/ +extern int vanquished(void); /**/ +extern int doengrave(void); /**/ +extern int dopickup(void); /**/ +extern int ddoinv(void); /**/ +extern int dotypeinv(void); /**/ +extern int dolook(void); /**/ +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 dosuspend(void); /**/ +extern int doforce(void); /**/ +extern int doopen(void); /**/ +extern int doclose(void); /**/ +extern int dosh(void); /**/ +extern int dodiscovered(void); /**/ +extern int doclassdisco(void); /**/ +extern int doset(void); /**/ +extern int dotogglepickup(void); /**/ +extern int dowhatis(void); /**/ +extern int doquickwhatis(void); /**/ +extern int dowhatdoes(void); /**/ +extern int dohelp(void); /**/ +extern int dohistory(void); /**/ +extern int doloot(void); /**/ +extern int dodrink(void); /**/ +extern int dodip(void); /**/ +extern int dosacrifice(void); /**/ +extern int dopray(void); /**/ +extern int dotip(void); /**/ +extern int doturn(void); /**/ +extern int doredraw(void); /**/ +extern int doread(void); /**/ +extern int dosave(void); /**/ +extern int dosearch(void); /**/ +extern int doidtrap(void); /**/ +extern int dopay(void); /**/ +extern int dosit(void); /**/ +extern int dotalk(void); /**/ +extern int docast(void); /**/ +extern int dovspell(void); /**/ +extern int dotele(void); /**/ +extern int dountrap(void); /**/ +extern int doversion(void); /**/ +extern int doextversion(void); /**/ +extern int doswapweapon(void); /**/ +extern int dowield(void); /**/ +extern int dowieldquiver(void); /**/ +extern int dozap(void); /**/ +extern int doorganize(void); /**/ #endif /* DUMB */ -static int NDECL(dosuspend_core); /**/ - -static int NDECL((*timed_occ_fn)); - -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(doterrain); -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_smell); -STATIC_PTR int NDECL(wiz_mon_polycontrol); -STATIC_PTR int NDECL(wiz_show_wmodes); -STATIC_DCL void NDECL(wiz_map_levltyp); -STATIC_DCL void NDECL(wiz_levltyp_legend); +static int dosuspend_core(void); /**/ + +static int (*timed_occ_fn)(void); + +STATIC_PTR int doprev_message(void); +STATIC_PTR int timed_occupation(void); +STATIC_PTR int doextcmd(void); +STATIC_PTR int domonability(void); +STATIC_PTR int dooverview_or_wiz_where(void); +STATIC_PTR int dotravel(void); +STATIC_PTR int doterrain(void); +STATIC_PTR int wiz_wish(void); +STATIC_PTR int wiz_identify(void); +STATIC_PTR int wiz_map(void); +STATIC_PTR int wiz_genesis(void); +STATIC_PTR int wiz_where(void); +STATIC_PTR int wiz_detect(void); +STATIC_PTR int wiz_panic(void); +STATIC_PTR int wiz_polyself(void); +STATIC_PTR int wiz_level_tele(void); +STATIC_PTR int wiz_level_change(void); +STATIC_PTR int wiz_show_seenv(void); +STATIC_PTR int wiz_show_vision(void); +STATIC_PTR int wiz_smell(void); +STATIC_PTR int wiz_mon_polycontrol(void); +STATIC_PTR int wiz_show_wmodes(void); +STATIC_DCL void wiz_map_levltyp(void); +STATIC_DCL void wiz_levltyp_legend(void); #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_PTR int wiz_migrate_mons(void); #endif -STATIC_DCL int FDECL(size_monst, (struct monst *)); -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 *, - 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 *, - long *, long *)); -STATIC_DCL void FDECL(contained, (winid, const char *, long *, long *)); -STATIC_PTR int NDECL(wiz_show_stats); -STATIC_DCL boolean FDECL(accept_menu_prefix, (int NDECL((*)))); +STATIC_DCL int size_monst(struct monst *); +STATIC_DCL int size_obj(struct obj *); +STATIC_DCL void count_obj(struct obj *, long *, long *, + boolean, boolean); +STATIC_DCL void obj_chain(winid, const char *, struct obj *, + long *, long *); +STATIC_DCL void mon_invent_chain(winid, const char *, struct monst *, + long *, long *); +STATIC_DCL void mon_chain(winid, const char *, struct monst *, + long *, long *); +STATIC_DCL void contained(winid, const char *, long *, long *); +STATIC_PTR int wiz_show_stats(void); +STATIC_DCL boolean accept_menu_prefix(int (*)(void)); #ifdef PORT_DEBUG -STATIC_DCL int NDECL(wiz_port_debug); +STATIC_DCL int wiz_port_debug(void); #endif -STATIC_PTR int NDECL(wiz_rumor_check); -STATIC_DCL char FDECL(cmd_from_func, (int NDECL((*)))); -STATIC_PTR int NDECL(doattributes); -STATIC_PTR int NDECL(doconduct); /**/ - -STATIC_DCL void FDECL(enlght_line, (const char *, const char *, const char *, - const char *)); -STATIC_DCL char *FDECL(enlght_combatinc, (const char *, int, int, char *)); -STATIC_DCL void FDECL(enlght_halfdmg, (int, int)); -STATIC_DCL boolean NDECL(walking_on_water); -STATIC_DCL boolean FDECL(cause_known, (int)); -STATIC_DCL char *FDECL(attrval, (int, int, char *)); -STATIC_DCL void FDECL(background_enlightenment, (int, int)); -STATIC_DCL void FDECL(characteristics_enlightenment, (int, int)); -STATIC_DCL void FDECL(one_characteristic, (int, int, int)); -STATIC_DCL void FDECL(status_enlightenment, (int, int)); -STATIC_DCL void FDECL(attributes_enlightenment, (int, int)); +STATIC_PTR int wiz_rumor_check(void); +STATIC_DCL char cmd_from_func(int (*)(void)); +STATIC_PTR int doattributes(void); +STATIC_PTR int doconduct(void); /**/ + +STATIC_DCL void enlght_line(const char *, const char *, const char *, + const char *); +STATIC_DCL char *enlght_combatinc(const char *, int, int, char *); +STATIC_DCL void enlght_halfdmg(int, int); +STATIC_DCL boolean walking_on_water(void); +STATIC_DCL boolean cause_known(int); +STATIC_DCL char *attrval(int, int, char *); +STATIC_DCL void background_enlightenment(int, int); +STATIC_DCL void characteristics_enlightenment(int, int); +STATIC_DCL void one_characteristic(int, int, int); +STATIC_DCL void status_enlightenment(int, int); +STATIC_DCL void attributes_enlightenment(int, int); static const char *readchar_queue = ""; static coord clicklook_cc; -STATIC_DCL char *NDECL(parse); -STATIC_DCL boolean FDECL(help_dir, (CHAR_P, const char *)); +STATIC_DCL char *parse(void); +STATIC_DCL boolean help_dir(char, const char *); STATIC_PTR int doprev_message(VOID_ARGS) @@ -225,10 +225,7 @@ reset_occupations() * function times out by its own means. */ void -set_occupation(fn, txt, xtime) -int NDECL((*fn)); -const char *txt; -int xtime; +set_occupation(int (*fn)(void), const char *txt, int xtime) { if (xtime) { occupation = timed_occupation; @@ -240,7 +237,7 @@ int xtime; return; } -STATIC_DCL char NDECL(popch); +STATIC_DCL 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 @@ -280,8 +277,7 @@ pgetchar() /* courtesy of aeb@cwi.nl */ /* A ch == 0 resets the pushq */ void -pushch(ch) -char ch; +pushch(char ch) { if (!ch) phead = ptail = 0; @@ -294,8 +290,7 @@ char ch; * replaying a previous command. */ void -savech(ch) -char ch; +savech(char ch) { if (!in_doagain) { if (!ch) @@ -311,7 +306,7 @@ STATIC_PTR int doextcmd(VOID_ARGS) { int idx, retval; - int NDECL((*func)); + int (*func)(void); /* keep repeating until we don't run help or quit */ do { @@ -1208,8 +1203,7 @@ static const char have_been[] = "have been ", have_never[] = "have never ", enl_msg(You_, have, (const char *) "", something, "") static void -enlght_line(start, middle, end, ps) -const char *start, *middle, *end, *ps; +enlght_line(const char *start, const char *middle, const char *end, const char *ps) { char buf[BUFSZ]; @@ -1219,10 +1213,7 @@ const char *start, *middle, *end, *ps; /* format increased chance to hit or damage or defense (Protection) */ 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) { const char *modif, *bonus; boolean invrt; @@ -1259,9 +1250,7 @@ char *outbuf; /* report half physical or half spell damage */ STATIC_OVL void -enlght_halfdmg(category, final) -int category; -int final; +enlght_halfdmg(int category, int final) { const char *category_name; char buf[BUFSZ]; @@ -1296,8 +1285,7 @@ walking_on_water() confers the target property; item must have been seen and its type discovered but it doesn't necessarily have to be fully identified */ STATIC_OVL boolean -cause_known(propindx) -int propindx; /* index of a property which can be conveyed by worn item */ +cause_known(int propindx) /* index of a property which can be conveyed by worn item */ { register struct obj *o; long mask = W_ARMOR | W_AMUL | W_RING | W_TOOL; @@ -1316,9 +1304,8 @@ int propindx; /* index of a property which can be conveyed by worn item */ /* format a characteristic value, accommodating Strength's strangeness */ STATIC_OVL char * -attrval(attrindx, attrvalue, resultbuf) -int attrindx, attrvalue; -char resultbuf[]; /* should be at least [7] to hold "18/100\0" */ +attrval(int attrindx, int attrvalue, + char resultbuf[])/* should be at least [7] to hold "18/100\0" */ { if (attrindx != A_STR || attrvalue <= 18) Sprintf(resultbuf, "%d", attrvalue); @@ -1330,9 +1317,8 @@ char resultbuf[]; /* should be at least [7] to hold "18/100\0" */ } void -enlightenment(mode, final) -int mode; /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */ -int final; /* ENL_GAMEINPROGRESS:0, ENL_GAMEOVERALIVE, ENL_GAMEOVERDEAD */ +enlightenment(int mode, /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */ + int final) /* ENL_GAMEINPROGRESS:0, ENL_GAMEOVERALIVE, ENL_GAMEOVERDEAD */ { char buf[BUFSZ], tmpbuf[BUFSZ]; @@ -1375,9 +1361,7 @@ int final; /* ENL_GAMEINPROGRESS:0, ENL_GAMEOVERALIVE, ENL_GAMEOVERDEAD */ /*ARGSUSED*/ /* display role, race, alignment and such to en_win */ STATIC_OVL void -background_enlightenment(unused_mode, final) -int unused_mode UNUSED; -int final; +background_enlightenment(int unused_mode UNUSED, int final) { const char *role_titl, *rank_titl; int innategend, difgend, difalgn; @@ -1484,9 +1468,7 @@ int final; /* characteristics: expanded version of bottom line strength, dexterity, &c */ STATIC_OVL void -characteristics_enlightenment(mode, final) -int mode; -int final; +characteristics_enlightenment(int mode, int final) { putstr(en_win, 0, ""); /* separator after background */ putstr(en_win, 0, @@ -1503,8 +1485,7 @@ int final; /* display one attribute value for characteristics_enlightenment() */ STATIC_OVL void -one_characteristic(mode, final, attrindx) -int mode, final, attrindx; +one_characteristic(int mode, int final, int attrindx) { boolean hide_innate_value = FALSE, interesting_alimit; int acurrent, abase, apeak, alimit; @@ -1601,9 +1582,7 @@ int mode, final, attrindx; /* status: selected obvious capabilities, assorted troubles */ STATIC_OVL void -status_enlightenment(mode, final) -int mode; -int final; +status_enlightenment(int mode, int final) { boolean magic = (mode & MAGICENLIGHTENMENT) ? TRUE : FALSE; int cap; @@ -1879,9 +1858,7 @@ int final; /* attributes: intrinsics and the like, other non-obvious capabilities */ void -attributes_enlightenment(unused_mode, final) -int unused_mode UNUSED; -int final; +attributes_enlightenment(int unused_mode UNUSED, int final) { static NEARDATA const char if_surroundings_permitted[] = " if surroundings permitted"; @@ -2303,7 +2280,7 @@ int final; } #if 0 /* no longer used */ -STATIC_DCL boolean NDECL(minimal_enlightenment); +STATIC_DCL boolean minimal_enlightenment(void); /* * Courtesy function for non-debug, non-explorer mode players @@ -2430,9 +2407,8 @@ doattributes(VOID_ARGS) } void -youhiding(via_enlghtmt, msgflag) -boolean via_enlghtmt; /* englightment line vs topl message */ -int msgflag; /* for variant message phrasing */ +youhiding(boolean via_enlghtmt, /* englightment line vs topl message */ + int msgflag) /* for variant message phrasing */ { char *bp, buf[BUFSZ]; @@ -2499,8 +2475,7 @@ doconduct(VOID_ARGS) } void -show_conduct(final) -int final; +show_conduct(int final) { char buf[BUFSZ]; int ngenocided; @@ -2841,8 +2816,7 @@ add_debug_extended_commands() } STATIC_OVL char -cmd_from_func(fn) -int NDECL((*fn)); +cmd_from_func(int (*fn)(void)) { int i; for (i = 0; i < SIZE(cmdlist); ++i) @@ -2856,8 +2830,7 @@ static const char count_str[] = " count bytes"; static const char separator[] = "------------------ ----- ------"; STATIC_OVL int -size_obj(otmp) -struct obj *otmp; +size_obj(struct obj *otmp) { int sz = (int) sizeof(struct obj); @@ -2878,12 +2851,7 @@ struct obj *otmp; } STATIC_OVL 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 *total_count, long *total_size, boolean top, boolean recurse) { long count, size; struct obj *obj; @@ -2901,12 +2869,7 @@ boolean recurse; } STATIC_OVL void -obj_chain(win, src, chain, total_count, total_size) -winid win; -const char *src; -struct obj *chain; -long *total_count; -long *total_size; +obj_chain(winid win, const char *src, struct obj *chain, long *total_count, long *total_size) { char buf[BUFSZ]; long count = 0, size = 0; @@ -2919,12 +2882,7 @@ long *total_size; } STATIC_OVL 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 *total_count, long *total_size) { char buf[BUFSZ]; long count = 0, size = 0; @@ -2939,11 +2897,7 @@ long *total_size; } STATIC_OVL void -contained(win, src, total_count, total_size) -winid win; -const char *src; -long *total_count; -long *total_size; +contained(winid win, const char *src, long *total_count, long *total_size) { char buf[BUFSZ]; long count = 0, size = 0; @@ -2968,8 +2922,7 @@ long *total_size; } STATIC_OVL int -size_monst(mtmp) -struct monst *mtmp; +size_monst(struct monst *mtmp) { int sz = (int) sizeof(struct monst); @@ -2993,12 +2946,7 @@ struct monst *mtmp; } STATIC_OVL void -mon_chain(win, src, chain, total_count, total_size) -winid win; -const char *src; -struct monst *chain; -long *total_count; -long *total_size; +mon_chain(winid win, const char *src, struct monst *chain, long *total_count, long *total_size) { char buf[BUFSZ]; long count, size; @@ -3118,8 +3066,7 @@ wiz_migrate_mons() /* 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><", @@ -3211,8 +3158,7 @@ boolean initial; } STATIC_OVL boolean -accept_menu_prefix(cmd_func) -int NDECL((*cmd_func)); +accept_menu_prefix(int (*cmd_func)(void)) { if (cmd_func == dopickup || cmd_func == dotip || cmd_func == doextcmd || cmd_func == doextlist) @@ -3221,8 +3167,7 @@ int NDECL((*cmd_func)); } void -rhack(cmd) -register char *cmd; +rhack(register char *cmd) { boolean do_walk, do_rush, prefix_seen, bad_command, firsttime = (cmd == 0); @@ -3351,7 +3296,7 @@ register char *cmd; if (prefix_seen && cmd[0] == 'm') { /* (for func_tab cast, see below) */ const struct func_tab *ft = Cmd.commands[cmd[1] & 0xff]; - int NDECL((*func)) = ft ? ((struct func_tab *) ft)->f_funct : 0; + int (*func)(void) = ft ? ((struct func_tab *) ft)->f_funct : 0; if (func && accept_menu_prefix(func)) { iflags.menu_requested = TRUE; @@ -3397,7 +3342,7 @@ register char *cmd; /* handle all other commands */ } else { register const struct func_tab *tlist; - int res, NDECL((*func)); + int res, (*func)(void); #if 0 /* obsolete - scan through the cmdlist array looking for *cmd */ @@ -3459,8 +3404,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; @@ -3472,9 +3416,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]; @@ -3483,8 +3425,7 @@ register int dd; /* also sets u.dz, but returns false for <> */ int -movecmd(sym) -char sym; +movecmd(char sym) { register const char *dp = index(Cmd.dirchars, sym); @@ -3514,8 +3455,7 @@ dxdy_moveok() /* decide whether a character (user input keystroke) requests screen repaint */ boolean -redraw_cmd(c) -char c; +redraw_cmd(char c) { return (boolean) (c == C('r') || (Cmd.num_pad && c == C('l'))); } @@ -3531,10 +3471,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)) { @@ -3555,8 +3492,7 @@ coord *cc; } int -getdir(s) -const char *s; +getdir(const char *s) { char dirsym; int is_mov; @@ -3605,9 +3541,7 @@ const char *s; } STATIC_OVL boolean -help_dir(sym, msg) -char sym; -const char *msg; +help_dir(char sym, const char *msg) { char ctrl; winid win; @@ -3691,8 +3625,7 @@ confdir() } const char * -directionname(dir) -int dir; +directionname(int dir) { static NEARDATA const char *const dirnames[] = { "west", "northwest", "north", "northeast", "east", @@ -3705,8 +3638,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; @@ -3718,8 +3650,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]; @@ -3931,8 +3862,7 @@ parse() the return value so we should be safe using `void' unconditionally */ /*ARGUSED*/ 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 */ { if (program_state.exiting) program_state.in_moveloop = 0; @@ -4055,8 +3985,8 @@ dotravel(VOID_ARGS) } #ifdef PORT_DEBUG -extern void NDECL(win32con_debug_keystrokes); -extern void NDECL(win32con_handler_info); +extern void win32con_debug_keystrokes(void); +extern void win32con_handler_info(void); int wiz_port_debug() @@ -4068,14 +3998,14 @@ wiz_port_debug() int num_menu_selections; struct menu_selection_struct { char *menutext; - void NDECL((*fn)); + void (*fn)(void); } menu_selections[] = { #ifdef WIN32 { "test win32 keystrokes (tty only)", win32con_debug_keystrokes }, { "show keystroke handler information (tty only)", win32con_handler_info }, #endif - { (char *) 0, (void NDECL((*) )) 0 } /* array terminator */ + { (char *) 0, (void ((*) )) 0 } /* array terminator */ }; num_menu_selections = SIZE(menu_selections) - 1; @@ -4109,9 +4039,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 qbuf[QBUFSZ]; @@ -4130,9 +4058,7 @@ char def; /* for paranoid_confirm:quit,die,attack prompting */ boolean -paranoid_query(be_paranoid, prompt) -boolean be_paranoid; -const char *prompt; +paranoid_query(boolean be_paranoid, const char *prompt) { boolean confirmed_ok; diff --git a/src/dbridge.c b/src/dbridge.c index 7d6bda397c..b38ff83dd0 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -19,23 +19,22 @@ #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_DCL void get_wall_for_db(int *, int *); +STATIC_DCL struct entity *e_at(int, int); +STATIC_DCL void m_to_e(struct monst *, int, int, struct entity *); +STATIC_DCL void u_to_e(struct entity *); +STATIC_DCL void set_entity(int, int, struct entity *); +STATIC_DCL const char *e_nam(struct entity *); +STATIC_DCL const char *E_phrase(struct entity *, const char *); +STATIC_DCL boolean e_survives_at(struct entity *, int, int); +STATIC_DCL void e_died(struct entity *, int, int); +STATIC_DCL boolean automiss(struct entity *); +STATIC_DCL boolean e_missed(struct entity *, boolean); +STATIC_DCL boolean e_jumps(struct entity *); +STATIC_DCL void do_entity(struct entity *); boolean -is_pool(x, y) -int x, y; +is_pool(int x, int y) { schar ltyp; @@ -51,8 +50,7 @@ int x, y; } boolean -is_lava(x, y) -int x, y; +is_lava(int x, int y) { schar ltyp; @@ -67,8 +65,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; @@ -77,8 +74,7 @@ int x, y; } boolean -is_ice(x, y) -int x, y; +is_ice(int x, int y) { schar ltyp; @@ -92,8 +88,7 @@ int x, y; } boolean -is_moat(x, y) -int x, y; +is_moat(int x, int y) { schar ltyp; @@ -109,8 +104,7 @@ int x, y; } schar -db_under_typ(mask) -int mask; +db_under_typ(int mask) { switch (mask & DB_UNDER) { case DB_ICE: @@ -136,8 +130,7 @@ int mask; */ int -is_drawbridge_wall(x, y) -int x, y; +is_drawbridge_wall(int x, int y) { struct rm *lev; @@ -167,8 +160,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); } @@ -178,8 +170,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; @@ -210,8 +201,7 @@ int *x, *y; * Find the drawbridge wall associated with a drawbridge. */ STATIC_OVL 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: @@ -236,9 +226,7 @@ int *x, *y; */ boolean -create_drawbridge(x, y, dir, flag) -int x, y, dir; -boolean flag; +create_drawbridge(int x, int y, int dir, boolean flag) { int x2, y2; boolean horiz; @@ -299,8 +287,7 @@ static NEARDATA struct entity occupants[ENTITIES]; STATIC_OVL struct entity * -e_at(x, y) -int x, y; +e_at(int x, int y) { int entitycnt; @@ -317,10 +304,7 @@ int x, y; } STATIC_OVL 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) { @@ -335,8 +319,7 @@ struct entity *etmp; } STATIC_OVL void -u_to_e(etmp) -struct entity *etmp; +u_to_e(struct entity *etmp) { etmp->emon = &youmonst; etmp->ex = u.ux; @@ -345,9 +328,7 @@ struct entity *etmp; } STATIC_OVL 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); @@ -369,8 +350,7 @@ struct entity *etmp; /* #define e_strg(etmp, func) (is_u(etmp)? (char *)0 : func(etmp->emon)) */ STATIC_OVL const char * -e_nam(etmp) -struct entity *etmp; +e_nam(struct entity *etmp) { return is_u(etmp) ? "you" : mon_nam(etmp->emon); } @@ -381,9 +361,7 @@ struct entity *etmp; */ STATIC_OVL 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 +381,7 @@ const char *verb; */ STATIC_OVL 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; @@ -427,9 +403,7 @@ int x, y; } STATIC_OVL void -e_died(etmp, dest, how) -struct entity *etmp; -int dest, how; +e_died(struct entity *etmp, int dest, int how) { if (is_u(etmp)) { if (how == DROWNING) { @@ -491,8 +465,7 @@ int dest, how; */ STATIC_OVL boolean -automiss(etmp) -struct entity *etmp; +automiss(struct entity *etmp) { return (boolean) ((is_u(etmp) ? Passes_walls : passes_walls(etmp->edata)) || noncorporeal(etmp->edata)); @@ -503,9 +476,7 @@ struct entity *etmp; */ STATIC_OVL boolean -e_missed(etmp, chunks) -struct entity *etmp; -boolean chunks; +e_missed(struct entity *etmp, boolean chunks) { int misses; @@ -541,8 +512,7 @@ boolean chunks; */ STATIC_OVL boolean -e_jumps(etmp) -struct entity *etmp; +e_jumps(struct entity *etmp) { int tmp = 4; /* out of 10 */ @@ -565,8 +535,7 @@ struct entity *etmp; } STATIC_OVL 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; @@ -766,8 +735,7 @@ struct entity *etmp; */ void -close_drawbridge(x, y) -int x, y; +close_drawbridge(int x, int y) { register struct rm *lev1, *lev2; struct trap *t; @@ -828,8 +796,7 @@ int x, y; */ void -open_drawbridge(x, y) -int x, y; +open_drawbridge(int x, int y) { register struct rm *lev1, *lev2; struct trap *t; @@ -875,8 +842,7 @@ int 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 944dbe3687..4353ca91a2 100644 --- a/src/decl.c +++ b/src/decl.c @@ -4,8 +4,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 1e5b23edc8..3bae2dc704 100644 --- a/src/detect.c +++ b/src/detect.c @@ -12,21 +12,19 @@ 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 int FDECL(detect_obj_traps, (struct obj *, BOOLEAN_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_DCL void do_dknown_of(struct obj *); +STATIC_DCL boolean check_map_spot(int, int, char, unsigned); +STATIC_DCL boolean clear_stale_map(char, unsigned); +STATIC_DCL void sense_trap(struct trap *, xchar, xchar, int); +STATIC_DCL int detect_obj_traps(struct obj *, boolean, int); +STATIC_DCL void show_map_spot(int, int); +STATIC_PTR void findone(int, int, genericptr_t); +STATIC_PTR void openone(int, int, genericptr_t); /* 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; @@ -48,9 +46,7 @@ char oclass; * Return first found. */ struct obj * -o_material(obj, material) -struct obj *obj; -unsigned material; +o_material(struct obj *obj, unsigned material) { register struct obj *otmp; struct obj *temp; @@ -70,8 +66,7 @@ unsigned material; } STATIC_OVL void -do_dknown_of(obj) -struct obj *obj; +do_dknown_of(struct obj *obj) { struct obj *otmp; @@ -84,10 +79,7 @@ struct obj *obj; /* Check whether the location has an outdated object displayed on it. */ STATIC_OVL 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 material) { int glyph; register struct obj *otmp; @@ -141,9 +133,7 @@ unsigned material; * change occurs. */ STATIC_OVL boolean -clear_stale_map(oclass, material) -char oclass; -unsigned material; +clear_stale_map(char oclass, unsigned material) { register int zx, zy; boolean change_made = FALSE; @@ -160,8 +150,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; @@ -285,8 +274,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; @@ -402,9 +390,8 @@ register struct obj *sobj; * 0 - something was detected */ int -object_detect(detector, class) -struct obj *detector; /* object doing the detecting */ -int class; /* an object class, 0 for all */ +object_detect(struct obj *detector, /* object doing the detecting */ + int class) /* an object class, 0 for all */ { register int x, y; char stuff[BUFSZ]; @@ -596,9 +583,8 @@ int class; /* an object class, 0 for all */ * 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(register struct obj *otmp, /* detecting object (if any) */ + int mclass) /* monster class, 0 for all */ { register struct monst *mtmp; int mcnt = 0; @@ -663,10 +649,7 @@ int mclass; /* monster class, 0 for all */ } STATIC_OVL 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 */ @@ -702,10 +685,8 @@ 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_OVL 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; @@ -730,8 +711,7 @@ int how; /* 1 for misleading map feedback */ * returns 0 if something was detected */ int -trap_detect(sobj) -register struct obj *sobj; +trap_detect(register struct obj *sobj) /* sobj is null if crystal ball, *scroll if gold detection scroll */ { register struct trap *ttmp; @@ -838,8 +818,7 @@ register struct obj *sobj; } 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); @@ -891,8 +870,7 @@ static const struct { }; void -use_crystal_ball(optr) -struct obj **optr; +use_crystal_ball(struct obj **optr) { char ch; int oops; @@ -1034,8 +1012,7 @@ struct obj **optr; } STATIC_OVL 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; @@ -1119,8 +1096,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; @@ -1137,9 +1113,7 @@ struct rm *lev; } STATIC_PTR 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; @@ -1182,9 +1156,7 @@ genericptr_t num; } STATIC_PTR 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; @@ -1278,15 +1250,13 @@ openit() /* callback hack for overriding vision in do_clear_area() */ boolean -detecting(func) -void FDECL((*func), (int, int, genericptr_t)); +detecting(void (*func)(int, int, genericptr_t)) { 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; @@ -1312,8 +1282,7 @@ struct trap *trap; } int -dosearch0(aflag) -register int aflag; /* intrinsic autosearch vs explicit searching */ +dosearch0(register int aflag) /* intrinsic autosearch vs explicit searching */ { #ifdef GCC_BUG /* some versions of gcc seriously muck up nested loops. if you get strange @@ -1465,9 +1434,8 @@ sokoban_detect() /* 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) /* when 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 bbfef5d0bf..45c53a765f 100644 --- a/src/dig.c +++ b/src/dig.c @@ -6,14 +6,13 @@ static NEARDATA boolean did_dig_msg; -STATIC_DCL boolean NDECL(rm_waslit); -STATIC_DCL void FDECL(mkcavepos, - (XCHAR_P, XCHAR_P, int, BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL void FDECL(mkcavearea, (BOOLEAN_P)); -STATIC_DCL int NDECL(dig); -STATIC_DCL void FDECL(dig_up_grave, (coord *)); -STATIC_DCL int FDECL(adj_pit_checks, (coord *, char *)); -STATIC_DCL void FDECL(pit_flow, (struct trap *, SCHAR_P)); +STATIC_DCL boolean rm_waslit(void); +STATIC_DCL void mkcavepos(xchar, xchar, int, boolean, boolean); +STATIC_DCL void mkcavearea(boolean); +STATIC_DCL int dig(void); +STATIC_DCL void dig_up_grave(coord *); +STATIC_DCL int adj_pit_checks(coord *, char *); +STATIC_DCL void pit_flow(struct trap *, schar); /* Indices returned by dig_typ() */ #define DIGTYP_UNDIGGABLE 0 @@ -42,10 +41,7 @@ rm_waslit() * immediately after the effect is complete. */ STATIC_OVL 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; @@ -85,8 +81,7 @@ boolean waslit, rockit; } STATIC_OVL void -mkcavearea(rockit) -register boolean rockit; +mkcavearea(register boolean rockit) { int dist; xchar xmin = u.ux, xmax = u.ux; @@ -137,9 +132,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; @@ -177,10 +170,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 = @@ -500,9 +490,8 @@ 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), @@ -535,10 +524,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; @@ -721,11 +707,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); @@ -746,9 +728,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; @@ -881,8 +861,7 @@ coord *cc; } STATIC_OVL void -dig_up_grave(cc) -coord *cc; +dig_up_grave(coord *cc) { struct obj *otmp; xchar dig_x, dig_y; @@ -942,8 +921,7 @@ coord *cc; } int -use_pick_axe(obj) -struct obj *obj; +use_pick_axe(struct obj *obj) { const char *sdp, *verb; char *dsp, dirsyms[12], qbuf[BUFSZ]; @@ -1008,8 +986,7 @@ struct obj *obj; /* the "In what direction do you want to dig?" query. */ /* 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; @@ -1191,10 +1168,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]; @@ -1237,8 +1211,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); @@ -1320,8 +1293,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 @@ -1576,9 +1548,7 @@ zap_dig() * down in the pit. */ STATIC_OVL int -adj_pit_checks(cc, msg) -coord *cc; -char *msg; +adj_pit_checks(coord *cc, char *msg) { int ltyp; struct rm *room; @@ -1667,9 +1637,7 @@ char *msg; * Ensure that all conjoined pits fill up. */ STATIC_OVL void -pit_flow(trap, filltyp) -struct trap *trap; -schar filltyp; +pit_flow(struct trap *trap, schar filltyp) { if (trap && (filltyp != ROOM) && (trap->ttyp == PIT || trap->ttyp == SPIKED_PIT)) { @@ -1705,8 +1673,7 @@ schar filltyp; } struct obj * -buried_ball(cc) -coord *cc; +buried_ball(coord *cc) { xchar check_x, check_y; struct obj *otmp, *otmp2; @@ -1790,9 +1757,7 @@ 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; +bury_an_obj(struct obj *otmp, boolean *dealloced) { struct obj *otmp2; boolean under_ice; @@ -1859,8 +1824,7 @@ boolean *dealloced; } void -bury_objs(x, y) -int x, y; +bury_objs(int x, int y) { struct obj *otmp, *otmp2; @@ -1877,8 +1841,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; @@ -1916,9 +1879,7 @@ int x, y; */ /* ARGSUSED */ void -rot_organic(arg, timeout) -anything *arg; -long timeout UNUSED; +rot_organic(anything *arg, long timeout UNUSED) { struct obj *obj = arg->a_obj; @@ -1939,9 +1900,7 @@ long timeout UNUSED; * Called when a corpse has rotted completely away. */ void -rot_corpse(arg, timeout) -anything *arg; -long timeout; +rot_corpse(anything *arg, long timeout) { xchar x = 0, y = 0; struct obj *obj = arg->a_obj; @@ -1993,8 +1952,7 @@ long timeout; #if 0 void -bury_monst(mtmp) -struct monst *mtmp; +bury_monst(struct monst *mtmp) { debugpline1("bury_monst: %s", mon_nam(mtmp)); if (canseemon(mtmp)) { @@ -2074,8 +2032,7 @@ escape_tomb() } void -bury_obj(otmp) -struct obj *otmp; +bury_obj(struct obj *otmp) { debugpline0("bury_obj"); if (cansee(otmp->ox, otmp->oy)) diff --git a/src/display.c b/src/display.c index e75f74d538..b8bf7be60b 100644 --- a/src/display.c +++ b/src/display.c @@ -117,26 +117,25 @@ */ #include "hack.h" -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 void display_monster(xchar, xchar, struct monst *, int, xchar); +STATIC_DCL int swallow_to_glyph(int, int); +STATIC_DCL void 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 check_pos(int, int, int); +STATIC_DCL int get_bk_glyph(xchar, xchar); /*#define WA_VERBOSE*/ /* give (x,y) locations for all "bad" spots */ #ifdef WA_VERBOSE -STATIC_DCL boolean FDECL(more_than_one, (int, int, int, int, int)); +STATIC_DCL 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_DCL int set_twall(int, int, int, int, int, int, int, int); +STATIC_DCL int set_wall(int, int, int); +STATIC_DCL int set_corn(int, int, int, int, int, int, int, int); +STATIC_DCL int set_crosswall(int, int); +STATIC_DCL void set_seenv(struct rm *, int, int, int, int); +STATIC_DCL void t_warn(struct rm *); +STATIC_DCL int wall_angle(struct rm *); #define remember_topology(x, y) (lastseentyp[x][y] = levl[x][y].typ) @@ -147,9 +146,7 @@ STATIC_DCL int FDECL(wall_angle, (struct rm *)); * 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]; @@ -197,9 +194,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); @@ -216,9 +211,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); @@ -236,9 +229,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); @@ -267,8 +258,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) { if (x != u.ux || y != u.uy) { /* don't display I at hero's location */ if (level.flags.hero_memory) @@ -287,8 +277,7 @@ register xchar 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; @@ -334,8 +323,7 @@ register int x, y; } void -map_location(x, y, show) -int x, y, show; +map_location(int x, int y, int show) { _map_location(x, y, show); } @@ -356,12 +344,11 @@ int x, y, show; * */ STATIC_OVL 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(register xchar x, register xchar 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 */ { boolean mon_mimic = (mon->m_ap_type != M_AP_NOTHING); int sensed = (mon_mimic && (Protection_from_shape_changers @@ -462,8 +449,7 @@ xchar worm_tail; /* mon is actually a worm tail */ * Do not call for worm tails. */ STATIC_OVL 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); @@ -493,8 +479,7 @@ register 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); @@ -514,8 +499,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; @@ -673,8 +657,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]); @@ -851,8 +834,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; @@ -904,8 +886,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; @@ -1005,8 +986,7 @@ int x, y; * being swallowed. */ void -swallowed(first) -int first; +swallowed(int first) { static xchar lastx, lasty; /* last swallowed position */ int swallower, left_ok, rght_ok; @@ -1068,8 +1048,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; @@ -1115,8 +1094,7 @@ int mode; * Very restricted display. You can only see yourself. */ void -under_ground(mode) -int mode; +under_ground(int mode) { static boolean dela; @@ -1323,8 +1301,7 @@ static char gbuf_stop[ROWNO]; * 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. @@ -1439,8 +1416,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; @@ -1469,8 +1445,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 @@ -1528,8 +1503,7 @@ int cursor_on_u; * variables. */ int -back_to_glyph(x, y) -xchar x, y; +back_to_glyph(xchar x, xchar y) { int idx; struct rm *ptr = &(levl[x][y]); @@ -1660,9 +1634,7 @@ xchar x, y; * a random monster in swallowed() and don't use what_mon() here. */ STATIC_OVL 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"); @@ -1684,9 +1656,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) { impossible("zapdir_to_glyph: illegal beam type"); @@ -1703,8 +1673,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 */ @@ -1722,8 +1691,7 @@ xchar x, y; */ STATIC_OVL int -get_bk_glyph(x,y) -xchar x, y; +get_bk_glyph(xchar x, xchar y) { int idx, bkglyph = NO_GLYPH; struct rm *lev = &levl[x][y]; @@ -1779,8 +1747,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] = { @@ -1793,15 +1761,13 @@ static const char *type_names[MAX_TYPE] = { }; static const char * -type_to_name(type) -int type; +type_to_name(int type) { return (type < 0 || type >= MAX_TYPE) ? "unknown" : type_names[type]; } static void -error4(x, y, a, b, c, dd) -int x, y, a, b, c, dd; +error4(int x, int y, int a, int b, int c, int dd) { pline("set_wall_state: %s @ (%d,%d) %s%s%s%s", type_to_name(levl[x][y].typ), x, y, @@ -1817,8 +1783,7 @@ int x, y, a, b, c, dd; * Things that are ambiguous: lava */ STATIC_OVL int -check_pos(x, y, which) -int x, y, which; +check_pos(int x, int y, int which) { int type; if (!isok(x, y)) @@ -1833,8 +1798,7 @@ int x, y, which; /*ARGSUSED*/ #ifdef WA_VERBOSE STATIC_OVL boolean -more_than_one(x, y, a, b, c) -int x, y, a, b, c; +more_than_one(int x, int y, int a, int b, int c) { if ((a && (b | c)) || (b && (a | c)) || (c && (a | b))) { error4(x, y, a, b, c, 0); @@ -1849,9 +1813,8 @@ int x, y, a, b, c; /* Return the wall mode for a T wall. */ STATIC_OVL int -set_twall(x0, y0, x1, y1, x2, y2, x3, y3) -int x0, y0; /* used #if WA_VERBOSE */ -int x1, y1, x2, y2, x3, y3; +set_twall(int x0, int y0, /* used #if WA_VERBOSE */ + int x1, int y1, int x2, int y2, int x3, int y3) { int wmode, is_1, is_2, is_3; @@ -1871,8 +1834,7 @@ int x1, y1, x2, y2, x3, y3; /* Return wall mode for a horizontal or vertical wall. */ STATIC_OVL int -set_wall(x, y, horiz) -int x, y, horiz; +set_wall(int x, int y, int horiz) { int wmode, is_1, is_2; @@ -1893,8 +1855,7 @@ int x, y, horiz; /* Return a wall mode for a corner wall. (x4,y4) is the "inner" position. */ STATIC_OVL 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; @@ -1922,8 +1883,7 @@ int x1, y1, x2, y2, x3, y3, x4, y4; /* Return mode for a crosswall. */ STATIC_OVL int -set_crosswall(x, y) -int x, y; +set_crosswall(int x, int y) { int wmode, is_1, is_2, is_3, is_4; @@ -2046,9 +2006,7 @@ 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_OVL 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, int x, int y)/* from, to */ { int dx = x - x0, dy = y0 - y; @@ -2058,9 +2016,8 @@ 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, int x1, int y1) /* from, to; abs(x1-x0)==1 && abs(y0-y1)==1 */ { int dx = x1 - x0, dy = y0 - y1; @@ -2126,8 +2083,7 @@ static const int cross_matrix[4][6] = { /* Print out a T wall warning and all interesting info. */ STATIC_OVL 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; @@ -2159,8 +2115,7 @@ struct rm *lev; * seen vector (SV). */ STATIC_OVL 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 a0b675246d..9d8d25c714 100644 --- a/src/dlb.c +++ b/src/dlb.c @@ -27,19 +27,19 @@ */ 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 */ -extern FILE *FDECL(fopen_datafile, (const char *, const char *, int)); +extern FILE *fopen_datafile(const char *, const char *, int); #ifdef DLBLIB /* @@ -61,25 +61,25 @@ extern FILE *FDECL(fopen_datafile, (const char *, const char *, int)); #define MAX_LIBS 4 static library dlb_libs[MAX_LIBS]; -STATIC_DCL boolean FDECL(readlibdir, (library * lp)); -STATIC_DCL boolean FDECL(find_file, (const char *name, library **lib, - long *startp, long *sizep)); -STATIC_DCL boolean NDECL(lib_dlb_init); -STATIC_DCL void NDECL(lib_dlb_cleanup); -STATIC_DCL boolean FDECL(lib_dlb_fopen, (dlb *, const char *, const char *)); -STATIC_DCL int FDECL(lib_dlb_fclose, (dlb *)); -STATIC_DCL int FDECL(lib_dlb_fread, (char *, int, int, dlb *)); -STATIC_DCL int FDECL(lib_dlb_fseek, (dlb *, long, int)); -STATIC_DCL char *FDECL(lib_dlb_fgets, (char *, int, dlb *)); -STATIC_DCL int FDECL(lib_dlb_fgetc, (dlb *)); -STATIC_DCL long FDECL(lib_dlb_ftell, (dlb *)); +STATIC_DCL boolean readlibdir(library * lp); +STATIC_DCL boolean find_file(const char *name, library **lib, + long *startp, long *sizep); +STATIC_DCL boolean lib_dlb_init(void); +STATIC_DCL void lib_dlb_cleanup(void); +STATIC_DCL boolean lib_dlb_fopen(dlb *, const char *, const char *); +STATIC_DCL int lib_dlb_fclose(dlb *); +STATIC_DCL int lib_dlb_fread(char *, int, int, dlb *); +STATIC_DCL int lib_dlb_fseek(dlb *, long, int); +STATIC_DCL char *lib_dlb_fgets(char *, int, dlb *); +STATIC_DCL int lib_dlb_fgetc(dlb *); +STATIC_DCL long lib_dlb_ftell(dlb *); /* not static because shared with dlb_main.c */ -boolean FDECL(open_library, (const char *lib_name, library *lp)); -void FDECL(close_library, (library * lp)); +boolean open_library(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 *); /* * Read the directory out of the library. Return 1 if successful, @@ -124,8 +124,7 @@ extern char *FDECL(eos, (char *)); * Return TRUE on success, FALSE on failure. */ STATIC_OVL 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_OVL boolean -find_file(name, lib, startp, sizep) -const char *name; -library **lib; -long *startp, *sizep; +find_file(const char *name, library **lib, long *startp, long *sizep) { int i, j; library *lp; @@ -202,9 +198,7 @@ long *startp, *sizep; * structure. Return TRUE if successful, FALSE otherwise. */ boolean -open_library(lib_name, lp) -const char *lib_name; -library *lp; +open_library(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); @@ -265,10 +258,7 @@ lib_dlb_cleanup(VOID_ARGS) /*ARGSUSED*/ STATIC_OVL 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; @@ -287,18 +277,14 @@ const char *mode UNUSED; /*ARGUSED*/ STATIC_OVL int -lib_dlb_fclose(dp) -dlb *dp UNUSED; +lib_dlb_fclose(dlb *dp UNUSED) { /* nothing needs to be done */ return 0; } STATIC_OVL 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; @@ -323,10 +309,7 @@ dlb *dp; } STATIC_OVL int -lib_dlb_fseek(dp, pos, whence) -dlb *dp; -long pos; -int whence; +lib_dlb_fseek(dlb *dp, long pos, int whence) { long curpos; @@ -351,10 +334,7 @@ int whence; } STATIC_OVL 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; @@ -386,8 +366,7 @@ dlb *dp; } STATIC_OVL int -lib_dlb_fgetc(dp) -dlb *dp; +lib_dlb_fgetc(dlb *dp) { char c; @@ -397,8 +376,7 @@ dlb *dp; } STATIC_OVL long -lib_dlb_ftell(dp) -dlb *dp; +lib_dlb_ftell(dlb *dp) { return dp->mark; } @@ -463,8 +441,7 @@ dlb_cleanup() } dlb * -dlb_fopen(name, mode) -const char *name, *mode; +dlb_fopen(const char *name, const char *mode) { FILE *fp; dlb *dp; @@ -491,8 +468,7 @@ const char *name, *mode; } int -dlb_fclose(dp) -dlb *dp; +dlb_fclose(dlb *dp) { int ret = 0; @@ -508,10 +484,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; @@ -521,10 +494,7 @@ dlb *dp; } int -dlb_fseek(dp, pos, whence) -dlb *dp; -long pos; -int whence; +dlb_fseek(dlb *dp, long pos, int whence) { if (!dlb_initialized) return EOF; @@ -534,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; @@ -547,8 +514,7 @@ dlb *dp; } int -dlb_fgetc(dp) -dlb *dp; +dlb_fgetc(dlb *dp) { if (!dlb_initialized) return EOF; @@ -558,8 +524,7 @@ dlb *dp; } long -dlb_ftell(dp) -dlb *dp; +dlb_ftell(dlb *dp) { if (!dlb_initialized) return 0; diff --git a/src/do.c b/src/do.c index 2081016a4a..d1c9710bd4 100644 --- a/src/do.c +++ b/src/do.c @@ -7,16 +7,16 @@ #include "hack.h" #include "lev.h" -STATIC_DCL void FDECL(trycall, (struct obj *)); -STATIC_DCL void NDECL(polymorph_sink); -STATIC_DCL boolean NDECL(teleport_sink); -STATIC_DCL void FDECL(dosinkring, (struct obj *)); -STATIC_PTR int FDECL(drop, (struct obj *)); -STATIC_PTR int NDECL(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 void trycall(struct obj *); +STATIC_DCL void polymorph_sink(void); +STATIC_DCL boolean teleport_sink(void); +STATIC_DCL void dosinkring(struct obj *); +STATIC_PTR int drop(struct obj *); +STATIC_PTR int wipeoff(void); +STATIC_DCL int menu_drop(int); +STATIC_DCL int currentlevel_rewrite(void); +STATIC_DCL void final_level(void); +/* static boolean badspot(xchar,xchar); */ extern int n_dgns; /* number of dungeons, from dungeon.c */ @@ -44,10 +44,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) { impossible("Not a boulder?"); @@ -128,10 +125,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; @@ -230,8 +224,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; @@ -258,8 +251,7 @@ register struct obj *obj; } STATIC_OVL void -trycall(obj) -register struct obj *obj; +trycall(register struct obj *obj) { if (!objects[obj->otyp].oc_name_known && !objects[obj->otyp].oc_uname) docall(obj); @@ -333,8 +325,7 @@ teleport_sink() /* obj is a ring being dropped over a kitchen sink */ STATIC_OVL void -dosinkring(obj) -register struct obj *obj; +dosinkring(register struct obj *obj) { struct obj *otmp, *otmp2; boolean ideed = TRUE; @@ -481,9 +472,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) @@ -519,8 +508,7 @@ const char *word; } STATIC_PTR int -drop(obj) -register struct obj *obj; +drop(register struct obj *obj) { if (!obj) return 0; @@ -586,8 +574,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) { /* Ensure update when we drop gold objects */ if (obj->oclass == COIN_CLASS) @@ -604,17 +591,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); @@ -681,8 +665,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; @@ -732,8 +715,7 @@ doddrop() /* Drop things from the hero's inventory, using a menu. */ STATIC_OVL int -menu_drop(retry) -int retry; +menu_drop(int retry) { int n, i, n_dropped = 0; long cnt; @@ -1068,8 +1050,7 @@ save_currentstate() /* static boolean -badspot(x, y) -register xchar x, y; +badspot(register xchar x, register xchar y) { return (boolean) ((levl[x][y].typ != ROOM && levl[x][y].typ != AIR @@ -1079,9 +1060,7 @@ register xchar x, y; */ 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; @@ -1531,11 +1510,8 @@ 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' */ @@ -1593,8 +1569,7 @@ deferred_goto() * corpse is gone. */ boolean -revive_corpse(corpse) -struct obj *corpse; +revive_corpse(struct obj *corpse) { struct monst *mtmp, *mcarry; boolean is_uwep, chewed; @@ -1683,9 +1658,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 timeout UNUSED) { struct obj *body = arg->a_obj; struct permonst *mptr = &mons[body->corpsenm]; @@ -1780,9 +1753,7 @@ dowipe() } void -set_wounded_legs(side, timex) -register long side; -register int timex; +set_wounded_legs(register long side, register int timex) { /* KMH -- STEED * If you are riding, your steed gets the wounded legs instead. diff --git a/src/do_name.c b/src/do_name.c index 2e2dfd193d..ba7af1ca7f 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -4,12 +4,12 @@ #include "hack.h" -STATIC_DCL char *NDECL(nextmbuf); -STATIC_DCL void FDECL(getpos_help, (BOOLEAN_P, const char *)); -STATIC_DCL void NDECL(do_mname); -STATIC_DCL void FDECL(do_oname, (struct obj *)); -STATIC_DCL void NDECL(namefloorobj); -STATIC_DCL char *FDECL(bogusmon, (char *,char *)); +STATIC_DCL char *nextmbuf(void); +STATIC_DCL void getpos_help(boolean, const char *); +STATIC_DCL void do_mname(void); +STATIC_DCL void do_oname(struct obj *); +STATIC_DCL void namefloorobj(void); +STATIC_DCL char *bogusmon(char *,char *); extern const char what_is_an_unknown_object[]; /* from pager.c */ @@ -29,20 +29,17 @@ nextmbuf() /* function for getpos() to highlight desired map locations. * parameter value 0 = initialize, 1 = highlight, 2 = done */ -void FDECL((*getpos_hilitefunc), (int)) = (void FDECL((*), (int))) 0; +void (*getpos_hilitefunc)(int) = (void (*)(int)) 0; void -getpos_sethilite(f) -void FDECL((*f), (int)); +getpos_sethilite(void (*f)(int)) { getpos_hilitefunc = f; } /* the response for '?' help request in getpos() */ STATIC_OVL void -getpos_help(force, goal) -boolean force; -const char *goal; +getpos_help(boolean force, const char *goal) { char sbuf[BUFSZ]; boolean doing_what_is; @@ -71,10 +68,7 @@ const char *goal; } int -getpos(ccp, force, goal) -coord *ccp; -boolean force; -const char *goal; +getpos(coord *ccp, boolean force, const char *goal) { int result = 0; int cx, cy, i, c; @@ -313,9 +307,8 @@ const char *goal; /* allocate space for a monster's name; removes old name if there is one */ void -new_mname(mon, lth) -struct monst *mon; -int lth; /* desired length (caller handles adding 1 for terminator) */ +new_mname(struct monst *mon, + int lth) /* desired length (caller handles adding 1 for terminator) */ { if (lth) { /* allocate mextra if necessary; otherwise get rid of old name */ @@ -333,8 +326,7 @@ int lth; /* desired length (caller handles adding 1 for terminator) */ /* release a monster's name; retains mextra even if all fields are now null */ void -free_mname(mon) -struct monst *mon; +free_mname(struct monst *mon) { if (has_mname(mon)) { free((genericptr_t) MNAME(mon)); @@ -344,9 +336,8 @@ 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 */ @@ -364,8 +355,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)); @@ -379,8 +369,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); @@ -390,9 +379,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]; @@ -482,8 +469,7 @@ do_mname() */ STATIC_OVL 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; @@ -537,9 +523,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]; @@ -585,8 +569,7 @@ static NEARDATA const char callable[] = { }; boolean -objtyp_is_callable(i) -int i; +objtyp_is_callable(int i) { return (boolean) (objects[i].oc_uname || (OBJ_DESCR(objects[i]) @@ -685,8 +668,7 @@ docallcmd() } void -docall(obj) -register struct obj *obj; +docall(register struct obj *obj) { char buf[BUFSZ], qbuf[QBUFSZ]; struct obj otemp; @@ -840,22 +822,21 @@ rndghostname() * options works, since those are special cases. */ char * -x_monnam(mtmp, article, adjective, suppress, called) -register struct monst *mtmp; -int article; -/* ARTICLE_NONE, ARTICLE_THE, ARTICLE_A: obvious - * ARTICLE_YOUR: "your" on pets, "the" on everything else - * - * If the monster would be referred to as "it" or if the monster has a name - * _and_ there is no adjective, "invisible", "saddled", etc., override this - * and always use no article. - */ -const char *adjective; -int suppress; +x_monnam(register struct monst *mtmp, + int article, + /* ARTICLE_NONE, ARTICLE_THE, ARTICLE_A: obvious + * ARTICLE_YOUR: "your" on pets, "the" on everything else + * + * If the monster would be referred to as "it" or if the monster has a name + * _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 */ -boolean called; + boolean called) { char *buf = nextmbuf(); struct permonst *mdat = mtmp->data; @@ -1025,16 +1006,14 @@ boolean called; } char * -l_monnam(mtmp) -struct monst *mtmp; +l_monnam(struct monst *mtmp) { return x_monnam(mtmp, ARTICLE_NONE, (char *) 0, (has_mname(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_mname(mtmp)) ? SUPPRESS_SADDLE : 0, FALSE); @@ -1045,8 +1024,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_mname(mtmp)) ? (SUPPRESS_SADDLE | SUPPRESS_IT) @@ -1055,8 +1033,7 @@ struct monst *mtmp; } char * -Monnam(mtmp) -struct monst *mtmp; +Monnam(struct monst *mtmp) { register char *bp = mon_nam(mtmp); @@ -1065,8 +1042,7 @@ struct monst *mtmp; } char * -noit_Monnam(mtmp) -struct monst *mtmp; +noit_Monnam(struct monst *mtmp) { register char *bp = noit_mon_nam(mtmp); @@ -1076,16 +1052,14 @@ struct monst *mtmp; /* monster's own name */ 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; @@ -1100,9 +1074,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_mname(mtmp) ? SUPPRESS_SADDLE : 0, FALSE); @@ -1112,16 +1084,14 @@ const char *adj; } char * -a_monnam(mtmp) -struct monst *mtmp; +a_monnam(struct monst *mtmp) { return x_monnam(mtmp, ARTICLE_A, (char *) 0, has_mname(mtmp) ? SUPPRESS_SADDLE : 0, FALSE); } char * -Amonnam(mtmp) -struct monst *mtmp; +Amonnam(struct monst *mtmp) { char *bp = a_monnam(mtmp); @@ -1132,10 +1102,9 @@ 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, /* only ARTICLE_NONE and ARTICLE_THE are handled here */ + char *outbuf) { /* high priest(ess)'s identity is concealed on the Astral Plane, unless you're adjacent (overridden for hallucination which does @@ -1152,8 +1121,7 @@ char *outbuf; /* fake monsters used to be in a hard-coded array, now in a data file */ STATIC_OVL char * -bogusmon(buf, code) -char *buf, *code; +bogusmon(char *buf, char *code) { char *mname = buf; @@ -1172,8 +1140,7 @@ char *buf, *code; /* return a random monster name, for hallucination */ char * -rndmonnam(code) -char *code; +rndmonnam(char *code) { static char buf[BUFSZ]; char *mname; @@ -1199,8 +1166,7 @@ char *code; /* 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; @@ -1237,8 +1203,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; @@ -1269,9 +1234,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", @@ -1298,8 +1261,7 @@ static const char *const sir_Terry_novels[] = { }; const char * -noveltitle(novidx) -int *novidx; +noveltitle(int *novidx) { int j, k = SIZE(sir_Terry_novels); @@ -1314,9 +1276,7 @@ int *novidx; } const char * -lookup_novel(lookname, idx) -const char *lookname; -int *idx; +lookup_novel(const char *lookname, int *idx) { int k; diff --git a/src/do_wear.c b/src/do_wear.c index ea73cace85..e6d38db1ad 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -19,33 +19,32 @@ static NEARDATA const long takeoff_order[] = { WORN_SHIRT, WORN_BOOTS, W_SWAPWEP, W_QUIVER, 0L }; -STATIC_DCL void FDECL(on_msg, (struct obj *)); -STATIC_DCL void FDECL(toggle_stealth, (struct obj *, long, BOOLEAN_P)); -STATIC_DCL void FDECL(toggle_displacement, (struct obj *, long, BOOLEAN_P)); -STATIC_PTR int NDECL(Armor_on); -STATIC_PTR int NDECL(Boots_on); -STATIC_PTR int NDECL(Cloak_on); -STATIC_PTR int NDECL(Helmet_on); -STATIC_PTR int NDECL(Gloves_on); -STATIC_DCL void FDECL(wielding_corpse, (struct obj *, BOOLEAN_P)); -STATIC_PTR int NDECL(Shield_on); -STATIC_PTR int NDECL(Shirt_on); -STATIC_DCL void NDECL(Amulet_on); -STATIC_DCL 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(count_worn_stuff, (struct obj **, BOOLEAN_P)); -STATIC_PTR int FDECL(armor_or_accessory_off, (struct obj *)); -STATIC_PTR int FDECL(accessory_or_armor_on, (struct obj *)); -STATIC_DCL void FDECL(already_wearing, (const char *)); -STATIC_DCL void FDECL(already_wearing2, (const char *, const char *)); +STATIC_DCL void on_msg(struct obj *); +STATIC_DCL void toggle_stealth(struct obj *, long, boolean); +STATIC_DCL void toggle_displacement(struct obj *, long, boolean); +STATIC_PTR int Armor_on(void); +STATIC_PTR int Boots_on(void); +STATIC_PTR int Cloak_on(void); +STATIC_PTR int Helmet_on(void); +STATIC_PTR int Gloves_on(void); +STATIC_DCL void wielding_corpse(struct obj *, boolean); +STATIC_PTR int Shield_on(void); +STATIC_PTR int Shirt_on(void); +STATIC_DCL void Amulet_on(void); +STATIC_DCL void learnring(struct obj *, boolean); +STATIC_DCL void Ring_off_or_gone(struct obj *, boolean); +STATIC_PTR int select_off(struct obj *); +STATIC_DCL struct obj *do_takeoff(void); +STATIC_PTR int take_off(void); +STATIC_DCL int menu_remarm(int); +STATIC_DCL void count_worn_stuff(struct obj **, boolean); +STATIC_PTR int armor_or_accessory_off(struct obj *); +STATIC_PTR int accessory_or_armor_on(struct obj *); +STATIC_DCL void already_wearing(const char *); +STATIC_DCL void already_wearing2(const char *, const char *); void -off_msg(otmp) -struct obj *otmp; +off_msg(struct obj *otmp) { if (flags.verbose) You("were wearing %s.", doname(otmp)); @@ -53,8 +52,7 @@ struct obj *otmp; /* for items that involve no delay */ STATIC_OVL void -on_msg(otmp) -struct obj *otmp; +on_msg(struct obj *otmp) { if (flags.verbose) { char how[BUFSZ]; @@ -78,10 +76,9 @@ static boolean initial_don = FALSE; /* manipulated in set_wear() */ give feedback and discover it iff stealth state is changing */ STATIC_OVL 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 oldprop, /* prop[].extrinsic, with obj->owornmask stripped by caller */ + boolean on) { if (on ? initial_don : context.takeoff.cancelled_don) return; @@ -112,10 +109,9 @@ boolean on; hero is able to see self (or sense monsters) */ STATIC_OVL 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 oldprop,/* prop[].extrinsic, with obj->owornmask stripped by caller */ + boolean on) { if (on ? initial_don : context.takeoff.cancelled_don) return; @@ -500,9 +496,8 @@ Gloves_on(VOID_ARGS) } STATIC_OVL 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]; @@ -802,9 +797,7 @@ Amulet_off() /* handle ring discovery; comparable to learnwand() */ STATIC_OVL void -learnring(ring, observed) -struct obj *ring; -boolean observed; +learnring(struct obj *ring, boolean observed) { int ringtype = ring->otyp; @@ -834,8 +827,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; @@ -950,9 +942,7 @@ register struct obj *obj; } STATIC_OVL 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; @@ -1062,22 +1052,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; @@ -1118,8 +1105,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; @@ -1165,8 +1151,7 @@ register struct obj *otmp; /* called in moveloop()'s prologue to set side-effects of worn start-up items; also used by poly_obj() when a worn item gets transformed */ void -set_wear(obj) -struct obj *obj; /* if null, do all worn items; otherwise just obj itself */ +set_wear(struct obj *obj) /* if null, do all worn items; otherwise just obj itself */ { initial_don = !obj; @@ -1200,8 +1185,7 @@ struct obj *obj; /* if null, do all worn items; otherwise just obj itself */ /* check whether the target object is currently being put on (or taken off-- also checks for doffing) */ boolean -donning(otmp) -struct obj *otmp; +donning(struct obj *otmp) { /* long what = (occupation == take_off) ? context.takeoff.what : 0L; */ long what = context.takeoff.what; /* if nonzero, occupation is implied */ @@ -1236,8 +1220,7 @@ struct obj *otmp; /* check whether the target object is currently being taken off, so that stop_donning() and steal() can vary messages */ boolean -doffing(otmp) -struct obj *otmp; +doffing(struct obj *otmp) { long what = context.takeoff.what; boolean result = FALSE; @@ -1280,8 +1263,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; @@ -1333,9 +1315,8 @@ STATIC_VAR NEARDATA int Narmorpieces, Naccessories; /* assign values to Narmorpieces and Naccessories */ STATIC_OVL void -count_worn_stuff(which, accessorizing) -struct obj **which; /* caller wants this when count is 1 */ -boolean accessorizing; +count_worn_stuff(struct obj **which, /* caller wants this when count is 1 */ + boolean accessorizing) { struct obj *otmp; @@ -1371,8 +1352,7 @@ boolean accessorizing; /* take off one piece or armor or one accessory; shared by dotakeoff('T') and doremring('R') */ STATIC_OVL 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."); @@ -1476,8 +1456,7 @@ doremring() /* Check if something worn is cursed _and_ unremovable. */ int -cursed(otmp) -register struct obj *otmp; +cursed(register struct obj *otmp) { /* Curses, like chickens, come home to roost. */ if ((otmp == uwep) ? welded(otmp) : (int) otmp->cursed) { @@ -1492,8 +1471,7 @@ register struct obj *otmp; } int -armoroff(otmp) -register struct obj *otmp; +armoroff(register struct obj *otmp) { register int delay = -objects[otmp->otyp].oc_delay; @@ -1549,15 +1527,13 @@ register struct obj *otmp; } STATIC_OVL void -already_wearing(cc) -const char *cc; +already_wearing(const char *cc) { You("are already wearing %s%c", cc, (cc == c_that_) ? '!' : '.'); } STATIC_OVL 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); } @@ -1570,10 +1546,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 *mask, boolean noisy) { int err = 0; const char *which; @@ -1737,8 +1710,7 @@ boolean noisy; } STATIC_OVL int -accessory_or_armor_on(obj) -struct obj *obj; +accessory_or_armor_on(struct obj *obj) { long mask = 0L; boolean armor, ring, eyewear; @@ -2093,8 +2065,7 @@ glibr() } struct obj * -some_armor(victim) -struct monst *victim; +some_armor(struct monst *victim) { register struct obj *otmph, *otmp; @@ -2121,9 +2092,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) { impossible("stuck_ring: neither left nor right?"); @@ -2158,8 +2127,7 @@ unchanger() STATIC_PTR int -select_off(otmp) -register struct obj *otmp; +select_off(register struct obj *otmp) { struct obj *why; char buf[BUFSZ]; @@ -2487,8 +2455,7 @@ doddoremarm() } STATIC_OVL int -menu_remarm(retry) -int retry; +menu_remarm(int retry) { int n, i = 0; menu_item *pick_list; @@ -2532,8 +2499,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) \ @@ -2595,9 +2561,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) { @@ -2620,10 +2584,9 @@ 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."; diff --git a/src/dog.c b/src/dog.c index efcb768928..cb0c72b74b 100644 --- a/src/dog.c +++ b/src/dog.c @@ -4,11 +4,10 @@ #include "hack.h" -STATIC_DCL int NDECL(pet_type); +STATIC_DCL 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; @@ -66,10 +63,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; @@ -293,9 +287,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; @@ -468,9 +460,8 @@ 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 nmv)/* number of moves */ { int imv = 0; /* avoid zillions of casts and lint warnings */ @@ -566,9 +557,9 @@ long nmv; /* number of moves */ } /* called when you move to another level */ +/* true for ascension or final escape */ void -keepdogs(pets_only) -boolean pets_only; /* true for ascension or final escape */ +keepdogs(boolean pets_only) { register struct monst *mtmp, *mtmp2; register struct obj *obj; @@ -676,12 +667,11 @@ boolean pets_only; /* true for ascension or final escape */ } } +/* destination level */ +/* MIGR_xxx destination xy location: */ +/* optional destination coordinates */ 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(register struct monst *mtmp, xchar tolev, xchar xyloc, coord *cc) { register struct obj *obj; d_level new_lev; @@ -735,9 +725,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), herbi = herbivorous(mptr), starving; @@ -861,9 +849,7 @@ register struct obj *obj; * succeeded. */ boolean -tamedog(mtmp, obj) -register struct monst *mtmp; -register struct obj *obj; +tamedog(register struct monst *mtmp, register struct obj *obj) { /* The Wiz, Medusa and the quest nemeses aren't even made peaceful. */ if (mtmp->iswiz || mtmp->data == &mons[PM_MEDUSA] @@ -957,9 +943,7 @@ register 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; @@ -1028,8 +1012,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 36e6c4a415..dbd07a8614 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -8,18 +8,17 @@ 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_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_DCL void FDECL(quickmimic, (struct monst *)); +STATIC_DCL boolean dog_hunger(struct monst *, struct edog *); +STATIC_DCL int dog_invent(struct monst *, struct edog *, int); +STATIC_DCL int dog_goal(struct monst *, struct edog *, int, int, int); +STATIC_DCL boolean can_reach_location(struct monst *, xchar, + xchar, xchar, xchar); +STATIC_DCL boolean could_reach_item(struct monst *, xchar, xchar); +STATIC_DCL 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, dummy, *pickaxe, *unihorn, *key; @@ -119,11 +118,10 @@ static NEARDATA const char nofetch[] = { BALL_CLASS, CHAIN_CLASS, ROCK_CLASS, STATIC_VAR xchar gtyp, gx, gy; /* type and position of dog's current goal */ -STATIC_PTR void FDECL(wantdoor, (int, int, genericptr_t)); +STATIC_PTR 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; @@ -134,9 +132,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; @@ -198,11 +194,10 @@ struct obj *obj; /* returns 2 if pet dies, otherwise 1 */ int -dog_eat(mtmp, obj, x, y, devour) -register struct monst *mtmp; -register 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(register struct monst *mtmp, + register struct obj *obj, /* if unpaid, then thrown or kicked by hero */ + int x, int y, /* dog's starting location, might be different from current */ + boolean devour) { register struct edog *edog = EDOG(mtmp); boolean poly, grow, heal, slimer, deadmimic; @@ -346,9 +341,7 @@ boolean devour; /* hunger effects -- returns TRUE on starvation */ STATIC_OVL boolean -dog_hunger(mtmp, edog) -register struct monst *mtmp; -register struct edog *edog; +dog_hunger(register struct monst *mtmp, register struct edog *edog) { if (monstermoves > edog->hungrytime + 500) { if (!carnivorous(mtmp->data) && !herbivorous(mtmp->data)) { @@ -391,10 +384,7 @@ register struct edog *edog; * returns 1 if object eaten (since that counts as dog's move), 2 if died */ STATIC_OVL int -dog_invent(mtmp, edog, udist) -register struct monst *mtmp; -register struct edog *edog; -int udist; +dog_invent(register struct monst *mtmp, register struct edog *edog, int udist) { register int omx, omy, carryamt = 0; struct obj *obj, *otmp; @@ -462,10 +452,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 -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; @@ -611,9 +598,8 @@ int after, udist, whappr; /* return 0 (no move), 1 (move) or 2 (dead) */ int -dog_move(mtmp, after) -register struct monst *mtmp; -register int after; /* this is extra fast monster movement */ +dog_move(register struct monst *mtmp, + register int after) /* this is extra fast monster movement */ { int omx, omy; /* original mtmp position */ int appr, whappr, udist; @@ -959,9 +945,7 @@ register int after; /* this is extra fast monster movement */ /* check if a monster could pick up objects from a location */ STATIC_OVL 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)) @@ -978,9 +962,7 @@ xchar nx, ny; * calls deep. */ STATIC_OVL 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; @@ -1014,9 +996,7 @@ xchar mx, my, fx, fy; /*ARGSUSED*/ /* do_clear_area client */ STATIC_PTR void -wantdoor(x, y, distance) -int x, y; -genericptr_t distance; +wantdoor(int x, int y, genericptr_t distance) { int ndist; @@ -1047,8 +1027,7 @@ static struct qmchoices { }; void -finish_meating(mtmp) -struct monst *mtmp; +finish_meating(struct monst *mtmp) { mtmp->meating = 0; if (mtmp->m_ap_type && mtmp->mappearance && mtmp->cham == NON_PM) { @@ -1060,8 +1039,7 @@ struct monst *mtmp; } STATIC_OVL 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 ca4e2a6bc2..5ec453f1d9 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -16,22 +16,20 @@ static NEARDATA const char *gate_str; extern boolean notonhead; /* for long worms */ -STATIC_DCL void FDECL(kickdmg, (struct monst *, BOOLEAN_P)); -STATIC_DCL boolean FDECL(maybe_kick_monster, (struct monst *, - XCHAR_P, XCHAR_P)); -STATIC_DCL void FDECL(kick_monster, (struct monst *, XCHAR_P, XCHAR_P)); -STATIC_DCL int FDECL(kick_object, (XCHAR_P, XCHAR_P)); -STATIC_DCL int FDECL(really_kick_object, (XCHAR_P, XCHAR_P)); -STATIC_DCL char *FDECL(kickstr, (char *)); -STATIC_DCL void FDECL(otransit_msg, (struct obj *, BOOLEAN_P, long)); -STATIC_DCL void FDECL(drop_to, (coord *, SCHAR_P)); +STATIC_DCL void kickdmg(struct monst *, boolean); +STATIC_DCL boolean maybe_kick_monster(struct monst *, + xchar, xchar); +STATIC_DCL void kick_monster(struct monst *, xchar, xchar); +STATIC_DCL int kick_object(xchar, xchar); +STATIC_DCL int really_kick_object(xchar, xchar); +STATIC_DCL char *kickstr(char *); +STATIC_DCL void otransit_msg(struct obj *, boolean, long); +STATIC_DCL void drop_to(coord *, schar); static const char kick_passes_thru[] = "kick passes harmlessly through"; STATIC_OVL void -kickdmg(mon, clumsy) -register struct monst *mon; -register boolean clumsy; +kickdmg(register struct monst *mon, register boolean clumsy) { register int mdx, mdy; register int dmg = (ACURRSTR + ACURR(A_DEX) + ACURR(A_CON)) / 15; @@ -126,9 +124,7 @@ register boolean clumsy; } STATIC_OVL 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 = context.forcefight; @@ -148,9 +144,7 @@ xchar x, y; } STATIC_OVL 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; @@ -290,9 +284,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; @@ -395,9 +387,8 @@ register struct obj *gold; /* 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; @@ -463,8 +454,7 @@ xchar x, y; /* coordinates where object was before the impact, not after */ /* jacket around really_kick_object */ STATIC_OVL int -kick_object(x, y) -xchar x, y; +kick_object(xchar x, xchar y) { int res = 0; @@ -480,8 +470,7 @@ xchar x, y; /* guts of kick_object */ STATIC_OVL int -really_kick_object(x, y) -xchar x, y; +really_kick_object(xchar x, xchar y) { int range; struct monst *mon, *shkp = 0; @@ -665,8 +654,8 @@ xchar x, y; (void) snuff_candle(kickedobj); newsym(x, y); mon = bhit(u.dx, u.dy, range, KICKED_WEAPON, - (int FDECL((*), (MONST_P, OBJ_P))) 0, - (int FDECL((*), (OBJ_P, OBJ_P))) 0, &kickedobj); + (int (*)(MONST_P, OBJ_P)) 0, + (int (*)(OBJ_P, OBJ_P)) 0, &kickedobj); if (!kickedobj) return 1; /* object broken */ @@ -707,8 +696,7 @@ xchar x, y; /* cause of death if kicking kills kicker */ STATIC_OVL char * -kickstr(buf) -char *buf; +kickstr(char *buf) { const char *what; @@ -1305,9 +1293,7 @@ dokick() } STATIC_OVL 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) { @@ -1339,10 +1325,9 @@ 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; @@ -1466,10 +1451,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; @@ -1588,8 +1570,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; @@ -1658,10 +1639,7 @@ boolean near_hero; } STATIC_OVL 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 num) { char obuf[BUFSZ]; @@ -1685,8 +1663,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 8de02854d4..2900346103 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -6,19 +6,19 @@ #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 boolean FDECL(throwing_weapon, (struct obj *)); -STATIC_DCL void FDECL(sho_obj_return_to_u, (struct obj * obj)); -STATIC_DCL boolean FDECL(mhurtle_step, (genericptr_t, int, int)); +STATIC_DCL int throw_obj(struct obj *, int); +STATIC_DCL boolean ok_to_throw(int *); +STATIC_DCL void autoquiver(void); +STATIC_DCL int gem_accept(struct monst *, struct obj *); +STATIC_DCL void tmiss(struct obj *, struct monst *, boolean); +STATIC_DCL int throw_gold(struct obj *); +STATIC_DCL void check_shop_obj(struct obj *, xchar, xchar, + boolean); +STATIC_DCL void breakmsg(struct obj *, boolean); +STATIC_DCL boolean toss_up(struct obj *, boolean); +STATIC_DCL boolean throwing_weapon(struct obj *); +STATIC_DCL void sho_obj_return_to_u(struct obj * obj); +STATIC_DCL boolean mhurtle_step(genericptr_t, int, int); static NEARDATA const char toss_objs[] = { ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, WEAPON_CLASS, 0 }; @@ -32,9 +32,7 @@ extern boolean notonhead; /* for long worms */ /* Throw the selected object, asking for direction */ STATIC_OVL int -throw_obj(obj, shotlimit) -struct obj *obj; -int shotlimit; +throw_obj(struct obj *obj, int shotlimit) { struct obj *otmp; int multishot; @@ -235,8 +233,7 @@ int shotlimit; /* common to dothrow() and dofire() */ STATIC_OVL 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; @@ -396,8 +393,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 && !context.mon_moving) { @@ -413,8 +409,7 @@ boolean verbose; * Object hits floor at hero's feet. Called from drop() and throwit(). */ void -hitfloor(obj) -register struct obj *obj; +hitfloor(register struct obj *obj) { if (IS_SOFT(levl[u.ux][u.uy].typ) || u.uinwater) { dropy(obj); @@ -440,11 +435,9 @@ register struct obj *obj; * before the failed callback. */ boolean -walk_path(src_cc, dest_cc, check_proc, arg) -coord *src_cc; -coord *dest_cc; -boolean FDECL((*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; @@ -524,9 +517,7 @@ genericptr_t arg; * 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; @@ -660,9 +651,7 @@ int x, y; } STATIC_OVL 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; @@ -689,9 +678,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; @@ -747,9 +734,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; @@ -782,10 +767,7 @@ int dx, dy, range; } STATIC_OVL 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) { struct monst *shkp = shop_keeper(*u.ushops); @@ -816,9 +798,7 @@ boolean broken; * Returns FALSE if the object is gone. */ STATIC_OVL 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) @@ -944,8 +924,7 @@ boolean hitsroof; /* return true for weapon meant to be thrown; excludes ammo */ STATIC_OVL boolean -throwing_weapon(obj) -struct obj *obj; +throwing_weapon(struct obj *obj) { return (boolean) (is_missile(obj) || is_spear(obj) /* daggers and knife (excludes scalpel) */ @@ -957,8 +936,7 @@ struct obj *obj; /* the currently thrown object is returning to you (not for boomerangs) */ STATIC_OVL 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 (bhitpos.x != u.ux || bhitpos.y != u.uy) { @@ -977,11 +955,9 @@ 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; @@ -1122,8 +1098,8 @@ boolean range = 1; mon = bhit(u.dx, u.dy, range, THROWN_WEAPON, - (int FDECL((*), (MONST_P, OBJ_P))) 0, - (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj); + (int (*)(MONST_P, OBJ_P)) 0, + (int (*)(OBJ_P, OBJ_P)) 0, &obj); thrownobj = obj; /* obj may be null now */ /* have to do this after bhit() so u.ux & u.uy are correct */ @@ -1263,10 +1239,7 @@ boolean /* 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; @@ -1306,10 +1279,7 @@ boolean mon_notices; /* thrown object misses target monster */ STATIC_OVL 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); @@ -1338,9 +1308,8 @@ boolean maybe_wakeup; * Also used for kicked objects and for polearms/grapnel applied at range. */ int -thitmonst(mon, obj) -register struct monst *mon; -register struct obj *obj; /* thrownobj or kickedobj or uwep */ +thitmonst(register struct monst *mon, + register struct obj *obj) /* thrownobj or kickedobj or uwep */ { register int tmp; /* Base chance to hit */ register int disttmp; /* distance modifier */ @@ -1603,9 +1572,7 @@ register struct obj *obj; /* thrownobj or kickedobj or uwep */ } STATIC_OVL 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); @@ -1710,10 +1677,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)); if (!breaktest(obj)) @@ -1729,9 +1695,8 @@ 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); @@ -1743,9 +1708,7 @@ xchar x, y; /* object location (ox, oy may not be right) */ } void -release_camera_demon(obj, x, y) -struct obj *obj; -xchar x, y; +release_camera_demon(struct obj *obj, xchar x, xchar y) { struct monst *mtmp; if (!rn2(3) @@ -1765,11 +1728,10 @@ xchar x, y; * 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, /* object location (ox, oy may not be right) */ + boolean hero_caused, /* is this the hero's fault? */ + boolean from_invent) { boolean fracture = FALSE; @@ -1854,8 +1816,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; @@ -1877,9 +1838,7 @@ struct obj *obj; } STATIC_OVL void -breakmsg(obj, in_view) -struct obj *obj; -boolean in_view; +breakmsg(struct obj *obj, boolean in_view) { const char *to_pieces; @@ -1918,8 +1877,7 @@ boolean in_view; } STATIC_OVL int -throw_gold(obj) -struct obj *obj; +throw_gold(struct obj *obj) { int range, odx, ody; register struct monst *mon; @@ -1961,8 +1919,8 @@ struct obj *obj; bhitpos.y = u.uy; } else { mon = bhit(u.dx, u.dy, range, THROWN_WEAPON, - (int FDECL((*), (MONST_P, OBJ_P))) 0, - (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj); + (int (*)(MONST_P, OBJ_P)) 0, + (int (*)(OBJ_P, OBJ_P)) 0, &obj); if (!obj) return 1; /* object is gone */ if (mon) { diff --git a/src/drawing.c b/src/drawing.c index 96bbd2da2c..772c576ae5 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -252,12 +252,12 @@ static const uchar def_r_oc_syms[MAXOCLASSES] = { #undef C #ifdef TERMLIB -void NDECL((*decgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ +void (*decgraphics_mode_callback)(void) = 0; /* set in tty_start_screen() */ #endif /* TERMLIB */ #ifdef PC9800 -void NDECL((*ibmgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ -void NDECL((*ascgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ +void (*ibmgraphics_mode_callback)(void) = 0; /* set in tty_start_screen() */ +void (*ascgraphics_mode_callback)(void) = 0; /* set in tty_start_screen() */ #endif /* @@ -266,8 +266,7 @@ void NDECL((*ascgraphics_mode_callback)) = 0; /* set in tty_start_screen() */ * objnam.c, options.c, pickup.c, sp_lev.c, lev_main.c, and tilemap.c. */ int -def_char_to_objclass(ch) -char ch; +def_char_to_objclass(char ch) { int i; for (i = 1; i < MAXOCLASSES; i++) @@ -282,8 +281,7 @@ char ch; * Used in detect.c, options.c, read.c, sp_lev.c, and lev_main.c */ int -def_char_to_monclass(ch) -char ch; +def_char_to_monclass(char ch) { int i; for (i = 1; i < MAXMCLASSES; i++) @@ -439,8 +437,7 @@ init_r_symbols() } void -assign_graphics(whichset) -int whichset; +assign_graphics(int whichset) { register int i; @@ -473,8 +470,7 @@ int whichset; } void -switch_symbols(nondefault) -int nondefault; +switch_symbols(int nondefault) { register int i; @@ -496,25 +492,19 @@ int nondefault; } void -update_l_symset(symp, val) -struct symparse *symp; -int val; +update_l_symset(struct symparse *symp, int val) { l_syms[symp->idx] = val; } void -update_r_symset(symp, val) -struct symparse *symp; -int val; +update_r_symset(struct symparse *symp, int val) { r_syms[symp->idx] = val; } void -clear_symsetentry(which_set, name_too) -int which_set; -boolean name_too; +clear_symsetentry(int which_set, boolean name_too) { if (symset[which_set].desc) free((genericptr_t) symset[which_set].desc); diff --git a/src/dungeon.c b/src/dungeon.c index 96b99591d0..6a873b7c93 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -37,44 +37,44 @@ 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 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_DCL boolean FDECL(unplaced_floater, (struct dungeon *)); -STATIC_DCL boolean FDECL(unreachable_level, (d_level *, BOOLEAN_P)); -STATIC_DCL void FDECL(tport_menu, (winid, char *, struct lchoice *, d_level *, - BOOLEAN_P)); -STATIC_DCL const char *FDECL(br_string, (int)); -STATIC_DCL void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P, - struct lchoice *)); -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 *, int, int, BOOLEAN_P)); -STATIC_DCL boolean FDECL(interest_mapseen, (mapseen *)); -STATIC_DCL void FDECL(traverse_mapseenchn, (BOOLEAN_P, winid, - int, int, int *)); -STATIC_DCL const char *FDECL(seen_string, (XCHAR_P, const char *)); -STATIC_DCL const char *FDECL(br_string2, (branch *)); -STATIC_DCL const char *FDECL(endgamelevelname, (char *, int)); -STATIC_DCL const char *FDECL(shop_string, (int)); -STATIC_DCL char *FDECL(tunesuffix, (mapseen *, char *)); +static void Fread(genericptr_t, int, int, dlb *); +STATIC_DCL xchar dname_to_dnum(const char *); +STATIC_DCL int find_branch(const char *, struct proto_dungeon *); +STATIC_DCL xchar parent_dnum(const char *, struct proto_dungeon *); +STATIC_DCL int level_range(xchar, int, int, int, + struct proto_dungeon *, int *); +STATIC_DCL xchar parent_dlevel(const char *, struct proto_dungeon *); +STATIC_DCL int correct_branch_type(struct tmpbranch *); +STATIC_DCL branch *add_branch(int, int, struct proto_dungeon *); +STATIC_DCL void add_level(s_level *); +STATIC_DCL void init_level(int, int, struct proto_dungeon *); +STATIC_DCL int possible_places(int, boolean *, + struct proto_dungeon *); +STATIC_DCL xchar pick_level(boolean *, int); +STATIC_DCL boolean place_level(int, struct proto_dungeon *); +STATIC_DCL boolean unplaced_floater(struct dungeon *); +STATIC_DCL boolean unreachable_level(d_level *, boolean); +STATIC_DCL void tport_menu(winid, char *, struct lchoice *, d_level *, + boolean); +STATIC_DCL const char *br_string(int); +STATIC_DCL void print_branch(winid, int, int, int, boolean, + struct lchoice *); +STATIC_DCL mapseen *load_mapseen(int); +STATIC_DCL void save_mapseen(int, mapseen *); +STATIC_DCL mapseen *find_mapseen(d_level *); +STATIC_DCL void print_mapseen(winid, mapseen *, int, int, boolean); +STATIC_DCL boolean interest_mapseen(mapseen *); +STATIC_DCL void traverse_mapseenchn(boolean, winid, + int, int, int *); +STATIC_DCL const char *seen_string(xchar, const char *); +STATIC_DCL const char *br_string2(branch *); +STATIC_DCL const char *endgamelevelname(char *, int); +STATIC_DCL const char *shop_string(int); +STATIC_DCL char *tunesuffix(mapseen *, char *); #ifdef DEBUG #define DD dungeons[i] -STATIC_DCL void NDECL(dumpit); +STATIC_DCL void dumpit(void); STATIC_OVL void dumpit() @@ -132,9 +132,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; @@ -187,8 +185,7 @@ boolean perform_write, free_data; /* Restore the dungeon structures. */ void -restore_dungeon(fd) -int fd; +restore_dungeon(int fd) { branch *curr, *last; int count, i; @@ -235,10 +232,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; @@ -251,8 +245,7 @@ dlb *stream; } STATIC_OVL xchar -dname_to_dnum(s) -const char *s; +dname_to_dnum(const char *s) { xchar i; @@ -266,8 +259,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) @@ -278,9 +270,8 @@ const char *s; /* Find the branch that links the named dungeon. */ STATIC_OVL int -find_branch(s, pd) -const char *s; /* dungeon name */ -struct proto_dungeon *pd; +find_branch(const char *s,/* dungeon name */ + struct proto_dungeon *pd) { int i; @@ -311,9 +302,8 @@ struct proto_dungeon *pd; * listing, then figuring out to which dungeon it belongs. */ STATIC_OVL xchar -parent_dnum(s, pd) -const char *s; /* dungeon name */ -struct proto_dungeon *pd; +parent_dnum(const char *s,/* dungeon name */ + struct proto_dungeon *pd) { int i; xchar pdnum; @@ -343,11 +333,7 @@ struct proto_dungeon *pd; * end of the dungeon. */ STATIC_OVL int -level_range(dgn, base, randc, chain, pd, adjusted_base) -xchar dgn; -int base, randc, chain; -struct proto_dungeon *pd; -int *adjusted_base; +level_range(xchar dgn, int base, int randc, int chain, struct proto_dungeon *pd, int *adjusted_base) { int lmax = dungeons[dgn].num_dunlevs; @@ -378,9 +364,7 @@ int *adjusted_base; } STATIC_OVL 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; @@ -405,8 +389,7 @@ struct proto_dungeon *pd; /* Convert from the temporary branch type to the dungeon branch type. */ STATIC_OVL int -correct_branch_type(tbr) -struct tmpbranch *tbr; +correct_branch_type(struct tmpbranch *tbr) { switch (tbr->type) { case TBR_STAIR: @@ -429,9 +412,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; @@ -479,10 +460,7 @@ boolean extract_first; /* Add a dungeon branch to the branch list. */ STATIC_OVL 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; @@ -510,8 +488,7 @@ struct proto_dungeon *pd; * last entry. */ STATIC_OVL void -add_level(new_lev) -s_level *new_lev; +add_level(s_level *new_lev) { s_level *prev, *curr; @@ -532,9 +509,7 @@ s_level *new_lev; } STATIC_OVL 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]; @@ -565,10 +540,9 @@ struct proto_dungeon *pd; } STATIC_OVL 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, /* prototype index */ + boolean *map, /* array MAXLEVEL+1 in length */ + struct proto_dungeon *pd) { int i, start, count; s_level *lev = pd->final_lev[idx]; @@ -597,9 +571,8 @@ struct proto_dungeon *pd; /* Pick the nth TRUE entry in the given boolean array. */ STATIC_OVL xchar -pick_level(map, nth) -boolean *map; /* an array MAXLEVEL+1 in size */ -int nth; +pick_level(boolean *map, /* an array MAXLEVEL+1 in size */ + int nth) { int i; for (i = 1; i <= MAXLEVEL; i++) @@ -610,11 +583,10 @@ int nth; } #ifdef DDEBUG -static void FDECL(indent, (int)); +static void indent(int); static void -indent(d) -int d; +indent(int d) { while (d-- > 0) fputs(" ", stderr); @@ -629,9 +601,7 @@ int d; * been exhausted, return false. */ STATIC_OVL 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; @@ -973,8 +943,7 @@ init_dungeons() /* return the level number for lev in *this* dungeon */ xchar -dunlev(lev) -d_level *lev; +dunlev(d_level *lev) { return lev->dlevel; } @@ -989,8 +958,7 @@ d_level *lev; /* 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 @@ -1027,8 +995,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); } @@ -1052,8 +1019,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; @@ -1070,8 +1036,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); @@ -1080,16 +1045,14 @@ 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); @@ -1097,8 +1060,7 @@ d_level *lev1, *lev2; /* 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; @@ -1114,8 +1076,7 @@ d_level *lev; * branch. Otherwise, return null. */ branch * -Is_branchlev(lev) -d_level *lev; +Is_branchlev(d_level *lev) { branch *curr; @@ -1128,8 +1089,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]; /* @@ -1142,8 +1102,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. */ @@ -1160,8 +1119,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. */ @@ -1181,8 +1139,7 @@ boolean at_stairs; } void -u_on_newpos(x, y) -int x, y; +u_on_newpos(int x, int y) { u.ux = x; u.uy = y; @@ -1200,8 +1157,7 @@ int x, y; /* place you on a random location */ void -u_on_rndspot(upflag) -int upflag; +u_on_rndspot(int upflag) { int up = (upflag & 1), was_in_W_tower = (upflag & 2); @@ -1230,8 +1186,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); @@ -1260,8 +1215,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) @@ -1271,15 +1225,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) @@ -1292,8 +1244,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)); } @@ -1305,9 +1256,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 */ @@ -1321,8 +1270,7 @@ d_level *lev; } boolean -has_ceiling(lev) -d_level *lev; +has_ceiling(d_level *lev) { /* [what about level 1 of the quest?] */ return (boolean) (!Is_airlevel(lev) && !Is_waterlevel(lev)); @@ -1340,9 +1288,7 @@ d_level *lev; * 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; @@ -1389,16 +1335,14 @@ 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); } @@ -1412,8 +1356,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; @@ -1440,8 +1383,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; @@ -1451,16 +1393,14 @@ 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) -d_level *lev; +On_W_tower_level(d_level *lev) { return (boolean) (Is_wiz1_level(lev) || Is_wiz2_level(lev) @@ -1469,9 +1409,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; @@ -1490,16 +1428,14 @@ 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; @@ -1507,8 +1443,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; @@ -1518,8 +1453,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; @@ -1527,9 +1461,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)); @@ -1541,8 +1473,7 @@ int range; } int -induced_align(pct) -int pct; +induced_align(int pct) { s_level *lev = Is_special(&u.uz); aligntyp al; @@ -1560,8 +1491,7 @@ int pct; } boolean -Invocation_lev(lev) -d_level *lev; +Invocation_lev(d_level *lev) { return (boolean) (In_hell(lev) && lev->dlevel == dungeons[lev->dnum].num_dunlevs - 1); @@ -1612,8 +1542,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; @@ -1679,8 +1608,7 @@ const char *nam; } STATIC_OVL boolean -unplaced_floater(dptr) -struct dungeon *dptr; +unplaced_floater(struct dungeon *dptr) { branch *br; int idx = (int) (dptr - dungeons); @@ -1695,9 +1623,7 @@ struct dungeon *dptr; } STATIC_OVL boolean -unreachable_level(lvl_p, unplaced) -d_level *lvl_p; -boolean unplaced; +unreachable_level(d_level *lvl_p, boolean unplaced) { s_level *dummy; @@ -1711,12 +1637,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; @@ -1746,8 +1667,7 @@ boolean unreachable; /* Convert a branch type to a string usable by print_dungeon(). */ STATIC_OVL const char * -br_string(type) -int type; +br_string(int type) { switch (type) { case BR_PORTAL: @@ -1764,13 +1684,8 @@ int type; /* Print all child branches between the lower and upper bounds. */ STATIC_OVL void -print_branch(win, dnum, lower_bound, upper_bound, bymenu, lchoices_p) -winid win; -int dnum; -int lower_bound; -int upper_bound; -boolean bymenu; -struct lchoice *lchoices_p; +print_branch(winid win, int dnum, int lower_bound, int upper_bound, + boolean bymenu, struct lchoice *lchoices_p) { branch *br; char buf[BUFSZ]; @@ -1792,10 +1707,7 @@ struct lchoice *lchoices_p; /* 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]; @@ -1941,9 +1853,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; @@ -1975,8 +1885,7 @@ d_level *dest; } char * -get_annotation(lev) -d_level *lev; +get_annotation(d_level *lev) { mapseen *mptr; @@ -2022,8 +1931,7 @@ donamelevel() /* find the particular mapseen object in the chain; may return null */ STATIC_OVL mapseen * -find_mapseen(lev) -d_level *lev; +find_mapseen(d_level *lev) { mapseen *mptr; @@ -2035,8 +1943,7 @@ d_level *lev; } void -forget_mapseen(ledger_num) -int ledger_num; +forget_mapseen(int ledger_num) { mapseen *mptr; struct cemetery *bp; @@ -2064,9 +1971,7 @@ int ledger_num; } STATIC_OVL void -save_mapseen(fd, mptr) -int fd; -mapseen *mptr; +save_mapseen(int fd, mapseen *mptr) { branch *curr; int brindx; @@ -2087,8 +1992,7 @@ mapseen *mptr; } STATIC_OVL mapseen * -load_mapseen(fd) -int fd; +load_mapseen(int fd) { int branchnum, brindx; mapseen *load; @@ -2125,8 +2029,7 @@ int fd; * ignore such levels, end of game disclosure will include them.] */ void -remdun_mapseen(dnum) -int dnum; +remdun_mapseen(int dnum) { mapseen *mptr, **mptraddr; @@ -2150,8 +2053,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. @@ -2194,8 +2096,7 @@ d_level *lev; /* returns true if this level has something interesting to print out */ STATIC_OVL boolean -interest_mapseen(mptr) -mapseen *mptr; +interest_mapseen(mapseen *mptr) { if (on_level(&u.uz, &mptr->lev)) return TRUE; @@ -2473,8 +2374,7 @@ recalc_mapseen() /* 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); @@ -2486,8 +2386,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); @@ -2504,10 +2403,9 @@ dooverview() /* called for #overview or for end of game disclosure */ void -show_overview(why, reason) -int why; /* 0 => #overview command, - 1 or 2 => final disclosure (1: hero lived, 2: hero died) */ -int reason; /* how hero died; used when disclosing end-of-game level */ +show_overview(int why, /* 0 => #overview command, + 1 or 2 => final disclosure (1: hero lived, 2: hero died) */ + int reason)/* how hero died; used when disclosing end-of-game level */ { winid win; int lastdun = -1; @@ -2529,10 +2427,7 @@ int reason; /* how hero died; used when disclosing end-of-game level */ /* display endgame levels or non-endgame levels, not both */ STATIC_OVL void -traverse_mapseenchn(viewendgame, win, why, reason, lastdun_p) -boolean viewendgame; -winid win; -int why, reason, *lastdun_p; +traverse_mapseenchn(boolean viewendgame, winid win, int why, int reason, int *lastdun_p) { mapseen *mptr; boolean showheader; @@ -2551,9 +2446,7 @@ int why, reason, *lastdun_p; } STATIC_OVL const char * -seen_string(x, obj) -xchar x; -const char *obj; +seen_string(xchar x, const char *obj) { /* players are computer scientists: 0, 1, 2, n */ switch (x) { @@ -2573,8 +2466,7 @@ const char *obj; /* better br_string */ STATIC_OVL const char * -br_string2(br) -branch *br; +br_string2(branch *br) { /* Special case: quest portal says closed if kicked from quest */ boolean closed_portal = (br->end2.dnum == quest_dnum @@ -2596,9 +2488,7 @@ branch *br; /* get the name of an endgame level; topten.c does something similar */ STATIC_OVL const char * -endgamelevelname(outbuf, indx) -char *outbuf; -int indx; +endgamelevelname(char *outbuf, int indx) { const char *planename = 0; @@ -2628,8 +2518,7 @@ int indx; } STATIC_OVL const char * -shop_string(rtype) -int rtype; +shop_string(int rtype) { const char *str = "shop"; /* catchall */ @@ -2680,9 +2569,7 @@ int rtype; /* if player knows about the mastermind tune, append it to Castle annotation; if drawbridge has been destroyed, flags.castletune will be zero */ STATIC_OVL char * -tunesuffix(mptr, outbuf) -mapseen *mptr; -char *outbuf; +tunesuffix(mapseen *mptr, char *outbuf) { *outbuf = '\0'; if (mptr->flags.castletune && u.uevent.uheard_tune) { @@ -2721,12 +2608,11 @@ char *outbuf; } while (0) STATIC_OVL void -print_mapseen(win, mptr, final, how, printdun) -winid win; -mapseen *mptr; -int final; /* 0: not final; 1: game over, alive; 2: game over, dead */ -int how; /* cause of death; only used if final==2 and mptr->lev==u.uz */ -boolean printdun; +print_mapseen(winid win, + mapseen *mptr, + int final, /* 0: not final; 1: game over, alive; 2: game over, dead */ + int how, /* cause of death; only used if final==2 and mptr->lev==u.uz */ + boolean printdun) { char buf[BUFSZ], tmpbuf[BUFSZ]; int i, depthstart, dnum; diff --git a/src/eat.c b/src/eat.c index fe3e4e0715..17b2ba594e 100644 --- a/src/eat.c +++ b/src/eat.c @@ -4,38 +4,38 @@ #include "hack.h" -STATIC_PTR int NDECL(eatmdone); -STATIC_PTR int NDECL(eatfood); -STATIC_PTR void FDECL(costly_tin, (int)); -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 int FDECL(intrinsic_possible, (int, struct permonst *)); -STATIC_DCL void FDECL(givit, (int, struct permonst *)); -STATIC_DCL void FDECL(cpostfx, (int)); -STATIC_DCL 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(start_eating, (struct obj *)); -STATIC_DCL void FDECL(fprefx, (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 int FDECL(bounded_increase, (int, int, int)); -STATIC_DCL void FDECL(accessory_has_effect, (struct obj *)); -STATIC_DCL void FDECL(eataccessory, (struct obj *)); -STATIC_DCL const char *FDECL(foodword, (struct obj *)); -STATIC_DCL int FDECL(tin_variety, (struct obj *, BOOLEAN_P)); -STATIC_DCL boolean FDECL(maybe_cannibal, (int, BOOLEAN_P)); +STATIC_PTR int eatmdone(void); +STATIC_PTR int eatfood(void); +STATIC_PTR void costly_tin(int); +STATIC_PTR int opentin(void); +STATIC_PTR int unfaint(void); + +STATIC_DCL const char *food_xname(struct obj *, boolean); +STATIC_DCL void choke(struct obj *); +STATIC_DCL void recalc_wt(void); +STATIC_DCL struct obj *touchfood(struct obj *); +STATIC_DCL void do_reset_eat(void); +STATIC_DCL void done_eating(boolean); +STATIC_DCL void cprefx(int); +STATIC_DCL int intrinsic_possible(int, struct permonst *); +STATIC_DCL void givit(int, struct permonst *); +STATIC_DCL void cpostfx(int); +STATIC_DCL void consume_tin(const char *); +STATIC_DCL void start_tin(struct obj *); +STATIC_DCL int eatcorpse(struct obj *); +STATIC_DCL void start_eating(struct obj *); +STATIC_DCL void fprefx(struct obj *); +STATIC_DCL void fpostfx(struct obj *); +STATIC_DCL int bite(void); +STATIC_DCL int edibility_prompts(struct obj *); +STATIC_DCL int rottenfood(struct obj *); +STATIC_DCL void eatspecial(void); +STATIC_DCL int bounded_increase(int, int, int); +STATIC_DCL void accessory_has_effect(struct obj *); +STATIC_DCL void eataccessory(struct obj *); +STATIC_DCL const char *foodword(struct obj *); +STATIC_DCL int tin_variety(struct obj *, boolean); +STATIC_DCL boolean maybe_cannibal(int, boolean); char msgbuf[BUFSZ]; @@ -78,8 +78,7 @@ const char *hu_stat[] = { "Satiated", " ", "Hungry ", "Weak ", * 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)) */ @@ -190,9 +189,7 @@ eatmupdate() /* ``[the(] singular(food, xname) [)]'' */ STATIC_OVL const char * -food_xname(food, the_pfx) -struct obj *food; -boolean the_pfx; +food_xname(struct obj *food, boolean the_pfx) { const char *result; @@ -220,8 +217,7 @@ boolean the_pfx; * To a full belly all food is bad. (It.) */ STATIC_OVL void -choke(food) -struct obj *food; +choke(struct obj *food) { /* only happens if you were satiated */ if (u.uhs != SATIATED) { @@ -297,8 +293,7 @@ reset_eat() } STATIC_OVL struct obj * -touchfood(otmp) -struct obj *otmp; +touchfood(struct obj *otmp) { if (otmp->quan > 1L) { if (!carried(otmp)) @@ -336,8 +331,7 @@ struct obj *otmp; * in do_reset_eat(). */ void -food_disappears(obj) -struct obj *obj; +food_disappears(struct obj *obj) { if (obj == context.victual.piece) { context.victual.piece = (struct obj *) 0; @@ -351,8 +345,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 == context.victual.piece) { context.victual.piece = new_obj; @@ -411,8 +404,7 @@ eatfood(VOID_ARGS) } STATIC_OVL void -done_eating(message) -boolean message; +done_eating(boolean message) { context.victual.piece->in_use = TRUE; occupation = 0; /* do this early, so newuhs() knows we're done */ @@ -440,8 +432,7 @@ boolean message; } void -eating_conducts(pd) -struct permonst *pd; +eating_conducts(struct permonst *pd) { u.uconduct.food++; if (!vegan(pd)) @@ -452,10 +443,10 @@ struct permonst *pd; /* handle side-effects of mind flayer's tentacle attack */ int -eat_brains(magr, mdef, visflag, dmg_p) -struct monst *magr, *mdef; -boolean visflag; -int *dmg_p; /* for dishing out extra damage in lieu of Int loss */ +eat_brains(struct monst *magr, + struct monst *mdef, + boolean visflag, + int *dmg_p)/* for dishing out extra damage in lieu of Int loss */ { struct permonst *pd = mdef->data; boolean give_nutrit = FALSE; @@ -598,9 +589,7 @@ int *dmg_p; /* for dishing out extra damage in lieu of Int loss */ /* eating a corpse or egg of one's own species is usually naughty */ STATIC_OVL 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 */ @@ -631,8 +620,7 @@ boolean allowmsg; } STATIC_OVL void -cprefx(pm) -register int pm; +cprefx(register int pm) { (void) maybe_cannibal(pm, TRUE); if (flesh_petrifies(&mons[pm])) { @@ -722,9 +710,7 @@ fix_petrification() /* intrinsic_possible() returns TRUE iff a monster can give an intrinsic. */ STATIC_OVL int -intrinsic_possible(type, ptr) -int type; -register struct permonst *ptr; +intrinsic_possible(int type, register struct permonst *ptr) { int res = 0; @@ -786,9 +772,7 @@ register struct permonst *ptr; * and what type of intrinsic it is trying to give you. */ STATIC_OVL void -givit(type, ptr) -int type; -register struct permonst *ptr; +givit(int type, register struct permonst *ptr) { register int chance; @@ -899,8 +883,7 @@ register struct permonst *ptr; /* called after completely consuming a corpse */ STATIC_OVL void -cpostfx(pm) -register int pm; +cpostfx(register int pm) { register int tmp = 0; boolean catch_lycanthropy = FALSE; @@ -1119,8 +1102,7 @@ violated_vegetarian() /* common code to check and possibly charge for 1 context.tin.tin, * will split() context.tin.tin if necessary */ STATIC_PTR void -costly_tin(alter_type) -int alter_type; /* COST_xxx */ +costly_tin(int alter_type) /* COST_xxx */ { struct obj *tin = context.tin.tin; @@ -1135,9 +1117,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; @@ -1160,10 +1140,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); @@ -1194,9 +1171,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; @@ -1224,9 +1199,8 @@ int forcetype; } STATIC_OVL 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; @@ -1249,8 +1223,7 @@ boolean disp; /* we're just displaying so leave things alone */ } STATIC_OVL void -consume_tin(mesg) -const char *mesg; +consume_tin(const char *mesg) { const char *what; int which, mnum, r; @@ -1398,8 +1371,7 @@ opentin(VOID_ARGS) /* called when starting to open a tin */ STATIC_OVL void -start_tin(otmp) -struct obj *otmp; +start_tin(struct obj *otmp) { const char *mesg = 0; register int tmp; @@ -1485,8 +1457,7 @@ Hear_again(VOID_ARGS) /* called on the "first bite" of rotten food */ STATIC_OVL int -rottenfood(obj) -struct obj *obj; +rottenfood(struct obj *obj) { pline("Blecch! Rotten %s!", foodword(obj)); if (!rn2(4)) { @@ -1524,8 +1495,7 @@ struct obj *obj; /* called when a corpse is selected as food */ STATIC_OVL int -eatcorpse(otmp) -struct obj *otmp; +eatcorpse(struct obj *otmp) { int tp = 0, mnum = otmp->corpsenm; long rotted = 0L; @@ -1645,8 +1615,7 @@ struct obj *otmp; /* called as you start to eat */ STATIC_OVL void -start_eating(otmp) -struct obj *otmp; +start_eating(struct obj *otmp) { const char *old_nomovemsg, *save_nomovemsg; @@ -1699,8 +1668,7 @@ struct obj *otmp; * used for non-rotten non-tin non-corpse food */ STATIC_OVL void -fprefx(otmp) -struct obj *otmp; +fprefx(struct obj *otmp) { switch (otmp->otyp) { case FOOD_RATION: @@ -1792,8 +1760,7 @@ struct obj *otmp; /* increment a combat intrinsic with limits on its growth */ STATIC_OVL int -bounded_increase(old, inc, typ) -int old, inc, typ; +bounded_increase(int old, int inc, int typ) { int absold, absinc, sgnold, sgninc; @@ -1824,16 +1791,14 @@ int old, inc, typ; } STATIC_OVL 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_OVL void -eataccessory(otmp) -struct obj *otmp; +eataccessory(struct obj *otmp) { int typ = otmp->otyp; long oldprop; @@ -2051,8 +2016,7 @@ static const char *foodwords[] = { }; STATIC_OVL const char * -foodword(otmp) -struct obj *otmp; +foodword(struct obj *otmp) { if (otmp->oclass == FOOD_CLASS) return "food"; @@ -2064,8 +2028,7 @@ struct obj *otmp; /* called after consuming (non-corpse) food */ STATIC_OVL void -fpostfx(otmp) -struct obj *otmp; +fpostfx(struct obj *otmp) { switch (otmp->otyp) { case SPRIG_OF_WOLFSBANE: @@ -2151,11 +2114,10 @@ struct obj *otmp; /* intended for eating a spellbook while polymorphed, but not used; "leather" applied to appearance, not composition, and has been changed to "leathery" to reflect that */ -STATIC_DCL boolean FDECL(leather_cover, (struct obj *)); +STATIC_DCL boolean leather_cover(struct obj *); STATIC_OVL boolean -leather_cover(otmp) -struct obj *otmp; +leather_cover(struct obj *otmp) { const char *odesc = OBJ_DESCR(objects[otmp->otyp]); @@ -2173,8 +2135,7 @@ struct obj *otmp; * return 2 if the food was dangerous and you chose to eat it anyway. */ STATIC_OVL int -edibility_prompts(otmp) -struct obj *otmp; +edibility_prompts(struct obj *otmp) { /* Blessed food detection grants hero a one-use * ability to detect food that is unfit for consumption @@ -2661,8 +2622,7 @@ gethungry() /* called after vomiting and after performing feats of magic */ void -morehungry(num) -int num; +morehungry(int num) { u.uhunger -= num; newuhs(TRUE); @@ -2670,8 +2630,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; @@ -2745,8 +2704,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; @@ -2884,9 +2842,8 @@ boolean incr; * Object may be either on floor or in inventory. */ struct obj * -floorfood(verb, corpsecheck) -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]; @@ -2990,9 +2947,7 @@ vomit() /* A good idea from David Neves */ } int -eaten_stat(base, obj) -int base; -struct obj *obj; +eaten_stat(int base, struct obj *obj) { long uneaten_amt, full_amount; @@ -3013,9 +2968,7 @@ 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 @@ -3065,8 +3018,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 @@ -3086,8 +3038,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 e245e30e4f..6f21e3fcd1 100644 --- a/src/end.c +++ b/src/end.c @@ -38,25 +38,25 @@ static struct val_list { { 0, 0 } }; #ifndef NO_SIGNAL -STATIC_PTR void FDECL(done_intr, (int)); +STATIC_PTR 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_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(really_done, (int)) NORETURN; -STATIC_DCL boolean FDECL(odds_and_ends, (struct obj *, int)); -STATIC_DCL void FDECL(savelife, (int)); -STATIC_DCL void FDECL(list_vanquished, (CHAR_P, BOOLEAN_P)); -STATIC_DCL void FDECL(list_genocided, (CHAR_P, BOOLEAN_P)); -STATIC_DCL boolean FDECL(should_query_disclose_option, (int, char *)); -STATIC_DCL int NDECL(num_extinct); +STATIC_DCL void disclose(int, boolean); +STATIC_DCL void get_valuables(struct obj *); +STATIC_DCL void sort_valuables(struct valuable_data *, int); +STATIC_DCL void artifact_score(struct obj *, boolean, winid); +STATIC_DCL void really_done(int) NORETURN; +STATIC_DCL boolean odds_and_ends(struct obj *, int); +STATIC_DCL void savelife(int); +STATIC_DCL void list_vanquished(char, boolean); +STATIC_DCL void list_genocided(char, boolean); +STATIC_DCL boolean should_query_disclose_option(int, char *); +STATIC_DCL int num_extinct(void); #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 @@ -111,12 +111,12 @@ extern void FDECL(nethack_exit, (int)); #endif #endif -static void NDECL(NH_abort); +static void NH_abort(void); #ifndef NO_SIGNAL -static void FDECL(panictrace_handler, (int)); +static void panictrace_handler(int); #endif -static boolean NDECL(NH_panictrace_libc); -static boolean NDECL(NH_panictrace_gdb); +static boolean NH_panictrace_libc(void); +static boolean NH_panictrace_gdb(void); #ifndef NO_SIGNAL /*ARGSUSED*/ @@ -130,8 +130,7 @@ int sig_unused UNUSED; } void -panictrace_setsignals(set) -boolean set; +panictrace_setsignals(boolean set) { #define SETSIGNAL(sig) \ (void) signal(sig, set ? (SIG_RET_TYPE) panictrace_handler : SIG_DFL); @@ -298,8 +297,7 @@ static boolean Schroedingers_cat = FALSE; /*ARGSUSED*/ void -done1(sig_unused) /* called as signal() handler, so sent at least one arg */ -int sig_unused UNUSED; +done1(int sig_unused UNUSED) /* called as signal() handler, so sent at least one arg */ { #ifndef NO_SIGNAL (void) signal(SIGINT, SIG_IGN); @@ -370,8 +368,7 @@ done2() #ifndef NO_SIGNAL /*ARGSUSED*/ STATIC_PTR void -done_intr(sig_unused) /* called as signal() handler, so sent at least 1 arg */ -int sig_unused UNUSED; +done_intr(int sig_unused UNUSED) /* called as signal() handler, so sent at least 1 arg */ { done_stopprint++; (void) signal(SIGINT, SIG_IGN); @@ -384,11 +381,10 @@ int sig_unused UNUSED; #if defined(UNIX) || defined(VMS) || defined(__EMX__) /* signal() handler */ static void -done_hangup(sig) -int sig; +done_hangup(int sig) { program_state.done_hup++; - sethanguphandler((void FDECL((*), (int) )) SIG_IGN); + sethanguphandler((void (*)(int)) SIG_IGN); done_intr(sig); return; } @@ -396,9 +392,7 @@ int sig; #endif /* NO_SIGNAL */ void -done_in_by(mtmp, how) -struct monst *mtmp; -int how; +done_in_by(struct monst *mtmp, int how) { char buf[BUFSZ]; struct permonst *mptr = mtmp->data, @@ -508,11 +502,10 @@ int how; #endif /*VARARGS1*/ -void panic -VA_DECL(const char *, str) +void panic(const char *str, ...) { - VA_START(str); - VA_INIT(str, char *); + va_list the_args; + va_start(the_args, str); if (program_state.panicking++) NH_abort(); /* avoid loops - this should never happen*/ @@ -568,7 +561,7 @@ VA_DECL(const char *, str) { char buf[BUFSZ]; - Vsprintf(buf, str, VA_ARGS); + Vsprintf(buf, str, the_args); raw_print(buf); paniclog("panic", buf); } @@ -579,14 +572,12 @@ VA_DECL(const char *, str) if (wizard) NH_abort(); /* generate core dump */ #endif - VA_END(); + va_end(the_args); really_done(PANICKED); } STATIC_OVL boolean -should_query_disclose_option(category, defquery) -int category; -char *defquery; +should_query_disclose_option(int category, char *defquery) { int idx; char *dop; @@ -620,9 +611,7 @@ char *defquery; } STATIC_OVL void -disclose(how, taken) -int how; -boolean taken; +disclose(int how, boolean taken) { char c = '\0', defquery; char qbuf[QBUFSZ]; @@ -701,8 +690,7 @@ boolean taken; /* try to get the player back in a viable state after being killed */ STATIC_OVL void -savelife(how) -int how; +savelife(int how) { int uhpmin = max(2 * u.ulevel, 10); @@ -740,8 +728,7 @@ int how; * intact. */ STATIC_OVL 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; @@ -775,9 +762,8 @@ struct obj *list; /* inventory or container contents */ * as easily use qsort, but we don't care about efficiency here. */ STATIC_OVL 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; @@ -801,9 +787,7 @@ int size; /* max value is less than 20 */ #define CAT_CHECK 2 STATIC_OVL boolean -odds_and_ends(list, what) -struct obj *list; -int what; +odds_and_ends(struct obj *list, int what) { struct obj *otmp; for (otmp = list; otmp; otmp = otmp->nobj) { @@ -822,10 +806,9 @@ int what; /* called twice; first to calculate total, then to list relevant items */ STATIC_OVL 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, /* true => add up points; false => display them */ + winid endwin) { char pbuf[BUFSZ]; struct obj *otmp; @@ -859,8 +842,7 @@ winid endwin; /* Be careful not to call panic from here! */ void -done(how) -int how; +done(int how) { if (how == TRICKED) { if (killer.name[0]) { @@ -917,8 +899,7 @@ int how; /* separated from done() in order to specify the __noreturn__ attribute */ STATIC_OVL void -really_done(how) -int how; +really_done(int how) { boolean taken; char pbuf[BUFSZ]; @@ -1284,9 +1265,8 @@ int how; } void -container_contents(list, identified, all_containers, reportempty) -struct obj *list; -boolean identified, all_containers, reportempty; +container_contents(struct obj *list, boolean identified, + boolean all_containers, boolean reportempty) { register struct obj *box, *obj; struct obj **oarray; @@ -1377,8 +1357,7 @@ boolean identified, all_containers, reportempty; /* should be called with either EXIT_SUCCESS or EXIT_FAILURE */ void -terminate(status) -int status; +terminate(int status) { program_state.in_moveloop = 0; /* won't be returning to normal play */ #ifdef MAC @@ -1415,9 +1394,7 @@ dovanquished() } STATIC_OVL void -list_vanquished(defquery, ask) -char defquery; -boolean ask; +list_vanquished(char defquery, boolean ask) { register int i, lev; int ntypes = 0, max_lev = 0, nkilled; @@ -1528,9 +1505,7 @@ num_extinct() } STATIC_OVL void -list_genocided(defquery, ask) -char defquery; -boolean ask; +list_genocided(char defquery, boolean ask) { register int i; int ngenocided, nextinct; @@ -1589,10 +1564,7 @@ boolean ask; /* 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); @@ -1610,8 +1582,7 @@ const char *killername; } struct kinfo * -find_delayed_killer(id) -int id; +find_delayed_killer(int id) { struct kinfo *k; @@ -1623,8 +1594,7 @@ int id; } void -dealloc_killer(kptr) -struct kinfo *kptr; +dealloc_killer(struct kinfo *kptr) { struct kinfo *prev = &killer, *k; @@ -1645,9 +1615,7 @@ struct kinfo *kptr; } void -save_killers(fd, mode) -int fd; -int mode; +save_killers(int fd, int mode) { struct kinfo *kptr; @@ -1666,8 +1634,7 @@ int mode; } void -restore_killers(fd) -int fd; +restore_killers(int fd) { struct kinfo *kptr; @@ -1680,8 +1647,7 @@ int fd; } static int -wordcount(p) -char *p; +wordcount(char *p) { int words = 0; @@ -1697,8 +1663,7 @@ char *p; } static void -bel_copy1(inp, out) -char **inp, *out; +bel_copy1(char **inp, char *out) { char *in = *inp; @@ -1712,8 +1677,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 3cc5592751..a542cdd970 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -8,8 +8,7 @@ STATIC_VAR NEARDATA struct engr *head_engr; char * -random_engraving(outbuf) -char *outbuf; +random_engraving(char *outbuf) { const char *rumor; @@ -77,10 +76,9 @@ static const struct { /* degrade some of the characters in a string */ void -wipeout_text(engr, cnt, seed) -char *engr; -int cnt; -unsigned seed; /* for semi-controlled randomization */ +wipeout_text(char *engr, + int cnt, + unsigned seed) /* for semi-controlled randomization */ { char *s; int i, j, nxt, use_rubout, lth = (int) strlen(engr); @@ -141,8 +139,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; @@ -163,9 +160,7 @@ boolean check_pit; /* 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) @@ -175,8 +170,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]; @@ -206,8 +200,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; @@ -238,8 +231,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; @@ -260,10 +252,7 @@ xchar x, y; * ("Elbereth burrito" matches; "o Elbereth" does not.) */ int -sengr_at(s, x, y, strict) -const char *s; -xchar x, y; -boolean strict; +sengr_at(const char *s, xchar x, xchar y, boolean strict) { register struct engr *ep = engr_at(x, y); @@ -275,16 +264,14 @@ boolean strict; } void -u_wipe_engr(cnt) -int cnt; +u_wipe_engr(int cnt) { if (can_reach_floor(TRUE)) wipe_engr_at(u.ux, u.uy, cnt, FALSE); } void -wipe_engr_at(x, y, cnt, magical) -xchar x, y, cnt, magical; +wipe_engr_at(xchar x, xchar y, xchar cnt, xchar magical) { register struct engr *ep = engr_at(x, y); @@ -306,8 +293,7 @@ xchar x, y, cnt, magical; } 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; @@ -377,11 +363,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 e_time, xchar e_type) { struct engr *ep; @@ -404,8 +386,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); @@ -1152,8 +1133,7 @@ sanitize_engravings() } void -save_engravings(fd, mode) -int fd, mode; +save_engravings(int fd, int mode) { struct engr *ep, *ep2; unsigned no_more_engr = 0; @@ -1174,8 +1154,7 @@ int fd, mode; } void -rest_engravings(fd) -int fd; +rest_engravings(int fd) { struct engr *ep; unsigned lth; @@ -1199,8 +1178,7 @@ int fd; } void -del_engr(ep) -register struct engr *ep; +del_engr(register struct engr *ep) { if (ep == head_engr) { head_engr = ep->nxt_engr; @@ -1222,8 +1200,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; @@ -1242,9 +1219,7 @@ struct engr *ep; * 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) { char buf[BUFSZ]; diff --git a/src/exper.c b/src/exper.c index 06456e0c0e..ed56c6caaa 100644 --- a/src/exper.c +++ b/src/exper.c @@ -5,12 +5,11 @@ #include "hack.h" #include -STATIC_DCL long FDECL(newuexp, (int)); -STATIC_DCL int FDECL(enermod, (int)); +STATIC_DCL long newuexp(int); +STATIC_DCL int enermod(int); STATIC_OVL long -newuexp(lev) -int lev; +newuexp(int lev) { if (lev < 10) return (10L * (1L << lev)); @@ -20,8 +19,7 @@ int lev; } STATIC_OVL int -enermod(en) -int en; +enermod(int en) { switch (Role_switch) { case PM_PRIEST: @@ -70,9 +68,7 @@ newpw() /* return # of exp points for mtmp after nk killed */ int -experience(mtmp, nk) -register struct monst *mtmp; -register int nk; +experience(register struct monst *mtmp, register int nk) { register struct permonst *ptr = mtmp->data; int i, tmp, tmp2; @@ -156,8 +152,7 @@ register int nk; } void -more_experienced(exper, rexp) -register int exper, rexp; +more_experienced(register int exper, register int rexp) { long newexp = u.uexp + exper; long rexpincr = 4 * exper + rexp; @@ -183,8 +178,7 @@ register int exper, 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; @@ -258,9 +252,8 @@ newexplevel() } void -pluslvl(incr) -boolean incr; /* true iff via incremental experience growth */ -{ /* (false for potion of gain level) */ +pluslvl(boolean incr) /* true iff via incremental experience growth */ +{ /* (false for potion of gain level) */ int hpinc, eninc; if (!incr) @@ -306,8 +299,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 08a9a704e9..f38e6afef0 100644 --- a/src/explode.c +++ b/src/explode.c @@ -25,12 +25,11 @@ static int explosion[3][3] = { { S_explode1, S_explode4, S_explode7 }, * 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, /* the same as in zap.c; passes -(wand typ) for some WAND_CLASS */ + int dam, + char olet, + int expltype) { int i, j, k, damu = dam; boolean starting = 1; @@ -541,11 +540,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; @@ -711,8 +709,7 @@ struct obj *obj; /* only scatter this obj */ * For now, just perform a "regular" explosion. */ void -splatter_burning_oil(x, y) -int x, y; +splatter_burning_oil(int x, int y) { /* ZT_SPELL(ZT_FIRE) = ZT_SPELL(AD_FIRE-1) = 10+(2-1) = 11 */ #define ZT_SPELL_O_FIRE 11 /* value kludge, see zap.c */ @@ -722,9 +719,7 @@ int x, y; /* 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) { if (!obj->lamplit) impossible("exploding unlit oil"); diff --git a/src/extralev.c b/src/extralev.c index 54e935e08b..9daaf01c53 100644 --- a/src/extralev.c +++ b/src/extralev.c @@ -21,15 +21,13 @@ 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_DCL void roguejoin(int, int, int, int, int); +STATIC_DCL void roguecorr(int, int, int); +STATIC_DCL void miniwalk(int, int); STATIC_OVL 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) { register int x, y, middle; if (horiz) { @@ -53,8 +51,7 @@ int horiz; STATIC_OVL void -roguecorr(x, y, dir) -int x, y, dir; +roguecorr(int x, int y, int dir) { register int fromx, fromy, tox, toy; @@ -149,8 +146,7 @@ int x, y, dir; /* Modified walkfrom() from mkmaze.c */ STATIC_OVL void -miniwalk(x, y) -int x, y; +miniwalk(int x, int y) { register int q, dir; int dirs[4]; @@ -287,8 +283,7 @@ makeroguerooms() } void -corr(x, y) -int x, y; +corr(int x, int y) { if (rn2(50)) { levl[x][y].typ = CORR; diff --git a/src/files.c b/src/files.c index 1b74a56b4d..8549065b27 100644 --- a/src/files.c +++ b/src/files.c @@ -124,8 +124,8 @@ struct level_ftrack { #define WIZKIT_MAX 128 static char wizkit[WIZKIT_MAX]; -STATIC_DCL FILE *NDECL(fopen_wizkit_file); -STATIC_DCL void FDECL(wizkit_addinv, (struct obj *)); +STATIC_DCL FILE *fopen_wizkit_file(void); +STATIC_DCL void wizkit_addinv(struct obj *); #ifdef AMIGA extern char PATH[]; /* see sys/amiga/amidos.c */ @@ -136,7 +136,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) @@ -171,37 +171,37 @@ extern int n_dgns; /* from dungeon.c */ #endif #ifdef SELECTSAVED -STATIC_PTR int FDECL(CFDECLSPEC strcmp_wrap, (const void *, const void *)); +STATIC_PTR int CFDECLSPEC strcmp_wrap(const void *, const void *); #endif -STATIC_DCL char *FDECL(set_bonesfile_name, (char *, d_level *)); -STATIC_DCL char *NDECL(set_bonestemp_name); +STATIC_DCL char *set_bonesfile_name(char *, d_level *); +STATIC_DCL char *set_bonestemp_name(void); #ifdef COMPRESS -STATIC_DCL void FDECL(redirect, (const char *, const char *, FILE *, - BOOLEAN_P)); +STATIC_DCL void redirect(const char *, const char *, FILE *, + boolean); #endif #if defined(COMPRESS) || defined(ZLIB_COMP) -STATIC_DCL void FDECL(docompress_file, (const char *, BOOLEAN_P)); +STATIC_DCL void docompress_file(const char *, boolean); #endif #if defined(ZLIB_COMP) -STATIC_DCL boolean FDECL(make_compressed_name, (const char *, char *)); +STATIC_DCL boolean make_compressed_name(const char *, char *); #endif #ifndef USE_FCNTL -STATIC_DCL char *FDECL(make_lockname, (const char *, char *)); -#endif -STATIC_DCL FILE *FDECL(fopen_config_file, (const char *, int)); -STATIC_DCL int FDECL(get_uchars, (FILE *, char *, char *, uchar *, BOOLEAN_P, - int, const char *)); -int FDECL(parse_config_line, (FILE *, char *, int)); -STATIC_DCL FILE *NDECL(fopen_sym_file); -STATIC_DCL void FDECL(set_symhandling, (char *, int)); +STATIC_DCL char *make_lockname(const char *, char *); +#endif +STATIC_DCL FILE *fopen_config_file(const char *, int); +STATIC_DCL int get_uchars(FILE *, char *, char *, uchar *, boolean, + int, const char *); +int parse_config_line(FILE *, char *, int); +STATIC_DCL FILE *fopen_sym_file(void); +STATIC_DCL void set_symhandling(char *, int); #ifdef NOCWD_ASSUMPTIONS -STATIC_DCL void FDECL(adjust_prefix, (char *, int)); +STATIC_DCL void adjust_prefix(char *, int); #endif #ifdef SELF_RECOVER -STATIC_DCL boolean FDECL(copy_bytes, (int, int)); +STATIC_DCL boolean copy_bytes(int, int); #endif #ifdef HOLD_LOCKFILE_OPEN -STATIC_DCL int FDECL(open_levelfile_exclusively, (const char *, int, int)); +STATIC_DCL int open_levelfile_exclusively(const char *, int, int); #endif /* @@ -228,11 +228,7 @@ STATIC_DCL int FDECL(open_levelfile_exclusively, (const char *, int, 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; @@ -276,10 +272,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; @@ -329,10 +322,9 @@ int bufsz; /*ARGSUSED*/ const char * -fqname(basenam, whichprefix, buffnum) -const char *basenam; -int whichprefix UNUSED_if_not_PREFIXES_IN_USE; -int buffnum UNUSED_if_not_PREFIXES_IN_USE; +fqname(const char *basenam, + int whichprefix UNUSED_if_not_PREFIXES_IN_USE, + int buffnum UNUSED_if_not_PREFIXES_IN_USE) { #ifndef PREFIXES_IN_USE return basenam; @@ -357,8 +349,7 @@ int buffnum UNUSED_if_not_PREFIXES_IN_USE; } int -validate_prefix_locations(reasonbuf) -char *reasonbuf; /* reasonbuf must be at least BUFSZ, supplied by caller */ +validate_prefix_locations(char *reasonbuf) /* reasonbuf must be at least BUFSZ, supplied by caller */ { #if defined(NOCWD_ASSUMPTIONS) FILE *fp; @@ -408,9 +399,7 @@ char *reasonbuf; /* reasonbuf must be at least BUFSZ, supplied by caller */ /* 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; @@ -452,9 +441,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; @@ -469,9 +456,7 @@ int lev; } int -create_levelfile(lev, errbuf) -int lev; -char errbuf[]; +create_levelfile(int lev, char errbuf[]) { int fd; const char *fq_lock; @@ -510,9 +495,7 @@ char errbuf[]; } int -open_levelfile(lev, errbuf) -int lev; -char errbuf[]; +open_levelfile(int lev, char errbuf[]) { int fd; const char *fq_lock; @@ -548,8 +531,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 @@ -585,7 +567,7 @@ clearlocks() (void) signal(SIGINT, SIG_IGN); #endif #if defined(UNIX) || defined(VMS) - sethanguphandler((void FDECL((*), (int) )) SIG_IGN); + sethanguphandler((void ((*)(int) )) SIG_IGN); #endif /* can't access maxledgerno() before dungeons are created -dlc */ for (x = (n_dgns ? maxledgerno() : 0); x >= 0; x--) @@ -597,9 +579,7 @@ clearlocks() #if defined(SELECTSAVED) /* qsort comparison routine */ STATIC_OVL int CFDECLSPEC -strcmp_wrap(p, q) -const void *p; -const void *q; +strcmp_wrap(const void *p, const void *q) { #if defined(UNIX) && defined(QT_GRAPHICS) return strncasecmp(*(char **) p, *(char **) q, 16); @@ -611,9 +591,7 @@ const void *q; #ifdef HOLD_LOCKFILE_OPEN STATIC_OVL int -open_levelfile_exclusively(name, lev, oflag) -const char *name; -int lev, oflag; +open_levelfile_exclusively(const char *name, int lev, int oflag) { int reslt, fd; if (!lftrack.init) { @@ -659,8 +637,7 @@ really_close() } int -nhclose(fd) -int fd; +nhclose(int fd) { if (lftrack.fd == fd) { really_close(); /* close it, but reopen it to hold it */ @@ -673,8 +650,7 @@ int fd; #else int -nhclose(fd) -int fd; +nhclose(int fd) { return close(fd); } @@ -688,9 +664,7 @@ int fd; * bonesid to be read/written in the bones file. */ STATIC_OVL char * -set_bonesfile_name(file, lev) -char *file; -d_level *lev; +set_bonesfile_name(char *file, d_level *lev) { s_level *sptr; char *dptr; @@ -730,10 +704,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; @@ -790,8 +761,7 @@ cancel_bonesfile() /* move completed bones file to proper name */ void -commit_bonesfile(lev) -d_level *lev; +commit_bonesfile(d_level *lev) { const char *fq_bones, *tempname; int ret; @@ -816,9 +786,7 @@ d_level *lev; } int -open_bonesfile(lev, bonesid) -d_level *lev; -char **bonesid; +open_bonesfile(d_level *lev, char **bonesid) { const char *fq_bones; int fd; @@ -835,8 +803,7 @@ char **bonesid; } int -delete_bonesfile(lev) -d_level *lev; +delete_bonesfile(d_level *lev) { (void) set_bonesfile_name(bones, lev); return !(unlink(fqname(bones, BONESPREFIX, 0)) < 0); @@ -857,8 +824,7 @@ compress_bonesfile() /* set savefile name in OS-dependent manner from pre-existing plname, * avoiding troublesome characters */ void -set_savefile_name(regularize_it) -boolean regularize_it; +set_savefile_name(boolean regularize_it) { #ifdef VMS Sprintf(SAVEF, "[.save]%d%s", getuid(), plname); @@ -910,8 +876,7 @@ boolean regularize_it; #ifdef INSURANCE void -save_savefile_name(fd) -int fd; +save_savefile_name(int fd) { (void) write(fd, (genericptr_t) SAVEF, sizeof(SAVEF)); } @@ -1023,8 +988,7 @@ restore_saved_game() #if defined(SELECTSAVED) char * -plname_from_file(filename) -const char *filename; +plname_from_file(const char *filename) { int fd; char *result = 0; @@ -1176,8 +1140,7 @@ get_saved_games() } void -free_saved_games(saved) -char **saved; +free_saved_games(char **saved) { if (saved) { int i = 0; @@ -1195,10 +1158,7 @@ char **saved; #ifdef COMPRESS STATIC_OVL void -redirect(filename, mode, stream, uncomp) -const char *filename, *mode; -FILE *stream; -boolean uncomp; +redirect(const char *filename, const char *mode, FILE *stream, boolean uncomp) { if (freopen(filename, mode, stream) == (FILE *) 0) { (void) fprintf(stderr, "freopen of %s for %scompress failed\n", @@ -1215,9 +1175,7 @@ boolean uncomp; * cf. child() in unixunix.c. */ STATIC_OVL void -docompress_file(filename, uncomp) -const char *filename; -boolean uncomp; +docompress_file(const char *filename, boolean uncomp) { char cfn[80]; FILE *cf; @@ -1372,8 +1330,7 @@ boolean uncomp; /* compress file */ void -nh_compress(filename) -const char *filename UNUSED_if_not_COMPRESS; +nh_compress(const char *filename UNUSED_if_not_COMPRESS) { #if !defined(COMPRESS) && !defined(ZLIB_COMP) #ifdef PRAGMA_UNUSED @@ -1386,8 +1343,7 @@ const char *filename UNUSED_if_not_COMPRESS; /* uncompress file if it exists */ void -nh_uncompress(filename) -const char *filename UNUSED_if_not_COMPRESS; +nh_uncompress(const char *filename UNUSED_if_not_COMPRESS) { #if !defined(COMPRESS) && !defined(ZLIB_COMP) #ifdef PRAGMA_UNUSED @@ -1400,9 +1356,7 @@ const char *filename UNUSED_if_not_COMPRESS; #ifdef ZLIB_COMP /* RLC 09 Mar 1999: Support internal ZLIB */ STATIC_OVL boolean -make_compressed_name(filename, cfn) -const char *filename; -char *cfn; +make_compressed_name(const char *filename, char *cfn) { #ifndef SHORT_FILENAMES /* Assume free-form filename with no 8.3 restrictions */ @@ -1433,9 +1387,7 @@ char *cfn; } STATIC_OVL void -docompress_file(filename, uncomp) -const char *filename; -boolean uncomp; +docompress_file(const char *filename, boolean uncomp) { gzFile compressedfile; FILE *uncompressedfile; @@ -1575,9 +1527,7 @@ struct flock sflock; /* for unlocking, same as above */ #ifndef USE_FCNTL STATIC_OVL char * -make_lockname(filename, lockname) -const char *filename; -char *lockname; +make_lockname(const char *filename, char *lockname) { #if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(WIN32) \ || defined(MSDOS) @@ -1611,10 +1561,7 @@ char *lockname; /* lock a file */ boolean -lock_file(filename, whichprefix, retryct) -const char *filename; -int whichprefix; -int retryct; +lock_file(const char *filename, int whichprefix, int retryct) { #if defined(PRAGMA_UNUSED) && !(defined(UNIX) || defined(VMS)) \ && !(defined(AMIGA) || defined(WIN32) || defined(MSDOS)) @@ -1775,8 +1722,7 @@ int retryct; /* unlock file, which must be currently locked by lock_file */ void -unlock_file(filename) -const char *filename; +unlock_file(const char *filename) { #ifndef USE_FCNTL char locknambuf[BUFSZ]; @@ -1855,9 +1801,7 @@ const char *backward_compat_configfile = "nethack.cnf"; #endif STATIC_OVL FILE * -fopen_config_file(filename, src) -const char *filename; -int src; +fopen_config_file(const char *filename, int src) { FILE *fp; #if defined(UNIX) || defined(VMS) @@ -1998,14 +1942,13 @@ int src; * location is unchanged. Callers must handle zeros if modlist is FALSE. */ STATIC_OVL 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; @@ -2067,9 +2010,7 @@ const char *name; /* name of option for error message */ #ifdef NOCWD_ASSUMPTIONS STATIC_OVL void -adjust_prefix(bufp, prefixid) -char *bufp; -int prefixid; +adjust_prefix(char *bufp, int prefixid) { char *ptr; @@ -2089,10 +2030,7 @@ int prefixid; #define match_varname(INP, NAM, LEN) match_optname(INP, NAM, LEN, TRUE) int -parse_config_line(fp, origbuf, src) -FILE *fp; -char *origbuf; -int src; +parse_config_line(FILE *fp, char *origbuf, int src) { #if defined(MICRO) && !defined(NOCWD_ASSUMPTIONS) static boolean ramdisk_specified = FALSE; @@ -2551,17 +2489,14 @@ int src; #ifdef USER_SOUNDS boolean -can_read_file(filename) -const char *filename; +can_read_file(const char *filename) { return (boolean) (access(filename, 4) == 0); } #endif /* USER_SOUNDS */ boolean -read_config_file(filename, src) -const char *filename; -int src; +read_config_file(const char *filename, int src) { char buf[4 * BUFSZ], *p; FILE *fp; @@ -2675,8 +2610,7 @@ fopen_wizkit_file() /* add to hero's inventory if there's room, otherwise put item on floor */ STATIC_DCL void -wizkit_addinv(obj) -struct obj *obj; +wizkit_addinv(struct obj *obj) { if (!obj || obj == &zeroobj) return; @@ -2765,8 +2699,7 @@ fopen_sym_file() * 0 if it wasn't found in the sym file or other problem. */ int -read_sym_file(which_set) -int which_set; +read_sym_file(int which_set) { char buf[4 * BUFSZ]; FILE *fp; @@ -2796,9 +2729,7 @@ int which_set; /* returns 0 on error */ int -parse_sym_line(buf, which_set) -char *buf; -int which_set; +parse_sym_line(char *buf, int which_set) { int val, i; struct symparse *symp = (struct symparse *) 0; @@ -2985,9 +2916,7 @@ int which_set; } STATIC_OVL void -set_symhandling(handling, which_set) -char *handling; -int which_set; +set_symhandling(char *handling, int which_set) { int i = 0; @@ -3014,8 +2943,7 @@ int which_set; /* verify that we can write to scoreboard file; if not, try to create one */ /*ARGUSED*/ void -check_recordfile(dir) -const char *dir UNUSED_if_not_OS2_CODEVIEW; +check_recordfile(const char *dir UNUSED_if_not_OS2_CODEVIEW) { #if defined(PRAGMA_UNUSED) && !defined(OS2_CODEVIEW) #pragma unused(dir) @@ -3101,9 +3029,8 @@ const char *dir UNUSED_if_not_OS2_CODEVIEW; /*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; @@ -3311,8 +3238,7 @@ recover_savefile() } boolean -copy_bytes(ifd, ofd) -int ifd, ofd; +copy_bytes(int ifd, int ofd) { char buf[BUFSIZ]; int nfrom, nto; @@ -3373,9 +3299,7 @@ assure_syscf_file() * like dungeon.c and questpgr.c, which generate a ridiculous amount of * output if DEBUG is defined and effectively block the use of a wildcard */ boolean -debugcore(filename, wildcards) -const char *filename; -boolean wildcards; +debugcore(const char *filename, boolean wildcards) { const char *debugfiles, *p; @@ -3449,14 +3373,13 @@ boolean wildcards; #define MAXPASSAGES SIZE(context.novel.pasg) /* 30 */ -static int FDECL(choose_passage, (int, unsigned)); +static int choose_passage(int, unsigned); /* choose a random passage that hasn't been chosen yet; once all have been chosen, reset the tracking to make all passages available again */ static int -choose_passage(passagecnt, oid) -int passagecnt; /* total of available passages, 1..MAXPASSAGES */ -unsigned oid; /* book.o_id, used to determine whether re-reading same book */ +choose_passage(int passagecnt, /* total of available passages, 1..MAXPASSAGES */ + unsigned oid) /* book.o_id, used to determine whether re-reading same book */ { int idx, res; @@ -3485,11 +3408,9 @@ unsigned oid; /* book.o_id, used to determine whether re-reading same book */ /* Returns True if you were able to read something. */ boolean -read_tribute(tribsection, tribtitle, tribpassage, nowin_buf, bufsz, oid) -const char *tribsection, *tribtitle; -int tribpassage, bufsz; -char *nowin_buf; -unsigned oid; /* book identifier */ +read_tribute(const char *tribsection, const char *tribtitle, int tribpassage, + char *nowin_buf, int bufsz, + unsigned oid) /* book identifier */ { dlb *fp; char *endp; @@ -3656,9 +3577,7 @@ unsigned oid; /* book identifier */ } boolean -Death_quote(buf, bufsz) -char *buf; -int bufsz; +Death_quote(char *buf, int bufsz) { unsigned death_oid = 1; /* chance of oid #1 being a novel is negligible */ diff --git a/src/fountain.c b/src/fountain.c index 71c9467961..38175a71fc 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -6,17 +6,16 @@ #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_DCL void dowatersnakes(void); +STATIC_DCL void dowaterdemon(void); +STATIC_DCL void dowaternymph(void); +STATIC_PTR void gush(int, int, genericptr_t); +STATIC_DCL 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."; @@ -103,8 +102,7 @@ dowaternymph() /* Gushing forth along LOS from (u.ux, u.uy) */ void -dogushforth(drinking) -int drinking; +dogushforth(int drinking) { int madepool = 0; @@ -118,9 +116,7 @@ int drinking; } STATIC_PTR 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; @@ -164,9 +160,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))) { @@ -347,8 +341,7 @@ drinkfountain() } void -dipfountain(obj) -register struct obj *obj; +dipfountain(register struct obj *obj) { if (Levitation) { floating_above("fountain"); @@ -490,8 +483,7 @@ register struct obj *obj; } 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!"); diff --git a/src/hack.c b/src/hack.c index 3e606f6beb..42069703f0 100644 --- a/src/hack.c +++ b/src/hack.c @@ -6,24 +6,23 @@ /* #define DEBUG */ /* uncomment for debugging */ -STATIC_DCL void NDECL(maybe_wail); -STATIC_DCL int NDECL(moverock); -STATIC_DCL int FDECL(still_chewing, (XCHAR_P, XCHAR_P)); -STATIC_DCL void NDECL(dosinkfall); -STATIC_DCL boolean FDECL(findtravelpath, (BOOLEAN_P)); -STATIC_DCL boolean FDECL(trapmove, (int, int, struct trap *)); -STATIC_DCL void NDECL(switch_terrain); -STATIC_DCL struct monst *FDECL(monstinroom, (struct permonst *, int)); -STATIC_DCL boolean FDECL(doorless_door, (int, int)); -STATIC_DCL void FDECL(move_update, (BOOLEAN_P)); +STATIC_DCL void maybe_wail(void); +STATIC_DCL int moverock(void); +STATIC_DCL int still_chewing(xchar, xchar); +STATIC_DCL void dosinkfall(void); +STATIC_DCL boolean findtravelpath(boolean); +STATIC_DCL boolean trapmove(int, int, struct trap *); +STATIC_DCL void switch_terrain(void); +STATIC_DCL struct monst *monstinroom(struct permonst *, int); +STATIC_DCL boolean doorless_door(int, int); +STATIC_DCL void move_update(boolean); #define IS_SHOP(x) (rooms[x].rtype >= SHOPBASE) static anything tmp_anything; anything * -uint_to_any(ui) -unsigned ui; +uint_to_any(unsigned ui) { tmp_anything = zeroany; tmp_anything.a_uint = ui; @@ -31,8 +30,7 @@ unsigned ui; } anything * -long_to_any(lng) -long lng; +long_to_any(long lng) { tmp_anything = zeroany; tmp_anything.a_long = lng; @@ -40,8 +38,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; @@ -49,8 +46,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; @@ -58,9 +54,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; @@ -347,8 +341,7 @@ moverock() * when done. */ STATIC_OVL 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); @@ -495,9 +488,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); @@ -589,8 +580,7 @@ dosinkfall() /* intended to be called only on ROCKs or TREEs */ boolean -may_dig(x, y) -register xchar x, y; +may_dig(register xchar x, register xchar y) { struct rm *lev = &levl[x][y]; @@ -599,17 +589,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) && (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) @@ -622,8 +609,7 @@ register xchar x, y; monster--who might be the hero--can fit through, and if not then return the reason why: 1: can't fit, 2: possessions won't fit, 3: sokoban */ int /* returns 0 if we can squeeze through */ - cant_squeeze_thru(mon) -struct monst *mon; + cant_squeeze_thru(struct monst *mon) { int amt; struct permonst *ptr = mon->data; @@ -649,8 +635,7 @@ 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); @@ -660,9 +645,7 @@ xchar x, y; * mode is one of DO_MOVE, TEST_MOVE or TEST_TRAV */ 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; @@ -858,8 +841,7 @@ int wiz_debug_cmd_traveldisplay() * Returns TRUE if a path was found. */ STATIC_OVL boolean -findtravelpath(guess) -boolean guess; +findtravelpath(boolean guess) { /* if travel to adjacent, reachable location, use normal movement rules */ if (!guess && context.travel1 && distmin(u.ux, u.uy, u.tx, u.ty) == 1 @@ -1054,9 +1036,8 @@ boolean guess; return true iff moving should continue to intended destination (all failures and most successful escapes leave hero at original spot) */ STATIC_OVL 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; const char *predicament, *culprit; @@ -1798,8 +1779,7 @@ switch_terrain() 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) { @@ -1873,8 +1853,7 @@ boolean newspot; /* true if called by spoteffects */ } void -spoteffects(pick) -boolean pick; +spoteffects(boolean pick) { static int inspoteffects = 0; static coord spotloc; @@ -2017,9 +1996,7 @@ boolean pick; /* returns first matching monster */ STATIC_OVL struct monst * -monstinroom(mdat, roomno) -struct permonst *mdat; -int roomno; +monstinroom(struct permonst *mdat, int roomno) { register struct monst *mtmp; @@ -2034,9 +2011,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]; @@ -2102,8 +2077,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; @@ -2128,8 +2102,7 @@ register int x, y; } STATIC_OVL void -move_update(newlev) -register boolean newlev; +move_update(register boolean newlev) { char *ptr1, *ptr2, *ptr3, *ptr4; @@ -2168,8 +2141,7 @@ register boolean newlev; } void -check_special_room(newlev) -register boolean newlev; +check_special_room(register boolean newlev) { register struct monst *mtmp; char *ptr; @@ -2513,8 +2485,7 @@ lookaround() /* check for a doorway which lacks its door (NODOOR or BROKEN) */ STATIC_OVL boolean -doorless_door(x, y) -int x, y; +doorless_door(int x, int y) { struct rm *lev_p = &levl[x][y]; @@ -2529,8 +2500,7 @@ int x, y; /* 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)) @@ -2581,8 +2551,7 @@ monster_nearby() } void -nomul(nval) -register int nval; +nomul(register int nval) { if (multi < nval) return; /* This is a bug fix by ab@unido */ @@ -2596,8 +2565,7 @@ register int nval; /* 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 */ if (msg_override) @@ -2649,10 +2617,7 @@ maybe_wail() } void -losehp(n, knam, k_format) -register int n; -register const char *knam; -boolean k_format; +losehp(register int n, register const char *knam, boolean k_format) { if (Upolyd) { u.mh -= n; @@ -2743,8 +2708,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; @@ -2771,8 +2735,7 @@ max_capacity() } boolean -check_capacity(str) -const char *str; +check_capacity(const char *str) { if (near_capacity() >= EXT_ENCUMBER) { if (str) @@ -2785,8 +2748,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; @@ -2804,8 +2766,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) { /* Must change when silver & copper is implemented: */ diff --git a/src/hacklib.c b/src/hacklib.c index a590968d9c..2288e6e7c0 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -64,45 +64,40 @@ #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, 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; @@ -114,8 +109,7 @@ char *s; /* convert a string into all uppercase */ char * -ucase(s) -char *s; +ucase(char *s) { register char *p; @@ -127,8 +121,7 @@ char *s; /* convert first character of a string to uppercase */ char * -upstart(s) -char *s; +upstart(char *s) { if (s) *s = highc(*s); @@ -137,8 +130,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; @@ -160,8 +152,7 @@ char *bp; /* 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); */ @@ -182,9 +173,7 @@ const char *str, *chkstr; /* 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); @@ -195,10 +184,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 @@ -212,8 +198,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; @@ -235,9 +220,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; @@ -259,8 +242,7 @@ const char *src; /* return a name converted to possessive */ char * -s_suffix(s) -const char *s; +s_suffix(const char *s) { Static char buf[BUFSZ]; @@ -278,8 +260,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) { const char *vowel = "aeiouy"; static char buf[BUFSZ]; @@ -313,9 +294,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; @@ -334,8 +313,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') @@ -345,8 +323,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; @@ -370,8 +347,7 @@ char *sbuf; /* make a displayable string from a character */ char * -visctrl(c) -char c; +visctrl(char c) { Static char ccc[3]; @@ -393,9 +369,7 @@ char c; /* 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]; @@ -412,8 +386,7 @@ const char *orig, *replacement; /* 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; @@ -423,8 +396,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]; @@ -434,17 +406,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 x, int y) { int r, m; int divsgn = 1; @@ -469,8 +438,7 @@ int y; /* distance between two points, in moves */ int -distmin(x0, y0, x1, y1) -int x0, y0, x1, y1; +distmin(int x0, int y0, int x1, int y1) { register int dx = x0 - x1, dy = y0 - y1; @@ -486,8 +454,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; @@ -496,8 +463,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; @@ -519,8 +485,7 @@ int val; /* 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, @@ -532,10 +497,9 @@ 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; /* @@ -572,24 +536,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-_"; @@ -600,9 +561,10 @@ const char *patrn, *strng; #ifndef STRNCMPI /* case insensitive counted string comparison */ int -strncmpi(s1, s2, n) /*{ aka strncasecmp }*/ -register const char *s1, *s2; -register int n; /*(should probably be size_t, which is unsigned)*/ +strncmpi(register const char *s1, + register const char *s2, + register int n /*(should probably be size_t, which is unsigned)*/ + ) /*{ aka strncasecmp }*/ { register char t1, t2; @@ -623,9 +585,7 @@ register int n; /*(should probably be size_t, which is unsigned)*/ #ifndef STRSTRI /* case insensitive substring search */ char * -strstri(str, sub) -const char *str; -const char *sub; +strstri(const char *str, const char *sub) { register const char *s1, *s2; register int i, k; @@ -670,10 +630,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; @@ -722,9 +679,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_DCL struct tm *NDECL(getlt); +STATIC_DCL struct tm *getlt(void); void setrandom() @@ -792,8 +749,7 @@ getyear() #if 0 /* This routine is no longer used since in 20YY it yields "1YYmmdd". */ char * -yymmdd(date) -time_t date; +yymmdd(time_t date) { Static char datestr[10]; struct tm *lt; @@ -810,8 +766,7 @@ time_t date; #endif long -yyyymmdd(date) -time_t date; +yyyymmdd(time_t date) { long datenum; struct tm *lt; @@ -835,8 +790,7 @@ time_t date; } long -hhmmss(date) -time_t date; +hhmmss(time_t date) { long timenum; struct tm *lt; @@ -851,8 +805,7 @@ time_t date; } char * -yyyymmddhhmmss(date) -time_t date; +yyyymmddhhmmss(time_t date) { long datenum; static char datestr[15]; @@ -880,8 +833,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; diff --git a/src/invent.c b/src/invent.c index 430894aabc..700f2c1449 100644 --- a/src/invent.c +++ b/src/invent.c @@ -7,31 +7,30 @@ #define NOINVSYM '#' #define CONTAINED_SYM '>' /* designator for inside a container */ -STATIC_DCL int FDECL(CFDECLSPEC sortloot_cmp, (struct obj *, struct obj *)); -STATIC_DCL void NDECL(reorder_invent); -STATIC_DCL boolean FDECL(mergable, (struct obj *, struct obj *)); -STATIC_DCL 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(splittable, (struct obj *)); -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_PTR char *FDECL(safeq_xprname, (struct obj *)); -STATIC_PTR char *FDECL(safeq_shortxprname, (struct obj *)); -STATIC_DCL char FDECL(display_pickinv, (const char *, BOOLEAN_P, long *)); -STATIC_DCL char FDECL(display_used_invlets, (CHAR_P)); -STATIC_DCL void FDECL(tally_BUCX, - (struct obj *, int *, int *, int *, int *, int *)); -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 CFDECLSPEC sortloot_cmp(struct obj *, struct obj *); +STATIC_DCL void reorder_invent(void); +STATIC_DCL boolean mergable(struct obj *, struct obj *); +STATIC_DCL void noarmor(boolean); +STATIC_DCL void invdisp_nothing(const char *, const char *); +STATIC_DCL boolean worn_wield_only(struct obj *); +STATIC_DCL boolean only_here(struct obj *); +STATIC_DCL void compactify(char *); +STATIC_DCL boolean splittable(struct obj *); +STATIC_DCL boolean taking_off(const char *); +STATIC_DCL boolean putting_on(const char *); +STATIC_PTR int ckunpaid(struct obj *); +STATIC_PTR int ckvalidcat(struct obj *); +STATIC_PTR char *safeq_xprname(struct obj *); +STATIC_PTR char *safeq_shortxprname(struct obj *); +STATIC_DCL char display_pickinv(const char *, boolean, long *); +STATIC_DCL char display_used_invlets(char); +STATIC_DCL void tally_BUCX(struct obj *, int *, int *, int *, int *, int *); +STATIC_DCL boolean this_type_only(struct obj *); +STATIC_DCL void dounpaid(void); +STATIC_DCL struct obj *find_unpaid(struct obj *, struct obj **); +STATIC_DCL void menu_identify(int); +STATIC_DCL boolean tool_in_use(struct obj *); +STATIC_DCL char obj_to_let(struct obj *); static int lastinvnr = 51; /* 0 ... 51 (never saved&restored) */ @@ -47,9 +46,7 @@ static int lastinvnr = 51; /* 0 ... 51 (never saved&restored) */ static char venom_inv[] = { VENOM_CLASS, 0 }; /* (constant) */ STATIC_OVL int CFDECLSPEC -sortloot_cmp(obj1, obj2) -struct obj *obj1; -struct obj *obj2; +sortloot_cmp(struct obj *obj1, struct obj *obj2) { int val1 = 0; int val2 = 0; @@ -112,18 +109,13 @@ struct obj *obj2; } struct obj ** -objarr_init(n) -int n; +objarr_init(int n) { return (struct obj **) alloc(n * sizeof(struct obj *)); } void -objarr_set(otmp, idx, oarray, dosort) -struct obj *otmp; -int idx; -struct obj **oarray; -boolean dosort; +objarr_set(struct obj *otmp, int idx, struct obj **oarray, boolean dosort) { if (dosort) { int j; @@ -139,8 +131,7 @@ boolean dosort; } void -assigninvlet(otmp) -register struct obj *otmp; +assigninvlet(register struct obj *otmp) { boolean inuse[52]; register int i; @@ -221,8 +212,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; @@ -258,8 +248,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; @@ -359,8 +348,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) { context.botl = 1; @@ -414,8 +402,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 @@ -429,8 +416,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 */ @@ -490,8 +476,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. */ @@ -511,9 +496,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]; @@ -586,8 +569,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); @@ -595,8 +577,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. */ @@ -612,9 +593,8 @@ 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); @@ -631,8 +611,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) { context.botl = 1; @@ -674,8 +653,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); @@ -683,8 +661,7 @@ register struct obj *obj; } void -delallobj(x, y) -int x, y; +delallobj(int x, int y) { struct obj *otmp, *otmp2; @@ -701,8 +678,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; @@ -726,9 +702,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; -int x, y; +sobj_at(int otyp, int x, int y) { register struct obj *otmp; @@ -741,10 +715,7 @@ int 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; @@ -759,8 +730,7 @@ boolean by_nexthere; } struct obj * -carrying(type) -register int type; +carrying(register int type) { register struct obj *otmp; @@ -798,8 +768,7 @@ static const char *const currencies[] = { }; const char * -currency(amount) -long amount; +currency(long amount) { const char *res; @@ -833,9 +802,7 @@ u_have_novel() } 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; @@ -850,9 +817,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; @@ -863,8 +828,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]; @@ -878,8 +842,7 @@ register int x, y; /* compact a string of inventory letters by dashing runs of letters */ STATIC_OVL void -compactify(buf) -register char *buf; +compactify(register char *buf) { register int i1 = 1, i2 = 1; register char ilet, ilet1, ilet2; @@ -916,8 +879,7 @@ register char *buf; /* some objects shouldn't be split when count given to getobj or askchain */ STATIC_OVL boolean -splittable(obj) -struct obj *obj; +splittable(struct obj *obj) { return !((obj->otyp == LOADSTONE && obj->cursed) || (obj == uwep && welded(uwep))); @@ -925,16 +887,14 @@ struct obj *obj; /* match the prompt for either 'T' or 'R' command */ STATIC_OVL 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_OVL boolean -putting_on(action) -const char *action; +putting_on(const char *action) { return !strcmp(action, "wear") || !strcmp(action, "put on"); } @@ -948,8 +908,7 @@ const char *action; !!!! 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) { register struct obj *otmp; register char ilet; @@ -1320,9 +1279,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); @@ -1359,16 +1316,14 @@ struct obj *otmp; } STATIC_PTR int -ckvalidcat(otmp) -struct obj *otmp; +ckvalidcat(struct obj *otmp) { /* use allow_category() from pickup.c */ return (int) allow_category(otmp); } STATIC_PTR int -ckunpaid(otmp) -struct obj *otmp; +ckunpaid(struct obj *otmp) { return (otmp->unpaid || (Has_contents(otmp) && count_unpaid(otmp->cobj))); } @@ -1381,8 +1336,7 @@ wearing_armor() } boolean -is_worn(otmp) -struct obj *otmp; +is_worn(struct obj *otmp) { return (otmp->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE | W_WEAPON)) ? TRUE @@ -1406,8 +1360,7 @@ struct obj *obj; /* alternate safe_qbuf() -> short_oname() callback */ STATIC_PTR 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); @@ -1421,14 +1374,14 @@ static NEARDATA const char removeables[] = { ARMOR_CLASS, WEAPON_CLASS, /* 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 FDECL((*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; +ggetobj(const char *word, + int (*fn)(OBJ_P), + int mx, + boolean combo, /* combination menu flag */ + unsigned *resultflags) +{ + 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; @@ -1600,11 +1553,13 @@ unsigned *resultflags; * objects to be treated. Return the number of objects treated. */ int -askchain(objchn, olets, allflag, fn, ckfn, mx, word) -struct obj **objchn; -register int allflag, mx; -register const char *olets, *word; /* olets is an Obj Class char array */ -register int FDECL((*fn), (OBJ_P)), FDECL((*ckfn), (OBJ_P)); +askchain(struct obj **objchn, + register const char *olets, /* olets is an Obj Class char array */ + register int allflag, + register int (*fn)(OBJ_P), + register int (*ckfn)(OBJ_P), + register int mx, + register const char *word) /* olets is an Obj Class char array */ { struct obj *otmp, *otmpo; register char sym, ilet; @@ -1738,8 +1693,7 @@ register int FDECL((*fn), (OBJ_P)), FDECL((*ckfn), (OBJ_P)); /* 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) @@ -1753,8 +1707,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); @@ -1763,8 +1716,7 @@ struct obj *otmp; /* menu of unidentified objects; select and identify up to id_limit of them */ STATIC_OVL void -menu_identify(id_limit) -int id_limit; +menu_identify(int id_limit) { menu_item *pick_list; int n, i, first = 1, tryct = 5; @@ -1802,9 +1754,8 @@ 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; /* true if we just read unknown identify scroll */ +identify_pack(int id_limit, + boolean learning_id) /* true if we just read unknown identify scroll */ { struct obj *obj, *the_obj; int n, unid_cnt; @@ -1870,8 +1821,7 @@ learn_unseen_invent() /* should of course only be called for things in invent */ STATIC_OVL char -obj_to_let(obj) -struct obj *obj; +obj_to_let(struct obj *obj) { if (!flags.invlet_constant) { obj->invlet = NOINVSYM; @@ -1885,10 +1835,7 @@ 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 quan) { if (!prefix) prefix = ""; @@ -1897,13 +1844,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]; @@ -1957,8 +1903,7 @@ ddoinv() * containers. */ STATIC_OVL struct obj * -find_unpaid(list, last_found) -struct obj *list, **last_found; +find_unpaid(struct obj *list, struct obj **last_found) { struct obj *obj; @@ -2000,10 +1945,7 @@ free_pickinv_cache() * any count returned from the menu selection is placed here. */ STATIC_OVL char -display_pickinv(lets, want_reply, out_cnt) -register const char *lets; -boolean want_reply; -long *out_cnt; +display_pickinv(register const char *lets, boolean want_reply, long *out_cnt) { struct obj *otmp; char ilet, ret; @@ -2139,9 +2081,7 @@ long *out_cnt; * 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, want_reply, (long *) 0); } @@ -2151,8 +2091,7 @@ boolean want_reply; * */ STATIC_OVL char -display_used_invlets(avoidlet) -char avoidlet; +display_used_invlets(char avoidlet) { struct obj *otmp; char ilet, ret = 0; @@ -2208,8 +2147,7 @@ char avoidlet; * contained objects. */ int -count_unpaid(list) -struct obj *list; +count_unpaid(struct obj *list) { int count = 0; @@ -2231,9 +2169,7 @@ struct obj *list; * at some point: bknown is forced for priest[ess], like in xname(). */ int -count_buc(list, type) -struct obj *list; -int type; +count_buc(struct obj *list, int type) { int count = 0; @@ -2259,9 +2195,7 @@ int type; /* similar to count_buc(), but tallies all states at once rather than looking for a specific type */ STATIC_OVL void -tally_BUCX(list, bcp, ucp, ccp, xcp, ocp) -struct obj *list; -int *bcp, *ucp, *ccp, *xcp, *ocp; +tally_BUCX(struct obj *list, int *bcp, int *ucp, int *ccp, int *xcp, int *ocp) { *bcp = *ucp = *ccp = *xcp = *ocp = 0; for (; list; list = list->nobj) { @@ -2285,11 +2219,10 @@ int *bcp, *ucp, *ccp, *xcp, *ocp; } long -count_contents(container, nested, quantity, everything) -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 */ +count_contents(struct obj *container, + boolean nested, /* include contents of any nested containers */ + boolean quantity, /* count all vs count separate stacks */ + boolean everything) /* all objects vs only unpaid objects */ { struct obj *otmp; long count = 0L; @@ -2404,8 +2337,7 @@ dounpaid() static int this_type; STATIC_OVL boolean -this_type_only(obj) -struct obj *obj; +this_type_only(struct obj *obj) { boolean res = (obj->oclass == this_type); @@ -2479,7 +2411,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++] = ' '; if (unpaid_count) @@ -2596,9 +2528,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; @@ -2675,9 +2605,8 @@ char *buf; /* look at what is here; if there are many objects (pile_limit 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 progress */ -boolean picked_some; +look_here(int obj_cnt,/* obj_cnt > 0 implies that autopickup is in progress */ + boolean picked_some) { struct obj *otmp; struct trap *trap; @@ -2839,9 +2768,7 @@ dolook() } 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]))) @@ -2850,9 +2777,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]; @@ -2873,8 +2798,7 @@ boolean force_touch; } void -stackobj(obj) -struct obj *obj; +stackobj(struct obj *obj) { struct obj *otmp; @@ -2886,8 +2810,7 @@ struct obj *obj; /* returns TRUE if obj & otmp can be merged */ STATIC_OVL boolean -mergable(otmp, obj) -register struct obj *otmp, *obj; +mergable(register struct obj *otmp, register struct obj *obj) { int objnamelth = 0, otmpnamelth = 0; if (obj == otmp) @@ -2997,8 +2920,7 @@ doprwep() /* caller is responsible for checking !wearing_armor() */ STATIC_OVL void -noarmor(report_uskin) -boolean report_uskin; +noarmor(boolean report_uskin) { if (!uskin || !report_uskin) { You("are not wearing any armor."); @@ -3086,8 +3008,7 @@ dopramulet() } STATIC_OVL boolean -tool_in_use(obj) -struct obj *obj; +tool_in_use(struct obj *obj) { if ((obj->owornmask & (W_TOOL | W_SADDLE)) != 0L) return TRUE; @@ -3140,9 +3061,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 numused) { register struct obj *otmp; boolean at_u = (obj->ox == u.ux && obj->oy == u.uy); @@ -3182,9 +3101,7 @@ static NEARDATA char *invbuf = (char *) 0; static NEARDATA unsigned invbufsiz = 0; char * -let_to_name(let, unpaid, showsym) -char let; -boolean unpaid, showsym; +let_to_name(char let, boolean unpaid, boolean showsym) { const char *ocsymfmt = " ('%c')"; const int invbuf_sympadding = 8; /* arbitrary */ @@ -3479,8 +3396,7 @@ doorganize() /* inventory organizer by Del Lamb */ /* common to display_minventory and display_cinventory */ STATIC_OVL void -invdisp_nothing(hdr, txt) -const char *hdr, *txt; +invdisp_nothing(const char *hdr, const char *txt) { winid win; anything any; @@ -3502,8 +3418,7 @@ const char *hdr, *txt; /* query_objlist callback: return things that are worn or wielded */ STATIC_OVL boolean -worn_wield_only(obj) -struct obj *obj; +worn_wield_only(struct obj *obj) { #if 1 /* check for things that *are* worn or wielded (only used for monsters, @@ -3533,10 +3448,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]; @@ -3580,8 +3492,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 qbuf[QBUFSZ]; @@ -3611,8 +3522,7 @@ register struct obj *obj; static coord only; STATIC_OVL boolean -only_here(obj) -struct obj *obj; +only_here(struct obj *obj) { return (obj->ox == only.x && obj->oy == only.y); } @@ -3624,9 +3534,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; diff --git a/src/light.c b/src/light.c index 469987cb24..2357fdd197 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_DCL void write_ls(int, light_source *); +STATIC_DCL int maybe_write_ls(int, int, boolean); /* imported from vision.c, for small circles */ extern char circle_data[]; @@ -53,10 +53,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; @@ -84,9 +81,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; @@ -128,8 +123,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; @@ -214,9 +208,7 @@ char **cs_rows; #define mon_is_local(mon) ((mon)->mx > 0) struct monst * -find_mid(nid, fmflags) -unsigned nid; -unsigned fmflags; +find_mid(unsigned nid, unsigned fmflags) { struct monst *mtmp; @@ -239,8 +231,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; @@ -289,8 +280,7 @@ int fd, mode, range; * pointers. */ void -restore_light_sources(fd) -int fd; +restore_light_sources(int fd) { int count; light_source *ls; @@ -308,8 +298,7 @@ int fd; /* Relink all lights that are so marked. */ void -relink_light_sources(ghostly) -boolean ghostly; +relink_light_sources(boolean ghostly) { char which; unsigned nid; @@ -347,9 +336,7 @@ boolean ghostly; * the light source out. */ STATIC_OVL 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; @@ -412,9 +399,7 @@ light_sources_sanity_check() /* Write a light source structure to disk. */ STATIC_OVL void -write_ls(fd, ls) -int fd; -light_source *ls; +write_ls(int fd, light_source *ls) { anything arg_save; struct obj *otmp; @@ -453,8 +438,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; @@ -477,8 +461,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; @@ -512,8 +495,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); @@ -521,8 +503,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 (boolean) (obj->lamplit && (obj->otyp == MAGIC_LAMP || ignitable(obj) @@ -531,8 +512,7 @@ struct obj *obj; /* copy the light source(s) attached 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; @@ -561,8 +541,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; @@ -580,9 +559,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; @@ -599,8 +576,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; @@ -639,8 +615,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 @@ -661,8 +636,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: diff --git a/src/lock.c b/src/lock.c index 16f1c63b14..e5de21fd5f 100644 --- a/src/lock.c +++ b/src/lock.c @@ -4,8 +4,8 @@ #include "hack.h" -STATIC_PTR int NDECL(picklock); -STATIC_PTR int NDECL(forcelock); +STATIC_PTR int picklock(void); +STATIC_PTR int forcelock(void); /* at most one of `door' and `box' should be non-null at any given time */ STATIC_VAR NEARDATA struct xlock_s { @@ -15,13 +15,12 @@ STATIC_VAR NEARDATA struct xlock_s { chance, usedtime; } xlock; -STATIC_DCL const char *NDECL(lock_action); -STATIC_DCL boolean FDECL(obstructed, (int, int, BOOLEAN_P)); -STATIC_DCL void FDECL(chest_shatter_msg, (struct obj *)); +STATIC_DCL const char *lock_action(void); +STATIC_DCL boolean obstructed(int, int, boolean); +STATIC_DCL 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; @@ -34,8 +33,7 @@ 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]); } @@ -128,9 +126,7 @@ picklock(VOID_ARGS) } 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 */ struct obj *hide_contents = box->cobj; @@ -238,8 +234,7 @@ reset_pick() /* player is applying a key, lock pick, or credit card */ int -pick_lock(pick) -struct obj *pick; +pick_lock(struct obj *pick) { int picktyp, c, ch; coord cc; @@ -534,8 +529,7 @@ doforce() } boolean -stumble_on_door_mimic(x, y) -int x, y; +stumble_on_door_mimic(int x, int y) { struct monst *mtmp; @@ -556,8 +550,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) { coord cc; register struct rm *door; @@ -661,9 +654,7 @@ int x, y; } STATIC_OVL boolean -obstructed(x, y, quietly) -register int x, y; -boolean quietly; +obstructed(register int x, register int y, boolean quietly) { register struct monst *mtmp = m_at(x, y); @@ -794,8 +785,8 @@ 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, /* obj *is* a box */ + struct obj *otmp) { boolean res = 0; @@ -840,9 +831,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; @@ -993,8 +982,7 @@ int x, y; } STATIC_OVL void -chest_shatter_msg(otmp) -struct obj *otmp; +chest_shatter_msg(struct obj *otmp) { const char *disposition; const char *thing; diff --git a/src/mail.c b/src/mail.c index 0a38f148b7..cec7e4a98e 100644 --- a/src/mail.c +++ b/src/mail.c @@ -32,10 +32,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_DCL boolean md_start(coord *); +STATIC_DCL boolean md_stop(coord *, coord *); +STATIC_DCL boolean md_rush(struct monst *, int, int); +STATIC_DCL void newmail(struct mail_info *); extern char *viz_rmin, *viz_rmax; /* line-of-sight limits (vision.c) */ @@ -51,9 +51,9 @@ int mustgetmail = -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 @@ -119,8 +119,7 @@ getmailstatus() * from newmail() and newphone(). */ STATIC_OVL boolean -md_start(startp) -coord *startp; +md_start(coord *startp) { coord testcc; /* scratch coordinates */ int row; /* current row we are checking */ @@ -219,9 +218,8 @@ coord *startp; * its point randomly, which is not what we want. */ STATIC_OVL 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; @@ -260,9 +258,8 @@ static NEARDATA const char *mail_text[] = { "Gangway!", "Look out!", * TRUE otherwise. */ STATIC_OVL boolean -md_rush(md, tx, ty) -struct monst *md; -register int tx, ty; /* destination of mail daemon */ +md_rush(struct monst *md, + register int tx, register int ty) /* destination of mail daemon */ { struct monst *mon; /* displaced monster */ register int dx, dy; /* direction counters */ @@ -359,8 +356,7 @@ register int tx, ty; /* destination of mail daemon */ /* Deliver a scroll of mail. */ /*ARGSUSED*/ STATIC_OVL void -newmail(info) -struct mail_info *info; +newmail(struct mail_info *info) { struct monst *md; coord start, stop; @@ -428,8 +424,7 @@ ckmailstatus() /*ARGSUSED*/ void -readmail(otmp) -struct obj *otmp; +readmail(struct obj *otmp) { static char *junk[] = { NULL, /* placeholder for "Report bugs to .", */ @@ -501,8 +496,7 @@ ckmailstatus() /*ARGSUSED*/ void -readmail(otmp) -struct obj *otmp; +readmail(struct obj *otmp) { #ifdef DEF_MAILREADER /* This implies that UNIX is defined */ register const char *mr = 0; @@ -530,7 +524,7 @@ struct obj *otmp; #ifdef VMS -extern NDECL(struct mail_info *parse_next_broadcast); +extern struct mail_info *parse_next_broadcast(void); volatile int broadcasts = 0; @@ -552,8 +546,7 @@ ckmailstatus() } void -readmail(otmp) -struct obj *otmp; +readmail(struct obj *otmp) { #ifdef SHELL /* can't access mail reader without spawning subprocess */ const char *txt, *cmd; diff --git a/src/makemon.c b/src/makemon.c index 102379e4aa..0532d8ebac 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -15,15 +15,15 @@ STATIC_VAR NEARDATA struct monst zeromonst; (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_DCL void FDECL(m_initgrp, (struct monst *, 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_initinv, (struct monst *)); -STATIC_DCL boolean FDECL(makemon_rnd_goodpos, (struct monst *, unsigned, coord *)); +STATIC_DCL boolean uncommon(int); +STATIC_DCL int align_shift(struct permonst *); +STATIC_DCL boolean mk_gen_ok(int, int, int); +STATIC_DCL boolean wrong_elem_type(struct permonst *); +STATIC_DCL void m_initgrp(struct monst *, int, int, int); +STATIC_DCL void m_initthrow(struct monst *, int, int); +STATIC_DCL void m_initweap(struct monst *); +STATIC_DCL void m_initinv(struct monst *); +STATIC_DCL boolean makemon_rnd_goodpos(struct monst *, unsigned, coord *); extern const int monstr[]; @@ -33,8 +33,7 @@ extern const int monstr[]; #define tooweak(monindx, lev) (monstr[monindx] < lev) boolean -is_home_elemental(ptr) -struct permonst *ptr; +is_home_elemental(struct permonst *ptr) { if (ptr->mlet == S_ELEMENTAL) switch (monsndx(ptr)) { @@ -54,8 +53,7 @@ struct permonst *ptr; * Return true if the given monster cannot exist on this elemental level. */ STATIC_OVL 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); @@ -78,9 +76,7 @@ struct permonst *ptr; /* make a group just like mtmp */ STATIC_OVL void -m_initgrp(mtmp, x, y, n) -register struct monst *mtmp; -register int x, y, n; +m_initgrp(register struct monst *mtmp, register int x, register int y, register int n) { coord mm; register int cnt = rnd(n); @@ -147,9 +143,7 @@ register int x, y, n; STATIC_OVL 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; @@ -162,8 +156,7 @@ int otyp, oquan; } STATIC_OVL 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); @@ -513,9 +506,7 @@ register struct monst *mtmp; * This will change with silver & copper coins */ void -mkmonmoney(mtmp, amount) -struct monst *mtmp; -long amount; +mkmonmoney(struct monst *mtmp, long amount) { struct obj *gold = mksobj(GOLD_PIECE, FALSE, FALSE); @@ -524,8 +515,7 @@ long amount; } STATIC_OVL void -m_initinv(mtmp) -register struct monst *mtmp; +m_initinv(register struct monst *mtmp) { register int cnt; register struct obj *otmp; @@ -726,9 +716,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; @@ -837,10 +826,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); @@ -869,8 +855,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 */ @@ -896,9 +881,7 @@ struct monst *mon; /* set up a new monster's initial level and hit points; used by newcham() as well as by makemon() */ void -newmonhp(mon, mndx) -struct monst *mon; -int mndx; +newmonhp(struct monst *mon, int mndx) { struct permonst *ptr = &mons[mndx]; @@ -947,10 +930,7 @@ newmextra() } boolean -makemon_rnd_goodpos(mon, gpflags, cc) -struct monst *mon; -unsigned gpflags; -coord *cc; +makemon_rnd_goodpos(struct monst *mon, unsigned gpflags, coord *cc) { int tryct = 0; int nx,ny; @@ -1019,10 +999,7 @@ coord *cc; * 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; -int mmflags; +makemon(register struct permonst *ptr, register int x, register int y, int mmflags) { register struct monst *mtmp; int mndx, mcham, ct, mitem; @@ -1332,10 +1309,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, neverask) -int cnt; -struct permonst *mptr; /* usually null; used for confused reading */ -boolean neverask; +create_critters(int cnt, + struct permonst *mptr, /* usually null; used for confused reading */ + boolean neverask) { coord c; int x, y; @@ -1365,8 +1341,7 @@ boolean neverask; } STATIC_OVL boolean -uncommon(mndx) -int mndx; +uncommon(int mndx) { if (mons[mndx].geno & (G_NOGEN | G_UNIQ)) return TRUE; @@ -1384,8 +1359,7 @@ int mndx; * return an integer in the range of 0-5. */ STATIC_OVL 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; @@ -1505,8 +1479,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) { @@ -1519,8 +1492,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 -mk_gen_ok(mndx, mvflagsmask, genomask) -int mndx, mvflagsmask, genomask; +mk_gen_ok(int mndx, int mvflagsmask, int genomask) { struct permonst *ptr = &mons[mndx]; @@ -1544,9 +1516,7 @@ int mndx, mvflagsmask, genomask; * Returns Null if no monsters in that class can be made. */ struct permonst * -mkclass(class, spc) -char class; -int spc; +mkclass(char class, int spc) { register int first, last, num = 0; int maxmlev, mask = (G_NOGEN | G_UNIQ) & ~spc; @@ -1599,8 +1569,7 @@ int spc; 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; @@ -1626,8 +1595,7 @@ int class; /* adjust strength of monsters based on u.uz and u.ulevel */ int -adj_lev(ptr) -register struct permonst *ptr; +adj_lev(register struct permonst *ptr) { int tmp, tmp2; @@ -1662,8 +1630,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; struct permonst *ptr = mtmp->data; @@ -1761,9 +1728,7 @@ struct monst *mtmp, *victim; } int -mongets(mtmp, otyp) -register struct monst *mtmp; -int otyp; +mongets(register struct monst *mtmp, int otyp) { register struct obj *otmp; int spe; @@ -1814,8 +1779,7 @@ int otyp; } int -golemhp(type) -int type; +golemhp(int type) { switch (type) { case PM_STRAW_GOLEM: @@ -1850,8 +1814,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; @@ -1902,8 +1865,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; @@ -1952,8 +1914,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(); @@ -1962,8 +1923,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; @@ -1977,8 +1937,7 @@ static NEARDATA char syms[] = { }; void -set_mimic_sym(mtmp) -register struct monst *mtmp; +set_mimic_sym(register struct monst *mtmp) { int typ, roomno, rt; unsigned appear, ap_type; @@ -2095,10 +2054,9 @@ register struct monst *mtmp; /* release monster from bag of tricks; return number of monsters created */ int -bagotricks(bag, tipping, seencount) -struct obj *bag; -boolean tipping; /* caller emptying entire contents; affects shop handling */ -int *seencount; /* secondary output */ +bagotricks(struct obj *bag, + boolean tipping, /* caller emptying entire contents; affects shop handling */ + int *seencount) /* secondary output */ { int moncount = 0; diff --git a/src/mapglyph.c b/src/mapglyph.c index a8f5638674..871f2ad2c0 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -56,10 +56,7 @@ static int explcolors[] = { /*ARGSUSED*/ int -mapglyph(glyph, ochar, ocolor, ospecial, x, y) -int glyph, *ocolor, x, y; -int *ochar; -unsigned *ospecial; +mapglyph(int glyph, int *ochar, int *ocolor, unsigned *ospecial, int x, int y) { register int offset, idx; int color = NO_COLOR; @@ -230,8 +227,7 @@ unsigned *ospecial; } char * -encglyph(glyph) -int glyph; +encglyph(int glyph) { static char encbuf[20]; @@ -252,10 +248,7 @@ int glyph; */ void -genl_putmixed(window, attr, str) -winid window; -int attr; -const char *str; +genl_putmixed(winid window, int attr, const char *str) { static const char hex[] = "00112233445566778899aAbBcCdDeEfF"; char buf[BUFSZ]; diff --git a/src/mcastu.c b/src/mcastu.c index 24463a59bf..c52dec2797 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -30,23 +30,21 @@ #define CLC_FIRE_PILLAR 8 #define CLC_GEYSER 9 -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 void FDECL(cast_wizard_spell, (struct monst *, int, int)); -STATIC_DCL void FDECL(cast_cleric_spell, (struct monst *, int, int)); -STATIC_DCL boolean FDECL(is_undirected_spell, (unsigned int, int)); +STATIC_DCL void cursetxt(struct monst *, boolean); +STATIC_DCL int choose_magic_spell(int); +STATIC_DCL int choose_clerical_spell(int); +STATIC_DCL void cast_wizard_spell(struct monst *, int, int); +STATIC_DCL void cast_cleric_spell(struct monst *, int, int); +STATIC_DCL boolean is_undirected_spell(unsigned int, int); STATIC_DCL boolean -FDECL(spell_would_be_useless, (struct monst *, unsigned int, int)); +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 -cursetxt(mtmp, undirected) -struct monst *mtmp; -boolean undirected; +cursetxt(struct monst *mtmp, boolean undirected) { if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my)) { const char *point_msg; /* spellcasting monsters are impolite */ @@ -73,8 +71,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 -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 */ @@ -128,8 +125,7 @@ int spellval; /* convert a level based random selection into a specific cleric spell */ STATIC_OVL 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 */ @@ -175,11 +171,8 @@ int spellnum; * 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; @@ -342,10 +335,7 @@ boolean foundyou; */ STATIC_OVL 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)) { impossible("cast directed wizard spell (%d) with dmg=0?", spellnum); @@ -504,10 +494,7 @@ int spellnum; STATIC_OVL 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)) { impossible("cast directed cleric spell (%d) with dmg=0?", spellnum); @@ -723,9 +710,7 @@ int spellnum; STATIC_DCL 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) { @@ -754,10 +739,7 @@ int spellnum; /* Some spells are useless under some circumstances. */ STATIC_DCL 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 @@ -837,9 +819,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 f0eab761e5..848a3b6f40 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -14,24 +14,24 @@ static NEARDATA struct obj *otmp; static const char brief_feeling[] = "have a %s feeling for a moment, then it passes."; -STATIC_DCL char *FDECL(mon_nam_too, (char *, struct monst *, struct monst *)); -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_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_DCL char *mon_nam_too(char *, struct monst *, struct monst *); +STATIC_DCL int hitmm(struct monst *, struct monst *, + struct attack *); +STATIC_DCL int gazemm(struct monst *, struct monst *, + struct attack *); +STATIC_DCL int gulpmm(struct monst *, struct monst *, + struct attack *); +STATIC_DCL int explmm(struct monst *, struct monst *, + struct attack *); +STATIC_DCL int mdamagem(struct monst *, struct monst *, + struct attack *); +STATIC_DCL void mswingsm(struct monst *, struct monst *, + struct obj *); +STATIC_DCL void noises(struct monst *, struct attack *); +STATIC_DCL void missmm(struct monst *, struct monst *, + struct attack *); +STATIC_DCL 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() @@ -42,9 +42,7 @@ static int dieroll; /* 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 */ STATIC_OVL char * -mon_nam_too(outbuf, mon, other_mon) -char *outbuf; -struct monst *mon, *other_mon; +mon_nam_too(char *outbuf, struct monst *mon, struct monst *other_mon) { Strcpy(outbuf, mon_nam(mon)); if (mon == other_mon) @@ -63,9 +61,7 @@ struct monst *mon, *other_mon; } STATIC_OVL 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); @@ -80,9 +76,7 @@ register struct attack *mattk; STATIC_OVL 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]; @@ -118,8 +112,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; @@ -193,9 +186,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; @@ -288,8 +279,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 */ @@ -480,9 +470,7 @@ register struct monst *magr, *mdef; /* Returns the result of mdamagem(). */ STATIC_OVL 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) { if (vis) { int compat; @@ -539,9 +527,7 @@ struct attack *mattk; /* Returns the same values as mdamagem(). */ STATIC_OVL 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]; @@ -590,8 +576,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; @@ -622,9 +607,7 @@ struct monst *magr, *mdef; /* Returns the same values as mattackm(). */ STATIC_OVL 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; @@ -692,9 +675,7 @@ register struct attack *mattk; } STATIC_OVL int -explmm(magr, mdef, mattk) -struct monst *magr, *mdef; -struct attack *mattk; +explmm(struct monst *magr, struct monst *mdef, struct attack *mattk) { int result; @@ -725,9 +706,7 @@ struct attack *mattk; * See comment at top of mattackm(), for return values. */ STATIC_OVL 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]; @@ -1329,9 +1308,7 @@ register struct attack *mattk; } void -paralyze_monst(mon, amt) -struct monst *mon; -int amt; +paralyze_monst(struct monst *mon, int amt) { if (amt > 127) amt = 127; @@ -1344,9 +1321,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))) { @@ -1367,8 +1342,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) { @@ -1378,9 +1352,7 @@ struct monst *mon; } void -rustm(mdef, obj) -struct monst *mdef; -struct obj *obj; +rustm(struct monst *mdef, struct obj *obj) { int dmgtyp; @@ -1399,9 +1371,7 @@ struct obj *obj; } STATIC_OVL 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), @@ -1416,10 +1386,8 @@ struct obj *otemp; * handled above. Returns same values as mattackm. */ STATIC_OVL 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; @@ -1569,9 +1537,7 @@ int mdead; /* hero or monster has successfully hit target mon with drain energy attack */ void -xdrainenergym(mon, givemsg) -struct monst *mon; -boolean givemsg; +xdrainenergym(struct monst *mon, boolean givemsg) { if (mon->mspec_used < 20 /* limit draining */ && (attacktype(mon->data, AT_MAGC) @@ -1585,8 +1551,7 @@ boolean givemsg; /* "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; diff --git a/src/mhitu.c b/src/mhitu.c index 2d489a1c29..b31e41984e 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -7,30 +7,27 @@ STATIC_VAR NEARDATA struct obj *otmp; -STATIC_DCL boolean FDECL(u_slip_free, (struct monst *, struct attack *)); -STATIC_DCL int FDECL(passiveum, - (struct permonst *, struct monst *, struct attack *)); +STATIC_DCL boolean u_slip_free(struct monst *, struct attack *); +STATIC_DCL int passiveum(struct permonst *, struct monst *, struct attack *); -STATIC_DCL void FDECL(mayberem, (struct obj *, const char *)); +STATIC_DCL void mayberem(struct obj *, const char *); -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 boolean diseasemu(struct permonst *); +STATIC_DCL int hitmu(struct monst *, struct attack *); +STATIC_DCL int gulpmu(struct monst *, struct attack *); +STATIC_DCL int explmu(struct monst *, struct attack *, boolean); +STATIC_DCL void missmu(struct monst *, boolean, struct attack *); +STATIC_DCL void mswings(struct monst *, struct obj *); +STATIC_DCL void wildmiss(struct monst *, struct attack *); -STATIC_DCL void FDECL(hitmsg, (struct monst *, struct attack *)); +STATIC_DCL void hitmsg(struct monst *, struct attack *); /* 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 -hitmsg(mtmp, mattk) -register struct monst *mtmp; -register struct attack *mattk; +hitmsg(register struct monst *mtmp, register struct attack *mattk) { int compat; @@ -72,10 +69,7 @@ register struct attack *mattk; /* monster missed you */ STATIC_OVL 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); @@ -91,9 +85,7 @@ struct attack *mattk; /* monster swings obj */ STATIC_OVL void -mswings(mtmp, otemp) -struct monst *mtmp; -struct obj *otemp; +mswings(struct monst *mtmp, struct obj *otemp) { if (flags.verbose && !Blind && mon_visible(mtmp)) { pline("%s %s %s%s %s.", Monnam(mtmp), @@ -104,9 +96,7 @@ 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); @@ -134,9 +124,7 @@ u_slow_down() /* monster attacked your displaced image */ STATIC_OVL void -wildmiss(mtmp, mattk) -register struct monst *mtmp; -register struct attack *mattk; +wildmiss(register struct monst *mtmp, register struct attack *mattk) { int compat; @@ -211,10 +199,9 @@ 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, /* if mtmp is polymorphed, mdat != mtmp->data */ + boolean message) { if (message) { if (is_animal(mdat)) @@ -256,10 +243,7 @@ boolean message; /* select a monster's next attack, possibly substituting for its usual one */ struct attack * -getmattk(mptr, indx, prev_result, alt_attk_buf) -struct permonst *mptr; -int indx, prev_result[]; -struct attack *alt_attk_buf; +getmattk(struct permonst *mptr, int indx, int prev_result[], struct attack *alt_attk_buf) { struct attack *attk = &mptr->mattk[indx]; @@ -287,8 +271,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, tmp, sum[NATTK]; @@ -738,8 +721,7 @@ register struct monst *mtmp; } STATIC_OVL boolean -diseasemu(mdat) -struct permonst *mdat; +diseasemu(struct permonst *mdat) { if (Sick_resistance) { You_feel("a slight illness."); @@ -753,9 +735,7 @@ struct permonst *mdat; /* check whether slippery clothing protects from hug or wrap attack */ STATIC_OVL 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); @@ -790,8 +770,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 *o; long wearmask; @@ -842,9 +821,7 @@ struct monst *mon; * attacking you */ STATIC_OVL int -hitmu(mtmp, mattk) -register struct monst *mtmp; -register struct attack *mattk; +hitmu(register struct monst *mtmp, register struct attack *mattk) { register struct permonst *mdat = mtmp->data; register int uncancelled, ptmp; @@ -1632,9 +1609,7 @@ gulp_blnd_check() /* monster swallows you, or damage if u.uswallow */ STATIC_OVL int -gulpmu(mtmp, mattk) -register struct monst *mtmp; -register struct attack *mattk; +gulpmu(register struct monst *mtmp, register struct attack *mattk) { struct trap *t = t_at(u.ux, u.uy); int tmp = d((int) mattk->damn, (int) mattk->damd); @@ -1874,10 +1849,7 @@ register struct attack *mattk; /* monster explodes in your face */ STATIC_OVL int -explmu(mtmp, mattk, ufound) -register struct monst *mtmp; -register struct attack *mattk; -boolean ufound; +explmu(register struct monst *mtmp, register struct attack *mattk, boolean ufound) { boolean physical_damage = TRUE, kill_agr = TRUE; @@ -1972,9 +1944,7 @@ boolean ufound; /* monster gazes at you */ int -gazemu(mtmp, mattk) -register struct monst *mtmp; -register struct attack *mattk; +gazemu(register struct monst *mtmp, register struct attack *mattk) { static const char *const reactions[] = { "confused", /* [0] */ @@ -2183,9 +2153,7 @@ register struct attack *mattk; /* mtmp hits you for n points damage */ void -mdamageu(mtmp, n) -register struct monst *mtmp; -register int n; +mdamageu(register struct monst *mtmp, register int n) { context.botl = 1; if (Upolyd) { @@ -2204,9 +2172,7 @@ register int n; * 2 if wrong gender for nymph */ int -could_seduce(magr, mdef, mattk) -struct monst *magr, *mdef; -struct attack *mattk; +could_seduce(struct monst *magr, struct monst *mdef, struct attack *mattk) { register struct permonst *pagr; boolean agrinvis, defperc; @@ -2248,8 +2214,7 @@ struct attack *mattk; /* Returns 1 if monster teleported */ int -doseduce(mon) -register struct monst *mon; +doseduce(register struct monst *mon) { register struct obj *ring, *nring; boolean fem = (mon->data == &mons[PM_SUCCUBUS]); /* otherwise incubus */ @@ -2512,9 +2477,7 @@ register struct monst *mon; } STATIC_OVL void -mayberem(obj, str) -register struct obj *obj; -const char *str; +mayberem(register struct obj *obj, const char *str) { char qbuf[QBUFSZ]; @@ -2549,10 +2512,7 @@ const char *str; } STATIC_OVL int -passiveum(olduasmon, mtmp, mattk) -struct permonst *olduasmon; -register struct monst *mtmp; -register struct attack *mattk; +passiveum(struct permonst *olduasmon, register struct monst *mtmp, register struct attack *mattk) { int i, tmp; diff --git a/src/minion.c b/src/minion.c index 1af08f5ea9..c7698dd04e 100644 --- a/src/minion.c +++ b/src/minion.c @@ -5,8 +5,7 @@ #include "hack.h" void -newemin(mtmp) -struct monst *mtmp; +newemin(struct monst *mtmp) { if (!mtmp->mextra) mtmp->mextra = newmextra(); @@ -17,8 +16,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)); @@ -29,8 +27,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; @@ -47,8 +44,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; @@ -147,9 +143,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; @@ -209,8 +203,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; @@ -287,8 +280,7 @@ register struct monst *mtmp; } long -bribe(mtmp) -struct monst *mtmp; +bribe(struct monst *mtmp) { char buf[BUFSZ]; long offer; @@ -318,8 +310,7 @@ struct monst *mtmp; } int -dprince(atyp) -aligntyp atyp; +dprince(aligntyp atyp) { int tryct, pm; @@ -333,8 +324,7 @@ aligntyp atyp; } int -dlord(atyp) -aligntyp atyp; +dlord(aligntyp atyp) { int tryct, pm; @@ -373,8 +363,7 @@ lminion() } int -ndemon(atyp) -aligntyp atyp; +ndemon(aligntyp atyp) { int tryct; struct permonst *ptr; @@ -391,8 +380,7 @@ aligntyp atyp; /* 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; diff --git a/src/mklev.c b/src/mklev.c index 6fd50f7fe0..9e21361a87 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -8,31 +8,31 @@ /* croom->lx etc are schar (width <= int), so % arith ensures that */ /* conversion of result to int is reasonable */ -STATIC_DCL void FDECL(mkfount, (int, struct mkroom *)); -STATIC_DCL void FDECL(mksink, (struct mkroom *)); -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 boolean FDECL(bydoor, (XCHAR_P, XCHAR_P)); -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 mkfount(int, struct mkroom *); +STATIC_DCL void mksink(struct mkroom *); +STATIC_DCL void mkaltar(struct mkroom *); +STATIC_DCL void mkgrave(struct mkroom *); +STATIC_DCL void makevtele(void); +STATIC_DCL void clear_level_structures(void); +STATIC_DCL void makelevel(void); +STATIC_DCL boolean bydoor(xchar, xchar); +STATIC_DCL struct mkroom *find_branch_room(coord *); +STATIC_DCL struct mkroom *pos_to_room(xchar, xchar); +STATIC_DCL boolean place_niche(struct mkroom *, int *, int *, int *); +STATIC_DCL void makeniche(int); +STATIC_DCL void make_niches(void); +STATIC_PTR int CFDECLSPEC do_comp(const genericptr, + const genericptr); +STATIC_DCL void dosdoor(xchar, xchar, struct mkroom *, int); +STATIC_DCL void join(int, int, boolean); +STATIC_DCL void do_room_or_subroom(struct mkroom *, int, int, + int, int, boolean, + schar, boolean, boolean); +STATIC_DCL void makerooms(void); +STATIC_DCL void finddpos(coord *, xchar, xchar, + xchar, xchar); +STATIC_DCL void mkinvpos(xchar, xchar, int); +STATIC_DCL void mk_knox_portal(xchar, xchar); #define create_vault() create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE) #define init_vault() vault_x = -1 @@ -43,9 +43,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 -do_comp(vx, vy) -const genericptr vx; -const genericptr vy; +do_comp(const genericptr vx, const genericptr vy) { #ifdef LINT /* lint complains about possible pointer alignment problems, but we know @@ -65,9 +63,7 @@ const genericptr vy; } STATIC_OVL 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,14 +102,9 @@ sort_rooms() } STATIC_OVL 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; @@ -182,11 +173,7 @@ boolean is_room; } void -add_room(lowx, lowy, hix, hiy, lit, rtype, special) -int lowx, lowy, hix, 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; @@ -199,12 +186,8 @@ boolean special; } void -add_subroom(proom, lowx, lowy, hix, hiy, lit, rtype, special) -struct mkroom *proom; -int lowx, lowy, hix, 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; @@ -239,9 +222,7 @@ makerooms() } STATIC_OVL 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; @@ -346,9 +327,7 @@ makecorridors() } 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; @@ -379,10 +358,7 @@ register struct mkroom *aroom; } STATIC_OVL void -dosdoor(x, y, aroom, type) -register xchar x, y; -struct mkroom *aroom; -int type; +dosdoor(register xchar x, register xchar y, struct mkroom *aroom, int type) { boolean shdoor = *in_rooms(x, y, SHOPBASE) ? TRUE : FALSE; @@ -446,9 +422,7 @@ int type; } STATIC_OVL 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; @@ -479,8 +453,7 @@ static NEARDATA const char *trap_engravings[TRAPNUM] = { }; STATIC_OVL void -makeniche(trap_type) -int trap_type; +makeniche(int trap_type) { register struct mkroom *aroom; struct rm *rm; @@ -881,9 +854,7 @@ makelevel() * mineralize(-1, -1, -1, -1, FALSE); => "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; @@ -1013,12 +984,9 @@ mklev() void #ifdef SPECIALIZATION -topologize(croom, do_ordinary) -struct mkroom *croom; -boolean do_ordinary; +topologize(struct mkroom *croom, boolean do_ordinary) #else -topologize(croom) -struct mkroom *croom; +topologize(struct mkroom *croom) #endif { register int x, y, roomno = (int) ((croom - rooms) + ROOMOFFSET); @@ -1078,8 +1046,7 @@ struct mkroom *croom; /* Find an unused room for a branch location. */ STATIC_OVL struct mkroom * -find_branch_room(mp) -coord *mp; +find_branch_room(coord *mp) { struct mkroom *croom = 0; @@ -1109,8 +1076,7 @@ coord *mp; /* Find the room for (x,y). Return null if not in a room. */ STATIC_OVL struct mkroom * -pos_to_room(x, y) -xchar x, y; +pos_to_room(xchar x, xchar y) { int i; struct mkroom *curr; @@ -1124,9 +1090,8 @@ 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; @@ -1183,8 +1148,7 @@ xchar x, y; /* location */ } STATIC_OVL boolean -bydoor(x, y) -register xchar x, y; +bydoor(register xchar x, register xchar y) { register int typ; @@ -1213,8 +1177,7 @@ register xchar x, y; /* see whether it is allowable to create a door at [x,y] */ int -okdoor(x, y) -xchar x, y; +okdoor(xchar x, xchar y) { boolean near_door = bydoor(x, y); @@ -1223,9 +1186,7 @@ xchar x, y; } void -dodoor(x, y, aroom) -int x, y; -struct mkroom *aroom; +dodoor(int x, int y, struct mkroom *aroom) { if (doorindex >= DOORMAX) { impossible("DOORMAX exceeded?"); @@ -1236,8 +1197,7 @@ 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) || is_lava(x, y) || is_pool(x, y) @@ -1247,10 +1207,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) -int num, mazeflag; -struct mkroom *croom; -coord *tm; +mktrap(int num, int mazeflag, struct mkroom *croom, coord *tm) { register int kind; coord m; @@ -1369,10 +1326,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); @@ -1403,9 +1357,7 @@ struct mkroom *croom; } STATIC_OVL void -mkfount(mazeflag, croom) -int mazeflag; -struct mkroom *croom; +mkfount(int mazeflag, struct mkroom *croom) { coord m; register int tryct = 0; @@ -1429,8 +1381,7 @@ struct mkroom *croom; } STATIC_OVL void -mksink(croom) -struct mkroom *croom; +mksink(struct mkroom *croom) { coord m; register int tryct = 0; @@ -1449,8 +1400,7 @@ struct mkroom *croom; } STATIC_OVL void -mkaltar(croom) -struct mkroom *croom; +mkaltar(struct mkroom *croom) { coord m; register int tryct = 0; @@ -1475,8 +1425,7 @@ struct mkroom *croom; } static void -mkgrave(croom) -struct mkroom *croom; +mkgrave(struct mkroom *croom) { coord m; register int tryct = 0; @@ -1581,9 +1530,7 @@ mkinvokearea() * Temporarily overrides vision in the name of a nice effect. */ STATIC_OVL void -mkinvpos(x, y, dist) -xchar x, y; -int dist; +mkinvpos(xchar x, xchar y, int dist) { struct trap *ttmp; struct obj *otmp; @@ -1665,8 +1612,7 @@ int dist; * Ludios will remain isolated until the branch is corrected by this function. */ STATIC_OVL 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; diff --git a/src/mkmap.c b/src/mkmap.c index 3ed4fd97fa..e8c0a47d96 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -8,26 +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, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL void FDECL(remove_room, (unsigned)); -void FDECL(mkmap, (lev_init *)); +STATIC_DCL void init_map(schar); +STATIC_DCL void init_fill(schar, schar); +STATIC_DCL schar get_map(int, int, schar); +STATIC_DCL void pass_one(schar, schar); +STATIC_DCL void pass_two(schar, schar); +STATIC_DCL void pass_three(schar, schar); +STATIC_DCL void wallify_map(void); +STATIC_DCL void join_map(schar, schar); +STATIC_DCL void finish_map(schar, schar, boolean, boolean, boolean); +STATIC_DCL void remove_room(unsigned); +void mkmap(lev_init *); static char *new_locations; int min_rx, max_rx, min_ry, max_ry; /* rectangle bounds for regions */ static int n_loc_filled; STATIC_OVL void -init_map(bg_typ) -schar bg_typ; +init_map(schar bg_typ) { register int i, j; @@ -37,8 +35,7 @@ schar bg_typ; } STATIC_OVL 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; @@ -56,9 +53,7 @@ schar bg_typ, fg_typ; } STATIC_OVL 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; @@ -69,8 +64,7 @@ static int dirs[16] = { -1, -1 /**/, -1, 0 /**/, -1, 1 /**/, 0, -1 /**/, 0, 1 /**/, 1, -1 /**/, 1, 0 /**/, 1, 1 }; STATIC_OVL 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; @@ -103,8 +97,7 @@ schar bg_typ, fg_typ; #define new_loc(i, j) *(new_locations + ((j) * (WIDTH + 1)) + (i)) STATIC_OVL 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; @@ -127,8 +120,7 @@ schar bg_typ, fg_typ; } STATIC_OVL 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; @@ -157,12 +149,7 @@ schar bg_typ, fg_typ; * 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; @@ -270,8 +257,7 @@ wallify_map() } STATIC_OVL 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; @@ -343,9 +329,7 @@ schar bg_typ, fg_typ; } STATIC_OVL void -finish_map(fg_typ, bg_typ, lit, walled, icedpools) -schar fg_typ, bg_typ; -boolean lit, walled, icedpools; +finish_map(schar fg_typ, schar bg_typ, boolean lit, boolean walled, boolean icedpools) { int i, j; @@ -384,8 +368,7 @@ boolean lit, walled, icedpools; * 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; @@ -416,8 +399,7 @@ int lx, ly, hx, hy; * Currently handles only the removal of rooms that have no subrooms. */ STATIC_OVL void -remove_room(roomno) -unsigned roomno; +remove_room(unsigned roomno) { struct mkroom *croom = &rooms[roomno]; struct mkroom *maxroom = &rooms[--nroom]; @@ -449,8 +431,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; boolean smooth = init_lev->smoothed, join = init_lev->joined; diff --git a/src/mkmaze.c b/src/mkmaze.c index eddf6fbd1a..73f1bfa474 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -10,18 +10,18 @@ extern lev_region *lregions; extern int num_lregions; -STATIC_DCL boolean FDECL(iswall, (int, int)); -STATIC_DCL boolean 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 *)); -STATIC_DCL void NDECL(fixup_special); -STATIC_DCL void NDECL(setup_waterlevel); -STATIC_DCL void NDECL(unsetup_waterlevel); +STATIC_DCL boolean iswall(int, int); +STATIC_DCL boolean iswall_or_stone(int, int); +STATIC_DCL boolean is_solid(int, int); +STATIC_DCL int extend_spine(int[3][3], int, int, int); +STATIC_DCL boolean okay(int, int, int); +STATIC_DCL void maze0xy(coord *); +STATIC_DCL boolean put_lregion_here(xchar, xchar, xchar, + xchar, xchar, xchar, + xchar, boolean, d_level *); +STATIC_DCL void fixup_special(void); +STATIC_DCL void setup_waterlevel(void); +STATIC_DCL void unsetup_waterlevel(void); /* adjust a coordinate one step in the specified direction */ #define mz_move(X, Y, dir) \ @@ -36,8 +36,7 @@ STATIC_DCL void NDECL(unsetup_waterlevel); } while (0) STATIC_OVL boolean -iswall(x, y) -int x, y; +iswall(int x, int y) { register int type; @@ -49,8 +48,7 @@ int x, y; } STATIC_OVL boolean -iswall_or_stone(x, y) -int x, y; +iswall_or_stone(int x, int y) { register int type; @@ -66,8 +64,7 @@ int x, y; /* return TRUE if out of bounds, wall or rock */ STATIC_OVL boolean -is_solid(x, y) -int x, y; +is_solid(int x, int y) { return (boolean) (!isok(x, y) || IS_STWALL(levl[x][y].typ)); } @@ -91,9 +88,7 @@ int x, y; * . W W */ STATIC_OVL int -extend_spine(locale, wall_there, dx, dy) -int locale[3][3]; -int wall_there, dx, dy; +extend_spine(int locale[3][3], int wall_there, int dx, int dy) { int spine, nx, ny; @@ -129,8 +124,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; register int x, y; @@ -202,9 +196,7 @@ int x1, y1, x2, y2; } STATIC_OVL boolean -okay(x, y, dir) -int x, y; -register int dir; +okay(int x, int y, register int dir) { mz_move(x, y, dir); mz_move(x, y, dir); @@ -216,8 +208,7 @@ register int dir; /* find random starting point for maze generation */ STATIC_OVL 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); @@ -231,9 +222,7 @@ coord *cc; * NOT (pos is corridor and a maze level OR pos is a room OR pos is air) */ boolean -bad_location(x, y, lx, ly, hx, hy) -xchar x, y; -xchar lx, ly, hx, hy; +bad_location(xchar x, xchar y, xchar lx, xchar ly, xchar hx, xchar hy) { return (boolean) (occupied(x, y) || within_bounded_area(x, y, lx, ly, hx, hy) @@ -245,11 +234,8 @@ xchar lx, ly, hx, hy; /* pick a location in area (lx, ly, hx, hy) but not in (nlx, nly, nhx, nhy) and place something (based on rtype) in that region */ void -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; @@ -294,12 +280,7 @@ d_level *lev; } STATIC_OVL boolean -put_lregion_here(x, y, nlx, nly, nhx, nhy, rtype, oneshot, lev) -xchar x, y; -xchar nlx, nly, nhx, nhy; -xchar rtype; -boolean oneshot; -d_level *lev; +put_lregion_here(xchar x, xchar y, xchar nlx, xchar nly, xchar nhx, xchar nhy, xchar rtype, boolean oneshot, d_level *lev) { if (bad_location(x, y, nlx, nly, nhx, nhy)) { if (!oneshot) { @@ -506,8 +487,7 @@ fixup_special() } void -makemaz(s) -register const char *s; +makemaz(register const char *s) { int x, y; char protofile[20]; @@ -674,9 +654,7 @@ register const char *s; * that is totally safe. */ void -walkfrom(x, y, typ) -int x, y; -schar typ; +walkfrom(int x, int y, schar typ) { #define CELLS (ROWNO * COLNO) / 4 /* a maze cell is 4 squares */ char mazex[CELLS + 1], mazey[CELLS + 1]; /* char's are OK */ @@ -723,9 +701,7 @@ schar typ; #else /* !MICRO */ void -walkfrom(x, y, typ) -int x, y; -schar typ; +walkfrom(int x, int y, schar typ) { register int q, a, dir; int dirs[4]; @@ -762,8 +738,7 @@ schar typ; /* 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; @@ -885,8 +860,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 */ @@ -951,9 +925,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_DCL void set_wportal(void); +STATIC_DCL void mk_bubble(int, int, int); +STATIC_DCL void mv_bubble(struct bubble *, int, int, boolean); void movebubbles() @@ -1130,8 +1104,7 @@ water_friction() } void -save_waterlevel(fd, mode) -int fd, mode; +save_waterlevel(int fd, int mode) { register struct bubble *b; @@ -1155,8 +1128,7 @@ int fd, mode; } void -restore_waterlevel(fd) -register int fd; +restore_waterlevel(register int fd) { register struct bubble *b = (struct bubble *) 0, *btmp; register int i; @@ -1190,8 +1162,7 @@ register int fd; } const char * -waterbody_name(x, y) -xchar x, y; +waterbody_name(xchar x, xchar y) { register struct rm *lev; schar ltyp; @@ -1280,8 +1251,7 @@ unsetup_waterlevel() } STATIC_OVL void -mk_bubble(x, y, n) -register int x, y, n; +mk_bubble(register int x, register int y, register int n) { /* * These bit masks make visually pleasing bubbles on a normal aspect @@ -1342,10 +1312,7 @@ register int x, y, n; * This property also makes leaving a bubble slightly difficult. */ STATIC_OVL void -mv_bubble(b, dx, dy, ini) -register struct bubble *b; -register int dx, dy; -register boolean ini; +mv_bubble(register struct bubble *b, register int dx, register int dy, register boolean ini) { register int x, y, i, j, colli = 0; struct container *cons, *ctemp; diff --git a/src/mkobj.c b/src/mkobj.c index 9a10231171..7a91cb2482 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -4,19 +4,19 @@ #include "hack.h" -STATIC_DCL void FDECL(mkbox_cnts, (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_DCL const char *FDECL(where_name, (struct obj *)); -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_DCL void mkbox_cnts(struct obj *); +STATIC_DCL void maybe_adjust_light(struct obj *, int); +STATIC_DCL void obj_timer_checks(struct obj *, + xchar, xchar, int); +STATIC_DCL void container_weight(struct obj *); +STATIC_DCL struct obj *save_mtraits(struct obj *, struct monst *); +STATIC_DCL void objlist_sanity(struct obj *, int, const char *); +STATIC_DCL void mon_obj_sanity(struct monst *, const char *); +STATIC_DCL const char *where_name(struct obj *); +STATIC_DCL void insane_object(struct obj *, const char *, + const char *, struct monst *); +STATIC_DCL void check_contained(struct obj *, const char *); +STATIC_DCL void sanity_check_worn(struct obj *); struct icp { int iprob; /* probability of an item type */ @@ -79,8 +79,7 @@ newoextra() } void -dealloc_oextra(o) -struct obj *o; +dealloc_oextra(struct obj *o) { struct oextra *x = o->oextra; @@ -102,8 +101,7 @@ struct obj *o; } void -newomonst(otmp) -struct obj *otmp; +newomonst(struct obj *otmp) { if (!otmp->oextra) otmp->oextra = newoextra(); @@ -119,8 +117,7 @@ struct obj *otmp; } void -free_omonst(otmp) -struct obj *otmp; +free_omonst(struct obj *otmp) { if (otmp->oextra) { struct monst *m = OMONST(otmp); @@ -135,8 +132,7 @@ struct obj *otmp; } void -newomid(otmp) -struct obj *otmp; +newomid(struct obj *otmp) { if (!otmp->oextra) otmp->oextra = newoextra(); @@ -147,8 +143,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)); @@ -157,8 +152,7 @@ struct obj *otmp; } void -newolong(otmp) -struct obj *otmp; +newolong(struct obj *otmp) { if (!otmp->oextra) otmp->oextra = newoextra(); @@ -169,8 +163,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)); @@ -179,9 +172,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(); @@ -191,8 +182,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)); @@ -201,10 +191,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; @@ -214,9 +201,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; @@ -226,9 +211,7 @@ boolean init, artif; } struct obj * -mkobj(oclass, artif) -char oclass; -boolean artif; +mkobj(char oclass, boolean artif) { int tprob, i, prob = rnd(1000); @@ -254,8 +237,7 @@ boolean artif; } STATIC_OVL void -mkbox_cnts(box) -struct obj *box; +mkbox_cnts(struct obj *box) { register int n; register struct obj *otmp; @@ -359,8 +341,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; @@ -408,9 +389,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 num) { struct obj *otmp; @@ -452,8 +431,7 @@ long num; /* 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; @@ -538,9 +516,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) { @@ -595,8 +571,7 @@ struct obj *otmp; * 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; @@ -638,9 +613,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; @@ -715,10 +688,7 @@ static const char dknowns[] = { WAND_CLASS, RING_CLASS, POTION_CLASS, WEAPON_CLASS, TOOL_CLASS, 0 }; 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; @@ -1071,9 +1041,7 @@ boolean artif; * */ void -set_corpsenm(obj, id) -struct obj *obj; -int id; +set_corpsenm(struct obj *obj, int id) { long when = 0L; @@ -1112,8 +1080,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 */ @@ -1163,9 +1130,7 @@ struct obj *body; } STATIC_OVL 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; @@ -1206,8 +1171,7 @@ int old_range; */ void -bless(otmp) -register struct obj *otmp; +bless(register struct obj *otmp) { int old_light = 0; @@ -1229,8 +1193,7 @@ register struct obj *otmp; } void -unbless(otmp) -register struct obj *otmp; +unbless(register struct obj *otmp) { int old_light = 0; @@ -1246,8 +1209,7 @@ register struct obj *otmp; } void -curse(otmp) -register struct obj *otmp; +curse(register struct obj *otmp) { int old_light = 0; @@ -1280,8 +1242,7 @@ register struct obj *otmp; } void -uncurse(otmp) -register struct obj *otmp; +uncurse(register struct obj *otmp) { int old_light = 0; @@ -1300,9 +1261,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; @@ -1318,8 +1277,7 @@ register int chance; } int -bcsign(otmp) -register struct obj *otmp; +bcsign(register struct obj *otmp) { return (!!otmp->blessed - !!otmp->cursed); } @@ -1333,8 +1291,7 @@ register struct obj *otmp; * container's weight. */ int -weight(obj) -register struct obj *obj; +weight(register struct obj *obj) { int wt = objects[obj->otyp].oc_weight; @@ -1389,16 +1346,13 @@ register struct obj *obj; static int treefruits[] = { APPLE, ORANGE, PEAR, BANANA, EUCALYPTUS_LEAF }; 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); } struct obj * -mkgold(amount, x, y) -long amount; -int x, y; +mkgold(long amount, int x, int y) { register struct obj *gold = g_at(x, y); @@ -1429,12 +1383,11 @@ int x, y; * resurrection. */ struct obj * -mkcorpstat(objtype, mtmp, ptr, x, y, corpstatflags) -int objtype; /* CORPSE or STATUE */ -struct monst *mtmp; -struct permonst *ptr; -int x, y; -unsigned corpstatflags; +mkcorpstat(int objtype, /* CORPSE or STATUE */ + struct monst *mtmp, + struct permonst *ptr, + int x, int y, + unsigned corpstatflags) { register struct obj *otmp; boolean init = ((corpstatflags & CORPSTAT_INIT) != 0); @@ -1484,8 +1437,7 @@ unsigned corpstatflags; * The return value is an index into mons[]. */ int -corpse_revive_type(obj) -struct obj *obj; +corpse_revive_type(struct obj *obj) { int revivetype; struct monst *mtmp; @@ -1504,9 +1456,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 mid) { if (!mid || !obj) return (struct obj *) 0; @@ -1516,9 +1466,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() */ @@ -1547,9 +1495,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; @@ -1573,9 +1519,8 @@ 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 */ -register int x, y; +mk_tt_object(int objtype, /* CORPSE or STATUE */ + register int x, register int y) { register struct obj *otmp, *otmp2; boolean initialize_it; @@ -1592,11 +1537,10 @@ register int x, y; /* make a new corpse or statue, uninitialized if a statue (i.e. no books) */ 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, /* CORPSE or STATUE */ + struct permonst *ptr, + int x, int y, + const char *nm) { struct obj *otmp; unsigned corpstatflags = @@ -1609,8 +1553,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; @@ -1629,8 +1572,7 @@ register struct obj *otmp; } boolean -is_rottable(otmp) -register struct obj *otmp; +is_rottable(register struct obj *otmp) { int otyp = otmp->otyp; @@ -1645,9 +1587,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]; @@ -1687,9 +1627,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; @@ -1715,8 +1653,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; @@ -1733,10 +1670,9 @@ struct obj *otmp; } STATIC_OVL 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; @@ -1801,8 +1737,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; @@ -1820,8 +1755,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 = (mtmp->mhp > 0); @@ -1858,8 +1792,7 @@ struct monst *mtmp; * OBJ_ONBILL on billobjs chain */ void -obj_extract_self(obj) -struct obj *obj; +obj_extract_self(struct obj *obj) { switch (obj->where) { case OBJ_FREE: @@ -1894,8 +1827,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; @@ -1922,8 +1854,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; @@ -1947,9 +1878,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; @@ -1973,8 +1902,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; @@ -1996,8 +1924,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"); @@ -2008,8 +1935,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"); @@ -2021,8 +1947,7 @@ struct obj *obj; /* Recalculate the weight of this container and all of _its_ containers. */ STATIC_OVL void -container_weight(container) -struct obj *container; +container_weight(struct obj *container) { container->owt = weight(container); if (container->where == OBJ_CONTAINED) @@ -2038,8 +1963,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"); @@ -2075,9 +1999,8 @@ 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 handling */ { int objcount = 0; @@ -2206,10 +2129,7 @@ obj_sanity_check() /* sanity check for objects on specified list (fobj, &c) */ STATIC_OVL 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; @@ -2256,9 +2176,7 @@ const char *mesg; /* sanity check for objects carried by all monsters in specified list */ STATIC_OVL 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; @@ -2289,8 +2207,7 @@ static const char *obj_state_names[NOBJ_STATES] = { "free", "floor", "buried", "onbill" }; STATIC_OVL 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; @@ -2306,10 +2223,7 @@ struct obj *obj; } STATIC_OVL 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]; @@ -2333,9 +2247,7 @@ struct monst *mon; /* obj sanity check: check objects inside container */ STATIC_OVL 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 */ @@ -2380,8 +2292,7 @@ const char *mesg; /* check an object in hero's or monster's inventory which has worn mask set */ STATIC_OVL void -sanity_check_worn(obj) -struct obj *obj; +sanity_check_worn(struct obj *obj) { #if defined(BETA) || defined(DEBUG) static unsigned long wearbits[] = { @@ -2577,8 +2488,7 @@ struct obj *obj; * wrapper to make "near this object" convenient */ struct obj * -obj_nexto(otmp) -struct obj *otmp; +obj_nexto(struct obj *otmp) { struct obj *otmp2 = (struct obj *) 0; @@ -2600,9 +2510,7 @@ struct obj *otmp; * reliably predict which one we want to 'find' first */ struct obj * -obj_nexto_xy(otyp, x, y, oid) -int otyp, x, y; -unsigned oid; +obj_nexto_xy(int otyp, int x, int y, unsigned oid) { struct obj *otmp; int fx, fy, ex, ey; @@ -2643,8 +2551,7 @@ unsigned oid; * is returned. */ struct obj * -obj_absorb(obj1, obj2) -struct obj **obj1, **obj2; +obj_absorb(struct obj **obj1, struct obj **obj2) { struct obj *otmp1 = (struct obj *) 0, *otmp2 = (struct obj *) 0; int extrawt = 0; @@ -2676,8 +2583,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 = (struct obj *) 0, *otmp2 = (struct obj *) 0; diff --git a/src/mkroom.c b/src/mkroom.c index c7f6196e4a..7c11ae2756 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -16,23 +16,22 @@ #include "hack.h" -STATIC_DCL boolean FDECL(isbig, (struct mkroom *)); -STATIC_DCL struct mkroom *FDECL(pick_room, (BOOLEAN_P)); -STATIC_DCL void NDECL(mkshop), FDECL(mkzoo, (int)), NDECL(mkswamp); -STATIC_DCL void NDECL(mktemple); -STATIC_DCL coord *FDECL(shrine_pos, (int)); -STATIC_DCL struct permonst *NDECL(morguemon); -STATIC_DCL struct permonst *NDECL(squadmon); -STATIC_DCL void FDECL(save_room, (int, struct mkroom *)); -STATIC_DCL void FDECL(rest_room, (int, struct mkroom *)); +STATIC_DCL boolean isbig(struct mkroom *); +STATIC_DCL struct mkroom *pick_room(boolean); +STATIC_DCL void mkshop(void), mkzoo(int), mkswamp(void); +STATIC_DCL void mktemple(void); +STATIC_DCL coord *shrine_pos(int); +STATIC_DCL struct permonst *morguemon(void); +STATIC_DCL struct permonst *squadmon(void); +STATIC_DCL void save_room(int, struct mkroom *); +STATIC_DCL void rest_room(int, struct mkroom *); #define sq(x) ((x) * (x)) extern const struct shclass shtypes[]; /* defined in shknam.c */ STATIC_OVL 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); @@ -42,8 +41,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 */ @@ -203,8 +201,7 @@ mkshop() /* pick an unused room, preferably with only one door */ STATIC_OVL struct mkroom * -pick_room(strict) -register boolean strict; +pick_room(register boolean strict) { register struct mkroom *sroom; register int i = nroom; @@ -228,8 +225,7 @@ register boolean strict; } STATIC_OVL void -mkzoo(type) -int type; +mkzoo(int type) { register struct mkroom *sroom; @@ -240,8 +236,7 @@ int type; } void -fill_zoo(sroom) -struct mkroom *sroom; +fill_zoo(struct mkroom *sroom) { struct monst *mon; register int sx, sy, i; @@ -410,10 +405,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; @@ -522,8 +514,7 @@ mkswamp() /* Michiel Huisjes & Fred de Wilde */ } STATIC_OVL coord * -shrine_pos(roomno) -int roomno; +shrine_pos(int roomno) { static coord buf; int delta; @@ -569,8 +560,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; @@ -587,8 +577,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; @@ -598,8 +587,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; @@ -609,32 +597,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; @@ -689,8 +671,7 @@ coord *c; * - ANY_TYPE */ struct mkroom * -search_special(type) -schar type; +search_special(schar type) { register struct mkroom *croom; @@ -771,9 +752,7 @@ squadmon() * (if any). */ STATIC_OVL void -save_room(fd, r) -int fd; -struct mkroom *r; +save_room(int fd, struct mkroom *r) { short i; @@ -791,8 +770,7 @@ struct mkroom *r; * save_rooms : Save all the rooms on disk! */ void -save_rooms(fd) -int fd; +save_rooms(int fd) { short i; @@ -803,9 +781,7 @@ int fd; } STATIC_OVL void -rest_room(fd, r) -int fd; -struct mkroom *r; +rest_room(int fd, struct mkroom *r) { short i; @@ -822,8 +798,7 @@ struct mkroom *r; * the disk. */ void -rest_rooms(fd) -int fd; +rest_rooms(int fd) { short i; @@ -840,8 +815,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/mon.c b/src/mon.c index ade5968106..c1e786114d 100644 --- a/src/mon.c +++ b/src/mon.c @@ -13,20 +13,20 @@ STATIC_VAR boolean vamp_rise_msg; -STATIC_DCL void FDECL(sanity_check_single_mon, (struct monst *, const char *)); -STATIC_DCL boolean FDECL(restrap, (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 boolean FDECL(validvamp, (struct monst *, int *, int)); -STATIC_DCL struct permonst *FDECL(accept_newcham_form, (int)); -STATIC_DCL struct obj *FDECL(make_corpse, (struct monst *, unsigned)); -STATIC_DCL void FDECL(m_detach, (struct monst *, struct permonst *)); -STATIC_DCL void FDECL(lifesaved_monster, (struct monst *)); +STATIC_DCL void sanity_check_single_mon(struct monst *, const char *); +STATIC_DCL boolean restrap(struct monst *); +STATIC_DCL long mm_aggression(struct monst *, struct monst *); +STATIC_DCL long mm_displacement(struct monst *, struct monst *); +STATIC_DCL int pick_animal(void); +STATIC_DCL void kill_eggs(struct obj *); +STATIC_DCL int pickvampshape(struct monst *); +STATIC_DCL boolean isspecmon(struct monst *); +STATIC_DCL boolean validspecmon(struct monst *, int); +STATIC_DCL boolean validvamp(struct monst *, int *, int); +STATIC_DCL struct permonst *accept_newcham_form(int); +STATIC_DCL struct obj *make_corpse(struct monst *, unsigned); +STATIC_DCL void m_detach(struct monst *, struct permonst *); +STATIC_DCL void lifesaved_monster(struct monst *); #define LEVEL_SPECIFIC_NOCORPSE(mdat) \ (Is_rogue_level(&u.uz) \ @@ -41,9 +41,7 @@ const char *warnings[] = { void -sanity_check_single_mon(mtmp, msg) -struct monst *mtmp; -const char *msg; +sanity_check_single_mon(struct monst *mtmp, const char *msg) { if (DEADMONSTER(mtmp)) return; @@ -76,8 +74,7 @@ mon_sanity_check() /* 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: @@ -130,8 +127,7 @@ int mndx; * if mode is 1. */ int -genus(mndx, mode) -int mndx, mode; +genus(int mndx, int mode) { switch (mndx) { /* Quest guardians */ @@ -196,8 +192,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; @@ -226,9 +221,7 @@ int mndx; * etc.... */ STATIC_OVL struct obj * -make_corpse(mtmp, corpseflags) -register struct monst *mtmp; -unsigned corpseflags; +make_corpse(register struct monst *mtmp, unsigned corpseflags) { register struct permonst *mdat = mtmp->data; int num; @@ -420,8 +413,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, infountain; @@ -531,8 +523,7 @@ register struct monst *mtmp; } int -mcalcmove(mon) -struct monst *mon; +mcalcmove(struct monst *mon) { int mmove = mon->data->mmove; @@ -740,8 +731,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; @@ -832,8 +822,7 @@ 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 */ { register struct obj *otmp, *otmp2; struct permonst *ptr, *original_ptr = mtmp->data; @@ -953,8 +942,7 @@ struct monst *mtmp; } void -mpickgold(mtmp) -register struct monst *mtmp; +mpickgold(register struct monst *mtmp) { register struct obj *gold; int mat_idx; @@ -973,9 +961,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) { register struct obj *otmp, *otmp2, *otmp3; int carryamt = 0; @@ -1023,8 +1009,7 @@ register const char *str; } int -curr_mon_load(mtmp) -struct monst *mtmp; +curr_mon_load(struct monst *mtmp) { int curload = 0; struct obj *obj; @@ -1038,8 +1023,7 @@ struct monst *mtmp; } int -max_mon_load(mtmp) -struct monst *mtmp; +max_mon_load(struct monst *mtmp) { long maxload; @@ -1082,9 +1066,7 @@ 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 iquan, otyp = otmp->otyp, newload = otmp->owt; struct permonst *mdat = mtmp->data; @@ -1157,11 +1139,10 @@ 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, /* coord poss[9] */ + long *info, /* long info[9] */ + long flag) { struct permonst *mdat = mon->data; register struct trap *ttmp; @@ -1384,9 +1365,8 @@ long flag; other monsters; just hand to hand fighting when they happen to be next to each other. */ STATIC_OVL 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 */ { /* supposedly purple worms are attracted to shrieking because they like to eat shriekers, so attack the latter when feasible */ @@ -1401,9 +1381,8 @@ struct monst *magr, /* monster that is currently deciding where to move */ /* Monster displacing another monster out of the way */ STATIC_OVL 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; @@ -1425,9 +1404,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); @@ -1462,8 +1439,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; @@ -1506,9 +1482,8 @@ 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; boolean unhide = (monst_list != 0); @@ -1553,8 +1528,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; @@ -1600,8 +1574,7 @@ struct monst *mtmp2, *mtmp1; } void -dealloc_mextra(m) -struct monst *m; +dealloc_mextra(struct monst *m) { struct mextra *x = m->mextra; @@ -1626,8 +1599,7 @@ struct monst *m; } void -dealloc_monst(mon) -struct monst *mon; +dealloc_monst(struct monst *mon) { if (mon->nmon) panic("dealloc_monst with nmon"); @@ -1638,9 +1610,8 @@ struct monst *mon; /* remove effects of mtmp from other data structures */ STATIC_OVL 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 */ { if (mtmp == context.polearm.hitmon) context.polearm.hitmon = 0; @@ -1666,8 +1637,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); @@ -1679,8 +1649,7 @@ struct monst *mon; } STATIC_OVL void -lifesaved_monster(mtmp) -struct monst *mtmp; +lifesaved_monster(struct monst *mtmp) { boolean surviver; struct obj *lifesave = mlifesaver(mtmp); @@ -1726,8 +1695,7 @@ struct monst *mtmp; } void -mondead(mtmp) -register struct monst *mtmp; +mondead(register struct monst *mtmp) { struct permonst *mptr; int tmp; @@ -1860,10 +1828,9 @@ register struct monst *mtmp; /* 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; @@ -1926,8 +1893,7 @@ boolean was_swallowed; /* digestion */ /* drop (perhaps) a cadaver and remove monster */ void -mondied(mdef) -register struct monst *mdef; +mondied(register struct monst *mdef) { mondead(mdef); if (mdef->mhp > 0) @@ -1940,8 +1906,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 */ @@ -1962,8 +1927,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; @@ -2045,10 +2009,7 @@ struct monst *mdef; /* another monster has killed the monster mdef */ void -monkilled(mdef, fltxt, how) -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 */ @@ -2071,8 +2032,7 @@ int how; } void -unstuck(mtmp) -struct monst *mtmp; +unstuck(struct monst *mtmp) { if (u.ustuck == mtmp) { if (u.uswallow) { @@ -2090,18 +2050,16 @@ struct monst *mtmp; } void -killed(mtmp) -struct monst *mtmp; +killed(struct monst *mtmp) { xkilled(mtmp, 1); } /* the player has killed the monster mtmp */ void -xkilled(mtmp, dest) -struct monst *mtmp; -int dest; /* dest==1, normal; dest==0, don't print message; dest==2, don't - drop corpse either; dest==3, message but no corpse */ +xkilled(struct monst *mtmp, + int dest) /* dest==1, normal; dest==0, don't print message; dest==2, don't + drop corpse either; dest==3, message but no corpse */ { int tmp, mndx, x = mtmp->mx, y = mtmp->my; struct permonst *mdat; @@ -2292,8 +2250,7 @@ int dest; /* dest==1, normal; dest==0, don't print message; dest==2, don't /* 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) -struct monst *mtmp; +mon_to_stone(struct monst *mtmp) { if (mtmp->data->mlet == S_GOLEM) { /* it's a golem, and not a stone golem */ @@ -2313,8 +2270,7 @@ struct monst *mtmp; /* 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); @@ -2340,8 +2296,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; @@ -2367,10 +2322,8 @@ struct monst *mtmp; * 0 - in most cases. */ boolean -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(register 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; @@ -2421,8 +2374,7 @@ boolean move_other; /* make sure mtmp gets to x, y! so move m_at(x, y) */ /* 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) { @@ -2449,8 +2401,7 @@ struct monst *mtmp; } void -setmangry(mtmp) -struct monst *mtmp; +setmangry(struct monst *mtmp) { mtmp->mstrategy &= ~STRAT_WAITMASK; if (!mtmp->mpeaceful) @@ -2499,8 +2450,7 @@ struct monst *mtmp; /* wake up a monster, usually making it angry in the process */ void -wakeup(mtmp) -register struct monst *mtmp; +wakeup(register struct monst *mtmp) { mtmp->msleeping = 0; finish_meating(mtmp); @@ -2535,8 +2485,7 @@ wake_nearby() /* Wake up monsters near some particular location. */ void -wake_nearto(x, y, distance) -register int x, y, distance; +wake_nearto(register int x, register int y, register int distance) { register struct monst *mtmp; @@ -2553,8 +2502,7 @@ register 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_door_mappear(mtmp) || is_obj_mappear(mtmp, BOULDER)); @@ -2623,8 +2571,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; @@ -2643,8 +2590,7 @@ struct monst *mon; /* unwatched hiders may hide again; if so, returns True */ STATIC_OVL boolean -restrap(mtmp) -register struct monst *mtmp; +restrap(register struct monst *mtmp) { struct trap *t; @@ -2669,8 +2615,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); @@ -2703,8 +2648,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; @@ -2730,8 +2674,7 @@ static short *animal_list = 0; /* list of PM values for animal monsters */ static int animal_list_count; void -mon_animal_list(construct) -boolean construct; +mon_animal_list(boolean construct) { if (construct) { short animal_temp[SPECIAL_PM]; @@ -2773,9 +2716,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; unsigned was_female = mon->female; @@ -2805,8 +2746,7 @@ int shiftflags; } STATIC_OVL int -pickvampshape(mon) -struct monst *mon; +pickvampshape(struct monst *mon) { int mndx = mon->cham; /* avoid picking monsters with lowercase display symbols ('d' for wolf @@ -2834,8 +2774,7 @@ struct monst *mon; /* nonshapechangers who warrant special polymorph handling */ STATIC_OVL boolean -isspecmon(mon) -struct monst *mon; +isspecmon(struct monst *mon) { return (mon->isshk || mon->ispriest || mon->isgd || mon->m_id == quest_status.leader_m_id); @@ -2845,9 +2784,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_OVL boolean -validspecmon(mon, mndx) -struct monst *mon; -int mndx; +validspecmon(struct monst *mon, int mndx) { if (mndx == NON_PM) return TRUE; /* caller wants random */ @@ -2869,9 +2806,7 @@ int mndx; /* prevent wizard mode user from specifying invalid vampshifter shape */ STATIC_OVL 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)) @@ -2920,8 +2855,7 @@ int *mndx_p, monclass; } int -select_newcham_form(mon) -struct monst *mon; +select_newcham_form(struct monst *mon) { int mndx = NON_PM, tryct; @@ -3030,8 +2964,7 @@ struct monst *mon; /* this used to be inline within newcham() but monpolycontrol needs it too */ STATIC_OVL struct permonst * -accept_newcham_form(mndx) -int mndx; +accept_newcham_form(int mndx) { struct permonst *mdat; @@ -3052,9 +2985,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) @@ -3072,11 +3003,10 @@ 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 hpn, hpd; int mndx, tryct; @@ -3276,8 +3206,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 @@ -3300,9 +3229,8 @@ 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, /* parent monster; caller must handle lays_eggs() check */ + boolean force_ordinary) { if (force_ordinary || !BREEDER_EGG) { if (mnum == PM_QUEEN_BEE) @@ -3316,9 +3244,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) { int alt_idx; @@ -3339,8 +3265,7 @@ boolean egg; /* kill off any eggs of genocided monsters */ STATIC_OVL void -kill_eggs(obj_list) -struct obj *obj_list; +kill_eggs(struct obj *obj_list) { struct obj *otmp; @@ -3411,9 +3336,7 @@ kill_genocided_monsters() } 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; @@ -3446,8 +3369,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; @@ -3504,9 +3426,7 @@ pacify_guards() } void -mimic_hit_msg(mtmp, otyp) -struct monst *mtmp; -short otyp; +mimic_hit_msg(struct monst *mtmp, short otyp) { short ap = mtmp->mappearance; @@ -3526,8 +3446,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 9fb2491d53..8f09874f24 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -8,10 +8,7 @@ /* set up an individual monster's base type (initial creation, shapechange) */ void -set_mon_data(mon, ptr, flag) -struct monst *mon; -struct permonst *ptr; -int flag; +set_mon_data(struct monst *mon, struct permonst *ptr, int flag) { mon->data = ptr; if (flag == -1) @@ -26,9 +23,7 @@ int flag; /* 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; @@ -40,17 +35,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; @@ -69,8 +61,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] @@ -80,8 +71,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; struct obj *wep; @@ -97,8 +87,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); @@ -131,8 +120,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); @@ -170,11 +158,10 @@ 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; @@ -258,8 +245,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); @@ -282,16 +268,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)); } /* True if monster-type 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) || ptr->mlet == S_VAMPIRE || is_demon(ptr) || ptr == &mons[PM_SHADE] @@ -300,8 +284,7 @@ register struct permonst *ptr; /* 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) @@ -311,8 +294,7 @@ struct permonst *mptr; /* returns True if monster can blow (whistle, etc) */ boolean -can_blow(mtmp) -register struct monst *mtmp; +can_blow(register struct monst *mtmp) { if ((is_silent(mtmp->data) || mtmp->data->msound == MS_BUZZ) && (breathless(mtmp->data) || verysmall(mtmp->data) @@ -325,8 +307,7 @@ register struct monst *mtmp; /* True if mon is vulnerable to strangulation */ boolean -can_be_strangled(mon) -struct monst *mon; +can_be_strangled(struct monst *mon) { struct obj *mamul; boolean nonbreathing, nobrainer; @@ -358,8 +339,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; @@ -369,8 +349,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)); @@ -378,8 +357,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; @@ -393,8 +371,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)); @@ -402,8 +379,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? */ @@ -415,8 +391,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" */ @@ -438,9 +413,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; @@ -452,9 +425,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; } @@ -462,8 +433,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; @@ -510,8 +480,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; @@ -615,8 +584,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; @@ -637,8 +605,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 @@ -768,9 +735,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 @@ -859,8 +824,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; @@ -870,8 +834,7 @@ 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) -register struct monst *mtmp; +pronoun_gender(register struct monst *mtmp) { if (is_neuter(mtmp->data) || !canspotmon(mtmp)) return 2; @@ -881,8 +844,7 @@ register struct monst *mtmp; /* 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; @@ -973,8 +935,7 @@ static const short grownups[][2] = { }; int -little_to_big(montype) -int montype; +little_to_big(int montype) { register int i; @@ -987,8 +948,7 @@ int montype; } int -big_to_little(montype) -int montype; +big_to_little(int montype) { register int i; @@ -1006,8 +966,7 @@ int montype; * 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]; @@ -1024,9 +983,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)); @@ -1041,9 +998,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)); @@ -1059,9 +1014,7 @@ const char *def; /* return 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; @@ -1107,8 +1060,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 */ diff --git a/src/monmove.c b/src/monmove.c index 50329ceb52..afd0b1871b 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -8,18 +8,17 @@ extern boolean notonhead; -STATIC_DCL void FDECL(watch_on_duty, (struct monst *)); -STATIC_DCL int FDECL(disturb, (struct monst *)); -STATIC_DCL void FDECL(release_hero, (struct monst *)); -STATIC_DCL void FDECL(distfleeck, (struct monst *, int *, int *, int *)); -STATIC_DCL int FDECL(m_arrival, (struct monst *)); -STATIC_DCL boolean FDECL(stuff_prevents_passage, (struct monst *)); -STATIC_DCL int FDECL(vamp_shift, (struct monst *, struct permonst *)); +STATIC_DCL void watch_on_duty(struct monst *); +STATIC_DCL int disturb(struct monst *); +STATIC_DCL void release_hero(struct monst *); +STATIC_DCL void distfleeck(struct monst *, int *, int *, int *); +STATIC_DCL int m_arrival(struct monst *); +STATIC_DCL boolean stuff_prevents_passage(struct monst *); +STATIC_DCL int vamp_shift(struct monst *, struct permonst *); /* True if mtmp died */ boolean -mb_trapped(mtmp) -struct monst *mtmp; +mb_trapped(struct monst *mtmp) { if (flags.verbose) { if (cansee(mtmp->mx, mtmp->my) && !Unaware) @@ -42,9 +41,8 @@ struct monst *mtmp; /* check whether a monster is carrying a locking/unlocking tool */ boolean -monhaskey(mon, for_unlocking) -struct monst *mon; -boolean for_unlocking; /* true => credit card ok, false => not ok */ +monhaskey(struct monst *mon, + boolean for_unlocking) /* true => credit card ok, false => not ok */ { if (for_unlocking && m_carrying(mon, CREDIT_CARD)) return TRUE; @@ -52,9 +50,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 (canspotmon(mon)) pline("%s yells:", Amonnam(mon)); @@ -64,8 +60,7 @@ const char *shout; } STATIC_OVL void -watch_on_duty(mtmp) -register struct monst *mtmp; +watch_on_duty(register struct monst *mtmp) { int x, y; @@ -92,8 +87,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); @@ -117,9 +111,7 @@ register struct monst *mtmp; } boolean -onscary(x, y, mtmp) -int x, y; -struct monst *mtmp; +onscary(int x, int y, struct monst *mtmp) { boolean epresent = sengr_at("Elbereth", x, y, TRUE); @@ -160,9 +152,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) { if (mon->mhp < mon->mhpmax && (moves % 20 == 0 || regenerates(mon->data))) mon->mhp++; @@ -182,8 +172,7 @@ boolean digest_meal; * jolted awake. */ STATIC_OVL int -disturb(mtmp) -register struct monst *mtmp; +disturb(register struct monst *mtmp) { /* * + Ettins are hard to surprise. @@ -217,8 +206,7 @@ register struct monst *mtmp; /* ungrab/expel held/swallowed hero */ STATIC_OVL void -release_hero(mon) -struct monst *mon; +release_hero(struct monst *mon) { if (mon == u.ustuck) { if (u.uswallow) { @@ -234,11 +222,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)) @@ -274,9 +258,7 @@ boolean fleemsg; } STATIC_OVL 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; @@ -318,8 +300,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 -m_arrival(mon) -struct monst *mon; +m_arrival(struct monst *mon) { mon->mstrategy &= ~STRAT_ARRIVE; /* always reset */ @@ -331,8 +312,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; @@ -636,8 +616,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)); @@ -654,12 +633,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, /* coord poss[9] */ + long *info, /* long info[9] */ + int cnt, + xchar gx, + xchar gy) { int shortest_with_displacing = -1; int shortest_without_displacing = -1; @@ -697,9 +676,7 @@ xchar gx, gy; * 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; @@ -1396,24 +1373,21 @@ register int after; } 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; newsym(x, 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; @@ -1426,8 +1400,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; @@ -1499,9 +1472,7 @@ register struct monst *mtmp; * location however. */ boolean -undesirable_disp(mtmp, x, y) -struct monst *mtmp; -xchar x, y; +undesirable_disp(struct monst *mtmp, xchar x, xchar y) { boolean is_pet = (mtmp && mtmp->mtame && !mtmp->isminion); struct trap *trap = t_at(x, y); @@ -1528,8 +1499,7 @@ xchar x, y; * Used by can_ooze() and can_fog(). */ STATIC_OVL boolean -stuff_prevents_passage(mtmp) -struct monst *mtmp; +stuff_prevents_passage(struct monst *mtmp) { struct obj *chain, *obj; @@ -1566,8 +1536,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; @@ -1576,8 +1545,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 ((is_vampshifter(mtmp) || mtmp->data->mlet == S_VAMPIRE) && !Protection_from_shape_changers && !stuff_prevents_passage(mtmp)) @@ -1586,9 +1554,7 @@ struct monst *mtmp; } STATIC_OVL int -vamp_shift(mon, ptr) -struct monst *mon; -struct permonst *ptr; +vamp_shift(struct monst *mon, struct permonst *ptr) { int reslt = 0; diff --git a/src/monst.c b/src/monst.c index cf14f9e291..597657fd5a 100644 --- a/src/monst.c +++ b/src/monst.c @@ -26,7 +26,7 @@ #define C(color) #endif -void NDECL(monst_init); +void monst_init(void); /* * Entry Format: (from permonst.h) * diff --git a/src/mplayer.c b/src/mplayer.c index 6ad230d410..c692f90167 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -4,9 +4,9 @@ #include "hack.h" -STATIC_DCL const char *NDECL(dev_name); -STATIC_DCL void FDECL(get_mplname, (struct monst *, char *)); -STATIC_DCL void FDECL(mk_mplayer_armor, (struct monst *, SHORT_P)); +STATIC_DCL const char *dev_name(void); +STATIC_DCL void get_mplname(struct monst *, char *); +STATIC_DCL 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. @@ -67,9 +67,7 @@ dev_name() } STATIC_OVL 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; @@ -92,9 +90,7 @@ char *nam; } STATIC_OVL void -mk_mplayer_armor(mon, typ) -struct monst *mon; -short typ; +mk_mplayer_armor(struct monst *mon, short typ) { struct obj *obj; @@ -116,10 +112,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]; @@ -324,9 +317,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; @@ -354,8 +345,7 @@ boolean special; } void -mplayer_talk(mtmp) -register struct monst *mtmp; +mplayer_talk(register struct monst *mtmp) { static const char *same_class_msg[3] = { diff --git a/src/mthrowu.c b/src/mthrowu.c index b63a479008..badb39d231 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -4,7 +4,7 @@ #include "hack.h" -STATIC_DCL int FDECL(drop_throw, (struct obj *, BOOLEAN_P, int, int)); +STATIC_DCL int drop_throw(struct obj *, boolean, int, int); #define URETREATING(x, y) \ (distmin(u.ux, u.uy, x, y) > distmin(u.ux0, u.uy0, x, y)) @@ -24,10 +24,8 @@ extern boolean notonhead; /* for long worms */ /* hero is hit by something other than a monster */ int -thitu(tlev, dam, obj, name) -int tlev, dam; -struct obj *obj; -const char *name; /* if null, then format `obj' */ +thitu(int tlev, int dam, struct obj *obj, + const char *name) /* if null, then format `obj' */ { const char *onm, *knm; boolean is_acid; @@ -87,10 +85,7 @@ const char *name; /* if null, then format `obj' */ * Returns 0 if object still exists (not destroyed). */ STATIC_OVL 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; @@ -132,13 +127,12 @@ int x, y; /* 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; @@ -254,10 +248,11 @@ boolean verbose; /* give message(s) even when you can't see what happened */ } 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, + int dx, int dy, + int range, /* launch point, direction, and range */ + struct obj *obj) /* missile (or stack providing it) */ { struct monst *mtmp; struct obj *singleobj; @@ -479,9 +474,7 @@ struct obj *obj; /* missile (or stack providing it) */ /* 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) { @@ -496,9 +489,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--; @@ -510,8 +501,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; @@ -674,9 +664,7 @@ struct monst *mtmp; /* monster spits substance at you */ int -spitmu(mtmp, mattk) -struct monst *mtmp; -struct attack *mattk; +spitmu(struct monst *mtmp, struct attack *mattk) { struct obj *otmp; @@ -717,9 +705,7 @@ struct attack *mattk; /* monster breathes at you (ranged) */ int -breamu(mtmp, mattk) -struct monst *mtmp; -struct attack *mattk; +breamu(struct monst *mtmp, struct attack *mattk) { /* if new breath types are added, change AD_ACID to max type */ int typ = (mattk->adtyp == AD_RBRE) ? rnd(AD_ACID) : mattk->adtyp; @@ -757,9 +743,8 @@ struct attack *mattk; } boolean -linedup(ax, ay, bx, by, boulderhandling) -register xchar ax, ay, bx, by; -int boulderhandling; /* 0=block, 1=ignore, 2=conditionally block */ +linedup(register xchar ax, register xchar ay, register xchar bx, register xchar by, + int boulderhandling) /* 0=block, 1=ignore, 2=conditionally block */ { int dx, dy, boulderspots; @@ -800,8 +785,7 @@ int boulderhandling; /* 0=block, 1=ignore, 2=conditionally block */ /* is mtmp in position to use ranged attack? */ boolean -lined_up(mtmp) -register struct monst *mtmp; +lined_up(register struct monst *mtmp) { boolean ignore_boulders; @@ -819,9 +803,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; @@ -833,11 +815,10 @@ int type; /* TRUE iff thrown/kicked/rolled object doesn't pass through iron bars */ boolean -hits_bars(obj_p, x, y, always_hit, whodidit) -struct obj **obj_p; /* *obj_p will be set to NULL if object breaks */ -int x, y; -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, + 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; diff --git a/src/muse.c b/src/muse.c index 012ac8b8fd..588e291194 100644 --- a/src/muse.c +++ b/src/muse.c @@ -18,25 +18,25 @@ boolean m_using = FALSE; * are confused 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_DCL void FDECL(mzapmsg, (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_DCL boolean FDECL(cures_stoning, (struct monst *, struct obj *, - BOOLEAN_P)); -STATIC_DCL boolean FDECL(mcould_eat_tin, (struct monst *)); -STATIC_DCL boolean FDECL(muse_unslime, (struct monst *, struct obj *, - BOOLEAN_P)); -STATIC_DCL int FDECL(cures_sliming, (struct monst *, struct obj *)); -STATIC_DCL boolean FDECL(green_mon, (struct monst *)); +STATIC_DCL struct permonst *muse_newcham_mon(struct monst *); +STATIC_DCL int precheck(struct monst *, struct obj *); +STATIC_DCL void mzapmsg(struct monst *, struct obj *, boolean); +STATIC_DCL void mreadmsg(struct monst *, struct obj *); +STATIC_DCL void mquaffmsg(struct monst *, struct obj *); +STATIC_PTR int mbhitm(struct monst *, struct obj *); +STATIC_DCL void mbhit(struct monst *, int, + int (*)(MONST_P, OBJ_P), + int (*)(OBJ_P, OBJ_P), struct obj *); +STATIC_DCL void you_aggravate(struct monst *); +STATIC_DCL void mon_consume_unstone(struct monst *, struct obj *, + boolean, boolean); +STATIC_DCL boolean cures_stoning(struct monst *, struct obj *, + boolean); +STATIC_DCL boolean mcould_eat_tin(struct monst *); +STATIC_DCL boolean muse_unslime(struct monst *, struct obj *, + boolean); +STATIC_DCL int cures_sliming(struct monst *, struct obj *); +STATIC_DCL boolean green_mon(struct monst *); static struct musable { struct obj *offensive; @@ -60,9 +60,7 @@ static boolean zap_oseen; /* for wands which use mbhitm and are zapped at * anything (i.e. it teleported) and 1 if it's dead. */ STATIC_OVL int -precheck(mon, obj) -struct monst *mon; -struct obj *obj; +precheck(struct monst *mon, struct obj *obj) { boolean vis; @@ -158,10 +156,7 @@ struct obj *obj; } STATIC_OVL void -mzapmsg(mtmp, otmp, self) -struct monst *mtmp; -struct obj *otmp; -boolean self; +mzapmsg(struct monst *mtmp, struct obj *otmp, boolean self) { if (!canseemon(mtmp)) { if (!Deaf) @@ -179,9 +174,7 @@ boolean self; } STATIC_OVL void -mreadmsg(mtmp, otmp) -struct monst *mtmp; -struct obj *otmp; +mreadmsg(struct monst *mtmp, struct obj *otmp) { boolean vismon = canseemon(mtmp); char onambuf[BUFSZ]; @@ -220,9 +213,7 @@ struct obj *otmp; } STATIC_OVL void -mquaffmsg(mtmp, otmp) -struct monst *mtmp; -struct obj *otmp; +mquaffmsg(struct monst *mtmp, struct obj *otmp) { if (canseemon(mtmp)) { otmp->dknown = 1; @@ -265,8 +256,7 @@ struct obj *otmp; /* Select a defensive item/action for a monster. Returns TRUE iff one is found. */ boolean -find_defensive(mtmp) -struct monst *mtmp; +find_defensive(struct monst *mtmp) { register struct obj *obj = 0; struct trap *t; @@ -594,8 +584,7 @@ struct monst *mtmp; * 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; @@ -993,8 +982,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))]; @@ -1061,8 +1049,7 @@ struct monst *mtmp; * found. */ boolean -find_offensive(mtmp) -struct monst *mtmp; +find_offensive(struct monst *mtmp) { register struct obj *obj; boolean reflection_skip = (Reflecting && rn2(2)); @@ -1193,9 +1180,7 @@ struct monst *mtmp; STATIC_PTR int -mbhitm(mtmp, otmp) -register struct monst *mtmp; -register struct obj *otmp; +mbhitm(register struct monst *mtmp, register struct obj *otmp) { int tmp; @@ -1272,12 +1257,11 @@ register struct obj *otmp; * to merge the two functions...) */ STATIC_OVL 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 */ -struct obj *obj; /* 2nd arg to fhitm/fhito */ +mbhit(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 */ { register struct monst *mtmp; register struct obj *otmp; @@ -1364,8 +1348,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; @@ -1535,8 +1518,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))]; @@ -1593,8 +1575,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; @@ -1723,8 +1704,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; @@ -1738,8 +1718,7 @@ struct monst *mon; } int -use_misc(mtmp) -struct monst *mtmp; +use_misc(struct monst *mtmp) { int i; struct obj *otmp = m.misc; @@ -1946,8 +1925,7 @@ struct monst *mtmp; } STATIC_OVL 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))); @@ -1970,8 +1948,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))]; @@ -2006,9 +1983,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; @@ -2083,9 +2058,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); @@ -2124,8 +2097,7 @@ const char *str; } boolean -ureflects(fmt, str) -const char *fmt, *str; +ureflects(const char *fmt, const char *str) { /* Check from outermost to innermost objects */ if (EReflecting & W_ARMS) { @@ -2159,9 +2131,7 @@ const char *fmt, *str; /* 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; boolean tinok; @@ -2183,11 +2153,7 @@ boolean by_you; } STATIC_OVL 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), tinned = obj->otyp == TIN, food = obj->otyp == CORPSE || tinned, @@ -2260,10 +2226,7 @@ boolean stoning; /* decide whether obj can cure petrification; also used when picking up */ STATIC_OVL 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; @@ -2277,8 +2240,7 @@ boolean tinok; } STATIC_OVL boolean -mcould_eat_tin(mon) -struct monst *mon; +mcould_eat_tin(struct monst *mon) { struct obj *obj, *mwep; boolean welded_wep; @@ -2308,9 +2270,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; @@ -2349,10 +2309,9 @@ boolean by_you; /* mon uses an item--selected by caller--to burn away incipient slime */ STATIC_OVL boolean -muse_unslime(mon, obj, by_you) -struct monst *mon; -struct obj *obj; -boolean by_you; /* true: if mon kills itself, hero gets credit/blame */ +muse_unslime(struct monst *mon, + struct obj *obj, + boolean by_you) /* true: if mon kills itself, hero gets credit/blame */ { struct obj *odummyp; int otyp = obj->otyp, dmg; @@ -2412,9 +2371,7 @@ boolean by_you; /* true: if mon kills itself, hero gets credit/blame */ /* decide whether obj can be used to cure green slime */ STATIC_OVL 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) @@ -2428,8 +2385,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_OVL 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 89ff06127f..fe4e605877 100644 --- a/src/music.c +++ b/src/music.c @@ -28,29 +28,29 @@ #include "hack.h" -STATIC_DCL void FDECL(awaken_monsters, (int)); -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 void FDECL(do_earthquake, (int)); -STATIC_DCL int FDECL(do_improvisation, (struct obj *)); +STATIC_DCL void awaken_monsters(int); +STATIC_DCL void put_monsters_to_sleep(int); +STATIC_DCL void charm_snakes(int); +STATIC_DCL void calm_nymphs(int); +STATIC_DCL void charm_monsters(int); +STATIC_DCL void do_earthquake(int); +STATIC_DCL int do_improvisation(struct obj *); #ifdef UNIX386MUSIC -STATIC_DCL int NDECL(atconsole); -STATIC_DCL void FDECL(speaker, (struct obj *, char *)); +STATIC_DCL int atconsole(void); +STATIC_DCL 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_DCL void playinit(void); +STATIC_DCL void playstring(char *, size_t); +STATIC_DCL 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 /* @@ -58,8 +58,7 @@ void FDECL(amii_speaker, (struct obj *, char *, int)); */ STATIC_OVL void -awaken_monsters(distance) -int distance; +awaken_monsters(int distance) { register struct monst *mtmp; register int distm; @@ -87,8 +86,7 @@ int distance; */ STATIC_OVL void -put_monsters_to_sleep(distance) -int distance; +put_monsters_to_sleep(int distance) { register struct monst *mtmp; @@ -108,8 +106,7 @@ int distance; */ STATIC_OVL void -charm_snakes(distance) -int distance; +charm_snakes(int distance) { register struct monst *mtmp; int could_see_mon, was_peaceful; @@ -143,8 +140,7 @@ int distance; */ STATIC_OVL void -calm_nymphs(distance) -int distance; +calm_nymphs(int distance) { register struct monst *mtmp; @@ -167,8 +163,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 */ { register struct monst *mtmp; int distance, distm; @@ -209,8 +204,7 @@ struct monst *bugler; /* monster that played instrument */ * If swallowed, range is reduced to 0. */ STATIC_OVL void -charm_monsters(distance) -int distance; +charm_monsters(int distance) { struct monst *mtmp, *mtmp2; @@ -235,8 +229,7 @@ int distance; * That is: create random chasms (pits). */ STATIC_OVL void -do_earthquake(force) -int force; +do_earthquake(int force) { register int x, y; struct monst *mtmp; @@ -430,8 +423,7 @@ int force; * The player is trying to extract something from his/her instrument. */ STATIC_OVL int -do_improvisation(instr) -struct obj *instr; +do_improvisation(struct obj *instr) { int damage, do_spec = !Confusion; #if defined(MAC) || defined(AMIGA) || defined(VPIX_MUSIC) || defined(PCMUSIC) @@ -561,8 +553,7 @@ struct obj *instr; * So you want music... */ int -do_play_instrument(instr) -struct obj *instr; +do_play_instrument(struct obj *instr) { char buf[BUFSZ], c = 'y'; char *s; @@ -745,9 +736,7 @@ atconsole() } STATIC_OVL void -speaker(instr, buf) -struct obj *instr; -char *buf; +speaker(struct obj *instr, char *buf) { /* * For this to work, you need to have installed the PD speaker-control @@ -798,8 +787,7 @@ char *buf; /* emit tone of frequency hz for given number of ticks */ STATIC_OVL void -tone(hz, ticks) -unsigned int hz, ticks; +tone(unsigned int hz, unsigned int ticks) { ioctl(0, KDMKTONE, hz | ((ticks * 10) << 16)); #ifdef DEBUG @@ -810,8 +798,7 @@ unsigned int hz, ticks; /* rest for given number of ticks */ STATIC_OVL void -rest(ticks) -int ticks; +rest(int ticks) { nap(ticks * 10); #ifdef DEBUG @@ -822,9 +809,7 @@ int ticks; #include "interp.c" /* from snd86unx.shr */ STATIC_OVL void -speaker(instr, buf) -struct obj *instr; -char *buf; +speaker(struct obj *instr, char *buf) { /* emit a prefix to modify instrumental `timbre' */ playinit(); @@ -850,9 +835,7 @@ char *buf; } #ifdef VPIX_DEBUG -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { if (argc == 2) { playinit(); diff --git a/src/o_init.c b/src/o_init.c index 17f49b8ba5..89587d933d 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -5,16 +5,16 @@ #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 char *FDECL(oclass_to_name, (CHAR_P, char *)); +STATIC_DCL void setgemprobs(d_level *); +STATIC_DCL void shuffle(int, int, boolean); +STATIC_DCL void shuffle_all(void); +STATIC_DCL boolean interesting_to_discover(int); +STATIC_DCL char *oclass_to_name(char, char *); static NEARDATA short disco[NUM_OBJECTS] = DUMMY; #ifdef USE_TILES -STATIC_DCL void NDECL(shuffle_tiles); +STATIC_DCL void shuffle_tiles(void); extern short glyph2tile[]; /* from tile.c */ /* Shuffle tile assignments to match descriptions, so a red potion isn't @@ -41,8 +41,7 @@ shuffle_tiles() #endif /* USE_TILES */ STATIC_OVL void -setgemprobs(dlev) -d_level *dlev; +setgemprobs(d_level *dlev) { int j, first, lev; @@ -68,9 +67,7 @@ d_level *dlev; /* shuffle descriptions on objects o_low to o_high */ STATIC_OVL 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; @@ -183,9 +180,8 @@ init_objects() /* retrieve the range of objects that otyp shares descriptions with */ void -obj_shuffle_range(otyp, lo_p, hi_p) -int otyp; /* input: representative item */ -int *lo_p, *hi_p; /* output: range that item belongs among */ +obj_shuffle_range(int otyp, /* input: representative item */ + int *lo_p, int *hi_p) /* output: range that item belongs among */ { int i, ocls = objects[otyp].oc_class; @@ -287,8 +283,7 @@ oinit() } void -savenames(fd, mode) -int fd, mode; +savenames(int fd, int mode) { register int i; unsigned int len; @@ -317,8 +312,7 @@ int fd, mode; } void -restnames(fd) -register int fd; +restnames(register int fd) { register int i; unsigned int len; @@ -338,10 +332,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; @@ -367,8 +358,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; @@ -393,8 +383,7 @@ register int oindx; } STATIC_OVL boolean -interesting_to_discover(i) -register int i; +interesting_to_discover(register int i) { /* Pre-discovered objects are now printed with a '*' */ return (boolean) (objects[i].oc_uname != (char *) 0 @@ -472,9 +461,7 @@ dodiscovered() /* free after Robert Viduya */ /* lower case let_to_name() output, which differs from def_oc_syms[].name */ STATIC_OVL char * -oclass_to_name(oclass, buf) -char oclass; -char *buf; +oclass_to_name(char oclass, char *buf) { char *s; diff --git a/src/objects.c b/src/objects.c index 3c686746c9..5c38042a2e 100644 --- a/src/objects.c +++ b/src/objects.c @@ -1152,7 +1152,7 @@ OBJECT(OBJ(None, None), /* clang-format on */ /* *INDENT-ON* */ -void NDECL(objects_init); +void objects_init(void); /* dummy routine used to force linkage */ void diff --git a/src/objnam.c b/src/objnam.c index 18d78fee14..54d21b3c54 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -9,17 +9,17 @@ #define SCHAR_LIM 127 #define NUMOBUF 12 -STATIC_DCL char *FDECL(strprepend, (char *, const char *)); -STATIC_DCL short FDECL(rnd_otyp_by_wpnskill, (SCHAR_P)); -STATIC_DCL boolean FDECL(wishymatch, (const char *, const char *, BOOLEAN_P)); -STATIC_DCL char *NDECL(nextobuf); -STATIC_DCL void FDECL(releaseobuf, (char *)); -STATIC_DCL char *FDECL(minimal_xname, (struct obj *)); -STATIC_DCL void FDECL(add_erosion_words, (struct obj *, char *)); +STATIC_DCL char *strprepend(char *, const char *); +STATIC_DCL short rnd_otyp_by_wpnskill(schar); +STATIC_DCL boolean wishymatch(const char *, const char *, boolean); +STATIC_DCL char *nextobuf(void); +STATIC_DCL void releaseobuf(char *); +STATIC_DCL char *minimal_xname(struct obj *); +STATIC_DCL void add_erosion_words(struct obj *, char *); STATIC_DCL boolean -FDECL(singplur_lookup, (char *, char *, BOOLEAN_P, const char *const *)); -STATIC_DCL char *FDECL(singplur_compound, (char *)); -STATIC_DCL char *FDECL(xname_flags, (struct obj *, unsigned)); +singplur_lookup(char *, char *, boolean, const char *const *); +STATIC_DCL char *singplur_compound(char *); +STATIC_DCL char *xname_flags(struct obj *, unsigned); struct Jitem { int item; @@ -53,12 +53,10 @@ STATIC_OVL struct Jitem Japanese_items[] = { { SHORT_SWORD, "wakizashi" }, { POT_BOOZE, "sake" }, { 0, "" } }; -STATIC_DCL const char *FDECL(Japanese_item_name, (int i)); +STATIC_DCL const char *Japanese_item_name(int i); STATIC_OVL char * -strprepend(s, pref) -register char *s; -register const char *pref; +strprepend(register char *s, register const char *pref) { register int i = (int) strlen(pref); @@ -84,8 +82,7 @@ nextobuf() /* put the most recently allocated buffer back if possible */ STATIC_OVL 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 */ @@ -94,8 +91,7 @@ char *bufp; } char * -obj_typename(otyp) -register int otyp; +obj_typename(register int otyp) { char *buf = nextobuf(); register struct objclass *ocl = &objects[otyp]; @@ -171,8 +167,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; @@ -185,8 +180,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; @@ -205,9 +199,7 @@ struct obj *obj; * or doname() instead. */ char * -distant_name(obj, func) -struct obj *obj; -char *FDECL((*func), (OBJ_P)); +distant_name(struct obj *obj, char *(*func)(OBJ_P)) { char *str; @@ -221,8 +213,7 @@ char *FDECL((*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 "); @@ -237,16 +228,14 @@ boolean juice; /* whether or not to append " juice" to the name */ } char * -xname(obj) -struct obj *obj; +xname(struct obj *obj) { return xname_flags(obj, CXN_NORMAL); } char * -xname_flags(obj, cxn_flags) -register struct obj *obj; -unsigned cxn_flags; /* bitmask of CXN_xxx values */ +xname_flags(register struct obj *obj, + unsigned cxn_flags) /* bitmask of CXN_xxx values */ { register char *buf; register int typ = obj->otyp; @@ -567,8 +556,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; @@ -612,8 +600,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); @@ -629,8 +616,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); @@ -645,8 +631,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; @@ -668,9 +653,7 @@ struct permonst *ptr; } STATIC_OVL void -add_erosion_words(obj, prefix) -struct obj *obj; -char *prefix; +add_erosion_words(struct obj *obj, char *prefix) { boolean iscrys = (obj->otyp == CRYSKNIFE); boolean rknown; @@ -718,9 +701,7 @@ char *prefix; } 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 known, cknown, bknown, lknown; @@ -1034,24 +1015,21 @@ boolean with_price; } 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) -register struct obj *otmp; +not_fully_identified(register struct obj *otmp) { /* gold doesn't have any interesting attributes [yet?] */ if (otmp->oclass == COIN_CLASS) @@ -1087,10 +1065,9 @@ register struct obj *otmp; } 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; @@ -1175,8 +1152,7 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */ /* xname doesn't include monster type for "corpse"; cxname does */ char * -cxname(obj) -struct obj *obj; +cxname(struct obj *obj) { if (obj->otyp == CORPSE) return corpse_xname(obj, (const char *) 0, CXN_NORMAL); @@ -1185,8 +1161,7 @@ struct obj *obj; /* 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); @@ -1195,8 +1170,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; @@ -1263,11 +1237,10 @@ 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 *FDECL((*func), (OBJ_P)), /* main formatting routine */ - *FDECL((*altfunc), (OBJ_P)); /* alternate for shortest result */ -unsigned lenlimit; +short_oname(struct obj *obj, + char *(*func)(OBJ_P), /* main formatting routine */ + char *(*altfunc)(OBJ_P), /* alternate for shortest result */ + unsigned lenlimit) { struct obj save_obj; char unamebuf[12], onamebuf[12], *save_oname, *save_uname, *outbuf; @@ -1345,9 +1318,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 *FDECL((*func), (OBJ_P)); +singular(register struct obj *otmp, char *(*func)(OBJ_P)) { long savequan; char *nam; @@ -1364,8 +1335,7 @@ char *FDECL((*func), (OBJ_P)); } char * -an(str) -register const char *str; +an(register const char *str) { char *buf = nextobuf(); @@ -1386,8 +1356,7 @@ register const char *str; } char * -An(str) -const char *str; +An(const char *str) { char *tmp = an(str); @@ -1400,8 +1369,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; @@ -1449,8 +1417,7 @@ const char *str; } char * -The(str) -const char *str; +The(const char *str) { char *tmp = the(str); @@ -1460,9 +1427,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 prefix[PREFIX]; char *bp = cxname(otmp); @@ -1480,9 +1445,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); @@ -1500,9 +1463,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); @@ -1512,9 +1473,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)); @@ -1527,8 +1486,7 @@ const char *verb; /* capitalized variant of doname() */ char * -Doname2(obj) -struct obj *obj; +Doname2(struct obj *obj) { char *s = doname(obj); @@ -1538,8 +1496,7 @@ 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 *s = cxname(obj); @@ -1558,8 +1515,7 @@ struct obj *obj; /* capitalized variant of yname() */ char * -Yname2(obj) -struct obj *obj; +Yname2(struct obj *obj) { char *s = yname(obj); @@ -1572,8 +1528,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 ); */ @@ -1584,8 +1539,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); @@ -1595,8 +1549,7 @@ struct obj *obj; /* "scroll" or "scrolls" */ char * -simpleonames(obj) -struct obj *obj; +simpleonames(struct obj *obj) { char *simpleoname = minimal_xname(obj); @@ -1607,8 +1560,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; @@ -1630,8 +1582,7 @@ struct obj *obj; /* "the scroll" or "the scrolls" */ char * -thesimpleoname(obj) -struct obj *obj; +thesimpleoname(struct obj *obj) { char *simpleoname = simpleonames(obj); @@ -1640,8 +1591,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; @@ -1670,9 +1620,7 @@ static const char wrpsym[] = { WAND_CLASS, RING_CLASS, POTION_CLASS, /* 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; @@ -1704,9 +1652,7 @@ static const char *const special_subjs[] = { /* return form of the verb (input plural) for present tense 3rd person subj */ char * -vtense(subj, verb) -register const char *subj; -register const char *verb; +vtense(register const char *subj, register const char *verb) { char *buf = nextobuf(), *bspot; int len, ltmp; @@ -1844,10 +1790,9 @@ static const char *const as_is[] = { /* singularize/pluralize decisions common to both makesingular & makeplural */ STATIC_OVL 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; @@ -1885,8 +1830,7 @@ const char *const *alt_as_is; /* another set like as_is[] */ /* searches for common compounds, ex. lump of royal jelly */ STATIC_OVL 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[] = @@ -1934,8 +1878,7 @@ char *str; * 3.6.0: made case-insensitive. */ char * -makeplural(oldstr) -const char *oldstr; +makeplural(const char *oldstr) { register char *spot; char lo_c, *str = nextobuf(); @@ -2099,8 +2042,7 @@ const char *oldstr; * 3.6.0: made case-insensitive. */ char * -makesingular(oldstr) -const char *oldstr; +makesingular(const char *oldstr) { register char *p, *bp; const char *excess = 0; @@ -2208,10 +2150,9 @@ const char *oldstr; /* compare user string against object name string using fuzzy matching */ STATIC_OVL 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"; @@ -2375,8 +2316,7 @@ struct alt_spellings { }; short -rnd_otyp_by_wpnskill(skill) -schar skill; +rnd_otyp_by_wpnskill(schar skill) { int i, n = 0; short otyp = STRANGE_OBJECT; @@ -2405,9 +2345,7 @@ schar skill; * return null. */ struct obj * -readobjnam(bp, no_wish) -register char *bp; -struct obj *no_wish; +readobjnam(register char *bp, struct obj *no_wish) { register char *p; register int i; @@ -3503,8 +3441,7 @@ struct obj *no_wish; } int -rnd_class(first, last) -int first, last; +rnd_class(int first, int last) { int i, x, sum = 0; @@ -3522,8 +3459,7 @@ int first, last; } STATIC_OVL const char * -Japanese_item_name(i) -int i; +Japanese_item_name(int i) { struct Jitem *j = Japanese_items; @@ -3536,8 +3472,7 @@ int i; } const char * -suit_simple_name(suit) -struct obj *suit; +suit_simple_name(struct obj *suit) { const char *suitnm, *esuitp; @@ -3556,8 +3491,7 @@ struct obj *suit; } const char * -cloak_simple_name(cloak) -struct obj *cloak; +cloak_simple_name(struct obj *cloak) { if (cloak) { switch (cloak->otyp) { @@ -3578,8 +3512,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 @@ -3597,8 +3530,7 @@ struct obj *helmet; } const char * -mimic_obj_name(mtmp) -struct monst *mtmp; +mimic_obj_name(struct monst *mtmp) { if (mtmp->m_ap_type == M_AP_OBJECT && mtmp->mappearance != STRANGE_OBJECT) { @@ -3617,12 +3549,13 @@ 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 *FDECL((*func), (OBJ_P)), *FDECL((*altfunc), (OBJ_P)); -const char *lastR; +safe_qbuf(char *qbuf, /* output buffer */ + const char *qprefix, + const char *qsuffix, + struct obj *obj, + char *(*func)(OBJ_P), + char *(*altfunc)(OBJ_P), + const char *lastR) { 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 87c40042f5..7fd08355c2 100644 --- a/src/options.c +++ b/src/options.c @@ -481,45 +481,44 @@ 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 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 boolean FDECL(duplicate_opt_detection, (const char *, int)); -STATIC_DCL void FDECL(complain_about_duplicate, (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_DCL void FDECL(remove_autopickup_exception, - (struct autopickup_exception *)); -STATIC_OVL int FDECL(count_ape_maps, (int *, int *)); -STATIC_DCL const char *FDECL(attr2attrname, (int)); -STATIC_DCL int NDECL(query_color); -STATIC_DCL int NDECL(query_msgtype); -STATIC_DCL int FDECL(query_attr, (const char *)); -STATIC_DCL const char * FDECL(msgtype2name, (int)); -STATIC_DCL boolean FDECL(msgtype_add, (int, char *)); -STATIC_DCL void FDECL(free_one_msgtype, (int)); -STATIC_DCL int NDECL(msgtype_count); -STATIC_DCL boolean FDECL(add_menu_coloring_parsed, (char *, int, int)); -STATIC_DCL void FDECL(free_one_menu_coloring, (int)); -STATIC_DCL int NDECL(count_menucolors); -STATIC_DCL int FDECL(handle_add_list_remove, (const char *, int)); +STATIC_DCL void doset_add_menu(winid, const char *, int); +STATIC_DCL void nmcpy(char *, const char *, int); +STATIC_DCL void escapes(const char *, char *); +STATIC_DCL void rejectoption(const char *); +STATIC_DCL void badoption(const char *); +STATIC_DCL char *string_for_opt(char *, boolean); +STATIC_DCL char *string_for_env_opt(const char *, char *, boolean); +STATIC_DCL void bad_negation(const char *, boolean); +STATIC_DCL int change_inv_order(char *); +STATIC_DCL void oc_to_str(char *, char *); +STATIC_DCL int feature_alert_opts(char *, const char *); +STATIC_DCL const char *get_compopt_value(const char *, char *); +STATIC_DCL boolean special_handling(const char *, + boolean, boolean); +STATIC_DCL void warning_opts(char *, const char *); +STATIC_DCL boolean duplicate_opt_detection(const char *, int); +STATIC_DCL void complain_about_duplicate(const char *, int); + +STATIC_OVL void wc_set_font_name(int, char *); +STATIC_OVL int wc_set_window_colors(char *); +STATIC_OVL boolean is_wc_option(const char *); +STATIC_OVL boolean wc_supported(const char *); +STATIC_OVL boolean is_wc2_option(const char *); +STATIC_OVL boolean wc2_supported(const char *); +STATIC_DCL void remove_autopickup_exception(struct autopickup_exception *); +STATIC_OVL int count_ape_maps(int *, int *); +STATIC_DCL const char *attr2attrname(int); +STATIC_DCL int query_color(void); +STATIC_DCL int query_msgtype(void); +STATIC_DCL int query_attr(const char *); +STATIC_DCL const char * msgtype2name(int); +STATIC_DCL boolean msgtype_add(int, char *); +STATIC_DCL void free_one_msgtype(int); +STATIC_DCL int msgtype_count(void); +STATIC_DCL boolean add_menu_coloring_parsed(char *, int, int); +STATIC_DCL void free_one_menu_coloring(int); +STATIC_DCL int count_menucolors(void); +STATIC_DCL int handle_add_list_remove(const char *, int); void reglyph_darkroom() @@ -554,10 +553,7 @@ reglyph_darkroom() 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); @@ -585,8 +581,7 @@ boolean val_allowed; * bounds-check itself. */ char * -nh_getenv(ev) -const char *ev; +nh_getenv(const char *ev) { char *getev = getenv(ev); @@ -784,10 +779,7 @@ initoptions_finish() } STATIC_OVL void -nmcpy(dest, src, maxlen) -char *dest; -const char *src; -int maxlen; +nmcpy(char *dest, const char *src, int maxlen) { int count; @@ -816,9 +808,7 @@ int maxlen; * or 'O', plus stop if the non-digit is end-of-string. */ STATIC_OVL void -escapes(cp, tp) -const char *cp; -char *tp; +escapes(const char *cp, char *tp) { static NEARDATA const char oct[] = "01234567", dec[] = "0123456789", hex[] = "00112233445566778899aAbBcCdDeEfF"; @@ -889,8 +879,7 @@ char *tp; } STATIC_OVL void -rejectoption(optname) -const char *optname; +rejectoption(const char *optname) { #ifdef MICRO pline("\"%s\" settable only from %s.", optname, lastconfigfile); @@ -901,8 +890,7 @@ const char *optname; } STATIC_OVL void -badoption(opts) -const char *opts; +badoption(const char *opts) { if (!initial) { if (!strncmp(opts, "h", 1) || !strncmp(opts, "?", 1)) @@ -936,9 +924,7 @@ const char *opts; } STATIC_OVL char * -string_for_opt(opts, val_optional) -char *opts; -boolean val_optional; +string_for_opt(char *opts, boolean val_optional) { char *colon, *equals; @@ -956,10 +942,7 @@ boolean val_optional; } STATIC_OVL 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); @@ -969,9 +952,7 @@ boolean val_optional; } STATIC_OVL 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, with_parameter ? "both have a value and " : ""); @@ -987,8 +968,7 @@ boolean with_parameter; * the string. */ STATIC_OVL int -change_inv_order(op) -char *op; +change_inv_order(char *op) { int oc_sym, num; char *sp, buf[BUFSZ]; @@ -1020,9 +1000,7 @@ char *op; } STATIC_OVL void -warning_opts(opts, optype) -register char *opts; -const char *optype; +warning_opts(register char *opts, const char *optype) { uchar translate[WARNCOUNT]; int length, i; @@ -1041,8 +1019,7 @@ const char *optype; } void -assign_warnings(graph_chars) -register uchar *graph_chars; +assign_warnings(register uchar *graph_chars) { int i; @@ -1052,9 +1029,7 @@ register uchar *graph_chars; } STATIC_OVL 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; @@ -1088,8 +1063,7 @@ const char *optn; } void -set_duplicate_opt_detection(on_or_off) -int on_or_off; +set_duplicate_opt_detection(int on_or_off) { int k, *optptr; @@ -1120,9 +1094,8 @@ int on_or_off; } STATIC_OVL boolean -duplicate_opt_detection(opts, iscompound) -const char *opts; -int iscompound; /* 0 == boolean option, 1 == compound */ +duplicate_opt_detection(const char *opts, + int iscompound) /* 0 == boolean option, 1 == compound */ { int i, *optptr; @@ -1154,9 +1127,8 @@ int iscompound; /* 0 == boolean option, 1 == compound */ } STATIC_OVL void -complain_about_duplicate(opts, iscompound) -const char *opts; -int iscompound; /* 0 == boolean option, 1 == compound */ +complain_about_duplicate(const char *opts, + int iscompound) /* 0 == boolean option, 1 == compound */ { #ifdef MAC /* the Mac has trouble dealing with the output of messages while @@ -1243,8 +1215,7 @@ static const struct { }; const char * -clr2colorname(clr) -int clr; +clr2colorname(int clr) { int i; @@ -1255,8 +1226,7 @@ int clr; } const char * -attr2attrname(attr) -int attr; +attr2attrname(int attr) { int i; @@ -1296,8 +1266,7 @@ query_color() } int -query_attr(prompt) -const char *prompt; +query_attr(const char *prompt) { winid tmpwin; anything any; @@ -1337,8 +1306,7 @@ static const struct { }; const char * -msgtype2name(typ) -int typ; +msgtype2name(int typ) { int i; @@ -1377,9 +1345,7 @@ query_msgtype() } boolean -msgtype_add(typ, pattern) -int typ; -char *pattern; +msgtype_add(int typ, char *pattern) { struct plinemsg_type *tmp = (struct plinemsg_type *) alloc(sizeof (struct plinemsg_type)); @@ -1421,8 +1387,7 @@ msgtype_free() } void -free_one_msgtype(idx) -int idx; /* 0 .. */ +free_one_msgtype(int idx) /* 0 .. */ { struct plinemsg_type *tmp = plinemsg_types; struct plinemsg_type *prev = NULL; @@ -1447,8 +1412,7 @@ int idx; /* 0 .. */ } int -msgtype_type(msg) -const char *msg; +msgtype_type(const char *msg) { struct plinemsg_type *tmp = plinemsg_types; @@ -1474,8 +1438,7 @@ msgtype_count() } boolean -msgtype_parse_add(str) -char *str; +msgtype_parse_add(char *str) { char pattern[256]; char msgtype[11]; @@ -1496,9 +1459,7 @@ char *str; } 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; @@ -1528,8 +1489,7 @@ int c, a; /* parse '"regex_string"=color&attr' and add it to menucoloring */ boolean -add_menu_coloring(str) -char *str; +add_menu_coloring(char *str) { int i, c = NO_COLOR, a = ATR_NONE; char *tmps, *cs, *amp; @@ -1588,9 +1548,7 @@ char *str; } boolean -get_menu_coloring(str, color, attr) -char *str; -int *color, *attr; +get_menu_coloring(char *str, int *color, int *attr) { struct menucoloring *tmpmc; @@ -1620,8 +1578,7 @@ free_menu_coloring() } 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; @@ -1659,9 +1616,7 @@ count_menucolors() } void -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; @@ -3398,8 +3353,7 @@ static NEARDATA const char *sortltype[] = { "none", "loot", "full" }; * symbols. */ STATIC_OVL void -oc_to_str(src, dest) -char *src, *dest; +oc_to_str(char *src, char *dest) { int i; @@ -3417,8 +3371,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."); @@ -3436,8 +3389,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) { @@ -3457,11 +3409,10 @@ static char fmtstr_doset_add_menu[] = "%s%-15s [%s] "; static char fmtstr_doset_add_menu_tab[] = "%s\t[%s]"; STATIC_OVL 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 - if option cannot be changed */ +doset_add_menu(winid win, /* window to add to */ + const char *option, /* option name */ + int indexoffset) /* value to add to index in compopt[], or zero + if option cannot be changed */ { const char *value = "unknown"; /* current value */ char buf[BUFSZ], buf2[BUFSZ]; @@ -3714,9 +3665,7 @@ doset() } 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; @@ -3770,9 +3719,7 @@ struct symsetentry *symset_list = 0; /* files.c will populate this with list of available sets */ STATIC_OVL 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; @@ -4444,9 +4391,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 * -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", @@ -4813,8 +4758,7 @@ dotogglepickup() } int -add_autopickup_exception(mapping) -const char *mapping; +add_autopickup_exception(const char *mapping) { struct autopickup_exception *ape, **apehead; char text[256], *text2; @@ -4853,8 +4797,7 @@ const char *mapping; } STATIC_OVL void -remove_autopickup_exception(whichape) -struct autopickup_exception *whichape; +remove_autopickup_exception(struct autopickup_exception *whichape) { struct autopickup_exception *ape, *prev = 0; int chain = whichape->grab ? AP_GRAB : AP_LEAVE; @@ -4879,8 +4822,7 @@ struct autopickup_exception *whichape; } STATIC_OVL int -count_ape_maps(leave, grab) -int *leave, *grab; +count_ape_maps(int *leave, int *grab) { struct autopickup_exception *ape; int pass, totalapes, numapes[2] = { 0, 0 }; @@ -4918,9 +4860,7 @@ free_autopickup_exceptions() /* bundle some common usage into one easy-to-use routine */ int -load_symset(s, which_set) -const char *s; -int which_set; +load_symset(const char *s, int which_set) { clear_symsetentry(which_set, TRUE); @@ -4950,8 +4890,7 @@ free_symsets() /* Parse the value of a SYMBOLS line from a config file */ void -parsesymbols(opts) -register char *opts; +parsesymbols(register char *opts) { int val; char *op, *symname, *strval; @@ -4986,8 +4925,7 @@ register char *opts; } struct symparse * -match_sym(buf) -char *buf; +match_sym(char *buf) { size_t len = strlen(buf); const char *p = index(buf, ':'), *q = index(buf, '='); @@ -5011,8 +4949,7 @@ char *buf; } int -sym_val(strval) -char *strval; +sym_val(char *strval) { char buf[QBUFSZ]; buf[0] = '\0'; @@ -5090,9 +5027,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; @@ -5131,9 +5066,7 @@ const char *str; * adding a new entry--for user specified fruits only. */ int -fruitadd(str, replace_fruit) -char *str; -struct fruit *replace_fruit; +fruitadd(char *str, struct fruit *replace_fruit) { register int i; register struct fruit *f; @@ -5264,12 +5197,7 @@ struct fruit *replace_fruit; * 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; @@ -5393,9 +5321,7 @@ struct wc_Opt wc2_options[] = { { "fullscreen", WC2_FULLSCREEN }, * with the appropriate second argument. */ void -set_option_mod_status(optnam, status) -const char *optnam; -int status; +set_option_mod_status(const char *optnam, int status) { int k; @@ -5427,9 +5353,7 @@ int status; * SET_IN_GAME); */ void -set_wc_option_mod_status(optmask, status) -unsigned long optmask; -int status; +set_wc_option_mod_status(unsigned long optmask, int status) { int k = 0; @@ -5447,8 +5371,7 @@ int status; } STATIC_OVL boolean -is_wc_option(optnam) -const char *optnam; +is_wc_option(const char *optnam) { int k = 0; @@ -5461,8 +5384,7 @@ const char *optnam; } STATIC_OVL boolean -wc_supported(optnam) -const char *optnam; +wc_supported(const char *optnam) { int k = 0; @@ -5487,9 +5409,7 @@ const char *optnam; */ void -set_wc2_option_mod_status(optmask, status) -unsigned long optmask; -int status; +set_wc2_option_mod_status(unsigned long optmask, int status) { int k = 0; @@ -5507,8 +5427,7 @@ int status; } STATIC_OVL boolean -is_wc2_option(optnam) -const char *optnam; +is_wc2_option(const char *optnam) { int k = 0; @@ -5521,8 +5440,7 @@ const char *optnam; } STATIC_OVL boolean -wc2_supported(optnam) -const char *optnam; +wc2_supported(const char *optnam) { int k = 0; @@ -5536,9 +5454,7 @@ const char *optnam; } STATIC_OVL void -wc_set_font_name(opttype, fontname) -int opttype; -char *fontname; +wc_set_font_name(int opttype, char *fontname) { char **fn = (char **) 0; @@ -5572,8 +5488,7 @@ char *fontname; } STATIC_OVL 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 diff --git a/src/pager.c b/src/pager.c index 0a4fc87a78..e11b3b4f5c 100644 --- a/src/pager.c +++ b/src/pager.c @@ -8,25 +8,24 @@ #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 void FDECL(look_at_object, (char *, int, int, int)); -STATIC_DCL void FDECL(look_at_monster, (char *, char *, - struct monst *, int, int)); -STATIC_DCL struct permonst *FDECL(lookat, (int, int, char *, char *)); -STATIC_DCL void FDECL(checkfile, (char *, struct permonst *, - BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL void FDECL(look_all, (BOOLEAN_P,BOOLEAN_P)); -STATIC_DCL boolean FDECL(help_menu, (int *)); -STATIC_DCL void NDECL(docontact); +STATIC_DCL boolean is_swallow_sym(int); +STATIC_DCL int append_str(char *, const char *); +STATIC_DCL void look_at_object(char *, int, int, int); +STATIC_DCL void look_at_monster(char *, char *, + struct monst *, int, int); +STATIC_DCL struct permonst *lookat(int, int, char *, char *); +STATIC_DCL void checkfile(char *, struct permonst *, + boolean, boolean); +STATIC_DCL void look_all(boolean,boolean); +STATIC_DCL boolean help_menu(int *); +STATIC_DCL void docontact(void); #ifdef PORT_HELP -extern void NDECL(port_help); +extern void port_help(void); #endif /* Returns "true" for characters that could represent a monster's stomach. */ STATIC_OVL boolean -is_swallow_sym(c) -int c; +is_swallow_sym(int c) { int i; @@ -42,9 +41,7 @@ int c; * It is expected that buf is of size BUFSZ. */ STATIC_OVL 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 */ @@ -59,8 +56,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]; @@ -79,9 +75,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; struct monst *mtmp; @@ -118,9 +112,8 @@ struct obj **obj_p; } STATIC_OVL void -look_at_object(buf, x, y, glyph) -char *buf; /* output buffer */ -int x, y, glyph; +look_at_object(char *buf, /* output buffer */ + int x, int y, int glyph) { struct obj *otmp = 0; boolean fakeobj = object_from_map(glyph, x, y, &otmp); @@ -148,10 +141,10 @@ int x, y, glyph; } STATIC_OVL 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, /* output */ + char *monbuf, /* optional output */ + struct monst *mtmp, + int x, int y) { char *name, monnambuf[BUFSZ]; boolean accurate = !Hallucination; @@ -254,9 +247,7 @@ int x, y; * If not hallucinating and the glyph is a monster, also monster data. */ STATIC_OVL 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; @@ -373,10 +364,7 @@ char *buf, *monbuf; * Therefore, we create a copy of inp _just_ for data.base lookup. */ STATIC_OVL void -checkfile(inp, pm, user_typed_name, without_asking) -char *inp; -struct permonst *pm; -boolean user_typed_name, without_asking; +checkfile(char *inp, struct permonst *pm, boolean user_typed_name, boolean without_asking) { dlb *fp; char buf[BUFSZ], newstr[BUFSZ]; @@ -540,12 +528,7 @@ boolean user_typed_name, without_asking; } int -do_screen_description(cc, looked, sym, out_str, firstmatch) -coord cc; -boolean looked; -int sym; -char *out_str; -const char **firstmatch; +do_screen_description(coord cc, boolean looked, int sym, char *out_str, const char **firstmatch) { boolean need_to_look = FALSE; int glyph = NO_GLYPH; @@ -781,9 +764,7 @@ const char **firstmatch; const char what_is_an_unknown_object[] = "an unknown object"; int -do_look(mode, click_cc) -int mode; -coord *click_cc; +do_look(int mode, coord *click_cc) { boolean quick = (mode == 1); /* use cursor; don't search for "more info" */ boolean clicklook = (mode == 2); /* right mouse-click method */ @@ -979,9 +960,8 @@ coord *click_cc; } STATIC_OVL void -look_all(nearby, do_mons) -boolean nearby; /* True => within BOLTLIM, False => entire map */ -boolean do_mons; /* True => monsters, False => objects */ +look_all(boolean nearby, /* True => within BOLTLIM, False => entire map */ + boolean do_mons)/* True => monsters, False => objects */ { winid win; int x, y, lo_x, lo_y, hi_x, hi_y, glyph, count = 0; @@ -1120,9 +1100,7 @@ doidtrap() } char * -dowhatdoes_core(q, cbuf) -char q; -char *cbuf; +dowhatdoes_core(char q, char *cbuf) { dlb *fp; char bufr[BUFSZ]; @@ -1240,8 +1218,7 @@ static const char *help_menu_items[] = { }; STATIC_OVL boolean -help_menu(sel) -int *sel; +help_menu(int *sel) { winid tmpwin = create_nhwindow(NHW_MENU); #ifdef PORT_HELP diff --git a/src/pickup.c b/src/pickup.c index 0fa4e65ccc..26860e9364 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -10,39 +10,38 @@ #define CONTAINED_SYM '>' /* from invent.c */ -STATIC_DCL void FDECL(simple_look, (struct obj *, BOOLEAN_P)); +STATIC_DCL void simple_look(struct obj *, boolean); STATIC_DCL boolean -FDECL(query_classes, (char *, boolean *, boolean *, const char *, - struct obj *, BOOLEAN_P, int *)); -STATIC_DCL boolean FDECL(fatal_corpse_mistake, (struct obj *, BOOLEAN_P)); -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 *)); +query_classes(char *, boolean *, boolean *, const char *, + struct obj *, boolean, int *); +STATIC_DCL boolean fatal_corpse_mistake(struct obj *, boolean); +STATIC_DCL void check_here(boolean); +STATIC_DCL boolean n_or_more(struct obj *); +STATIC_DCL boolean all_but_uchain(struct obj *); #if 0 /* not used */ -STATIC_DCL boolean FDECL(allow_cat_no_uchain, (struct obj *)); +STATIC_DCL 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(out_container, (struct obj *)); -STATIC_DCL long FDECL(mbag_item_gone, (int, struct obj *)); -STATIC_DCL void FDECL(observe_quantum_cat, (struct obj *)); -STATIC_DCL void NDECL(explain_container_prompt); -STATIC_DCL int FDECL(traditional_loot, (BOOLEAN_P)); -STATIC_DCL int FDECL(menu_loot, (int, BOOLEAN_P)); -STATIC_DCL char FDECL(in_or_out_menu, (const char *, struct obj *, BOOLEAN_P, - BOOLEAN_P, BOOLEAN_P)); -STATIC_DCL int FDECL(container_at, (int, int, BOOLEAN_P)); -STATIC_DCL boolean FDECL(able_to_loot, (int, int, BOOLEAN_P)); -STATIC_DCL boolean NDECL(reverse_loot); -STATIC_DCL boolean FDECL(mon_beside, (int, int)); -STATIC_DCL int FDECL(do_loot_cont, (struct obj **)); -STATIC_DCL void FDECL(tipcontainer, (struct obj *)); +STATIC_DCL int autopick(struct obj *, int, menu_item **); +STATIC_DCL int count_categories(struct obj *, int); +STATIC_DCL long carry_count(struct obj *, struct obj *, long, + boolean, int *, int *); +STATIC_DCL int lift_object(struct obj *, struct obj *, long *, boolean); +STATIC_DCL boolean mbag_explodes(struct obj *, int); +STATIC_PTR int in_container(struct obj *); +STATIC_PTR int out_container(struct obj *); +STATIC_DCL long mbag_item_gone(int, struct obj *); +STATIC_DCL void observe_quantum_cat(struct obj *); +STATIC_DCL void explain_container_prompt(void); +STATIC_DCL int traditional_loot(boolean); +STATIC_DCL int menu_loot(int, boolean); +STATIC_DCL char in_or_out_menu(const char *, struct obj *, boolean, + boolean, boolean); +STATIC_DCL int container_at(int, int, boolean); +STATIC_DCL boolean able_to_loot(int, int, boolean); +STATIC_DCL boolean reverse_loot(void); +STATIC_DCL boolean mon_beside(int, int); +STATIC_DCL int do_loot_cont(struct obj **); +STATIC_DCL void tipcontainer(struct obj *); /* define for query_objlist() and autopickup() */ #define FOLLOW(curr, flags) \ @@ -75,9 +74,8 @@ static const char overloadmsg[] = "You have extreme difficulty lifting"; touching them */ /* much simpler version of the look-here code; used by query_classes() */ STATIC_OVL 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 @@ -100,12 +98,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 FDECL((*filter), (OBJ_P)); -int *itemcount; +collect_obj_classes(char ilets[], register struct obj *otmp, boolean here, boolean (*filter)(OBJ_P), int *itemcount) { register int iletct = 0; register char c; @@ -136,14 +129,9 @@ int *itemcount; * (ie, treated as if it had just been "?a"). */ STATIC_OVL 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[30], inbuf[BUFSZ]; /* FIXME: hardcoded ilets[] length */ int iletct, oclassct; @@ -155,7 +143,7 @@ int *menu_on_demand; oclasses[oclassct = 0] = '\0'; *one_at_a_time = *everything = m_seen = FALSE; iletct = collect_obj_classes(ilets, objs, here, - (boolean FDECL((*), (OBJ_P))) 0, &itemcount); + (boolean (*)(OBJ_P)) 0, &itemcount); if (iletct == 0) { return FALSE; } else if (iletct == 1) { @@ -245,9 +233,7 @@ int *menu_on_demand; /* check whether hero is bare-handedly touching a cockatrice corpse */ STATIC_OVL 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) @@ -266,9 +252,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; @@ -282,8 +266,7 @@ boolean remotely; /* look at the objects at our location, unless there are too many of them */ STATIC_OVL void -check_here(picked_some) -boolean picked_some; +check_here(boolean picked_some) { register struct obj *obj; register int ct = 0; @@ -310,8 +293,7 @@ static long val_for_n_or_more; /* query_objlist callback: return TRUE if obj's count is >= reference value */ STATIC_OVL boolean -n_or_more(obj) -struct obj *obj; +n_or_more(struct obj *obj) { if (obj == uchain) return FALSE; @@ -324,8 +306,7 @@ static char valid_menu_classes[MAXOCLASSES + 1 + 4 + 1]; static boolean class_filter, bucx_filter, shop_filter; void -add_valid_menu_class(c) -int c; +add_valid_menu_class(int c) { static int vmc_count = 0; @@ -355,8 +336,7 @@ int c; /* query_objlist callback: return TRUE if not uchain */ STATIC_OVL boolean -all_but_uchain(obj) -struct obj *obj; +all_but_uchain(struct obj *obj) { return (boolean) (obj != uchain); } @@ -364,15 +344,13 @@ struct obj *obj; /* query_objlist callback: return TRUE */ /*ARGUSED*/ 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) { /* unpaid and BUC checks don't apply to coins */ if (obj->oclass == COIN_CLASS) @@ -421,8 +399,7 @@ struct obj *obj; #if 0 /* not used */ /* query_objlist callback: return TRUE if valid category (class), no uchain */ STATIC_OVL boolean -allow_cat_no_uchain(obj) -struct obj *obj; +allow_cat_no_uchain(struct obj *obj) { if (obj != uchain && ((index(valid_menu_classes,'u') && obj->unpaid) @@ -435,8 +412,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 (boolean) (!!(otmp->owornmask & (W_ARMOR | W_ACCESSORY | W_WEAPON)) && index(valid_menu_classes, otmp->oclass) != 0); @@ -455,8 +431,7 @@ register struct obj *otmp; * 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; @@ -676,9 +651,8 @@ int what; /* should be a long */ } boolean -is_autopickup_exception(obj, grab) -struct obj *obj; -boolean grab; /* forced pickup, rather than forced leave behind? */ +is_autopickup_exception(struct obj *obj, + boolean grab) /* forced pickup, rather than forced leave behind? */ { /* * Does the text description of this match an exception? @@ -703,10 +677,9 @@ boolean grab; /* forced pickup, rather than forced leave behind? */ * function must free the pickup list. */ STATIC_OVL 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; @@ -770,13 +743,12 @@ menu_item **pick_list; /* list of objects and counts to pick up */ * pick nothing. */ 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 FDECL((*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, n, actualn; winid win; @@ -931,12 +903,11 @@ boolean FDECL((*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; @@ -1096,9 +1067,7 @@ int how; /* type of query */ } STATIC_OVL int -count_categories(olist, qflags) -struct obj *olist; -int qflags; +count_categories(struct obj *olist, int qflags) { char *pack; boolean counted_category; @@ -1126,11 +1095,12 @@ int qflags; /* could we carry `obj'? if not, could we carry some of it/them? */ STATIC_OVL 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, /* object to pick up */ + struct obj *container, /* bag it's coming out of */ + long count, + boolean telekinesis, + int *wt_before, + int *wt_after) { boolean adjust_wt = container && carried(container), is_gold = obj->oclass == COIN_CLASS; @@ -1268,10 +1238,10 @@ int *wt_before, *wt_after; /* determine whether character is able and player is willing to carry `obj' */ STATIC_OVL 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, /* object to pick up */ + struct obj *container, /* bag it's coming out of */ + long *cnt_p, + boolean telekinesis) { int result, old_wt, new_wt, prev_encumbr, next_encumbr; @@ -1356,10 +1326,9 @@ 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; @@ -1426,8 +1395,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) { obj_extract_self(otmp); if (!u.uswallow && otmp != uball && costly_spot(otmp->ox, otmp->oy)) { @@ -1504,9 +1472,7 @@ encumber_msg() /* Is there a container at x,y. Optional: return count of containers at x,y */ STATIC_OVL 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; @@ -1523,9 +1489,8 @@ boolean countem; } STATIC_OVL 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"; @@ -1553,8 +1518,7 @@ boolean looting; /* loot vs tip */ } STATIC_OVL boolean -mon_beside(x, y) -int x, y; +mon_beside(int x, int y) { int i, j, nx, ny; for (i = -1; i <= 1; i++) @@ -1568,8 +1532,7 @@ int x, y; } int -do_loot_cont(cobjp) -struct obj **cobjp; +do_loot_cont(struct obj **cobjp) { struct obj *cobj = *cobjp; if (!cobj) @@ -1836,10 +1799,7 @@ reverse_loot() /* 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; @@ -1898,9 +1858,7 @@ boolean *prev_loot; * it to explode. If the object is a bag itself, check recursively. */ STATIC_OVL 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) @@ -1923,8 +1881,7 @@ int depthin; /* Returns: -1 to stop, 1 item was inserted, 0 item was not inserted. */ STATIC_PTR int -in_container(obj) -register struct obj *obj; +in_container(register struct obj *obj) { boolean floor_container = !carried(current_container); boolean was_unpaid = FALSE; @@ -2063,16 +2020,14 @@ register struct obj *obj; } 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_PTR 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); @@ -2135,9 +2090,7 @@ register struct obj *obj; /* an object inside a cursed bag of holding is being destroyed */ STATIC_OVL 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; @@ -2157,8 +2110,7 @@ struct obj *item; } STATIC_OVL void -observe_quantum_cat(box) -struct obj *box; +observe_quantum_cat(struct obj *box) { static NEARDATA const char sc[] = "Schroedinger's Cat"; struct obj *deadcat; @@ -2202,8 +2154,7 @@ struct obj *box; /* used by askchain() to check for magic bag explosion */ boolean -container_gone(fn) -int FDECL((*fn), (OBJ_P)); +container_gone(int (*fn)(OBJ_P)) { /* result is only meaningful while use_container() is executing */ return ((fn == in_container || fn == out_container) @@ -2249,9 +2200,7 @@ u_handsy() static const char stashable[] = { ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, 0 }; int -use_container(objp, held) -struct obj **objp; -int held; +use_container(struct obj **objp, int held) { struct obj *curr, *otmp, *obj = *objp; boolean quantum_cat, cursed_mbag, loot_out, loot_in, loot_in_first, @@ -2482,10 +2431,9 @@ int held; /* loot current_container (take things out or put things in), by prompting */ STATIC_OVL int -traditional_loot(put_in) -boolean put_in; +traditional_loot(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 + 1]; const char *action; @@ -2501,7 +2449,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, @@ -2517,9 +2465,7 @@ boolean put_in; /* loot current_container (take things out or put things in), using a menu */ STATIC_OVL 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; @@ -2600,10 +2546,7 @@ boolean put_in; } STATIC_OVL char -in_or_out_menu(prompt, obj, outokay, inokay, alreadyused) -const char *prompt; -struct obj *obj; -boolean outokay, inokay, alreadyused; +in_or_out_menu(const char *prompt, struct obj *obj, boolean outokay, boolean inokay, boolean alreadyused) { /* underscore is not a choice; it's used to skip element [0] */ static const char lootchars[] = "_:oibrsq", abc_chars[] = "_:abcdeq"; @@ -2821,8 +2764,7 @@ dotip() } STATIC_OVL void -tipcontainer(box) -struct obj *box; /* or bag */ +tipcontainer(struct obj *box) /* or bag */ { xchar ox = u.ux, oy = u.uy; /* #tip only works at hero's location */ boolean empty_it = FALSE, diff --git a/src/pline.c b/src/pline.c index ce4b607022..e698a516f9 100644 --- a/src/pline.c +++ b/src/pline.c @@ -9,42 +9,25 @@ static boolean no_repeat = FALSE; static char prevmsg[BUFSZ]; -static char *FDECL(You_buf, (int)); +static char *You_buf(int); /*VARARGS1*/ /* Note that these declarations rely on knowledge of the internals * of the variable argument handling stuff in "tradstdc.h" */ -#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) -{ - VA_START(line); - VA_INIT(line, char *); - vpline(line, VA_ARGS); - VA_END(); +(const char *line, ...) { + va_list the_args; + va_start(the_args, line); + vpline(line, the_args); + va_end(the_args); } -# ifdef USE_STDARG static void vpline(const char *line, va_list the_args) -# else -static void -vpline(line, the_args) -const char *line; -va_list the_args; -# endif - -#else /* USE_STDARG | USE_VARARG */ - -# define vpline pline - -void pline -VA_DECL(const char *, line) -#endif /* USE_STDARG | USE_VARARG */ { /* start of vpline() or of nested block in USE_OLDARG's pline() */ char pbuf[3 * BUFSZ]; int ln; @@ -61,7 +44,7 @@ VA_DECL(const char *, line) return; if (index(line, '%')) { - Vsprintf(pbuf, line, VA_ARGS); + Vsprintf(pbuf, line, the_args); line = pbuf; } if ((ln = (int) strlen(line)) > BUFSZ - 1) { @@ -99,24 +82,17 @@ VA_DECL(const char *, line) iflags.last_msg = PLNMSG_UNKNOWN; strncpy(prevmsg, line, BUFSZ); if (msgtyp == MSGTYP_STOP) display_nhwindow(WIN_MESSAGE, TRUE); /* --more-- */ - -#if !(defined(USE_STDARG) || defined(USE_VARARGS)) - /* provide closing brace for the nested block - which immediately follows USE_OLDARGS's VA_DECL() */ - VA_END(); -#endif } /*VARARGS1*/ -void Norep -VA_DECL(const char *, line) +void Norep(const char *line, ...) { - VA_START(line); - VA_INIT(line, const char *); + va_list the_args; + va_start(the_args, line); no_repeat = TRUE; - vpline(line, VA_ARGS); + vpline(line, the_args); no_repeat = FALSE; - VA_END(); + va_end(the_args); return; } @@ -125,8 +101,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) @@ -153,111 +128,103 @@ free_youbuf() strcat((YouPrefix(pointer, prefix, text), pointer), text) /*VARARGS1*/ -void You -VA_DECL(const char *, line) +void You(const char *line, ...) { + va_list the_args; char *tmp; - VA_START(line); - VA_INIT(line, const char *); - vpline(YouMessage(tmp, "You ", line), VA_ARGS); - VA_END(); + va_start(the_args, line); + vpline(YouMessage(tmp, "You ", line), the_args); + va_end(the_args); } /*VARARGS1*/ -void Your -VA_DECL(const char *, line) +void Your(const char *line, ...) { + va_list the_args; char *tmp; - VA_START(line); - VA_INIT(line, const char *); - vpline(YouMessage(tmp, "Your ", line), VA_ARGS); - VA_END(); + va_start(the_args, line); + vpline(YouMessage(tmp, "Your ", line), the_args); + va_end(the_args); } /*VARARGS1*/ -void You_feel -VA_DECL(const char *, line) +void You_feel(const char *line, ...) { + va_list the_args; char *tmp; - VA_START(line); - VA_INIT(line, const char *); + va_start(the_args, line); if (Unaware) YouPrefix(tmp, "You dream that you feel ", line); else YouPrefix(tmp, "You feel ", line); - vpline(strcat(tmp, line), VA_ARGS); - VA_END(); + vpline(strcat(tmp, line), the_args); + va_end(the_args); } /*VARARGS1*/ -void You_cant -VA_DECL(const char *, line) +void You_cant(const char *line, ...) { + va_list the_args; char *tmp; - VA_START(line); - VA_INIT(line, const char *); - vpline(YouMessage(tmp, "You can't ", line), VA_ARGS); - VA_END(); + va_start(the_args, line); + vpline(YouMessage(tmp, "You can't ", line), the_args); + va_end(the_args); } /*VARARGS1*/ -void pline_The -VA_DECL(const char *, line) +void pline_The(const char *line, ...) { + va_list the_args; char *tmp; - VA_START(line); - VA_INIT(line, const char *); - vpline(YouMessage(tmp, "The ", line), VA_ARGS); - VA_END(); + va_start(the_args, line); + vpline(YouMessage(tmp, "The ", line), the_args); + va_end(the_args); } /*VARARGS1*/ -void There -VA_DECL(const char *, line) +void There(const char *line, ...) { + va_list the_args; char *tmp; - VA_START(line); - VA_INIT(line, const char *); - vpline(YouMessage(tmp, "There ", line), VA_ARGS); - VA_END(); + va_start(the_args, line); + vpline(YouMessage(tmp, "There ", line), the_args); + va_end(the_args); } /*VARARGS1*/ -void You_hear -VA_DECL(const char *, line) +void You_hear(const char *line, ...) { + va_list the_args; char *tmp; if (Deaf || !flags.acoustics) return; - VA_START(line); - VA_INIT(line, const char *); + va_start(the_args, line); if (Underwater) YouPrefix(tmp, "You barely hear ", line); else if (Unaware) YouPrefix(tmp, "You dream that you hear ", line); else YouPrefix(tmp, "You hear ", line); - vpline(strcat(tmp, line), VA_ARGS); - VA_END(); + vpline(strcat(tmp, line), the_args); + va_end(the_args); } /*VARARGS1*/ -void You_see -VA_DECL(const char *, line) +void You_see(const char *line, ...) { + va_list the_args; char *tmp; - VA_START(line); - VA_INIT(line, const char *); + va_start(the_args, line); if (Unaware) YouPrefix(tmp, "You dream that you see ", line); else if (Blind) /* caller should have caught this... */ YouPrefix(tmp, "You sense ", line); else YouPrefix(tmp, "You see ", line); - vpline(strcat(tmp, line), VA_ARGS); - VA_END(); + vpline(strcat(tmp, line), the_args); + va_end(the_args); } /* Print a message inside double-quotes. @@ -265,19 +232,18 @@ VA_DECL(const char *, line) * Gods can speak directly to you in spite of deafness. */ /*VARARGS1*/ -void verbalize -VA_DECL(const char *, line) +void verbalize(const char *line, ...) { + va_list the_args; char *tmp; - VA_START(line); - VA_INIT(line, const char *); + va_start(the_args, line); tmp = You_buf((int) strlen(line) + sizeof "\"\""); Strcpy(tmp, "\""); Strcat(tmp, line); Strcat(tmp, "\""); - vpline(tmp, VA_ARGS); - VA_END(); + vpline(tmp, the_args); + va_end(the_args); } /*VARARGS1*/ @@ -285,40 +251,25 @@ VA_DECL(const char *, line) * of the variable argument handling stuff in "tradstdc.h" */ -#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) +void raw_printf(const char *line, ...) { - VA_START(line); - VA_INIT(line, char *); - vraw_printf(line, VA_ARGS); - VA_END(); + va_list the_args; + va_start(the_args, line); + vraw_printf(line, the_args); + va_end(the_args); } -# ifdef USE_STDARG static void vraw_printf(const char *line, va_list the_args) -# else -static void -vraw_printf(line, the_args) -const char *line; -va_list the_args; -# endif - -#else /* USE_STDARG | USE_VARARG */ - -void raw_printf -VA_DECL(const char *, line) -#endif { char pbuf[3 * BUFSZ]; int ln; /* Do NOT use VA_START and VA_END in here... see above */ if (index(line, '%')) { - Vsprintf(pbuf, line, VA_ARGS); + Vsprintf(pbuf, line, the_args); line = pbuf; } if ((ln = (int) strlen(line)) > BUFSZ - 1) { @@ -328,34 +279,29 @@ VA_DECL(const char *, line) pbuf[BUFSZ - 1] = '\0'; /* terminate strncpy or truncate vsprintf */ } raw_print(line); -#if !(defined(USE_STDARG) || defined(USE_VARARGS)) - VA_END(); /* (see vpline) */ -#endif } /*VARARGS1*/ -void impossible -VA_DECL(const char *, s) +void impossible(const char *s, ...) { + va_list the_args; char pbuf[2 * BUFSZ]; - VA_START(s); - VA_INIT(s, const char *); + va_start(the_args, s); if (program_state.in_impossible) panic("impossible called impossible"); program_state.in_impossible = 1; - Vsprintf(pbuf, s, VA_ARGS); + Vsprintf(pbuf, s, the_args); pbuf[BUFSZ - 1] = '\0'; /* sanity */ paniclog("impossible", pbuf); pline("%s", pbuf); pline("Program in disorder - perhaps you'd better #quit."); program_state.in_impossible = 0; - VA_END(); + va_end(the_args); } const char * -align_str(alignment) -aligntyp alignment; +align_str(aligntyp alignment) { switch ((int) alignment) { case A_CHAOTIC: @@ -371,8 +317,7 @@ aligntyp alignment; } void -mstatusline(mtmp) -register struct monst *mtmp; +mstatusline(register struct monst *mtmp) { aligntyp alignment = mon_aligntyp(mtmp); char info[BUFSZ], monnambuf[BUFSZ]; @@ -556,9 +501,7 @@ self_invis_message() } 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/polyself.c b/src/polyself.c index 4cd01d0d64..8612ba939e 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -21,14 +21,14 @@ #include "hack.h" -STATIC_DCL void FDECL(check_strangling, (BOOLEAN_P)); -STATIC_DCL void FDECL(polyman, (const char *, const char *)); -STATIC_DCL void NDECL(break_armor); -STATIC_DCL void FDECL(drop_weapon, (int)); -STATIC_DCL void NDECL(uunstick); -STATIC_DCL int FDECL(armor_to_dragon, (int)); -STATIC_DCL void NDECL(newman); -STATIC_DCL boolean FDECL(polysense, (struct permonst *)); +STATIC_DCL void check_strangling(boolean); +STATIC_DCL void polyman(const char *, const char *); +STATIC_DCL void break_armor(void); +STATIC_DCL void drop_weapon(int); +STATIC_DCL void uunstick(void); +STATIC_DCL int armor_to_dragon(int); +STATIC_DCL void newman(void); +STATIC_DCL boolean polysense(struct permonst *); STATIC_VAR const char no_longer_petrify_resistant[] = "No longer petrify-resistant, you"; @@ -116,8 +116,7 @@ float_vs_flight() /* for changing into form that's immune to strangulation */ STATIC_OVL 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_OVL void -polyman(fmt, arg) -const char *fmt, *arg; +polyman(const char *fmt, const char *arg) { boolean sticky = (sticks(youmonst.data) && u.ustuck && !u.uswallow), was_mimicking = (youmonst.m_ap_type == M_AP_OBJECT); @@ -373,8 +371,7 @@ newman() } void -polyself(psflags) -int psflags; +polyself(int psflags) { char buf[BUFSZ]; int old_light, new_light, mntmp, class, tryct; @@ -578,8 +575,7 @@ int psflags; /* (try to) make a mntmp monster out of the player; returns 1 if polymorph successful */ int -polymon(mntmp) -int mntmp; +polymon(int mntmp) { boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow, was_blind = !!Blind, dochange = FALSE; @@ -957,8 +953,7 @@ break_armor() } STATIC_OVL void -drop_weapon(alone) -int alone; +drop_weapon(int alone) { struct obj *otmp; const char *what, *which, *whichtoo; @@ -1514,8 +1509,7 @@ uunstick() } void -skinback(silently) -boolean silently; +skinback(boolean silently) { if (uskin) { if (!silently) @@ -1528,9 +1522,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", @@ -1686,8 +1678,7 @@ int part; } const char * -body_part(part) -int part; +body_part(int part) { return mbodypart(&youmonst, part); } @@ -1704,8 +1695,7 @@ poly_gender() } void -ugolemeffects(damtype, dam) -int damtype, dam; +ugolemeffects(int damtype, int dam) { int heal = 0; @@ -1736,8 +1726,7 @@ int damtype, dam; } STATIC_OVL int -armor_to_dragon(atyp) -int atyp; +armor_to_dragon(int atyp) { switch (atyp) { case GRAY_DRAGON_SCALE_MAIL: @@ -1781,8 +1770,7 @@ int atyp; * Some species have awareness of other species */ static boolean -polysense(mptr) -struct permonst *mptr; +polysense(struct permonst *mptr) { short warnidx = 0; diff --git a/src/potion.c b/src/potion.c index 7484d29d2e..fc7cbefdb2 100644 --- a/src/potion.c +++ b/src/potion.c @@ -9,17 +9,16 @@ 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_DCL long itimeout(long); +STATIC_DCL long itimeout_incr(long, int); +STATIC_DCL void ghost_from_bottle(void); STATIC_DCL boolean -FDECL(H2Opotion_dip, (struct obj *, struct obj *, BOOLEAN_P, const char *)); -STATIC_DCL short FDECL(mixtype, (struct obj *, struct obj *)); +H2Opotion_dip(struct obj *, struct obj *, boolean, const char *); +STATIC_DCL short mixtype(struct obj *, struct obj *); /* force `val' to be within valid range for intrinsic timeout value */ STATIC_OVL long -itimeout(val) -long val; +itimeout(long val) { if (val >= TIMEOUT) val = TIMEOUT; @@ -31,17 +30,14 @@ long val; /* increment `old' by `incr' and force result to be valid intrinsic timeout */ STATIC_OVL long -itimeout_incr(old, incr) -long old; -int incr; +itimeout_incr(long 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 *which, long 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 *which, int incr) { set_itimeout(which, itimeout_incr(*which, incr)); } void -make_confused(xtime, talk) -long xtime; -boolean talk; +make_confused(long xtime, boolean talk) { long old = HConfusion; @@ -77,9 +69,7 @@ boolean talk; } void -make_stunned(xtime, talk) -long xtime; -boolean talk; +make_stunned(long xtime, boolean talk) { long old = HStun; @@ -106,11 +96,10 @@ boolean talk; } void -make_sick(xtime, cause, talk, type) -long xtime; -const char *cause; /* sickness cause */ -boolean talk; -int type; +make_sick(long xtime, + const char *cause, /* sickness cause */ + boolean talk, + int type) { long old = Sick; @@ -155,9 +144,7 @@ int type; } void -make_slimed(xtime, msg) -long xtime; -const char *msg; +make_slimed(long xtime, const char *msg) { long old = Slimed; @@ -177,11 +164,7 @@ const char *msg; /* start or stop petrification */ void -make_stoned(xtime, msg, killedby, killername) -long xtime; -const char *msg; -int killedby; -const char *killername; +make_stoned(long xtime, const char *msg, int killedby, const char *killername) { long old = Stoned; @@ -202,9 +185,7 @@ const char *killername; } void -make_vomiting(xtime, talk) -long xtime; -boolean talk; +make_vomiting(long xtime, boolean talk) { long old = Vomiting; @@ -222,9 +203,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 xtime, boolean talk) { long old = Blinded; boolean u_could_see, can_see_now; @@ -319,10 +298,9 @@ boolean talk; } 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; @@ -391,9 +369,7 @@ long mask; /* nonzero if resistance status should change by mask */ } void -make_deaf(xtime, talk) -long xtime; -boolean talk; +make_deaf(long xtime, boolean talk) { long old = HDeaf; boolean toggled = FALSE; @@ -517,8 +493,7 @@ dodrink() } int -dopotion(otmp) -register struct obj *otmp; +dopotion(register struct obj *otmp) { int retval; @@ -544,8 +519,7 @@ register struct obj *otmp; } int -peffects(otmp) -register struct obj *otmp; +peffects(register struct obj *otmp) { register int i, ii, lim; @@ -1085,9 +1059,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) { if (Upolyd) { @@ -1111,9 +1083,7 @@ register boolean curesick, cureblind; } void -strange_feeling(obj, txt) -struct obj *obj; -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.", @@ -1142,12 +1112,12 @@ bottlename() /* handle item dipped into water potion or steed saddle splashed by same */ STATIC_OVL 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 FDECL((*func), (OBJ_P)) = 0; + void (*func)(OBJ_P) = 0; const char *glowcolor = 0; #define COST_alter (-2) #define COST_none (-1) @@ -1220,10 +1190,7 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ } void -potionhit(mon, obj, your_fault) -register struct monst *mon; -register struct obj *obj; -boolean your_fault; +potionhit(register struct monst *mon, register struct obj *obj, boolean your_fault) { const char *botlnam = bottlename(); boolean isyou = (mon == &youmonst); @@ -1493,8 +1460,7 @@ boolean your_fault; /* vapors are inhaled or get in your eyes */ void -potionbreathe(obj) -register struct obj *obj; +potionbreathe(register struct obj *obj) { register int i, ii, isdone, kn = 0; @@ -1654,8 +1620,7 @@ register struct obj *obj; /* returns the potion type when o1 is dipped in o2 */ STATIC_OVL 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 @@ -2128,8 +2093,7 @@ dodip() /* *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); @@ -2148,8 +2112,7 @@ struct monst **monp; } void -djinni_from_bottle(obj) -struct obj *obj; +djinni_from_bottle(struct obj *obj) { struct monst *mtmp; int chance; @@ -2206,9 +2169,8 @@ 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 e3da3e37d0..3fab94b65f 100644 --- a/src/pray.c +++ b/src/pray.c @@ -4,22 +4,22 @@ #include "hack.h" -STATIC_PTR int NDECL(prayer_done); -STATIC_DCL struct obj *NDECL(worst_cursed_item); -STATIC_DCL int NDECL(in_trouble); -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_DCL 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_PTR int prayer_done(void); +STATIC_DCL struct obj *worst_cursed_item(void); +STATIC_DCL int in_trouble(void); +STATIC_DCL void fix_worst_trouble(int); +STATIC_DCL void angrygods(ALIGNTYP_P); +STATIC_DCL void at_your_feet(const char *); +STATIC_DCL void gcrownu(void); +STATIC_DCL void pleased(ALIGNTYP_P); +STATIC_DCL void godvoice(ALIGNTYP_P, const char *); +STATIC_DCL void god_zaps_you(ALIGNTYP_P); +STATIC_DCL void fry_by_god(ALIGNTYP_P, boolean); +STATIC_DCL void gods_angry(ALIGNTYP_P); +STATIC_DCL void gods_upset(ALIGNTYP_P); +STATIC_DCL void consume_offering(struct obj *); +STATIC_DCL boolean water_prayer(boolean); +STATIC_DCL boolean blocked_boulder(int, int); /* simplify a few tests */ #define Cursed_obj(obj, typ) ((obj) && (obj)->otyp == (typ) && (obj)->cursed) @@ -99,8 +99,7 @@ static int p_type; /* (-1)-3: (-1)=really naughty, 3=really good */ /* critically low hit points if hp <= 5 or hp <= maxhp/N for some N */ boolean -critically_low_hp(only_if_injured) -boolean only_if_injured; /* determines whether maxhp <= 5 matters */ +critically_low_hp(boolean only_if_injured) /* determines whether maxhp <= 5 matters */ { int divisor, hplim, curhp = Upolyd ? u.mh : u.uhp, maxhp = Upolyd ? u.mhmax : u.uhpmax; @@ -309,8 +308,7 @@ worst_cursed_item() } STATIC_OVL void -fix_worst_trouble(trouble) -int trouble; +fix_worst_trouble(int trouble) { int i; struct obj *otmp = 0; @@ -529,8 +527,7 @@ int trouble; * Divine wrath, dungeon walls, and armor follow the same principle. */ STATIC_OVL void -god_zaps_you(resp_god) -aligntyp resp_god; +god_zaps_you(aligntyp resp_god) { if (u.uswallow) { pline( @@ -603,9 +600,7 @@ aligntyp resp_god; } STATIC_OVL 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"); @@ -615,8 +610,7 @@ boolean via_disintegration; } STATIC_OVL void -angrygods(resp_god) -aligntyp resp_god; +angrygods(aligntyp resp_god) { int maxanger; @@ -691,8 +685,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; @@ -864,8 +857,7 @@ gcrownu() } STATIC_OVL 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? */ @@ -1160,8 +1152,7 @@ aligntyp g_align; * returns true if it found any water here. */ STATIC_OVL boolean -water_prayer(bless_water) -boolean bless_water; +water_prayer(boolean bless_water) { register struct obj *otmp; register long changed = 0; @@ -1189,9 +1180,7 @@ boolean bless_water; } STATIC_OVL void -godvoice(g_align, words) -aligntyp g_align; -const char *words; +godvoice(aligntyp g_align, const char *words) { const char *quot = ""; @@ -1205,16 +1194,14 @@ const char *words; } STATIC_OVL 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_OVL void -gods_upset(g_align) -aligntyp g_align; +gods_upset(aligntyp g_align) { if (g_align == u.ualign.type) u.ugangr++; @@ -1224,8 +1211,7 @@ aligntyp g_align; } STATIC_OVL void -consume_offering(otmp) -register struct obj *otmp; +consume_offering(register struct obj *otmp) { if (Hallucination) switch (rn2(3)) { @@ -1721,8 +1707,7 @@ dosacrifice() /* 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; @@ -1979,8 +1964,7 @@ a_gname() /* 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; @@ -1996,8 +1980,7 @@ u_gname() } const char * -align_gname(alignment) -aligntyp alignment; +align_gname(aligntyp alignment) { const char *gnam; @@ -2044,8 +2027,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; @@ -2093,8 +2075,7 @@ aligntyp alignment; /* deity's title */ const char * -align_gtitle(alignment) -aligntyp alignment; +align_gtitle(aligntyp alignment) { const char *gnam, *result = "god"; @@ -2118,8 +2099,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); @@ -2135,8 +2115,7 @@ register int x, y; /* assumes isok() at one space away, but not necessarily at two */ STATIC_OVL boolean -blocked_boulder(dx, dy) -int dx, dy; +blocked_boulder(int dx, int dy) { register struct obj *otmp; long count = 0L; diff --git a/src/priest.c b/src/priest.c index f17f431e3c..97e3d73f20 100644 --- a/src/priest.c +++ b/src/priest.c @@ -9,12 +9,11 @@ #define ALGN_SINNED (-4) /* worse than strayed (-1..-3) */ #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_DCL boolean histemple_at(struct monst *, xchar, xchar); +STATIC_DCL boolean has_shrine(struct monst *); void -newepri(mtmp) -struct monst *mtmp; +newepri(struct monst *mtmp) { if (!mtmp->mextra) mtmp->mextra = newmextra(); @@ -25,8 +24,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)); @@ -40,12 +38,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; @@ -134,8 +127,7 @@ register xchar omx, omy, gx, gy; } char -temple_occupied(array) -register char *array; +temple_occupied(register char *array) { register char *ptr; @@ -146,9 +138,7 @@ register char *array; } STATIC_OVL 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)) @@ -156,8 +146,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) @@ -173,8 +162,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; @@ -217,11 +205,8 @@ 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; @@ -266,8 +251,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 @@ -289,9 +273,8 @@ 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(register struct monst *mon, + char *pname) /* caller-supplied output buffer */ { boolean do_hallu = Hallucination, aligned_priest = mon->data == &mons[PM_ALIGNED_PRIEST], @@ -339,15 +322,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_OVL boolean -has_shrine(pri) -struct monst *pri; +has_shrine(struct monst *pri) { struct rm *lev; struct epri *epri_p; @@ -363,8 +344,7 @@ struct monst *pri; } struct monst * -findpriest(roomno) -char roomno; +findpriest(char roomno) { register struct monst *mtmp; @@ -380,8 +360,7 @@ char roomno; /* called from check_special_room() when the player enters the temple room */ void -intemple(roomno) -int roomno; +intemple(int roomno) { struct monst *priest, *mtmp; struct epri *epri_p; @@ -512,8 +491,7 @@ 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; @@ -526,8 +504,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); @@ -638,11 +615,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); @@ -672,8 +645,7 @@ boolean peaceful; } void -reset_hostility(roamer) -register struct monst *roamer; +reset_hostility(register struct monst *roamer) { if (!roamer->isminion) return; @@ -689,9 +661,8 @@ 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, /* if non-null, overrides */ + xchar x, xchar y) { register char roomno; register struct monst *priest; @@ -714,8 +685,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; @@ -841,9 +811,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) diff --git a/src/quest.c b/src/quest.c index f1222fc699..10b2ca7ffd 100644 --- a/src/quest.c +++ b/src/quest.c @@ -12,16 +12,16 @@ #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_DCL void on_start(void); +STATIC_DCL void on_locate(void); +STATIC_DCL void on_goal(void); +STATIC_DCL boolean not_capable(void); +STATIC_DCL int is_pure(boolean); +STATIC_DCL void expulsion(boolean); +STATIC_DCL void chat_with_leader(void); +STATIC_DCL void chat_with_nemesis(void); +STATIC_DCL void chat_with_guardian(void); +STATIC_DCL void prisoner_speaks(struct monst *); STATIC_OVL void on_start() @@ -101,8 +101,7 @@ nemdead() } void -artitouch(obj) -struct obj *obj; +artitouch(struct obj *obj) { if (!Qstat(touched_artifact)) { /* in case we haven't seen the item yet (ie, currently blinded), @@ -130,8 +129,7 @@ not_capable() } STATIC_OVL int -is_pure(talk) -boolean talk; +is_pure(boolean talk) { int purity; aligntyp original_alignment = u.ualignbase[A_ORIGINAL]; @@ -164,8 +162,7 @@ boolean talk; * there is a single branch to and from it. */ STATIC_OVL void -expulsion(seal) -boolean seal; +expulsion(boolean seal) { branch *br; d_level *dest; @@ -201,8 +198,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; @@ -302,8 +298,7 @@ chat_with_leader() } void -leader_speaks(mtmp) -struct monst *mtmp; +leader_speaks(struct monst *mtmp) { /* maybe you attacked leader? */ if (!mtmp->mpeaceful) { @@ -364,8 +359,7 @@ chat_with_guardian() } STATIC_OVL void -prisoner_speaks(mtmp) -struct monst *mtmp; +prisoner_speaks(struct monst *mtmp) { if (mtmp->data == &mons[PM_PRISONER] && (mtmp->mstrategy & STRAT_WAITMASK)) { @@ -386,8 +380,7 @@ 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(); @@ -406,8 +399,7 @@ register struct monst *mtmp; } void -quest_talk(mtmp) -struct monst *mtmp; +quest_talk(struct monst *mtmp) { if (mtmp->m_id == Qstat(leader_m_id)) { leader_speaks(mtmp); @@ -426,8 +418,7 @@ 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 ed936d9e42..b581d03ef5 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -18,20 +18,20 @@ /* from sp_lev.c, for deliver_splev_message() */ extern char *lev_message; -static void NDECL(dump_qtlist); -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(neminame); -STATIC_DCL const char *NDECL(guardname); -STATIC_DCL const char *NDECL(homebase); -STATIC_DCL 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_DCL 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_DCL boolean FDECL(skip_pager, (BOOLEAN_P)); +static void dump_qtlist(void); +static void Fread(genericptr_t, int, int, dlb *); +STATIC_DCL struct qtmsg *construct_qtlist(long); +STATIC_DCL const char *intermed(void); +STATIC_DCL const char *neminame(void); +STATIC_DCL const char *guardname(void); +STATIC_DCL const char *homebase(void); +STATIC_DCL void qtext_pronoun(char, char); +STATIC_DCL struct qtmsg *msg_in(struct qtmsg *, int); +STATIC_DCL void convert_arg(char); +STATIC_DCL void convert_line(char *,char *); +STATIC_DCL void deliver_by_pline(struct qtmsg *); +STATIC_DCL void deliver_by_window(struct qtmsg *, int); +STATIC_DCL boolean skip_pager(boolean); static char cvt_buf[64]; static struct qtlists qt_list; @@ -60,10 +60,7 @@ dump_qtlist() } 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; @@ -74,8 +71,7 @@ dlb *stream; } STATIC_OVL struct qtmsg * -construct_qtlist(hdr_offset) -long hdr_offset; +construct_qtlist(long hdr_offset) { struct qtmsg *msg_list; int n_msgs; @@ -153,8 +149,7 @@ unload_qtlist() } short -quest_info(typ) -int typ; +quest_info(int typ) { switch (typ) { case 0: @@ -190,8 +185,7 @@ intermed() } boolean -is_quest_artifact(otmp) -struct obj *otmp; +is_quest_artifact(struct obj *otmp) { return (boolean) (otmp->oartifact == urole.questarti); } @@ -224,9 +218,8 @@ homebase() /* return your role leader's location */ /* replace deity, leader, nemesis, or artifact name with pronoun; overwrites cvt_buf[] */ STATIC_OVL void -qtext_pronoun(who, which) -char who, /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => artifact */ - which; /* 'h'|'H'|'i'|'I'|'j'|'J' */ +qtext_pronoun(char who, /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => artifact */ + char which) /* 'h'|'H'|'i'|'I'|'j'|'J' */ { const char *pnoun; int g; @@ -261,9 +254,7 @@ char who, /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => artifact */ } STATIC_OVL 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; @@ -275,8 +266,7 @@ int msgnum; } STATIC_OVL void -convert_arg(c) -char c; +convert_arg(char c) { register const char *str; @@ -367,8 +357,7 @@ char c; } STATIC_OVL 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]; @@ -459,8 +448,7 @@ char *in_line, *out_line; } STATIC_OVL void -deliver_by_pline(qt_msg) -struct qtmsg *qt_msg; +deliver_by_pline(struct qtmsg *qt_msg) { long size; char in_line[BUFSZ], out_line[BUFSZ]; @@ -474,9 +462,7 @@ struct qtmsg *qt_msg; } STATIC_OVL 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]; @@ -524,8 +510,7 @@ int how; } boolean -skip_pager(common) -boolean common; +skip_pager(boolean common) { /* WIZKIT: suppress plot feedback if starting with quest artifact */ if (program_state.wizkit_wishing) @@ -541,8 +526,7 @@ boolean common; } void -com_pager(msgnum) -int msgnum; +com_pager(int msgnum) { struct qtmsg *qt_msg; @@ -565,8 +549,7 @@ int msgnum; } void -qt_pager(msgnum) -int msgnum; +qt_pager(int msgnum) { struct qtmsg *qt_msg; diff --git a/src/read.c b/src/read.c index 6f9b39a0b9..8c7001760d 100644 --- a/src/read.c +++ b/src/read.c @@ -17,23 +17,22 @@ static NEARDATA const char readable[] = { ALL_CLASSES, SCROLL_CLASS, SPBOOK_CLASS, 0 }; static const char all_count[] = { ALLOW_COUNT, ALL_CLASSES, 0 }; -STATIC_DCL boolean FDECL(learnscrolltyp, (SHORT_P)); -STATIC_DCL char * FDECL(erode_obj_text, (struct obj *, char *)); -STATIC_DCL void NDECL(do_class_genocide); -STATIC_DCL void FDECL(stripspe, (struct obj *)); -STATIC_DCL void FDECL(p_glow1, (struct obj *)); -STATIC_DCL void FDECL(p_glow2, (struct obj *, const char *)); -STATIC_DCL void FDECL(randomize, (int *, int)); -STATIC_DCL void FDECL(forget_single_object, (int)); -STATIC_DCL void FDECL(forget, (int)); -STATIC_DCL int FDECL(maybe_tame, (struct monst *, struct obj *)); -STATIC_DCL boolean FDECL(is_valid_stinking_cloud_pos, (int, int, BOOLEAN_P)); -STATIC_DCL void FDECL(display_stinking_cloud_positions, (int)); -STATIC_PTR void FDECL(set_lit, (int, int, genericptr)); +STATIC_DCL boolean learnscrolltyp(short); +STATIC_DCL char * erode_obj_text(struct obj *, char *); +STATIC_DCL void do_class_genocide(void); +STATIC_DCL void stripspe(struct obj *); +STATIC_DCL void p_glow1(struct obj *); +STATIC_DCL void p_glow2(struct obj *, const char *); +STATIC_DCL void randomize(int *, int); +STATIC_DCL void forget_single_object(int); +STATIC_DCL void forget(int); +STATIC_DCL int maybe_tame(struct monst *, struct obj *); +STATIC_DCL boolean is_valid_stinking_cloud_pos(int, int, boolean); +STATIC_DCL void display_stinking_cloud_positions(int); +STATIC_PTR void set_lit(int, int, genericptr); STATIC_OVL boolean -learnscrolltyp(scrolltyp) -short scrolltyp; +learnscrolltyp(short scrolltyp) { if (!objects[scrolltyp].oc_name_known) { makeknown(scrolltyp); @@ -45,8 +44,7 @@ short scrolltyp; /* also called from teleport.c for scroll of teleportation */ void -learnscroll(sobj) -struct obj *sobj; +learnscroll(struct obj *sobj) { /* it's implied that sobj->dknown is set; we couldn't be reading this scroll otherwise */ @@ -55,9 +53,7 @@ struct obj *sobj; } char * -erode_obj_text(otmp, buf) -struct obj *otmp; -char *buf; +erode_obj_text(struct obj *otmp, char *buf) { int erosion = greatest_erosion(otmp); if (erosion) @@ -67,9 +63,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 */ @@ -146,9 +140,7 @@ char *buf; } char * -apron_text(apron, buf) -struct obj *apron; -char *buf; +apron_text(struct obj *apron, char *buf) { static const char *apron_msgs[] = { "Kiss the cook", @@ -374,8 +366,7 @@ doread() } STATIC_OVL void -stripspe(obj) -register struct obj *obj; +stripspe(register struct obj *obj) { if (obj->blessed || obj->spe <= 0) { pline1(nothing_happens); @@ -390,16 +381,13 @@ register struct obj *obj; } STATIC_OVL void -p_glow1(otmp) -register struct obj *otmp; +p_glow1(register struct obj *otmp) { pline("%s briefly.", Yobjnam2(otmp, Blind ? "vibrate" : "glow")); } STATIC_OVL void -p_glow2(otmp, color) -register struct obj *otmp; -register const char *color; +p_glow2(register struct obj *otmp, register const char *color) { pline("%s%s%s for a moment.", Yobjnam2(otmp, Blind ? "vibrate" : "glow"), Blind ? "" : " ", Blind ? "" : hcolor(color)); @@ -408,8 +396,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; @@ -429,9 +416,7 @@ struct obj *obj; /* recharge an object; curse_bless is -1 if the recharging implement 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; @@ -680,8 +665,7 @@ int curse_bless; /* Forget known information about this object type. */ STATIC_OVL 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 */ @@ -697,8 +681,7 @@ int obj_id; #if 0 /* here if anyone wants it.... */ /* Forget everything known about a particular object class. */ STATIC_OVL void -forget_objclass(oclass) -int oclass; +forget_objclass(int oclass) { int i; @@ -710,9 +693,7 @@ int oclass; /* randomize the given list of numbers 0 <= i < count */ STATIC_OVL void -randomize(indices, count) -int *indices; -int count; +randomize(int *indices, int count) { int i, iswap, temp; @@ -727,8 +708,7 @@ int count; /* Forget % of known objects. */ void -forget_objects(percent) -int percent; +forget_objects(int percent) { int i, count; int indices[NUM_OBJECTS]; @@ -758,8 +738,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; @@ -797,8 +776,7 @@ forget_traps() * except this one. */ void -forget_levels(percent) -int percent; +forget_levels(int percent) { int i, count; xchar maxl, this_lev; @@ -858,8 +836,7 @@ int percent; * howmuch & ALL_SPELLS = forget all spells */ STATIC_OVL void -forget(howmuch) -int howmuch; +forget(int howmuch) { if (Punished) u.bc_felt = 0; /* forget felt ball&chain */ @@ -892,9 +869,7 @@ int howmuch; /* monster is hit by scroll of taming's effect */ STATIC_OVL 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; @@ -915,9 +890,7 @@ struct obj *sobj; } 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 (!cansee(x, y) || !ACCESSIBLE(levl[x][y].typ) || distu(x, y) >= 32) { if (showmsg) @@ -928,8 +901,7 @@ boolean showmsg; } 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)); @@ -952,8 +924,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), sblessed = sobj->blessed, @@ -1641,8 +1612,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ } void -drop_boulder_on_player(confused, helmet_protects, byu, skip_uswallow) -boolean confused, helmet_protects, byu, skip_uswallow; +drop_boulder_on_player(boolean confused, boolean helmet_protects, boolean byu, boolean skip_uswallow) { int dmg; struct obj *otmp2; @@ -1684,9 +1654,7 @@ boolean confused, helmet_protects, byu, skip_uswallow; } boolean -drop_boulder_on_monster(x, y, confused, byu) -int x, y; -boolean confused, byu; +drop_boulder_on_monster(int x, int y, boolean confused, boolean byu) { register struct obj *otmp2; register struct monst *mtmp; @@ -1756,9 +1724,8 @@ boolean confused, byu; /* overcharging any wand or zapping/engraving cursed wand */ void -wand_explode(obj, chg) -struct obj *obj; -int chg; /* recharging */ +wand_explode(struct obj *obj, + int chg) /* recharging */ { const char *expl = !chg ? "suddenly" : "vibrates violently and"; int dmg, n, k; @@ -1815,9 +1782,7 @@ STATIC_VAR struct litmon *gremlins = 0; * Low-level lit-field update routine. */ STATIC_PTR 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; @@ -1837,9 +1802,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() */ @@ -2090,8 +2053,7 @@ do_class_genocide() #define PLAYER 2 #define ONTHRONE 4 void -do_genocide(how) -int how; +do_genocide(int how) /* 0 = no genocide; create monsters (cursed scroll) */ /* 1 = normal genocide */ /* 3 = forced genocide of player */ @@ -2249,8 +2211,7 @@ int how; } void -punish(sobj) -struct obj *sobj; +punish(struct obj *sobj) { struct obj *reuse_ball = (sobj && sobj->otyp == HEAVY_IRON_BALL) ? sobj : (struct obj *) 0; @@ -2311,10 +2272,7 @@ unpunish() * revive 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 || (*mtype == PM_SHOPKEEPER && !revival) diff --git a/src/rect.c b/src/rect.c index 5107bf1810..4235e386f4 100644 --- a/src/rect.c +++ b/src/rect.c @@ -4,9 +4,9 @@ #include "hack.h" -int FDECL(get_rect_ind, (NhRect *)); +int get_rect_ind(NhRect *); -STATIC_DCL boolean FDECL(intersect, (NhRect *, NhRect *, NhRect *)); +STATIC_DCL boolean intersect(NhRect *, NhRect *, NhRect *); /* * In this file, we will handle the various rectangle functions we @@ -40,8 +40,7 @@ init_rect() */ int -get_rect_ind(r) -NhRect *r; +get_rect_ind(NhRect *r) { register NhRect *rectp; register int lx, ly, hx, hy; @@ -63,8 +62,7 @@ NhRect *r; */ NhRect * -get_rect(r) -NhRect *r; +get_rect(NhRect *r) { register NhRect *rectp; register int lx, ly, hx, hy; @@ -98,8 +96,7 @@ rnd_rect() */ STATIC_OVL 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) @@ -120,8 +117,7 @@ NhRect *r1, *r2, *r3; */ void -remove_rect(r) -NhRect *r; +remove_rect(NhRect *r) { int ind; @@ -135,8 +131,7 @@ NhRect *r; */ void -add_rect(r) -NhRect *r; +add_rect(NhRect *r) { if (rect_cnt >= MAXRECT) { if (wizard) @@ -158,8 +153,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 6699716c05..d3abdce33b 100644 --- a/src/region.c +++ b/src/region.c @@ -17,33 +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(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 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,long)); +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 *); +boolean enter_force_field(genericptr,genericptr); +NhRegion *create_force_field(xchar,xchar,int,long); #endif -STATIC_DCL void FDECL(reset_region_mids, (NhRegion *)); +STATIC_DCL void reset_region_mids(NhRegion *); static callback_proc callbacks[] = { #define INSIDE_GAS_CLOUD 0 @@ -54,9 +54,8 @@ 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 (boolean) (x >= r->lx && x <= r->hx && y >= r->ly && y <= r->hy); } @@ -65,9 +64,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; @@ -83,9 +80,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; @@ -139,9 +134,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; @@ -169,9 +162,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; @@ -194,9 +185,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; @@ -214,9 +203,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; @@ -233,8 +220,7 @@ struct monst *mon; * Clone (make a standalone copy) the region. */ NhRegion * -clone_region(reg) -NhRegion *reg; +clone_region(NhRegion *reg) { NhRegion *ret_reg; @@ -267,8 +253,7 @@ NhRegion *reg; * Free mem from region. */ void -free_region(reg) -NhRegion *reg; +free_region(NhRegion *reg) { if (reg) { if (reg->rects) @@ -288,8 +273,7 @@ NhRegion *reg; * This actually activates the region. */ void -add_region(reg) -NhRegion *reg; +add_region(NhRegion *reg) { NhRegion **tmp_reg; int i, j; @@ -329,8 +313,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; @@ -425,8 +408,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; @@ -473,9 +455,7 @@ xchar x, y; * check whether a monster enters/leaves one or more region. */ 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; @@ -535,8 +515,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; @@ -560,8 +539,7 @@ struct monst *mon; * need a new structure (internally that is). */ void -replace_mon_regions(monold, monnew) -struct monst *monold, *monnew; +replace_mon_regions(struct monst *monold, struct monst *monnew) { register int i; @@ -576,8 +554,7 @@ struct monst *monold, *monnew; * Remove monster from all regions it was in (ie monster just died) */ void -remove_mon_from_regions(mon) -struct monst *mon; +remove_mon_from_regions(struct monst *mon) { register int i; @@ -593,8 +570,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; @@ -606,9 +582,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); } @@ -617,9 +591,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; @@ -673,9 +645,8 @@ 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; @@ -765,8 +736,7 @@ boolean ghostly; /* If a bones file restore */ /* update monster IDs for region being loaded from bones; `ghostly' implied */ STATIC_OVL void -reset_region_mids(reg) -NhRegion *reg; +reset_region_mids(NhRegion *reg) { int i = 0, n = reg->n_monst; unsigned *mid_list = reg->monsters; @@ -793,11 +763,7 @@ NhRegion *reg; *--------------------------------------------------------------*/ NhRegion * -create_msg_region(x, y, w, h, msg_enter, msg_leave) -xchar x, y; -xchar w, h; -const char *msg_enter; -const char *msg_leave; +create_msg_region(xchar x, xchar y, xchar w, xchar h, const char *msg_enter, const char *msg_leave) { NhRect tmprect; NhRegion *reg = create_region((NhRect *) 0, 0); @@ -823,9 +789,7 @@ const char *msg_leave; *--------------------------------------------------------------*/ boolean -enter_force_field(p1, p2) -genericptr_t p1; -genericptr_t p2; +enter_force_field(genericptr_t p1, genericptr_t p2) { struct monst *mtmp; @@ -845,10 +809,7 @@ genericptr_t p2; } NhRegion * -create_force_field(x, y, radius, ttl) -xchar x, y; -int radius; -long ttl; +create_force_field(xchar x, xchar y, int radius, long ttl) { int i; NhRegion *ff; @@ -891,9 +852,7 @@ long ttl; */ /*ARGSUSED*/ boolean -expire_gas_cloud(p1, p2) -genericptr_t p1; -genericptr_t p2 UNUSED; +expire_gas_cloud(genericptr_t p1, genericptr_t p2 UNUSED) { NhRegion *reg; int damage; @@ -913,9 +872,7 @@ genericptr_t p2 UNUSED; } 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; @@ -972,10 +929,7 @@ genericptr_t p2; } NhRegion * -create_gas_cloud(x, y, radius, damage) -xchar x, y; -int radius; -int damage; +create_gas_cloud(xchar x, xchar y, int radius, int damage) { NhRegion *cloud; int i, nrect; diff --git a/src/restore.c b/src/restore.c index 99c5ad61f4..3cf469eeaa 100644 --- a/src/restore.c +++ b/src/restore.c @@ -12,42 +12,42 @@ 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_DCL void NDECL(zerocomp_minit); -STATIC_DCL void FDECL(zerocomp_mread, (int, genericptr_t, unsigned int)); -STATIC_DCL int NDECL(zerocomp_mgetc); +STATIC_DCL void zerocomp_minit(void); +STATIC_DCL void zerocomp_mread(int, genericptr_t, unsigned int); +STATIC_DCL int zerocomp_mgetc(void); #endif -STATIC_DCL void NDECL(def_minit); -STATIC_DCL void FDECL(def_mread, (int, genericptr_t, unsigned int)); - -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 void def_minit(void); +STATIC_DCL void def_mread(int, genericptr_t, unsigned int); + +STATIC_DCL void find_lev_obj(void); +STATIC_DCL void restlevchn(int); +STATIC_DCL void restdamage(int, boolean); +STATIC_DCL void restobj(int, struct obj *); +STATIC_DCL struct obj *restobjchn(int, boolean, boolean); +STATIC_OVL void restmon(int, struct monst *); +STATIC_DCL struct monst *restmonchn(int, boolean); +STATIC_DCL struct fruit *loadfruitchn(int); +STATIC_DCL void freefruitchn(struct fruit *); +STATIC_DCL void 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_OVL void FDECL(restore_msghistory, (int)); -STATIC_DCL void FDECL(reset_oattached_mids, (BOOLEAN_P)); -STATIC_DCL void FDECL(rest_levl, (int, BOOLEAN_P)); +restgamestate(int, unsigned int *, unsigned int *); +STATIC_DCL void restlevelstate(unsigned int, unsigned int); +STATIC_DCL int restlevelfile(int, xchar); +STATIC_OVL void restore_msghistory(int); +STATIC_DCL void reset_oattached_mids(boolean); +STATIC_DCL void rest_levl(int, boolean); static struct restore_procs { const char *name; int mread_flags; - void NDECL((*restore_minit)); - void FDECL((*restore_mread), (int, genericptr_t, unsigned int)); - void FDECL((*restore_bclose), (int)); + void (*restore_minit)(void); + void (*restore_mread)(int, genericptr_t, unsigned int); + void (*restore_bclose)(int); } restoreprocs = { #if !defined(ZEROCOMP) || (defined(COMPRESS) || defined(ZLIB_COMP)) "externalcomp", 0, def_minit, def_mread, def_bclose, @@ -69,14 +69,14 @@ struct bucket { } map[N_PER_BUCKET]; }; -STATIC_DCL void NDECL(clear_id_mapping); -STATIC_DCL void FDECL(add_id_mapping, (unsigned, unsigned)); +STATIC_DCL void clear_id_mapping(void); +STATIC_DCL 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 @@ -124,8 +124,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; @@ -140,8 +139,7 @@ boolean quietly; } STATIC_OVL void -restlevchn(fd) -register int fd; +restlevchn(register int fd) { int cnt; s_level *tmplev, *x; @@ -163,9 +161,7 @@ register int fd; } STATIC_OVL void -restdamage(fd, ghostly) -int fd; -boolean ghostly; +restdamage(int fd, boolean ghostly) { int counter; struct damage *tmp_dam; @@ -207,9 +203,7 @@ boolean ghostly; /* restore one object */ STATIC_OVL void -restobj(fd, otmp) -int fd; -struct obj *otmp; +restobj(int fd, struct obj *otmp) { int buflen; @@ -261,9 +255,7 @@ struct obj *otmp; } STATIC_OVL 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; @@ -326,9 +318,7 @@ boolean ghostly, frozen; /* restore one monster */ STATIC_OVL void -restmon(fd, mtmp) -int fd; -struct monst *mtmp; +restmon(int fd, struct monst *mtmp) { int buflen; @@ -383,9 +373,7 @@ struct monst *mtmp; } STATIC_OVL 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; @@ -457,8 +445,7 @@ boolean ghostly; } STATIC_OVL struct fruit * -loadfruitchn(fd) -int fd; +loadfruitchn(int fd) { register struct fruit *flist, *fnext; @@ -473,8 +460,7 @@ int fd; } STATIC_OVL void -freefruitchn(flist) -register struct fruit *flist; +freefruitchn(register struct fruit *flist) { register struct fruit *fnext; @@ -486,8 +472,7 @@ register struct fruit *flist; } STATIC_OVL void -ghostfruit(otmp) -register struct obj *otmp; +ghostfruit(register struct obj *otmp) { register struct fruit *oldf; @@ -509,9 +494,7 @@ register struct obj *otmp; STATIC_OVL boolean -restgamestate(fd, stuckid, steedid) -register int fd; -unsigned int *stuckid, *steedid; +restgamestate(register int fd, unsigned int *stuckid, unsigned int *steedid) { struct flag newgameflags; #ifdef SYSFLAGS @@ -674,8 +657,7 @@ unsigned int *stuckid, *steedid; * don't dereference a wild u.ustuck when saving the game state, for instance) */ STATIC_OVL void -restlevelstate(stuckid, steedid) -unsigned int stuckid, steedid; +restlevelstate(unsigned int stuckid, unsigned int steedid) { register struct monst *mtmp; @@ -700,9 +682,8 @@ unsigned int stuckid, steedid; /*ARGSUSED*/ STATIC_OVL int -restlevelfile(fd, ltmp) -int fd; /* fd used in MFLOPPY only */ -xchar ltmp; +restlevelfile(int fd, /* fd used in MFLOPPY only */ + xchar ltmp) { int nfd; char whynot[BUFSZ]; @@ -757,8 +738,7 @@ xchar ltmp; } int -dorecover(fd) -register int fd; +dorecover(register int fd) { unsigned int stuckid = 0, steedid = 0; /* not a register */ xchar ltmp; @@ -899,9 +879,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; @@ -922,9 +900,7 @@ struct cemetery **cemeteryaddr; /*ARGSUSED*/ STATIC_OVL void -rest_levl(fd, rlecomp) -int fd; -boolean rlecomp; +rest_levl(int fd, boolean rlecomp) { #ifdef RLECOMP short i, j; @@ -959,8 +935,7 @@ boolean rlecomp; } 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..."); @@ -970,10 +945,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; @@ -1158,9 +1130,7 @@ boolean ghostly; } void -get_plname_from_file(fd, plbuf) -int fd; -char *plbuf; +get_plname_from_file(int fd, char *plbuf) { int pltmpsiz = 0; (void) read(fd, (genericptr_t) &pltmpsiz, sizeof(pltmpsiz)); @@ -1169,8 +1139,7 @@ char *plbuf; } STATIC_OVL void -restore_msghistory(fd) -register int fd; +restore_msghistory(register int fd) { int msgsize, msgcount = 0; char msg[BUFSZ]; @@ -1206,8 +1175,7 @@ clear_id_mapping() /* Add a mapping to the ID map. */ STATIC_OVL void -add_id_mapping(gid, nid) -unsigned gid, nid; +add_id_mapping(unsigned gid, unsigned nid) { int idx; @@ -1231,8 +1199,7 @@ unsigned gid, nid; * ID. */ boolean -lookup_id_mapping(gid, nidp) -unsigned gid, *nidp; +lookup_id_mapping(unsigned gid, unsigned *nidp) { int i; struct bucket *curr; @@ -1258,8 +1225,7 @@ unsigned gid, *nidp; } STATIC_OVL void -reset_oattached_mids(ghostly) -boolean ghostly; +reset_oattached_mids(boolean ghostly) { struct obj *otmp; unsigned oldid, nid; @@ -1286,8 +1252,7 @@ boolean ghostly; /* put up a menu listing each character from this player's saved games; returns 1: use plname[], 0: new game, -1: quit */ int -restore_menu(bannerwin) -winid bannerwin; /* if not WIN_ERR, clear window and show copyright in menu */ +restore_menu(winid bannerwin) /* if not WIN_ERR, clear window and show copyright in menu */ { winid tmpwin; anything any; @@ -1361,10 +1326,7 @@ minit() } 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) { (*restoreprocs.restore_mread)(fd, buf, len); return; @@ -1378,9 +1340,7 @@ register unsigned int len; Return -1 if it failed for some unknown reason. */ int -validate(fd, name) -int fd; -const char *name; +validate(int fd, const char *name) { int rlen; struct savefile_info sfi; @@ -1469,8 +1429,7 @@ reset_restpref() } void -set_restpref(suitename) -const char *suitename; +set_restpref(const char *suitename) { if (!strcmpi(suitename, "externalcomp")) { restoreprocs.name = "externalcomp"; @@ -1537,10 +1496,7 @@ zerocomp_minit() } STATIC_OVL void -zerocomp_mread(fd, buf, len) -int fd; -genericptr_t buf; -register unsigned len; +zerocomp_mread(int fd, genericptr_t buf, register unsigned len) { /*register int readlen = 0;*/ if (fd < 0) @@ -1572,10 +1528,7 @@ def_minit() } STATIC_OVL void -def_mread(fd, buf, len) -register int fd; -register genericptr_t buf; -register unsigned int len; +def_mread(register int fd, register genericptr_t buf, register unsigned int len) { register int rlen; #if defined(BSD) || defined(ULTRIX) diff --git a/src/rip.c b/src/rip.c index 80791cb846..779ead9144 100644 --- a/src/rip.c +++ b/src/rip.c @@ -4,7 +4,7 @@ #include "hack.h" -STATIC_DCL void FDECL(center, (int, char *)); +STATIC_DCL void center(int, char *); #if defined(TTY_GRAPHICS) || defined(X11_GRAPHICS) || defined(GEM_GRAPHICS) \ || defined(MSWIN_GRAPHICS) @@ -72,9 +72,7 @@ static const char *rip_txt[] = { static char **rip; STATIC_OVL void -center(line, text) -int line; -char *text; +center(int line, char *text) { register char *ip, *op; ip = text; @@ -84,10 +82,7 @@ char *text; } void -genl_outrip(tmpwin, how, when) -winid tmpwin; -int how; -time_t when; +genl_outrip(winid tmpwin, int how, time_t when) { register char **dp; register char *dpx; diff --git a/src/rnd.c b/src/rnd.c index 8c15f22d45..fe866ba0db 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -5,7 +5,7 @@ /* "Rand()"s definition is determined by [OS]conf.h */ #if defined(LINT) && defined(UNIX) /* rand() is long... */ -extern int NDECL(rand); +extern int rand(void); #define RND(x) (rand() % x) #else /* LINT */ #if defined(UNIX) || defined(RANDOM) @@ -18,8 +18,7 @@ extern int NDECL(rand); /* 0 <= rn2(x) < x */ int -rn2(x) -register int x; +rn2(register int x) { #ifdef BETA if (x <= 0) { @@ -36,8 +35,7 @@ register int x; /* 0 <= rnl(x) < x; sometimes subtracting Luck; good luck approaches 0, bad luck approaches (x-1) */ int -rnl(x) -register int x; +rnl(register int x) { register int i, adjustment; @@ -80,8 +78,7 @@ register int x; /* 1 <= rnd(x) <= x */ int -rnd(x) -register int x; +rnd(register int x) { #ifdef BETA if (x <= 0) { @@ -95,8 +92,7 @@ register int x; /* d(N,X) == NdX == dX+dX+...+dX N times; n <= d(n,x) <= (n*x) */ int -d(n, x) -register int n, x; +d(register int n, register int x) { register int tmp = n; @@ -113,8 +109,7 @@ register int n, x; /* 1 <= rne(x) <= max(u.ulevel/3,5) */ int -rne(x) -register int x; +rne(register int x) { register int tmp, utmp; @@ -136,8 +131,7 @@ register int x; /* rnz: everyone's favorite! */ int -rnz(i) -int i; +rnz(int i) { #ifdef LINT int x = i; diff --git a/src/role.c b/src/role.c index 7be577b7f1..eea62e6fab 100644 --- a/src/role.c +++ b/src/role.c @@ -770,17 +770,16 @@ static struct { short mask; } filter; -STATIC_DCL 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_DCL int randrole_filtered(void); +STATIC_DCL char *promptsep(char *, int); +STATIC_DCL int role_gendercount(int); +STATIC_DCL int race_alignmentcount(int); /* used by str2XXX() */ static char NEARDATA randomstr[] = "random"; boolean -validrole(rolenum) -int rolenum; +validrole(int rolenum) { return (boolean) (rolenum >= 0 && rolenum < SIZE(roles) - 1); } @@ -808,8 +807,7 @@ randrole_filtered() } int -str2role(str) -const char *str; +str2role(const char *str) { int i, len; @@ -840,8 +838,7 @@ const char *str; } boolean -validrace(rolenum, racenum) -int rolenum, racenum; +validrace(int rolenum, int racenum) { /* Assumes validrole */ return (boolean) (racenum >= 0 && racenum < SIZE(races) - 1 @@ -850,8 +847,7 @@ int rolenum, racenum; } int -randrace(rolenum) -int rolenum; +randrace(int rolenum) { int i, n = 0; @@ -877,8 +873,7 @@ int rolenum; } int -str2race(str) -const char *str; +str2race(const char *str) { int i, len; @@ -906,8 +901,7 @@ const char *str; } boolean -validgend(rolenum, racenum, gendnum) -int rolenum, racenum, gendnum; +validgend(int rolenum, int racenum, int gendnum) { /* Assumes validrole and validrace */ return (boolean) (gendnum >= 0 && gendnum < ROLE_GENDERS @@ -916,8 +910,7 @@ int rolenum, racenum, gendnum; } int -randgend(rolenum, racenum) -int rolenum, racenum; +randgend(int rolenum, int racenum) { int i, n = 0; @@ -944,8 +937,7 @@ int rolenum, racenum; } int -str2gend(str) -const char *str; +str2gend(const char *str) { int i, len; @@ -972,8 +964,7 @@ const char *str; } boolean -validalign(rolenum, racenum, alignnum) -int rolenum, racenum, alignnum; +validalign(int rolenum, int racenum, int alignnum) { /* Assumes validrole and validrace */ return (boolean) (alignnum >= 0 && alignnum < ROLE_ALIGNS @@ -982,8 +973,7 @@ int rolenum, racenum, alignnum; } int -randalign(rolenum, racenum) -int rolenum, racenum; +randalign(int rolenum, int racenum) { int i, n = 0; @@ -1010,8 +1000,7 @@ int rolenum, racenum; } int -str2align(str) -const char *str; +str2align(const char *str) { int i, len; @@ -1039,8 +1028,7 @@ 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; @@ -1084,8 +1072,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)]; @@ -1107,8 +1094,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; @@ -1152,8 +1138,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; @@ -1179,9 +1164,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; @@ -1220,8 +1203,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; @@ -1247,10 +1229,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; @@ -1290,8 +1269,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; @@ -1349,8 +1327,7 @@ rigid_role_checks() } boolean -setrolefilter(bufp) -const char *bufp; +setrolefilter(const char *bufp) { int i; boolean reslt = TRUE; @@ -1400,9 +1377,7 @@ clearrolefilter() STATIC_VAR char pa[NUM_BP], post_attribs; STATIC_OVL char * -promptsep(buf, num_post_attribs) -char *buf; -int num_post_attribs; +promptsep(char *buf, int num_post_attribs) { const char *conjuct = "and "; @@ -1417,8 +1392,7 @@ int num_post_attribs; } STATIC_OVL int -role_gendercount(rolenum) -int rolenum; +role_gendercount(int rolenum) { int gendcount = 0; @@ -1434,8 +1408,7 @@ int rolenum; } STATIC_OVL int -race_alignmentcount(racenum) -int racenum; +race_alignmentcount(int racenum) { int aligncount = 0; @@ -1451,10 +1424,8 @@ 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]; @@ -1602,9 +1573,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? [ynaq] "; int num_post_attribs = 0; @@ -1721,9 +1690,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 NEARDATA choosing[] = " choosing now", not_yet[] = " not yet specified", @@ -1809,9 +1776,7 @@ winid where; /* add a "pick alignment first"-type entry to the specified menu */ void -role_menu_extra(which, where) -int which; -winid where; +role_menu_extra(int which, winid where) { static NEARDATA const char RS_menu_let[] = { '=', /* name */ @@ -2089,8 +2054,7 @@ role_init() } const char * -Hello(mtmp) -struct monst *mtmp; +Hello(struct monst *mtmp) { switch (Role_switch) { case PM_KNIGHT: diff --git a/src/rumors.c b/src/rumors.c index 18656e5e71..1fb8f87cce 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -40,8 +40,8 @@ * and placed there by 'makedefs'. */ -STATIC_DCL void FDECL(init_rumors, (dlb *)); -STATIC_DCL void FDECL(init_oracles, (dlb *)); +STATIC_DCL void init_rumors(dlb *); +STATIC_DCL 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; @@ -55,8 +55,7 @@ static unsigned oracle_cnt = 0; static unsigned long *oracle_loc = 0; STATIC_OVL void -init_rumors(fp) -dlb *fp; +init_rumors(dlb *fp) { static const char rumors_header[] = "%d,%ld,%lx;%d,%ld,%lx;0,0,%lx\n"; int true_count, false_count; /* in file but not used here */ @@ -86,10 +85,9 @@ 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, /* 1=true, -1=false, 0=either */ + char *rumor_buf, + boolean exclude_cookie) { dlb *rumors; long tidbit, beginning; @@ -278,9 +276,7 @@ rumor_check() /* Gets a random line of text from file 'fname', and returns it. */ char * -get_rnd_text(fname, buf) -const char *fname; -char *buf; +get_rnd_text(const char *fname, char *buf) { dlb *fh; @@ -319,9 +315,8 @@ char *buf; } void -outrumor(truth, mechanism) -int truth; /* 1=true, -1=false, 0=either */ -int mechanism; +outrumor(int truth, /* 1=true, -1=false, 0=either */ + int mechanism) { static const char fortune_msg[] = "This cookie has a scrap of paper inside."; @@ -364,8 +359,7 @@ int mechanism; } STATIC_OVL void -init_oracles(fp) -dlb *fp; +init_oracles(dlb *fp) { register int i; char line[BUFSZ]; @@ -386,8 +380,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); @@ -403,8 +396,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) { @@ -415,9 +407,7 @@ int fd; } void -outoracle(special, delphi) -boolean special; -boolean delphi; +outoracle(boolean special, boolean delphi) { char line[COLNO]; char *endp; @@ -474,8 +464,7 @@ boolean delphi; } int -doconsult(oracl) -struct monst *oracl; +doconsult(struct monst *oracl) { long umoney; int u_pay, minor_cost = 50, major_cost = 500 + 50 * u.ulevel; diff --git a/src/save.c b/src/save.c index 2fc0872093..153fb7b03a 100644 --- a/src/save.c +++ b/src/save.c @@ -21,40 +21,40 @@ static int count_only; int dotcnt, dotrow; /* also used in restore */ #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)); -STATIC_OVL void FDECL(save_msghistory, (int, int)); +STATIC_DCL void savelevchn(int, int); +STATIC_DCL void savedamage(int, int); +STATIC_DCL void saveobj(int, struct obj *); +STATIC_DCL void saveobjchn(int, struct obj *, int); +STATIC_DCL void savemon(int, struct monst *); +STATIC_DCL void savemonchn(int, struct monst *, int); +STATIC_DCL void savetrapchn(int, struct trap *, int); +STATIC_DCL void savegamestate(int, int); +STATIC_OVL void save_msghistory(int, 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_DCL void savelev0(int, xchar, int); +STATIC_DCL boolean swapout_oldest(void); +STATIC_DCL void copyfile(char *, char *); #endif /* MFLOPPY */ -STATIC_DCL void FDECL(savelevl, (int fd, BOOLEAN_P)); -STATIC_DCL void FDECL(def_bufon, (int)); -STATIC_DCL void FDECL(def_bufoff, (int)); -STATIC_DCL void FDECL(def_bflush, (int)); -STATIC_DCL void FDECL(def_bwrite, (int, genericptr_t, unsigned int)); +STATIC_DCL void savelevl(int fd, boolean); +STATIC_DCL void def_bufon(int); +STATIC_DCL void def_bufoff(int); +STATIC_DCL void def_bflush(int); +STATIC_DCL void def_bwrite(int, genericptr_t, unsigned int); #ifdef ZEROCOMP -STATIC_DCL void FDECL(zerocomp_bufon, (int)); -STATIC_DCL void FDECL(zerocomp_bufoff, (int)); -STATIC_DCL void FDECL(zerocomp_bflush, (int)); -STATIC_DCL void FDECL(zerocomp_bwrite, (int, genericptr_t, unsigned int)); -STATIC_DCL void FDECL(zerocomp_bputc, (int)); +STATIC_DCL void zerocomp_bufon(int); +STATIC_DCL void zerocomp_bufoff(int); +STATIC_DCL void zerocomp_bflush(int); +STATIC_DCL void zerocomp_bwrite(int, genericptr_t, unsigned int); +STATIC_DCL void zerocomp_bputc(int); #endif static struct save_procs { const char *name; - void FDECL((*save_bufon), (int)); - void FDECL((*save_bufoff), (int)); - void FDECL((*save_bflush), (int)); - void FDECL((*save_bwrite), (int, genericptr_t, unsigned int)); - void FDECL((*save_bclose), (int)); + void (*save_bufon)(int); + void (*save_bufoff)(int); + void (*save_bflush)(int); + void (*save_bwrite)(int, genericptr_t, unsigned int); + void (*save_bclose)(int); } saveprocs = { #if !defined(ZEROCOMP) || (defined(COMPRESS) || defined(ZLIB_COMP)) "externalcomp", def_bufon, def_bufoff, def_bflush, def_bwrite, def_bclose, @@ -125,7 +125,7 @@ dosave0() fq_save = fqname(SAVEF, SAVEPREFIX, 1); /* level files take 0 */ #if defined(UNIX) || defined(VMS) - sethanguphandler((void FDECL((*), (int) )) SIG_IGN); + sethanguphandler((void ((*)(int) )) SIG_IGN); #endif #ifndef NO_SIGNAL (void) signal(SIGINT, SIG_IGN); @@ -274,8 +274,7 @@ dosave0() } STATIC_OVL void -savegamestate(fd, mode) -register int fd, mode; +savegamestate(register int fd, register int mode) { unsigned long uid; @@ -344,9 +343,7 @@ register int fd, mode; } boolean -tricked_fileremoved(fd, whynot) -int fd; -char *whynot; +tricked_fileremoved(int fd, char *whynot) { if (fd < 0) { pline1(whynot); @@ -427,10 +424,7 @@ savestateinlock() #ifdef MFLOPPY boolean -savelev(fd, lev, mode) -int fd; -xchar lev; -int mode; +savelev(int fd, xchar lev, int mode) { if (mode & COUNT_SAVE) { bytes_counted = 0; @@ -457,14 +451,11 @@ int mode; } STATIC_OVL void -savelev0(fd, lev, mode) +savelev0(int fd, xchar lev, int 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; @@ -545,9 +536,7 @@ int mode; } STATIC_OVL void -savelevl(fd, rlecomp) -int fd; -boolean rlecomp; +savelevl(int fd, boolean rlecomp) { #ifdef RLECOMP struct rm *prm, *rgrm; @@ -602,8 +591,7 @@ boolean rlecomp; /*ARGSUSED*/ void -bufon(fd) -int fd; +bufon(int fd) { (*saveprocs.save_bufon)(fd); return; @@ -611,8 +599,7 @@ int fd; /*ARGSUSED*/ void -bufoff(fd) -int fd; +bufoff(int fd) { (*saveprocs.save_bufoff)(fd); return; @@ -620,26 +607,21 @@ int fd; /* flush run and buffer */ void -bflush(fd) -register int fd; +bflush(register int fd) { (*saveprocs.save_bflush)(fd); return; } void -bwrite(fd, loc, num) -int fd; -genericptr_t loc; -register unsigned num; +bwrite(int fd, genericptr_t loc, register unsigned num) { (*saveprocs.save_bwrite)(fd, loc, num); return; } void -bclose(fd) -int fd; +bclose(int fd) { (*saveprocs.save_bclose)(fd); return; @@ -650,8 +632,7 @@ static FILE *bw_FILE = 0; static boolean buffering = FALSE; STATIC_OVL void -def_bufon(fd) -int fd; +def_bufon(int fd) { #ifdef UNIX if (bw_fd != fd) { @@ -666,16 +647,14 @@ int fd; } STATIC_OVL void -def_bufoff(fd) -int fd; +def_bufoff(int fd) { def_bflush(fd); buffering = FALSE; } STATIC_OVL void -def_bflush(fd) -int fd; +def_bflush(int fd) { #ifdef UNIX if (fd == bw_fd) { @@ -687,10 +666,7 @@ int fd; } STATIC_OVL void -def_bwrite(fd, loc, num) -register int fd; -register genericptr_t loc; -register unsigned num; +def_bwrite(register int fd, register genericptr_t loc, register unsigned num) { boolean failed; @@ -728,8 +704,7 @@ register unsigned num; } void -def_bclose(fd) -int fd; +def_bclose(int fd) { bufoff(fd); #ifdef UNIX @@ -770,8 +745,7 @@ static NEARDATA boolean compressing = FALSE; }*/ STATIC_OVL void -zerocomp_bputc(c) -int c; +zerocomp_bputc(int c) { #ifdef MFLOPPY bytes_counted++; @@ -787,8 +761,7 @@ int c; /*ARGSUSED*/ void STATIC_OVL -zerocomp_bufon(fd) -int fd; +zerocomp_bufon(int fd) { compressing = TRUE; return; @@ -796,8 +769,7 @@ int fd; /*ARGSUSED*/ STATIC_OVL void -zerocomp_bufoff(fd) -int fd; +zerocomp_bufoff(int fd) { if (outbufp) { outbufp = 0; @@ -810,8 +782,7 @@ int fd; /* flush run and buffer */ STATIC_OVL void -zerocomp_bflush(fd) -register int fd; +zerocomp_bflush(register int fd) { bwritefd = fd; if (outrunlength >= 0) { /* flush run */ @@ -836,10 +807,7 @@ register int fd; } STATIC_OVL void -zerocomp_bwrite(fd, loc, num) -int fd; -genericptr_t loc; -register unsigned num; +zerocomp_bwrite(int fd, genericptr_t loc, register unsigned num) { register unsigned char *bp = (unsigned char *) loc; @@ -875,8 +843,7 @@ register unsigned num; } void -zerocomp_bclose(fd) -int fd; +zerocomp_bclose(int fd) { zerocomp_bufoff(fd); (void) nhclose(fd); @@ -885,8 +852,7 @@ int fd; #endif /* ZEROCOMP */ STATIC_OVL void -savelevchn(fd, mode) -register int fd, mode; +savelevchn(register int fd, register int mode) { s_level *tmplev, *tmplev2; int cnt = 0; @@ -909,10 +875,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 +896,7 @@ struct cemetery **cemeteryaddr; } STATIC_OVL 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 +920,7 @@ register int fd, mode; } STATIC_OVL void -saveobj(fd, otmp) -int fd; -struct obj *otmp; +saveobj(int fd, struct obj *otmp) { int buflen, zerobuf = 0; @@ -1009,9 +969,7 @@ struct obj *otmp; } STATIC_OVL 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; @@ -1071,9 +1029,7 @@ register struct obj *otmp; } STATIC_OVL void -savemon(fd, mtmp) -int fd; -struct monst *mtmp; +savemon(int fd, struct monst *mtmp) { int buflen; @@ -1136,9 +1092,7 @@ struct monst *mtmp; } STATIC_OVL 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; @@ -1168,9 +1122,7 @@ register struct monst *mtmp; } STATIC_OVL void -savetrapchn(fd, trap, mode) -register int fd, mode; -register struct trap *trap; +savetrapchn(register int fd, register struct trap *trap, register int mode) { register struct trap *trap2; @@ -1192,8 +1144,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) { register struct fruit *f2, *f1; @@ -1213,8 +1164,7 @@ register int fd, mode; } void -store_plname_in_file(fd) -int fd; +store_plname_in_file(int fd) { int plsiztmp = PL_NSIZ; bufoff(fd); @@ -1226,8 +1176,7 @@ int fd; } STATIC_OVL void -save_msghistory(fd, mode) -int fd, mode; +save_msghistory(int fd, int mode) { char *msg; int msgcount = 0, msglen; @@ -1254,8 +1203,7 @@ int fd, mode; } void -store_savefileinfo(fd) -int fd; +store_savefileinfo(int fd) { /* sfcap (decl.c) describes the savefile feature capabilities * that are supported by this port/platform build. @@ -1277,8 +1225,7 @@ int fd; } void -set_savepref(suitename) -const char *suitename; +set_savepref(const char *suitename) { if (!strcmpi(suitename, "externalcomp")) { saveprocs.name = "externalcomp"; @@ -1411,8 +1358,7 @@ freedynamicdata() #ifdef MFLOPPY boolean -swapin_file(lev) -int lev; +swapin_file(int lev) { char to[PATHLEN], from[PATHLEN]; @@ -1467,8 +1413,7 @@ swapout_oldest() } STATIC_OVL void -copyfile(from, to) -char *from, *to; +copyfile(char *from, char *to) { #ifdef TOS if (_copyfile(from, to)) diff --git a/src/shk.c b/src/shk.c index a0cf00e0d1..3f32f01839 100644 --- a/src/shk.c +++ b/src/shk.c @@ -10,9 +10,9 @@ #define PAY_SKIP (-1) #define PAY_BROKE (-2) -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_DCL void makekops(coord *); +STATIC_DCL void call_kops(struct monst *, boolean); +STATIC_DCL void kops_gone(boolean); #define NOTANGRY(mon) ((mon)->mpeaceful) #define ANGRY(mon) (!NOTANGRY(mon)) @@ -28,52 +28,52 @@ STATIC_VAR NEARDATA long int followmsg; /* last time of follow message */ STATIC_VAR const char and_its_contents[] = " and its contents"; STATIC_VAR const char the_contents_of[] = "the contents of "; -STATIC_DCL void FDECL(append_honorific, (char *)); -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_DCL void FDECL(clear_unpaid, (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_DCL boolean FDECL(inherits, (struct monst *, int, int)); -STATIC_DCL 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_DCL void FDECL(add_one_tobill, (struct obj *, BOOLEAN_P, - struct monst *)); -STATIC_DCL void FDECL(dropped_container, (struct obj *, struct monst *, - BOOLEAN_P)); -STATIC_DCL void FDECL(add_to_billobjs, (struct obj *)); -STATIC_DCL void FDECL(bill_box_content, (struct obj *, BOOLEAN_P, BOOLEAN_P, - struct monst *)); -STATIC_DCL boolean FDECL(rob_shop, (struct monst *)); -STATIC_DCL void FDECL(deserted_shop, (char *)); -STATIC_DCL boolean FDECL(special_stock, (struct obj *, struct monst *, - BOOLEAN_P)); -STATIC_DCL const char *FDECL(cad, (BOOLEAN_P)); +STATIC_DCL void append_honorific(char *); +STATIC_DCL void setpaid(struct monst *); +STATIC_DCL long addupbill(struct monst *); +STATIC_DCL void pacify_shk(struct monst *); +STATIC_DCL struct bill_x *onbill(struct obj *, struct monst *, + boolean); +STATIC_DCL struct monst *next_shkp(struct monst *, boolean); +STATIC_DCL long shop_debt(struct eshk *); +STATIC_DCL char *shk_owns(char *, struct obj *); +STATIC_DCL char *mon_owns(char *, struct obj *); +STATIC_DCL void clear_unpaid(struct obj *); +STATIC_DCL long check_credit(long, struct monst *); +STATIC_DCL void pay(long, struct monst *); +STATIC_DCL long get_cost(struct obj *, struct monst *); +STATIC_DCL long set_cost(struct obj *, struct monst *); +STATIC_DCL const char *shk_embellish(struct obj *, long); +STATIC_DCL long cost_per_charge(struct monst *, struct obj *, + boolean); +STATIC_DCL long cheapest_item(struct monst *); +STATIC_DCL int dopayobj(struct monst *, struct bill_x *, + struct obj **, int, boolean); +STATIC_DCL long stolen_container(struct obj *, struct monst *, + long, boolean); +STATIC_DCL long getprice(struct obj *, boolean); +STATIC_DCL void shk_names_obj(struct monst *, struct obj *, + const char *, long, const char *); +STATIC_DCL struct obj *bp_to_obj(struct bill_x *); +STATIC_DCL boolean inherits(struct monst *, int, int); +STATIC_DCL void set_repo_loc(struct monst *); +STATIC_DCL boolean angry_shk_exists(void); +STATIC_DCL void rile_shk(struct monst *); +STATIC_DCL void rouse_shk(struct monst *, boolean); +STATIC_DCL void remove_damage(struct monst *, boolean); +STATIC_DCL void sub_one_frombill(struct obj *, struct monst *); +STATIC_DCL void add_one_tobill(struct obj *, boolean, + struct monst *); +STATIC_DCL void dropped_container(struct obj *, struct monst *, + boolean); +STATIC_DCL void add_to_billobjs(struct obj *); +STATIC_DCL void bill_box_content(struct obj *, boolean, boolean, + struct monst *); +STATIC_DCL boolean rob_shop(struct monst *); +STATIC_DCL void deserted_shop(char *); +STATIC_DCL boolean special_stock(struct obj *, struct monst *, + boolean); +STATIC_DCL const char *cad(boolean); /* invariants: obj->unpaid iff onbill(obj) [unless bp->useup] @@ -94,9 +94,7 @@ STATIC_DCL const char *FDECL(cad, (BOOLEAN_P)); * if the monster kept the change. */ long -money2mon(mon, amount) -struct monst *mon; -long amount; +money2mon(struct monst *mon, long amount) { struct obj *ygold = findgold(invent); @@ -125,9 +123,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 amount) { struct obj *mongold = findgold(mon->minvent); @@ -155,9 +151,7 @@ long amount; } STATIC_OVL 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)) @@ -180,8 +174,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]; @@ -218,9 +211,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 = @@ -228,8 +219,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) { @@ -239,9 +229,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); @@ -260,8 +248,7 @@ boolean ghostly; /* Clear the unpaid bit on all of the objects in the list. */ STATIC_OVL void -clear_unpaid(list) -register struct obj *list; +clear_unpaid(register struct obj *list) { while (list) { if (Has_contents(list)) @@ -273,8 +260,7 @@ register struct obj *list; /* either you paid or left the shop or the shopkeeper died */ STATIC_OVL void -setpaid(shkp) -register struct monst *shkp; +setpaid(register struct monst *shkp) { register struct obj *obj; register struct monst *mtmp; @@ -307,8 +293,7 @@ register struct monst *shkp; } STATIC_OVL 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; @@ -322,9 +307,7 @@ register struct monst *shkp; } STATIC_OVL 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; @@ -376,8 +359,7 @@ register boolean nearshop; /* 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; @@ -389,9 +371,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; @@ -432,8 +412,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; @@ -455,8 +434,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_OVL boolean -rob_shop(shkp) -struct monst *shkp; +rob_shop(struct monst *shkp) { struct eshk *eshkp; long total; @@ -488,8 +466,7 @@ struct monst *shkp; /* give a message when entering an untended shop (caller has verified that) */ STATIC_OVL void -deserted_shop(enterstring) -/*const*/ char *enterstring; +deserted_shop(/*const*/ char *enterstring) { struct monst *mtmp; struct mkroom *r = &rooms[(int) *enterstring - ROOMOFFSET]; @@ -516,8 +493,7 @@ deserted_shop(enterstring) } void -u_entered_shop(enterstring) -char *enterstring; +u_entered_shop(char *enterstring) { register int rt; register struct monst *shkp; @@ -632,8 +608,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; @@ -658,8 +633,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) { register struct monst *shkp1, *shkp2; struct bill_x *bp1 = 0, *bp2 = 0; @@ -694,8 +668,7 @@ struct obj *obj1, *obj2; * level is bones data which has a shk on the warpath. */ STATIC_OVL long -shop_debt(eshkp) -struct eshk *eshkp; +shop_debt(struct eshk *eshkp) { struct bill_x *bp; int ct; @@ -743,8 +716,7 @@ shopper_financial_report() } int -inhishop(mtmp) -register struct monst *mtmp; +inhishop(register struct monst *mtmp) { struct eshk *eshkp = ESHK(mtmp); @@ -753,8 +725,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; @@ -772,8 +743,7 @@ register char rmno; } boolean -tended_shop(sroom) -register struct mkroom *sroom; +tended_shop(register struct mkroom *sroom) { register struct monst *mtmp = sroom->resident; @@ -784,10 +754,7 @@ register struct mkroom *sroom; } STATIC_OVL 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; @@ -808,8 +775,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))); @@ -817,8 +783,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; @@ -830,8 +795,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; @@ -904,9 +868,7 @@ register struct obj *obj, *merge; } STATIC_OVL long -check_credit(tmp, shkp) -long tmp; -register struct monst *shkp; +check_credit(long tmp, register struct monst *shkp) { long credit = ESHK(shkp)->credit; @@ -925,9 +887,7 @@ register struct monst *shkp; } STATIC_OVL void -pay(tmp, shkp) -long tmp; -register struct monst *shkp; +pay(long tmp, register struct monst *shkp) { long robbed = ESHK(shkp)->robbed; long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp)); @@ -947,9 +907,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; @@ -976,8 +934,7 @@ angry_shk_exists() /* remove previously applied surcharge from all billed items */ STATIC_OVL void -pacify_shk(shkp) -register struct monst *shkp; +pacify_shk(register struct monst *shkp) { NOTANGRY(shkp) = TRUE; /* make peaceful */ if (ESHK(shkp)->surcharge) { @@ -995,8 +952,7 @@ register struct monst *shkp; /* add aggravation surcharge to all billed items */ STATIC_OVL void -rile_shk(shkp) -register struct monst *shkp; +rile_shk(register struct monst *shkp) { NOTANGRY(shkp) = FALSE; /* make angry */ if (!ESHK(shkp)->surcharge) { @@ -1014,9 +970,7 @@ register struct monst *shkp; /* wakeup and/or unparalyze shopkeeper */ STATIC_OVL 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... */ @@ -1030,9 +984,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); @@ -1075,8 +1027,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); @@ -1085,8 +1036,7 @@ boolean silentkops; } void -hot_pursuit(shkp) -register struct monst *shkp; +hot_pursuit(register struct monst *shkp) { if (!shkp->isshk) return; @@ -1102,9 +1052,7 @@ register struct monst *shkp; * must be checked by the calling function. */ void -make_angry_shk(shkp, ox, oy) -register struct monst *shkp; -register xchar ox, oy; +make_angry_shk(register struct monst *shkp, register xchar ox, register xchar oy) { xchar sx, sy; struct eshk *eshkp = ESHK(shkp); @@ -1136,8 +1084,7 @@ STATIC_VAR const char not_enough_money[] = "Besides, you don't have enough to interest %s."; STATIC_OVL long -cheapest_item(shkp) /* delivers the cheapest item on the list */ -register struct monst *shkp; +cheapest_item(register struct monst *shkp) /* delivers the cheapest item on the list */ { register int ct = ESHK(shkp)->billct; register struct bill_x *bp = ESHK(shkp)->bill_p; @@ -1481,12 +1428,11 @@ dopay() * -2 if no money/credit left */ STATIC_OVL 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,/* 0 => used-up item, 1 => other (unpaid or lost) */ + boolean itemize) { register struct obj *obj = *obj_p; long ltmp, quan, save_quan; @@ -1588,8 +1534,7 @@ static struct repo { /* repossession context */ /* routine called after dying (or quitting) */ boolean -paybill(croaked) -int croaked; /* -1: escaped dungeon; 0: quit; 1: died */ +paybill(int croaked) /* -1: escaped dungeon; 0: quit; 1: died */ { struct monst *mtmp, *mtmp2, *firstshk, *resident, *creditor, *hostile, *localshk; @@ -1675,10 +1620,7 @@ int croaked; /* -1: escaped dungeon; 0: quit; 1: died */ } STATIC_OVL boolean -inherits(shkp, numsk, croaked) -struct monst *shkp; -int numsk; -int croaked; +inherits(struct monst *shkp, int numsk, int croaked) { long loss = 0L; long umoney; @@ -1774,8 +1716,7 @@ int croaked; } STATIC_OVL void -set_repo_loc(shkp) -struct monst *shkp; +set_repo_loc(struct monst *shkp) { register xchar ox, oy; struct eshk *eshkp = ESHK(shkp); @@ -1827,8 +1768,7 @@ finish_paybill() /* find obj on one of the lists */ STATIC_OVL 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; @@ -1846,8 +1786,7 @@ register struct bill_x *bp; * be any timeouts on the billobjs chain. */ struct obj * -find_oid(id) -unsigned id; +find_oid(unsigned id) { struct obj *obj; struct monst *mon, *mmtmp[3]; @@ -1879,8 +1818,7 @@ unsigned id; /* Returns the price of an arbitrary item in the shop. Returns 0 if the item doesn't belong to a shopkeeper. */ 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; @@ -1904,9 +1842,8 @@ register struct obj *obj; /* calculate the value that the shk will charge for [one of] an object */ STATIC_OVL long -get_cost(obj, shkp) -register struct obj *obj; -register struct monst *shkp; /* if angry, impose a surcharge */ +get_cost(register struct obj *obj, + register struct monst *shkp) /* if angry, impose a surcharge */ { long tmp = getprice(obj, FALSE), /* used to perform a single calculation even when multiple @@ -2015,12 +1952,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 price, boolean usell, boolean unpaid_only) { register struct obj *otmp; @@ -2048,8 +1980,7 @@ boolean unpaid_only; } long -contained_gold(obj) -register struct obj *obj; +contained_gold(register struct obj *obj) { register struct obj *otmp; register long value = 0L; @@ -2065,10 +1996,7 @@ register struct obj *obj; } STATIC_OVL 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; @@ -2086,8 +2014,7 @@ register boolean sale; } void -picked_container(obj) -register struct obj *obj; +picked_container(register struct obj *obj) { register struct obj *otmp; @@ -2105,10 +2032,7 @@ register struct obj *obj; } STATIC_OVL 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 @@ -2134,9 +2058,7 @@ boolean quietly; /* calculate how much the shk will pay when buying [all of] an object */ STATIC_OVL 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, multiplier = 1L, divisor = 1L; @@ -2184,10 +2106,9 @@ register struct monst *shkp; 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; - if negative, use abs(amt) even if it's less than old cost */ +alter_cost(struct obj *obj, + long 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; struct monst *shkp; @@ -2207,9 +2128,8 @@ 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,/* known to be unpaid or contain unpaid */ + boolean include_contents) { struct bill_x *bp = (struct bill_x *) 0; struct monst *shkp; @@ -2241,10 +2161,7 @@ boolean include_contents; } STATIC_OVL 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; @@ -2274,8 +2191,7 @@ struct monst *shkp; } STATIC_OVL 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"); @@ -2289,10 +2205,7 @@ struct obj *obj; /* recursive billing of objects within containers. */ STATIC_OVL void -bill_box_content(obj, ininv, dummy, shkp) -register struct obj *obj; -register boolean ininv, dummy; -register struct monst *shkp; +bill_box_content(register struct obj *obj, register boolean ininv, register boolean dummy, register struct monst *shkp) { register struct obj *otmp; @@ -2310,12 +2223,11 @@ register struct monst *shkp; /* shopkeeper tells you what you bought or sold, sometimes partly IDing it */ STATIC_OVL 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, /* "%s %ld %s %s", doname(obj), amt, plur(amt), arg */ + long amt, + const char *arg) { char *obj_name, fmtbuf[BUFSZ]; boolean was_unknown = !obj->dknown; @@ -2346,11 +2258,10 @@ 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, /* in: non-null if shk has been validated; out: shk */ + struct obj *obj, + char roomno, + boolean reset_nocharge) { struct monst *shkp = *shkpp; @@ -2384,9 +2295,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 = 0; long ltmp, cltmp, gltmp; @@ -2484,8 +2393,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) */ @@ -2504,8 +2412,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; @@ -2543,9 +2450,7 @@ register struct obj *obj, *otmp; } STATIC_OVL 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; @@ -2585,9 +2490,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; @@ -2606,11 +2509,7 @@ register struct monst *shkp; } STATIC_OVL 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 price, boolean ininv) { struct obj *otmp; struct bill_x *bp; @@ -2646,10 +2545,7 @@ boolean ininv; } long -stolen_value(obj, x, y, peaceful, silent) -struct obj *obj; -xchar x, y; -boolean peaceful, 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); @@ -2745,8 +2641,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 @@ -2760,9 +2655,7 @@ int deliberate; } 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; register struct eshk *eshkp; @@ -3027,8 +2920,7 @@ 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); @@ -3109,9 +3001,7 @@ int mode; /* 0: deliver count 1: paged */ #define HUNGRY 2 STATIC_OVL 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; @@ -3152,9 +3042,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; @@ -3185,9 +3073,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 cost) { struct damage *tmp_dam; char *shops; @@ -3231,9 +3117,7 @@ long cost; */ STATIC_OVL void -remove_damage(shkp, croaked) -struct monst *shkp; -boolean croaked; +remove_damage(struct monst *shkp, boolean croaked) { struct damage *tmp_dam, *tmp2_dam; boolean did_repair = FALSE, saw_door = FALSE, saw_floor = FALSE, @@ -3353,10 +3237,7 @@ boolean croaked; * 3: untrap */ int -repair_damage(shkp, tmp_dam, catchup) -register struct monst *shkp; -register struct damage *tmp_dam; -boolean catchup; /* restoring a level */ +repair_damage(register struct monst *shkp, register struct damage *tmp_dam, boolean catchup) /* restoring a level */ { register xchar x, y, i; xchar litter[9]; @@ -3487,8 +3368,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) -register struct monst *shkp; +shk_move(register struct monst *shkp) { register xchar gx, gy, omx, omy; register int udist; @@ -3597,8 +3477,7 @@ register struct monst *shkp; /* called after shopkeeper moves, in case themove causes re-entry into shop */ void -after_shk_move(shkp) -struct monst *shkp; +after_shk_move(struct monst *shkp) { struct eshk *eshkp = ESHK(shkp); @@ -3611,16 +3490,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; @@ -3712,8 +3589,7 @@ register int fall; } STATIC_OVL void -makekops(mm) -coord *mm; +makekops(coord *mm) { static const short k_mndx[4] = { PM_KEYSTONE_KOP, PM_KOP_SERGEANT, PM_KOP_LIEUTENANT, PM_KOP_KAPTAIN }; @@ -3738,9 +3614,7 @@ coord *mm; } 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]; @@ -3902,8 +3776,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; struct eshk *eshkp; @@ -3921,8 +3794,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; @@ -3942,8 +3814,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]; @@ -3996,9 +3867,7 @@ register struct obj *first_obj; } STATIC_OVL const char * -shk_embellish(itm, cost) -register struct obj *itm; -long cost; +shk_embellish(register struct obj *itm, long cost) { if (!rn2(3)) { register int o, choice = rn2(5); @@ -4048,8 +3917,7 @@ const char *Izchak_speaks[] = { }; void -shk_chat(shkp) -struct monst *shkp; +shk_chat(struct monst *shkp) { struct eshk *eshk; long shkmoney; @@ -4104,8 +3972,7 @@ struct monst *shkp; } STATIC_OVL void -kops_gone(silent) -boolean silent; +kops_gone(boolean silent) { register int cnt = 0; register struct monst *mtmp, *mtmp2; @@ -4124,10 +3991,9 @@ boolean silent; } STATIC_OVL 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; @@ -4183,9 +4049,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; @@ -4232,16 +4096,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 amount) { register long delta; register struct monst *shkp; @@ -4276,8 +4137,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; @@ -4311,8 +4171,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; @@ -4347,9 +4206,7 @@ register xchar x, y; /* "your " or "Foobar's " (note the trailing space) */ 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, the_your[carried(obj) ? 1 : 0]); @@ -4357,9 +4214,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); @@ -4367,9 +4222,7 @@ struct obj *obj; } STATIC_OVL char * -shk_owns(buf, obj) -char *buf; -struct obj *obj; +shk_owns(char *buf, struct obj *obj) { struct monst *shkp; xchar x, y; @@ -4384,9 +4237,7 @@ struct obj *obj; } STATIC_OVL 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))); @@ -4394,8 +4245,7 @@ struct obj *obj; } STATIC_OVL 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; diff --git a/src/shknam.c b/src/shknam.c index 728976cba1..e86fbd0329 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -6,13 +6,13 @@ #include "hack.h" -STATIC_DCL boolean FDECL(veggy_item, (struct obj * obj, int)); -STATIC_DCL int NDECL(shkveg); -STATIC_DCL void FDECL(mkveggy_at, (int, int)); -STATIC_DCL void FDECL(mkshobj_at, (const struct shclass *, int, int, - BOOLEAN_P)); -STATIC_DCL void FDECL(nameshk, (struct monst *, const char *const *)); -STATIC_DCL int FDECL(shkinit, (const struct shclass *, struct mkroom *)); +STATIC_DCL boolean veggy_item(struct obj * obj, int); +STATIC_DCL int shkveg(void); +STATIC_DCL void mkveggy_at(int, int); +STATIC_DCL void mkshobj_at(const struct shclass *, int, int, + boolean); +STATIC_DCL void nameshk(struct monst *, const char *const *); +STATIC_DCL int shkinit(const struct shclass *, struct mkroom *); #define VEGETARIAN_CLASS (MAXOCLASSES + 1) @@ -367,9 +367,7 @@ init_shop_selection() /* decide whether an object or object type is considered vegetarian; for types, items which might go either way are assumed to be veggy */ STATIC_OVL boolean -veggy_item(obj, otyp) -struct obj *obj; -int otyp; /* used iff obj is null */ +veggy_item(struct obj *obj, int otyp) /* used iff obj is null */ { int corpsenm; char oclass; @@ -433,8 +431,7 @@ shkveg() /* make a random item for health food store */ STATIC_OVL void -mkveggy_at(sx, sy) -int sx, sy; +mkveggy_at(int sx, int sy) { struct obj *obj = mksobj_at(shkveg(), sx, sy, TRUE, TRUE); @@ -445,10 +442,7 @@ int sx, sy; /* make an object of the appropriate type for a shop square */ STATIC_OVL void -mkshobj_at(shp, sx, sy, mkspecl) -const struct shclass *shp; -int sx, sy; -boolean mkspecl; +mkshobj_at(const struct shclass *shp, int sx, int sy, boolean mkspecl) { struct monst *mtmp; struct permonst *ptr; @@ -485,9 +479,7 @@ boolean mkspecl; /* extract a shopkeeper name for the given shop type */ STATIC_OVL 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; @@ -559,8 +551,7 @@ const char *const *nlp; } void -neweshk(mtmp) -struct monst *mtmp; +neweshk(struct monst *mtmp) { if (!mtmp->mextra) mtmp->mextra = newmextra(); @@ -571,8 +562,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)); @@ -583,9 +573,7 @@ struct monst *mtmp; /* create a new shopkeeper in the given room */ STATIC_OVL 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; @@ -677,9 +665,7 @@ struct mkroom *sroom; /* 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 @@ -776,9 +762,7 @@ register struct mkroom *sroom; /* 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]; @@ -801,8 +785,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; @@ -815,8 +798,7 @@ int type; } const char * -shkname(mtmp) -struct monst *mtmp; +shkname(struct monst *mtmp) { const char *shknm = ESHK(mtmp)->shknam; @@ -846,8 +828,7 @@ struct monst *mtmp; } boolean -shkname_is_pname(mtmp) -struct monst *mtmp; +shkname_is_pname(struct monst *mtmp) { const char *shknm = ESHK(mtmp)->shknam; @@ -855,9 +836,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/sounds.c b/src/sounds.c index f08fe9d207..2e38c3151c 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -4,16 +4,14 @@ #include "hack.h" -STATIC_DCL boolean FDECL(mon_is_gecko, (struct monst *)); -STATIC_DCL int FDECL(domonnoise, (struct monst *)); -STATIC_DCL int NDECL(dochat); -STATIC_DCL int FDECL(mon_in_room, (struct monst *, int)); +STATIC_DCL boolean mon_is_gecko(struct monst *); +STATIC_DCL int domonnoise(struct monst *); +STATIC_DCL int dochat(void); +STATIC_DCL int mon_in_room(struct monst *, int); /* this easily could be a macro, but it might overtax dumb compilers */ STATIC_OVL 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) @@ -307,8 +305,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; @@ -350,8 +347,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; @@ -373,8 +369,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; @@ -416,8 +411,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; @@ -450,8 +444,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))) @@ -469,8 +462,7 @@ register struct monst *mtmp; /* return True if mon is a gecko or seems to look like one (hallucination) */ STATIC_OVL boolean -mon_is_gecko(mon) -struct monst *mon; +mon_is_gecko(struct monst *mon) { int glyph; @@ -488,8 +480,7 @@ struct monst *mon; } STATIC_OVL int -domonnoise(mtmp) -register struct monst *mtmp; +domonnoise(register struct monst *mtmp) { char verbuf[BUFSZ]; register const char *pline_msg = 0, /* Monnam(mtmp) will be prepended */ @@ -1088,7 +1079,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 { struct nhregex *regex; @@ -1103,8 +1094,7 @@ char *sounddir = "."; /* adds a sound file mapping, returns 0 on failure, 1 on success */ int -add_sound_mapping(mapping) -const char *mapping; +add_sound_mapping(const char *mapping) { char text[256]; char filename[256]; @@ -1151,8 +1141,7 @@ const char *mapping; } void -play_sound_for_message(msg) -const char *msg; +play_sound_for_message(const char *msg) { audio_mapping *cursor = soundmap; diff --git a/src/sp_lev.c b/src/sp_lev.c index dc454128a0..d9d7873e96 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -18,156 +18,155 @@ #pragma warning(disable : 4244) #endif -typedef void FDECL((*select_iter_func), (int, int, genericptr)); - -extern void FDECL(mkmap, (lev_init *)); - -STATIC_DCL void NDECL(solidify_map); -STATIC_DCL void FDECL(splev_stack_init, (struct splevstack *)); -STATIC_DCL void FDECL(splev_stack_done, (struct splevstack *)); -STATIC_DCL void FDECL(splev_stack_push, (struct splevstack *, - struct opvar *)); -STATIC_DCL struct opvar *FDECL(splev_stack_pop, (struct splevstack *)); -STATIC_DCL struct splevstack *FDECL(splev_stack_reverse, - (struct splevstack *)); -STATIC_DCL struct opvar *FDECL(opvar_new_str, (char *)); -STATIC_DCL struct opvar *FDECL(opvar_new_int, (long)); -STATIC_DCL struct opvar *FDECL(opvar_new_coord, (int, int)); +typedef void (*select_iter_func)(int, int, genericptr); + +extern void mkmap(lev_init *); + +STATIC_DCL void solidify_map(void); +STATIC_DCL void splev_stack_init(struct splevstack *); +STATIC_DCL void splev_stack_done(struct splevstack *); +STATIC_DCL void splev_stack_push(struct splevstack *, + struct opvar *); +STATIC_DCL struct opvar *splev_stack_pop(struct splevstack *); +STATIC_DCL struct splevstack *splev_stack_reverse(struct splevstack *); +STATIC_DCL struct opvar *opvar_new_str(char *); +STATIC_DCL struct opvar *opvar_new_int(long); +STATIC_DCL struct opvar *opvar_new_coord(int, int); #if 0 -STATIC_DCL struct opvar * FDECL(opvar_new_region, (int,int, int,int)); +STATIC_DCL struct opvar * opvar_new_region(int,int, int,int); #endif /*0*/ -STATIC_DCL void FDECL(opvar_free_x, (struct opvar *)); -STATIC_DCL struct opvar *FDECL(opvar_clone, (struct opvar *)); -STATIC_DCL struct opvar *FDECL(opvar_var_conversion, (struct sp_coder *, - struct opvar *)); -STATIC_DCL struct splev_var *FDECL(opvar_var_defined, (struct sp_coder *, - char *)); -STATIC_DCL struct opvar *FDECL(splev_stack_getdat, (struct sp_coder *, - XCHAR_P)); -STATIC_DCL struct opvar *FDECL(splev_stack_getdat_any, (struct sp_coder *)); -STATIC_DCL void FDECL(variable_list_del, (struct splev_var *)); -STATIC_DCL void FDECL(lvlfill_maze_grid, (int, int, int, int, SCHAR_P)); -STATIC_DCL void FDECL(lvlfill_solid, (SCHAR_P, SCHAR_P)); -STATIC_DCL void FDECL(set_wall_property, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, - int)); -STATIC_DCL void NDECL(shuffle_alignments); -STATIC_DCL void NDECL(count_features); -STATIC_DCL void NDECL(remove_boundary_syms); -STATIC_DCL void FDECL(maybe_add_door, (int, int, struct mkroom *)); -STATIC_DCL void NDECL(link_doors_rooms); -STATIC_DCL void NDECL(fill_rooms); -STATIC_DCL int NDECL(rnddoor); -STATIC_DCL int NDECL(rndtrap); -STATIC_DCL void FDECL(get_location, (schar *, schar *, int, struct mkroom *)); -STATIC_DCL boolean FDECL(is_ok_location, (SCHAR_P, SCHAR_P, int)); -STATIC_DCL unpacked_coord FDECL(get_unpacked_coord, (long, int)); -STATIC_DCL void FDECL(get_location_coord, (schar *, schar *, int, - struct mkroom *, long)); -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 boolean FDECL(create_subroom, (struct mkroom *, XCHAR_P, XCHAR_P, - XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); -STATIC_DCL void FDECL(create_door, (room_door *, struct mkroom *)); -STATIC_DCL void FDECL(create_trap, (trap *, struct mkroom *)); -STATIC_DCL int FDECL(noncoalignment, (ALIGNTYP_P)); -STATIC_DCL boolean FDECL(m_bad_boulder_spot, (int, int)); -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 void FDECL(replace_terrain, (replaceterrain *, 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 struct mkroom *FDECL(build_room, (room *, struct mkroom *)); -STATIC_DCL void FDECL(light_region, (region *)); -STATIC_DCL void FDECL(wallify_map, (int, int, int, int)); -STATIC_DCL void FDECL(maze1xy, (coord *, int)); -STATIC_DCL void NDECL(fill_empty_maze); -STATIC_DCL boolean FDECL(sp_level_loader, (dlb *, sp_lev *)); -STATIC_DCL boolean FDECL(sp_level_free, (sp_lev *)); -STATIC_DCL void FDECL(splev_initlev, (lev_init *)); -STATIC_DCL struct sp_frame *FDECL(frame_new, (long)); -STATIC_DCL void FDECL(frame_del, (struct sp_frame *)); -STATIC_DCL void FDECL(spo_frame_push, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_frame_pop, (struct sp_coder *)); -STATIC_DCL long FDECL(sp_code_jmpaddr, (long, long)); -STATIC_DCL void FDECL(spo_call, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_return, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_end_moninvent, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_pop_container, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_message, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_monster, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_object, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_level_flags, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_initlevel, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_engraving, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_mineralize, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_room, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_endroom, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_stair, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_ladder, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_grave, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_altar, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_trap, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_gold, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_corridor, (struct sp_coder *)); -STATIC_DCL struct opvar *FDECL(selection_opvar, (char *)); -STATIC_DCL xchar FDECL(selection_getpoint, (int, int, struct opvar *)); -STATIC_DCL void FDECL(selection_setpoint, (int, int, struct opvar *, XCHAR_P)); -STATIC_DCL struct opvar *FDECL(selection_not, (struct opvar *)); -STATIC_DCL struct opvar *FDECL(selection_logical_oper, (struct opvar *, - struct opvar *, CHAR_P)); -STATIC_DCL struct opvar *FDECL(selection_filter_mapchar, (struct opvar *, - struct opvar *)); -STATIC_DCL void FDECL(selection_filter_percent, (struct opvar *, int)); -STATIC_DCL int FDECL(selection_rndcoord, (struct opvar *, schar *, schar *, - BOOLEAN_P)); -STATIC_DCL void FDECL(selection_do_grow, (struct opvar *, int)); -STATIC_DCL void FDECL(set_selection_floodfillchk, (int FDECL((*), (int,int)))); -STATIC_DCL int FDECL(floodfillchk_match_under, (int, int)); -STATIC_DCL int FDECL(floodfillchk_match_accessible, (int, int)); -STATIC_DCL void FDECL(selection_floodfill, (struct opvar *, int, int, - BOOLEAN_P)); -STATIC_DCL void FDECL(selection_do_ellipse, (struct opvar *, int, int, - int, int, int)); -STATIC_DCL long FDECL(line_dist_coord, (long, long, long, long, long, long)); -STATIC_DCL void FDECL(selection_do_gradient, (struct opvar *, long, long, long, - long, long, long, long, long)); -STATIC_DCL void FDECL(selection_do_line, (SCHAR_P, SCHAR_P, SCHAR_P, SCHAR_P, - struct opvar *)); -STATIC_DCL void FDECL(selection_do_randline, (SCHAR_P, SCHAR_P, SCHAR_P, - SCHAR_P, SCHAR_P, SCHAR_P, - struct opvar *)); -STATIC_DCL void FDECL(selection_iterate, (struct opvar *, select_iter_func, - genericptr_t)); -STATIC_DCL void FDECL(sel_set_ter, (int, int, genericptr_t)); -STATIC_DCL void FDECL(sel_set_feature, (int, int, genericptr_t)); -STATIC_DCL void FDECL(sel_set_door, (int, int, genericptr_t)); -STATIC_DCL void FDECL(spo_door, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_feature, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_terrain, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_replace_terrain, (struct sp_coder *)); -STATIC_DCL boolean FDECL(generate_way_out_method, (int, int, struct opvar *)); -STATIC_DCL void NDECL(ensure_way_out); -STATIC_DCL void FDECL(spo_levregion, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_region, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_drawbridge, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_mazewalk, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_wall_property, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_room_door, (struct sp_coder *)); -STATIC_DCL void FDECL(sel_set_wallify, (int, int, genericptr_t)); -STATIC_DCL void FDECL(spo_wallify, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_map, (struct sp_coder *)); -STATIC_DCL void FDECL(spo_jmp, (struct sp_coder *, sp_lev *)); -STATIC_DCL void FDECL(spo_conditional_jump, (struct sp_coder *, sp_lev *)); -STATIC_DCL void FDECL(spo_var_init, (struct sp_coder *)); +STATIC_DCL void opvar_free_x(struct opvar *); +STATIC_DCL struct opvar *opvar_clone(struct opvar *); +STATIC_DCL struct opvar *opvar_var_conversion(struct sp_coder *, + struct opvar *); +STATIC_DCL struct splev_var *opvar_var_defined(struct sp_coder *, + char *); +STATIC_DCL struct opvar *splev_stack_getdat(struct sp_coder *, + xchar); +STATIC_DCL struct opvar *splev_stack_getdat_any(struct sp_coder *); +STATIC_DCL void variable_list_del(struct splev_var *); +STATIC_DCL void lvlfill_maze_grid(int, int, int, int, schar); +STATIC_DCL void lvlfill_solid(schar, schar); +STATIC_DCL void set_wall_property(xchar, xchar, xchar, xchar, + int); +STATIC_DCL void shuffle_alignments(void); +STATIC_DCL void count_features(void); +STATIC_DCL void remove_boundary_syms(void); +STATIC_DCL void maybe_add_door(int, int, struct mkroom *); +STATIC_DCL void link_doors_rooms(void); +STATIC_DCL void fill_rooms(void); +STATIC_DCL int rnddoor(void); +STATIC_DCL int rndtrap(void); +STATIC_DCL void get_location(schar *, schar *, int, struct mkroom *); +STATIC_DCL boolean is_ok_location(schar, schar, int); +STATIC_DCL unpacked_coord get_unpacked_coord(long, int); +STATIC_DCL void get_location_coord(schar *, schar *, int, + struct mkroom *, long); +STATIC_DCL void get_room_loc(schar *, schar *, struct mkroom *); +STATIC_DCL void get_free_room_loc(schar *, schar *, + struct mkroom *, packed_coord); +STATIC_DCL boolean create_subroom(struct mkroom *, xchar, xchar, + xchar, xchar, xchar, xchar); +STATIC_DCL void create_door(room_door *, struct mkroom *); +STATIC_DCL void create_trap(trap *, struct mkroom *); +STATIC_DCL int noncoalignment(ALIGNTYP_P); +STATIC_DCL boolean m_bad_boulder_spot(int, int); +STATIC_DCL void create_monster(monster *, struct mkroom *); +STATIC_DCL void create_object(object *, struct mkroom *); +STATIC_DCL void create_altar(altar *, struct mkroom *); +STATIC_DCL void replace_terrain(replaceterrain *, struct mkroom *); +STATIC_DCL boolean search_door(struct mkroom *, + xchar *, xchar *, xchar, int); +STATIC_DCL void fix_stair_rooms(void); +STATIC_DCL void create_corridor(corridor *); +STATIC_DCL struct mkroom *build_room(room *, struct mkroom *); +STATIC_DCL void light_region(region *); +STATIC_DCL void wallify_map(int, int, int, int); +STATIC_DCL void maze1xy(coord *, int); +STATIC_DCL void fill_empty_maze(void); +STATIC_DCL boolean sp_level_loader(dlb *, sp_lev *); +STATIC_DCL boolean sp_level_free(sp_lev *); +STATIC_DCL void splev_initlev(lev_init *); +STATIC_DCL struct sp_frame *frame_new(long); +STATIC_DCL void frame_del(struct sp_frame *); +STATIC_DCL void spo_frame_push(struct sp_coder *); +STATIC_DCL void spo_frame_pop(struct sp_coder *); +STATIC_DCL long sp_code_jmpaddr(long, long); +STATIC_DCL void spo_call(struct sp_coder *); +STATIC_DCL void spo_return(struct sp_coder *); +STATIC_DCL void spo_end_moninvent(struct sp_coder *); +STATIC_DCL void spo_pop_container(struct sp_coder *); +STATIC_DCL void spo_message(struct sp_coder *); +STATIC_DCL void spo_monster(struct sp_coder *); +STATIC_DCL void spo_object(struct sp_coder *); +STATIC_DCL void spo_level_flags(struct sp_coder *); +STATIC_DCL void spo_initlevel(struct sp_coder *); +STATIC_DCL void spo_engraving(struct sp_coder *); +STATIC_DCL void spo_mineralize(struct sp_coder *); +STATIC_DCL void spo_room(struct sp_coder *); +STATIC_DCL void spo_endroom(struct sp_coder *); +STATIC_DCL void spo_stair(struct sp_coder *); +STATIC_DCL void spo_ladder(struct sp_coder *); +STATIC_DCL void spo_grave(struct sp_coder *); +STATIC_DCL void spo_altar(struct sp_coder *); +STATIC_DCL void spo_trap(struct sp_coder *); +STATIC_DCL void spo_gold(struct sp_coder *); +STATIC_DCL void spo_corridor(struct sp_coder *); +STATIC_DCL struct opvar *selection_opvar(char *); +STATIC_DCL xchar selection_getpoint(int, int, struct opvar *); +STATIC_DCL void selection_setpoint(int, int, struct opvar *, xchar); +STATIC_DCL struct opvar *selection_not(struct opvar *); +STATIC_DCL struct opvar *selection_logical_oper(struct opvar *, + struct opvar *, char); +STATIC_DCL struct opvar *selection_filter_mapchar(struct opvar *, + struct opvar *); +STATIC_DCL void selection_filter_percent(struct opvar *, int); +STATIC_DCL int selection_rndcoord(struct opvar *, schar *, schar *, + boolean); +STATIC_DCL void selection_do_grow(struct opvar *, int); +STATIC_DCL void set_selection_floodfillchk(int (*)(int,int)); +STATIC_DCL int floodfillchk_match_under(int, int); +STATIC_DCL int floodfillchk_match_accessible(int, int); +STATIC_DCL void selection_floodfill(struct opvar *, int, int, + boolean); +STATIC_DCL void selection_do_ellipse(struct opvar *, int, int, + int, int, int); +STATIC_DCL long line_dist_coord(long, long, long, long, long, long); +STATIC_DCL void selection_do_gradient(struct opvar *, long, long, long, + long, long, long, long, long); +STATIC_DCL void selection_do_line(schar, schar, schar, schar, + struct opvar *); +STATIC_DCL void selection_do_randline(schar, schar, schar, + schar, schar, schar, + struct opvar *); +STATIC_DCL void selection_iterate(struct opvar *, select_iter_func, + genericptr_t); +STATIC_DCL void sel_set_ter(int, int, genericptr_t); +STATIC_DCL void sel_set_feature(int, int, genericptr_t); +STATIC_DCL void sel_set_door(int, int, genericptr_t); +STATIC_DCL void spo_door(struct sp_coder *); +STATIC_DCL void spo_feature(struct sp_coder *); +STATIC_DCL void spo_terrain(struct sp_coder *); +STATIC_DCL void spo_replace_terrain(struct sp_coder *); +STATIC_DCL boolean generate_way_out_method(int, int, struct opvar *); +STATIC_DCL void ensure_way_out(void); +STATIC_DCL void spo_levregion(struct sp_coder *); +STATIC_DCL void spo_region(struct sp_coder *); +STATIC_DCL void spo_drawbridge(struct sp_coder *); +STATIC_DCL void spo_mazewalk(struct sp_coder *); +STATIC_DCL void spo_wall_property(struct sp_coder *); +STATIC_DCL void spo_room_door(struct sp_coder *); +STATIC_DCL void sel_set_wallify(int, int, genericptr_t); +STATIC_DCL void spo_wallify(struct sp_coder *); +STATIC_DCL void spo_map(struct sp_coder *); +STATIC_DCL void spo_jmp(struct sp_coder *, sp_lev *); +STATIC_DCL void spo_conditional_jump(struct sp_coder *, sp_lev *); +STATIC_DCL void spo_var_init(struct sp_coder *); #if 0 -STATIC_DCL long FDECL(opvar_array_length, (struct sp_coder *)); +STATIC_DCL long opvar_array_length(struct sp_coder *); #endif /*0*/ -STATIC_DCL void FDECL(spo_shuffle_array, (struct sp_coder *)); -STATIC_DCL boolean FDECL(sp_level_coder, (sp_lev *)); +STATIC_DCL void spo_shuffle_array(struct sp_coder *); +STATIC_DCL boolean sp_level_coder(sp_lev *); #define LEFT 1 #define H_LEFT 2 @@ -225,8 +224,7 @@ solidify_map() } void -splev_stack_init(st) -struct splevstack *st; +splev_stack_init(struct splevstack *st) { if (st) { st->depth = 0; @@ -237,8 +235,7 @@ struct splevstack *st; } void -splev_stack_done(st) -struct splevstack *st; +splev_stack_done(struct splevstack *st) { if (st) { int i; @@ -274,9 +271,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; @@ -299,8 +294,7 @@ struct opvar *v; } struct opvar * -splev_stack_pop(st) -struct splevstack *st; +splev_stack_pop(struct splevstack *st) { struct opvar *ret = NULL; @@ -320,8 +314,7 @@ struct splevstack *st; } struct splevstack * -splev_stack_reverse(st) -struct splevstack *st; +splev_stack_reverse(struct splevstack *st) { long i; struct opvar *tmp; @@ -350,8 +343,7 @@ struct splevstack *st; #define OV_pop_typ(x, typ) (x = splev_stack_getdat(coder, typ)) struct opvar * -opvar_new_str(s) -char *s; +opvar_new_str(char *s) { struct opvar *tmpov = (struct opvar *) alloc(sizeof(struct opvar)); @@ -368,8 +360,7 @@ char *s; } struct opvar * -opvar_new_int(i) -long i; +opvar_new_int(long i) { struct opvar *tmpov = (struct opvar *) alloc(sizeof(struct opvar)); @@ -379,8 +370,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)); @@ -391,8 +381,7 @@ int x, y; #if 0 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)); @@ -403,8 +392,7 @@ opvar_new_region(x1,y1,x2,y2) #endif /*0*/ void -opvar_free_x(ov) -struct opvar *ov; +opvar_free_x(struct opvar *ov) { if (!ov) return; @@ -446,8 +434,7 @@ struct opvar *ov; } while (0) struct opvar * -opvar_clone(ov) -struct opvar *ov; +opvar_clone(struct opvar *ov) { struct opvar *tmpov; @@ -476,9 +463,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) { static const char nhFunc[] = "opvar_var_conversion"; struct splev_var *tmp; @@ -514,9 +499,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; @@ -532,9 +515,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) { static const char nhFunc[] = "splev_stack_getdat"; if (coder && coder->stack) { @@ -556,8 +537,7 @@ xchar typ; } struct opvar * -splev_stack_getdat_any(coder) -struct sp_coder *coder; +splev_stack_getdat_any(struct sp_coder *coder) { static const char nhFunc[] = "splev_stack_getdat_any"; if (coder && coder->stack) { @@ -573,8 +553,7 @@ struct sp_coder *coder; } void -variable_list_del(varlist) -struct splev_var *varlist; +variable_list_del(struct splev_var *varlist) { static const char nhFunc[] = "variable_list_del"; struct splev_var *tmp = varlist; @@ -600,9 +579,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; @@ -617,9 +594,7 @@ schar filling; } void -lvlfill_solid(filling, lit) -schar filling; -schar lit; +lvlfill_solid(schar filling, schar lit) { int x, y; for (x = 2; x <= x_maze_max; x++) @@ -632,9 +607,7 @@ schar lit; * Make walls of the area (x1, y1, x2, y2) non diggable/non passwall-able */ STATIC_OVL 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; @@ -707,9 +680,7 @@ remove_boundary_syms() } 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)) add_door(x, y, droom); @@ -803,10 +774,7 @@ rndtrap() * created underwater, or eels on dry land. */ STATIC_OVL 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; @@ -873,9 +841,7 @@ struct mkroom *croom; } STATIC_OVL 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; @@ -903,9 +869,7 @@ register int humidity; } unpacked_coord -get_unpacked_coord(loc, defhumidity) -long loc; -int defhumidity; +get_unpacked_coord(long loc, int defhumidity) { static unpacked_coord c; @@ -925,11 +889,7 @@ int defhumidity; } STATIC_OVL 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 crd) { unpacked_coord c; @@ -948,9 +908,7 @@ long crd; */ STATIC_OVL 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; @@ -975,10 +933,7 @@ struct mkroom *croom; * negative values for x or y means RANDOM! */ STATIC_OVL 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, packed_coord pos) { schar try_x, try_y; register int trycnt = 0; @@ -997,9 +952,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; @@ -1060,11 +1013,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; @@ -1232,11 +1181,7 @@ xchar rtype, rlit; * x & y are relative to the parent room. */ STATIC_OVL 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; @@ -1279,9 +1224,7 @@ xchar rtype, rlit; * It's placed on a wall (north, south, east or west). */ STATIC_OVL 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; @@ -1385,9 +1328,8 @@ struct mkroom *broom; * 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; @@ -1433,9 +1375,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 -create_trap(t, croom) -trap *t; -struct mkroom *croom; +create_trap(trap *t, struct mkroom *croom) { schar x, y; coord tm; @@ -1462,8 +1402,7 @@ struct mkroom *croom; * Create a monster in a room. */ STATIC_OVL int -noncoalignment(alignment) -aligntyp alignment; +noncoalignment(aligntyp alignment) { int k; @@ -1475,8 +1414,7 @@ aligntyp alignment; /* attempt to screen out locations where a mimic-as-boulder shouldn't occur */ STATIC_OVL boolean -m_bad_boulder_spot(x, y) -int x, y; +m_bad_boulder_spot(int x, int y) { struct rm *lev; @@ -1496,9 +1434,7 @@ int x, y; } STATIC_OVL void -create_monster(m, croom) -monster *m; -struct mkroom *croom; +create_monster(monster *m, struct mkroom *croom) { struct monst *mtmp; schar x, y; @@ -1737,9 +1673,7 @@ struct mkroom *croom; * Create an object in a room. */ STATIC_OVL void -create_object(o, croom) -object *o; -struct mkroom *croom; +create_object(object *o, struct mkroom *croom) { struct obj *otmp; schar x, y; @@ -1964,9 +1898,7 @@ struct mkroom *croom; * Create an altar in a room. */ STATIC_OVL void -create_altar(a, croom) -altar *a; -struct mkroom *croom; +create_altar(altar *a, struct mkroom *croom) { schar sproom, x, y; aligntyp amask; @@ -2022,9 +1954,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; @@ -2050,11 +1980,7 @@ struct mkroom *croom; * Search for a door in a room on a specified wall. */ STATIC_OVL 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; @@ -2106,10 +2032,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; @@ -2265,8 +2188,7 @@ fix_stair_rooms() * (from a distance). */ STATIC_OVL void -create_corridor(c) -corridor *c; +create_corridor(corridor *c) { coord org, dest; @@ -2320,9 +2242,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; @@ -2382,9 +2302,7 @@ boolean prefilled; } struct mkroom * -build_room(r, mkr) -room *r; -struct mkroom *mkr; +build_room(room *r, struct mkroom *mkr) { boolean okroom; struct mkroom *aroom; @@ -2416,8 +2334,7 @@ struct mkroom *mkr; * set lighting in a region that will not become a room. */ STATIC_OVL void -light_region(tmpregion) -region *tmpregion; +light_region(region *tmpregion) { register boolean litstate = tmpregion->rlit ? 1 : 0; register int hiy = tmpregion->y2; @@ -2444,8 +2361,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; @@ -2476,9 +2392,7 @@ int x1, y1, x2, y2; * the maze outside every part of the special level. */ STATIC_OVL 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 @@ -2559,9 +2473,7 @@ fill_empty_maze() * special level loader */ STATIC_OVL 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; @@ -2631,8 +2543,7 @@ sp_lev *lvl; /* Frees the memory allocated for special level creation structs */ STATIC_OVL boolean -sp_level_free(lvl) -sp_lev *lvl; +sp_level_free(sp_lev *lvl) { static const char nhFunc[] = "sp_level_free"; long n_opcode = 0; @@ -2654,8 +2565,7 @@ sp_lev *lvl; } void -splev_initlev(linit) -lev_init *linit; +splev_initlev(lev_init *linit) { switch (linit->init_style) { default: @@ -2686,8 +2596,7 @@ lev_init *linit; } struct sp_frame * -frame_new(execptr) -long execptr; +frame_new(long execptr) { struct sp_frame *frame = (struct sp_frame *) alloc(sizeof(struct sp_frame)); @@ -2701,8 +2610,7 @@ long execptr; } void -frame_del(frame) -struct sp_frame *frame; +frame_del(struct sp_frame *frame) { if (!frame) return; @@ -2718,8 +2626,7 @@ struct sp_frame *frame; } 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); @@ -2728,8 +2635,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; @@ -2741,15 +2647,13 @@ struct sp_coder *coder; } long -sp_code_jmpaddr(curpos, jmpaddr) -long curpos, jmpaddr; +sp_code_jmpaddr(long curpos, long jmpaddr) { return (curpos + jmpaddr); } void -spo_call(coder) -struct sp_coder *coder; +spo_call(struct sp_coder *coder) { static const char nhFunc[] = "spo_call"; struct opvar *addr; @@ -2778,8 +2682,7 @@ struct sp_coder *coder; } void -spo_return(coder) -struct sp_coder *coder; +spo_return(struct sp_coder *coder) { static const char nhFunc[] = "spo_return"; struct opvar *params; @@ -2809,8 +2712,7 @@ struct sp_coder *coder; /*ARGUSED*/ 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); @@ -2819,8 +2721,7 @@ struct sp_coder *coder UNUSED; /*ARGUSED*/ void -spo_pop_container(coder) -struct sp_coder *coder UNUSED; +spo_pop_container(struct sp_coder *coder UNUSED) { if (container_idx > 0) { container_idx--; @@ -2829,8 +2730,7 @@ struct sp_coder *coder UNUSED; } void -spo_message(coder) -struct sp_coder *coder; +spo_message(struct sp_coder *coder) { static const char nhFunc[] = "spo_message"; struct opvar *op; @@ -2860,8 +2760,7 @@ struct sp_coder *coder; } void -spo_monster(coder) -struct sp_coder *coder; +spo_monster(struct sp_coder *coder) { static const char nhFunc[] = "spo_monster"; int nparams = 0; @@ -3004,8 +2903,7 @@ struct sp_coder *coder; } void -spo_object(coder) -struct sp_coder *coder; +spo_object(struct sp_coder *coder) { static const char nhFunc[] = "spo_object"; int nparams = 0; @@ -3154,8 +3052,7 @@ struct sp_coder *coder; } void -spo_level_flags(coder) -struct sp_coder *coder; +spo_level_flags(struct sp_coder *coder) { static const char nhFunc[] = "spo_level_flags"; struct opvar *flagdata; @@ -3196,8 +3093,7 @@ struct sp_coder *coder; } void -spo_initlevel(coder) -struct sp_coder *coder; +spo_initlevel(struct sp_coder *coder) { static const char nhFunc[] = "spo_initlevel"; lev_init init_lev; @@ -3235,8 +3131,7 @@ struct sp_coder *coder; } void -spo_engraving(coder) -struct sp_coder *coder; +spo_engraving(struct sp_coder *coder) { static const char nhFunc[] = "spo_engraving"; struct opvar *etyp, *txt, *ecoord; @@ -3254,8 +3149,7 @@ struct sp_coder *coder; } void -spo_mineralize(coder) -struct sp_coder *coder; +spo_mineralize(struct sp_coder *coder) { static const char nhFunc[] = "spo_mineralize"; struct opvar *kelp_pool, *kelp_moat, *gold_prob, *gem_prob; @@ -3274,8 +3168,7 @@ struct sp_coder *coder; } void -spo_room(coder) -struct sp_coder *coder; +spo_room(struct sp_coder *coder) { static const char nhFunc[] = "spo_room"; @@ -3332,8 +3225,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--; @@ -3356,8 +3248,7 @@ struct sp_coder *coder; } void -spo_stair(coder) -struct sp_coder *coder; +spo_stair(struct sp_coder *coder) { static const char nhFunc[] = "spo_stair"; xchar x, y; @@ -3378,8 +3269,7 @@ struct sp_coder *coder; } void -spo_ladder(coder) -struct sp_coder *coder; +spo_ladder(struct sp_coder *coder) { static const char nhFunc[] = "spo_ladder"; xchar x, y; @@ -3406,8 +3296,7 @@ struct sp_coder *coder; } void -spo_grave(coder) -struct sp_coder *coder; +spo_grave(struct sp_coder *coder) { static const char nhFunc[] = "spo_grave"; struct opvar *gcoord, *typ, *txt; @@ -3439,8 +3328,7 @@ struct sp_coder *coder; } void -spo_altar(coder) -struct sp_coder *coder; +spo_altar(struct sp_coder *coder) { static const char nhFunc[] = "spo_altar"; struct opvar *al, *shrine, *acoord; @@ -3461,8 +3349,7 @@ struct sp_coder *coder; } void -spo_trap(coder) -struct sp_coder *coder; +spo_trap(struct sp_coder *coder) { static const char nhFunc[] = "spo_trap"; struct opvar *type; @@ -3481,8 +3368,7 @@ struct sp_coder *coder; } void -spo_gold(coder) -struct sp_coder *coder; +spo_gold(struct sp_coder *coder) { static const char nhFunc[] = "spo_gold"; struct opvar *gcoord, *amt; @@ -3501,8 +3387,7 @@ struct sp_coder *coder; } void -spo_corridor(coder) -struct sp_coder *coder; +spo_corridor(struct sp_coder *coder) { static const char nhFunc[] = "spo_corridor"; struct opvar *deswall, *desdoor, *desroom, *srcwall, *srcdoor, *srcroom; @@ -3530,8 +3415,7 @@ struct sp_coder *coder; } struct opvar * -selection_opvar(nbuf) -char *nbuf; +selection_opvar(char *nbuf) { struct opvar *ov; char buf[(COLNO * ROWNO) + 1]; @@ -3548,9 +3432,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; @@ -3561,10 +3443,7 @@ struct opvar *ov; } void -selection_setpoint(x, y, ov, c) -int x, y; -struct opvar *ov; -xchar c; +selection_setpoint(int x, int y, struct opvar *ov, xchar c) { if (!ov || ov->spovartyp != SPOVAR_SEL) return; @@ -3575,8 +3454,7 @@ xchar c; } struct opvar * -selection_not(s) -struct opvar *s; +selection_not(struct opvar *s) { struct opvar *ov; int x, y; @@ -3594,9 +3472,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; @@ -3626,9 +3502,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; @@ -3661,9 +3535,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; @@ -3676,10 +3548,7 @@ int percent; } STATIC_OVL 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; @@ -3709,9 +3578,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]; @@ -3760,26 +3627,23 @@ int dir; selection_setpoint(x, y, ov, 1); } -STATIC_VAR int FDECL((*selection_flood_check_func), (int, int)); +STATIC_VAR int (*selection_flood_check_func)(int, int); STATIC_VAR schar floodfillchk_match_under_typ; STATIC_OVL void -set_selection_floodfillchk(f) -int FDECL((*f), (int, int)); +set_selection_floodfillchk(int (*f)(int, int)) { selection_flood_check_func = f; } STATIC_OVL 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_OVL 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 @@ -3787,10 +3651,7 @@ int x, y; } STATIC_OVL 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) { static const char nhFunc[] = "selection_floodfill"; struct opvar *tmp = selection_opvar((char *) 0); @@ -3846,9 +3707,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; long a2 = (long) a * a, b2 = (long) b * b; @@ -3930,8 +3789,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 x1, long y1, long x2, long y2, long x3, long y3) { long px = x2 - x1; long py = y2 - y1; @@ -3958,9 +3816,8 @@ 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 x, long y, long x2, + long y2, long gtyp, long mind, long maxd, long limit) { long dx, dy, dofs; @@ -4009,9 +3866,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 d0, dx, dy, ai, bi, xi, yi; @@ -4063,9 +3918,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; @@ -4105,10 +3958,7 @@ struct opvar *ov; } void -selection_iterate(ov, func, arg) -struct opvar *ov; -select_iter_func func; -genericptr_t arg; +selection_iterate(struct opvar *ov, select_iter_func func, genericptr_t arg) { int x, y; @@ -4120,9 +3970,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) { terrain terr; @@ -4138,9 +3986,7 @@ 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; @@ -4148,9 +3994,7 @@ genericptr_t 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; @@ -4168,8 +4012,7 @@ genericptr_t arg; } void -spo_door(coder) -struct sp_coder *coder; +spo_door(struct sp_coder *coder) { static const char nhFunc[] = "spo_door"; struct opvar *msk, *sel; @@ -4187,8 +4030,7 @@ struct sp_coder *coder; } void -spo_feature(coder) -struct sp_coder *coder; +spo_feature(struct sp_coder *coder) { static const char nhFunc[] = "spo_feature"; struct opvar *sel; @@ -4216,8 +4058,7 @@ struct sp_coder *coder; } void -spo_terrain(coder) -struct sp_coder *coder; +spo_terrain(struct sp_coder *coder) { static const char nhFunc[] = "spo_terrain"; terrain tmpterrain; @@ -4235,8 +4076,7 @@ struct sp_coder *coder; } void -spo_replace_terrain(coder) -struct sp_coder *coder; +spo_replace_terrain(struct sp_coder *coder) { static const char nhFunc[] = "spo_replace_terrain"; replaceterrain rt; @@ -4265,9 +4105,7 @@ struct sp_coder *coder; } STATIC_OVL 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) { static const char nhFunc[] = "generate_way_out_method"; const int escapeitems[] = { PICK_AXE, @@ -4383,8 +4221,7 @@ ensure_way_out() } void -spo_levregion(coder) -struct sp_coder *coder; +spo_levregion(struct sp_coder *coder) { static const char nhFunc[] = "spot_levregion"; struct opvar *rname, *padding, *rtype, *del_islev, *dy2, *dx2, *dy1, *dx1, @@ -4466,8 +4303,7 @@ struct sp_coder *coder; } void -spo_region(coder) -struct sp_coder *coder; +spo_region(struct sp_coder *coder) { static const char nhFunc[] = "spo_region"; struct opvar *rtype, *rlit, *rflags, *area; @@ -4566,8 +4402,7 @@ struct sp_coder *coder; } void -spo_drawbridge(coder) -struct sp_coder *coder; +spo_drawbridge(struct sp_coder *coder) { static const char nhFunc[] = "spo_drawbridge"; xchar x, y; @@ -4587,8 +4422,7 @@ struct sp_coder *coder; } void -spo_mazewalk(coder) -struct sp_coder *coder; +spo_mazewalk(struct sp_coder *coder) { static const char nhFunc[] = "spo_mazewalk"; xchar x, y; @@ -4666,8 +4500,7 @@ struct sp_coder *coder; } void -spo_wall_property(coder) -struct sp_coder *coder; +spo_wall_property(struct sp_coder *coder) { static const char nhFunc[] = "spo_wall_property"; struct opvar *r; @@ -4693,8 +4526,7 @@ struct sp_coder *coder; } void -spo_room_door(coder) -struct sp_coder *coder; +spo_room_door(struct sp_coder *coder) { static const char nhFunc[] = "spo_room_door"; struct opvar *wall, *secret, *mask, *pos; @@ -4719,16 +4551,13 @@ struct sp_coder *coder; /*ARGSUSED*/ void -sel_set_wallify(x, y, arg) -int x, y; -genericptr_t arg UNUSED; +sel_set_wallify(int x, int y, genericptr_t arg UNUSED) { wallify_map(x, y, x, y); } void -spo_wallify(coder) -struct sp_coder *coder; +spo_wallify(struct sp_coder *coder) { static const char nhFunc[] = "spo_wallify"; struct opvar *typ, *r; @@ -4760,8 +4589,7 @@ struct sp_coder *coder; } void -spo_map(coder) -struct sp_coder *coder; +spo_map(struct sp_coder *coder) { static const char nhFunc[] = "spo_map"; mazepart tmpmazepart; @@ -4917,9 +4745,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) { static const char nhFunc[] = "spo_jmp"; struct opvar *tmpa; @@ -4934,9 +4760,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) { static const char nhFunc[] = "spo_conditional_jump"; struct opvar *oa, *oc; @@ -4982,8 +4806,7 @@ sp_lev *lvl; } void -spo_var_init(coder) -struct sp_coder *coder; +spo_var_init(struct sp_coder *coder) { static const char nhFunc[] = "spo_var_init"; struct opvar *vname; @@ -5094,8 +4917,7 @@ struct sp_coder *coder; #if 0 STATIC_OVL long -opvar_array_length(coder) -struct sp_coder *coder; +opvar_array_length(struct sp_coder *coder) { static const char nhFunc[] = "opvar_array_length"; struct opvar *vname; @@ -5131,8 +4953,7 @@ struct sp_coder *coder; #endif /*0*/ void -spo_shuffle_array(coder) -struct sp_coder *coder; +spo_shuffle_array(struct sp_coder *coder) { static const char nhFunc[] = "spo_shuffle_array"; struct opvar *vname; @@ -5163,8 +4984,7 @@ struct sp_coder *coder; * Does not free the allocated memory. */ STATIC_OVL boolean -sp_level_coder(lvl) -sp_lev *lvl; +sp_level_coder(sp_lev *lvl) { static const char nhFunc[] = "sp_level_coder"; unsigned long exec_opcodes = 0; @@ -5884,8 +5704,7 @@ sp_lev *lvl; * General loader */ 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 71068c7a6c..3eb4fa4ac4 100644 --- a/src/spell.c +++ b/src/spell.c @@ -25,24 +25,24 @@ #define spellet(spell) \ ((char) ((spell < 26) ? ('a' + spell) : ('A' + spell - 26))) -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 NDECL(rejectcasting); -STATIC_DCL boolean FDECL(getspell, (int *)); -STATIC_PTR int FDECL(CFDECLSPEC spell_cmp, (const genericptr, - const genericptr)); -STATIC_DCL void NDECL(sortspells); -STATIC_DCL boolean NDECL(spellsortmenu); -STATIC_DCL boolean FDECL(dospellmenu, (const char *, int, int *)); -STATIC_DCL int FDECL(percent_success, (int)); -STATIC_DCL char *FDECL(spellretention, (int, char *)); -STATIC_DCL int NDECL(throwspell); -STATIC_DCL void NDECL(cast_protection); -STATIC_DCL void FDECL(spell_backfire, (int)); -STATIC_DCL const char *FDECL(spelltypemnemonic, (int)); +STATIC_DCL int spell_let_to_idx(char); +STATIC_DCL boolean cursed_book(struct obj * bp); +STATIC_DCL boolean confused_book(struct obj *); +STATIC_DCL void deadbook(struct obj *); +STATIC_PTR int learn(void); +STATIC_DCL boolean rejectcasting(void); +STATIC_DCL boolean getspell(int *); +STATIC_PTR int CFDECLSPEC spell_cmp(const genericptr, + const genericptr); +STATIC_DCL void sortspells(void); +STATIC_DCL boolean spellsortmenu(void); +STATIC_DCL boolean dospellmenu(const char *, int, int *); +STATIC_DCL int percent_success(int); +STATIC_DCL char *spellretention(int, char *); +STATIC_DCL int throwspell(void); +STATIC_DCL void cast_protection(void); +STATIC_DCL void spell_backfire(int); +STATIC_DCL const char *spelltypemnemonic(int); /* The roles[] table lists the role-specific values for tuning * percent_success(). @@ -101,8 +101,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_OVL int -spell_let_to_idx(ilet) -char ilet; +spell_let_to_idx(char ilet) { int indx; @@ -117,8 +116,7 @@ char ilet; /* TRUE: book should be destroyed by caller */ STATIC_OVL boolean -cursed_book(bp) -struct obj *bp; +cursed_book(struct obj *bp) { int lev = objects[bp->otyp].oc_level; int dmg = 0; @@ -175,8 +173,7 @@ struct obj *bp; /* study while confused: returns TRUE if the book is destroyed */ STATIC_OVL boolean -confused_book(spellbook) -struct obj *spellbook; +confused_book(struct obj *spellbook) { boolean gone = FALSE; @@ -200,8 +197,7 @@ struct obj *spellbook; /* special effects for The Book of the Dead */ STATIC_OVL void -deadbook(book2) -struct obj *book2; +deadbook(struct obj *book2) { struct monst *mtmp, *mtmp2; coord mm; @@ -422,8 +418,7 @@ learn(VOID_ARGS) } int -study_book(spellbook) -register struct obj *spellbook; +study_book(register struct obj *spellbook) { int booktype = spellbook->otyp; boolean confused = (Confusion != 0); @@ -580,8 +575,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 == context.spbook.book) { context.spbook.book = (struct obj *) 0; @@ -593,8 +587,7 @@ 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 == context.spbook.book) { context.spbook.book = new_obj; @@ -648,8 +641,7 @@ rejectcasting() * parameter. Otherwise return FALSE. */ STATIC_OVL boolean -getspell(spell_no) -int *spell_no; +getspell(int *spell_no) { int nspells, idx; char ilet, lets[BUFSZ], qbuf[QBUFSZ]; @@ -710,8 +702,7 @@ docast() } STATIC_OVL const char * -spelltypemnemonic(skill) -int skill; +spelltypemnemonic(int skill) { switch (skill) { case P_ATTACK_SPELL: @@ -735,8 +726,7 @@ int skill; } int -spell_skilltype(booktype) -int booktype; +spell_skilltype(int booktype) { return objects[booktype].oc_skill; } @@ -823,8 +813,7 @@ cast_protection() /* attempting to cast a forgotten spell will cause disorientation */ STATIC_OVL void -spell_backfire(spell) -int spell; +spell_backfire(int spell) { long duration = (long) ((spellev(spell) + 1) * 3), /* 6..24 */ old_stun = (HStun & TIMEOUT), old_conf = (HConfusion & TIMEOUT); @@ -863,9 +852,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; @@ -1313,9 +1300,7 @@ static int *spl_orderindx = 0; /* array of spl_book[] indices */ /* qsort callback routine */ STATIC_PTR int CFDECLSPEC -spell_cmp(vptr1, vptr2) -const genericptr vptr1; -const genericptr vptr2; +spell_cmp(const genericptr vptr1, const genericptr vptr2) { /* * gather up all of the possible parameters except spell name @@ -1499,10 +1484,9 @@ dovspell() } STATIC_OVL 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, /* SPELLMENU_CAST, SPELLMENU_VIEW, or spl_book[] index */ + int *spell_no) { winid tmpwin; int i, n, how, splnum; @@ -1581,8 +1565,7 @@ int *spell_no; } STATIC_OVL 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. @@ -1696,9 +1679,7 @@ int spell; } STATIC_OVL char * -spellretention(idx, outbuf) -int idx; -char *outbuf; +spellretention(int idx, char *outbuf) { long turnsleft, percent, accuracy; int skill; @@ -1743,8 +1724,7 @@ char *outbuf; /* Learn a spell during creation of the initial inventory */ void -initialspell(obj) -struct obj *obj; +initialspell(struct obj *obj) { int i, otyp = obj->otyp; diff --git a/src/steal.c b/src/steal.c index 4b5378d960..098dfad6da 100644 --- a/src/steal.c +++ b/src/steal.c @@ -4,13 +4,12 @@ #include "hack.h" -STATIC_PTR int NDECL(stealarm); +STATIC_PTR int stealarm(void); -STATIC_DCL const char *FDECL(equipname, (struct obj *)); +STATIC_DCL const char *equipname(struct obj *); STATIC_OVL const char * -equipname(otmp) -register struct obj *otmp; +equipname(register struct obj *otmp) { return ((otmp == uarmu) ? "shirt" @@ -29,8 +28,7 @@ register struct obj *otmp; /* proportional subset of gold; return value actually fits in an int */ long -somegold(lmoney) -long lmoney; +somegold(long lmoney) { #ifdef LINT /* long conv. ok */ int igold = 0; @@ -65,8 +63,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; @@ -77,8 +74,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; @@ -180,9 +176,8 @@ stealarm(VOID_ARGS) /* 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(); @@ -241,9 +236,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, named = 0, retrycnt = 0; @@ -469,9 +462,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; @@ -507,8 +498,7 @@ register struct obj *otmp; } void -stealamulet(mtmp) -struct monst *mtmp; +stealamulet(struct monst *mtmp) { struct obj *otmp = (struct obj *) 0; int real = 0, fake = 0; @@ -558,10 +548,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, /* percent chance for ordinary item */ + int achance) /* percent chance for artifact */ { if (obj == uball || obj == uchain || obj->oclass == ROCK_CLASS || obj_resists(obj, 100 - ochance, 100 - achance) @@ -601,10 +591,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; @@ -645,8 +632,7 @@ boolean verbosely; even leaving the game entirely; when that happens, prevent them from taking the Amulet or invocation tools with them */ void -mdrop_special_objs(mon) -struct monst *mon; +mdrop_special_objs(struct monst *mon) { struct obj *obj, *otmp; @@ -663,10 +649,9 @@ 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 1129a27cc4..99764ae27a 100644 --- a/src/steed.c +++ b/src/steed.c @@ -9,8 +9,8 @@ static NEARDATA const char steeds[] = { S_QUADRUPED, S_UNICORN, S_ANGEL, S_CENTAUR, S_DRAGON, S_JABBERWOCK, '\0' }; -STATIC_DCL boolean FDECL(landing_spot, (coord *, int, int)); -STATIC_DCL void FDECL(maybewakesteed, (struct monst *)); +STATIC_DCL boolean landing_spot(coord *, int, int); +STATIC_DCL void maybewakesteed(struct monst *); /* caller has decided that hero can't reach something while mounted */ void @@ -23,8 +23,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; @@ -150,8 +148,7 @@ struct obj *otmp; /* 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) @@ -177,9 +174,8 @@ 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]; @@ -408,10 +404,9 @@ kick_steed() * Adapted from mail daemon code. */ STATIC_OVL boolean -landing_spot(spot, reason, forceit) -coord *spot; /* landing position (we fill it in) */ -int reason; -int forceit; +landing_spot(coord *spot, /* landing position (we fill it in) */ + int reason, + int forceit) { int i = 0, x, y, distance, min_distance = -1; boolean found = FALSE; @@ -453,8 +448,7 @@ 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; @@ -624,8 +618,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_OVL void -maybewakesteed(steed) -struct monst *steed; +maybewakesteed(struct monst *steed) { int frozen = (int) steed->mfrozen; boolean wasimmobile = steed->msleeping || !steed->mcanmove; @@ -651,8 +644,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; @@ -672,9 +664,7 @@ boolean checkfeeding; } void -place_monster(mon, x, y) -struct monst *mon; -int x, y; +place_monster(struct monst *mon, int x, int y) { if (mon == u.usteed /* special case is for convoluted vault guard handling */ diff --git a/src/sys.c b/src/sys.c index 96c080ea45..a3d6ebc7c1 100644 --- a/src/sys.c +++ b/src/sys.c @@ -111,8 +111,7 @@ extern struct attack sa_yes[NATTK]; extern struct attack sa_no[NATTK]; void -sysopt_seduce_set(val) -int val; +sysopt_seduce_set(int val) { struct attack *setval = val ? sa_yes : sa_no; int x; diff --git a/src/teleport.c b/src/teleport.c index 5faf0135cd..4d118e16e9 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -4,11 +4,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_DCL boolean tele_jump_ok(int, int, int, int); +STATIC_DCL boolean teleok(int, int, boolean); +STATIC_DCL void vault_tele(void); +STATIC_DCL boolean rloc_pos_ok(int, int, struct monst *); +STATIC_DCL void mvault_tele(struct monst *); /* non-null when teleporting via having read this scroll */ STATIC_VAR struct obj *telescroll = 0; @@ -21,10 +21,7 @@ STATIC_VAR struct obj *telescroll = 0; * 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 gpflags) { struct permonst *mdat = (struct permonst *) 0; boolean ignorewater = ((gpflags & MM_IGNOREWATER) != 0); @@ -102,20 +99,13 @@ 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, 0); } boolean -enexto_core(cc, xx, yy, mdat, entflags) -coord *cc; -register xchar xx, yy; -struct permonst *mdat; -unsigned entflags; +enexto_core(coord *cc, register xchar xx, register xchar yy, struct permonst *mdat, unsigned entflags) { #define MAX_GOOD 15 coord good[MAX_GOOD], *good_ptr; @@ -193,8 +183,7 @@ unsigned entflags; * only for explicitly chosen destinations.) */ STATIC_OVL 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 (dndest.nlx > 0) { /* if inside a restricted region, can't teleport outside */ @@ -226,9 +215,7 @@ int x1, y1, x2, y2; } STATIC_OVL boolean -teleok(x, y, trapok) -register int x, y; -boolean trapok; +teleok(register int x, register int y, boolean trapok) { if (!trapok && t_at(x, y)) return FALSE; @@ -242,9 +229,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) { boolean ball_active, ball_still_in_range; @@ -349,8 +334,7 @@ boolean allow_drag; } boolean -safe_teleds(allow_drag) -boolean allow_drag; +safe_teleds(boolean allow_drag) { register int nux, nuy, tcnt = 0; @@ -380,9 +364,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; @@ -420,8 +402,7 @@ tele() outcome sometimes depends upon destination and discovery needs to be performed before arrival, in case we land on another teleport scroll */ boolean -scrolltele(scroll) -struct obj *scroll; +scrolltele(struct obj *scroll) { coord cc; boolean result = FALSE; /* don't learn scroll */ @@ -816,8 +797,7 @@ level_tele() } void -domagicportal(ttmp) -register struct trap *ttmp; +domagicportal(register struct trap *ttmp) { struct d_level target_level; @@ -852,8 +832,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) @@ -870,8 +849,7 @@ struct trap *trap; } void -level_tele_trap(trap) -struct trap *trap; +level_tele_trap(struct trap *trap) { You("%s onto a level teleport trap!", Levitation ? (const char *) "float" @@ -894,9 +872,8 @@ struct trap *trap; /* check whether monster can arrive at location via Tport (or fall) */ STATIC_OVL 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, /* coordinates of candidate location */ + struct monst *mtmp) { register int xx, yy; @@ -961,9 +938,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); @@ -1008,9 +983,8 @@ 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, /* mx==0 implies migrating monster arrival */ + boolean suppress_impossible) { register int x, y, trycount; @@ -1059,8 +1033,7 @@ boolean suppress_impossible; } STATIC_OVL void -mvault_tele(mtmp) -struct monst *mtmp; +mvault_tele(struct monst *mtmp) { register struct mkroom *croom = search_special(VAULT); coord c; @@ -1073,8 +1046,7 @@ struct monst *mtmp; } boolean -tele_restrict(mon) -struct monst *mon; +tele_restrict(struct monst *mon) { if (level.flags.noteleport) { if (canseemon(mon)) @@ -1086,10 +1058,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; @@ -1120,11 +1089,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->ttyp; struct permonst *mptr = mtmp->data; @@ -1188,8 +1153,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; @@ -1320,9 +1284,7 @@ random_teleport_level() /* you teleport a monster (via wand, spell, or poly'd q.mechanic attack); return 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 e50ae39b22..f67746e680 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -5,14 +5,14 @@ #include "hack.h" #include "lev.h" /* for checking save modes */ -STATIC_DCL void NDECL(stoned_dialogue); -STATIC_DCL void NDECL(vomiting_dialogue); -STATIC_DCL void NDECL(choke_dialogue); -STATIC_DCL void NDECL(slime_dialogue); -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_DCL void stoned_dialogue(void); +STATIC_DCL void vomiting_dialogue(void); +STATIC_DCL void choke_dialogue(void); +STATIC_DCL void slime_dialogue(void); +STATIC_DCL void slip_or_trip(void); +STATIC_DCL void see_lamp_flicker(struct obj *, const char *); +STATIC_DCL void lantern_message(struct obj *); +STATIC_DCL void cleanup_burn(ANY_P *, long); /* He is being petrified - dialogue by inmet!tower */ static NEARDATA const char *const stoned_texts[] = { @@ -431,9 +431,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); @@ -455,9 +453,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 when) { int i; @@ -485,8 +481,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)); @@ -494,9 +489,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 timeout) { struct obj *egg; struct monst *mon, *mon2; @@ -654,8 +647,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); @@ -666,8 +658,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; @@ -776,9 +767,7 @@ slip_or_trip() /* Print a lamp flicker message with tailer. */ STATIC_OVL 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: @@ -793,8 +782,7 @@ const char *tailer; /* Print a dimming message for brass lanterns. */ STATIC_OVL void -lantern_message(obj) -struct obj *obj; +lantern_message(struct obj *obj) { /* from adventure */ switch (obj->where) { @@ -817,9 +805,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 timeout) { struct obj *obj = arg->a_obj; boolean canseeit, many, menorah, need_newsym; @@ -1115,9 +1101,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; @@ -1207,9 +1191,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) { impossible("end_burn: obj %s not lit", xname(obj)); @@ -1233,9 +1215,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 expire_time) { struct obj *obj = arg->a_obj; if (!obj->lamplit) { @@ -1357,15 +1337,14 @@ do_storms() * Check whether object has a timer of type timer_type. */ -STATIC_DCL const char *FDECL(kind_name, (SHORT_P)); -STATIC_DCL void FDECL(print_queue, (winid, timer_element *)); -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_DCL const char *kind_name(short); +STATIC_DCL void print_queue(winid, timer_element *); +STATIC_DCL void insert_timer(timer_element *); +STATIC_DCL timer_element *remove_timer(timer_element **, short, ANY_P *); +STATIC_DCL void write_timer(int, timer_element *); +STATIC_DCL boolean mon_is_local(struct monst *); +STATIC_DCL boolean timer_is_local(timer_element *); +STATIC_DCL int maybe_write_timer(int, int, boolean); /* ordered timer list */ static timer_element *timer_base; /* "active" */ @@ -1403,8 +1382,7 @@ static const ttable timeout_funcs[NUM_TIME_FUNCS] = { #undef TTAB STATIC_OVL const char * -kind_name(kind) -short kind; +kind_name(short kind) { switch (kind) { case TIMER_LEVEL: @@ -1420,9 +1398,7 @@ short kind; } STATIC_OVL void -print_queue(win, base) -winid win; -timer_element *base; +print_queue(winid win, timer_element *base) { timer_element *curr; char buf[BUFSZ]; @@ -1515,11 +1491,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 when, short kind, short func_index, anything *arg) { timer_element *gnu; @@ -1548,9 +1520,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 func_index, anything *arg) { timer_element *doomed; long timeout; @@ -1573,9 +1543,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 type, anything *arg) { timer_element *curr; @@ -1590,8 +1558,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; @@ -1611,8 +1578,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; @@ -1630,8 +1596,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; @@ -1657,9 +1622,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 timer_type) { long timeout = peek_timer(timer_type, obj_to_any(object)); @@ -1671,9 +1634,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 func_index) { timer_element *curr, *prev, *next_timer = 0; long where = (((long) x << 16) | ((long) y)); @@ -1701,9 +1662,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 func_index) { timer_element *curr; long where = (((long) x << 16) | ((long) y)); @@ -1717,9 +1676,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 func_index) { long expires = spot_time_expires(x, y, func_index); return (expires > 0L) ? expires - monstermoves : 0L; @@ -1727,8 +1684,7 @@ short func_index; /* Insert timer into the global queue */ STATIC_OVL void -insert_timer(gnu) -timer_element *gnu; +insert_timer(timer_element *gnu) { timer_element *curr, *prev; @@ -1744,10 +1700,7 @@ timer_element *gnu; } STATIC_OVL timer_element * -remove_timer(base, func_index, arg) -timer_element **base; -short func_index; -anything *arg; +remove_timer(timer_element **base, short func_index, anything *arg) { timer_element *prev, *curr; @@ -1766,9 +1719,7 @@ anything *arg; } STATIC_OVL void -write_timer(fd, timer) -int fd; -timer_element *timer; +write_timer(int fd, timer_element *timer) { anything arg_save; @@ -1821,8 +1772,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: @@ -1845,8 +1795,7 @@ struct obj *obj; * level is saved. */ STATIC_OVL boolean -mon_is_local(mon) -struct monst *mon; +mon_is_local(struct monst *mon) { struct monst *curr; @@ -1865,8 +1814,7 @@ struct monst *mon; * level when the level is saved. */ STATIC_OVL boolean -timer_is_local(timer) -timer_element *timer; +timer_is_local(timer_element *timer) { switch (timer->kind) { case TIMER_LEVEL: @@ -1887,9 +1835,7 @@ timer_element *timer; * be written. If write_it is true, actually write the timer. */ STATIC_OVL 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; @@ -1932,8 +1878,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; @@ -1970,10 +1915,10 @@ 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 adjust) /* how much to adjust timeout */ { int count; timer_element *curr; @@ -1994,8 +1939,7 @@ long adjust; /* how much to adjust timeout */ /* 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 7ea996da3a..6481bd900b 100644 --- a/src/topten.c +++ b/src/topten.c @@ -56,35 +56,32 @@ struct toptenentry { room for separating space or trailing newline plus string terminator */ #define SCANBUFSZ (4 * (ROLESZ + 1) + (NAMSZ + 1) + (DTHSZ + 1) + 1) -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(discardexcess, (FILE *)); -STATIC_DCL void FDECL(readentry, (FILE *, struct toptenentry *)); -STATIC_DCL void FDECL(writeentry, (FILE *, struct toptenentry *)); -STATIC_DCL void FDECL(writexlentry, (FILE *, struct toptenentry *)); -STATIC_DCL long NDECL(encodexlogflags); -STATIC_DCL long NDECL(encodeconduct); -STATIC_DCL long NDECL(encodeachieve); -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_DCL void topten_print(const char *); +STATIC_DCL void topten_print_bold(const char *); +STATIC_DCL xchar observable_depth(d_level *); +STATIC_DCL void outheader(void); +STATIC_DCL void outentry(int, struct toptenentry *, boolean); +STATIC_DCL void discardexcess(FILE *); +STATIC_DCL void readentry(FILE *, struct toptenentry *); +STATIC_DCL void writeentry(FILE *, struct toptenentry *); +STATIC_DCL void writexlentry(FILE *, struct toptenentry *); +STATIC_DCL long encodexlogflags(void); +STATIC_DCL long encodeconduct(void); +STATIC_DCL long encodeachieve(void); +STATIC_DCL void free_ttlist(struct toptenentry *); +STATIC_DCL int classmon(char *, boolean); +STATIC_DCL int score_wanted(boolean, int, struct toptenentry *, int, + const char **, int); #ifdef NO_SCAN_BRACK -STATIC_DCL void FDECL(nsb_mung_line, (char *)); -STATIC_DCL void FDECL(nsb_unmung_line, (char *)); +STATIC_DCL void nsb_mung_line(char *); +STATIC_DCL void nsb_unmung_line(char *); #endif static winid toptenwin = WIN_ERR; /* "killed by",&c ["an"] 'killer.name' */ void -formatkiller(buf, siz, how) -char *buf; -unsigned siz; -int how; +formatkiller(char *buf, unsigned siz, int how) { static NEARDATA const char *const killed_by_prefix[] = { /* DIED, CHOKING, POISONING, STARVING, */ @@ -121,8 +118,7 @@ int how; } STATIC_OVL void -topten_print(x) -const char *x; +topten_print(const char *x) { if (toptenwin == WIN_ERR) raw_print(x); @@ -131,8 +127,7 @@ const char *x; } STATIC_OVL void -topten_print_bold(x) -const char *x; +topten_print_bold(const char *x) { if (toptenwin == WIN_ERR) raw_print_bold(x); @@ -141,8 +136,7 @@ const char *x; } STATIC_OVL xchar -observable_depth(lev) -d_level *lev; +observable_depth(d_level *lev) { #if 0 /* if we ever randomize the order of the elemental planes, we @@ -167,8 +161,7 @@ d_level *lev; /* throw away characters until current record has been entirely consumed */ STATIC_OVL void -discardexcess(rfile) -FILE *rfile; +discardexcess(FILE *rfile) { int c; @@ -178,9 +171,7 @@ FILE *rfile; } STATIC_OVL void -readentry(rfile, tt) -FILE *rfile; -struct toptenentry *tt; +readentry(FILE *rfile, struct toptenentry *tt) { char inbuf[SCANBUFSZ], s1[SCANBUFSZ], s2[SCANBUFSZ], s3[SCANBUFSZ], s4[SCANBUFSZ], s5[SCANBUFSZ], s6[SCANBUFSZ]; @@ -261,9 +252,7 @@ struct toptenentry *tt; } STATIC_OVL void -writeentry(rfile, tt) -FILE *rfile; -struct toptenentry *tt; +writeentry(FILE *rfile, struct toptenentry *tt) { static const char fmt32[] = "%c%c "; /* role,gender */ static const char fmt33[] = "%s %s %s %s "; /* role,race,gndr,algn */ @@ -300,9 +289,7 @@ struct toptenentry *tt; /* as tab is never used in eg. plname or death, no need to mangle those. */ STATIC_OVL void -writexlentry(rfile, tt) -FILE *rfile; -struct toptenentry *tt; +writexlentry(FILE *rfile, struct toptenentry *tt) { #define Fprintf (void) fprintf #define XLOG_SEP '\t' /* xlogfile field separator. */ @@ -426,8 +413,7 @@ encodeachieve() } STATIC_OVL void -free_ttlist(tt) -struct toptenentry *tt; +free_ttlist(struct toptenentry *tt) { struct toptenentry *ttnext; @@ -440,9 +426,7 @@ struct toptenentry *tt; } void -topten(how, when) -int how; -time_t when; +topten(int how, time_t when) { int uid = getuid(); int rank, rank0 = -1, rank1 = 0; @@ -753,10 +737,7 @@ outheader() /* so>0: standout line; so=0: ordinary line */ STATIC_OVL 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]; @@ -916,13 +897,7 @@ boolean so; } STATIC_OVL 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; @@ -960,9 +935,7 @@ int uid; * 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; @@ -1108,9 +1081,7 @@ char **argv; } STATIC_OVL int -classmon(plch, fem) -char *plch; -boolean fem; +classmon(char *plch, boolean fem) { int i; @@ -1137,8 +1108,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; @@ -1185,16 +1155,14 @@ struct obj *otmp; /* follows deals with that; I admit it's ugly. (KL) */ /* Now generally available (KL) */ STATIC_OVL void -nsb_mung_line(p) -char *p; +nsb_mung_line(char *p) { while ((p = index(p, ' ')) != 0) *p = '|'; } STATIC_OVL void -nsb_unmung_line(p) -char *p; +nsb_unmung_line(char *p) { while ((p = index(p, '|')) != 0) *p = ' '; diff --git a/src/track.c b/src/track.c index 0ba143044c..1558a1c0e6 100644 --- a/src/track.c +++ b/src/track.c @@ -30,8 +30,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 b8944eea96..1455790176 100644 --- a/src/trap.c +++ b/src/trap.c @@ -6,36 +6,36 @@ extern const char *const destroy_strings[][3]; /* from zap.c */ -STATIC_DCL void FDECL(dofiretrap, (struct obj *)); -STATIC_DCL void NDECL(domagictrap); -STATIC_DCL boolean FDECL(emergency_disrobe, (boolean *)); -STATIC_DCL int FDECL(untrap_prob, (struct trap *)); -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_DCL int FDECL(try_lift, (struct monst *, struct trap *, int, - BOOLEAN_P)); -STATIC_DCL int FDECL(help_monster_out, (struct monst *, struct trap *)); -STATIC_DCL boolean FDECL(thitm, (int, struct monst *, struct obj *, int, - BOOLEAN_P)); -STATIC_DCL void FDECL(launch_drop_spot, (struct obj *, XCHAR_P, XCHAR_P)); -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_DCL char *FDECL(trapnote, (struct trap *, BOOLEAN_P)); +STATIC_DCL void dofiretrap(struct obj *); +STATIC_DCL void domagictrap(void); +STATIC_DCL boolean emergency_disrobe(boolean *); +STATIC_DCL int untrap_prob(struct trap *); +STATIC_DCL void move_into_trap(struct trap *); +STATIC_DCL int try_disarm(struct trap *, boolean); +STATIC_DCL void reward_untrap(struct trap *, struct monst *); +STATIC_DCL int disarm_holdingtrap(struct trap *); +STATIC_DCL int disarm_landmine(struct trap *); +STATIC_DCL int disarm_squeaky_board(struct trap *); +STATIC_DCL int disarm_shooting_trap(struct trap *, int); +STATIC_DCL int try_lift(struct monst *, struct trap *, int, + boolean); +STATIC_DCL int help_monster_out(struct monst *, struct trap *); +STATIC_DCL boolean thitm(int, struct monst *, struct obj *, int, + boolean); +STATIC_DCL void launch_drop_spot(struct obj *, xchar, xchar); +STATIC_DCL int mkroll_launch(struct trap *, xchar, xchar, + short, long); +STATIC_DCL boolean isclearpath(coord *, int, schar, schar); +STATIC_DCL char *trapnote(struct trap *, boolean); #if 0 -STATIC_DCL void FDECL(join_adjacent_pits, (struct trap *)); +STATIC_DCL void join_adjacent_pits(struct trap *); #endif -STATIC_DCL void FDECL(clear_conjoined_pits, (struct trap *)); -STATIC_DCL int FDECL(steedintrap, (struct trap *, struct obj *)); -STATIC_DCL boolean FDECL(keep_saddle_with_steedcorpse, (unsigned, - struct obj *, - struct obj *)); -STATIC_DCL void NDECL(maybe_finish_sokoban); +STATIC_DCL void clear_conjoined_pits(struct trap *); +STATIC_DCL int steedintrap(struct trap *, struct obj *); +STATIC_DCL boolean keep_saddle_with_steedcorpse(unsigned, + struct obj *, + struct obj *); +STATIC_DCL void maybe_finish_sokoban(void); /* mintrap() should take a flags argument, but for time being we use this */ STATIC_VAR int force_mintrap = 0; @@ -51,8 +51,7 @@ STATIC_VAR const char *const blindgas[6] = { "humid", "odorless", /* called when you're hit by fire (dofiretrap,buzz,zapyourself,explode); returns TRUE if hit on torso */ boolean -burnarmor(victim) -struct monst *victim; +burnarmor(struct monst *victim) { struct obj *item; char buf[BUFSZ]; @@ -135,11 +134,7 @@ struct monst *victim; * Returns an erosion return value (ER_*) */ int -erode_obj(otmp, ostr, type, ef_flags) -register struct obj *otmp; -const char *ostr; -int type; -int ef_flags; +erode_obj(register struct obj *otmp, const char *ostr, int type, int ef_flags) { static NEARDATA const char *const action[] = { "smoulder", "rust", "rot", "corrode" }; @@ -288,10 +283,7 @@ int ef_flags; * wears off. */ boolean -grease_protect(otmp, ostr, victim) -register struct obj *otmp; -const char *ostr; -struct monst *victim; +grease_protect(register 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); @@ -317,8 +309,7 @@ struct monst *victim; } struct trap * -maketrap(x, y, typ) -register int x, y, typ; +maketrap(register int x, register int y, register int typ) { static union vlaunchinfo zero_vl; register struct trap *ttmp; @@ -449,8 +440,7 @@ register int x, y, typ; } void -fall_through(td) -boolean td; /* td == TRUE : trap door or hole */ +fall_through(boolean td) /* td == TRUE : trap door or hole */ { d_level dtmp; char msgbuf[BUFSZ]; @@ -561,11 +551,7 @@ boolean td; /* td == TRUE : trap door or hole */ * 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]; @@ -741,10 +727,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); @@ -771,9 +754,7 @@ boolean shatter; } STATIC_OVL boolean -keep_saddle_with_steedcorpse(steed_mid, objchn, saddle) -unsigned steed_mid; -struct obj *objchn, *saddle; +keep_saddle_with_steedcorpse(unsigned steed_mid, struct obj *objchn, struct obj *saddle) { if (!saddle) return FALSE; @@ -801,9 +782,7 @@ struct obj *objchn, *saddle; } void -dotrap(trap, trflags) -register struct trap *trap; -unsigned trflags; +dotrap(register struct trap *trap, unsigned trflags) { register int ttype = trap->ttyp; register struct obj *otmp; @@ -1465,9 +1444,7 @@ unsigned trflags; } STATIC_OVL char * -trapnote(trap, noprefix) -struct trap *trap; -boolean noprefix; +trapnote(struct trap *trap, boolean noprefix) { static char tnbuf[12]; const char *tn, @@ -1485,9 +1462,7 @@ boolean noprefix; } STATIC_OVL int -steedintrap(trap, otmp) -struct trap *trap; -struct obj *otmp; +steedintrap(struct trap *trap, struct obj *otmp) { struct monst *steed = u.usteed; int tt; @@ -1562,8 +1537,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]; @@ -1607,9 +1581,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; @@ -1647,10 +1619,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 otyp, register int x1, register int y1, register int x2, register int y2, int style) { register struct monst *mtmp; register struct obj *otmp, *otmp2; @@ -1910,8 +1879,7 @@ int style; } void -seetrap(trap) -struct trap *trap; +seetrap(struct trap *trap) { if (!trap->tseen) { trap->tseen = 1; @@ -1921,8 +1889,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); @@ -1931,11 +1898,7 @@ struct trap *trap; } STATIC_OVL 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 otyp, long ocount) { struct obj *otmp; register int tmp; @@ -2001,10 +1964,7 @@ long ocount; } STATIC_OVL 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; @@ -2024,8 +1984,7 @@ schar dx, dy; } int -mintrap(mtmp) -register struct monst *mtmp; +mintrap(register struct monst *mtmp) { register struct trap *trap = t_at(mtmp->mx, mtmp->my); boolean trapkilled = FALSE; @@ -2636,8 +2595,7 @@ register struct monst *mtmp; /* Combine cockatrice checks into single functions to avoid repeating code. */ void -instapetrify(str) -const char *str; +instapetrify(const char *str) { if (Stone_resistance) return; @@ -2651,9 +2609,7 @@ const char *str; } void -minstapetrify(mon, byplayer) -struct monst *mon; -boolean byplayer; +minstapetrify(struct monst *mon, boolean byplayer) { if (resists_ston(mon)) return; @@ -2676,8 +2632,7 @@ boolean byplayer; } void -selftouch(arg) -const char *arg; +selftouch(const char *arg) { char kbuf[BUFSZ]; @@ -2704,10 +2659,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); @@ -2775,8 +2727,7 @@ float_up() } void -fill_pit(x, y) -int x, y; +fill_pit(int x, int y) { struct obj *otmp; struct trap *t; @@ -2790,8 +2741,7 @@ int x, y; /* stop levitating */ int -float_down(hmask, emask) -long hmask, emask; /* might cancel timeout */ +float_down(long hmask, long emask) /* might cancel timeout */ { register struct trap *trap = (struct trap *) 0; d_level current_dungeon_level; @@ -2968,8 +2918,7 @@ climb_pit() } STATIC_OVL 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; @@ -3145,10 +3094,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; @@ -3235,10 +3181,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; @@ -3254,8 +3197,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; @@ -3305,10 +3247,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; @@ -3441,9 +3380,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; @@ -3469,8 +3406,7 @@ boolean here; * crawl out of the current predicament. */ STATIC_OVL boolean -emergency_disrobe(lostsome) -boolean *lostsome; +emergency_disrobe(boolean *lostsome) { int invc = inv_cnt(TRUE); @@ -3668,8 +3604,7 @@ drown() } void -drain_en(n) -int n; +drain_en(int n) { if (!u.uenmax) { /* energy is completely gone */ @@ -3716,8 +3651,7 @@ dountrap() /* Probability of disabling a trap. Helge Hafting */ STATIC_OVL int -untrap_prob(ttmp) -struct trap *ttmp; +untrap_prob(struct trap *ttmp) { int chance = 3; @@ -3747,11 +3681,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); @@ -3778,8 +3708,7 @@ boolean bury_it; /* while attempting to disarm an adjacent trap, we've fallen into it */ STATIC_OVL 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; @@ -3813,9 +3742,7 @@ struct trap *ttmp; * 2: succeeds */ STATIC_OVL 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; @@ -3896,9 +3823,7 @@ boolean force_failure; } STATIC_OVL 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 && !mtmp->msleeping @@ -3918,8 +3843,7 @@ struct monst *mtmp; } STATIC_OVL 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); @@ -3951,8 +3875,7 @@ struct trap *ttmp; } STATIC_OVL int -disarm_landmine(ttmp) /* Helge Hafting */ -struct trap *ttmp; +disarm_landmine(struct trap *ttmp) /* Helge Hafting */ { int fails = try_disarm(ttmp, FALSE); @@ -3969,8 +3892,7 @@ static NEARDATA const char oil[] = { ALL_CLASSES, TOOL_CLASS, POTION_CLASS, /* it may not make much sense to use grease on floor boards, but so what? */ STATIC_OVL int -disarm_squeaky_board(ttmp) -struct trap *ttmp; +disarm_squeaky_board(struct trap *ttmp) { struct obj *obj; boolean bad_tool; @@ -4004,9 +3926,7 @@ struct trap *ttmp; /* removes traps that shoot arrows, darts, etc. */ STATIC_OVL 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); @@ -4020,11 +3940,7 @@ int otyp; /* Is the weight too heavy? * Formula as in near_capacity() & check_capacity() */ STATIC_OVL 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(); @@ -4045,9 +3961,7 @@ boolean stuff; /* Help trapped monster (out of a (spiked) pit) */ STATIC_OVL 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; @@ -4135,8 +4049,7 @@ struct trap *ttmp; } int -untrap(force) -boolean force; +untrap(boolean force) { register struct obj *otmp; register int x, y; @@ -4372,10 +4285,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; */ -{ /* otherwise left with its previous value intact */ +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]; const char *trapdescr, *which; @@ -4431,10 +4343,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; */ -{ /* otherwise left with its previous value intact */ +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; boolean ishero = (mon == &youmonst), result; @@ -4474,11 +4385,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; */ -{ /* otherwise left with its previous value intact */ +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; @@ -4516,10 +4426,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]; @@ -4708,8 +4615,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; @@ -4722,8 +4628,7 @@ register int x, y; } void -deltrap(trap) -register struct trap *trap; +deltrap(register struct trap *trap) { register struct trap *ttmp; @@ -4744,9 +4649,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; @@ -4773,8 +4676,7 @@ boolean u_entering_trap2; } void -clear_conjoined_pits(trap) -struct trap *trap; +clear_conjoined_pits(struct trap *trap) { int diridx, adjidx, x, y; struct trap *t; @@ -4802,8 +4704,7 @@ struct trap *trap; * (currently not called from anywhere) */ STATIC_OVL void -join_adjacent_pits(trap) -struct trap *trap; +join_adjacent_pits(struct trap *trap) { struct trap *t; int diridx, x, y; @@ -4829,8 +4730,7 @@ struct trap *trap; * 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) { if (trap && trap->tseen && (!u.utrap || u.utraptype != TT_PIT) && (trap->ttyp == PIT || trap->ttyp == SPIKED_PIT)) @@ -4841,8 +4741,7 @@ struct trap *trap; /* Destroy a trap that emanates from the floor. */ boolean -delfloortrap(ttmp) -register struct trap *ttmp; +delfloortrap(register struct trap *ttmp) { /* some of these are arbitrary -dlc */ if (ttmp && ((ttmp->ttyp == SQKY_BOARD) || (ttmp->ttyp == BEAR_TRAP) @@ -4868,9 +4767,7 @@ register struct trap *ttmp; /* used for doors (also tins). can be used for anything else that opens. */ void -b_trapped(item, bodypart) -const char *item; -int bodypart; +b_trapped(const char *item, int bodypart) { int lvl = level_difficulty(), dmg = rnd(5 + (lvl < 5 ? lvl : 2 + lvl / 2)); @@ -4887,12 +4784,7 @@ int bodypart; /* Monster is hit by trap. */ /* Note: doesn't work if both obj and d_override are null */ STATIC_OVL 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; diff --git a/src/u_init.c b/src/u_init.c index f0c1e37569..d8a629ba90 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -12,10 +12,10 @@ struct trobj { Bitfield(trbless, 2); }; -STATIC_DCL void FDECL(ini_inv, (struct trobj *)); -STATIC_DCL void FDECL(knows_object, (int)); -STATIC_DCL void FDECL(knows_class, (CHAR_P)); -STATIC_DCL boolean FDECL(restricted_spell_discipline, (int)); +STATIC_DCL void ini_inv(struct trobj *); +STATIC_DCL void knows_object(int); +STATIC_DCL void knows_class(char); +STATIC_DCL boolean restricted_spell_discipline(int); #define UNDEF_TYP 0 #define UNDEF_SPE '\177' @@ -552,8 +552,7 @@ static const struct def_skill Skill_W[] = { }; STATIC_OVL 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" */ @@ -563,8 +562,7 @@ register int obj; * like all gems except the loadstone and luckstone. */ STATIC_OVL void -knows_class(sym) -register char sym; +knows_class(register char sym) { register int ct; for (ct = 1; ct < NUM_OBJECTS; ct++) @@ -908,8 +906,7 @@ u_init() /* skills aren't initialized, so we use the role-specific skill lists */ STATIC_OVL boolean -restricted_spell_discipline(otyp) -int otyp; +restricted_spell_discipline(int otyp) { const struct def_skill *skills; int this_skill = spell_skilltype(otyp); @@ -968,8 +965,7 @@ int otyp; } STATIC_OVL 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 d41f71669c..d355ccedbc 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -4,23 +4,23 @@ #include "hack.h" -STATIC_DCL boolean FDECL(known_hitum, (struct monst *, struct obj *, int *, - int, int, struct attack *)); -STATIC_DCL boolean FDECL(theft_petrifies, (struct obj *)); -STATIC_DCL void FDECL(steal_it, (struct monst *, struct attack *)); -STATIC_DCL boolean FDECL(hitum, (struct monst *, struct attack *)); -STATIC_DCL boolean FDECL(hmon_hitmon, (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_DCL boolean FDECL(hmonas, (struct monst *)); -STATIC_DCL void FDECL(nohandglow, (struct monst *)); -STATIC_DCL boolean FDECL(shade_aware, (struct obj *)); +STATIC_DCL boolean known_hitum(struct monst *, struct obj *, int *, + int, int, struct attack *); +STATIC_DCL boolean theft_petrifies(struct obj *); +STATIC_DCL void steal_it(struct monst *, struct attack *); +STATIC_DCL boolean hitum(struct monst *, struct attack *); +STATIC_DCL boolean hmon_hitmon(struct monst *, struct obj *, int); +STATIC_DCL int joust(struct monst *, struct obj *); +STATIC_DCL void demonpet(void); +STATIC_DCL boolean m_slips_free(struct monst * mtmp, + struct attack *mattk); +STATIC_DCL int explum(struct monst *, struct attack *); +STATIC_DCL void start_engulf(struct monst *); +STATIC_DCL void end_engulf(void); +STATIC_DCL int gulpum(struct monst *, struct attack *); +STATIC_DCL boolean hmonas(struct monst *); +STATIC_DCL void nohandglow(struct monst *); +STATIC_DCL boolean shade_aware(struct obj *); extern boolean notonhead; /* for long worms */ /* The below might become a parameter instead if we use it a lot */ @@ -31,9 +31,7 @@ static boolean override_confirmation = FALSE; #define PROJECTILE(obj) ((obj) && is_ammo(obj)) void -erode_armor(mdef, hurt) -struct monst *mdef; -int hurt; +erode_armor(struct monst *mdef, int hurt) { struct obj *target; @@ -96,9 +94,8 @@ 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(register struct monst *mtmp, + struct obj *wep) /* uwep for attack(), null for kick_monster() */ { char qbuf[QBUFSZ]; @@ -216,8 +213,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; @@ -235,11 +231,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, /* usually AT_WEAP or AT_KICK */ + struct obj *weapon, /* uwep or uswapwep or NULL */ + int *attk_count, + int *role_roll_penalty) { int tmp, tmp2; @@ -308,8 +304,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; @@ -432,12 +427,12 @@ register struct monst *mtmp; /* really hit target monster; returns TRUE if it still lives */ STATIC_OVL boolean -known_hitum(mon, weapon, mhit, rollneeded, armorpenalty, uattk) -register struct monst *mon; -struct obj *weapon; -int *mhit; -int rollneeded, armorpenalty; /* for monks */ -struct attack *uattk; +known_hitum(register struct monst *mon, + struct obj *weapon, + int *mhit, + int rollneeded, /* for monks */ + int armorpenalty, /* for monks */ + struct attack *uattk) { register boolean malive = TRUE; @@ -488,9 +483,7 @@ struct attack *uattk; /* hit target monster; returns TRUE if it still lives */ STATIC_OVL 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; @@ -519,10 +512,9 @@ struct attack *uattk; /* general "damage monster" routine; return True if mon still alive */ boolean -hmon(mon, obj, thrown) -struct monst *mon; -struct obj *obj; -int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ +hmon(struct monst *mon, + struct obj *obj, + int thrown) /* HMON_xxx (0 => hand-to-hand, other => ranged) */ { boolean result, anger_guards; @@ -538,10 +530,9 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ /* guts of hmon() */ STATIC_OVL boolean -hmon_hitmon(mon, obj, thrown) -struct monst *mon; -struct obj *obj; -int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ +hmon_hitmon(struct monst *mon, + struct obj *obj, + int thrown) /* HMON_xxx (0 => hand-to-hand, other => ranged) */ { int tmp; struct permonst *mdat = mon->data; @@ -1163,8 +1154,7 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ } STATIC_OVL boolean -shade_aware(obj) -struct obj *obj; +shade_aware(struct obj *obj) { if (!obj) return FALSE; @@ -1188,9 +1178,7 @@ struct obj *obj; /* check whether slippery clothing protects from hug or wrap attack */ /* [currently assumes that you are the attacker] */ STATIC_OVL boolean -m_slips_free(mdef, mattk) -struct monst *mdef; -struct attack *mattk; +m_slips_free(struct monst *mdef, struct attack *mattk) { struct obj *obj; @@ -1232,9 +1220,8 @@ struct attack *mattk; /* used when hitting a monster with a lance while mounted; 1: joust hit; 0: ordinary hit; -1: joust but break lance */ STATIC_OVL int -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; @@ -1285,8 +1272,7 @@ demonpet() } STATIC_OVL boolean -theft_petrifies(otmp) -struct obj *otmp; +theft_petrifies(struct obj *otmp) { if (uarmg || otmp->otyp != CORPSE || !touch_petrifies(&mons[otmp->corpsenm]) || Stone_resistance) @@ -1312,9 +1298,7 @@ struct obj *otmp; * otherwise, take one object. [Is this really the behavior we want?] */ STATIC_OVL 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; @@ -1387,9 +1371,7 @@ struct attack *mattk; } int -damageum(mdef, mattk) -register struct monst *mdef; -register struct attack *mattk; +damageum(register struct monst *mdef, register struct attack *mattk) { register struct permonst *pd = mdef->data; int armpro, tmp = d((int) mattk->damn, (int) mattk->damd); @@ -1772,9 +1754,7 @@ register struct attack *mattk; } STATIC_OVL 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); @@ -1826,8 +1806,7 @@ register struct attack *mattk; } STATIC_OVL void -start_engulf(mdef) -struct monst *mdef; +start_engulf(struct monst *mdef) { if (!Invisible) { map_location(u.ux, u.uy, TRUE); @@ -1849,9 +1828,7 @@ end_engulf() } STATIC_OVL int -gulpum(mdef, mattk) -register struct monst *mdef; -register struct attack *mattk; +gulpum(register struct monst *mdef, register struct attack *mattk) { #ifdef LINT /* static char msgbuf[BUFSZ]; */ char msgbuf[BUFSZ]; @@ -2048,10 +2025,7 @@ register struct attack *mattk; } void -missum(mdef, mattk, wouldhavehit) -register struct monst *mdef; -register struct attack *mattk; -boolean wouldhavehit; +missum(register struct monst *mdef, register struct attack *mattk, boolean wouldhavehit) { if (wouldhavehit) /* monk is missing due to penalty for wearing suit */ Your("armor is rather cumbersome..."); @@ -2068,8 +2042,7 @@ boolean wouldhavehit; /* attack monster as a monster. */ STATIC_OVL boolean -hmonas(mon) -register struct monst *mon; +hmonas(register struct monst *mon) { struct attack *mattk, alt_attk; struct obj *weapon; @@ -2266,12 +2239,8 @@ register struct monst *mon; /* Special (passive) attacks on you by monsters done here. */ int -passive(mon, mhit, malive, aatyp, wep_was_destroyed) -register struct monst *mon; -register boolean mhit; -register int malive; -uchar aatyp; -boolean wep_was_destroyed; +passive(register struct monst *mon, register boolean mhit, register int malive, + uchar aatyp, boolean wep_was_destroyed) { register struct permonst *ptr = mon->data; register int i, tmp; @@ -2501,10 +2470,9 @@ boolean wep_was_destroyed; * Assumes the attack was successful. */ void -passive_obj(mon, obj, mattk) -register struct monst *mon; -register struct obj *obj; /* null means pick uwep, uswapwep or uarmg */ -struct attack *mattk; /* null means we find one internally */ +passive_obj(register struct monst *mon, + register struct obj *obj, /* null means pick uwep, uswapwep or uarmg */ + struct attack *mattk) /* null means we find one internally */ { struct permonst *ptr = mon->data; register int i; @@ -2568,8 +2536,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", *what = 0; @@ -2609,8 +2576,7 @@ struct monst *mtmp; } STATIC_OVL void -nohandglow(mon) -struct monst *mon; +nohandglow(struct monst *mon) { char *hands = makeplural(body_part(HAND)); @@ -2631,9 +2597,8 @@ 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); @@ -2670,9 +2635,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"); diff --git a/src/vault.c b/src/vault.c index 5b73dadc53..134c2f456e 100644 --- a/src/vault.c +++ b/src/vault.c @@ -4,18 +4,17 @@ #include "hack.h" -STATIC_DCL struct monst *NDECL(findgd); +STATIC_DCL struct monst *findgd(void); -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 boolean FDECL(in_fcorridor, (struct monst *, int, int)); -STATIC_DCL void FDECL(move_gold, (struct obj *, int)); -STATIC_DCL void FDECL(wallify_vault, (struct monst *)); +STATIC_DCL boolean clear_fcorr(struct monst *, boolean); +STATIC_DCL void blackout(int, int); +STATIC_DCL void restfakecorr(struct monst *); +STATIC_DCL boolean in_fcorridor(struct monst *, int, int); +STATIC_DCL void move_gold(struct obj *, int); +STATIC_DCL void wallify_vault(struct monst *); void -newegd(mtmp) -struct monst *mtmp; +newegd(struct monst *mtmp) { if (!mtmp->mextra) mtmp->mextra = newmextra(); @@ -26,8 +25,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)); @@ -37,9 +35,7 @@ struct monst *mtmp; } STATIC_OVL boolean -clear_fcorr(grd, forceshow) -struct monst *grd; -boolean forceshow; +clear_fcorr(struct monst *grd, boolean forceshow) { register int fcx, fcy, fcbeg; struct monst *mtmp; @@ -103,8 +99,7 @@ boolean forceshow; the corridor, we don't want the light to reappear if/when a new tunnel goes through the same area */ STATIC_OVL void -blackout(x, y) -int x, y; +blackout(int x, int y) { struct rm *lev; int i, j; @@ -125,8 +120,7 @@ int x, y; } STATIC_OVL 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)) { @@ -137,8 +131,7 @@ struct monst *grd; /* called in mon.c */ boolean -grddead(grd) -struct monst *grd; +grddead(struct monst *grd) { boolean dispose = clear_fcorr(grd, TRUE); @@ -163,9 +156,7 @@ struct monst *grd; } STATIC_OVL boolean -in_fcorridor(grd, x, y) -struct monst *grd; -int x, y; +in_fcorridor(struct monst *grd, int x, int y) { register int fci; struct egd *egrd = EGD(grd); @@ -192,8 +183,7 @@ findgd() } char -vault_occupied(array) -char *array; +vault_occupied(char *array) { register char *ptr; @@ -448,9 +438,7 @@ invault() } STATIC_OVL void -move_gold(gold, vroom) -struct obj *gold; -int vroom; +move_gold(struct obj *gold, int vroom) { xchar nx, ny; @@ -464,8 +452,7 @@ int vroom; } STATIC_OVL void -wallify_vault(grd) -struct monst *grd; +wallify_vault(struct monst *grd) { int x, y, typ; int vlt = EGD(grd)->vroom; @@ -535,8 +522,7 @@ struct monst *grd; * 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, gy, fci; @@ -924,8 +910,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 97c8d0321f..de08b1fe13 100644 --- a/src/version.c +++ b/src/version.c @@ -17,20 +17,18 @@ #define BETA_INFO "" -STATIC_DCL void FDECL(insert_rtoptions, (winid,char *,const char *)); +STATIC_DCL void insert_rtoptions(winid,char *,const char *); /* 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) @@ -145,10 +143,7 @@ static const char indent[] = " "; * game image, so we insert those options here. */ STATIC_OVL void -insert_rtoptions(win, buf, finalphrase) -winid win; -char *buf; -const char *finalphrase; +insert_rtoptions(winid win, char *buf, const char *finalphrase) { char rtbuf[BUFSZ]; int l, i; @@ -200,18 +195,14 @@ const char *finalphrase; #ifdef MICRO boolean -comp_times(filetime) -long filetime; +comp_times(long filetime) { return (boolean) (filetime < BUILD_TIME); } #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 @@ -244,9 +235,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; @@ -270,8 +259,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, @@ -291,8 +279,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; @@ -332,8 +319,7 @@ get_current_feature_ver() /*ARGUSED*/ const char * -copyright_banner_line(indx) -int indx; +copyright_banner_line(int indx) { #ifdef COPYRIGHT_BANNER_A if (indx == 1) diff --git a/src/vision.c b/src/vision.c index 77475af969..986e805dbc 100644 --- a/src/vision.c +++ b/src/vision.c @@ -94,14 +94,14 @@ 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, +STATIC_DCL void fill_point(int, int); +STATIC_DCL void dig_point(int, int); +STATIC_DCL void view_init(void); +STATIC_DCL void 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_DCL void FDECL(rogue_vision, (char **, char *, char *)); + genericptr_t); +STATIC_DCL void get_unused_cs(char ***, char **, char **); +STATIC_DCL void rogue_vision(char **, char *, char *); /* Macro definitions that I can't find anywhere. */ #define sign(z) ((z) < 0 ? -1 : ((z) ? 1 : 0)) @@ -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; @@ -253,9 +251,7 @@ vision_reset() * to the unused vision work area. */ STATIC_OVL 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; @@ -295,9 +291,9 @@ char **rmin, **rmax; * due to the one-sided lit wall hack. */ STATIC_OVL void -rogue_vision(next, rmin, rmax) -char **next; /* could_see array pointers */ -char *rmin, *rmax; +rogue_vision(char **next, /* could_see array pointers */ + char *rmin, + char *rmax) { int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET; /* no SHARED... */ int start, stop, in_door, xhi, xlo, yhi, ylo; @@ -353,7 +349,7 @@ char *rmin, *rmax; #ifdef EXTEND_SPINE -STATIC_DCL int FDECL(new_angle, (struct rm *, unsigned char *, int, int)); +STATIC_DCL int new_angle(struct rm *, unsigned char *, int, int); /* * new_angle() * @@ -397,10 +393,7 @@ STATIC_DCL int FDECL(new_angle, (struct rm *, unsigned char *, int, int)); * checks. - Dean 2/11/93 */ STATIC_OVL int -new_angle(lev, sv, row, col) -struct rm *lev; -unsigned char *sv; -int row, col; +new_angle(struct rm *lev, unsigned char *sv, int row, int col) { register int res = *sv; @@ -498,8 +491,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 */ @@ -547,7 +539,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, + (void (*)(int, int, genericptr_t)) 0, (genericptr_t) 0); /* @@ -612,7 +604,7 @@ int control; } } else view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, 0, - (void FDECL((*), (int, int, genericptr_t))) 0, + (void (*)(int, int, genericptr_t)) 0, (genericptr_t) 0); /* @@ -841,8 +833,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); @@ -865,8 +856,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); @@ -924,8 +914,7 @@ int x, y; * spot on its right) will point to itself. */ STATIC_OVL void -dig_point(row, col) -int row, col; +dig_point(int row, int col) { int i; @@ -1009,8 +998,7 @@ int row, col; } STATIC_OVL void -fill_point(row, col) -int row, col; +fill_point(int row, int col) { int i; @@ -1104,7 +1092,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; /* @@ -1353,10 +1341,10 @@ static genericptr_t varg; #else /* !MACRO_CPATH -- 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_DCL int _q1_path(int, int, int, int); +STATIC_DCL int _q2_path(int, int, int, int); +STATIC_DCL int _q3_path(int, int, int, int); +STATIC_DCL 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) @@ -1367,8 +1355,7 @@ STATIC_DCL int FDECL(_q4_path, (int, int, int, int)); * Quadrant I (step < 0). */ STATIC_OVL int -_q1_path(srow, scol, y2, x2) -int scol, srow, y2, x2; +_q1_path(int srow, int scol, int y2, int x2) { int dx, dy; register int k, err, x, y, dxs, dys; @@ -1415,8 +1402,7 @@ int scol, srow, y2, x2; * Quadrant IV (step > 0). */ STATIC_OVL int -_q4_path(srow, scol, y2, x2) -int scol, srow, y2, x2; +_q4_path(int srow, int scol, int y2, int x2) { int dx, dy; register int k, err, x, y, dxs, dys; @@ -1463,8 +1449,7 @@ int scol, srow, y2, x2; * Quadrant II (step < 0). */ STATIC_OVL int -_q2_path(srow, scol, y2, x2) -int scol, srow, y2, x2; +_q2_path(int srow, int scol, int y2, int x2) { int dx, dy; register int k, err, x, y, dxs, dys; @@ -1511,8 +1496,7 @@ int scol, srow, y2, x2; * Quadrant III (step > 0). */ STATIC_OVL int -_q3_path(srow, scol, y2, x2) -int scol, srow, y2, x2; +_q3_path(int srow, int scol, int y2, int x2) { int dx, dy; register int k, err, x, y, dxs, dys; @@ -1565,8 +1549,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; @@ -1612,11 +1595,11 @@ 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_DCL void right_side (int, int, int, int, int, + int, int, char *); +STATIC_DCL void left_side(int, int, int, int, int, int, int, char *); +STATIC_DCL int close_shadow(int, int, int, int); +STATIC_DCL int far_shadow(int, int, int, int); /* * Initialize algorithm D's table pointers. If we don't have these, @@ -1642,8 +1625,7 @@ view_init() #define OFF_TABLE 0xff STATIC_OVL int -close_shadow(side, this_row, block_row, block_col) -int side, this_row, block_row, block_col; +close_shadow(int side, int this_row, int block_row, int block_col) { register int sdy, sdx, pdy, offset; @@ -1675,8 +1657,7 @@ int side, this_row, block_row, block_col; } STATIC_OVL int -far_shadow(side, this_row, block_row, block_col) -int side, this_row, block_row, block_col; +far_shadow(int side, int this_row, int block_row, int block_col) { register int sdy, sdx, pdy, offset; @@ -1721,13 +1702,12 @@ int side, this_row, block_row, block_col; * Figure out what could be seen on the right side of the source. */ STATIC_OVL 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, int cb_col, /* close block row and col */ + int fb_row, int 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; register char *rowp = NULL; @@ -1999,13 +1979,12 @@ char *limits; /* points at range limit for current row, or NULL */ * for blow by blow comments. */ STATIC_OVL 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, /* 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 the previous row */ + int right, /* right mark of previous row */ + char *limits) /* points at range limit for current row, or NULL */ { register int i; register char *rowp = NULL; @@ -2201,13 +2180,12 @@ char *limits; * and right most boundaries of what could be seen. */ STATIC_OVL 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)); -genericptr_t arg; +view_from(int srow, int scol, /* source row and column */ + char **loc_cs_rows, /* could_see array (row pointers) */ + char *left_most, char *right_most,/* limits of what could be seen */ + int range, /* 0 if unlimited */ + void (*func)(int, int, genericptr_t), + genericptr_t arg) { register int i; char *rowp; @@ -2296,8 +2274,8 @@ 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_DCL void right_side(int, int, int, char *); +STATIC_DCL void left_side(int, int, int, char *); /* Initialize algorithm C (nothing). */ STATIC_OVL void @@ -2310,11 +2288,10 @@ view_init() * quadrant is determined by the value of the global variable step. */ STATIC_OVL 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 */ @@ -2502,9 +2479,7 @@ char *limits; /* points at range limit for current row, or NULL */ * extensive comments. */ STATIC_OVL 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; @@ -2638,14 +2613,13 @@ char *limits; * array provided. */ STATIC_OVL 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)); -genericptr_t arg; +view_from(int srow, int 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) { register int i; /* loop counter */ char *rowp; /* optimization for setting could_see */ @@ -2744,10 +2718,7 @@ genericptr_t arg; * vision matrix and reduce extra work. */ void -do_clear_area(scol, srow, range, func, arg) -int scol, srow, range; -void FDECL((*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) { @@ -2788,8 +2759,7 @@ genericptr_t arg; /* bitmask indicating ways mon is seen; extracted from lookat(pager.c) */ unsigned -howmonseen(mon) -struct monst *mon; +howmonseen(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 cc14f35ec4..30ba76cabd 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -26,7 +26,7 @@ #define PN_ESCAPE_SPELL (-13) #define PN_MATTER_SPELL (-14) -STATIC_DCL void FDECL(give_may_advance_msg, (int)); +STATIC_DCL void give_may_advance_msg(int); STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = { 0, DAGGER, KNIFE, AXE, PICK_AXE, SHORT_SWORD, BROADSWORD, LONG_SWORD, @@ -51,8 +51,7 @@ STATIC_VAR NEARDATA const char *const barehands_or_martial[] = { }; STATIC_OVL void -give_may_advance_msg(skill) -int skill; +give_may_advance_msg(int skill) { You_feel("more confident in your %sskills.", skill == P_NONE ? "" : skill <= P_LAST_WEAPON @@ -62,12 +61,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_DCL char *FDECL(skill_level_name, (int, char *)); -STATIC_DCL void FDECL(skill_advance, (int)); +STATIC_DCL boolean can_advance(int, boolean); +STATIC_DCL boolean could_advance(int); +STATIC_DCL boolean peaked_skill(int); +STATIC_DCL int slots_required(int); +STATIC_DCL char *skill_level_name(int, char *); +STATIC_DCL void skill_advance(int); #define P_NAME(type) \ ((skill_names_indices[type] > 0) \ @@ -83,8 +82,7 @@ static NEARDATA const char kebabable[] = { S_XORN, S_DRAGON, S_JABBERWOCK, 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); @@ -139,9 +137,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; @@ -209,9 +205,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) { int tmp = 0, otyp = otmp->otyp; struct permonst *ptr = mon->data; @@ -351,15 +345,13 @@ struct monst *mon; return tmp; } -STATIC_DCL struct obj *FDECL(oselect, (struct monst *, int)); +STATIC_DCL struct obj *oselect(struct monst *, int); #define Oselect(x) \ if ((otmp = oselect(mtmp, x)) != 0) \ return otmp; STATIC_OVL struct obj * -oselect(mtmp, x) -struct monst *mtmp; -int x; +oselect(struct monst *mtmp, int x) { struct obj *otmp; @@ -392,8 +384,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; struct obj *mwep; @@ -526,8 +517,7 @@ static const NEARDATA short hwep[] = { /* select a hand to hand weapon for the monster */ struct obj * -select_hwep(mtmp) -register struct monst *mtmp; +select_hwep(register struct monst *mtmp) { register struct obj *otmp; register int i; @@ -567,9 +557,7 @@ register 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; @@ -622,8 +610,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; @@ -730,8 +717,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); @@ -808,10 +794,9 @@ 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, /* positive: new value; negative: increment by -amt; zero: no-op */ + boolean verbose) { int newspe = (amt <= 0) ? obj->spe - amt : amt; @@ -840,10 +825,9 @@ 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, /* positive: new value; negative: decrement by -amt; zero: no-op */ + boolean verbose) { int newspe = (amt <= 0) ? obj->spe + amt : amt; @@ -869,9 +853,7 @@ boolean verbose; /* copy the skill level name into the given buffer */ STATIC_OVL char * -skill_level_name(skill, buf) -int skill; -char *buf; +skill_level_name(int skill, char *buf) { const char *ptr; @@ -905,8 +887,7 @@ char *buf; /* return the # of slots required to advance the skill */ STATIC_OVL int -slots_required(skill) -int skill; +slots_required(int skill) { int tmp = P_SKILL(skill); @@ -931,9 +912,7 @@ int skill; /* return true if this skill can be advanced */ /*ARGSUSED*/ STATIC_OVL 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) @@ -950,8 +929,7 @@ boolean speedy; /* return true if this skill could be advanced if more slots were available */ STATIC_OVL boolean -could_advance(skill) -int skill; +could_advance(int skill) { if (P_RESTRICTED(skill) || P_SKILL(skill) >= P_MAX_SKILL(skill) @@ -965,8 +943,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 -peaked_skill(skill) -int skill; +peaked_skill(int skill) { if (P_RESTRICTED(skill)) return FALSE; @@ -977,8 +954,7 @@ int skill; } STATIC_OVL void -skill_advance(skill) -int skill; +skill_advance(int skill) { u.weapon_slots -= slots_required(skill); P_SKILL(skill)++; @@ -1150,8 +1126,8 @@ enhance_weapon_skill() * function may be called with with P_NONE. Used in pray.c. */ 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; @@ -1161,9 +1137,7 @@ int skill; } void -use_skill(skill, degree) -int skill; -int degree; +use_skill(int skill, int degree) { boolean advance_before; @@ -1176,8 +1150,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; @@ -1193,8 +1166,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; @@ -1217,8 +1189,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; @@ -1245,8 +1216,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"; @@ -1340,8 +1310,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; @@ -1434,8 +1403,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; @@ -1504,9 +1472,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; diff --git a/src/were.c b/src/were.c index 7ab1051ba6..26c9f9afe1 100644 --- a/src/were.c +++ b/src/were.c @@ -5,8 +5,7 @@ #include "hack.h" void -were_change(mon) -register struct monst *mon; +were_change(register struct monst *mon) { if (!is_were(mon->data)) return; @@ -40,8 +39,7 @@ register struct monst *mon; } int -counter_were(pm) -int pm; +counter_were(int pm) { switch (pm) { case PM_WEREWOLF: @@ -63,8 +61,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: @@ -89,8 +86,7 @@ int pm; } void -new_were(mon) -register struct monst *mon; +new_were(register struct monst *mon) { register int pm; @@ -118,12 +114,10 @@ register struct monst *mon; possibly_unwield(mon, FALSE); } -int were_summon(ptr, yours, visible, - genbuf) /* were-creature (even you) summons a horde */ -register struct permonst *ptr; -register boolean yours; -int *visible; /* number of visible helpers created */ -char *genbuf; +int were_summon(register struct permonst *ptr, + register boolean yours, + int *visible,/* number of visible helpers created */ + char *genbuf) /* were-creature (even you) summons a horde */ { register int i, typ, pm = monsndx(ptr); register struct monst *mtmp; @@ -187,8 +181,7 @@ you_were() } void -you_unwere(purify) -boolean purify; +you_unwere(boolean purify) { boolean controllable_poly = Polymorph_control && !(Stunned || Unaware); diff --git a/src/wield.c b/src/wield.c index 3a0625c5f4..ead458a550 100644 --- a/src/wield.c +++ b/src/wield.c @@ -51,8 +51,8 @@ * No item may be in more than one of these slots. */ -STATIC_DCL boolean FDECL(cant_wield_corpse, (struct obj *)); -STATIC_DCL int FDECL(ready_weapon, (struct obj *)); +STATIC_DCL boolean cant_wield_corpse(struct obj *); +STATIC_DCL int ready_weapon(struct obj *); /* used by will_weld() */ /* probably should be renamed */ @@ -80,8 +80,7 @@ STATIC_DCL int FDECL(ready_weapon, (struct obj *)); * to print the appropriate messages. */ void -setuwep(obj) -register struct obj *obj; +setuwep(register struct obj *obj) { struct obj *olduwep = uwep; @@ -111,8 +110,7 @@ register struct obj *obj; } STATIC_OVL boolean -cant_wield_corpse(obj) -struct obj *obj; +cant_wield_corpse(struct obj *obj) { char kbuf[BUFSZ]; @@ -130,8 +128,7 @@ struct obj *obj; } STATIC_OVL int -ready_weapon(wep) -struct obj *wep; +ready_weapon(struct obj *wep) { /* Separated function so swapping works easily */ int res = 0; @@ -215,16 +212,14 @@ struct obj *wep; } void -setuqwep(obj) -register struct obj *obj; +setuqwep(register struct obj *obj) { setworn(obj, W_QUIVER); update_inventory(); } void -setuswapwep(obj) -register struct obj *obj; +setuswapwep(register struct obj *obj) { setworn(obj, W_SWAPWEP); update_inventory(); @@ -398,9 +393,8 @@ dowieldquiver() /* used for #rub and for applying pick-axe, whip, grappling hook or polearm */ 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; @@ -596,9 +590,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, *wepname = ""; @@ -718,8 +710,7 @@ register int amount; } int -welded(obj) -register struct obj *obj; +welded(register struct obj *obj) { if (obj && obj == uwep && will_weld(obj)) { obj->bknown = TRUE; @@ -729,8 +720,7 @@ register struct obj *obj; } void -weldmsg(obj) -register struct obj *obj; +weldmsg(register struct obj *obj) { long savewornmask; @@ -743,8 +733,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)) diff --git a/src/windows.c b/src/windows.c index 1423f8cf16..788c61fefc 100644 --- a/src/windows.c +++ b/src/windows.c @@ -10,7 +10,7 @@ /* 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 FDECL(win_X11_init, (int)); +extern void win_X11_init(int); #endif #ifdef QT_GRAPHICS extern struct window_procs Qt_procs; @@ -23,13 +23,13 @@ extern struct window_procs mac_procs; #endif #ifdef BEOS_GRAPHICS extern struct window_procs beos_procs; -extern void FDECL(be_win_init, (int)); +extern void be_win_init(int); FAIL /* be_win_init doesn't exist? XXX*/ #endif #ifdef AMIGA_INTUITION extern struct window_procs amii_procs; extern struct window_procs amiv_procs; -extern void FDECL(ami_wininit_data, (int)); +extern void ami_wininit_data(int); #endif #ifdef WIN32_GRAPHICS extern struct window_procs win32_procs; @@ -43,19 +43,19 @@ extern struct window_procs mswin_procs; #endif #ifdef WINCHAIN extern struct window_procs chainin_procs; -extern void FDECL(chainin_procs_init, (int)); -extern void *FDECL(chainin_procs_chain, (int, int, void *, void *, void *)); +extern void chainin_procs_init(int); +extern void *chainin_procs_chain(int, int, void *, void *, void *); extern struct chain_procs chainout_procs; -extern void FDECL(chainout_procs_init, (int)); -extern void *FDECL(chainout_procs_chain, (int, int, void *, void *, void *)); +extern void chainout_procs_init(int); +extern void *chainout_procs_chain(int, int, void *, void *, void *); extern struct chain_procs trace_procs; -extern void FDECL(trace_procs_init, (int)); -extern void *FDECL(trace_procs_chain, (int, int, void *, void *, void *)); +extern void trace_procs_init(int); +extern void *trace_procs_chain(int, int, void *, void *, void *); #endif -STATIC_DCL void FDECL(def_raw_print, (const char *s)); +STATIC_DCL void def_raw_print(const char *s); #ifdef HANGUPHANDLING volatile @@ -70,9 +70,9 @@ volatile static struct win_choices { struct window_procs *procs; - void FDECL((*ini_routine), (int)); /* optional (can be 0) */ + void (*ini_routine)(int); /* optional (can be 0) */ #ifdef WINCHAIN - void *FDECL((*chain_routine), (int, int, void *, void *, void *)); + void *(*chain_routine)(int, int, void *, void *, void *); #endif } winchoices[] = { #ifdef TTY_GRAPHICS @@ -173,16 +173,14 @@ genl_can_suspend_yes(VOID_ARGS) STATIC_OVL void -def_raw_print(s) -const char *s; +def_raw_print(const char *s) { puts(s); } #ifdef WINCHAIN static struct win_choices * -win_choices_find(s) -const char *s; +win_choices_find(const char *s) { register int i; @@ -196,8 +194,7 @@ const char *s; #endif void -choose_windows(s) -const char *s; +choose_windows(const char *s) { register int i; @@ -246,8 +243,7 @@ const char *s; #ifdef WINCHAIN void -addto_windowchain(s) -const char *s; +addto_windowchain(const char *s) { register int i; @@ -355,10 +351,7 @@ commit_windowchain() */ /*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; @@ -366,8 +359,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 @@ -378,8 +370,7 @@ const char *pref UNUSED; } char * -genl_getmsghistory(init) -boolean init UNUSED; +genl_getmsghistory(boolean init UNUSED) { /* window ports can provide their own getmsghistory() routine to @@ -396,9 +387,7 @@ boolean init UNUSED; } void -genl_putmsghistory(msg, is_restoring) -const char *msg; -boolean is_restoring; +genl_putmsghistory(const char *msg, boolean is_restoring) { /* window ports can provide their own putmsghistory() routine to @@ -432,42 +421,42 @@ boolean is_restoring; * in order to avoid all terminal I/O after hangup/disconnect. */ -static int NDECL(hup_nhgetch); -static char FDECL(hup_yn_function, (const char *, const char *, CHAR_P)); -static int FDECL(hup_nh_poskey, (int *, int *, int *)); -static void FDECL(hup_getlin, (const char *, char *)); -static void FDECL(hup_init_nhwindows, (int *, char **)); -static void FDECL(hup_exit_nhwindows, (const char *)); -static winid FDECL(hup_create_nhwindow, (int)); -static int FDECL(hup_select_menu, (winid, int, MENU_ITEM_P **)); -static void FDECL(hup_add_menu, (winid, int, const anything *, CHAR_P, CHAR_P, - int, const char *, BOOLEAN_P)); -static void FDECL(hup_end_menu, (winid, const char *)); -static void FDECL(hup_putstr, (winid, int, const char *)); -static void FDECL(hup_print_glyph, (winid, XCHAR_P, XCHAR_P, int, int)); -static void FDECL(hup_outrip, (winid, int, time_t)); -static void FDECL(hup_curs, (winid, int, int)); -static void FDECL(hup_display_nhwindow, (winid, BOOLEAN_P)); -static void FDECL(hup_display_file, (const char *, BOOLEAN_P)); +static int hup_nhgetch(void); +static char hup_yn_function(const char *, const char *, char); +static int hup_nh_poskey(int *, int *, int *); +static void hup_getlin(const char *, char *); +static void hup_init_nhwindows(int *, char **); +static void hup_exit_nhwindows(const char *); +static winid hup_create_nhwindow(int); +static int hup_select_menu(winid, int, MENU_ITEM_P **); +static void hup_add_menu(winid, int, const anything *, char, char, + int, const char *, boolean); +static void hup_end_menu(winid, const char *); +static void hup_putstr(winid, int, const char *); +static void hup_print_glyph(winid, xchar, xchar, int, int); +static void hup_outrip(winid, int, time_t); +static void hup_curs(winid, int, int); +static void hup_display_nhwindow(winid, boolean); +static void hup_display_file(const char *, boolean); #ifdef CLIPPING -static void FDECL(hup_cliparound, (int, int)); +static void hup_cliparound(int, int); #endif #ifdef CHANGE_COLOR -static void FDECL(hup_change_color, (int, long, int)); +static void hup_change_color(int, long, int); #ifdef MAC -static short FDECL(hup_set_font_name, (winid, char *)); +static short hup_set_font_name(winid, char *); #endif -static char *NDECL(hup_get_color_string); +static char *hup_get_color_string(void); #endif /* CHANGE_COLOR */ #ifdef STATUS_VIA_WINDOWPORT -static void FDECL(hup_status_update, (int, genericptr_t, int, int)); +static void hup_status_update(int, genericptr_t, int, int); #endif -static int NDECL(hup_int_ndecl); -static void NDECL(hup_void_ndecl); -static void FDECL(hup_void_fdecl_int, (int)); -static void FDECL(hup_void_fdecl_winid, (winid)); -static void FDECL(hup_void_fdecl_constchar_p, (const char *)); +static int hup_int_ndecl(void); +static void hup_void_ndecl(void); +static void hup_void_fdecl_int(int); +static void hup_void_fdecl_winid(winid); +static void hup_void_fdecl_constchar_p(const char *); static struct window_procs hup_procs = { "hup", 0L, 0L, hup_init_nhwindows, @@ -488,7 +477,7 @@ static struct window_procs hup_procs = { hup_cliparound, #endif #ifdef POSITIONBAR - (void FDECL((*), (char *))) hup_void_fdecl_constchar_p, + (void (*)(char *)) hup_void_fdecl_constchar_p, /* update_positionbar */ #endif hup_print_glyph, @@ -522,13 +511,13 @@ static struct window_procs hup_procs = { genl_can_suspend_no, }; -static void FDECL((*previnterface_exit_nhwindows), (const char *)) = 0; +static void (*previnterface_exit_nhwindows)(const char *) = 0; /* hangup has occurred; switch to no-op user interface */ void nhwindows_hangup() { - char *FDECL((*previnterface_getmsghistory), (BOOLEAN_P)) = 0; + char *(*previnterface_getmsghistory)(boolean) = 0; #ifdef ALTMETA /* command processor shouldn't look for 2nd char after seeing ESC */ @@ -554,8 +543,7 @@ nhwindows_hangup() } static void -hup_exit_nhwindows(lastgasp) -const char *lastgasp; +hup_exit_nhwindows(const char *lastgasp) { /* core has called exit_nhwindows(); call the previous interface's shutdown routine now; xxx_exit_nhwindows() needs to call other @@ -576,9 +564,7 @@ hup_nhgetch(VOID_ARGS) /*ARGSUSED*/ static char -hup_yn_function(prompt, resp, deflt) -const char *prompt UNUSED, *resp UNUSED; -char deflt; +hup_yn_function(const char *prompt UNUSED, const char *resp UNUSED, char deflt) { if (!deflt) deflt = '\033'; @@ -587,124 +573,91 @@ char deflt; /*ARGSUSED*/ static int -hup_nh_poskey(x, y, mod) -int *x UNUSED, *y UNUSED, *mod UNUSED; +hup_nh_poskey(int *x UNUSED, int *y UNUSED, int *mod UNUSED) { return '\033'; } /*ARGSUSED*/ static void -hup_getlin(prompt, outbuf) -const char *prompt UNUSED; -char *outbuf; +hup_getlin(const char *prompt UNUSED, char *outbuf) { Strcpy(outbuf, "\033"); } /*ARGSUSED*/ static void -hup_init_nhwindows(argc_p, argv) -int *argc_p UNUSED; -char **argv UNUSED; +hup_init_nhwindows(int *argc_p UNUSED, char **argv UNUSED) { iflags.window_inited = 1; } /*ARGUSED*/ static winid -hup_create_nhwindow(type) -int type UNUSED; +hup_create_nhwindow(int type UNUSED) { return WIN_ERR; } /*ARGSUSED*/ static int -hup_select_menu(window, how, menu_list) -winid window UNUSED; -int how UNUSED; -struct mi **menu_list UNUSED; +hup_select_menu(winid window UNUSED, int how UNUSED, struct mi **menu_list UNUSED) { return -1; } /*ARGSUSED*/ static void -hup_add_menu(window, glyph, identifier, sel, grpsel, attr, txt, preselected) -winid window UNUSED; -int glyph UNUSED, attr UNUSED; -const anything *identifier UNUSED; -char sel UNUSED, grpsel UNUSED; -const char *txt UNUSED; -boolean preselected UNUSED; +hup_add_menu(winid window UNUSED, int glyph UNUSED, const anything *identifier UNUSED, char sel UNUSED, char grpsel UNUSED, int attr UNUSED, const char *txt UNUSED, boolean preselected UNUSED) { return; } /*ARGSUSED*/ static void -hup_end_menu(window, prompt) -winid window UNUSED; -const char *prompt UNUSED; +hup_end_menu(winid window UNUSED, const char *prompt UNUSED) { return; } /*ARGSUSED*/ static void -hup_putstr(window, attr, text) -winid window UNUSED; -int attr UNUSED; -const char *text UNUSED; +hup_putstr(winid window UNUSED, int attr UNUSED, const char *text UNUSED) { return; } /*ARGSUSED*/ static void -hup_print_glyph(window, x, y, glyph, bkglyph) -winid window UNUSED; -xchar x UNUSED, y UNUSED; -int glyph UNUSED; -int bkglyph UNUSED; +hup_print_glyph(winid window UNUSED, xchar x UNUSED, xchar y UNUSED, int glyph UNUSED, int bkglyph UNUSED) { return; } /*ARGSUSED*/ static void -hup_outrip(tmpwin, how, when) -winid tmpwin UNUSED; -int how UNUSED; -time_t when UNUSED; +hup_outrip(winid tmpwin UNUSED, int how UNUSED, time_t when UNUSED) { return; } /*ARGSUSED*/ static void -hup_curs(window, x, y) -winid window UNUSED; -int x UNUSED, y UNUSED; +hup_curs(winid window UNUSED, int x UNUSED, int y UNUSED) { return; } /*ARGSUSED*/ static void -hup_display_nhwindow(window, blocking) -winid window UNUSED; -boolean blocking UNUSED; +hup_display_nhwindow(winid window UNUSED, boolean blocking UNUSED) { return; } /*ARGSUSED*/ static void -hup_display_file(fname, complain) -const char *fname UNUSED; -boolean complain UNUSED; +hup_display_file(const char *fname UNUSED, boolean complain UNUSED) { return; } @@ -712,8 +665,7 @@ boolean complain UNUSED; #ifdef CLIPPING /*ARGSUSED*/ static void -hup_cliparound(x, y) -int x UNUSED, y UNUSED; +hup_cliparound(int x UNUSED, int y UNUSED) { return; } @@ -722,9 +674,7 @@ int x UNUSED, y UNUSED; #ifdef CHANGE_COLOR /*ARGSUSED*/ static void -hup_change_color(color, rgb, reverse) -int color, reverse; -long rgb; +hup_change_color(int color, long rgb, int reverse) { return; } @@ -732,9 +682,7 @@ long rgb; #ifdef MAC /*ARGSUSED*/ static short -hup_set_font_name(window, fontname) -winid window; -char *fontname; +hup_set_font_name(winid window, char *fontname) { return 0; } @@ -750,9 +698,7 @@ hup_get_color_string(VOID_ARGS) #ifdef STATUS_VIA_WINDOWPORT /*ARGSUSED*/ static void -hup_status_update(idx, ptr, chg, percent) -int idx UNUSED, chg UNUSED, percent UNUSED; -genericptr_t ptr UNUSED; +hup_status_update(int idx UNUSED, genericptr_t ptr UNUSED, int chg UNUSED, int percent UNUSED) { return; } @@ -763,37 +709,34 @@ genericptr_t ptr UNUSED; */ static int -hup_int_ndecl(VOID_ARGS) +hup_int_ndecl(void) { return -1; } static void -hup_void_ndecl(VOID_ARGS) +hup_void_ndecl(void) { return; } /*ARGUSED*/ static void -hup_void_fdecl_int(arg) -int arg UNUSED; +hup_void_fdecl_int(int arg UNUSED) { return; } /*ARGUSED*/ static void -hup_void_fdecl_winid(window) -winid window UNUSED; +hup_void_fdecl_winid(winid window UNUSED) { return; } /*ARGUSED*/ static void -hup_void_fdecl_constchar_p(string) -const char *string UNUSED; +hup_void_fdecl_constchar_p(const char *string UNUSED) { return; } @@ -842,11 +785,7 @@ genl_status_finish() } void -genl_status_enablefield(fieldidx, nm, fmt, enable) -int fieldidx; -const char *nm; -const char *fmt; -boolean enable; +genl_status_enablefield(int fieldidx, const char *nm, const char *fmt, boolean enable) { status_fieldfmt[fieldidx] = fmt; status_fieldnm[fieldidx] = nm; @@ -854,9 +793,7 @@ boolean enable; } void -genl_status_update(idx, ptr, chg, percent) -int idx, chg, percent; -genericptr_t ptr; +genl_status_update(int idx, genericptr_t ptr, int chg, int percent) { char newbot1[MAXCO], newbot2[MAXCO]; long cond, *condptr = (long *) ptr; @@ -922,10 +859,7 @@ genericptr_t ptr; #ifdef STATUS_HILITES void -genl_status_threshold(fldidx, thresholdtype, threshold, behavior, under, over) -int fldidx, thresholdtype; -int behavior, under, over; -anything threshold; +genl_status_threshold(int fldidx, int thresholdtype, anything threshold, int behavior, int under, int over) { return; } diff --git a/src/wizard.c b/src/wizard.c index facacc7998..7d28d4adaa 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -12,13 +12,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_DCL unsigned long FDECL(target_on, (int, struct monst *)); -STATIC_DCL unsigned long FDECL(strategy, (struct monst *)); +STATIC_DCL short which_arti(int); +STATIC_DCL boolean mon_has_arti(struct monst *, short); +STATIC_DCL struct monst *other_mon_has_arti(struct monst *, short); +STATIC_DCL struct obj *on_ground(short); +STATIC_DCL boolean you_have(int); +STATIC_DCL unsigned long target_on(int, struct monst *); +STATIC_DCL unsigned long strategy(struct monst *); static NEARDATA const int nasties[] = { PM_COCKATRICE, PM_ETTIN, PM_STALKER, PM_MINOTAUR, PM_RED_DRAGON, @@ -85,8 +85,7 @@ amulet() } int -mon_has_amulet(mtmp) -register struct monst *mtmp; +mon_has_amulet(register struct monst *mtmp) { register struct obj *otmp; @@ -97,8 +96,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; @@ -125,8 +123,7 @@ register struct monst *mtmp; #define M_Wants(mask) (mtmp->data->mflags3 & (mask)) STATIC_OVL short -which_arti(mask) -register int mask; +which_arti(register int mask) { switch (mask) { case M3_WANTSAMUL: @@ -149,9 +146,7 @@ register int mask; * artifacts right now. [MRS] */ STATIC_OVL boolean -mon_has_arti(mtmp, otyp) -register struct monst *mtmp; -register short otyp; +mon_has_arti(register struct monst *mtmp, register short otyp) { register struct obj *otmp; @@ -166,9 +161,7 @@ register short otyp; } STATIC_OVL struct monst * -other_mon_has_arti(mtmp, otyp) -register struct monst *mtmp; -register short otyp; +other_mon_has_arti(register struct monst *mtmp, register short otyp) { register struct monst *mtmp2; @@ -182,8 +175,7 @@ register short otyp; } STATIC_OVL struct obj * -on_ground(otyp) -register short otyp; +on_ground(register short otyp) { register struct obj *otmp; @@ -197,8 +189,7 @@ register short otyp; } STATIC_OVL boolean -you_have(mask) -register int mask; +you_have(register int mask) { switch (mask) { case M3_WANTSAMUL: @@ -218,9 +209,7 @@ register int mask; } STATIC_OVL 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; @@ -246,8 +235,7 @@ register struct monst *mtmp; } STATIC_OVL unsigned long -strategy(mtmp) -register struct monst *mtmp; +strategy(register struct monst *mtmp) { unsigned long strat, dstrat; @@ -307,8 +295,7 @@ register struct monst *mtmp; } int -tactics(mtmp) -register struct monst *mtmp; +tactics(register struct monst *mtmp) { unsigned long strat = strategy(mtmp); @@ -445,8 +432,7 @@ pick_nasty() /* create some nasty monsters, aligned or neutral with the caster */ /* a null caster defaults to a chaotic caster (e.g. the wizard) */ int -nasty(mcast) -struct monst *mcast; +nasty(struct monst *mcast) { register struct monst *mtmp; register int i, j, tmp; @@ -619,8 +605,7 @@ const char *const random_malediction[] = { /* Insult or intimidate the player */ void -cuss(mtmp) -register struct monst *mtmp; +cuss(register struct monst *mtmp) { if (Deaf) return; diff --git a/src/worm.c b/src/worm.c index 5d41c59f42..2375565a72 100644 --- a/src/worm.c +++ b/src/worm.c @@ -14,10 +14,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_DCL void toss_wsegs(struct wseg *, boolean); +STATIC_DCL void shrink_worm(int); +STATIC_DCL void random_dir(xchar, xchar, xchar *, xchar *); +STATIC_DCL struct wseg *create_worm_tail(int); /* Description of long worm implementation. * @@ -109,9 +109,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; @@ -140,9 +138,7 @@ int wseg_count; */ STATIC_OVL 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; */ STATIC_OVL void -shrink_worm(wnum) -int wnum; /* worm number */ +shrink_worm(int wnum) /* worm number */ { struct wseg *seg; @@ -195,8 +190,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 */ @@ -243,8 +237,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 */ @@ -262,8 +255,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; @@ -287,8 +279,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; @@ -316,10 +307,7 @@ register struct monst *worm; * 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; @@ -434,8 +422,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]; @@ -453,9 +440,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]; @@ -480,8 +465,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; @@ -527,8 +511,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; @@ -561,8 +544,7 @@ int fd; * Place the segments of the given worm. Called from restore.c */ void -place_wsegs(worm) -struct monst *worm; +place_wsegs(struct monst *worm) { struct wseg *curr = wtails[worm->wormno]; @@ -583,8 +565,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]; @@ -607,9 +588,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]; @@ -664,9 +643,7 @@ xchar x, y; */ STATIC_OVL 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; @@ -686,8 +663,7 @@ register xchar *nx, *ny; * returns the number of visible segments that a worm has. */ int -count_wsegs(mtmp) -struct monst *mtmp; +count_wsegs(struct monst *mtmp) { register int i = 0; register struct wseg *curr = (wtails[mtmp->wormno])->nseg; @@ -707,8 +683,7 @@ struct monst *mtmp; */ STATIC_OVL 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; @@ -739,8 +714,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]; @@ -755,8 +729,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; diff --git a/src/worn.c b/src/worn.c index 947f367b97..62b20860eb 100644 --- a/src/worn.c +++ b/src/worn.c @@ -4,10 +4,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_DCL void m_lose_armor(struct monst *, struct obj *); +STATIC_DCL void m_dowear_type(struct monst *, long, boolean, boolean); +STATIC_DCL int extra_pref(struct monst *, struct obj *); const struct worn { long w_mask; @@ -42,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 mask) { register const struct worn *wp; register struct obj *oobj; @@ -107,8 +104,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; @@ -133,8 +129,7 @@ register struct obj *obj; /* 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 @@ -206,8 +201,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) { @@ -219,10 +213,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; @@ -297,10 +290,7 @@ struct obj *obj; /* item to make known if effect can be seen */ /* armor put on or taken off; might be magical variety */ 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; @@ -413,8 +403,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; @@ -447,9 +436,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 @@ -486,11 +473,7 @@ boolean creation; } STATIC_OVL void -m_dowear_type(mon, flag, creation, racialexception) -struct monst *mon; -long flag; -boolean creation; -boolean racialexception; +m_dowear_type(struct monst *mon, long flag, boolean creation, boolean racialexception) { struct obj *old, *best, *obj; int m_delay = 0; @@ -630,9 +613,7 @@ boolean racialexception; #undef RACE_EXCEPTION struct obj * -which_armor(mon, flag) -struct monst *mon; -long flag; +which_armor(struct monst *mon, long flag) { if (mon == &youmonst) { switch (flag) { @@ -666,9 +647,7 @@ long flag; /* remove an item of armor and then drop it */ STATIC_OVL 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) @@ -729,8 +708,7 @@ clear_bypasses() } void -bypass_obj(obj) -struct obj *obj; +bypass_obj(struct obj *obj) { obj->bypass = 1; context.bypasses = TRUE; @@ -738,9 +716,8 @@ 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) context.bypasses = TRUE; @@ -753,8 +730,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) { @@ -767,9 +743,7 @@ struct obj *objchain; } void -mon_break_armor(mon, polyspot) -struct monst *mon; -boolean polyspot; +mon_break_armor(struct monst *mon, boolean polyspot) { register struct obj *otmp; struct permonst *mdat = mon->data; @@ -928,9 +902,7 @@ boolean polyspot; /* bias a monster's preferences towards armor that has special benefits. */ STATIC_OVL 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 @@ -951,9 +923,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 1000b29c7e..fa8f5f3dde 100644 --- a/src/write.c +++ b/src/write.c @@ -3,16 +3,15 @@ #include "hack.h" -STATIC_DCL int FDECL(cost, (struct obj *)); -STATIC_DCL boolean FDECL(label_known, (int, struct obj *)); -STATIC_DCL char *FDECL(new_book_description, (int, char *)); +STATIC_DCL int cost(struct obj *); +STATIC_DCL boolean label_known(int, struct obj *); +STATIC_DCL char *new_book_description(int, char *); /* * returns basecost of a scroll or a spellbook */ STATIC_OVL int -cost(otmp) -register struct obj *otmp; +cost(register struct obj *otmp) { if (otmp->oclass == SPBOOK_CLASS) return (10 * objects[otmp->otyp].oc_level); @@ -62,9 +61,7 @@ register 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_OVL boolean -label_known(scrolltype, objlist) -int scrolltype; -struct obj *objlist; +label_known(int scrolltype, struct obj *objlist) { struct obj *otmp; @@ -91,8 +88,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], *nm, *bp; @@ -351,9 +347,7 @@ register struct obj *pen; even that's rather iffy, indicating that such descriptions probably ought to be eliminated (especially "cloth"!) */ STATIC_OVL 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 474f19563e..bceb655f50 100644 --- a/src/zap.c +++ b/src/zap.c @@ -19,19 +19,19 @@ extern boolean notonhead; /* for long worms */ /* kludge to use mondied instead of killed */ extern boolean m_using; -STATIC_DCL void FDECL(polyuse, (struct obj *, int, int)); -STATIC_DCL void FDECL(create_polymon, (struct obj *, int)); -STATIC_DCL int FDECL(stone_to_flesh_obj, (struct obj *)); -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_DCL void FDECL(skiprange, (int, int *, int *)); - -STATIC_DCL int FDECL(zap_hit, (int, int)); -STATIC_OVL void FDECL(disintegrate_mon, (struct monst *, int, const char *)); -STATIC_DCL void FDECL(backfire, (struct obj *)); -STATIC_DCL int FDECL(spell_hit_bonus, (int)); +STATIC_DCL void polyuse(struct obj *, int, int); +STATIC_DCL void create_polymon(struct obj *, int); +STATIC_DCL int stone_to_flesh_obj(struct obj *); +STATIC_DCL boolean zap_updown(struct obj *); +STATIC_DCL void zhitu(int, int, const char *, xchar, xchar); +STATIC_DCL void revive_egg(struct obj *); +STATIC_DCL boolean zap_steed(struct obj *); +STATIC_DCL void skiprange(int, int *, int *); + +STATIC_DCL int zap_hit(int, int); +STATIC_OVL void disintegrate_mon(struct monst *, int, const char *); +STATIC_DCL void backfire(struct obj *); +STATIC_DCL int spell_hit_bonus(int); #define ZT_MAGIC_MISSILE (AD_MAGM - 1) #define ZT_FIRE (AD_FIRE - 1) @@ -97,8 +97,7 @@ const char *const flash_types[] = /* wand discovery gets special handling when hero is blinded */ void -learnwand(obj) -struct obj *obj; +learnwand(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 @@ -130,9 +129,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, learn_it = FALSE; @@ -420,8 +417,7 @@ struct obj *otmp; } void -probe_monster(mtmp) -struct monst *mtmp; +probe_monster(struct monst *mtmp) { struct obj *otmp; @@ -457,10 +453,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: @@ -495,10 +488,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; @@ -516,9 +509,7 @@ int locflags; /* non-zero means get location even if monster is buried */ /* used by revive() and animate_statue() */ struct monst * -montraits(obj, cc) -struct obj *obj; -coord *cc; +montraits(struct obj *obj, coord *cc) { struct monst *mtmp = (struct monst *) 0; struct monst *mtmp2 = (struct monst *) 0; @@ -607,10 +598,7 @@ coord *cc; * 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; @@ -635,9 +623,7 @@ int *container_nesting; * successful. Note: this does NOT use up the corpse if it fails. */ 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; @@ -847,8 +833,7 @@ boolean by_hero; } STATIC_OVL void -revive_egg(obj) -struct obj *obj; +revive_egg(struct obj *obj) { /* * Note: generic eggs with corpsenm set to NON_PM will never hatch. @@ -861,8 +846,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; @@ -901,8 +885,7 @@ struct monst *mon; /* 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); int otyp = obj->otyp; @@ -1002,8 +985,7 @@ register struct obj *obj; * possibly carried by you or a monster */ boolean -drain_item(obj) -register struct obj *obj; +drain_item(register struct obj *obj) { boolean u_ring; @@ -1073,9 +1055,9 @@ register struct obj *obj; } 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 @@ -1091,8 +1073,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; @@ -1121,9 +1102,7 @@ struct obj *obj; * at the top of the pile. */ STATIC_OVL void -polyuse(objhdr, mat, minwt) -struct obj *objhdr; -int mat, minwt; +polyuse(struct obj *objhdr, int mat, int minwt) { register struct obj *otmp, *otmp2; @@ -1164,9 +1143,7 @@ int mat, minwt; * a golem of the kind okind. */ STATIC_OVL 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; @@ -1257,8 +1234,7 @@ int okind; /* Assumes obj is on the floor. */ void -do_osshock(obj) -struct obj *obj; +do_osshock(struct obj *obj) { long i; @@ -1314,9 +1290,7 @@ static const char charged_objs[] = { WAND_CLASS, WEAPON_CLASS, ARMOR_CLASS, * 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, oy; @@ -1580,8 +1554,7 @@ int id; /* stone-to-flesh spell hits and maybe transforms or animates obj */ STATIC_OVL 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; @@ -1705,8 +1678,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 */ boolean learn_it = FALSE, maybelearnit; @@ -1938,11 +1910,7 @@ struct obj *obj, *otmp; /* returns nonzero if something was hit */ int -bhitpile(obj, fhito, tx, ty, zz) -struct obj *obj; -int FDECL((*fhito), (OBJ_P, OBJ_P)); -int tx, ty; -schar zz; +bhitpile(struct obj *obj, int (*fhito)(OBJ_P, OBJ_P), int tx, int ty, schar zz) { int hitanything = 0; register struct obj *otmp, *next_obj; @@ -1982,8 +1950,7 @@ schar zz; * added by GAN 11/03/86 */ int -zappable(wand) -register struct obj *wand; +zappable(register struct obj *wand) { if (wand->spe < 0 || (wand->spe == 0 && rn2(121))) return 0; @@ -1998,8 +1965,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; @@ -2050,8 +2016,7 @@ register struct obj *obj; } STATIC_OVL void -backfire(otmp) -struct obj *otmp; +backfire(struct obj *otmp) { int dmg; otmp->in_use = TRUE; /* in case losehp() is fatal */ @@ -2117,9 +2082,7 @@ dozap() } int -zapyourself(obj, ordinary) -struct obj *obj; -boolean ordinary; +zapyourself(struct obj *obj, boolean ordinary) { boolean learn_it = FALSE; int damage = 0; @@ -2424,8 +2387,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 */ @@ -2435,10 +2397,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; @@ -2469,8 +2430,7 @@ int amt; /* pseudo-damage used to determine blindness duration */ /* light[ning] causes blindness */ boolean -flashburn(duration) -long duration; +flashburn(long duration) { if (!resists_blnd(&youmonst)) { You(are_blinded_by_the_flash); @@ -2487,8 +2447,7 @@ long duration; * Return FALSE if the steed was not hit by the wand. */ STATIC_OVL boolean -zap_steed(obj) -struct obj *obj; /* wand or spell */ +zap_steed(struct obj *obj) /* wand or spell */ { int steedhit = FALSE; @@ -2549,10 +2508,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[] = @@ -2609,8 +2565,7 @@ boolean youattack, allow_cancel_kill, self_cancel; /* you've zapped an immediate type wand up or down */ STATIC_OVL 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; @@ -2828,8 +2783,7 @@ zapwrapup() /* called for various wand and spell effects - M. Stephenson */ void -weffects(obj) -struct obj *obj; +weffects(struct obj *obj) { int otyp = obj->otyp; boolean disclose = FALSE, was_unkn = !objects[otyp].oc_name_known; @@ -2879,8 +2833,7 @@ 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); @@ -2908,8 +2861,7 @@ int dmg; /* base amount to be adjusted by bonus or penalty */ * spell class and dexterity. */ STATIC_OVL int -spell_hit_bonus(skill) -int skill; +spell_hit_bonus(int skill) { int hit_bon = 0; int dex = ACURR(A_DEX); @@ -2947,8 +2899,7 @@ int skill; } const char * -exclam(force) -int force; +exclam(int force) { /* force == 0 occurs e.g. with sleep ray */ /* note that large force is usual with wands so that !! would @@ -2957,10 +2908,9 @@ int force; } void -hit(str, mtmp, force) -const char *str; -struct monst *mtmp; -const char *force; /* usually either "." or "!" */ +hit(const char *str, + struct monst *mtmp, + const char *force) /* usually either "." or "!" */ { if ((!cansee(bhitpos.x, bhitpos.y) && !canspotmon(mtmp) && !(u.uswallow && mtmp == u.ustuck)) || !flags.verbose) @@ -2971,9 +2921,7 @@ 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"), @@ -2983,8 +2931,7 @@ register struct monst *mtmp; } STATIC_OVL 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); @@ -3016,13 +2963,13 @@ 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, pobj) -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)); -struct obj **pobj; /* object tossed/used, set to NULL - * if object is destroyed */ +bhit(register int ddx, register int ddy, /* direction */ + register int range, /* range */ + int weapon, /* see values in hack.h */ + int (*fhitm)(MONST_P, OBJ_P), /* fns called when mon hit */ + int (*fhito)(OBJ_P, OBJ_P), /* fns called when obj hit */ + struct obj **pobj) /* object tossed/used, set to NULL + * if object is destroyed */ { struct monst *mtmp; struct obj *obj = *pobj; @@ -3292,9 +3239,7 @@ struct obj **pobj; /* object tossed/used, set to NULL * 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 */ @@ -3371,10 +3316,10 @@ int dx, dy; /* used by buzz(); also used by munslime(muse.c); returns damage to mon */ int -zhitm(mon, type, nd, ootmp) -register struct monst *mon; -register int type, nd; -struct obj **ootmp; /* to return worn armor for caller to disintegrate */ +zhitm(register struct monst *mon, + register int type, + register int nd, + struct obj **ootmp) /* to return worn armor for caller to disintegrate */ { register int tmp = 0; register int abstype = abs(type) % 10; @@ -3533,10 +3478,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ } STATIC_OVL 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, abstyp = abs(type); @@ -3674,10 +3616,9 @@ xchar sx, sy; * at position x,y; 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, /* caller needs to decide about visibility checks */ + boolean u_caused) { struct obj *obj, *obj2; long i, scrquan, delquan; @@ -3732,9 +3673,8 @@ boolean u_caused; /* will zap/spell/breath attack score a hit against armor class `ac'? */ STATIC_OVL 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; @@ -3750,10 +3690,9 @@ int type; /* either hero cast spell type or 0 */ } STATIC_OVL void -disintegrate_mon(mon, type, fltxt) -struct monst *mon; -int type; /* hero vs other */ -const char *fltxt; +disintegrate_mon(struct monst *mon, + int type, /* hero vs other */ + const char *fltxt) { struct obj *otmp, *otmp2, *m_amulet = mlifesaver(mon); @@ -3804,10 +3743,7 @@ const char *fltxt; * called with dx = dy = 0 with vertical bolts */ void -buzz(type, nd, sx, sy, dx, dy) -register int type, nd; -register xchar sx, sy; -register int dx, dy; +buzz(register int type, register int nd, register xchar sx, register xchar sy, register int dx, register int dy) { int range, abstype = abs(type) % 10; struct rm *lev; @@ -4050,9 +3986,7 @@ register int dx, dy; } 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; @@ -4102,9 +4036,8 @@ const char *msg; * 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 min_time) /* 's old melt timeout (deleted by time we get here) */ { int when; long where; @@ -4133,9 +4066,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 timeout UNUSED) { xchar x, y; long where = arg->a_long; @@ -4152,11 +4083,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 exploding_wand_typ) { const char *zapverb; struct monst *mon; @@ -4442,8 +4369,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(register struct obj *obj) /* no texts here! */ { xchar x, y; boolean by_you = !context.mon_moving; @@ -4482,8 +4408,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); @@ -4531,8 +4456,7 @@ const char *const destroy_strings[][3] = { }; void -destroy_item(osym, dmgtyp) -register int osym, dmgtyp; +destroy_item(register int osym, register int dmgtyp) { register struct obj *obj, *obj2; int dmg, xresist, skip; @@ -4683,9 +4607,7 @@ register 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; @@ -4800,10 +4722,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; diff --git a/sys/amiga/amidos.c b/sys/amiga/amidos.c index 2ae3bee197..c8b402f9b3 100644 --- a/sys/amiga/amidos.c +++ b/sys/amiga/amidos.c @@ -68,8 +68,7 @@ getlogin() #ifndef AZTEC_50 int -abs(x) -int x; +abs(int x) { return x < 0 ? -x : x; } @@ -113,8 +112,7 @@ dosh() */ /* TODO: update this for FFS */ long -freediskspace(path) -char *path; +freediskspace(char *path) { #ifdef UNTESTED /* these changes from Patric Mueller for AROS to @@ -183,8 +181,7 @@ char *path; } long -filesize(file) -char *file; +filesize(char *file) { register BPTR fileLock; register struct FileInfoBlock *fileInfoBlock; @@ -204,8 +201,7 @@ char *file; #if 0 void -eraseall(path, files) -const char *path, *files; +eraseall(const char *path, const char *files) { BPTR dirLock, dirLock2; struct FileInfoBlock *fibp; @@ -240,8 +236,7 @@ const char *path, *files; #if 0 /* Unused */ #define COPYSIZE 4096 -char *CopyFile(from, to) -const char *from, *to; +char *CopyFile(const char *from, const char *to) { register BPTR fromFile, toFile; register char *buffer; @@ -355,8 +350,7 @@ gameDiskPrompt() * be room for the /. */ void -append_slash(name) -char *name; +append_slash(char *name) { char *ptr; @@ -371,8 +365,7 @@ char *name; } void -getreturn(str) -const char *str; +getreturn(const char *str) { int ch; @@ -386,8 +379,7 @@ const char *str; #define PATHSEP ';' FILE * -fopenp(name, mode) -register const char *name, *mode; +fopenp(register const char *name, register const char *mode) { register char *bp, *pp, lastch; register FILE *fp; @@ -442,7 +434,7 @@ register const char *name, *mode; static BPTR OrgDirLock = NO_LOCK; -chdir(dir) char *dir; +chdir(char *dir) { extern char orgdir[]; @@ -496,8 +488,7 @@ nethack_exit(code) exit(code); } -void regularize(s) /* normalize file name - we don't like :'s or /'s */ -register char *s; +void regularize(register char *s) /* normalize file name - we don't like :'s or /'s */ { register char *lp; diff --git a/sys/amiga/amidos.p b/sys/amiga/amidos.p index c9fb4d508e..d1a9b16c24 100644 --- a/sys/amiga/amidos.p +++ b/sys/amiga/amidos.p @@ -3,40 +3,40 @@ /* NetHack may be freely redistributed. See license for details. */ /* amidos.c */ -void NDECL(flushout ); +void flushout(void); #ifndef getuid -int NDECL(getuid ); +int getuid(void); #endif #ifndef getpid -int NDECL(getpid ); +int getpid(void); #endif #ifndef getlogin -char *NDECL(getlogin ); +char *getlogin(void); #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(void); +int dosh(void); +long freediskspace(char *); +long filesize(char *); +void eraseall(const char * , const char *); +char *CopyFile(const char * , const char *); +void copybones(int ); +void playwoRAMdisk(void); +int saveDiskPrompt(int ); +void gameDiskPrompt(void); +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/amiga/amirip.c b/sys/amiga/amirip.c index 0c5e02f7ae..cc7839e6ae 100644 --- a/sys/amiga/amirip.c +++ b/sys/amiga/amirip.c @@ -101,10 +101,7 @@ int wh; /* was local in outrip, but needed for SCALE macro */ int cmap_white, cmap_black; void -amii_outrip(tmpwin, how, when) -winid tmpwin; -int how; -time_t when; +amii_outrip(winid tmpwin, int how, time_t when) { int just_return = 0; int done, rtxth; @@ -290,8 +287,7 @@ time_t when; } static void -tomb_text(p) -char *p; +tomb_text(char *p) { char buf[STONE_LINE_LEN * 2]; int l; diff --git a/sys/amiga/amisnd.c b/sys/amiga/amisnd.c index 6421520eda..ce1e9541d7 100644 --- a/sys/amiga/amisnd.c +++ b/sys/amiga/amisnd.c @@ -80,8 +80,7 @@ long freqtab[] = { }; #ifdef TESTING -main(argc, argv) int argc; -char **argv; +main(int argc, char **argv) { makesound("wooden_flute", "AwBwCwDwEwFwGwawbwcwdwewfwgw", 60); makesound("wooden_flute", "AhBhChDhEhFhGhahbhchdhehfhgh", 60); diff --git a/sys/amiga/amitty.c b/sys/amiga/amitty.c index 047a122c1e..e3ff882ef5 100644 --- a/sys/amiga/amitty.c +++ b/sys/amiga/amitty.c @@ -20,8 +20,8 @@ #include #endif -void NDECL(tty_change_color); -char *NDECL(tty_get_color_string); +void tty_change_color(void); +char *tty_get_color_string(void); #ifdef TTY_GRAPHICS diff --git a/sys/amiga/amiwind.c b/sys/amiga/amiwind.c index a5c4f7d670..f69fddb90b 100644 --- a/sys/amiga/amiwind.c +++ b/sys/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); @@ -83,8 +83,7 @@ static enum { NoAction, CloseOver } delayed_key_action = NoAction; */ struct Window * -OpenShWindow(nw) -struct NewWindow *nw; +OpenShWindow(struct NewWindow *nw) { register struct Window *win; register ULONG idcmpflags; @@ -109,10 +108,9 @@ 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; +CloseShWindow(struct Window *win) { register struct IntuiMessage *msg; @@ -163,8 +161,7 @@ BufferGetchar() */ int -ConvertKey(message) -register struct IntuiMessage *message; +ConvertKey(register struct IntuiMessage *message) { static struct InputEvent theEvent; static char numpad[] = "bjnh.lyku"; @@ -356,8 +353,7 @@ register struct IntuiMessage *message; */ static void -ProcessMessage(message) -register struct IntuiMessage *message; +ProcessMessage(register struct IntuiMessage *message) { int c; int cnt; @@ -696,8 +692,7 @@ amii_cleanup() #ifndef SHAREDLIB void -Abort(rc) -long rc; +Abort(long rc) { int fault = 1; #ifdef CHDIR @@ -759,8 +754,7 @@ CleanUp() #ifdef AMIFLUSH /* This routine adapted from AmigaMail IV-37 by Michael Sinz */ static struct Message * -GetFMsg(port) -struct MsgPort *port; +GetFMsg(struct MsgPort *port) { struct IntuiMessage *msg, *succ, *succ1; @@ -786,8 +780,7 @@ struct MsgPort *port; #endif struct NewWindow * -DupNewWindow(win) -struct NewWindow *win; +DupNewWindow(struct NewWindow *win) { struct NewWindow *nwin; struct Gadget *ngd, *gd, *pgd = NULL; @@ -828,8 +821,7 @@ struct NewWindow *win; } void -FreeNewWindow(win) -struct NewWindow *win; +FreeNewWindow(struct NewWindow *win) { register struct Gadget *gd, *pgd; register struct StringInfo *sip; @@ -885,17 +877,16 @@ amii_loadlib(void) /* fatal error */ /*VARARGS1*/ -void error -VA_DECL(const char *, s) +void error(const char *s, ...) { - VA_START(s); - VA_INIT(s, char *); + va_list the_args; + va_start(the_args, s); putchar('\n'); - vprintf(s, VA_ARGS); + vprintf(s, the_args); putchar('\n'); - VA_END(); + va_end(the_args); Abort(0L); } #endif diff --git a/sys/amiga/amiwind.p b/sys/amiga/amiwind.p index 3c9460b17f..e85b8b1729 100644 --- a/sys/amiga/amiwind.p +++ b/sys/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(void); +int amikbhit(void); +int WindowGetchar(void); +WETYPE WindowGetevent(void); +void WindowFlush(void); +void WindowPutchar(char ); +void WindowFPuts(const char *); +void WindowPuts(const char *); +void WindowPrintf( char *,... ); +void CleanUp(void); +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); +void amii_delay_output(void); +void amii_number_pad(int ); void amii_cleanup( void ); diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index 5f32f7711d..7b7d60d49e 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -10,7 +10,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; @@ -589,8 +589,7 @@ amii_player_selection() #include "NH:sys/amiga/randwin.c" void -RandomWindow( name ) - char *name; +RandomWindow( char *name ) { struct MsgPort *tport; struct timerequest *trq; @@ -935,9 +934,7 @@ amii_get_ext_cmd(void) #endif } - static int put_ext_cmd(obufp, colx, cw, bottom) char * obufp; - int colx, bottom; - struct amii_WinDesc *cw; + static int put_ext_cmd(char * obufp, int colx, struct amii_WinDesc *cw, int bottom) { struct Window *w = cw->win; char *t; @@ -982,8 +979,7 @@ amii_get_ext_cmd(void) /* Ask a question and get a response */ - char amii_yn_function(query, resp, def) const char * query, *resp; - char def; + char amii_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 @@ -1127,8 +1123,7 @@ amii_get_ext_cmd(void) return q; } - void amii_display_file(fn, complain) const char * fn; - boolean complain; + void amii_display_file(const char * fn, boolean complain) { register struct amii_WinDesc *cw; register int win; @@ -1183,7 +1178,7 @@ amii_get_ext_cmd(void) * are rendered in the up position by default. */ - void SetBorder(gd) register struct Gadget * gd; + void SetBorder(register struct Gadget * gd) { register struct Border *bp; register short *sp; diff --git a/sys/amiga/winami.p b/sys/amiga/winami.p index 7d24a2ceed..da63f45ea9 100644 --- a/sys/amiga/winami.p +++ b/sys/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, 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); +void amii_mark_synch(void); +void amii_wait_synch(void); +void amii_setclipped(void); +void amii_cliparound(int , int ); +void amii_askname(void); +void amii_player_selection(void); +void flush_output(void); +void amii_destroy_nhwindow(winid ); +int amii_create_nhwindow(int ); +void amii_init_nhwindows(void); +int amii_get_ext_cmd(void); +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 ); +void amii_clear_nhwindow(winid ); +void amii_exit_nhwindows(const char *); +int amii_nh_poskey(int * , int * , int *); +int amii_nhgetch(void); +void amii_get_nh_event(void); +void amii_remember_topl(void); +int amii_doprev_message(void); +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, 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); +void amii_getlin(const char * , char *); +void getlind(const char * , char * , const char *); +void amii_suspend_nhwindows(char * ); +void amii_resume_nhwindows(void); +void amii_bell(void); +void EditColor(void); +void DrawCol( struct Window *, int, UWORD * ); +void DispCol( struct Window *w, int idx, UWORD * ); +void SetBorder(struct Gadget *); +void port_help(void); +void dismiss_nhwindow(winid); diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index b7960c01a2..f353223b5f 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -439,8 +439,7 @@ struct amiv_glyph_node amiv_g_nodes[NUMBER_GLYPH_NODES]; static char amiv_glyph_buffer[GLYPH_BUFFER_SIZE]; void -flush_glyph_buffer(vw) -struct Window *vw; +flush_glyph_buffer(struct Window *vw) { if (WINVERS_AMIV) amiv_flush_glyph_buffer(vw); @@ -452,8 +451,7 @@ struct Window *vw; * Routine to flush whatever is buffered */ void -amiv_flush_glyph_buffer(vw) -struct Window *vw; +amiv_flush_glyph_buffer(struct Window *vw) { #if !defined(DISPMAP) || defined(OPT_DISPMAP) int xsize, ysize, x, y; @@ -631,9 +629,7 @@ struct Window *vw; * Glyph buffering routine. Called instead of WindowPuts(). */ void -amiv_lprint_glyph(window, color_index, glyph) -winid window; -int color_index, glyph; +amiv_lprint_glyph(winid window, int color_index, int glyph) { int base; struct amii_WinDesc *cw; @@ -807,8 +803,7 @@ static int usecolor; */ void -amiv_start_glyphout(window) -winid window; +amiv_start_glyphout(winid window) { struct amii_WinDesc *cw; struct Window *w; @@ -843,8 +838,7 @@ winid window; * General cleanup routine -- flushes and restores cursor */ void -amii_end_glyphout(window) -winid window; +amii_end_glyphout(winid window) { struct amii_WinDesc *cw; struct Window *w; @@ -969,8 +963,7 @@ int backg[AMII_MAXCOLORS] = { * Routine to simply flush whatever is buffered */ void -amii_flush_glyph_buffer(w) -struct Window *w; +amii_flush_glyph_buffer(struct Window *w) { short i, x, y; register struct RastPort *rp = w->RPort; @@ -1011,9 +1004,7 @@ struct Window *w; glyph_node_index = glyph_buffer_index = 0; } void -amiga_print_glyph(window, color_index, glyph) -winid window; -int color_index, glyph; +amiga_print_glyph(winid window, int color_index, int glyph) { if (WINVERS_AMIV) amiv_lprint_glyph(window, color_index, glyph); @@ -1025,9 +1016,7 @@ int color_index, glyph; * Glyph buffering routine. Called instead of WindowPuts(). */ void -amii_lprint_glyph(window, color_index, glyph) -winid window; -int color_index, glyph; +amii_lprint_glyph(winid window, int color_index, int glyph) { int fg_color, bg_color; struct amii_WinDesc *cw; @@ -1107,8 +1096,7 @@ static int usecolor; */ void -amii_start_glyphout(window) -winid window; +amii_start_glyphout(winid window) { struct amii_WinDesc *cw; struct Window *w; @@ -1145,8 +1133,7 @@ winid window; * General cleanup routine -- flushes and restores cursor */ void -amii_end_glyphout(window) - winid window; +amii_end_glyphout(winid window) { struct amii_WinDesc *cw; struct Window *w; @@ -1190,8 +1177,7 @@ dispmap_sanity() } } int -dispmap_sanity1(x) -int x; +dispmap_sanity1(int x) { static unsigned char valid[] = { 8, 16, 24, 32, 48, 0 }; return !!strchr(valid, x); diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index d565b1af45..52c3518a63 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -43,8 +43,7 @@ int amii_otherBPen; long amii_libvers = LIBRARY_FONT_VERSION; void -ami_wininit_data(dir) -int dir; +ami_wininit_data(int dir) { extern unsigned short amii_init_map[AMII_MAXCOLORS]; extern unsigned short amiv_init_map[AMII_MAXCOLORS]; @@ -139,8 +138,7 @@ struct TagItem wintags[] = { }; #endif -void amii_destroy_nhwindow(win) /* just hide */ -register winid win; +void amii_destroy_nhwindow(register winid win) /* just hide */ { int i; int type; @@ -310,7 +308,7 @@ void } #endif -amii_create_nhwindow(type) register int type; +amii_create_nhwindow(register int type) { register struct Window *w = NULL; register struct NewWindow *nw = NULL; @@ -849,9 +847,7 @@ int /* Initialize the windowing environment */ void -amii_init_nhwindows(argcp, argv) -int *argcp; -char **argv; +amii_init_nhwindows(int *argcp, char **argv) { int i; struct Screen *wbscr; @@ -1345,8 +1341,7 @@ amii_setdrawpens(struct Window *w, int type) /* Clear the indicated window */ void -amii_clear_nhwindow(win) -register winid win; +amii_clear_nhwindow(register winid win) { register struct amii_WinDesc *cw; register struct Window *w; @@ -1402,8 +1397,7 @@ register winid win; /* Dismiss the window from the screen */ void -dismiss_nhwindow(win) -register winid win; +dismiss_nhwindow(register winid win) { register struct Window *w; register struct amii_WinDesc *cw; @@ -1442,8 +1436,7 @@ register winid win; } void -amii_exit_nhwindows(str) -const char *str; +amii_exit_nhwindows(const char *str) { /* Seems strange to have to do this... but we need the BASE window * left behind... @@ -1459,9 +1452,7 @@ const char *str; } void -amii_display_nhwindow(win, blocking) -winid win; -boolean blocking; +amii_display_nhwindow(winid win, boolean blocking) { menu_item *mip; int cnt; @@ -1497,10 +1488,9 @@ boolean blocking; } void -amii_curs(window, x, y) -winid window; -register int x, y; /* not xchar: perhaps xchar is unsigned and - curx-x would be unsigned as well */ +amii_curs(winid window, + register int x, register int y) /* not xchar: perhaps xchar is unsigned and + curx-x would be unsigned as well */ { register struct amii_WinDesc *cw; register struct Window *w; @@ -1648,9 +1638,7 @@ printf("pos: (%d,%d)->(%d,%d)\n",x,y,qqx,qqy); } void -amii_set_text_font(name, size) -char *name; -int size; +amii_set_text_font(char *name, int size) { register int i; register struct amii_WinDesc *cw; @@ -1694,8 +1682,7 @@ int size; } void -kill_nhwindows(all) -register int all; +kill_nhwindows(register int all) { register int i; register struct amii_WinDesc *cw; @@ -1711,9 +1698,7 @@ register int all; } void -amii_cl_end(cw, curs_pos) -register struct amii_WinDesc *cw; -register int curs_pos; +amii_cl_end(register struct amii_WinDesc *cw, register int curs_pos) { register struct Window *w = cw->win; register int oy, ox; @@ -1730,8 +1715,7 @@ register int curs_pos; } void -cursor_off(window) -winid window; +cursor_off(winid window) { register struct amii_WinDesc *cw; register struct Window *w; @@ -1790,8 +1774,7 @@ winid window; } void -cursor_on(window) -winid window; +cursor_on(winid window) { int x, y; register struct amii_WinDesc *cw; @@ -1855,9 +1838,7 @@ winid window; } static void -cursor_common(rp, x, y) -struct RastPort *rp; -int x, y; +cursor_common(struct RastPort *rp, int x, int y) { int x1, x2, y1, y2; @@ -1880,8 +1861,7 @@ int x, y; } void -amii_suspend_nhwindows(str) -const char *str; +amii_suspend_nhwindows(const char *str) { if (HackScreen) ScreenToBack(HackScreen); @@ -1901,8 +1881,7 @@ amii_bell() } void -removetopl(cnt) -int cnt; +removetopl(int cnt) { struct amii_WinDesc *cw = amii_wins[WIN_MESSAGE]; /* NB - this is sufficient for @@ -1936,10 +1915,7 @@ port_help() */ void -amii_print_glyph(win, x, y, glyph, bkglyph) -winid win; -xchar x, y; -int glyph, bkglyph; +amii_print_glyph(winid win, xchar x, xchar y, int glyph, int bkglyph) { struct amii_WinDesc *cw; uchar ch; @@ -2004,8 +1980,7 @@ if(u.uz.dlevel != x){ /* Make sure the user sees a text string when no windowing is available */ void -amii_raw_print(s) -register const char *s; +amii_raw_print(register const char *s) { int argc = 0; @@ -2040,8 +2015,7 @@ register const char *s; */ void -amii_raw_print_bold(s) -register const char *s; +amii_raw_print_bold(register const char *s) { int argc = 0; @@ -2128,8 +2102,7 @@ amii_setclipped() * edge of the map is already displayed */ void -amii_cliparound(x, y) -register int x, y; +amii_cliparound(register int x, register int y) { extern boolean restoring; #ifdef CLIPPING @@ -2326,8 +2299,7 @@ register int x, y; } void -flushIDCMP(port) -struct MsgPort *port; +flushIDCMP(struct MsgPort *port) { struct Message *msg; while (msg = GetMsg(port)) diff --git a/sys/amiga/winkey.c b/sys/amiga/winkey.c index c90e06fc80..43327ed464 100644 --- a/sys/amiga/winkey.c +++ b/sys/amiga/winkey.c @@ -6,7 +6,7 @@ #include "NH:sys/amiga/winext.h" #include "NH:sys/amiga/winproto.h" -amii_nh_poskey(x, y, mod) int *x, *y, *mod; +amii_nh_poskey(int *x, int *y, int *mod) { struct amii_WinDesc *cw; WETYPE type; diff --git a/sys/amiga/winmenu.c b/sys/amiga/winmenu.c index 8558dbac5c..ac74ab60d8 100644 --- a/sys/amiga/winmenu.c +++ b/sys/amiga/winmenu.c @@ -9,8 +9,7 @@ /* Start building the text for a menu */ void -amii_start_menu(window) -register winid window; +amii_start_menu(register winid window) { register int i; register struct amii_WinDesc *cw; @@ -56,15 +55,7 @@ register winid window; /* Add a string to a menu */ void -amii_add_menu(window, glyph, id, ch, gch, attr, str, preselected) -register winid window; -register int glyph; -register const anything *id; -register char ch; -register char gch; -register int attr; -register const char *str; -register BOOLEAN_P preselected; +amii_add_menu(register winid window, register int glyph, register const anything *id, register char ch, register char gch, register int attr, register const char *str, register boolean preselected) { register struct amii_WinDesc *cw; amii_menu_item *mip; @@ -122,9 +113,7 @@ register BOOLEAN_P preselected; /* Done building a menu. */ void -amii_end_menu(window, morestr) -register winid window; -register const char *morestr; +amii_end_menu(register winid window, register const char *morestr) { register struct amii_WinDesc *cw; @@ -169,10 +158,7 @@ register const char *morestr; /* Select something from the menu. */ int -amii_select_menu(window, how, mip) -register winid window; -register int how; -register menu_item **mip; +amii_select_menu(register winid window, register int how, register menu_item **mip) { int cnt; register struct amii_WinDesc *cw; @@ -227,9 +213,7 @@ make_menu_items(register struct amii_WinDesc *cw, register menu_item **rmip) } int -DoMenuScroll(win, blocking, how, retmip) -int win, blocking, how; -menu_item **retmip; +DoMenuScroll(int win, int blocking, int how, menu_item **retmip) { amii_menu_item *amip; register struct Window *w; @@ -1083,8 +1067,7 @@ menu_item **retmip; } void -ReDisplayData(win) -winid win; +ReDisplayData(winid win) { int totalvis; register struct amii_WinDesc *cw; @@ -1114,9 +1097,7 @@ winid win; } long -FindLine(win, line) -winid win; -int line; +FindLine(winid win, int line) { int txwd; register char *t; @@ -1177,8 +1158,7 @@ int line; } long -CountLines(win) -winid win; +CountLines(winid win) { int txwd; amii_menu_item *mip; @@ -1241,9 +1221,7 @@ winid win; } void -DisplayData(win, start) -winid win; -int start; +DisplayData(winid win, int start) { int txwd; amii_menu_item *mip; @@ -1418,10 +1396,7 @@ int start; } void -SetPropInfo(win, gad, vis, total, top) -register struct Window *win; -register struct Gadget *gad; -register long vis, total, top; +SetPropInfo(register struct Window *win, register struct Gadget *gad, register long vis, register long total, register long top) { long mflags; register long hidden; diff --git a/sys/amiga/winproto.h b/sys/amiga/winproto.h index 9c249b0a0f..653febb72d 100644 --- a/sys/amiga/winproto.h +++ b/sys/amiga/winproto.h @@ -20,7 +20,7 @@ char *dirname(char *str); void amii_putstr(winid window, int attr, const char *str); void outmore(struct amii_WinDesc *cw); void outsubstr(struct amii_WinDesc *cw, char *str, int len, int fudge); -void amii_putsym(winid st, int i, int y, CHAR_P c); +void amii_putsym(winid st, int i, int y, char c); void amii_addtopl(const char *s); void TextSpaces(struct RastPort *rp, int nr); void amii_remember_topl(void); @@ -40,10 +40,10 @@ 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, char, int, + const char *, boolean); +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); @@ -142,7 +142,7 @@ void Abort(long rc); #endif /* amirip.c */ -void FDECL(amii_outrip, (winid tmpwin, int how, time_t when)); +void amii_outrip(winid tmpwin, int how, time_t when); /* winchar.c */ void SetMazeType(MazeType); diff --git a/sys/amiga/winreq.c b/sys/amiga/winreq.c index a5e4b95fb9..fa35670a1b 100644 --- a/sys/amiga/winreq.c +++ b/sys/amiga/winreq.c @@ -532,8 +532,7 @@ EditClipping(void) } char * -dirname(str) -char *str; +dirname(char *str) { char *t, c; static char dir[300]; @@ -553,8 +552,7 @@ char *str; } char * -basename(str) -char *str; +basename(char *str) { char *t; @@ -568,7 +566,7 @@ char *str; return (t); } -filecopy(from, to) char *from, *to; +filecopy(char *from, char *to) { char *buf; int i = 0; @@ -643,10 +641,7 @@ ClearCol(struct Window *w) } void -DrawCol(w, idx, colors) -struct Window *w; -int idx; -UWORD *colors; +DrawCol(struct Window *w, int idx, UWORD *colors) { int bxorx, bxory, bxxlen, bxylen; int i, incx, incy, r, g, b; @@ -728,10 +723,7 @@ UWORD *colors; } void -DispCol(w, idx, colors) -struct Window *w; -int idx; -UWORD *colors; +DispCol(struct Window *w, int idx, UWORD *colors) { char buf[50]; char *colname, *defval; @@ -810,19 +802,14 @@ amii_setpens(int count) /* Generate a requester for a string value. */ void -amii_getlin(prompt, bufp) -const char *prompt; -char *bufp; +amii_getlin(const char *prompt, char *bufp) { getlind(prompt, bufp, 0); } /* and with default */ void -getlind(prompt, bufp, dflt) -const char *prompt; -char *bufp; -const char *dflt; +getlind(const char *prompt, char *bufp, const char *dflt) { #ifndef TOPL_GETLINE register struct Window *cwin; @@ -992,9 +979,7 @@ const char *dflt; } void -amii_change_color(pen, val, rev) -int pen, rev; -long val; +amii_change_color(int pen, int val, long val) { if (rev) sysflags.amii_curmap[pen] = ~val; diff --git a/sys/amiga/winstr.c b/sys/amiga/winstr.c index 46946b522b..07c596d36b 100644 --- a/sys/amiga/winstr.c +++ b/sys/amiga/winstr.c @@ -9,10 +9,7 @@ /* Put a string into the indicated window using the indicated attribute */ void -amii_putstr(window, attr, str) -winid window; -int attr; -const char *str; +amii_putstr(winid window, int attr, const char *str) { int fudge; int len; @@ -281,9 +278,7 @@ const char *str; } void -amii_scrollmsg(w, cw) -register struct Window *w; -register struct amii_WinDesc *cw; +amii_scrollmsg(register struct Window *w, register struct amii_WinDesc *cw) { int bottom, wheight; @@ -306,8 +301,7 @@ register struct amii_WinDesc *cw; } int -amii_msgborder(w) -struct Window *w; +amii_msgborder(struct Window *w) { register int bottom; @@ -320,8 +314,7 @@ struct Window *w; } void -outmore(cw) -register struct amii_WinDesc *cw; +outmore(register struct amii_WinDesc *cw) { struct Window *w = cw->win; @@ -354,11 +347,7 @@ register struct amii_WinDesc *cw; } void -outsubstr(cw, str, len, fudge) -register struct amii_WinDesc *cw; -char *str; -int len; -int fudge; +outsubstr(register struct amii_WinDesc *cw, char *str, int len, int fudge) { struct Window *w = cw->win; @@ -382,10 +371,7 @@ int fudge; /* Put a graphics character onto the screen */ void -amii_putsym(st, i, y, c) -winid st; -int i, y; -CHAR_P c; +amii_putsym(winid st, int i, int y, char c) { amii_curs(st, i, y); Text(amii_wins[st]->win->RPort, &c, 1); @@ -394,8 +380,7 @@ CHAR_P c; /* Add to the last line in the message window */ void -amii_addtopl(s) -const char *s; +amii_addtopl(const char *s) { register struct amii_WinDesc *cw = amii_wins[WIN_MESSAGE]; @@ -408,9 +393,7 @@ const char *s; } void -TextSpaces(rp, nr) -struct RastPort *rp; -int nr; +TextSpaces(struct RastPort *rp, int nr) { if (nr < 1) return; diff --git a/sys/atari/tos.c b/sys/atari/tos.c index eee7bd40f3..377cf96d7d 100644 --- a/sys/atari/tos.c +++ b/sys/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(void); +static char BIOSgetch(void); +static void init_aline(void); char *_a_line; /* for Line A variables */ #ifdef TEXTCOLOR boolean colors_changed = FALSE; @@ -170,8 +170,7 @@ DOSgetch() } long -freediskspace(path) -char *path; +freediskspace(char *path) { int drive = 0; struct { @@ -191,8 +190,7 @@ char *path; * Functions to get filenames using wildcards */ int -findfirst(path) -char *path; +findfirst(char *path) { return (Fsfirst(path, 0) == 0); } @@ -210,8 +208,7 @@ foundfile_buffer() } long -filesize(file) -char *file; +filesize(char *path) { if (findfirst(file)) return (*(long *) ((char *) Fgetdta() + 26)); @@ -223,8 +220,7 @@ char *file; * Chdrive() changes the default drive. */ void -chdrive(str) -char *str; +chdrive(char *path) { char *ptr; char drive; @@ -265,8 +261,7 @@ get_scr_size() #define BIGBUF 8192 int -_copyfile(from, to) -char *from, *to; +_copyfile(char *from, char *to) { int fromfd, tofd, r; char *buf; diff --git a/sys/mac/macerrs.c b/sys/mac/macerrs.c index c78ef0f667..60e1270ee7 100644 --- a/sys/mac/macerrs.c +++ b/sys/mac/macerrs.c @@ -102,9 +102,9 @@ static void vprogerror(); /* Macro substitute for error() */ void error VA_DECL(const char *, line) { - VA_START(line); - VA_INIT(line, char *); - vprogerror(line, VA_ARGS); + va_start(the_args, line); + ; + vprogerror(line, the_args); VA_END(); } @@ -125,7 +125,7 @@ error VA_DECL(const char *, line) char pbuf[BUFSZ]; if(index(line, '%')) { - Vsprintf(pbuf,line,VA_ARGS); + Vsprintf(pbuf,line,the_args); line = pbuf; } showerror("of an internal error",line); diff --git a/sys/mac/macfile.c b/sys/mac/macfile.c index d2055716b2..f6ff3edc4b 100644 --- a/sys/mac/macfile.c +++ b/sys/mac/macfile.c @@ -41,11 +41,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 */ diff --git a/sys/mac/mactopl.c b/sys/mac/mactopl.c index 2d43d9c6a0..eceda3d178 100644 --- a/sys/mac/mactopl.c +++ b/sys/mac/mactopl.c @@ -48,9 +48,7 @@ topl_yn_function(const char *query, const char *resp, char def) } char -mac_yn_function(query, resp, def) -const char *query, *resp; -char def; +mac_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/sys/mac/macwin.c b/sys/mac/macwin.c index 210b139949..19d4a1e70d 100644 --- a/sys/mac/macwin.c +++ b/sys/mac/macwin.c @@ -79,22 +79,22 @@ static pascal OSStatus GlobalEvent(EventHandlerCallRef, EventRef, void *); #else -static void FDECL(GeneralKey, (EventRecord *, WindowPtr)); -static void FDECL(macKeyMenu, (EventRecord *, WindowPtr)); -static void FDECL(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 short FDECL(macDoNull, (EventRecord *, WindowPtr)); -static short FDECL(macUpdateMessage, (EventRecord *, WindowPtr)); -static short FDECL(macUpdateMenu, (EventRecord *, WindowPtr)); -static short FDECL(GeneralUpdate, (EventRecord *, WindowPtr)); - -static void FDECL(macCursorTerm, (EventRecord *, WindowPtr, RgnHandle)); -static void FDECL(GeneralCursor, (EventRecord *, WindowPtr, RgnHandle)); +static void GeneralKey(EventRecord *, WindowPtr); +static void macKeyMenu(EventRecord *, WindowPtr); +static void macKeyText(EventRecord *, WindowPtr); + +static void macClickMessage(EventRecord *, WindowPtr); +static void macClickTerm(EventRecord *, WindowPtr); +static void macClickMenu(EventRecord *, WindowPtr); +static void macClickText(EventRecord *, WindowPtr); + +static short macDoNull(EventRecord *, WindowPtr); +static short macUpdateMessage(EventRecord *, WindowPtr); +static short macUpdateMenu(EventRecord *, WindowPtr); +static short GeneralUpdate(EventRecord *, WindowPtr); + +static void macCursorTerm(EventRecord *, WindowPtr, RgnHandle); +static void GeneralCursor(EventRecord *, WindowPtr, RgnHandle); #endif static void TextUpdate(NhWindow *wind); @@ -215,12 +215,12 @@ 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 *); #if 1 //!TARGET_API_MAC_CARBON -static void FDECL(DoScrollBar, (Point, short, ControlHandle, NhWindow *)); +static void DoScrollBar(Point, short, ControlHandle, NhWindow *); #endif -static pascal void FDECL(MoveScrollBar, (ControlHandle, short)); +static pascal void MoveScrollBar(ControlHandle, short); #if 1 //!TARGET_API_MAC_CARBON typedef void (*CbFunc)(EventRecord *, WindowPtr); @@ -1293,7 +1293,7 @@ adjust_window_pos(NhWindow *aWin, short width, short height) * until presumed seen. */ void -mac_display_nhwindow(winid win, BOOLEAN_P f) +mac_display_nhwindow(winid win, boolean f) { NhWindow *aWin = &theWindows[win]; WindowPtr theWindow = aWin->its_window; @@ -1936,8 +1936,8 @@ mac_start_menu(winid win) } void -mac_add_menu(winid win, int glyph, const anything *any, CHAR_P menuChar, - CHAR_P groupAcc, int attr, const char *inStr, int preselected) +mac_add_menu(winid win, int glyph, const anything *any, char menuChar, + char groupAcc, int attr, const char *inStr, int preselected) { #if defined(__SC__) || defined(__MRC__) #pragma unused(glyph) @@ -2084,9 +2084,8 @@ mac_select_menu(winid win, int how, menu_item **selected_list) #include "dlb.h" static void -mac_display_file(name, complain) -const char *name; /* not ANSI prototype because of boolean parameter */ -boolean complain; +mac_display_file(const char *name, + boolean complain) { Ptr buf; int win; diff --git a/sys/mac/mgetline.c b/sys/mac/mgetline.c index 308daa97be..c54ff6fed3 100644 --- a/sys/mac/mgetline.c +++ b/sys/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(void); /* 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/msdos/msdos.c b/sys/msdos/msdos.c index d943b864d5..1a33d40d3d 100644 --- a/sys/msdos/msdos.c +++ b/sys/msdos/msdos.c @@ -45,18 +45,18 @@ #define GETKEYFLAGS 0x02 /* Get Keyboard Flags */ /*#define KEY_DEBUG */ /* print values of unexpected key codes - devel*/ -void FDECL(get_cursor, (int *, int *)); +void get_cursor(int *, int *); /* direct bios calls are used only when iflags.BIOS is set */ -STATIC_DCL char NDECL(DOSgetch); -STATIC_DCL char NDECL(BIOSgetch); +STATIC_DCL char DOSgetch(void); +STATIC_DCL char BIOSgetch(void); #ifndef __GO32__ -STATIC_DCL char *NDECL(getdta); +STATIC_DCL char *getdta(void); #endif -STATIC_DCL unsigned int FDECL(dos_ioctl, (int, int, unsigned)); +STATIC_DCL unsigned int dos_ioctl(int, int, unsigned); #ifdef USE_TILES -extern boolean FDECL(pckeys, (unsigned char, unsigned char)); /* pckeys.c */ +extern boolean pckeys(unsigned char, unsigned char); /* pckeys.c */ #endif int @@ -353,8 +353,7 @@ switchar() } long -freediskspace(path) -char *path; +freediskspace(char *path) { union REGS regs; @@ -375,8 +374,7 @@ char *path; * Functions to get filenames using wildcards */ int -findfirst_file(path) -char *path; +findfirst_file(char *path) { union REGS regs; struct SREGS sregs; @@ -425,8 +423,7 @@ getdta() } long -filesize_nh(file) -char *file; +filesize_nh(char *file) { char *dta; @@ -443,8 +440,7 @@ char *file; * Chdrive() changes the default drive. */ void -chdrive(str) -char *str; +chdrive(char *str) { #define SELECTDISK 0x0E char *ptr; @@ -504,9 +500,7 @@ enable_ctrlP() } STATIC_OVL unsigned int -dos_ioctl(handle, mode, setvalue) -int handle, mode; -unsigned setvalue; +dos_ioctl(int handle, int mode, unsigned setvalue) { union REGS regs; diff --git a/sys/msdos/ovlinit.c b/sys/msdos/ovlinit.c index bc18134add..210ef099e0 100644 --- a/sys/msdos/ovlinit.c +++ b/sys/msdos/ovlinit.c @@ -17,8 +17,7 @@ * */ unsigned -memavail(minovl) -unsigned minovl; /* minimum size of overlay heap */ +memavail(unsigned minovl) /* minimum size of overlay heap */ { unsigned available; @@ -66,7 +65,7 @@ signed long tmpbuffer; int emsstatus; int xmsstatus; -void NDECL(_resizeOvrBuffer); +void _resizeOvrBuffer(void); void _resizeOvrBuffer() @@ -116,8 +115,7 @@ startup() } void -show_borlandc_stats(win) -winid win; +show_borlandc_stats(winid win) { char buf[BUFSZ]; diff --git a/sys/msdos/pckeys.c b/sys/msdos/pckeys.c index 567b8ee4d3..a805ea1b9a 100644 --- a/sys/msdos/pckeys.c +++ b/sys/msdos/pckeys.c @@ -13,7 +13,7 @@ #include "wintty.h" #include "pcvideo.h" -boolean FDECL(pckeys, (unsigned char, unsigned char)); +boolean pckeys(unsigned char, unsigned char); extern struct WinDesc *wins[MAXWIN]; /* from wintty.c */ extern boolean inmap; /* from video.c */ @@ -28,9 +28,7 @@ extern boolean inmap; /* from video.c */ * */ boolean -pckeys(scancode, shift) -unsigned char scancode; -unsigned char shift; +pckeys(unsigned char scancode, unsigned char shift) { boolean opening_dialog; diff --git a/sys/msdos/pctiles.c b/sys/msdos/pctiles.c index 1a8a53aadc..b162fe269c 100644 --- a/sys/msdos/pctiles.c +++ b/sys/msdos/pctiles.c @@ -54,9 +54,7 @@ extern int total_tiles_used; /* tile.c */ * */ int -ReadTileFileHeader(tibhdr, filestyle) -struct tibhdr_struct *tibhdr; -boolean filestyle; +ReadTileFileHeader(struct tibhdr_struct *tibhdr, boolean filestyle) { FILE *x; x = filestyle ? tilefile_O : tilefile; @@ -85,9 +83,7 @@ boolean filestyle; * */ int -OpenTileFile(tilefilename, filestyle) -char *tilefilename; -boolean filestyle; +OpenTileFile(char *tilefilename, boolean filestyle) { #ifdef TILES_IN_RAM int k; @@ -150,8 +146,7 @@ boolean filestyle; } void -CloseTileFile(filestyle) -boolean filestyle; +CloseTileFile(boolean filestyle) { fclose(filestyle ? tilefile_O : tilefile); #ifdef TILES_IN_RAM @@ -191,9 +186,7 @@ struct overview_planar_cell_struct oplancell; */ #ifdef PLANAR_FILE int -ReadPlanarTileFile(tilenum, gp) -int tilenum; -struct planar_cell_struct **gp; +ReadPlanarTileFile(int tilenum, struct planar_cell_struct **gp) { long fpos; @@ -214,9 +207,7 @@ struct planar_cell_struct **gp; return 0; } int -ReadPlanarTileFile_O(tilenum, gp) -int tilenum; -struct overview_planar_cell_struct **gp; +ReadPlanarTileFile_O(int tilenum, struct overview_planar_cell_struct **gp) { long fpos; @@ -242,9 +233,7 @@ struct overview_planar_cell_struct **gp; #ifdef PACKED_FILE int -ReadPackedTileFile(tilenum, pta) -int tilenum; -char (*pta)[TILE_X]; +ReadPackedTileFile(int tilenum, char (*pta)[TILE_X]) { long fpos; diff --git a/sys/msdos/pctiles.h b/sys/msdos/pctiles.h index 58f29a3906..aba18f2cfa 100644 --- a/sys/msdos/pctiles.h +++ b/sys/msdos/pctiles.h @@ -41,20 +41,19 @@ struct tibhdr_struct { * char packtile[TILE_Y][TILE_X]; */ -extern void FDECL(CloseTileFile, (BOOLEAN_P)); -extern int FDECL(OpenTileFile, (char *, BOOLEAN_P)); -extern int FDECL(ReadTileFileHeader, (struct tibhdr_struct *, BOOLEAN_P)); +extern void CloseTileFile(boolean); +extern int OpenTileFile(char *, boolean); +extern int ReadTileFileHeader(struct tibhdr_struct *, boolean); #ifdef PLANAR_FILE #ifdef SCREEN_VGA -extern int FDECL(ReadPlanarTileFile, (int, struct planar_cell_struct **)); -extern int FDECL(ReadPlanarTileFile_O, - (int, struct overview_planar_cell_struct **)); +extern int ReadPlanarTileFile(int, struct planar_cell_struct **); +extern int ReadPlanarTileFile_O(int, struct overview_planar_cell_struct **); #endif #endif #ifdef PACKED_FILE -extern int FDECL(ReadPackedTileFile, (int, char (*)[TILE_X])); +extern int ReadPackedTileFile(int, char (*)[TILE_X]); #endif extern short glyph2tile[MAX_GLYPH]; /* in tile.c (made from tilemap.c) */ diff --git a/sys/msdos/pcvideo.h b/sys/msdos/pcvideo.h index e62bd7be1c..1bea4ed045 100644 --- a/sys/msdos/pcvideo.h +++ b/sys/msdos/pcvideo.h @@ -228,63 +228,62 @@ extern int cursor_color; /* ### video.c ### */ #ifdef SIMULATE_CURSOR -E void NDECL(DrawCursor); -E void NDECL(HideCursor); +E void DrawCursor(void); +E void HideCursor(void); #endif /* ### vidtxt.c ### */ #ifdef NO_TERMS -E void NDECL(txt_backsp); -E void NDECL(txt_clear_screen); -E void FDECL(txt_cl_end, (int, int)); -E void NDECL(txt_cl_eos); -E void NDECL(txt_get_scr_size); -E void FDECL(txt_gotoxy, (int, int)); -E int NDECL(txt_monoadapt_check); -E void NDECL(txt_nhbell); -E void FDECL(txt_startup, (int *, int *)); -E void FDECL(txt_xputs, (const char *, int, int)); -E void FDECL(txt_xputc, (CHAR_P, int)); +E void txt_backsp(void); +E void txt_clear_screen(void); +E void txt_cl_end(int, int); +E void txt_cl_eos(void); +E void txt_get_scr_size(void); +E void txt_gotoxy(int, int); +E int txt_monoadapt_check(void); +E void txt_nhbell(void); +E void txt_startup(int *, int *); +E void txt_xputs(const char *, int, int); +E void txt_xputc(char, int); /* ### vidvga.c ### */ #ifdef SCREEN_VGA -E void NDECL(vga_backsp); -E void FDECL(vga_clear_screen, (int)); -E void FDECL(vga_cl_end, (int, int)); -E void FDECL(vga_cl_eos, (int)); -E int NDECL(vga_detect); +E void vga_backsp(void); +E void vga_clear_screen(int); +E void vga_cl_end(int, int); +E void vga_cl_eos(int); +E int vga_detect(void); #ifdef SIMULATE_CURSOR -E void NDECL(vga_DrawCursor); +E void vga_DrawCursor(void); #endif -E void FDECL(vga_DisplayCell, (struct planar_cell_struct *, int, int)); -E void FDECL(vga_DisplayCell_O, - (struct overview_planar_cell_struct *, int, int)); -E void NDECL(vga_Finish); -E char __far *NDECL(vga_FontPtrs); -E void NDECL(vga_get_scr_size); -E void FDECL(vga_gotoloc, (int, int)); +E void vga_DisplayCell(struct planar_cell_struct *, int, int); +E void vga_DisplayCell_O(struct overview_planar_cell_struct *, int, int); +E void vga_Finish(void); +E char __far *vga_FontPtrs(void); +E void vga_get_scr_size(void); +E void vga_gotoloc(int, int); #ifdef POSITIONBAR -E void FDECL(vga_update_positionbar, (char *)); +E void vga_update_positionbar(char *); #endif #ifdef SIMULATE_CURSOR -E void NDECL(vga_HideCursor); +E void vga_HideCursor(void); #endif -E void NDECL(vga_Init); -E void FDECL(vga_SwitchMode, (unsigned int)); -E void FDECL(vga_SetPalette, (char *)); -E void NDECL(vga_tty_end_screen); -E void FDECL(vga_tty_startup, (int *, int *)); -E void FDECL(vga_WriteChar, (int, int, int, int)); -E void FDECL(vga_WriteStr, (char *, int, int, int, int)); -E void FDECL(vga_xputs, (const char *, int, int)); -E void FDECL(vga_xputc, (CHAR_P, int)); -E void FDECL(vga_xputg, (int, int, unsigned)); -E void FDECL(vga_userpan, (BOOLEAN_P)); -E void FDECL(vga_overview, (BOOLEAN_P)); -E void FDECL(vga_traditional, (BOOLEAN_P)); -E void NDECL(vga_refresh); +E void vga_Init(void); +E void vga_SwitchMode(unsigned int); +E void vga_SetPalette(char *); +E void vga_tty_end_screen(void); +E void vga_tty_startup(int *, int *); +E void vga_WriteChar(int, int, int, int); +E void vga_WriteStr(char *, int, int, int, int); +E void vga_xputs(const char *, int, int); +E void vga_xputc(char, int); +E void vga_xputg(int, int, unsigned); +E void vga_userpan(boolean); +E void vga_overview(boolean); +E void vga_traditional(boolean); +E void vga_refresh(void); #endif /* SCREEN_VGA */ #endif /* NO_TERMS */ diff --git a/sys/msdos/sound.c b/sys/msdos/sound.c index 8a9f6b65a6..b7b182d8fd 100644 --- a/sys/msdos/sound.c +++ b/sys/msdos/sound.c @@ -24,8 +24,7 @@ #define printf pline int -assign_soundcard(sopt) -char *sopt; +assign_soundcard(char *sopt) { iflags.hassound = 0; #ifdef PCMUSIC diff --git a/sys/msdos/tile2bin.c b/sys/msdos/tile2bin.c index 8ecdbfe176..2e85c42f3b 100644 --- a/sys/msdos/tile2bin.c +++ b/sys/msdos/tile2bin.c @@ -38,7 +38,7 @@ extern unsigned _stklen = STKSIZ; #endif -extern char *FDECL(tilename, (int, int)); +extern char *tilename(int, int); #ifdef PLANAR_FILE char masktable[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; @@ -60,9 +60,9 @@ int num_colors; pixel pixels[TILE_Y][TILE_X]; struct tibhdr_struct tibheader; -static void FDECL(write_tibtile, (int)); -static void FDECL(write_tibheader, (FILE *, struct tibhdr_struct *)); -static void FDECL(build_tibtile, (pixel(*) [TILE_X])); +static void write_tibtile(int); +static void write_tibheader(FILE *, struct tibhdr_struct *); +static void build_tibtile(pixel(*) [TILE_X]); #ifndef OVERVIEW_FILE char *tilefiles[] = { "../win/share/monsters.txt", "../win/share/objects.txt", @@ -77,9 +77,7 @@ int filenum; int paletteflag; int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { int i; struct tm *newtime; @@ -196,9 +194,7 @@ char *argv[]; } static void -write_tibheader(fileptr, tibhdr) -FILE *fileptr; -struct tibhdr_struct *tibhdr; +write_tibheader(FILE *fileptr, struct tibhdr_struct *tibhdr) { if (fseek(fileptr, 0L, SEEK_SET)) { Fprintf(stderr, "Error writing header to tile file\n"); @@ -207,8 +203,7 @@ struct tibhdr_struct *tibhdr; } static void -build_tibtile(pixels) -pixel (*pixels)[TILE_X]; +build_tibtile(pixel (*pixels)[TILE_X]) { int i, j, k, co_off; unsigned char co_mask, tmp; @@ -263,8 +258,7 @@ pixel (*pixels)[TILE_X]; } static void -write_tibtile(recnum) -int recnum; +write_tibtile(int recnum) { long fpos; diff --git a/sys/msdos/video.c b/sys/msdos/video.c index ce1de0415a..9e10ad7572 100644 --- a/sys/msdos/video.c +++ b/sys/msdos/video.c @@ -111,13 +111,13 @@ typedef long clock_t; #endif #ifdef SCREEN_BIOS -void FDECL(get_cursor, (int *, int *)); +void get_cursor(int *, int *); #endif -void FDECL(adjust_cursor_flags, (struct WinDesc *)); -void FDECL(cmov, (int, int)); -void FDECL(nocmov, (int, int)); -STATIC_DCL void NDECL(init_ttycolor); +void adjust_cursor_flags(struct WinDesc *); +void cmov(int, int); +void nocmov(int, int); +STATIC_DCL void init_ttycolor(void); int savevmode; /* store the original video mode in here */ int curcol, currow; /* graphics mode current cursor locations */ @@ -188,8 +188,7 @@ void cl_eos() /* clear to end of screen */ } void -cmov(col, row) -register int col, row; +cmov(register int col, register int row) { ttyDisplay->cury = (uchar) row; ttyDisplay->curx = (uchar) col; @@ -228,8 +227,7 @@ home() } void -nocmov(col, row) -int col, row; +nocmov(int col, int row) { if (!iflags.grmode) { txt_gotoxy(col, row); @@ -371,15 +369,13 @@ tty_nhbell() } void -tty_number_pad(state) -int state; +tty_number_pad(int state) { ++state; /* prevents compiler warning (unref. param) */ } void -tty_startup(wid, hgt) -int *wid, *hgt; +tty_startup(int *wid, int *hgt) { /* code to sense display adapter is required here - MJA */ @@ -497,8 +493,7 @@ gr_finish() */ void -xputs(s) -const char *s; +xputs(const char *s) { int col, row; @@ -514,8 +509,7 @@ const char *s; } } -void xputc(ch) /* write out character (and attribute) */ -char ch; +void xputc(char ch) /* write out character (and attribute) */ { int i; char attribute; @@ -532,11 +526,9 @@ char ch; } } -void xputg(glyphnum, ch, - special) /* write out a glyph picture at current location */ -int glyphnum; -int ch; -unsigned special; +void xputg(int glyphnum, + int ch, + unsigned special) /* write out a glyph picture at current location */ { if (!iflags.grmode || !iflags.tile_view) { xputc((char) ch); @@ -549,8 +541,7 @@ unsigned special; #ifdef POSITIONBAR void -video_update_positionbar(posbar) -char *posbar; +video_update_positionbar(char *posbar) { if (!iflags.grmode) return; @@ -562,8 +553,7 @@ char *posbar; #endif void -adjust_cursor_flags(cw) -struct WinDesc *cw; +adjust_cursor_flags(struct WinDesc *cw) { #ifdef SIMULATE_CURSOR #if 0 @@ -679,7 +669,7 @@ init_ttycolor() #endif } -static int FDECL(convert_uchars, (char *, uchar *, int)); +static int convert_uchars(char *, uchar *, int); #ifdef VIDEOSHADES int assign_videoshades(char *choiceptr) @@ -788,10 +778,9 @@ assign_videocolors(char *colorvals) } 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; @@ -844,8 +833,7 @@ int size; * vga (use vga adapter code) */ int -assign_video(sopt) -char *sopt; +assign_video(char *sopt) { /* * debug @@ -907,8 +895,7 @@ char *sopt; } void -tileview(enable) -boolean enable; +tileview(boolean enable) { #ifdef SCREEN_VGA if (iflags.grmode) @@ -920,8 +907,7 @@ boolean enable; #else /* STUBVIDEO */ void -tileview(enable) -boolean enable; +tileview(boolean enable) { } #endif /* STUBVIDEO */ diff --git a/sys/msdos/vidtxt.c b/sys/msdos/vidtxt.c index 82e18e8a37..f989c2b5eb 100644 --- a/sys/msdos/vidtxt.c +++ b/sys/msdos/vidtxt.c @@ -31,7 +31,7 @@ #endif #endif -/* void FDECL(txt_xputc,(char, int)); */ /* write out character (and +/* void txt_xputc(char, int); */ /* write out character (and attribute) */ extern int attrib_text_normal; /* text mode normal attribute */ @@ -98,10 +98,10 @@ txt_get_scr_size() #include #endif -void FDECL(txt_gotoxy, (int, int)); +void txt_gotoxy(int, int); #if defined(SCREEN_BIOS) && !defined(PC9800) -void FDECL(txt_get_cursor, (int *, int *)); +void txt_get_cursor(int *, int *); #endif #ifdef SCREEN_DJGPPFAST @@ -178,8 +178,7 @@ txt_clear_screen() #endif } -void txt_cl_end(col, row) /* clear to end of line */ -int col, row; +void txt_cl_end(int col, int row) /* clear to end of line */ { union REGS regs; #ifndef PC9800 @@ -251,8 +250,7 @@ void txt_cl_eos() /* clear to end of screen */ } void -txt_startup(wid, hgt) -int *wid, *hgt; +txt_startup(int *wid, int *hgt) { txt_get_scr_size(); *wid = CO; @@ -288,9 +286,7 @@ int *wid, *hgt; */ void -txt_xputs(s, col, row) -const char *s; -int col, row; +txt_xputs(const char *s, int col, int row) { char c; @@ -306,9 +302,7 @@ int col, row; } } -void txt_xputc(ch, attr) /* write out character (and attribute) */ -char ch; -int attr; +void txt_xputc(char ch, int attr) /* write out character (and attribute) */ { #ifdef PC9800 union REGS regs; @@ -391,8 +385,7 @@ int attr; /* * This is implemented as a macro under DJGPPFAST. */ -void txt_get_cursor(x, y) /* get cursor position */ -int *x, *y; +void txt_get_cursor(int *x, int *y) /* get cursor position */ { union REGS regs; @@ -407,8 +400,7 @@ int *x, *y; #endif /* SCREEN_BIOS && !PC9800 */ void -txt_gotoxy(x, y) -int x, y; +txt_gotoxy(int x, int y) { #ifdef SCREEN_BIOS union REGS regs; diff --git a/sys/msdos/vidvga.c b/sys/msdos/vidvga.c index 533ce179f6..b7b89b19b1 100644 --- a/sys/msdos/vidvga.c +++ b/sys/msdos/vidvga.c @@ -102,19 +102,19 @@ #include #endif -/* STATIC_DCL void FDECL(vga_NoBorder, (int)); */ -void FDECL(vga_gotoloc, (int, int)); /* This should be made a macro */ -void NDECL(vga_backsp); +/* STATIC_DCL void vga_NoBorder(int); */ +void vga_gotoloc(int, int); /* This should be made a macro */ +void vga_backsp(void); #ifdef SCROLLMAP -STATIC_DCL void FDECL(vga_scrollmap, (BOOLEAN_P)); +STATIC_DCL void vga_scrollmap(boolean); #endif -STATIC_DCL void FDECL(vga_redrawmap, (BOOLEAN_P)); -void FDECL(vga_cliparound, (int, int)); -STATIC_OVL void FDECL(decal_planar, (struct planar_cell_struct *, unsigned)); +STATIC_DCL void vga_redrawmap(boolean); +void vga_cliparound(int, int); +STATIC_OVL void decal_planar(struct planar_cell_struct *, unsigned); #ifdef POSITIONBAR -STATIC_DCL void NDECL(positionbar); -static void FDECL(vga_special, (int, int, int)); +STATIC_DCL void positionbar(void); +static void vga_special(int, int, int); #endif extern int clipx, clipxmax; /* current clipping column from wintty.c */ @@ -218,8 +218,7 @@ vga_backsp() } void -vga_clear_screen(colour) -int colour; +vga_clear_screen(int colour) { char __far *pch; int y, j; @@ -245,8 +244,7 @@ int colour; vga_gotoloc(0, 0); /* is this needed? */ } -void vga_cl_end(col, row) /* clear to end of line */ -int col, row; +void vga_cl_end(int col, int row) /* clear to end of line */ { int count; @@ -260,8 +258,7 @@ int col, row; } } -void vga_cl_eos(cy) /* clear to end of screen */ -int cy; +void vga_cl_eos(int cy) /* clear to end of screen */ { int count; @@ -282,8 +279,7 @@ vga_tty_end_screen() } void -vga_tty_startup(wid, hgt) -int *wid, *hgt; +vga_tty_startup(int *wid, int *hgt) { /* code to sense display adapter is required here - MJA */ @@ -320,18 +316,14 @@ int *wid, *hgt; */ void -vga_xputs(s, col, row) -const char *s; -int col, row; +vga_xputs(const char *s, int col, int row) { if (s != (char *) 0) { vga_WriteStr((char *) s, strlen(s), col, row, g_attribute); } } -void vga_xputc(ch, attr) /* write out character (and attribute) */ -char ch; -int attr; +void vga_xputc(char ch, int attr) /* write out character (and attribute) */ { int col, row; @@ -354,12 +346,10 @@ int attr; #if defined(USE_TILES) void -vga_xputg(glyphnum, ch, - special) /* Place tile represent. a glyph at current location */ -int glyphnum; -int ch; -unsigned special; /* special feature: corpse, invis, detected, pet, ridden - - hack.h */ +vga_xputg(int glyphnum, int ch, + unsigned special/* special feature: corpse, invis, detected, pet, ridden - + hack.h */ + ) /* Place tile represent. a glyph at current location */ { int col, row; int attr; @@ -414,8 +404,7 @@ unsigned special; /* special feature: corpse, invis, detected, pet, ridden - */ void -vga_gotoloc(col, row) -int col, row; +vga_gotoloc(int col, int row) { curcol = min(col, CO - 1); /* protection from callers */ currow = min(row, LI - 1); @@ -423,8 +412,7 @@ int col, row; #if defined(USE_TILES) && defined(CLIPPING) void -vga_cliparound(x, y) -int x, y; +vga_cliparound(int x, int y) { extern boolean restoring; int oldx = clipx; @@ -447,8 +435,7 @@ int x, y; } STATIC_OVL void -vga_redrawmap(clearfirst) -boolean clearfirst; +vga_redrawmap(boolean clearfirst) { int j, x, y, t; char __far *pch; @@ -513,8 +500,7 @@ boolean clearfirst; #endif /* USE_TILES && CLIPPING */ void -vga_userpan(left) -boolean left; +vga_userpan(boolean left) { int x; @@ -531,8 +517,7 @@ boolean left; } void -vga_overview(on) -boolean on; +vga_overview(boolean on) { /* vga_HideCursor(); */ if (on) { @@ -549,8 +534,7 @@ boolean on; } void -vga_traditional(on) -boolean on; +vga_traditional(boolean on) { /* vga_HideCursor(); */ if (on) { @@ -579,8 +563,7 @@ vga_refresh() #ifdef SCROLLMAP STATIC_OVL void -vga_scrollmap(left) -boolean left; +vga_scrollmap(boolean left) { int j, x, y, t; int i, pixx, pixy, x1, y1, x2, y2; @@ -646,9 +629,7 @@ boolean left; #endif /* SCROLLMAP */ STATIC_OVL void -decal_planar(gp, special) -struct planar_cell_struct *gp; -unsigned special; +decal_planar(struct planar_cell_struct *gp, unsigned special) { if (special & MG_CORPSE) { } else if (special & MG_INVIS) { @@ -854,8 +835,7 @@ vga_detect() * */ void -vga_WriteChar(chr, col, row, colour) -int chr, col, row, colour; +vga_WriteChar(int chr, int col, int row, int colour) { int i; int x, pixy; @@ -902,9 +882,7 @@ int chr, col, row, colour; * */ void -vga_DisplayCell(gp, col, row) -struct planar_cell_struct *gp; -int col, row; +vga_DisplayCell(struct planar_cell_struct *gp, int col, int row) { int i, pixx, pixy; char __far *tmp_s; /* source pointer */ @@ -933,9 +911,7 @@ int col, row; } void -vga_DisplayCell_O(gp, col, row) -struct overview_planar_cell_struct *gp; -int col, row; +vga_DisplayCell_O(struct overview_planar_cell_struct *gp, int col, int row) { int i, pixx, pixy; char __far *tmp_s; /* source pointer */ @@ -966,9 +942,7 @@ int col, row; * */ void -vga_WriteStr(s, len, col, row, colour) -char *s; -int len, col, row, colour; +vga_WriteStr(char *s, int len, int col, int row, int colour) { unsigned char *us; int i = 0; @@ -994,8 +968,7 @@ int len, col, row, colour; * */ void -vga_SetPalette(p) -char *p; +vga_SetPalette(char *p) { union REGS regs; int i; @@ -1029,8 +1002,7 @@ static unsigned char colorbits[] = { 0x08, 0x04, 0x02, 0x01 }; static unsigned char pbar[COLNO]; void -vga_update_positionbar(posbar) -char *posbar; +vga_update_positionbar(char *posbar) { char *p = pbar; if (posbar) @@ -1141,8 +1113,7 @@ positionbar() } void -vga_special(chr, col, color) -int chr, col, color; +vga_special(int chr, int col, int color) { int i, y, pixy; char __far *tmp_d; /* destination pointer */ diff --git a/sys/os2/os2.c b/sys/os2/os2.c index 83798968eb..fabebc787b 100644 --- a/sys/os2/os2.c +++ b/sys/os2/os2.c @@ -30,8 +30,8 @@ #include -static char NDECL(DOSgetch); -static char NDECL(BIOSgetch); +static char DOSgetch(void); +static char BIOSgetch(void); int tgetch() @@ -187,8 +187,7 @@ kbhit() } long -freediskspace(path) -char *path; +freediskspace(char *path) { FSALLOCATE FSInfoBuf; #ifdef OS2_32BITAPI @@ -229,8 +228,7 @@ static FILEFINDBUF ResultBuf; static HDIR DirHandle; int -findfirst(path) -char *path; +findfirst(char *path) { #ifdef OS2_32BITAPI ULONG @@ -279,8 +277,7 @@ foundfile_buffer() } long -filesize(file) -char *file; +filesize(char *file) { if (findfirst(file)) { return (*(long *) (ResultBuf.cbFileAlloc)); @@ -292,8 +289,7 @@ char *file; * Chdrive() changes the default drive. */ void -chdrive(str) -char *str; +chdrive(char *str) { char *ptr; char drive; @@ -353,8 +349,7 @@ get_scr_size() } void -gotoxy(x, y) -int x, y; +gotoxy(int x, int y) { HVIO VideoHandle = 0; @@ -365,8 +360,7 @@ int x, y; } char * -get_username(lan_username_size) -int *lan_username_size; +get_username(int *lan_username_size) { return (char *) 0; } diff --git a/sys/share/dgn_lex.c b/sys/share/dgn_lex.c index 44ddfc5b31..53053b1a76 100644 --- a/sys/share/dgn_lex.c +++ b/sys/share/dgn_lex.c @@ -517,11 +517,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(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 @@ -551,11 +551,11 @@ 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 #else /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ @@ -565,14 +565,14 @@ int FDECL(yyoutput, (int)); #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) /* older flex wants this */ -#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t, size_t)); +#define YY_MALLOC_DECL genericptr_t malloc(size_t); \ + genericptr_t realloc(genericptr_t, size_t); /* newer flex assumes so needs this in case it's been suppressed */ YY_MALLOC_DECL #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/sys/share/dgn_yacc.c b/sys/share/dgn_yacc.c index 9339fd578d..68e866cebf 100644 --- a/sys/share/dgn_yacc.c +++ b/sys/share/dgn_yacc.c @@ -38,18 +38,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(void); +int yyparse(void); +int getchain(char *); +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) diff --git a/sys/share/ioctl.c b/sys/share/ioctl.c index 3da74b81a9..ce06e6bb00 100644 --- a/sys/share/ioctl.c +++ b/sys/share/ioctl.c @@ -71,12 +71,12 @@ struct termio termio; #endif #ifdef _M_UNIX -extern void NDECL(sco_mapon); -extern void NDECL(sco_mapoff); +extern void sco_mapon(void); +extern void sco_mapoff(void); #endif #ifdef __linux__ -extern void NDECL(linux_mapon); -extern void NDECL(linux_mapoff); +extern void linux_mapon(void); +extern void linux_mapoff(void); #endif #ifdef AUX diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index b34ae00915..a8996f91bb 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -1036,11 +1036,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(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 @@ -1070,11 +1070,11 @@ 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 #else /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ @@ -1084,28 +1084,28 @@ int FDECL(yyoutput, (int)); #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) /* older flex wants this */ -#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t, size_t)); +#define YY_MALLOC_DECL genericptr_t malloc(size_t); \ + genericptr_t realloc(genericptr_t, size_t); /* newer flex assumes so needs this in case it's been suppressed */ YY_MALLOC_DECL #endif -void FDECL(init_yyin, (FILE *)); -void FDECL(init_yyout, (FILE *)); +void init_yyin(FILE *); +void init_yyout(FILE *); -long NDECL(handle_varstring_check); -long FDECL(corefunc_str_check, (char *, long)); +long handle_varstring_check(void); +long corefunc_str_check(char *, long); -extern void VDECL(lc_error, (const char *, ...)); -extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); +extern void lc_error(const char *, ...); +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); +void advancepos(char *); /* * This doesn't always get put in lev_comp.h diff --git a/sys/share/lev_yacc.c b/sys/share/lev_yacc.c index 62e1f20429..038b31bdcc 100644 --- a/sys/share/lev_yacc.c +++ b/sys/share/lev_yacc.c @@ -52,52 +52,52 @@ #define NewTab(type, size) (type **) alloc(sizeof(type *) * size) #define Free(ptr) free((genericptr_t)ptr) -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 lc_error(const char *, ...); +extern void lc_warning(const char *, ...); +extern void yyerror(const char *); +extern void yywarning(const char *); +extern int yylex(void); +int yyparse(void); -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 VDECL(add_opvars, (sp_lev *, const char *, ...)); -extern void FDECL(start_level_def, (sp_lev * *, char *)); +extern int get_floor_type(char); +extern int get_room_type(char *); +extern int get_trap_type(char *); +extern int get_monster_id(char *,char); +extern int get_object_id(char *,char); +extern boolean check_monster_char(char); +extern boolean check_object_char(char); +extern char what_map_char(char); +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 add_opvars(sp_lev *, const char *, ...); +extern void start_level_def(sp_lev * *, 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(void); +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); struct coord { long x; diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 0276d61f82..35590621a1 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -40,14 +40,14 @@ long _stksize = 16 * 1024; #ifdef AMIGA extern int bigscreen; -void NDECL(preserve_icon); +void preserve_icon(void); #endif -STATIC_DCL void FDECL(process_options, (int argc, char **argv)); -STATIC_DCL void NDECL(nhusage); +STATIC_DCL void process_options(int argc, char **argv); +STATIC_DCL void nhusage(void); #if defined(MICRO) || defined(WIN32) || defined(OS2) -extern void FDECL(nethack_exit, (int)); +extern void nethack_exit(int); #else #define nethack_exit exit #endif @@ -55,24 +55,24 @@ extern void FDECL(nethack_exit, (int)); #ifdef WIN32 extern boolean getreturn_enabled; /* from sys/share/pcsys.c */ extern int redirect_stdout; /* from sys/share/pcsys.c */ -char *NDECL(exename); +char *exename(void); char default_window_sys[] = "mswin"; #endif #if defined(MSWIN_GRAPHICS) -extern void NDECL(mswin_destroy_reg); +extern void mswin_destroy_reg(void); #endif #ifdef EXEPATH -STATIC_DCL char *FDECL(exepath, (char *)); +STATIC_DCL char *exepath(char *); #endif -int FDECL(main, (int, char **)); +int main(int, char **); -extern boolean FDECL(pcmain, (int, char **)); +extern boolean pcmain(int, char **); #if defined(__BORLANDC__) && !defined(_WIN32) -void NDECL(startup); +void startup(void); unsigned _stklen = STKSIZ; #endif @@ -82,9 +82,7 @@ unsigned _stklen = STKSIZ; */ #ifndef __MINGW32__ int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { boolean resuming; @@ -105,9 +103,7 @@ char *argv[]; #endif boolean -pcmain(argc, argv) -int argc; -char *argv[]; +pcmain(int argc, char *argv[]) { register int fd; register char *dir; @@ -558,9 +554,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ } STATIC_OVL void -process_options(argc, argv) -int argc; -char *argv[]; +process_options(int argc, char *argv[]) { int i; @@ -748,9 +742,7 @@ nhusage() #ifdef CHDIR void -chdirx(dir, wr) -char *dir; -boolean wr; +chdirx(char *dir, boolean wr) { #ifdef AMIGA static char thisdir[] = ""; @@ -832,8 +824,7 @@ exename() char exepathbuf[EXEPATHBUFSZ]; char * -exepath(str) -char *str; +exepath(char *str) { char *tmp, *tmp2; int bsize; diff --git a/sys/share/pcsys.c b/sys/share/pcsys.c index 47f74a717b..74795c908e 100644 --- a/sys/share/pcsys.c +++ b/sys/share/pcsys.c @@ -28,11 +28,11 @@ #endif #if defined(MICRO) || defined(WIN32) || defined(OS2) -void FDECL(nethack_exit, (int)); +void nethack_exit(int); #else #define nethack_exit exit #endif -STATIC_DCL void NDECL(msexit); +STATIC_DCL void msexit(void); #ifdef MOVERLAY extern void __far __cdecl _movepause(void); @@ -44,9 +44,9 @@ extern unsigned short __far __cdecl _movefpaused; #endif /* MOVERLAY */ #ifdef MFLOPPY -STATIC_DCL boolean NDECL(record_exists); +STATIC_DCL boolean record_exists(void); #ifndef TOS -STATIC_DCL boolean NDECL(comspec_exists); +STATIC_DCL boolean comspec_exists(void); #endif #endif @@ -139,8 +139,7 @@ dosh() #ifdef MFLOPPY void -eraseall(path, files) -const char *path, *files; +eraseall(const char *path, const char *files) { char buf[PATHLEN]; char *foundfile; @@ -159,8 +158,7 @@ const char *path, *files; * Rewritten for version 3.3 to be faster */ void -copybones(mode) -int mode; +copybones(int mode) { char from[PATHLEN], to[PATHLEN], last[13]; char *frompath, *topath; @@ -271,8 +269,7 @@ playwoRAMdisk() } int -saveDiskPrompt(start) -int start; +saveDiskPrompt(int start) { char buf[BUFSIZ], *bp; char qbuf[QBUFSZ]; @@ -375,8 +372,7 @@ gameDiskPrompt() * be room for the \ */ void -append_slash(name) -char *name; +append_slash(char *name) { char *ptr; @@ -396,8 +392,7 @@ int redirect_stdout; #endif void -getreturn(str) -const char *str; +getreturn(const char *str) { #ifdef WIN32 if (!getreturn_enabled) @@ -414,18 +409,17 @@ const char *str; } #ifndef WIN32 -void msmsg -VA_DECL(const char *, fmt) +void msmsg(const char *fmt, ...) { - VA_START(fmt); - VA_INIT(fmt, const char *); + va_list the_args; + va_start(the_args, fmt); #if defined(MSDOS) && defined(NO_TERMS) if (iflags.grmode) gr_finish(); #endif - Vprintf(fmt, VA_ARGS); + Vprintf(fmt, the_args); flushout(); - VA_END(); + va_end(the_args); return; } #endif @@ -444,8 +438,7 @@ VA_DECL(const char *, fmt) #endif FILE * -fopenp(name, mode) -const char *name, *mode; +fopenp(const char *name, const char *mode) { char buf[BUFSIZ], *bp, *pp, lastch = 0; FILE *fp; @@ -493,8 +486,7 @@ const char *name, *mode; #if defined(MICRO) || defined(WIN32) || defined(OS2) void -nethack_exit(code) -int code; +nethack_exit(int code) { msexit(); exit(code); diff --git a/sys/share/pctty.c b/sys/share/pctty.c index 567ac0368c..0c2f404855 100644 --- a/sys/share/pctty.c +++ b/sys/share/pctty.c @@ -32,8 +32,7 @@ gettty() /* reset terminal to original state */ void -settty(s) -const char *s; +settty(const char *s) { #if defined(MSDOS) && defined(NO_TERMS) gr_finish(); @@ -55,8 +54,7 @@ setftty() #if defined(TIMED_DELAY) && defined(_MSC_VER) void -msleep(mseconds) -unsigned mseconds; +msleep(unsigned mseconds) { /* now uses clock() which is ANSI C */ clock_t goal; @@ -71,18 +69,17 @@ unsigned mseconds; /* fatal error */ /*VARARGS1*/ -void error -VA_DECL(const char *, s) +void error(const char *s, ...) { - VA_START(s); - VA_INIT(s, const char *); + va_list the_args; + va_start(the_args, s); /* error() may get called before tty is initialized */ if (iflags.window_inited) end_screen(); putchar('\n'); - Vprintf(s, VA_ARGS); + Vprintf(s, the_args); putchar('\n'); - VA_END(); + va_end(the_args); exit(EXIT_FAILURE); } diff --git a/sys/share/pcunix.c b/sys/share/pcunix.c index 5fcc3210bf..8caef3b5f0 100644 --- a/sys/share/pcunix.c +++ b/sys/share/pcunix.c @@ -15,9 +15,9 @@ #if defined(WIN32) || defined(MSDOS) extern char orgdir[]; #ifdef WIN32 -extern void NDECL(backsp); +extern void backsp(void); #endif -extern void NDECL(clear_screen); +extern void clear_screen(void); #endif #if 0 @@ -29,13 +29,12 @@ static struct stat hbuf; #endif #ifdef PC_LOCKING -static int NDECL(eraseoldlocks); +static int eraseoldlocks(void); #endif #if 0 int -uptodate(fd) -int fd; +uptodate(int fd) { #ifdef WANT_GETHDATE if(fstat(fd, &buf)) { @@ -270,12 +269,11 @@ getlock() #ifndef WIN32 void -regularize(s) +regularize(register char *s) /* * normalize file name - we don't like .'s, /'s, spaces, and * lots of other things */ -register char *s; { register char *lp; diff --git a/sys/share/pmatchregex.c b/sys/share/pmatchregex.c index d41e441c1b..6dca6278d1 100644 --- a/sys/share/pmatchregex.c +++ b/sys/share/pmatchregex.c @@ -30,9 +30,7 @@ regex_init() } boolean -regex_compile(s, re) -const char *s; -struct nhregex *re; +regex_compile(const char *s, struct nhregex *re) { if (!re) return FALSE; @@ -44,16 +42,13 @@ struct nhregex *re; } const char * -regex_error_desc(re) -struct nhregex *re UNUSED; +regex_error_desc(struct nhregex *re UNUSED) { return "pattern match compilation error"; } boolean -regex_match(s, re) -const char *s; -struct nhregex *re; +regex_match(const char *s, struct nhregex *re) { if (!re || !re->pat || !s) return FALSE; @@ -62,8 +57,7 @@ struct nhregex *re; } void -regex_free(re) -struct nhregex *re; +regex_free(struct nhregex *re) { if (re) { if (re->pat) diff --git a/sys/share/random.c b/sys/share/random.c index 6d3d5e45cc..3522091ef0 100644 --- a/sys/share/random.c +++ b/sys/share/random.c @@ -199,9 +199,7 @@ static long *end_ptr = &randtbl[DEG_3 + 1]; */ void -srandom(x) - -unsigned x; +srandom(unsigned x) { register int i; @@ -236,11 +234,9 @@ unsigned x; */ char * -initstate(seed, arg_state, n) - -unsigned seed; /* seed for R. N. G. */ -char *arg_state; /* pointer to state array */ -int n; /* # bytes of state info */ +initstate(unsigned seed, /* seed for R. N. G. */ + char *arg_state, /* pointer to state array */ + int n) /* # bytes of state info */ { register char *ostate = (char *) (&state[-1]); @@ -304,9 +300,7 @@ int n; /* # bytes of state info */ */ char * -setstate(arg_state) - -char *arg_state; +setstate(char *arg_state) { register long *new_state = (long *) arg_state; register int type = new_state[0] % MAX_TYPES; diff --git a/sys/share/tclib.c b/sys/share/tclib.c index c158741e53..02e1b82140 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)) @@ -60,9 +60,8 @@ static const char *FDECL(tc_field, (const char *, const char **)); /* retrieve the specified terminal entry and return it in `entbuf' */ int -tgetent(entbuf, term) -char *entbuf; /* size must be at least [TCBUFSIZ] */ -const char *term; +tgetent(char *entbuf, /* size must be at least [TCBUFSIZ] */ + const char *term) { int result; FILE *fp; @@ -96,8 +95,7 @@ const char *term; /* copy the entry into the output buffer */ static int -tc_store(trm, ent) -const char *trm, *ent; +tc_store(const char *trm, const char *ent) { const char *bar, *col; char *s; @@ -137,11 +135,7 @@ const char *trm, *ent; /* search for an entry in the termcap file */ static char * -tc_find(fp, term, buffer, bufsiz) -FILE *fp; -const char *term; -char *buffer; -int bufsiz; +tc_find(FILE *fp, const char *term, char *buffer, int bufsiz) { int in, len, first, skip; char *ip, *op, *tc_fetch, tcbuf[TCBUFSIZ]; @@ -198,9 +192,7 @@ int bufsiz; /* check whether `ent' contains `nam'; return start of field entries */ static char * -tc_name(nam, ent) -const char *nam; -char *ent; +tc_name(const char *nam, char *ent) { char *nxt, *lst, *p = ent; size_t n = strlen(nam); @@ -220,8 +212,7 @@ char *ent; /* look up a numeric entry */ int -tgetnum(which) -const char *which; +tgetnum(const char *which) { const char *q, *p = tc_field(which, &q); char numbuf[32]; @@ -239,8 +230,7 @@ const char *which; /* look up a boolean entry */ int -tgetflag(which) -const char *which; +tgetflag(const char *which) { const char *p = tc_field(which, (const char **) 0); @@ -249,9 +239,7 @@ const char *which; /* look up a string entry; update `*outptr' */ char * -tgetstr(which, outptr) -const char *which; -char **outptr; +tgetstr(const char *which, char **outptr) { int n; char c, *r, *result; @@ -326,9 +314,7 @@ char **outptr; /* look for a particular field name */ static const char * -tc_field(field, tc_end) -const char *field; -const char **tc_end; +tc_field(const char *field, const char **tc_end) { const char *end, *q, *p = tc_entry; @@ -356,20 +342,17 @@ static char cmbuf[64]; /* produce a string which will position the cursor at if output */ char * -tgoto(cm, col, row) -const char *cm; -int col, row; +tgoto(const char *cm, int col, int row) { return tparam(cm, cmbuf, (int) (sizeof cmbuf), row, col, 0, 0); } /* format a parameterized string, ala sprintf */ char * -tparam(ctl, buf, buflen, row, col, row2, col2) -const char *ctl; /* parameter control string */ -char *buf; /* output buffer */ -int buflen; /* ought to have been `size_t'... */ -int row, col, row2, col2; +tparam(const char *ctl, /* parameter control string */ + char *buf, /* output buffer */ + int buflen, /* ought to have been `size_t'... */ + int row, int col, int row2, int col2) { int atmp, ac, av[5]; char c, *r, *z, *bufend, numbuf[32]; @@ -501,10 +484,9 @@ int row, col, row2, col2; /* send a string to the terminal, possibly padded with trailing NULs */ void -tputs(string, range, output_func) -const char *string; /* characters to output */ -int range; /* number of lines affected, used for `*' delays */ -int (*output_func)(); /* actual output routine; return value ignored */ +tputs(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; diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c index 55e362f663..dba8e853c7 100644 --- a/sys/share/unixtty.c +++ b/sys/share/unixtty.c @@ -141,8 +141,7 @@ struct termstruct inittyb, curttyb; #ifdef POSIX_TYPES static int -speednum(speed) -speed_t speed; +speednum(speed_t speed) { switch (speed) { case B0: @@ -218,8 +217,7 @@ gettty() /* reset terminal to original state */ void -settty(s) -const char *s; +settty(const char *s) { end_screen(); if (s) @@ -335,10 +333,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); +void sco_mapoff(void); +void check_sco_console(void); +void init_sco_cons(void); void sco_mapon() @@ -399,10 +397,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); +void linux_mapoff(void); +void check_linux_console(void); +void init_linux_cons(void); void linux_mapon() @@ -453,16 +451,15 @@ init_linux_cons() #ifndef __begui__ /* the Be GUI will define its own error proc */ /* fatal error */ /*VARARGS1*/ -void error -VA_DECL(const char *, s) +void error(const char *s, ...) { - VA_START(s); - VA_INIT(s, const char *); + va_list the_args; + va_start(the_args, s); if (settty_needed) settty((char *) 0); - Vprintf(s, VA_ARGS); + Vprintf(s, the_args); (void) putchar('\n'); - VA_END(); + va_end(the_args); exit(EXIT_FAILURE); } #endif /* !__begui__ */ diff --git a/sys/share/uudecode.c b/sys/share/uudecode.c index b998e4698e..a9af0bfef4 100644 --- a/sys/share/uudecode.c +++ b/sys/share/uudecode.c @@ -88,9 +88,7 @@ static void outdec(char *, FILE *, int); #define DEC(c) (((c) - ' ') & 077) int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { FILE *in, *out; int mode; @@ -179,9 +177,7 @@ char **argv; * copy from in to out, decoding as you go along. */ void -decode(in, out) -FILE *in; -FILE *out; +decode(FILE *in, FILE *out) { char buf[80]; char *bp; @@ -218,10 +214,7 @@ FILE *out; * output all of them at the end of the file. */ void -outdec(p, f, n) -char *p; -FILE *f; -int n; +outdec(char *p, FILE *f, int n) { int c1, c2, c3; @@ -247,8 +240,7 @@ int n; #endif char * -index(sp, c) -register char *sp, c; +index(register char *sp, register char c) { do { if (*sp == c) diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 506618f14c..35211355fb 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -18,36 +18,34 @@ #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); #endif /* CHDIR */ -static boolean NDECL(whoami); -static void FDECL(process_options, (int, char **)); +static boolean whoami(void); +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(void); +extern void init_sco_cons(void); #endif #ifdef __linux__ -extern void NDECL(check_linux_console); -extern void NDECL(init_linux_cons); +extern void check_linux_console(void); +extern void init_linux_cons(void); #endif -static void NDECL(wd_message); +static void wd_message(void); static boolean wiz_error_flag = FALSE; -static struct passwd *NDECL(get_unix_pw); +static struct passwd *get_unix_pw(void); int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { register int fd; #ifdef CHDIR @@ -323,9 +321,7 @@ char *argv[]; } static void -process_options(argc, argv) -int argc; -char *argv[]; +process_options(int argc, char *argv[]) { int i, l; @@ -437,9 +433,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 @@ -527,8 +521,7 @@ whoami() } void -sethanguphandler(handler) -void FDECL((*handler), (int)); +sethanguphandler(void (*handler)(int)) { #ifdef SA_RESTART /* don't want reads to restart. If SA_RESTART is defined, we know @@ -599,8 +592,7 @@ wd_message() * be room for the / */ void -append_slash(name) -char *name; +append_slash(char *name) { char *ptr; @@ -615,8 +607,7 @@ char *name; } boolean -check_user_string(optstr) -char *optstr; +check_user_string(char *optstr) { struct passwd *pw = get_unix_pw(); int pwlen; diff --git a/sys/unix/unixres.c b/sys/unix/unixres.c index c60df76694..cef6a8d02c 100644 --- a/sys/unix/unixres.c +++ b/sys/unix/unixres.c @@ -24,8 +24,7 @@ #include static int -real_getresuid(ruid, euid, suid) -uid_t *ruid, *euid, *suid; +real_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) { int (*f)(uid_t *, uid_t *, uid_t *); /* getresuid signature */ @@ -37,8 +36,7 @@ uid_t *ruid, *euid, *suid; } static int -real_getresgid(rgid, egid, sgid) -gid_t *rgid, *egid, *sgid; +real_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) { int (*f)(gid_t *, gid_t *, gid_t *); /* getresgid signature */ @@ -55,8 +53,7 @@ gid_t *rgid, *egid, *sgid; #ifdef SYS_getresuid static int -real_getresuid(ruid, euid, suid) -uid_t *ruid, *euid, *suid; +real_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) { return syscall(SYS_getresuid, ruid, euid, suid); } @@ -68,8 +65,7 @@ uid_t *ruid, *euid, *suid; #endif /* SVR4 */ static int -real_getresuid(ruid, euid, suid) -uid_t *ruid, *euid, *suid; +real_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) { int retval; int pfd[2]; @@ -92,8 +88,7 @@ uid_t *ruid, *euid, *suid; #ifdef SYS_getresgid static int -real_getresgid(rgid, egid, sgid) -gid_t *rgid, *egid, *sgid; +real_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) { return syscall(SYS_getresgid, rgid, egid, sgid); } @@ -101,8 +96,7 @@ gid_t *rgid, *egid, *sgid; #else /* SYS_getresgid */ static int -real_getresgid(rgid, egid, sgid) -gid_t *rgid, *egid, *sgid; +real_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) { int retval; int pfd[2]; @@ -131,8 +125,7 @@ static unsigned int hiding_privileges = 0; */ int -hide_privileges(flag) -boolean flag; +hide_privileges(boolean flag) { if (flag) hiding_privileges++; @@ -142,8 +135,7 @@ boolean flag; } int -nh_getresuid(ruid, euid, suid) -uid_t *ruid, *euid, *suid; +nh_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) { int retval = real_getresuid(ruid, euid, suid); if (!retval && hiding_privileges) @@ -170,8 +162,7 @@ nh_geteuid() } int -nh_getresgid(rgid, egid, sgid) -gid_t *rgid, *egid, *sgid; +nh_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) { int retval = real_getresgid(rgid, egid, sgid); if (!retval && hiding_privileges) @@ -201,8 +192,7 @@ nh_getegid() #ifdef GNOME_GRAPHICS int -hide_privileges(flag) -boolean flag; +hide_privileges(boolean flag) { return 0; } diff --git a/sys/unix/unixunix.c b/sys/unix/unixunix.c index d02d70c636..3ca2d36338 100644 --- a/sys/unix/unixunix.c +++ b/sys/unix/unixunix.c @@ -14,12 +14,12 @@ #include #ifdef _M_UNIX -extern void NDECL(sco_mapon); -extern void NDECL(sco_mapoff); +extern void sco_mapon(void); +extern void sco_mapoff(void); #endif #ifdef __linux__ -extern void NDECL(linux_mapon); -extern void NDECL(linux_mapoff); +extern void linux_mapon(void); +extern void linux_mapoff(void); #endif #ifndef NHSTDC @@ -30,8 +30,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; @@ -207,8 +206,7 @@ getlock() } } -void regularize(s) /* normalize file name - we don't like .'s, /'s, spaces */ -register char *s; +void regularize(register char *s) /* normalize file name - we don't like .'s, /'s, spaces */ { register char *lp; @@ -242,8 +240,7 @@ register char *s; #include void -msleep(msec) -unsigned msec; /* milliseconds */ +msleep(unsigned msec) /* milliseconds */ { struct pollfd unused; int msecs = msec; /* poll API is signed */ @@ -280,8 +277,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() */ @@ -331,15 +327,14 @@ int wt; #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(void); +extern uid_t nh_geteuid(void); +extern int nh_getresgid(gid_t *, gid_t *, gid_t *); +extern gid_t nh_getgid(void); +extern gid_t nh_getegid(void); -int(getresuid)(ruid, euid, suid) -uid_t *ruid, *euid, *suid; +int(getresuid)(uid_t *ruid, uid_t *euid, uid_t *suid) { return nh_getresuid(ruid, euid, suid); } @@ -354,8 +349,7 @@ uid_t(geteuid)() return nh_geteuid(); } -int(getresgid)(rgid, egid, sgid) -gid_t *rgid, *egid, *sgid; +int(getresgid)(gid_t *rgid, gid_t *egid, gid_t *sgid) { return nh_getresgid(rgid, egid, sgid); } diff --git a/sys/vms/oldcrtl.c b/sys/vms/oldcrtl.c index 40a30127ba..5622afb254 100644 --- a/sys/vms/oldcrtl.c +++ b/sys/vms/oldcrtl.c @@ -23,10 +23,7 @@ /* void *memset(void *, int, size_t) -- fill chunk of memory. */ char * -memset(dst, fil, cnt) -REG char *dst; -REG char fil; -REG int cnt; +memset(REG char *dst, REG char fil, REG int cnt) { char *dst_p = dst; while (--cnt >= 0) @@ -37,10 +34,7 @@ REG int cnt; /* void *memcpy(void *, const void *, size_t) -- copy chunk of memory. */ char * -memcpy(dst, src, cnt) -REG char *dst; -REG const char *src; -REG int cnt; +memcpy(REG char *dst, REG const char *src, REG int cnt) { char *dst_p = dst; while (--cnt >= 0) @@ -52,10 +46,7 @@ REG int cnt; * mem. */ char * -memmove(dst, src, cnt) -REG char *dst; -REG const char *src; -REG int cnt; +memmove(REG char *dst, REG const char *src, REG int cnt) { char *dst_p = dst; if (src == dst || cnt <= 0) { @@ -74,10 +65,7 @@ REG int cnt; /* void *memchr(const void *, int, size_t) -- search for a byte. */ char * -memchr(buf, byt, len) -REG const char *buf; -REG char byt; -REG int len; +memchr(REG const char *buf, REG char byt, REG int len) { while (--len >= 0) if (*buf++ == byt) /* found */ @@ -88,10 +76,7 @@ REG int len; /* int memcmp(const void *, const void *, size_t) -- compare two chunks. */ int -memcmp(buf1, buf2, len) -REG const char *buf1; -REG const char *buf2; -REG int len; +memcmp(REG const char *buf1, REG const char *buf2, REG int len) { while (--len >= 0) if (*buf1++ != *buf2++) @@ -115,8 +100,7 @@ static struct { extern unsigned long sys$dclexh(); int -atexit(function) -void (*function)(); /* note: actually gets called with 1 arg */ +atexit(void (*function)()) /* note: actually gets called with 1 arg */ { if (ex_cnt < MAX_EXIT_FUNCS) { ex_data[ex_cnt].dummy_arg = 0; /* ultimately receives exit reason */ @@ -142,9 +126,7 @@ void (*function)(); /* note: actually gets called with 1 arg */ extern unsigned long lib$rename_file(); int -rename(old_name, new_name) -const char *old_name; -const char *new_name; +rename(const char *old_name, const char *new_name) { struct dsc { unsigned short len, mbz; @@ -172,11 +154,7 @@ extern char *malloc(); /* assume no alloca() available */ extern void free(); void -qsort(base, count, size, compare) -char *base; -int count; -REG int size; -int (*compare)(); +qsort(char *base, int count, REG int size, int (*compare)()) { REG int i, cmp; REG char *next, *prev, *tmp = 0; diff --git a/sys/vms/vmsfiles.c b/sys/vms/vmsfiles.c index a2a98a28a2..6a6afc43c0 100644 --- a/sys/vms/vmsfiles.c +++ b/sys/vms/vmsfiles.c @@ -10,11 +10,11 @@ #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)); -boolean FDECL(same_dir, (const char *, const char *)); -int FDECL(c__translate, (int)); +int vms_link(const char *, const char *); +int vms_unlink(const char *); +int vms_creat(const char *, unsigned int); +boolean same_dir(const char *, const char *); +int c__translate(int); #include #if 0 @@ -27,15 +27,14 @@ int FDECL(c__translate, (int)); #define C$$TRANSLATE(status) (errno = EVMSERR, vaxc$errno = (status)) #endif extern unsigned long sys$parse(), sys$search(), sys$enter(), sys$remove(); -extern int VDECL(lib$match_cond, (int, int, ...)); +extern int lib$match_cond(int, int, ...); #define vms_success(sts) ((sts) &1) /* odd, */ #define vms_failure(sts) (!vms_success(sts)) /* even */ /* vms_link() -- create an additional directory for an existing file */ int -vms_link(file, new) -const char *file, *new; +vms_link(const char *file, const char *new) { struct FAB fab; struct NAM nam; @@ -82,8 +81,7 @@ const char *file, *new; (because the file won't be deleted, just made inaccessible!). */ int -vms_unlink(file) -const char *file; +vms_unlink(const char *file) { struct FAB fab; struct NAM nam; @@ -114,9 +112,7 @@ const char *file; */ #undef creat int -vms_creat(file, mode) -const char *file; -unsigned int mode; +vms_creat(const char *file, unsigned int mode) { char filnambuf[BUFSIZ]; /*(not BUFSZ)*/ @@ -140,10 +136,7 @@ unsigned int mode; */ #undef open int -vms_open(file, flags, mode) -const char *file; -int flags; -unsigned int mode; +vms_open(const char *file, int flags, unsigned int mode) { char filnambuf[BUFSIZ]; /*(not BUFSZ)*/ int fd; @@ -164,8 +157,7 @@ unsigned int mode; /* do likewise for fopen() */ #undef fopen FILE * -vms_fopen(file, mode) -const char *file, *mode; +vms_fopen(const char *file, const char *mode) { char filnambuf[BUFSIZ]; /*(not BUFSZ)*/ FILE *fp; @@ -190,8 +182,7 @@ const char *file, *mode; the command line). This version doesn't handle Unix-style file specs. */ boolean -same_dir(d1, d2) -const char *d1, *d2; +same_dir(const char *d1, const char *d2) { if (!d1 || !*d1 || !d2 || !*d2) return FALSE; @@ -246,8 +237,7 @@ const char *d1, *d2; #define CASE2(V, W) CASE1(V) : CASE1(W) int -c__translate(code) -int code; +c__translate(int code) { register int trans; @@ -296,8 +286,7 @@ static char base_name[NAM$C_MAXRSS + 1]; /* return a copy of the 'base' portion of a filename */ char * -vms_basename(name) -const char *name; +vms_basename(const char *name) { unsigned len; char *base, *base_p; diff --git a/sys/vms/vmsmail.c b/sys/vms/vmsmail.c index e62d2dca9f..f8f0a7ca45 100644 --- a/sys/vms/vmsmail.c +++ b/sys/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(void); +unsigned long enable_broadcast_trapping(void); +unsigned long disable_broadcast_trapping(void); +struct mail_info *parse_next_broadcast(void); #ifdef MAIL #include "wintype.h" @@ -27,17 +27,17 @@ 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(void); +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 *, ...)); +extern int sscanf(const char *, const char *, ...); #endif extern unsigned long smg$create_pasteboard(), smg$get_broadcast_message(), smg$set_broadcast_trapping(), smg$disable_broadcast_trapping(); @@ -107,8 +107,8 @@ static char nam_buf[63], /* maximum onamelth, size of ONAME(object) */ /* try to decipher and categorize broadcast message text */ static struct mail_info * -parse_brdcst(buf) /* called by parse_next_broadcast() */ -char *buf; /* input: filtered broadcast text */ +parse_brdcst(char *buf) /* called by parse_next_broadcast() */ + /* input: filtered broadcast text */ { int typ; char *txt; @@ -292,8 +292,8 @@ char *buf; /* input: filtered broadcast text */ /* filter out non-printable characters and redundant noise */ -static void filter_brdcst(buf) /* called by parse_next_broadcast() */ -register char *buf; /* in: original text; out: filtered text */ +static void filter_brdcst(register char *buf) /* called by parse_next_broadcast() */ + /* in: original text; out: filtered text */ { register char c, *p, *buf_p; @@ -374,8 +374,7 @@ static void flush_broadcasts() /* called from disable_broadcast_trapping() */ */ /*ARGSUSED*/ static void -broadcast_ast(dummy) /* called asynchronously by terminal driver */ -int dummy; /* not used */ +broadcast_ast(int dummy /* not used */) /* called asynchronously by terminal driver */ { broadcasts++; } @@ -468,8 +467,7 @@ parse_next_broadcast() volatile int broadcasts = 0; void -newmail(foo) -struct mail_info *foo; +newmail(struct mail_info *foo) { #define STRING(s) ((s) ? (s) : "") printf("\n\ @@ -519,16 +517,14 @@ main() } void -panic(s) -char *s; +panic(char *s) { raw_print(s); exit(EXIT_FAILURE); } void -raw_print(s) -char *s; +raw_print(char *s) { puts(s); fflush(stdout); diff --git a/sys/vms/vmsmain.c b/sys/vms/vmsmain.c index ccc32d9bfe..104c114283 100644 --- a/sys/vms/vmsmain.c +++ b/sys/vms/vmsmain.c @@ -8,9 +8,9 @@ #include -static void NDECL(whoami); -static void FDECL(process_options, (int, char **)); -static void NDECL(byebye); +static void whoami(void); +static void process_options(int, char **); +static void byebye(void); #ifndef SAVE_ON_FATAL_ERROR #ifndef __DECC #define vms_handler_type int @@ -19,17 +19,15 @@ static void NDECL(byebye); #endif extern void FDECL(VAXC$ESTABLISH, (vms_handler_type (*) (genericptr_t, genericptr_t))); -static vms_handler_type FDECL(vms_handler, (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(void); static boolean wiz_error_flag = FALSE; int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { register int fd; #ifdef CHDIR @@ -229,9 +227,7 @@ char *argv[]; } static void -process_options(argc, argv) -int argc; -char *argv[]; +process_options(int argc, char *argv[]) { int i; @@ -323,9 +319,7 @@ char *argv[]; #ifdef CHDIR void -chdirx(dir, wr) -const char *dir; -boolean wr; +chdirx(const char *dir, boolean wr) { #ifndef HACKDIR static const char *defdir = "."; @@ -374,7 +368,7 @@ whoami() static void byebye() { - void FDECL((*hup), (int) ); + void (*hup)(int) ); #ifdef SHELL extern unsigned long dosh_pid, mail_pid; extern unsigned long FDECL(sys$delprc, @@ -404,9 +398,9 @@ byebye() /* Condition handler to prevent byebye's hangup simulation from saving the game after a fatal error has occurred. */ /*ARGSUSED*/ -static vms_handler_type /* should be `unsigned long', but the -*/ - vms_handler(sigargs, mechargs) /*+ prototype in is screwed */ -genericptr_t sigargs, mechargs; /* [0] is argc, [1..argc] are the real args */ +static vms_handler_type /* should be `unsigned long', but the -*/ + vms_handler(genericptr_t sigargs, /*+ prototype in is screwed */ + genericptr_t mechargs) /* [0] is argc, [1..argc] are the real args */ { unsigned long condition = ((unsigned long *) sigargs)[1]; @@ -424,8 +418,7 @@ genericptr_t sigargs, mechargs; /* [0] is argc, [1..argc] are the real args */ #endif void -sethanguphandler(handler) -void FDECL((*handler), (int)); +sethanguphandler(void (*handler)(int)) { (void) signal(SIGHUP, (SIG_RET_TYPE) handler); } diff --git a/sys/vms/vmsmisc.c b/sys/vms/vmsmisc.c index 02c7fe7001..6c1ae1151c 100644 --- a/sys/vms/vmsmisc.c +++ b/sys/vms/vmsmisc.c @@ -8,16 +8,15 @@ int debuggable = 0; /* 1 if we can debug or show a call trace */ -void FDECL(vms_exit, (int)); -void NDECL(vms_abort); +void vms_exit(int); +void vms_abort(void); /* first arg should be unsigned long but has unsigned int */ -extern void VDECL(lib$signal, (unsigned, ...)); +extern void lib$signal(unsigned, ...); /* terminate, converting Unix-style exit code into VMS status code */ void -vms_exit(status) -int status; +vms_exit(int status) { /* convert non-zero to failure, zero to success */ exit(status ? (SS$_ABORT | STS$M_INHIB_MSG) : SS$_NORMAL); diff --git a/sys/vms/vmstty.c b/sys/vms/vmstty.c index d115a84919..945bf02e53 100644 --- a/sys/vms/vmstty.c +++ b/sys/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(void); +static void resettty(void); #define vms_ok(sts) ((sts) &1) #define META(c) ((c) | 0x80) /* 8th bit */ @@ -103,7 +103,7 @@ static unsigned long tt_char_restore = 0, tt_char_active = 0, static unsigned long ctrl_mask = 0; #ifdef DEBUG -extern int NDECL(nh_vms_getchar); +extern int nh_vms_getchar(void); /* rename the real vms_getchar and interpose this one in front of it */ int @@ -281,8 +281,7 @@ static const char *arrow_or_PF = "ABCDPQRS", /* suffix char */ /* Ultimate return value is (index into smg_keypad_codes[] + 256). */ static short -parse_function_key(c) -register int c; +parse_function_key(register int c) { struct _rd_iosb iosb; unsigned long sts; @@ -440,8 +439,7 @@ gettty() /* reset terminal to original state */ void -settty(s) -const char *s; +settty(const char *s) { if (!bombing) end_screen(); @@ -468,8 +466,7 @@ const char *s; /* same as settty, with no clearing of the screen */ void -shuttty(s) -const char *s; +shuttty(const char *s) { bombing = TRUE; settty(s); @@ -514,8 +511,8 @@ void introff() /* disable kbd interrupts if required*/ #ifdef TIMED_DELAY -extern unsigned long FDECL(lib$emul, (const long *, const long *, - const long *, long *)); +extern unsigned 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 */ @@ -525,8 +522,7 @@ static const long mseconds_to_delta = VMS_UNITS_PER_SECOND / 1000L * -1L; /* sleep for specified number of milliseconds (note: the timer used generally only has 10-millisecond resolution at the hardware level...) */ void -msleep(mseconds) -unsigned mseconds; /* milliseconds */ +msleep(unsigned mseconds) /* milliseconds */ { long pid = 0L, zero = 0L, msec, qtime[2]; @@ -544,20 +540,19 @@ unsigned mseconds; /* milliseconds */ /* fatal error */ /*VARARGS1*/ -void error -VA_DECL(const char *, s) +void error(const char *s, ...) { - VA_START(s); - VA_INIT(s, const char *); + va_list the_args; + va_start(the_args, s); if (settty_needed) settty((char *) 0); - Vprintf(s, VA_ARGS); + Vprintf(s, the_args); (void) putchar('\n'); VA_END(); #ifndef SAVE_ON_FATAL_ERROR /* prevent vmsmain's exit handler byebye() from calling hangup() */ - sethanguphandler((void FDECL((*), (int) )) SIG_DFL); + sethanguphandler((void ((*)(int) )) SIG_DFL); #endif exit(EXIT_FAILURE); } diff --git a/sys/vms/vmsunix.c b/sys/vms/vmsunix.c index 0a9edb4d47..6352550e7e 100644 --- a/sys/vms/vmsunix.c +++ b/sys/vms/vmsunix.c @@ -24,7 +24,7 @@ extern int debuggable; /* defined in vmsmisc.c */ -extern void VDECL(lib$signal, (unsigned, ...)); +extern void lib$signal(unsigned, ...); extern unsigned long sys$setprv(); extern unsigned long lib$getdvi(), lib$getjpi(), lib$spawn(), lib$attach(); extern unsigned long smg$init_term_table_by_type(), smg$del_term_table(); @@ -33,18 +33,17 @@ extern unsigned long smg$init_term_table_by_type(), smg$del_term_table(); /* this could be static; it's only used within this file; it won't be used at all if C_LIB$INTIALIZE gets commented out below, so make it global so that compiler won't complain that it's not used */ -int FDECL(vmsexeini, (const void *, const void *, const unsigned char *)); +int vmsexeini(const void *, const void *, const unsigned char *); -static int FDECL(veryold, (int)); -static char *NDECL(verify_term); +static int veryold(int); +static char *verify_term(void); #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, const char *); +static void hack_resume(boolean); #endif static int -veryold(fd) -int fd; +veryold(int fd) { register int i; time_t date; @@ -153,8 +152,7 @@ getlock() } } -void regularize(s) /* normalize file name */ -register char *s; +void regularize(register char *s) /* normalize file name */ { register char *lp; @@ -175,8 +173,7 @@ vms_getuid() #endif /* check whether the open file specified by `fd' is in stream-lf format */ boolean -file_is_stmlf(fd) -int fd; +file_is_stmlf(int fd) { int rfm; struct stat buf; @@ -204,10 +201,7 @@ int fd; /* vms_define() - assign a value to a logical name */ int -vms_define(name, value, flag) -const char *name; -const char *value; -int flag; +vms_define(const char *name, const char *value, int flag) { struct dsc { unsigned short len, mbz; @@ -250,8 +244,7 @@ int flag; /* vms_putenv() - create or modify an environment value */ int -vms_putenv(string) -const char *string; +vms_putenv(const char *string) { char name[ENVSIZ + 1], value[ENVSIZ + 1], *p; /* [255+1] */ @@ -374,9 +367,7 @@ privon() #if defined(SHELL) || defined(SUSPEND) static void -hack_escape(screen_manip, msg_str) -boolean screen_manip; -const char *msg_str; +hack_escape(boolean screen_manip, const char *msg_str) { if (screen_manip) suspend_nhwindows(msg_str); /* clear screen, reset terminal, &c */ @@ -385,8 +376,7 @@ const char *msg_str; } static void -hack_resume(screen_manip) -boolean screen_manip; +hack_resume(boolean screen_manip) { (void) signal(SIGINT, (SIG_RET_TYPE) done1); if (wizard) @@ -423,9 +413,7 @@ dosh() /* will be piped into oblivion. Used for silent phone call rejection. */ int -vms_doshell(execstring, screenoutput) -const char *execstring; -boolean screenoutput; +vms_doshell(const char *execstring, boolean screenoutput) { unsigned long status, new_pid, spawnflags = 0; struct dsc$descriptor_s comstring, *command, *inoutfile = 0; @@ -520,13 +508,10 @@ dosuspend() /* this would fit better in vmsfiles.c except that that gets linked with the utility programs and we don't want this code there */ -static void FDECL(savefile, (const char *, int, int *, char ***)); +static void savefile(const char *, int, int *, char ***); static void -savefile(name, indx, asize, array) -const char *name; -int indx, *asize; -char ***array; +savefile(const char *name, int indx, int *asize, char ***array) { char **newarray; int i, oldsize; @@ -551,15 +536,14 @@ struct dsc { char *adr; }; /* descriptor */ typedef unsigned long vmscond; /* vms condition value */ -vmscond FDECL(lib$find_file, - (const struct dsc *, struct dsc *, genericptr *)); -vmscond FDECL(lib$find_file_end, (void **)); +vmscond lib$find_file + (const struct dsc *, struct dsc *, genericptr *); +vmscond lib$find_file_end(void **); /* collect a list of character names from all save files for this player */ int -vms_get_saved_games(savetemplate, outarray) -const char *savetemplate; /* wildcarded save file name in native VMS format */ -char ***outarray; +vms_get_saved_games(const char *savetemplate, /* wildcarded save file name in native VMS format */ + char ***outarray) { struct dsc in, out; unsigned short l; @@ -597,8 +581,7 @@ char ***outarray; /* nethack has detected an internal error; try to give a trace of call stack */ void -vms_traceback(how) -int how; /* 1: exit after traceback; 2: stay in debugger */ +vms_traceback(int how) /* 1: exit after traceback; 2: stay in debugger */ { /* assumes that a static initializer applies to the first union field and that no padding will be placed between len and str */ @@ -673,16 +656,16 @@ int how; /* 1: exit after traceback; 2: stay in debugger */ * It all takes place before nethack even starts, and sets up * `debuggable' to control possible use of lib$signal(SS$_DEBUG). */ -typedef unsigned FDECL((*condition_handler), (unsigned *, unsigned *)); -extern condition_handler FDECL(lib$establish, (condition_handler)); -extern unsigned FDECL(lib$sig_to_ret, (unsigned *, unsigned *)); +typedef unsigned (*condition_handler)(unsigned *, unsigned *); +extern condition_handler lib$establish(condition_handler); +extern unsigned lib$sig_to_ret(unsigned *, unsigned *); /* SYS$IMGSTA() is not documented: if called at image startup, it controls access to the debugger; fortunately, the linker knows now to find it without needing to link against sys.stb (VAX) or use LINK/System (Alpha). We won't be calling it, but we indirectly check whether it has already been called by checking if nethack.exe has it as a transfer address. */ -extern unsigned FDECL(sys$imgsta, ()); +extern unsigned sys$imgsta(); /* * These structures are in header files contained in sys$lib_c.tlb, @@ -749,9 +732,7 @@ struct eiha { /* extended image header activation block, $EIHADEF */ with magic arguments; C run-time library won't be initialized yet */ /*ARGSUSED*/ int -vmsexeini(inirtn_unused, clirtn_unused, imghdr) -const void *inirtn_unused, *clirtn_unused; -const unsigned char *imghdr; +vmsexeini(const void *inirtn_unused, const void *clirtn_unused, const unsigned char *imghdr) { const struct ihd *vax_hdr; const struct eihd *axp_hdr; diff --git a/sys/wince/celib.c b/sys/wince/celib.c index 713f45de62..8a6d5f9b6c 100644 --- a/sys/wince/celib.c +++ b/sys/wince/celib.c @@ -383,8 +383,7 @@ chdrive(char *str) * This is used in nhlan.c to implement some of the LAN_FEATURES. */ char * -get_username(lan_username_size) -int *lan_username_size; +get_username(int *lan_username_size) { static char username_buffer[BUFSZ]; strcpy(username_buffer, "nhsave"); diff --git a/sys/wince/cesound.c b/sys/wince/cesound.c index 4130feb77f..992a4f2de1 100644 --- a/sys/wince/cesound.c +++ b/sys/wince/cesound.c @@ -14,9 +14,7 @@ #ifdef USER_SOUNDS void -play_usersound(filename, volume) -const char *filename; -int volume; +play_usersound(const char *filename, int volume) { TCHAR wbuf[MAX_PATH + 1]; /* pline("play_usersound: %s (%d).", filename, volume); */ diff --git a/sys/wince/mhmenu.c b/sys/wince/mhmenu.c index 4637b3e115..9543791be3 100644 --- a/sys/wince/mhmenu.c +++ b/sys/wince/mhmenu.c @@ -20,11 +20,11 @@ typedef struct mswin_menu_item { int glyph; ANY_P identifier; - CHAR_P accelerator; - CHAR_P group_accel; + char accelerator; + char group_accel; int attr; char str[NHMENU_STR_SIZE]; - BOOLEAN_P presel; + boolean presel; int count; BOOL has_focus; BOOL has_tab; diff --git a/sys/wince/mhmsg.h b/sys/wince/mhmsg.h index 55e0d3ce9c..df662ab552 100644 --- a/sys/wince/mhmsg.h +++ b/sys/wince/mhmsg.h @@ -29,8 +29,8 @@ typedef struct mswin_nhmsg_putstr { } MSNHMsgPutstr, *PMSNHMsgPutstr; typedef struct mswin_nhmsg_print_glyph { - XCHAR_P x; - XCHAR_P y; + xchar x; + xchar y; int glyph; } MSNHMsgPrintGlyph, *PMSNHMsgPrintGlyph; @@ -42,11 +42,11 @@ typedef struct mswin_nhmsg_cliparound { typedef struct mswin_nhmsg_add_menu { int glyph; const ANY_P *identifier; - CHAR_P accelerator; - CHAR_P group_accel; + char accelerator; + char group_accel; int attr; const char *str; - BOOLEAN_P presel; + boolean presel; } MSNHMsgAddMenu, *PMSNHMsgAddMenu; typedef struct mswin_nhmsg_cursor { diff --git a/sys/wince/mswproc.c b/sys/wince/mswproc.c index 5a0ff989d1..d5e7bcba1c 100644 --- a/sys/wince/mswproc.c +++ b/sys/wince/mswproc.c @@ -796,7 +796,7 @@ mswin_clear_nhwindow(winid wid) --more--, if necessary, in the tty window-port. */ void -mswin_display_nhwindow(winid wid, BOOLEAN_P block) +mswin_display_nhwindow(winid wid, boolean block) { logDebug("mswin_display_nhwindow(%d, %d)\n", wid, block); if (GetNHApp()->windowlist[wid].win != NULL) { @@ -967,7 +967,7 @@ mswin_putstr_ex(winid wid, int attr, const char *text, boolean app) iff complain is TRUE. */ void -mswin_display_file(const char *filename, BOOLEAN_P must_exist) +mswin_display_file(const char *filename, boolean must_exist) { dlb *f; TCHAR wbuf[BUFSZ]; @@ -1061,8 +1061,8 @@ identifier */ void mswin_add_menu(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) { logDebug("mswin_add_menu(%d, %d, %p, %c, %c, %d, %s, %d)\n", wid, glyph, identifier, (char) accelerator, (char) group_accel, attr, str, @@ -1212,7 +1212,7 @@ print_glyph(window, x, y, glyph, bkglyph) 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, int bkglyph) +mswin_print_glyph(winid wid, xchar x, xchar y, int glyph, int bkglyph) { logDebug("mswin_print_glyph(%d, %d, %d, %d, %d)\n", wid, x, y, glyph, bkglyph); @@ -1366,7 +1366,7 @@ char yn_function(const char *ques, const char *choices, char default) ports might use a popup. */ char -mswin_yn_function(const char *question, const char *choices, CHAR_P def) +mswin_yn_function(const char *question, const char *choices, char def) { int result = -1; char ch; diff --git a/sys/wince/winMS.h b/sys/wince/winMS.h index e9b78bd993..2c6951ebb0 100644 --- a/sys/wince/winMS.h +++ b/sys/wince/winMS.h @@ -122,30 +122,30 @@ void mswin_suspend_nhwindows(const char *); void mswin_resume_nhwindows(void); winid mswin_create_nhwindow(int type); void mswin_clear_nhwindow(winid wid); -void mswin_display_nhwindow(winid wid, BOOLEAN_P block); +void mswin_display_nhwindow(winid wid, boolean block); void mswin_destroy_nhwindow(winid wid); void mswin_curs(winid wid, int x, int y); void mswin_putstr(winid wid, int attr, const char *text); void mswin_putstr_ex(winid wid, int attr, const char *text, boolean append); -void mswin_display_file(const char *filename, BOOLEAN_P must_exist); +void mswin_display_file(const char *filename, boolean must_exist); void mswin_start_menu(winid wid); void mswin_add_menu(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); void mswin_end_menu(winid wid, const char *prompt); int mswin_select_menu(winid wid, int how, MENU_ITEM_P **selected); 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, int bkglyph); +void mswin_print_glyph(winid wid, xchar x, xchar y, int glyph, int bkglyph); 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); void mswin_nhbell(void); int mswin_doprev_message(void); -char mswin_yn_function(const char *question, const char *choices, CHAR_P def); +char mswin_yn_function(const char *question, const char *choices, char def); void mswin_getlin(const char *question, char *input); int mswin_get_ext_cmd(void); void mswin_number_pad(int state); diff --git a/sys/wince/winhack.c b/sys/wince/winhack.c index 252fc9c84e..f626cdb2ef 100644 --- a/sys/wince/winhack.c +++ b/sys/wince/winhack.c @@ -11,7 +11,7 @@ extern 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: @@ -24,7 +24,7 @@ static void win_hack_init(int, char **); static void __cdecl mswin_moveloop(void *); static BOOL setMapTiles(const char *fname); -extern boolean FDECL(pcmain, (int, char **)); +extern boolean pcmain(int, char **); #define MAX_CMDLINE_PARAM 255 @@ -237,20 +237,19 @@ getlock() } /* misc functions */ -void error -VA_DECL(const char *, s) +void error(const char *s, ...) { + va_list the_args; TCHAR wbuf[1024]; char buf[1024]; DWORD last_error = GetLastError(); - VA_START(s); - VA_INIT(s, const char *); + va_start(the_args, s); /* error() may get called before tty is initialized */ if (iflags.window_inited) end_screen(); - vsprintf(buf, s, VA_ARGS); + vsprintf(buf, s, the_args); NH_A2W(buf, wbuf, sizeof(wbuf) / sizeof(wbuf[0])); if (last_error > 0) { LPVOID lpMsgBuf; @@ -270,7 +269,7 @@ VA_DECL(const char *, s) } } MessageBox(NULL, wbuf, TEXT("Error"), MB_OK | MB_ICONERROR); - VA_END(); + va_end(the_args); exit(EXIT_FAILURE); } @@ -323,8 +322,7 @@ _get_cmd_arg(TCHAR *pCmdLine) * Strip out troublesome file system characters. */ -void nt_regularize(s) /* normalize file name */ -register char *s; +void nt_regularize(register char *s) /* normalize file name */ { register unsigned char *lp; @@ -344,8 +342,7 @@ win32_abort() } void -append_port_id(buf) -char *buf; +append_port_id(char *buf) { char *portstr = PORT_CE_PLATFORM " " PORT_CE_CPU; Sprintf(eos(buf), " %s", portstr); diff --git a/sys/wince/winmain.c b/sys/wince/winmain.c index 7007166e31..1e5b51c9cc 100644 --- a/sys/wince/winmain.c +++ b/sys/wince/winmain.c @@ -7,7 +7,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 @@ -92,16 +92,15 @@ _get_cmd_arg(TCHAR *pCmdLine) } #ifndef STRNCMPI -char lowc(c) /* force 'c' into lowercase */ -char c; +char lowc(char c) /* force 'c' into lowercase */ { return ((char) (('A' <= c && c <= 'Z') ? (c | 040) : c)); } -int strncmpi(s1, s2, n) /* case insensitive counted string comparison */ -register const char *s1, *s2; -register int n; /*(should probably be size_t, which is usually unsigned)*/ -{ /*{ aka strncasecmp }*/ +/* case insensitive counted string comparison */ +int strncmpi(register const char *s1, register const char *s2, + register int n) /*(should probably be size_t, which is usually unsigned)*/ +{ /*{ aka strncasecmp }*/ register char t1, t2; while (n--) { diff --git a/sys/winnt/nh340key.c b/sys/winnt/nh340key.c index 7d64b3843a..e38769e7a9 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, +int __declspec(dllexport) __stdcall ProcessKeystroke (HANDLE hConIn, INPUT_RECORD *ir, boolean *valid, - BOOLEAN_P numberpad, int portdebug)); + boolean numberpad, int portdebug); int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) @@ -94,13 +94,8 @@ static const struct pad { #define inmap(x, vk) (((x) > 'A' && (x) < 'Z') || (vk) == 0xBF || (x) == '2') -int __declspec(dllexport) __stdcall ProcessKeystroke(hConIn, ir, valid, - numberpad, portdebug) -HANDLE hConIn; -INPUT_RECORD *ir; -boolean *valid; -boolean numberpad; -int portdebug; +int __declspec(dllexport) __stdcall ProcessKeystroke(HANDLE hConIn, INPUT_RECORD *ir, boolean *valid, + boolean numberpad, int portdebug) { int metaflags = 0, k = 0; int keycode, vk; @@ -169,9 +164,7 @@ int portdebug; return ch; } -int __declspec(dllexport) __stdcall NHkbhit(hConIn, ir) -HANDLE hConIn; -INPUT_RECORD *ir; +int __declspec(dllexport) __stdcall NHkbhit(HANDLE hConIn, INPUT_RECORD *ir) { int done = 0; /* true = "stop searching" */ int retval; /* true = "we had a match" */ @@ -223,15 +216,8 @@ INPUT_RECORD *ir; return retval; } -int __declspec(dllexport) __stdcall CheckInput(hConIn, ir, count, numpad, - mode, mod, cc) -HANDLE hConIn; -INPUT_RECORD *ir; -DWORD *count; -boolean numpad; -int mode; -int *mod; -coord *cc; +int __declspec(dllexport) __stdcall CheckInput(HANDLE hConIn, INPUT_RECORD *ir, DWORD *count, boolean numpad, + int mode, int *mod, coord *cc) { #if defined(SAFERHANGUP) DWORD dwWait; @@ -284,8 +270,7 @@ coord *cc; return mode ? 0 : ch; } -int __declspec(dllexport) __stdcall SourceWhere(buf) -char **buf; +int __declspec(dllexport) __stdcall SourceWhere(char **buf) { if (!buf) return 0; @@ -293,8 +278,7 @@ char **buf; return 1; } -int __declspec(dllexport) __stdcall SourceAuthor(buf) -char **buf; +int __declspec(dllexport) __stdcall SourceAuthor(char **buf) { if (!buf) return 0; @@ -302,9 +286,7 @@ char **buf; return 1; } -int __declspec(dllexport) __stdcall KeyHandlerName(buf, full) -char **buf; -int full; +int __declspec(dllexport) __stdcall KeyHandlerName(char **buf, int full) { if (!buf) return 0; diff --git a/sys/winnt/nhdefkey.c b/sys/winnt/nhdefkey.c index 258874e540..163d971c7c 100644 --- a/sys/winnt/nhdefkey.c +++ b/sys/winnt/nhdefkey.c @@ -30,9 +30,9 @@ extern struct sinfo program_state; char dllname[512]; char *shortdllname; -int FDECL(__declspec(dllexport) __stdcall ProcessKeystroke, +int __declspec(dllexport) __stdcall ProcessKeystroke (HANDLE hConIn, INPUT_RECORD *ir, boolean *valid, - BOOLEAN_P numberpad, int portdebug)); + boolean numberpad, int portdebug); int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) @@ -104,13 +104,8 @@ static const struct pad { static BYTE KeyState[256]; -int __declspec(dllexport) __stdcall ProcessKeystroke(hConIn, ir, valid, - numberpad, portdebug) -HANDLE hConIn; -INPUT_RECORD *ir; -boolean *valid; -boolean numberpad; -int portdebug; +int __declspec(dllexport) __stdcall ProcessKeystroke(HANDLE hConIn, INPUT_RECORD *ir, boolean *valid, + boolean numberpad, int portdebug) { int metaflags = 0, k = 0; int keycode, vk; @@ -202,9 +197,7 @@ int portdebug; return ch; } -int __declspec(dllexport) __stdcall NHkbhit(hConIn, ir) -HANDLE hConIn; -INPUT_RECORD *ir; +int __declspec(dllexport) __stdcall NHkbhit(HANDLE hConIn, INPUT_RECORD *ir) { int done = 0; /* true = "stop searching" */ int retval; /* true = "we had a match" */ @@ -256,15 +249,8 @@ INPUT_RECORD *ir; return retval; } -int __declspec(dllexport) __stdcall CheckInput(hConIn, ir, count, numpad, - mode, mod, cc) -HANDLE hConIn; -INPUT_RECORD *ir; -DWORD *count; -boolean numpad; -int mode; -int *mod; -coord *cc; +int __declspec(dllexport) __stdcall CheckInput(HANDLE hConIn, INPUT_RECORD *ir, DWORD *count, boolean numpad, + int mode, int *mod, coord *cc) { #if defined(SAFERHANGUP) DWORD dwWait; @@ -317,8 +303,7 @@ coord *cc; return mode ? 0 : ch; } -int __declspec(dllexport) __stdcall SourceWhere(buf) -char **buf; +int __declspec(dllexport) __stdcall SourceWhere(char **buf) { if (!buf) return 0; @@ -326,8 +311,7 @@ char **buf; return 1; } -int __declspec(dllexport) __stdcall SourceAuthor(buf) -char **buf; +int __declspec(dllexport) __stdcall SourceAuthor(char **buf) { if (!buf) return 0; @@ -335,9 +319,7 @@ char **buf; return 1; } -int __declspec(dllexport) __stdcall KeyHandlerName(buf, full) -char **buf; -int full; +int __declspec(dllexport) __stdcall KeyHandlerName(char **buf, int full) { if (!buf) return 0; diff --git a/sys/winnt/nhraykey.c b/sys/winnt/nhraykey.c index 95dfddf241..43bacf5926 100644 --- a/sys/winnt/nhraykey.c +++ b/sys/winnt/nhraykey.c @@ -169,9 +169,9 @@ extern INPUT_RECORD ir; char dllname[512]; char *shortdllname; -int FDECL(__declspec(dllexport) __stdcall ProcessKeystroke, +int __declspec(dllexport) __stdcall ProcessKeystroke (HANDLE hConIn, INPUT_RECORD *ir, boolean *valid, - BOOLEAN_P numberpad, int portdebug)); + boolean numberpad, int portdebug); static INPUT_RECORD bogus_key; @@ -255,14 +255,13 @@ 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) -unsigned long shiftstate; +is_altseq(unsigned long shiftstate) { /* We need to distinguish the Alt keys from the AltGr key. * On NT-based Windows, AltGr signals as right Alt and left Ctrl together; @@ -284,13 +283,8 @@ unsigned long shiftstate; } } -int __declspec(dllexport) __stdcall ProcessKeystroke(hConIn, ir, valid, - numberpad, portdebug) -HANDLE hConIn; -INPUT_RECORD *ir; -boolean *valid; -boolean numberpad; -int portdebug; +int __declspec(dllexport) __stdcall ProcessKeystroke(HANDLE hConIn, INPUT_RECORD *ir, boolean *valid, + boolean numberpad, int portdebug) { int metaflags = 0, k = 0; int keycode, vk; @@ -390,10 +384,7 @@ int portdebug; } int -process_keystroke2(hConIn, ir, valid) -HANDLE hConIn; -INPUT_RECORD *ir; -boolean *valid; +process_keystroke2(HANDLE hConIn, INPUT_RECORD *ir, boolean *valid) { /* Use these values for the numeric keypad */ static const char keypad_nums[] = "789-456+1230."; @@ -456,14 +447,8 @@ boolean *valid; return ch; } -int __declspec(dllexport) __stdcall CheckInput(hConIn, ir, count, numpad, - mode, mod, cc) -HANDLE hConIn; -INPUT_RECORD *ir; -DWORD *count; -int *mod; -boolean numpad; -coord *cc; +int __declspec(dllexport) __stdcall CheckInput(HANDLE hConIn, INPUT_RECORD *ir, DWORD *count, boolean numpad, + int mode, int *mod, coord *cc) { #if defined(SAFERHANGUP) DWORD dwWait; @@ -537,9 +522,7 @@ coord *cc; return ch; } -int __declspec(dllexport) __stdcall NHkbhit(hConIn, ir) -HANDLE hConIn; -INPUT_RECORD *ir; +int __declspec(dllexport) __stdcall NHkbhit(HANDLE hConIn, INPUT_RECORD *ir) { int done = 0; /* true = "stop searching" */ int retval; /* true = "we had a match" */ @@ -591,8 +574,7 @@ INPUT_RECORD *ir; return retval; } -int __declspec(dllexport) __stdcall SourceWhere(buf) -char **buf; +int __declspec(dllexport) __stdcall SourceWhere(char **buf) { if (!buf) return 0; @@ -600,8 +582,7 @@ char **buf; return 1; } -int __declspec(dllexport) __stdcall SourceAuthor(buf) -char **buf; +int __declspec(dllexport) __stdcall SourceAuthor(char **buf) { if (!buf) return 0; @@ -609,9 +590,7 @@ char **buf; return 1; } -int __declspec(dllexport) __stdcall KeyHandlerName(buf, full) -char **buf; -int full; +int __declspec(dllexport) __stdcall KeyHandlerName(char **buf, int full) { if (!buf) return 0; diff --git a/sys/winnt/ntsound.c b/sys/winnt/ntsound.c index 0e4efbf164..f5b2ce71d7 100644 --- a/sys/winnt/ntsound.c +++ b/sys/winnt/ntsound.c @@ -17,9 +17,7 @@ #ifdef USER_SOUNDS void -play_usersound(filename, volume) -const char *filename; -int volume; +play_usersound(const char *filename, int volume) { /* pline("play_usersound: %s (%d).", filename, volume); */ (void) sndPlaySound(filename, SND_ASYNC | SND_NODEFAULT); diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 7c0c72cf1e..6abee3461c 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -20,10 +20,9 @@ #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 numberpad, int portdebug); /* * The following WIN32 Console API routines are used in this file. @@ -59,7 +58,7 @@ INPUT_RECORD ir; */ int GUILaunched; extern int redirect_stdout; -static BOOL FDECL(CtrlHandler, (DWORD)); +static BOOL CtrlHandler(DWORD); /* Flag for whether unicode is supported */ static boolean has_unicode; @@ -72,11 +71,11 @@ extern boolean getreturn_enabled; /* from sys/share/pcsys.c */ /* dynamic keystroke handling .DLL support */ typedef int(__stdcall *PROCESS_KEYSTROKE)(HANDLE, INPUT_RECORD *, boolean *, - BOOLEAN_P, int); + boolean, int); typedef int(__stdcall *NHKBHIT)(HANDLE, INPUT_RECORD *); -typedef int(__stdcall *CHECKINPUT)(HANDLE, INPUT_RECORD *, DWORD *, BOOLEAN_P, +typedef int(__stdcall *CHECKINPUT)(HANDLE, INPUT_RECORD *, DWORD *, boolean, int, int *, coord *); typedef int(__stdcall *SOURCEWHERE)(char **); @@ -94,8 +93,8 @@ SOURCEAUTHOR pSourceAuthor; KEYHANDLERNAME pKeyHandlerName; #ifdef CHANGE_COLOR -static void NDECL(adjust_palette); -static int FDECL(match_color_name, (const char *)); +static void adjust_palette(void); +static int match_color_name(const char *); typedef HWND(WINAPI *GETCONSOLEWINDOW)(); static HWND GetConsoleHandle(void); static HWND GetConsoleHwnd(void); @@ -118,9 +117,9 @@ static COLORREF DefaultColors[CLR_MAX] = { #endif int ttycolors[CLR_MAX]; #ifdef TEXTCOLOR -static void NDECL(init_ttycolor); +static void init_ttycolor(void); #endif -static void NDECL(really_move_cursor); +static void really_move_cursor(void); #define MAX_OVERRIDES 256 unsigned char key_overrides[MAX_OVERRIDES]; @@ -158,8 +157,7 @@ gettty() /* reset terminal to original state */ void -settty(s) -const char *s; +settty(const char *s) { cmov(ttyDisplay->curx, ttyDisplay->cury); end_screen(); @@ -180,8 +178,7 @@ setftty() } void -tty_startup(wid, hgt) -int *wid, *hgt; +tty_startup(int *wid, int *hgt) { int twid = origcsbi.srWindow.Right - origcsbi.srWindow.Left + 1; @@ -193,8 +190,7 @@ int *wid, *hgt; } void -tty_number_pad(state) -int state; +tty_number_pad(int state) { } @@ -226,8 +222,7 @@ tty_end_screen() } static BOOL -CtrlHandler(ctrltype) -DWORD ctrltype; +CtrlHandler(DWORD ctrltype) { switch (ctrltype) { /* case CTRL_C_EVENT: */ @@ -251,8 +246,7 @@ DWORD ctrltype; /* called by init_tty in wintty.c for WIN32 port only */ void -nttty_open(mode) -int mode; +nttty_open(int mode) { HANDLE hStdOut; DWORD cmode; @@ -335,11 +329,7 @@ int mode; } int -process_keystroke(ir, valid, numberpad, portdebug) -INPUT_RECORD *ir; -boolean *valid; -boolean numberpad; -int portdebug; +process_keystroke(INPUT_RECORD *ir, boolean *valid, boolean numberpad, int portdebug) { int ch = pProcessKeystroke(hConIn, ir, valid, numberpad, portdebug); /* check for override */ @@ -389,8 +379,7 @@ tgetch() } int -ntposkey(x, y, mod) -int *x, *y, *mod; +ntposkey(int *x, int *y, int *mod) { int ch; coord cc; @@ -429,8 +418,7 @@ really_move_cursor() } void -cmov(x, y) -register int x, y; +cmov(register int x, register int y) { ttyDisplay->cury = y; ttyDisplay->curx = x; @@ -439,8 +427,7 @@ register int x, y; } void -nocmov(x, y) -int x, y; +nocmov(int x, int y) { cursor.X = x; cursor.Y = y; @@ -449,8 +436,7 @@ int x, y; } void -xputc_core(ch) -char ch; +xputc_core(char ch) { switch (ch) { case '\n': @@ -478,8 +464,7 @@ char ch; } void -xputc(ch) -char ch; +xputc(char ch) { cursor.X = ttyDisplay->curx; cursor.Y = ttyDisplay->cury; @@ -487,8 +472,7 @@ char ch; } void -xputs(s) -const char *s; +xputs(const char *s) { int k; int slen = strlen(s); @@ -509,8 +493,7 @@ const char *s; * for win32. It is used for glyphs only, not text. */ void -g_putch(in_ch) -int in_ch; +g_putch(int in_ch) { /* CP437 to Unicode mapping according to the Unicode Consortium */ static const WCHAR cp437[] = { @@ -830,8 +813,7 @@ toggle_mouse_support() /* handle tty options updates here */ void -nttty_preference_update(pref) -const char *pref; +nttty_preference_update(const char *pref) { if (stricmp(pref, "mouse_support") == 0) { #ifndef NO_MOUSE_ALLOWED @@ -894,8 +876,7 @@ win32con_toggle_cursor_info() #endif void -map_subkeyvalue(op) -register char *op; +map_subkeyvalue(register char *op) { char digits[] = "0123456789"; int length, i, idx, val; @@ -1012,13 +993,12 @@ load_keyboard_handler() /* this is used as a printf() replacement when the window * system isn't initialized yet */ -void msmsg -VA_DECL(const char *, fmt) +void msmsg(const char *fmt, ...) { + va_list the_args; char buf[ROWNO * COLNO]; /* worst case scenario */ - VA_START(fmt); - VA_INIT(fmt, const char *); - Vsprintf(buf, fmt, VA_ARGS); + va_start(the_args, fmt); + Vsprintf(buf, fmt, the_args); if (redirect_stdout) fprintf(stdout, "%s", buf); else { @@ -1026,26 +1006,25 @@ VA_DECL(const char *, fmt) if (ttyDisplay) curs(BASE_WINDOW, cursor.X + 1, cursor.Y); } - VA_END(); + va_end(the_args); return; } /* fatal error */ /*VARARGS1*/ -void nttty_error -VA_DECL(const char *, s) +void nttty_error(const char *s, ...) { + va_list the_args; char buf[BUFSZ]; - VA_START(s); - VA_INIT(s, const char *); + va_start(the_args, s); /* error() may get called before tty is initialized */ if (iflags.window_inited) end_screen(); buf[0] = '\n'; - (void) vsprintf(&buf[1], s, VA_ARGS); + (void) vsprintf(&buf[1], s, the_args); msmsg(buf); really_move_cursor(); - VA_END(); + va_end(the_args); exit(EXIT_FAILURE); } @@ -1057,9 +1036,7 @@ synch_cursor() #ifdef CHANGE_COLOR void -tty_change_color(color_number, rgb, reverse) -int color_number, reverse; -long rgb; +tty_change_color(int color_number, long rgb, int reverse) { /* Map NetHack color index to NT Console palette index */ int idx, win32_color_number[] = { @@ -1104,8 +1081,7 @@ tty_get_color_string() } int -match_color_name(c) -const char *c; +match_color_name(const char *c) { const struct others { int idx; @@ -1134,8 +1110,7 @@ const char *c; * Returns 0 if badoption syntax */ int -alternative_palette(op) -char *op; +alternative_palette(char *op) { /* * palette:color-R-G-B diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index e95fe4f1d0..78985bc5e8 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -54,8 +54,7 @@ switchar() } long -freediskspace(path) -char *path; +freediskspace(char *path) { char tmppath[4]; DWORD SectorsPerCluster = 0; @@ -76,8 +75,7 @@ char *path; * Functions to get filenames using wildcards */ int -findfirst(path) -char *path; +findfirst(char *path) { if (ffhandle) { FindClose(ffhandle); @@ -100,8 +98,7 @@ foundfile_buffer() } long -filesize(file) -char *file; +filesize(char *file) { if (findfirst(file)) { return ((long) ffd.nFileSizeLow); @@ -113,8 +110,7 @@ char *file; * Chdrive() changes the default drive. */ void -chdrive(str) -char *str; +chdrive(char *str) { char *ptr; char drive; @@ -148,8 +144,7 @@ def_kbhit() * Strip out troublesome file system characters. */ -void nt_regularize(s) /* normalize file name */ -register char *s; +void nt_regularize(register char *s) /* normalize file name */ { register unsigned char *lp; @@ -164,8 +159,7 @@ register char *s; * This is used in nhlan.c to implement some of the LAN_FEATURES. */ char * -get_username(lan_username_size) -int *lan_username_size; +get_username(int *lan_username_size) { static TCHAR username_buffer[BUFSZ]; unsigned int status; @@ -195,26 +189,25 @@ return &szFullPath[0]; /* fatal error */ /*VARARGS1*/ -void error -VA_DECL(const char *, s) +void error(const char *s, ...) { + va_list the_args; char buf[BUFSZ]; - VA_START(s); - VA_INIT(s, const char *); + va_start(the_args, s); /* error() may get called before tty is initialized */ if (iflags.window_inited) end_screen(); if (!strncmpi(windowprocs.name, "tty", 3)) { buf[0] = '\n'; - (void) vsprintf(&buf[1], s, VA_ARGS); + (void) vsprintf(&buf[1], s, the_args); Strcat(buf, "\n"); msmsg(buf); } else { - (void) vsprintf(buf, s, VA_ARGS); + (void) vsprintf(buf, s, the_args); Strcat(buf, "\n"); raw_printf(buf); } - VA_END(); + va_end(the_args); exit(EXIT_FAILURE); } @@ -224,7 +217,7 @@ Delay(int ms) (void) Sleep(ms); } -extern void NDECL(backsp); +extern void backsp(void); void win32_abort() @@ -260,11 +253,7 @@ static char interjection_buf[INTERJECTION_TYPES][1024]; static int interjection[INTERJECTION_TYPES]; void -interject_assistance(num, interjection_type, ptr1, ptr2) -int num; -int interjection_type; -genericptr_t ptr1; -genericptr_t ptr2; +interject_assistance(int num, int interjection_type, genericptr_t ptr1, genericptr_t ptr2) { switch (num) { case 1: { @@ -309,8 +298,7 @@ genericptr_t ptr2; } void -interject(interjection_type) -int interjection_type; +interject(int interjection_type) { if (interjection_type >= 0 && interjection_type < INTERJECTION_TYPES) msmsg(interjection_buf[interjection_type]); @@ -338,8 +326,7 @@ int interjection_type; #endif void -append_port_id(buf) -char *buf; +append_port_id(char *buf) { char *portstr = TARGET_PORT; Sprintf(eos(buf), " %s", portstr); diff --git a/util/dgn_comp.l b/util/dgn_comp.l index a18b5fefc8..6e9ea53f3e 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(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 @@ -49,11 +49,11 @@ 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 #else /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ @@ -63,14 +63,14 @@ int FDECL(yyoutput, (int)); #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) /* older flex wants this */ -#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t, size_t)); +#define YY_MALLOC_DECL genericptr_t malloc(size_t); \ + genericptr_t realloc(genericptr_t, size_t); /* newer flex assumes so needs this in case it's been suppressed */ YY_MALLOC_DECL #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) @@ -121,8 +121,7 @@ RNDCHLEVEL return(RNDCHLEVEL); /* routine to switch to another input file; needed for flex */ void -init_yyin( input_f ) -FILE *input_f; +init_yyin( FILE *input_f ) { #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) if (yyin) @@ -134,8 +133,7 @@ FILE *input_f; /* analogous routine (for completeness) */ void -init_yyout( output_f ) -FILE *output_f; +init_yyout( FILE *output_f ) { yyout = output_f; } diff --git a/util/dgn_comp.y b/util/dgn_comp.y index a00ff75596..8afbe486ea 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(void); +int yyparse(void); +int getchain(char *); +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) @@ -485,8 +485,7 @@ init_branch() } int -getchain(s) - char *s; +getchain(char *s) { int i; diff --git a/util/dgn_main.c b/util/dgn_main.c index e3e5e5939c..9c2c9027e4 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 nh_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 @@ -53,9 +53,7 @@ FILE *FDECL(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; */ void -yyerror(s) -const char *s; +yyerror(const char *s) { (void) fprintf(stderr, "%s : line %d : %s\n", fname, nh_line_number, s); if (++fatal_error > MAX_ERRORS) { @@ -173,8 +170,7 @@ const char *s; */ void -yywarning(s) -const char *s; +yywarning(const char *s) { (void) fprintf(stderr, "%s : line %d : WARNING : %s\n", fname, nh_line_number, s); diff --git a/util/dlb_main.c b/util/dlb_main.c index 0a4b938dd7..b5206d63af 100644 --- a/util/dlb_main.c +++ b/util/dlb_main.c @@ -14,8 +14,8 @@ #include #endif -static void FDECL(grow_ld, (libdir **, int *, int)); -static void FDECL(xexit, (int)); +static void grow_ld(libdir **, int *, int); +static void xexit(int); #ifdef DLB #ifdef DLBLIB @@ -24,17 +24,16 @@ 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 *); -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(void); +static void verbose_help(void); +static void write_dlb_directory(int, int, libdir *, long, long, long); static char default_progname[] = "dlb"; static char *progname = default_progname; @@ -108,10 +107,7 @@ verbose_help() } 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; @@ -132,8 +128,7 @@ long len; } char * -eos(s) -char *s; +eos(char *s) { while (*s) s++; @@ -142,8 +137,7 @@ char *s; /* open_library(dlb.c) needs this (which normally comes from src/files.c) */ FILE * -fopen_datafile(filename, mode) -const char *filename, *mode; +fopen_datafile(const char *filename, const char *mode) { return fopen(filename, mode); } @@ -152,9 +146,7 @@ const char *filename, *mode; #endif /* DLB */ int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { #ifdef DLB #ifdef DLBLIB @@ -474,10 +466,7 @@ char **argv; #ifdef DLBLIB static void -grow_ld(ld_p, ldlimit_p, alloc_incr) -libdir **ld_p; -int *ldlimit_p; -int alloc_incr; +grow_ld(libdir **ld_p, int *ldlimit_p, int alloc_incr) { static libdir zerolibdir; int i = 0, newlimit = *ldlimit_p + alloc_incr; @@ -494,10 +483,7 @@ int alloc_incr; } 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; @@ -527,8 +513,7 @@ long slen, dir_size, flen; #endif /* DLB */ static void -xexit(retcd) -int retcd; +xexit(int retcd) { #ifdef DLB #ifdef AMIGA diff --git a/util/lev_comp.l b/util/lev_comp.l index c70c48148c..95ca7b9127 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(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 @@ -47,11 +47,11 @@ 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 #else /* !FLEX_SCANNER && !FLEXHACK_SCANNER */ @@ -61,28 +61,28 @@ int FDECL(yyoutput, (int)); #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) /* older flex wants this */ -#define YY_MALLOC_DECL genericptr_t FDECL(malloc, (size_t)); \ - genericptr_t FDECL(realloc, (genericptr_t, size_t)); +#define YY_MALLOC_DECL genericptr_t malloc(size_t); \ + genericptr_t realloc(genericptr_t, size_t); /* newer flex assumes so needs this in case it's been suppressed */ YY_MALLOC_DECL #endif -void FDECL(init_yyin, (FILE *)); -void FDECL(init_yyout, (FILE *)); +void init_yyin(FILE *); +void init_yyout(FILE *); -long NDECL(handle_varstring_check); -long FDECL(corefunc_str_check, (char *, long)); +long handle_varstring_check(void); +long corefunc_str_check(char *, long); -extern void VDECL(lc_error, (const char *, ...)); -extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); +extern void lc_error(const char *, ...); +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); +void advancepos(char *); /* * This doesn't always get put in lev_comp.h @@ -347,8 +347,7 @@ inaccessibles { savetoken(yytext); yylval.i=CHECK_INACCESSIBLES; return FLAG_T %% #ifdef AMIGA long * -alloc(n) - unsigned n; +alloc(unsigned n) { return (long *) malloc(n); } @@ -356,8 +355,7 @@ alloc(n) /* routine to switch to another input file; needed for flex */ void -init_yyin( input_f ) -FILE *input_f; +init_yyin( FILE *input_f ) { #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER) if (yyin) @@ -371,8 +369,7 @@ FILE *input_f; } /* analogous routine (for completeness) */ void -init_yyout( output_f ) -FILE *output_f; +init_yyout( FILE *output_f ) { yyout = output_f; } @@ -419,16 +416,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 6831564d10..c13be24bab 100644 --- a/util/lev_comp.y +++ b/util/lev_comp.y @@ -40,52 +40,52 @@ #define NewTab(type, size) (type **) alloc(sizeof(type *) * size) #define Free(ptr) free((genericptr_t)ptr) -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 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 VDECL(add_opvars, (sp_lev *, const char *, ...)); -extern void FDECL(start_level_def, (sp_lev * *, 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_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 void NDECL(break_stmt_start); -extern void FDECL(break_stmt_end, (sp_lev *)); -extern void FDECL(break_stmt_new, (sp_lev *, long)); - -extern void FDECL(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 int FDECL(reverse_jmp_opcode, (int)); +extern void lc_error(const char *, ...); +extern void lc_warning(const char *, ...); +extern void yyerror(const char *); +extern void yywarning(const char *); +extern int yylex(void); +int yyparse(void); + +extern int get_floor_type(char); +extern int get_room_type(char *); +extern int get_trap_type(char *); +extern int get_monster_id(char *,char); +extern int get_object_id(char *,char); +extern boolean check_monster_char(char); +extern boolean check_object_char(char); +extern char what_map_char(char); +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 add_opvars(sp_lev *, const char *, ...); +extern void start_level_def(sp_lev * *, 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 *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(void); +extern void break_stmt_end(sp_lev *); +extern void break_stmt_new(sp_lev *, long); + +extern void splev_add_from(sp_lev *, sp_lev *); + +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 reverse_jmp_opcode(int); struct coord { long x; diff --git a/util/lev_main.c b/util/lev_main.c index d3350e1782..af287d80c5 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -77,74 +77,72 @@ 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 NDECL(check_subrooms); -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)); -static boolean FDECL(write_maze, (int, sp_lev *)); -static void NDECL(init_obj_classes); -static int FDECL(case_insensitive_comp, (const char *, const char *)); - -void VDECL(lc_pline, (const char *, ...)); -void VDECL(lc_error, (const char *, ...)); -void VDECL(lc_warning, (const char *, ...)); -char *FDECL(decode_parm_chr, (CHAR_P)); -char *FDECL(decode_parm_str, (char *)); -struct opvar *FDECL(set_opvar_int, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_coord, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_region, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_mapchar, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_monst, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_obj, (struct opvar *, long)); -struct opvar *FDECL(set_opvar_str, (struct opvar *, const char *)); -struct opvar *FDECL(set_opvar_var, (struct opvar *, const char *)); -void VDECL(add_opvars, (sp_lev *, const char *, ...)); -void NDECL(break_stmt_start); -void FDECL(break_stmt_end, (sp_lev *)); -void FDECL(break_stmt_new, (sp_lev *, long)); -char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *)); -const char *FDECL(spovar2str, (long)); -void FDECL(vardef_used, (struct lc_vardefs *, char *)); -void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long)); -struct lc_vardefs *FDECL(add_vardef_type, - (struct lc_vardefs *, char *, long)); -int FDECL(reverse_jmp_opcode, (int)); -struct opvar *FDECL(opvar_clone, (struct opvar *)); -void FDECL(start_level_def, (sp_lev **, char *)); +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); +int get_room_type(char *); +int get_trap_type(char *); +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(void); +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(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); +static boolean write_maze(int, sp_lev *); +static void init_obj_classes(void); +static int case_insensitive_comp(const char *, const char *); + +void lc_pline(const char *, ...); +void lc_error(const char *, ...); +void lc_warning(const char *, ...); +char *decode_parm_chr(char); +char *decode_parm_str(char *); +struct opvar *set_opvar_int(struct opvar *, long); +struct opvar *set_opvar_coord(struct opvar *, long); +struct opvar *set_opvar_region(struct opvar *, long); +struct opvar *set_opvar_mapchar(struct opvar *, long); +struct opvar *set_opvar_monst(struct opvar *, long); +struct opvar *set_opvar_obj(struct opvar *, long); +struct opvar *set_opvar_str(struct opvar *, const char *); +struct opvar *set_opvar_var(struct opvar *, const char *); +void add_opvars(sp_lev *, const char *, ...); +void break_stmt_start(void); +void break_stmt_end(sp_lev *); +void break_stmt_new(sp_lev *, long); +char *funcdef_paramtypes(struct lc_funcdefs *); +const char *spovar2str(long); +void vardef_used(struct lc_vardefs *, char *); +void check_vardef_type(struct lc_vardefs *, char *, long); +struct lc_vardefs *add_vardef_type(struct lc_vardefs *, char *, long); +int reverse_jmp_opcode(int); +struct opvar *opvar_clone(struct opvar *); +void start_level_def(sp_lev **, char *); static struct { const char *name; @@ -233,9 +231,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; @@ -310,8 +306,7 @@ char **argv; * the current declaration, instead of the beginning of the next declaration. */ void -yyerror(s) -const char *s; +yyerror(const char *s) { char *e = ((char *) s + strlen(s) - 1); @@ -331,8 +326,7 @@ const char *s; * 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, nh_line_number, s); @@ -359,36 +353,18 @@ yywrap() #define LC_PLINE_ERROR 2 static int lc_pline_mode = LC_PLINE_MESSAGE; -#if defined(USE_STDARG) || defined(USE_VARARGS) -static void FDECL(lc_vpline, (const char *, va_list)); +static void lc_vpline(const char *, va_list); -void lc_pline -VA_DECL(const char *, line) +void lc_pline(const char *line, ...) { - VA_START(line); - VA_INIT(line, char *); - lc_vpline(line, VA_ARGS); - VA_END(); + va_list the_args; + va_start(the_args, line); + lc_vpline(line, the_args); + va_end(the_args); } -#ifdef USE_STDARG static void lc_vpline(const char *line, va_list the_args) -#else -static void -lc_vpline(line, the_args) -const char *line; -va_list the_args; -#endif - -#else /* USE_STDARG | USE_VARARG */ - -#define lc_vpline lc_pline - -void -lc_pline -VA_DECL(const char *, line) -#endif /* USE_STDARG | USE_VARARG */ { /* opening brace for lc_vpline, nested block for USE_OLDARGS lc_pline */ char pbuf[3 * BUFSZ]; @@ -398,7 +374,7 @@ VA_DECL(const char *, line) if (!line || !*line) line = nomsg; /* shouldn't happen */ if (index(line, '%')) { - Vsprintf(pbuf, line, VA_ARGS); + Vsprintf(pbuf, line, the_args); pbuf[BUFSZ - 1] = '\0'; /* truncate if long */ line = pbuf; } @@ -415,40 +391,35 @@ VA_DECL(const char *, line) } lc_pline_mode = LC_PLINE_MESSAGE; /* reset to default */ return; -#if !(defined(USE_STDARG) || defined(USE_VARARGS)) - VA_END(); /* closing brace ofr USE_OLDARGS's nested block */ -#endif } /*VARARGS1*/ void -lc_error -VA_DECL(const char *, line) +lc_error(const char *line, ...) { - VA_START(line); - VA_INIT(line, const char *); + va_list the_args; + va_start(the_args, line); lc_pline_mode = LC_PLINE_ERROR; - lc_vpline(line, VA_ARGS); - VA_END(); + lc_vpline(line, the_args); + va_end(the_args); return; } /*VARARGS1*/ void -lc_warning -VA_DECL(const char *, line) +lc_warning(const char *line, ...) { - VA_START(line); - VA_INIT(line, const char *); + va_list the_args; + va_start(the_args, line); + ; lc_pline_mode = LC_PLINE_WARNING; - lc_vpline(line, VA_ARGS); - VA_END(); + lc_vpline(line, the_args); + va_end(the_args); return; } char * -decode_parm_chr(chr) -char chr; +decode_parm_chr(char chr) { static char buf[32]; @@ -485,8 +456,7 @@ char chr; } char * -decode_parm_str(str) -char *str; +decode_parm_str(char *str) { static char tmpbuf[1024]; char *p = str; @@ -502,9 +472,7 @@ char *str; } 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; @@ -514,9 +482,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; @@ -526,9 +492,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; @@ -538,9 +502,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; @@ -550,9 +512,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; @@ -562,9 +522,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; @@ -574,9 +532,7 @@ long val; } struct opvar * -set_opvar_str(ov, val) -struct opvar *ov; -const char *val; +set_opvar_str(struct opvar *ov, const char *val) { if (ov) { ov->spovartyp = SPOVAR_STRING; @@ -586,9 +542,7 @@ const char *val; } struct opvar * -set_opvar_var(ov, val) -struct opvar *ov; -const char *val; +set_opvar_var(struct opvar *ov, const char *val) { if (ov) { ov->spovartyp = SPOVAR_VARIABLE; @@ -600,38 +554,19 @@ const char *val; #define New(type) \ (type *) memset((genericptr_t) alloc(sizeof(type)), 0, sizeof(type)) -#if defined(USE_STDARG) || defined(USE_VARARGS) -static void FDECL(vadd_opvars, (sp_lev *, const char *, va_list)); +static void vadd_opvars(sp_lev *, const char *, va_list); -void add_opvars -VA_DECL2(sp_lev *, sp, const char *, fmt) +void add_opvars(sp_lev *sp, const char *fmt, ...) { - VA_START(fmt); - VA_INIT(fmt, char *); - vadd_opvars(sp, fmt, VA_ARGS); - VA_END(); + va_list the_args; + va_start(the_args, fmt); + vadd_opvars(sp, fmt, the_args); + va_end(the_args); } -#ifdef USE_STDARG static void vadd_opvars(sp_lev *sp, const char *fmt, va_list the_args) { -#else -static void -vadd_opvars(sp, fmt, the_args) -sp_lev *sp; -const char *fmt; -va_list the_args; -{ -#endif - -#else /* USE_STDARG | USE_VARARG */ - -#define vadd_opvars add_opvars - -void add_opvars -VA_DECL2(sp_lev *, sp, const char *, fmt) -#endif /* USE_STDARG | USE_VARARG */ const char *p, *lp; long la; @@ -644,62 +579,62 @@ VA_DECL2(sp_lev *, sp, const char *, fmt) case 'i': /* integer */ { struct opvar *ov = New(struct opvar); - set_opvar_int(ov, VA_NEXT(la, long) ); + set_opvar_int(ov, la = va_arg(the_args, long) ); add_opcode(sp, SPO_PUSH, ov); break; } case 'c': /* coordinate */ { struct opvar *ov = New(struct opvar); - set_opvar_coord(ov, VA_NEXT(la, long) ); + set_opvar_coord(ov, la = va_arg(the_args, long) ); add_opcode(sp, SPO_PUSH, ov); break; } case 'r': /* region */ { struct opvar *ov = New(struct opvar); - set_opvar_region(ov, VA_NEXT(la, long) ); + set_opvar_region(ov, la = va_arg(the_args, long) ); add_opcode(sp, SPO_PUSH, ov); break; } case 'm': /* mapchar */ { struct opvar *ov = New(struct opvar); - set_opvar_mapchar(ov, VA_NEXT(la, long) ); + set_opvar_mapchar(ov, la = va_arg(the_args, long) ); add_opcode(sp, SPO_PUSH, ov); break; } case 'M': /* monster */ { struct opvar *ov = New(struct opvar); - set_opvar_monst(ov, VA_NEXT(la, long) ); + set_opvar_monst(ov, la = va_arg(the_args, long) ); add_opcode(sp, SPO_PUSH, ov); break; } case 'O': /* object */ { struct opvar *ov = New(struct opvar); - set_opvar_obj(ov, VA_NEXT(la, long) ); + set_opvar_obj(ov, la = va_arg(the_args, long) ); add_opcode(sp, SPO_PUSH, ov); break; } case 's': /* string */ { struct opvar *ov = New(struct opvar); - set_opvar_str(ov, VA_NEXT(lp, const char *) ); + set_opvar_str(ov, lp = va_arg(the_args, const char *) ); add_opcode(sp, SPO_PUSH, ov); break; } case 'v': /* variable */ { struct opvar *ov = New(struct opvar); - set_opvar_var(ov, VA_NEXT(lp, const char *) ); + set_opvar_var(ov, lp = va_arg(the_args, const char *) ); add_opcode(sp, SPO_PUSH, ov); break; } case 'o': /* opcode */ { - long i = VA_NEXT(la, int); + long i = la = va_arg(the_args, int); if (i < 0 || i >= MAX_SP_OPCODES) lc_pline("add_opvars: unknown opcode '%ld'.", i); add_opcode(sp, i, NULL); @@ -720,8 +655,7 @@ break_stmt_start() } 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; @@ -747,9 +681,7 @@ sp_lev *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); @@ -763,9 +695,7 @@ long 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); @@ -785,8 +715,7 @@ char *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; @@ -807,8 +736,7 @@ struct lc_funcdefs *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; @@ -825,10 +753,7 @@ struct lc_funcdefs *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) { @@ -844,9 +769,7 @@ int 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); @@ -862,8 +785,7 @@ char *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; @@ -879,10 +801,7 @@ struct lc_vardefs *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) { @@ -898,8 +817,7 @@ int casesense; } const char * -spovar2str(spovar) -long spovar; +spovar2str(long spovar) { static int togl = 0; static char buf[2][128]; @@ -944,9 +862,7 @@ long spovar; } void -vardef_used(vd, varname) -struct lc_vardefs *vd; -char *varname; +vardef_used(struct lc_vardefs *vd, char *varname) { struct lc_vardefs *tmp; @@ -955,10 +871,7 @@ char *varname; } 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; @@ -971,10 +884,7 @@ long 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; @@ -991,8 +901,7 @@ long vartype; } int -reverse_jmp_opcode(opcode) -int opcode; +reverse_jmp_opcode(int opcode) { switch (opcode) { case SPO_JE: @@ -1015,8 +924,7 @@ int 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)); @@ -1059,9 +967,7 @@ struct opvar *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; @@ -1072,9 +978,7 @@ sp_lev *from_splev; } void -start_level_def(splev, ldfname) -sp_lev **splev; -char *ldfname; +start_level_def(sp_lev **splev, char *ldfname) { struct lc_funcdefs *f; @@ -1099,8 +1003,7 @@ char *ldfname; * Find the type of floor, knowing its char representation. */ int -get_floor_type(c) -char c; +get_floor_type(char c) { int val; @@ -1117,8 +1020,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; @@ -1133,8 +1035,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; @@ -1149,9 +1050,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; @@ -1180,9 +1079,7 @@ 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; @@ -1231,8 +1128,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); } @@ -1241,8 +1137,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); } @@ -1251,8 +1146,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) { @@ -1305,10 +1199,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; @@ -1343,9 +1234,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; @@ -1429,8 +1318,7 @@ sp_lev *sp; * Output some info common to all special levels. */ static boolean -write_common_data(fd) -int fd; +write_common_data(int fd) { static struct version_info version_data = { VERSION_NUMBER, VERSION_FEATURES, VERSION_SANITY1, VERSION_SANITY2, @@ -1446,9 +1334,7 @@ int fd; * 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; @@ -1523,9 +1409,7 @@ sp_lev *maze; * 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]; @@ -1560,9 +1444,7 @@ sp_lev *lvl; } static int -case_insensitive_comp(s1, s2) -const char *s1; -const char *s2; +case_insensitive_comp(const char *s1, const char *s2) { uchar u1, u2; diff --git a/util/makedefs.c b/util/makedefs.c index 0e340b4785..0509e51de2 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -144,66 +144,65 @@ 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 *, const char *)); -static char *FDECL(version_id_string, (char *, const char *)); -static char *FDECL(bannerc_string, (char *, const char *)); -static char *FDECL(xcrypt, (const char *)); -static unsigned long FDECL(read_rumors_file, - (const char *, int *, long *, unsigned long)); -static void FDECL(do_rnd_access_file, (const 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 void FDECL(do_ext_makedefs, (int, char **)); -static void NDECL(windowing_sanity); - -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 char *FDECL(valid_qt_summary, (char *, BOOLEAN_P)); -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); +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 *, const char *); +static char *version_id_string(char *, const char *); +static char *bannerc_string(char *, const char *); +static char *xcrypt(const char *); +static unsigned long read_rumors_file(const char *, int *, long *, unsigned long); +static void do_rnd_access_file(const 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(void); +static void do_ext_makedefs(int, char **); +static void windowing_sanity(void); + +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 char *valid_qt_summary(char *, boolean); +static void do_qt_control(char *); +static void do_qt_text(char *); +static void adjust_qt_hdrs(void); +static void put_qt_hdrs(void); #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(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 -static char *FDECL(fgetline, (FILE*)); -static char *FDECL(tmpdup, (const char *)); -static char *FDECL(limit, (char *, int)); -static char *FDECL(eos, (char *)); +static char *fgetline(FILE*); +static char *tmpdup(const char *); +static char *limit(char *, int); +static char *eos(char *); /* input, output, tmp */ static FILE *ifp, *ofp, *tfp; @@ -247,9 +246,7 @@ main(void) #else /* ! MAC */ int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { if ((argc != 2) #ifdef FILE_PREFIX @@ -292,8 +289,7 @@ link_sanity_check() } void -do_makedefs(options) -char *options; +do_makedefs(char *options) { boolean more_than_one; @@ -369,28 +365,21 @@ char *options; static char namebuf[1000]; static char * -name_file(template, tag) -char *template; -char *tag; +name_file(char *template, char *tag) { Sprintf(namebuf, template, tag); return namebuf; } static void -delete_file(template, tag) -char *template; -char *tag; +delete_file(char *template, char *tag) { char *name = name_file(template, tag); Unlink(name); } static FILE * -getfp(template, tag, mode) -char *template; -char *tag; -char *mode; +getfp(char *template, char *tag, char *mode) { char *name = name_file(template, tag); FILE *rv = fopen(name, mode); @@ -413,9 +402,9 @@ struct grep_var { /* struct grep_var grep_vars[] and TODO_* constants in include file: */ #include "mdgrep.h" -static void NDECL(do_grep); -static void NDECL(do_grep_showvars); -static struct grep_var *FDECL(grepsearch, (char *)); +static void do_grep(void); +static void do_grep_showvars(void); +static struct grep_var *grepsearch(char *); static int grep_trace = 0; static void @@ -625,8 +614,7 @@ do_grep_showvars() } static struct grep_var * -grepsearch(name) -char *name; +grepsearch(char *name) { /* XXX make into binary search */ int x = 0; @@ -639,8 +627,7 @@ char *name; } static int -grep_check_id(id) -char *id; +grep_check_id(char *id) { struct grep_var *rv; while (*id && isspace(*id)) @@ -668,8 +655,7 @@ char *id; } static void -grep_show_wstack(tag) -char *tag; +grep_show_wstack(char *tag) { int x; @@ -684,8 +670,7 @@ char *tag; } static char * -do_grep_control(buf) -char *buf; +do_grep_control(char *buf) { int isif = 1; char *buf0 = buf; @@ -759,8 +744,7 @@ char *buf; #ifdef notyet static void -do_grep_rewrite(buf) -char *buf; +do_grep_rewrite(char *buf) { /* no language features use this yet */ return; @@ -786,9 +770,7 @@ do_grep() } static void -grep0(inputfp0, outputfp0) -FILE *inputfp0; -FILE *outputfp0; +grep0(FILE *inputfp0, FILE *outputfp0) { char buf[16384]; /* looong, just in case */ @@ -844,8 +826,7 @@ FILE *outputfp0; /* trivial text encryption routine which can't be broken with `tr' */ static char * -xcrypt(str) -const char *str; +xcrypt(const char *str) { /* duplicated in src/hacklib.c */ static char buf[BUFSZ]; register const char *p; @@ -866,11 +847,7 @@ const char *str; #define PAD_RUMORS_TO 60 /* common code for do_rumors(). Return 0 on error. */ static unsigned long -read_rumors_file(file_ext, rumor_count, rumor_size, old_rumor_offset) -const char *file_ext; -int *rumor_count; -long *rumor_size; -unsigned long old_rumor_offset; +read_rumors_file(const char *file_ext, int *rumor_count, long *rumor_size, unsigned long old_rumor_offset) { char infile[600]; char *line; @@ -927,8 +904,7 @@ unsigned long old_rumor_offset; } void -do_rnd_access_file(fname) -const char *fname; +do_rnd_access_file(const char *fname) { char *line; @@ -1155,9 +1131,7 @@ make_version() } static char * -version_string(outbuf, delim) -char *outbuf; -const char *delim; +version_string(char *outbuf, const char *delim) { Sprintf(outbuf, "%d%s%d%s%d", VERSION_MAJOR, delim, VERSION_MINOR, delim, PATCHLEVEL); @@ -1168,9 +1142,7 @@ const char *delim; } 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]; @@ -1189,9 +1161,7 @@ const char *build_date; } static char * -bannerc_string(outbuf, build_date) -char *outbuf; -const char *build_date; +bannerc_string(char *outbuf, const char *build_date) { char subbuf[64], versbuf[64]; @@ -1586,8 +1556,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 */ @@ -1732,8 +1701,7 @@ do_data() /* 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; @@ -1978,8 +1946,7 @@ do_dungeon() } static boolean -ranged_attk(ptr) /* returns TRUE if monster can attack at range */ -register struct permonst *ptr; +ranged_attk(register struct permonst *ptr) /* returns TRUE if monster can attack at range */ { register int i, j; register int atk_mask = (1 << AT_BREA) | (1 << AT_SPIT) | (1 << AT_GAZE); @@ -1997,8 +1964,7 @@ register struct permonst *ptr; * determination as "experience()" to arrive at the strength. */ static int -mstrength(ptr) -struct permonst *ptr; +mstrength(struct permonst *ptr) { int i, tmp2, n, tmp = ptr->mlevel; @@ -2085,7 +2051,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(void);\n"); Fprintf(ofp, "\nvoid\n"); Fprintf(ofp, "monstr_init()\n"); Fprintf(ofp, "{\n"); @@ -2150,8 +2116,7 @@ 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; @@ -2159,15 +2124,13 @@ char *s; } 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; @@ -2179,8 +2142,7 @@ char *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); @@ -2194,8 +2156,7 @@ char *code; } static boolean -known_msg(num, id) -int num, id; +known_msg(int num, int id) { int i; @@ -2207,9 +2168,7 @@ int 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; @@ -2227,10 +2186,10 @@ int num, id; /* check %E record for "[summary text]" that nethack can stuff into the message history buffer when delivering text via window instead of pline */ +/* end record: "%E" optionally followed by " [summary]" */ +/* curr_msg is valid iff this is True */ static char * -valid_qt_summary(s, parsing) -char *s; /* end record: "%E" optionally followed by " [summary]" */ -boolean parsing; /* curr_msg is valid iff this is True */ +valid_qt_summary(char *s, boolean parsing) { static char summary[BUFSZ]; char *p; @@ -2278,8 +2237,7 @@ boolean parsing; /* curr_msg is valid iff this is True */ } static void -do_qt_control(s) -char *s; +do_qt_control(char *s) { char code[BUFSZ]; int num, id = 0; @@ -2326,8 +2284,7 @@ char *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); @@ -2484,9 +2441,7 @@ do_questtxt() static char temp[32]; -static char *limit(name, pref) /* limit a name to 30 characters length */ -char *name; -int pref; +static char *limit(char *name, int pref) /* limit a name to 30 characters length */ { (void) strncpy(temp, name, pref ? 26 : 30); temp[pref ? 26 : 30] = 0; @@ -2630,8 +2585,7 @@ do_objs() * null pointer if no characters were read. */ static char * -fgetline(fd) -FILE *fd; +fgetline(FILE *fd) { static const int inc = 256; int len = inc; @@ -2654,8 +2608,7 @@ FILE *fd; } static char * -tmpdup(str) -const char *str; +tmpdup(const char *str) { static char buf[128]; @@ -2666,8 +2619,7 @@ const char *str; } static char * -eos(str) -char *str; +eos(char *str) { while (*str) str++; @@ -2984,8 +2936,7 @@ C_far_gen() * same row as the hero. */ static int -clear_path(you_row, you_col, y2, x2) -int you_row, you_col, y2, x2; +clear_path(int you_row, int you_col, int y2, int x2) { int dx, dy, s1, s2; register int i, error, x, y, dxs, dys; diff --git a/util/panic.c b/util/panic.c index f5a0837d01..c2f5ecb14a 100644 --- a/util/panic.c +++ b/util/panic.c @@ -14,18 +14,17 @@ #define abort() exit() #endif #ifdef VMS -extern void NDECL(vms_abort); +extern void vms_abort(void); #endif /*VARARGS1*/ boolean panicking; -void VDECL(panic, (char *, ...)); +void panic(char *, ...); -void panic -VA_DECL(char *, str) +void panic(char *str, ...) { - VA_START(str); - VA_INIT(str, char *); + va_list the_args; + va_start(the_args, str); if (panicking++) #ifdef SYSV (void) @@ -33,7 +32,7 @@ VA_DECL(char *, str) abort(); /* avoid loops - this should never happen*/ (void) fputs(" ERROR: ", stderr); - Vfprintf(stderr, str, VA_ARGS); + Vfprintf(stderr, str, the_args); (void) fflush(stderr); #if defined(UNIX) || defined(VMS) #ifdef SYSV @@ -41,7 +40,7 @@ VA_DECL(char *, str) #endif abort(); /* generate core dump */ #endif - VA_END(); + va_end(the_args); exit(EXIT_FAILURE); /* redundant */ } @@ -52,8 +51,7 @@ VA_DECL(char *, str) * systems, but they should either use yacc or get a real alloca routine. */ long * -alloca(cnt) -unsigned cnt; +alloca(unsigned cnt) { return cnt ? alloc(cnt) : (long *) 0; } diff --git a/util/recover.c b/util/recover.c index 5c1c27f1f0..cc34b8ebe9 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 *)); -void FDECL(set_levelfile_name, (int)); -int FDECL(open_levelfile, (int)); -int NDECL(create_savefile); -void FDECL(copy_bytes, (int, int)); +int restore_savefile(char *); +void set_levelfile_name(int); +int open_levelfile(int); +int create_savefile(void); +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) @@ -61,9 +61,7 @@ char savename[SAVESIZE]; /* holds relative path of save file from playground */ int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { int argno; const char *dir = (char *) 0; @@ -152,8 +150,7 @@ char *argv[]; static char lock[256]; void -set_levelfile_name(lev) -int lev; +set_levelfile_name(int lev) { char *tf; @@ -167,8 +164,7 @@ int lev; } int -open_levelfile(lev) -int lev; +open_levelfile(int lev) { int fd; @@ -195,8 +191,7 @@ create_savefile() } void -copy_bytes(ifd, ofd) -int ifd, ofd; +copy_bytes(int ifd, int ofd) { char buf[BUFSIZ]; int nfrom, nto; @@ -212,8 +207,7 @@ int ifd, ofd; } int -restore_savefile(basename) -char *basename; +restore_savefile(char *basename) { int gfd, lfd, sfd; int lev, savelev, hpid, pltmpsiz; @@ -396,8 +390,7 @@ char *basename; char exepathbuf[EXEPATHBUFSZ]; char * -exepath(str) -char *str; +exepath(char *str) { char *tmp, *tmp2; int bsize; diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index 4b3e5dd193..3f80bdfef2 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -4700,7 +4700,7 @@ void NetHackQtBind::qt_clear_nhwindow(winid wid) window->Clear(); } -void NetHackQtBind::qt_display_nhwindow(winid wid, BOOLEAN_P block) +void NetHackQtBind::qt_display_nhwindow(winid wid, boolean block) { NetHackQtWindow* window=id_to_window[wid]; window->Display(block); @@ -4727,7 +4727,7 @@ void NetHackQtBind::qt_putstr(winid wid, int attr, const char *text) window->PutStr(attr,text); } -void NetHackQtBind::qt_display_file(const char *filename, BOOLEAN_P must_exist) +void NetHackQtBind::qt_display_file(const char *filename, boolean must_exist) { NetHackQtTextWindow* window=new NetHackQtTextWindow(keybuffer); bool complain = FALSE; @@ -4784,8 +4784,8 @@ void NetHackQtBind::qt_start_menu(winid wid) } void NetHackQtBind::qt_add_menu(winid wid, int glyph, - const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr, - const char *str, BOOLEAN_P presel) + const ANY_P * identifier, char ch, char gch, int attr, + const char *str, boolean presel) { NetHackQtWindow* window=id_to_window[wid]; window->AddMenu(glyph, identifier, ch, gch, attr, str, presel); @@ -4832,12 +4832,12 @@ void NetHackQtBind::qt_cliparound_window(winid wid, int x, int y) NetHackQtWindow* window=id_to_window[wid]; window->ClipAround(x,y); } -void NetHackQtBind::qt_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph, int bkglyph) +void NetHackQtBind::qt_print_glyph(winid wid,xchar x,xchar y,int glyph, int bkglyph) { NetHackQtWindow* window=id_to_window[wid]; window->PrintGlyph(x,y,glyph); } -//void NetHackQtBind::qt_print_glyph_compose(winid wid,XCHAR_P x,XCHAR_P y,int glyph1, int glyph2) +//void NetHackQtBind::qt_print_glyph_compose(winid wid,xchar x,xchar y,int glyph1, int glyph2) //{ //NetHackQtWindow* window=id_to_window[wid]; //window->PrintGlyphCompose(x,y,glyph1,glyph2); @@ -4914,7 +4914,7 @@ int NetHackQtBind::qt_doprev_message() return 0; } -char NetHackQtBind::qt_yn_function(const char *question, const char *choices, CHAR_P def) +char NetHackQtBind::qt_yn_function(const char *question, const char *choices, char def) { if (qt_settings->ynInMessages() && WIN_MESSAGE!=WIN_ERR) { // Similar to X11 windowport `slow' feature. diff --git a/win/Qt/tileedit.cpp b/win/Qt/tileedit.cpp index 1259af3dcd..4250c6222b 100644 --- a/win/Qt/tileedit.cpp +++ b/win/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/X11/Window.c b/win/X11/Window.c index e6db07b582..1ba3f6a260 100644 --- a/win/X11/Window.c +++ b/win/X11/Window.c @@ -90,11 +90,10 @@ static XtResource resources[] = { /* ARGSUSED */ static void -no_op(w, event, params, num_params) -Widget w; /* unused */ -XEvent *event; /* unused */ -String *params; /* unused */ -Cardinal *num_params; /* unused */ +no_op(Widget w, /* unused */ + XEvent *event, /* unused */ + String *params, /* unused */ + Cardinal *num_params) /* unused */ { nhUse(w); nhUse(event); @@ -113,10 +112,9 @@ static char translations[] = ": input() \ /* ARGSUSED */ static void -Redisplay(w, event, region) -Widget w; -XEvent *event; -Region region; /* unused */ +Redisplay(Widget w, + XEvent *event, + Region region) /* unused */ { nhUse(region); @@ -126,8 +124,7 @@ Region region; /* unused */ /* ARGSUSED */ static void -Resize(w) -Widget w; +Resize(Widget w) { XtCallCallbacks(w, XtNresizeCallback, (caddr_t) 0); } @@ -173,15 +170,13 @@ WindowClassRec windowClassRec = { WidgetClass windowWidgetClass = (WidgetClass) &windowClassRec; Font -WindowFont(w) -Widget w; +WindowFont(Widget w) { return ((WindowWidget) w)->window.font->fid; } XFontStruct * -WindowFontStruct(w) -Widget w; +WindowFontStruct(Widget w) { return ((WindowWidget) w)->window.font; } diff --git a/win/X11/dialogs.c b/win/X11/dialogs.c index e05e7ad175..906fcff313 100644 --- a/win/X11/dialogs.c +++ b/win/X11/dialogs.c @@ -91,11 +91,7 @@ static const char cancel_accelerators[] = "#override\n\ * an optional cancel button */ Widget -CreateDialog(parent, name, okay_callback, cancel_callback) -Widget parent; -String name; -XtCallbackProc okay_callback; -XtCallbackProc cancel_callback; +CreateDialog(Widget parent, String name, XtCallbackProc okay_callback, XtCallbackProc cancel_callback) { Widget form, prompt, response, okay, cancel; Arg args[20]; @@ -253,9 +249,7 @@ GetDialogPrompt(w) /* set the prompt. This is used to put error information in the prompt */ void -SetDialogPrompt(w, newprompt) -Widget w; -String newprompt; +SetDialogPrompt(Widget w, String newprompt) { Arg args[1]; Widget label; @@ -283,9 +277,7 @@ Widget w; #define max(a, b) (((a) > (b)) ? (a) : (b)) /* set the default reponse */ void -SetDialogResponse(w, s) -Widget w; -String s; +SetDialogResponse(Widget w, String s) { Arg args[4]; Widget response; @@ -312,8 +304,7 @@ String s; #if 0 /* clear the response */ void -ClearDialogResponse(w) - Widget w; +ClearDialogResponse(Widget w) { Arg args[2]; Widget response; @@ -330,9 +321,8 @@ ClearDialogResponse(w) /* position popup window under the cursor */ void -positionpopup(w, bottom) -Widget w; -boolean bottom; /* position y on bottom? */ +positionpopup(Widget w, + boolean bottom) /* position y on bottom? */ { Arg args[3]; Cardinal num_args; diff --git a/win/X11/tile2x11.c b/win/X11/tile2x11.c index c9e410f464..6ed010eb14 100644 --- a/win/X11/tile2x11.c +++ b/win/X11/tile2x11.c @@ -22,8 +22,7 @@ unsigned char x11_colormap[MAXCOLORMAPSIZE][3]; /* Look up the given pixel and return its colormap index. */ static unsigned char -pix_to_colormap(pix) -pixel pix; +pix_to_colormap(pixel pix) { unsigned i; @@ -43,9 +42,8 @@ pixel pix; /* Convert the tiles in the file to our format of bytes. */ static unsigned long -convert_tiles(tb_ptr, total) -unsigned char **tb_ptr; /* pointer to a tile byte pointer */ -unsigned long total; /* total tiles so far */ +convert_tiles(unsigned char **tb_ptr, /* pointer to a tile byte pointer */ + unsigned long total) /* total tiles so far */ { unsigned char *tb = *tb_ptr; unsigned long count = 0; @@ -106,8 +104,7 @@ merge_text_colormap() /* Open the given file, read & merge the colormap, convert the tiles. */ static void -process_file(fname) -char *fname; +process_file(char *fname) { unsigned long count; @@ -124,8 +121,7 @@ char *fname; #ifdef USE_XPM static int -xpm_write(fp) -FILE *fp; +xpm_write(FILE *fp) { int i, j, n; @@ -162,9 +158,7 @@ FILE *fp; #endif /* USE_XPM */ int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { FILE *fp; int i; diff --git a/win/X11/winX.c b/win/X11/winX.c index 6cf4dd5de1..32f7b84c42 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -80,7 +80,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; @@ -138,19 +138,19 @@ 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(void); #ifdef X11_HANGUP_SIGNAL -static void FDECL(X11_sig, (int)); -static void FDECL(X11_sig_cb, (XtPointer, XtSignalId *)); +static void X11_sig(int); +static void X11_sig_cb(XtPointer, XtSignalId *); #endif /* @@ -168,8 +168,7 @@ static Pixmap icon_pixmap = None; /* Pixmap for icon. */ * that this is not the popup widget, nor the viewport, but the child. */ struct xwindow * -find_widget(w) -Widget w; +find_widget(Widget w) { int windex; struct xwindow *wp; @@ -244,11 +243,10 @@ XtConvertArgRec const nhcolorConvertArgs[] = { * Return True if something close was found. */ Boolean -nhApproxColor(screen, colormap, str, color) -Screen *screen; /* screen to use */ -Colormap colormap; /* the colormap to use */ -char *str; /* color name */ -XColor *color; /* the X color structure; changed only if successful */ +nhApproxColor(Screen *screen, /* screen to use */ + Colormap colormap, /* the colormap to use */ + char *str, /* color name */ + XColor *color) /* the X color structure; changed only if successful */ { int ncells; long cdiff = 16777216; /* 2^24; hopefully our map is smaller */ @@ -320,13 +318,7 @@ XColor *color; /* the X color structure; changed only if successful */ } Boolean -nhCvtStringToPixel(dpy, args, num_args, fromVal, toVal, closure_ret) -Display *dpy; -XrmValuePtr args; -Cardinal *num_args; -XrmValuePtr fromVal; -XrmValuePtr toVal; -XtPointer *closure_ret; +nhCvtStringToPixel(Display *dpy, XrmValuePtr args, Cardinal *num_args, XrmValuePtr fromVal, XrmValuePtr toVal, XtPointer *closure_ret) { String str = (String) fromVal->addr; XColor screenColor; @@ -415,12 +407,7 @@ XtPointer *closure_ret; /* ARGSUSED */ static void -nhFreePixel(app, toVal, closure, args, num_args) -XtAppContext app; -XrmValuePtr toVal; -XtPointer closure; -XrmValuePtr args; -Cardinal *num_args; +nhFreePixel(XtAppContext app, XrmValuePtr toVal, XtPointer closure, XrmValuePtr args, Cardinal *num_args) { Screen *screen; Colormap colormap; @@ -445,7 +432,7 @@ Cardinal *num_args; /* [ALI] Utility function to ask Xaw for font height, since the previous * assumption of ascent + descent is not always valid. */ -Dimension nhFontHeight(w) Widget w; +Dimension nhFontHeight(Widget w) #ifdef _XawTextSink_h { Widget sink; @@ -475,23 +462,19 @@ Dimension nhFontHeight(w) Widget w; /* Global Functions ======================================================== */ void -X11_raw_print(str) -const char *str; +X11_raw_print(const char *str) { (void) puts(str); } void -X11_raw_print_bold(str) -const char *str; +X11_raw_print_bold(const char *str) { (void) puts(str); } void -X11_curs(window, x, y) -winid window; -int x, y; +X11_curs(winid window, int x, int y) { check_winid(window); @@ -509,10 +492,7 @@ int x, y; } void -X11_putstr(window, attr, str) -winid window; -int attr; -const char *str; +X11_putstr(winid window, int attr, const char *str) { winid new_win; struct xwindow *wp; @@ -569,8 +549,7 @@ X11_nhgetch() } int -X11_nh_poskey(x, y, mod) -int *x, *y, *mod; +X11_nh_poskey(int *x, int *y, int *mod) { int val = input_event(EXIT_ON_KEY_OR_BUTTON_PRESS); @@ -583,8 +562,7 @@ int *x, *y, *mod; } winid -X11_create_nhwindow(type) -int type; +X11_create_nhwindow(int type) { winid window; struct xwindow *wp; @@ -674,8 +652,7 @@ int type; } void -X11_clear_nhwindow(window) -winid window; +X11_clear_nhwindow(winid window) { struct xwindow *wp; @@ -701,9 +678,7 @@ winid window; } void -X11_display_nhwindow(window, blocking) -winid window; -boolean blocking; +X11_display_nhwindow(winid window, boolean blocking) { struct xwindow *wp; @@ -764,8 +739,7 @@ boolean blocking; } void -X11_destroy_nhwindow(window) -winid window; +X11_destroy_nhwindow(winid window) { struct xwindow *wp; @@ -872,8 +846,7 @@ X11_resume_nhwindows() } /* ARGSUSED */ void -X11_suspend_nhwindows(str) -const char *str; +X11_suspend_nhwindows(const char *str) { nhUse(str); @@ -882,8 +855,7 @@ const char *str; /* Under X, we don't need to initialize the number pad. */ /* ARGSUSED */ -void X11_number_pad(state) /* called from options.c */ -int state; +void X11_number_pad(int state) /* called from options.c */ { nhUse(state); @@ -903,10 +875,7 @@ X11_end_screen() #ifdef GRAPHIC_TOMBSTONE void -X11_outrip(window, how, when) -winid window; -int how; -time_t when; +X11_outrip(winid window, int how, time_t when) { struct xwindow *wp; @@ -1001,9 +970,7 @@ static XtResource resources[] = { }; void -X11_init_nhwindows(argcp, argv) -int *argcp; -char **argv; +X11_init_nhwindows(int *argcp, char **argv) { int i; Cardinal num_args; @@ -1099,8 +1066,7 @@ char **argv; */ /* ARGSUSED */ void -X11_exit_nhwindows(dummy) -const char *dummy; +X11_exit_nhwindows(const char *dummy) { extern Pixmap tile_pixmap; /* from winmap.c */ @@ -1126,17 +1092,14 @@ const char *dummy; } #ifdef X11_HANGUP_SIGNAL -static void X11_sig(sig) /* Unix signal handler */ -int sig; +static void X11_sig(int sig) /* Unix signal handler */ { XtNoticeSignal(X11_sig_id); hangup(sig); } static void -X11_sig_cb(not_used, id) -XtPointer not_used; -XtSignalId *id; +X11_sig_cb(XtPointer not_used, XtSignalId *id) { XEvent event; XClientMessageEvent *mesg; @@ -1165,9 +1128,7 @@ XtSignalId *id; */ /* ARGSUSED */ static void -d_timeout(client_data, id) -XtPointer client_data; -XtIntervalId *id; +d_timeout(XtPointer client_data, XtIntervalId *id) { XEvent event; XClientMessageEvent *mesg; @@ -1207,11 +1168,7 @@ X11_delay_output() */ /* ARGSUSED */ static void -X11_hangup(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +X11_hangup(Widget w, XEvent *event, String *params, Cardinal *num_params) { nhUse(w); nhUse(event); @@ -1226,11 +1183,7 @@ Cardinal *num_params; */ /* ARGSUSED */ static void -askname_delete(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +askname_delete(Widget w, XEvent *event, String *params, Cardinal *num_params) { nhUse(event); nhUse(params); @@ -1244,10 +1197,7 @@ Cardinal *num_params; /* Callback for askname dialog widget. */ /* ARGSUSED */ static void -askname_done(w, client_data, call_data) -Widget w; -XtPointer client_data; -XtPointer call_data; +askname_done(Widget w, XtPointer client_data, XtPointer call_data) { int len; char *s; @@ -1317,10 +1267,7 @@ static char *getline_input; /* Callback for getline dialog widget. */ /* ARGSUSED */ static void -done_button(w, client_data, call_data) -Widget w; -XtPointer client_data; -XtPointer call_data; +done_button(Widget w, XtPointer client_data, XtPointer call_data) { int len; char *s; @@ -1346,11 +1293,7 @@ XtPointer call_data; /* ARGSUSED */ static void -getline_delete(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +getline_delete(Widget w, XEvent *event, String *params, Cardinal *num_params) { nhUse(event); nhUse(params); @@ -1364,10 +1307,7 @@ Cardinal *num_params; /* Callback for getline dialog widget. */ /* ARGSUSED */ static void -abort_button(w, client_data, call_data) -Widget w; -XtPointer client_data; -XtPointer call_data; +abort_button(Widget w, XtPointer client_data, XtPointer call_data) { Widget dialog = (Widget) client_data; @@ -1380,9 +1320,7 @@ XtPointer call_data; } void -X11_getlin(question, input) -const char *question; -char *input; +X11_getlin(const char *question, char *input) { static boolean need_to_init = True; @@ -1429,11 +1367,7 @@ static const char display_translations[] = "#override\n\ /* WM_DELETE_WINDOW callback for file dismissal. */ /*ARGSUSED*/ static void -delete_file(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +delete_file(Widget w, XEvent *event, String *params, Cardinal *num_params) { nhUse(event); nhUse(params); @@ -1446,11 +1380,7 @@ Cardinal *num_params; /* Callback for file dismissal. */ /*ARGSUSED*/ static void -dismiss_file(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +dismiss_file(Widget w, XEvent *event, String *params, Cardinal *num_params) { Widget popup = XtParent(w); @@ -1463,9 +1393,7 @@ Cardinal *num_params; } void -X11_display_file(str, complain) -const char *str; -boolean complain; +X11_display_file(const char *str, boolean complain) { dlb *fp; Arg args[12]; @@ -1616,8 +1544,7 @@ static const char yn_translations[] = "#override\n\ * no conversion (i.e. just the CTRL key hit) a NUL is returned. */ char -key_event_to_char(key) -XKeyEvent *key; +key_event_to_char(XKeyEvent *key) { char keystring[MAX_KEY_STRING]; int nbytes; @@ -1638,11 +1565,7 @@ XKeyEvent *key; */ /* ARGSUSED */ static void -yn_delete(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +yn_delete(Widget w, XEvent *event, String *params, Cardinal *num_params) { nhUse(w); nhUse(event); @@ -1660,11 +1583,7 @@ Cardinal *num_params; */ /* ARGSUSED */ static void -yn_key(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +yn_key(Widget w, XEvent *event, String *params, Cardinal *num_params) { char ch; @@ -1731,10 +1650,7 @@ Cardinal *num_params; } char -X11_yn_function(ques, choices, def) -const char *ques; -const char *choices; -char def; +X11_yn_function(const char *ques, const char *choices, char def) { static Boolean need_to_init = True; char buf[BUFSZ]; @@ -1852,8 +1768,7 @@ char def; /*ARGSUSED*/ void -X11_preference_update(pref) -const char *pref; +X11_preference_update(const char *pref) { if (!strcmp(pref, "tiled_map")) { if (WIN_MAP != WIN_ERR) @@ -1869,8 +1784,7 @@ const char *pref; * do some pre-processing. */ static int -input_event(exit_condition) -int exit_condition; +input_event(int exit_condition) { if (WIN_STATUS != WIN_ERR) /* hilighting on the fancy status window */ check_turn_events(); @@ -1884,10 +1798,7 @@ int exit_condition; /*ARGSUSED*/ void -msgkey(w, data, event) -Widget w; -XtPointer data; -XEvent *event; +msgkey(Widget w, XtPointer data, XEvent *event) { Cardinal num = 0; @@ -1898,11 +1809,11 @@ XEvent *event; } /*ARGSUSED*/ -static void win_visible(w, data, event, flag) /* only called for autofocus */ -Widget w; -XtPointer data; /* client_data not used */ -XEvent *event; -Boolean *flag; /* continue_to_dispatch flag not used */ +static void win_visible(Widget w, + XtPointer data, /* client_data not used */ + XEvent *event, + Boolean *flag /* continue_to_dispatch flag not used */ + ) /* only called for autofocus */ { XVisibilityEvent *vis_event = (XVisibilityEvent *) event; @@ -2134,10 +2045,9 @@ init_standard_windows() } void -nh_XtPopup(w, g, childwid) -Widget w; /* widget */ -int g; /* type of grab */ -Widget childwid; /* child to recieve focus (can be None) */ +nh_XtPopup(Widget w, /* widget */ + int g, /* type of grab */ + Widget childwid) /* child to recieve focus (can be None) */ { XtPopup(w, (XtGrabKind) g); XSetWMProtocols(XtDisplay(w), XtWindow(w), &wm_delete_window, 1); @@ -2146,8 +2056,7 @@ Widget childwid; /* child to recieve focus (can be None) */ } void -nh_XtPopdown(w) -Widget w; +nh_XtPopdown(Widget w) { XtPopdown(w); if (appResources.autofocus) @@ -2155,8 +2064,7 @@ Widget w; } void -win_X11_init(dir) -int dir; +win_X11_init(int dir) { if (dir != WININIT) return; @@ -2183,11 +2091,7 @@ int dir; */ /*ARGSUSED*/ void -nh_keyscroll(viewport, event, params, num_params) -Widget viewport; -XEvent *event; -String *params; -Cardinal *num_params; +nh_keyscroll(Widget viewport, XEvent *event, String *params, Cardinal *num_params) { Arg arg[2]; Widget horiz_sb, vert_sb; diff --git a/win/X11/winmap.c b/win/X11/winmap.c index 28d973e0b5..d5541c56f6 100644 --- a/win/X11/winmap.c +++ b/win/X11/winmap.c @@ -55,26 +55,22 @@ extern int total_tiles_used; #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, const 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); +static void init_text(struct xwindow *); +static void map_exposed(Widget, XtPointer, XtPointer); +static void set_gc(Widget, Font, const 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 ======================================================= */ void -X11_print_glyph(window, x, y, glyph, bkglyph) -winid window; -xchar x, y; -int glyph; -int bkglyph UNUSED; +X11_print_glyph(winid window, xchar x, xchar y, int glyph, int bkglyph UNUSED) { struct map_info_t *map_info; boolean update_bbox = FALSE; @@ -151,8 +147,7 @@ int bkglyph UNUSED; */ /*ARGSUSED*/ void -X11_cliparound(x, y) -int x, y; +X11_cliparound(int x, int y) { } #endif /* CLIPPING */ @@ -187,10 +182,7 @@ static struct tile_annotation pet_annotation; static struct tile_annotation pile_annotation; static void -init_annotation(annotation, filename, colorpixel) -struct tile_annotation *annotation; -char *filename; -Pixel colorpixel; +init_annotation(struct tile_annotation *annotation, char *filename, Pixel colorpixel) { Display *dpy = XtDisplay(toplevel); @@ -249,8 +241,7 @@ post_process_tiles() * Return FALSE otherwise. */ static boolean -init_tiles(wp) -struct xwindow *wp; +init_tiles(struct xwindow *wp) { #ifdef USE_XPM XpmAttributes attributes; @@ -562,8 +553,7 @@ ntiles %ld\n", * Make sure the map's cursor is always visible. */ void -check_cursor_visibility(wp) -struct xwindow *wp; +check_cursor_visibility(struct xwindow *wp) { Arg arg[2]; Widget viewport, horiz_sb, vert_sb; @@ -714,8 +704,7 @@ struct xwindow *wp; * on the screen when the user resizes the nethack window. */ static void -map_check_size_change(wp) -struct xwindow *wp; +map_check_size_change(struct xwindow *wp) { struct map_info_t *map_info = wp->map_information; Arg arg[2]; @@ -769,12 +758,7 @@ struct xwindow *wp; * by querying the widget with the resource name. */ static void -set_gc(w, font, resource_name, bgpixel, regular, inverse) -Widget w; -Font font; -const char *resource_name; -Pixel bgpixel; -GC *regular, *inverse; +set_gc(Widget w, Font font, const char *resource_name, Pixel bgpixel, GC *regular, GC *inverse) { XGCValues values; XtGCMask mask = GCFunction | GCForeground | GCBackground | GCFont; @@ -804,9 +788,7 @@ GC *regular, *inverse; * background colors on the current GC as needed. */ static void -get_text_gc(wp, font) -struct xwindow *wp; -Font font; +get_text_gc(struct xwindow *wp, Font font) { struct map_info_t *map_info = wp->map_information; Pixel bgpixel; @@ -848,8 +830,7 @@ Font font; * Display the cursor on the map window. */ static void -display_cursor(wp) -struct xwindow *wp; +display_cursor(struct xwindow *wp) { /* Redisplay the cursor location inverted. */ map_update(wp, wp->cursy, wp->cursy, wp->cursx, wp->cursx, TRUE); @@ -860,8 +841,7 @@ struct xwindow *wp; * the screen. */ void -display_map_window(wp) -struct xwindow *wp; +display_map_window(struct xwindow *wp) { register int row; struct map_info_t *map_info = wp->map_information; @@ -908,8 +888,7 @@ struct xwindow *wp; * Set all map tiles to S_stone */ static void -map_all_stone(map_info) -struct map_info_t *map_info; +map_all_stone(struct map_info_t *map_info) { int x, y; unsigned short stone = cmap_to_glyph(S_stone); @@ -928,8 +907,7 @@ struct map_info_t *map_info; * display_map_window(). */ void -clear_map_window(wp) -struct xwindow *wp; +clear_map_window(struct xwindow *wp) { struct map_info_t *map_info = wp->map_information; @@ -956,8 +934,7 @@ struct xwindow *wp; * that are used when updating it. */ static void -get_char_info(wp) -struct xwindow *wp; +get_char_info(struct xwindow *wp) { XFontStruct *fs; struct map_info_t *map_info = wp->map_information; @@ -1004,11 +981,7 @@ int inptr = 0; /* points to valid data */ * Keyboard and button event handler for map window. */ void -map_input(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +map_input(Widget w, XEvent *event, String *params, Cardinal *num_params) { XKeyEvent *key; XButtonEvent *button; @@ -1101,11 +1074,7 @@ Cardinal *num_params; } static void -set_button_values(w, x, y, button) -Widget w; -int x; -int y; -unsigned int button; +set_button_values(Widget w, int x, int y, unsigned int button) { struct xwindow *wp; struct map_info_t *map_info; @@ -1137,10 +1106,9 @@ unsigned int button; */ /*ARGSUSED*/ static void -map_exposed(w, client_data, widget_data) -Widget w; -XtPointer client_data; /* unused */ -XtPointer widget_data; /* expose event from Window widget */ +map_exposed(Widget w, + XtPointer client_data, /* unused */ + XtPointer widget_data) /* expose event from Window widget */ { int x, y; struct xwindow *wp; @@ -1223,10 +1191,7 @@ XtPointer widget_data; /* expose event from Window widget */ * The start and stop columns are *inclusive*. */ static void -map_update(wp, start_row, stop_row, start_col, stop_col, inverted) -struct xwindow *wp; -int start_row, stop_row, start_col, stop_col; -boolean inverted; +map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int stop_col, boolean inverted) { int win_start_row, win_start_col; struct map_info_t *map_info = wp->map_information; @@ -1390,9 +1355,7 @@ boolean inverted; /* Adjust the number of rows and columns on the given map window */ void -set_map_size(wp, cols, rows) -struct xwindow *wp; -Dimension cols, rows; +set_map_size(struct xwindow *wp, Dimension cols, Dimension rows) { Arg args[4]; Cardinal num_args; @@ -1414,8 +1377,7 @@ Dimension cols, rows; } static void -init_text(wp) -struct xwindow *wp; +init_text(struct xwindow *wp) { struct map_info_t *map_info = wp->map_information; struct text_map_info_t *text_map = &map_info->text_map; @@ -1442,10 +1404,9 @@ static char map_translations[] = "#override\n\ * The map window creation routine. */ void -create_map_window(wp, create_popup, parent) -struct xwindow *wp; -boolean create_popup; /* parent is a popup shell that we create */ -Widget parent; +create_map_window(struct xwindow *wp, + boolean create_popup, /* parent is a popup shell that we create */ + Widget parent) { struct map_info_t *map_info; /* map info pointer */ Widget map, viewport; @@ -1572,8 +1533,7 @@ Widget parent; * Destroy this map window. */ void -destroy_map_window(wp) -struct xwindow *wp; +destroy_map_window(struct xwindow *wp) { struct map_info_t *map_info = wp->map_information; @@ -1616,8 +1576,7 @@ boolean exit_x_event; /* exit condition for the event loop */ #if 0 /*******/ void -pkey(k) -int k; +pkey(int k) { printf("key = '%s%c'\n", (k < 32) ? "^" : "", (k < 32) ? '@' + k : k); } @@ -1628,8 +1587,7 @@ int k; * under certain circumstances. */ int -x_event(exit_condition) -int exit_condition; +x_event(int exit_condition) { XEvent event; int retval = 0; diff --git a/win/X11/winmenu.c b/win/X11/winmenu.c index 7986f0d290..c9f519caec 100644 --- a/win/X11/winmenu.c +++ b/win/X11/winmenu.c @@ -40,30 +40,29 @@ #include "winX.h" #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) @@ -79,9 +78,7 @@ static const char menu_translations[] = "#override\n\ */ /* ARGSUSED */ static void -menu_select(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +menu_select(Widget w, XtPointer client_data, XtPointer call_data) { struct xwindow *wp; struct menu_info_t *menu_info; @@ -150,11 +147,7 @@ XtPointer client_data, call_data; */ /* ARGSUSED */ void -menu_delete(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +menu_delete(Widget w, XEvent *event, String *params, Cardinal *num_params) { nhUse(event); nhUse(params); @@ -168,11 +161,7 @@ Cardinal *num_params; */ /*ARGSUSED*/ static void -invert_line(wp, curr, which, how_many) -struct xwindow *wp; -x11_menu_item *curr; -int which; -long how_many; +invert_line(struct xwindow *wp, x11_menu_item *curr, int which, long how_many) { #ifndef USE_FWF nhUse(which); @@ -201,11 +190,7 @@ long how_many; */ /* ARGSUSED */ void -menu_key(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +menu_key(Widget w, XEvent *event, String *params, Cardinal *num_params) { struct menu_info_t *menu_info; x11_menu_item *curr; @@ -355,9 +340,7 @@ Cardinal *num_params; /* ARGSUSED */ static void -menu_ok(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +menu_ok(Widget w, XtPointer client_data, XtPointer call_data) { struct xwindow *wp = (struct xwindow *) client_data; @@ -369,9 +352,9 @@ XtPointer client_data, call_data; /* ARGSUSED */ static void -menu_cancel(w, client_data, call_data) -Widget w; /* don't use - may be None */ -XtPointer client_data, call_data; +menu_cancel(Widget w, /* don't use - may be None */ + XtPointer client_data, + XtPointer call_data) { struct xwindow *wp = (struct xwindow *) client_data; @@ -387,9 +370,7 @@ XtPointer client_data, call_data; /* ARGSUSED */ static void -menu_all(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +menu_all(Widget w, XtPointer client_data, XtPointer call_data) { nhUse(w); nhUse(call_data); @@ -399,9 +380,7 @@ XtPointer client_data, call_data; /* ARGSUSED */ static void -menu_none(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +menu_none(Widget w, XtPointer client_data, XtPointer call_data) { nhUse(w); nhUse(call_data); @@ -411,9 +390,7 @@ XtPointer client_data, call_data; /* ARGSUSED */ static void -menu_invert(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +menu_invert(Widget w, XtPointer client_data, XtPointer call_data) { nhUse(w); nhUse(call_data); @@ -423,9 +400,7 @@ XtPointer client_data, call_data; /* ARGSUSED */ static void -menu_search(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +menu_search(Widget w, XtPointer client_data, XtPointer call_data) { struct xwindow *wp = (struct xwindow *) client_data; struct menu_info_t *menu_info = wp->menu_information; @@ -450,8 +425,7 @@ XtPointer client_data, call_data; } static void -select_all(wp) -struct xwindow *wp; +select_all(struct xwindow *wp) { x11_menu_item *curr; int count; @@ -474,8 +448,7 @@ struct xwindow *wp; } static void -select_none(wp) -struct xwindow *wp; +select_none(struct xwindow *wp) { x11_menu_item *curr; int count; @@ -498,8 +471,7 @@ struct xwindow *wp; } static void -invert_all(wp) -struct xwindow *wp; +invert_all(struct xwindow *wp) { x11_menu_item *curr; int count; @@ -517,9 +489,8 @@ struct xwindow *wp; } static void -invert_match(wp, match) -struct xwindow *wp; -char *match; /* wildcard pattern for pmatch() */ +invert_match(struct xwindow *wp, + char *match) /* wildcard pattern for pmatch() */ { x11_menu_item *curr; int count; @@ -541,9 +512,8 @@ char *match; /* wildcard pattern for pmatch() */ } static void -select_match(wp, match) -struct xwindow *wp; -char *match; /* wildcard pattern for pmatch() */ +select_match(struct xwindow *wp, + char *match) /* wildcard pattern for pmatch() */ { x11_menu_item *curr; int count; @@ -568,8 +538,7 @@ char *match; /* wildcard pattern for pmatch() */ } static void -menu_popdown(wp) -struct xwindow *wp; +menu_popdown(struct xwindow *wp) { nh_XtPopdown(wp->popup); /* remove the event grab */ if (wp->menu_information->is_active) @@ -586,10 +555,7 @@ struct xwindow *wp; * but we are not notified. */ static void -sync_selected(menu_info, num_selected, items) -struct menu_info_t *menu_info; -int num_selected; -int *items; +sync_selected(struct menu_info_t *menu_info, int num_selected, int *items) { int i, j, *ip; x11_menu_item *curr; @@ -618,8 +584,7 @@ int *items; */ void -X11_start_menu(window) -winid window; +X11_start_menu(winid window) { struct xwindow *wp; check_winid(window); @@ -636,15 +601,14 @@ winid window; /*ARGSUSED*/ void -X11_add_menu(window, glyph, identifier, ch, gch, attr, str, preselected) -winid window; -int glyph; /* unused (for now) */ -const anything *identifier; -char ch; -char gch; /* group accelerator (0 = no group) */ -int attr; -const char *str; -boolean preselected; +X11_add_menu(winid window, + int glyph, /* unused (for now) */ + const anything *identifier, + char ch, + char gch, /* group accelerator (0 = no group) */ + int attr, + const char *str, + boolean preselected) { x11_menu_item *item; struct menu_info_t *menu_info; @@ -711,9 +675,7 @@ boolean preselected; } void -X11_end_menu(window, query) -winid window; -const char *query; +X11_end_menu(winid window, const char *query) { struct menu_info_t *menu_info; @@ -727,10 +689,7 @@ const char *query; } int -X11_select_menu(window, how, menu_list) -winid window; -int how; -menu_item **menu_list; +X11_select_menu(winid window, int how, menu_item **menu_list) { x11_menu_item *curr; struct xwindow *wp; @@ -1171,8 +1130,7 @@ menu_item **menu_list; * This is an exact duplicate of copy_of() in tty/wintty.c. */ static char * -copy_of(s) -const char *s; +copy_of(const char *s) { if (!s) s = ""; @@ -1180,8 +1138,7 @@ const char *s; } static void -move_menu(src_menu, dest_menu) -struct menu *src_menu, *dest_menu; +move_menu(struct menu *src_menu, struct menu *dest_menu) { free_menu(dest_menu); /* toss old menu */ *dest_menu = *src_menu; /* make new menu current */ @@ -1190,8 +1147,7 @@ struct menu *src_menu, *dest_menu; } static void -free_menu(mp) -struct menu *mp; +free_menu(struct menu *mp) { while (mp->base) { mp->last = mp->base; @@ -1212,8 +1168,7 @@ struct menu *mp; } static void -reset_menu_to_default(mp) -struct menu *mp; +reset_menu_to_default(struct menu *mp) { mp->base = mp->last = (x11_menu_item *) 0; mp->query = (const char *) 0; @@ -1225,8 +1180,7 @@ struct menu *mp; } static void -clear_old_menu(wp) -struct xwindow *wp; +clear_old_menu(struct xwindow *wp) { struct menu_info_t *menu_info = wp->menu_information; @@ -1243,8 +1197,7 @@ struct xwindow *wp; } void -create_menu_window(wp) -struct xwindow *wp; +create_menu_window(struct xwindow *wp) { wp->type = NHW_MENU; wp->menu_information = @@ -1258,8 +1211,7 @@ struct xwindow *wp; } void -destroy_menu_window(wp) -struct xwindow *wp; +destroy_menu_window(struct xwindow *wp) { clear_old_menu(wp); /* this will also destroy the widgets */ free((genericptr_t) wp->menu_information); diff --git a/win/X11/winmesg.c b/win/X11/winmesg.c index 0d537d2ff6..ac2e49ea74 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\ : input() \ @@ -51,8 +51,7 @@ static char mesg_translations[] = "#override\n\ /* Move the message window's vertical scrollbar's slider to the bottom. */ void -set_message_slider(wp) -struct xwindow *wp; +set_message_slider(struct xwindow *wp) { Widget scrollbar; float top; @@ -66,10 +65,9 @@ struct xwindow *wp; } void -create_message_window(wp, create_popup, parent) -struct xwindow *wp; /* window pointer */ -boolean create_popup; -Widget parent; +create_message_window(struct xwindow *wp, /* window pointer */ + boolean create_popup, + Widget parent) { Arg args[8]; Cardinal num_args; @@ -204,8 +202,7 @@ Widget parent; } void -destroy_message_window(wp) -struct xwindow *wp; +destroy_message_window(struct xwindow *wp) { if (wp->popup) { nh_XtPopdown(wp->popup); @@ -225,8 +222,7 @@ struct xwindow *wp; /* Redraw message window if new lines have been added. */ void -display_message_window(wp) -struct xwindow *wp; +display_message_window(struct xwindow *wp) { if (wp->mesg_information->dirty) redraw_message_window(wp); @@ -237,9 +233,7 @@ struct xwindow *wp; * rendering of the text is too long for the window. */ void -append_message(wp, str) -struct xwindow *wp; -const char *str; +append_message(struct xwindow *wp, const char *str) { char *mark, *remainder, buf[BUFSZ]; @@ -264,8 +258,7 @@ const char *str; * element. */ static struct line_element * -get_previous(mark) -struct line_element *mark; +get_previous(struct line_element *mark) { struct line_element *curr; @@ -284,9 +277,7 @@ struct line_element *mark; * are no longer used. */ static void -set_circle_buf(mesg_info, count) -struct mesg_info_t *mesg_info; -int count; +set_circle_buf(struct mesg_info_t *mesg_info, int count) { int i; struct line_element *tail, *curr, *head; @@ -361,10 +352,9 @@ int count; * not, back up from the end by words until we find a place to split. */ static char * -split(s, fs, pixel_width) -char *s; -XFontStruct *fs; /* Font for the window. */ -Dimension pixel_width; +split(char *s, + XFontStruct *fs,/* Font for the window. */ + Dimension pixel_width) { char save, *end, *remainder; @@ -394,9 +384,7 @@ Dimension pixel_width; * one. */ static void -add_line(mesg_info, s) -struct mesg_info_t *mesg_info; -const char *s; +add_line(struct mesg_info_t *mesg_info, const char *s) { register struct line_element *curr = mesg_info->head; register int new_line_length = strlen(s); @@ -425,8 +413,7 @@ const char *s; * line above this saved pointer. */ void -set_last_pause(wp) -struct xwindow *wp; +set_last_pause(struct xwindow *wp) { register struct mesg_info_t *mesg_info = wp->mesg_information; @@ -453,8 +440,7 @@ struct xwindow *wp; } static void -redraw_message_window(wp) -struct xwindow *wp; +redraw_message_window(struct xwindow *wp) { struct mesg_info_t *mesg_info = wp->mesg_information; register struct line_element *curr; @@ -498,8 +484,7 @@ struct xwindow *wp; * move the vertical slider to the bottom. */ static void -mesg_check_size_change(wp) -struct xwindow *wp; +mesg_check_size_change(struct xwindow *wp) { struct mesg_info_t *mesg_info = wp->mesg_information; Arg arg[2]; @@ -525,10 +510,9 @@ struct xwindow *wp; /* Event handler for message window expose events. */ /*ARGSUSED*/ static void -mesg_exposed(w, client_data, widget_data) -Widget w; -XtPointer client_data; /* unused */ -XtPointer widget_data; /* expose event from Window widget */ +mesg_exposed(Widget w, + XtPointer client_data, /* unused */ + XtPointer widget_data) /* expose event from Window widget */ { XExposeEvent *event = (XExposeEvent *) widget_data; @@ -558,9 +542,7 @@ XtPointer widget_data; /* expose event from Window widget */ } static void -get_gc(w, mesg_info) -Widget w; -struct mesg_info_t *mesg_info; +get_gc(Widget w, struct mesg_info_t *mesg_info) { XGCValues values; XtGCMask mask = GCFunction | GCForeground | GCBackground | GCFont; @@ -590,9 +572,7 @@ struct mesg_info_t *mesg_info; */ /* ARGSUSED */ static void -mesg_resized(w, client_data, call_data) -Widget w; -XtPointer call_data, client_data; +mesg_resized(Widget w, XtPointer client_data, XtPointer call_data) { Arg args[4]; Cardinal num_args; diff --git a/win/X11/winmisc.c b/win/X11/winmisc.c index 06eaaaa928..2ad424b468 100644 --- a/win/X11/winmisc.c +++ b/win/X11/winmisc.c @@ -61,24 +61,22 @@ static const char gend_select_translations[] = "#override\n\ 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, +static void popup_delete(Widget, XEvent *, String *, Cardinal *); +static void ec_dismiss(void); +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)); + const char **, Widget **, XtCallbackProc, Widget *); +static void init_extended_commands_popup(void); +static void ps_quit(Widget, XtPointer, XtPointer); +static void ps_random(Widget, XtPointer, XtPointer); +static void ps_select(Widget, XtPointer, XtPointer); /* Player Selection -------------------------------------------------------- */ /* ARGSUSED */ static void -ps_quit(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +ps_quit(Widget w, XtPointer client_data, XtPointer call_data) { nhUse(w); nhUse(client_data); @@ -90,9 +88,7 @@ XtPointer client_data, call_data; /* ARGSUSED */ static void -ps_random(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +ps_random(Widget w, XtPointer client_data, XtPointer call_data) { nhUse(w); nhUse(client_data); @@ -104,9 +100,7 @@ XtPointer client_data, call_data; /* ARGSUSED */ static void -ps_select(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +ps_select(Widget w, XtPointer client_data, XtPointer call_data) { nhUse(w); nhUse(call_data); @@ -117,11 +111,7 @@ XtPointer client_data, call_data; /* ARGSUSED */ void -ps_key(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +ps_key(Widget w, XEvent *event, String *params, Cardinal *num_params) { char ch, *mark; char rolechars[QBUFSZ]; @@ -167,11 +157,7 @@ Cardinal *num_params; /* ARGSUSED */ void -race_key(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +race_key(Widget w, XEvent *event, String *params, Cardinal *num_params) { char ch, *mark; char racechars[QBUFSZ]; @@ -215,11 +201,7 @@ Cardinal *num_params; /* ARGSUSED */ void -gend_key(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +gend_key(Widget w, XEvent *event, String *params, Cardinal *num_params) { char ch, *mark; static char gendchars[] = "mf"; @@ -252,11 +234,7 @@ Cardinal *num_params; /* ARGSUSED */ void -algn_key(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +algn_key(Widget w, XEvent *event, String *params, Cardinal *num_params) { char ch, *mark; static char algnchars[] = "LNC"; @@ -604,9 +582,7 @@ X11_get_ext_cmd() */ /* ARGSUSED */ static void -extend_select(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +extend_select(Widget w, XtPointer client_data, XtPointer call_data) { int selected = (int) client_data; @@ -632,9 +608,7 @@ XtPointer client_data, call_data; /* ARGSUSED */ static void -extend_dismiss(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +extend_dismiss(Widget w, XtPointer client_data, XtPointer call_data) { nhUse(w); nhUse(client_data); @@ -645,9 +619,7 @@ XtPointer client_data, call_data; /* ARGSUSED */ static void -extend_help(w, client_data, call_data) -Widget w; -XtPointer client_data, call_data; +extend_help(Widget w, XtPointer client_data, XtPointer call_data) { nhUse(w); nhUse(client_data); @@ -659,11 +631,7 @@ XtPointer client_data, call_data; /* ARGSUSED */ void -ec_delete(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +ec_delete(Widget w, XEvent *event, String *params, Cardinal *num_params) { if (w == extended_command_popup) { ec_dismiss(); @@ -674,11 +642,7 @@ Cardinal *num_params; /* ARGSUSED */ static void -popup_delete(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +popup_delete(Widget w, XEvent *event, String *params, Cardinal *num_params) { nhUse(event); nhUse(params); @@ -703,11 +667,7 @@ ec_dismiss() /* ARGSUSED */ void -ec_key(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +ec_key(Widget w, XEvent *event, String *params, Cardinal *num_params) { char ch; int i; @@ -828,21 +788,18 @@ init_extended_commands_popup() * ------------------------ */ static Widget -make_menu(popup_name, popup_label, popup_translations, left_name, - left_callback, right_name, right_callback, num_names, widget_names, - command_widgets, name_callback, formp) -const char *popup_name; -const char *popup_label; -const char *popup_translations; -const char *left_name; -XtCallbackProc left_callback; -const char *right_name; -XtCallbackProc right_callback; -int num_names; -const char **widget_names; /* return array of command widgets */ -Widget **command_widgets; -XtCallbackProc name_callback; -Widget *formp; /* return */ +make_menu(const char *popup_name, + const char *popup_label, + const char *popup_translations, + const char *left_name, + XtCallbackProc left_callback, + const char *right_name, + XtCallbackProc right_callback, + int num_names, + const char **widget_names, + Widget **command_widgets, /* return array of command widgets */ + XtCallbackProc name_callback, + Widget *formp) /* return */ { Widget popup, form, label, above, left, right; Widget *commands, *curr; diff --git a/win/X11/winstat.c b/win/X11/winstat.c index fde1af8518..23fac4f21b 100644 --- a/win/X11/winstat.c +++ b/win/X11/winstat.c @@ -37,15 +37,14 @@ 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) -struct xwindow *wp; /* window pointer */ -boolean create_popup; -Widget parent; +create_status_window(struct xwindow *wp,/* window pointer */ + boolean create_popup, + Widget parent) { XFontStruct *fs; Arg args[8]; @@ -133,8 +132,7 @@ Widget parent; } void -destroy_status_window(wp) -struct xwindow *wp; +destroy_status_window(struct xwindow *wp) { /* If status_information is defined, then it a "text" status window. */ if (wp->status_information) { @@ -159,9 +157,7 @@ struct xwindow *wp; * + We didn't set stringInPlace on the widget. */ void -adjust_status(wp, str) -struct xwindow *wp; -const char *str; +adjust_status(struct xwindow *wp, const char *str) { Arg args[2]; Cardinal num_args; @@ -205,15 +201,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, - (const 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(const char *, Widget, Widget, Widget, int *); +static Widget init_info_form(Widget, Widget, Widget); /* * Form entry storage indices. @@ -319,8 +314,7 @@ null_out_status() /* This is almost an exact duplicate of hilight_value() */ static void -hilight_label(w) -Widget w; /* label widget */ +hilight_label(Widget w) /* label widget */ { Arg args[2]; Pixel fg, bg; @@ -335,9 +329,7 @@ Widget w; /* label widget */ } static void -update_val(attr_rec, new_value) -struct X_status_value *attr_rec; -long new_value; +update_val(struct X_status_value *attr_rec, long new_value) { char buf[BUFSZ]; Arg args[4]; @@ -570,8 +562,7 @@ long new_value; * [**] HD is shown instead of level and exp if mtimedone is non-zero. */ static void -update_fancy_status(wp) -struct xwindow *wp; +update_fancy_status(struct xwindow *wp) { struct X_status_value *sv; long val; @@ -724,8 +715,7 @@ check_turn_events() /* Return a string for the initial width. */ static const char * -width_string(sv_index) -int sv_index; +width_string(int sv_index) { switch (sv_index) { case F_STR: @@ -780,10 +770,7 @@ int sv_index; } static void -create_widget(parent, sv, sv_index) -Widget parent; -struct X_status_value *sv; -int sv_index; +create_widget(Widget parent, struct X_status_value *sv, int sv_index) { Arg args[4]; Cardinal num_args; @@ -826,9 +813,7 @@ int sv_index; * Get current width of value. width2p is only valid for SV_LABEL types. */ static void -get_widths(sv, width1p, width2p) -struct X_status_value *sv; -int *width1p, *width2p; +get_widths(struct X_status_value *sv, int *width1p, int *width2p) { Arg args[1]; Dimension width; @@ -851,9 +836,7 @@ int *width1p, *width2p; } static void -set_widths(sv, width1, width2) -struct X_status_value *sv; -int width1, width2; +set_widths(struct X_status_value *sv, int width1, int width2) { Arg args[1]; @@ -873,10 +856,7 @@ int width1, width2; } static Widget -init_column(name, parent, top, left, col_indices) -const char *name; -Widget parent, top, left; -int *col_indices; +init_column(const char *name, Widget parent, Widget top, Widget left, int *col_indices) { Widget form; Arg args[4]; @@ -955,8 +935,7 @@ static int col1_indices[] = { F_HP, F_AC, F_GOLD, F_LEVEL, F_POWER, * col1_indices[n] col2_indices[n] */ static Widget -init_info_form(parent, top, left) -Widget parent, top, left; +init_info_form(Widget parent, Widget top, Widget left) { Widget form, col1; struct X_status_value *sv_name, *sv_dlevel; @@ -1019,8 +998,7 @@ Widget parent, top, left; * contains everything. */ static Widget -create_fancy_status(parent, top) -Widget parent, top; +create_fancy_status(Widget parent, Widget top) { Widget form; /* The form that surrounds everything. */ Widget w; @@ -1049,8 +1027,7 @@ Widget parent, top; } static void -destroy_fancy_status(wp) -struct xwindow *wp; +destroy_fancy_status(struct xwindow *wp) { int i; struct X_status_value *sv; diff --git a/win/X11/wintext.c b/win/X11/wintext.c index 433527dae3..0cdfc42899 100644 --- a/win/X11/wintext.c +++ b/win/X11/wintext.c @@ -48,16 +48,12 @@ static const char rip_translations[] = "#override\n\ : rip_dismiss_text()\n\ : rip_dismiss_text()"; -static Widget FDECL(create_ripout_widget, (Widget)); +static Widget create_ripout_widget(Widget); #endif /*ARGSUSED*/ void -delete_text(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +delete_text(Widget w, XEvent *event, String *params, Cardinal *num_params) { struct xwindow *wp; struct text_info_t *text_info; @@ -85,11 +81,7 @@ Cardinal *num_params; */ /*ARGSUSED*/ void -dismiss_text(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +dismiss_text(Widget w, XEvent *event, String *params, Cardinal *num_params) { struct xwindow *wp; struct text_info_t *text_info; @@ -112,11 +104,7 @@ Cardinal *num_params; /* Dismiss when a non-modifier key pressed. */ void -key_dismiss_text(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +key_dismiss_text(Widget w, XEvent *event, String *params, Cardinal *num_params) { char ch = key_event_to_char((XKeyEvent *) event); if (ch) @@ -126,11 +114,7 @@ Cardinal *num_params; #ifdef GRAPHIC_TOMBSTONE /* Dismiss from clicking on rip image. */ void -rip_dismiss_text(w, event, params, num_params) -Widget w; -XEvent *event; -String *params; -Cardinal *num_params; +rip_dismiss_text(Widget w, XEvent *event, String *params, Cardinal *num_params) { dismiss_text(XtParent(w), event, params, num_params); } @@ -138,10 +122,9 @@ Cardinal *num_params; /* ARGSUSED */ void -add_to_text_window(wp, attr, str) -struct xwindow *wp; -int attr; /* currently unused */ -const char *str; +add_to_text_window(struct xwindow *wp, + int attr, /* currently unused */ + const char *str) { struct text_info_t *text_info = wp->text_information; int width; @@ -157,9 +140,7 @@ const char *str; } void -display_text_window(wp, blocking) -struct xwindow *wp; -boolean blocking; +display_text_window(struct xwindow *wp, boolean blocking) { struct text_info_t *text_info; Arg args[8]; @@ -256,8 +237,7 @@ boolean blocking; } void -create_text_window(wp) -struct xwindow *wp; +create_text_window(struct xwindow *wp) { struct text_info_t *text_info; Arg args[8]; @@ -340,8 +320,7 @@ struct xwindow *wp; } void -destroy_text_window(wp) -struct xwindow *wp; +destroy_text_window(struct xwindow *wp) { /* Don't need to pop down, this only called from dismiss_text(). */ @@ -364,8 +343,7 @@ struct xwindow *wp; } void -clear_text_window(wp) -struct xwindow *wp; +clear_text_window(struct xwindow *wp) { clear_text_buffer(&wp->text_information->text); } @@ -375,10 +353,7 @@ struct xwindow *wp; /* Append a line to the text buffer. */ void -append_text_buffer(tb, str, concat) -struct text_buffer *tb; -const char *str; -boolean concat; +append_text_buffer(struct text_buffer *tb, const char *str, boolean concat) { char *copy; int length; @@ -436,8 +411,7 @@ boolean concat; /* Initialize text buffer. */ void -init_text_buffer(tb) -struct text_buffer *tb; +init_text_buffer(struct text_buffer *tb) { tb->text = (char *) alloc(START_SIZE); tb->text[0] = '\0'; @@ -448,8 +422,7 @@ struct text_buffer *tb; /* Empty the text buffer */ void -clear_text_buffer(tb) -struct text_buffer *tb; +clear_text_buffer(struct text_buffer *tb) { tb->text_last = 0; tb->text[0] = '\0'; @@ -458,8 +431,7 @@ struct text_buffer *tb; /* Free up allocated memory. */ void -free_text_buffer(tb) -struct text_buffer *tb; +free_text_buffer(struct text_buffer *tb) { free(tb->text); tb->text = (char *) 0; @@ -470,7 +442,7 @@ struct 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; @@ -532,10 +504,9 @@ calculate_rip_text(int how, time_t when) */ /*ARGSUSED*/ static void -rip_exposed(w, client_data, widget_data) -Widget w; -XtPointer client_data; /* unused */ -XtPointer widget_data; /* expose event from Window widget */ +rip_exposed(Widget w, + XtPointer client_data, /* unused */ + XtPointer widget_data) /* expose event from Window widget */ { XExposeEvent *event = (XExposeEvent *) widget_data; Display *dpy = XtDisplay(w); diff --git a/win/X11/winval.c b/win/X11/winval.c index 66de17926f..b11f74a6e4 100644 --- a/win/X11/winval.c +++ b/win/X11/winval.c @@ -32,9 +32,7 @@ #define WVALUE "value" Widget -create_value(parent, name_value) -Widget parent; -const char *name_value; +create_value(Widget parent, const char *name_value) { Widget form, name; Arg args[8]; @@ -75,9 +73,7 @@ const char *name_value; } void -set_name(w, new_label) -Widget w; -const char *new_label; +set_name(Widget w, const char *new_label) { Arg args[1]; Widget name; @@ -88,9 +84,7 @@ const char *new_label; } void -set_name_width(w, new_width) -Widget w; -int new_width; +set_name_width(Widget w, int new_width) { Arg args[1]; Widget name; @@ -101,8 +95,7 @@ int new_width; } int -get_name_width(w) -Widget w; +get_name_width(Widget w) { Arg args[1]; Dimension width; @@ -115,9 +108,7 @@ Widget w; } void -set_value(w, new_value) -Widget w; -const char *new_value; +set_value(Widget w, const char *new_value) { Arg args[1]; Widget val; @@ -128,9 +119,7 @@ const char *new_value; } void -set_value_width(w, new_width) -Widget w; -int new_width; +set_value_width(Widget w, int new_width) { Arg args[1]; Widget val; @@ -141,8 +130,7 @@ int new_width; } int -get_value_width(w) -Widget w; +get_value_width(Widget w) { Arg args[1]; Widget val; @@ -157,16 +145,14 @@ Widget w; /* Swap foreground and background colors (this is the best I can do with */ /* a label widget, unless I can get some init hook in there). */ void -hilight_value(w) -Widget w; +hilight_value(Widget w) { swap_fg_bg(XtNameToWidget(w, WVALUE)); } /* Swap the foreground and background colors of the given widget */ void -swap_fg_bg(w) -Widget w; +swap_fg_bg(Widget w) { Arg args[2]; Pixel fg, bg; diff --git a/win/chain/wc_chainin.c b/win/chain/wc_chainin.c index 66362bd0be..1201abff74 100644 --- a/win/chain/wc_chainin.c +++ b/win/chain/wc_chainin.c @@ -124,7 +124,7 @@ winid window; void chainin_display_nhwindow(window, blocking) winid window; -BOOLEAN_P blocking; +boolean blocking; { (*cibase->nprocs->win_display_nhwindow)(cibase->ndata, window, blocking); } diff --git a/win/chain/wc_chainout.c b/win/chain/wc_chainout.c index 85b265117a..0933d2a0fd 100644 --- a/win/chain/wc_chainout.c +++ b/win/chain/wc_chainout.c @@ -146,7 +146,7 @@ void chainout_display_nhwindow(vp, window, blocking) void *vp; winid window; -BOOLEAN_P blocking; +boolean blocking; { struct chainout_data *tdp = vp; diff --git a/win/chain/wc_trace.c b/win/chain/wc_trace.c index 9073e062a9..fa229ad8b7 100644 --- a/win/chain/wc_trace.c +++ b/win/chain/wc_trace.c @@ -244,7 +244,7 @@ void trace_display_nhwindow(vp, window, blocking) void *vp; winid window; -BOOLEAN_P blocking; +boolean blocking; { struct trace_data *tdp = vp; diff --git a/win/gem/tile2img.c b/win/gem/tile2img.c index 765b4a7c1c..1eabbb596c 100644 --- a/win/gem/tile2img.c +++ b/win/gem/tile2img.c @@ -18,8 +18,8 @@ /* #define COLORS_IN_USE MAXCOLORMAPSIZE /* 256 colors */ #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); @@ -50,9 +50,7 @@ char bmpname[128]; FILE *fp; int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { int i; @@ -135,8 +133,7 @@ get_pixel(int x, int y, unsigned int *colind) } static void -build_ximgtile(pixels) -pixel (*pixels)[TILE_X]; +build_ximgtile(pixel (*pixels)[TILE_X]) { int cur_x, cur_y, cur_color; int x, y; diff --git a/win/gem/wingem.c b/win/gem/wingem.c index 33b3702758..16f30bf1d3 100644 --- a/win/gem/wingem.c +++ b/win/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); @@ -82,15 +82,12 @@ struct window_procs Gem_procs = { #ifdef MAC void * -Gem_change_background(dummy) -int dummy; +Gem_change_background(int dummy) { } short * -Gem_set_font_name(foo, bar) -winid foo; -char *bar; +Gem_set_font_name(winid foo, char *bar) { } #endif @@ -124,8 +121,7 @@ mar_get_msg_visible() } /* clean up and quit */ static void -bail(mesg) -const char *mesg; +bail(const char *mesg) { clearlocks(); Gem_exit_nhwindows(mesg); @@ -146,9 +142,7 @@ const char *mesg; /*$$$*/ /*ARGSUSED*/ void -Gem_init_nhwindows(argcp, argv) -int *argcp; -char **argv; +Gem_init_nhwindows(int *argcp, char **argv) { argv = argv, argcp = argcp; colors_changed = TRUE; @@ -513,8 +507,7 @@ Gem_get_nh_event() } void -Gem_suspend_nhwindows(str) -const char *str; +Gem_suspend_nhwindows(const char *str) { const char *foo; @@ -540,8 +533,7 @@ extern void mar_exit_nhwindows(void); extern boolean run_from_desktop; void -Gem_exit_nhwindows(str) -const char *str; +Gem_exit_nhwindows(const char *str) { if (str) Gem_raw_print(str); @@ -552,8 +544,7 @@ const char *str; } winid -Gem_create_nhwindow(type) -int type; +Gem_create_nhwindow(int type) { winid newid; @@ -596,8 +587,7 @@ Gem_nhbell() extern void mar_clear_map(void); void -Gem_clear_nhwindow(window) -winid window; +Gem_clear_nhwindow(winid window) { if (window == WIN_ERR) panic(winpanicstr, window); @@ -620,9 +610,7 @@ extern void mar_more(void); /*ARGSUSED*/ void -Gem_display_nhwindow(window, blocking) -winid window; -boolean blocking; +Gem_display_nhwindow(winid window, boolean blocking) { if (window == WIN_ERR) panic(winpanicstr, window); @@ -647,8 +635,7 @@ boolean blocking; } void -Gem_destroy_nhwindow(window) -winid window; +Gem_destroy_nhwindow(winid window) { if (window == WIN_ERR) /* MAR -- test existence */ panic(winpanicstr, window); @@ -659,9 +646,7 @@ winid window; extern void mar_curs(int, int); /* mar_curs is only for map */ void -Gem_curs(window, x, y) -winid window; -register int x, y; +Gem_curs(winid window, register int x, register int y) { if (window == WIN_ERR) /* MAR -- test existence */ panic(winpanicstr, window); @@ -676,10 +661,7 @@ extern void mar_add_status_str(const char *, int); extern void mar_putstr_text(winid, int, const char *); void -Gem_putstr(window, attr, str) -winid window; -int attr; -const char *str; +Gem_putstr(winid window, int attr, const char *str) { int win_type; @@ -722,9 +704,7 @@ const char *str; } void -Gem_display_file(fname, complain) -const char *fname; -boolean complain; +Gem_display_file(const char *fname, boolean complain) { dlb *f; char buf[BUFSZ]; @@ -757,15 +737,14 @@ boolean complain; * later. */ void -Gem_add_menu(window, glyph, 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) */ -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 Gem_putstr()) */ -const char *str; /* menu string */ -boolean preselected; /* item is marked as selected */ +Gem_add_menu(winid window, /* window to use, must be of type NHW_MENU */ + int glyph, /* glyph to display with item (unused) */ + 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 Gem_putstr()) */ + const char *str, /* menu string */ + boolean preselected) /* item is marked as selected */ { Gem_menu_item *G_item; const char *newstr; @@ -800,9 +779,8 @@ boolean preselected; /* item is marked as selected */ * We assign the keyboard accelerators as needed. */ void -Gem_end_menu(window, prompt) -winid window; /* menu to use */ -const char *prompt; /* prompt to for menu */ +Gem_end_menu(winid window, /* menu to use */ + const char *prompt) /* prompt to for menu */ { if (window == WIN_ERR || mar_hol_win_type(window) != NHW_MENU) panic(winpanicstr, window); @@ -817,10 +795,7 @@ const char *prompt; /* prompt to for menu */ } int -Gem_select_menu(window, how, menu_list) -winid window; -int how; -menu_item **menu_list; +Gem_select_menu(winid window, int how, menu_item **menu_list) { Gem_menu_item *Gmit; menu_item *mi; @@ -875,8 +850,7 @@ Gem_wait_synch() #ifdef CLIPPING extern void mar_cliparound(void); void -Gem_cliparound(x, y) -int x, y; +Gem_cliparound(int x, int y) { mar_curs(x - 1, y); mar_cliparound(); @@ -899,10 +873,7 @@ extern int mar_set_rogue(int); extern void mar_add_pet_sign(winid, int, int); void -Gem_print_glyph(window, x, y, glyph, bkglyph) -winid window; -xchar x, y; -int glyph, bkglyph; +Gem_print_glyph(winid window, xchar x, xchar y, int glyph, int bkglyph) { /* Move the cursor. */ Gem_curs(window, x, y); @@ -925,10 +896,7 @@ int glyph, bkglyph; void mar_print_char(winid, xchar, xchar, char, int); void -mar_print_gl_char(window, x, y, glyph) -winid window; -xchar x, y; -int glyph; +mar_print_gl_char(winid window, xchar x, xchar y, int glyph) { int ch; int color; @@ -950,8 +918,7 @@ extern void mar_raw_print(const char *); extern void mar_raw_print_bold(const char *); void -Gem_raw_print(str) -const char *str; +Gem_raw_print(const char *str) { if (str && *str) { if (iflags.window_inited) @@ -962,8 +929,7 @@ const char *str; } void -Gem_raw_print_bold(str) -const char *str; +Gem_raw_print_bold(const char *str) { if (str && *str) { if (iflags.window_inited) @@ -1029,8 +995,7 @@ Gem_get_ext_cmd() } void -Gem_number_pad(state) -int state; +Gem_number_pad(int state) { state = state; } @@ -1042,8 +1007,7 @@ win_Gem_init() #ifdef POSITIONBAR void -Gem_update_positionbar(posbar) -char *posbar; +Gem_update_positionbar(char *posbar) { } #endif @@ -1053,10 +1017,7 @@ void mar_set_text_to_rip(winid); char **rip_line = 0; void -Gem_outrip(w, how, when) -winid w; -int how; -time_t when; +Gem_outrip(winid w, int how, time_t when) { /* Code from X11 windowport */ #define STONE_LINE_LEN 15 /* # chars that fit on one line */ @@ -1114,10 +1075,7 @@ time_t when; putstr(w, 0, ""); } void -mar_get_font(type, p_fname, psize) -int type; -char **p_fname; -int *psize; +mar_get_font(int type, char **p_fname, int *psize) { switch (type) { case NHW_MESSAGE: @@ -1145,8 +1103,7 @@ int *psize; } } void -Gem_preference_update(pref) -const char *pref; +Gem_preference_update(const char *pref) { if (stricmp(pref, "font_message") == 0 || stricmp(pref, "font_size_message") == 0) { @@ -1224,8 +1181,7 @@ const char *pref; * 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 = nullstr; diff --git a/win/gem/wingem1.c b/win/gem/wingem1.c index 368aff27e1..98cc8f1eef 100644 --- a/win/gem/wingem1.c +++ b/win/gem/wingem1.c @@ -21,23 +21,23 @@ typedef signed char schar; #include "wintype.h" #undef genericptr_t -#define NDECL(f) f(void) +#define NDECL(f) f() #define FDECL(f, p) f p -#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 char char +#define schar schar +#define uchar uchar +#define xchar xchar +#define short short +#define boolean 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 char +#undef schar +#undef uchar +#undef xchar +#undef short +#undef boolean #undef ALIGNTYP_P #undef NDECL #undef FDECL @@ -362,29 +362,25 @@ mar_ob_mapcenter(OBJECT *p_obj) * *************************************/ void -mar_set_no_glyph(ng) -int ng; +mar_set_no_glyph(int ng) { no_glyph = ng; } void -mar_set_tilefile(name) -char *name; +mar_set_tilefile(char *name) { Tilefile = name; } void -mar_set_tilex(value) -int value; +mar_set_tilex(int value) { Min(&value, 32); Max(&value, 1); Tile_width = value; } void -mar_set_tiley(value) -int value; +mar_set_tiley(int value) { Min(&value, 32); Max(&value, 1); @@ -968,9 +964,7 @@ my_close_dialog(DIAINFO *dialog, boolean shrink_box) } void -mar_get_rsc_tree(obj_number, z_ob_obj) -int obj_number; -OBJECT **z_ob_obj; +mar_get_rsc_tree(int obj_number, OBJECT **z_ob_obj) { rsrc_gaddr(R_TREE, obj_number, z_ob_obj); fix_objects(*z_ob_obj, SCALING, 0, 0); @@ -979,8 +973,7 @@ OBJECT **z_ob_obj; void mar_clear_map(void); void -img_error(errnumber) -int errnumber; +img_error(int errnumber) { char buf[BUFSZ]; @@ -1243,8 +1236,7 @@ mar_exit_nhwindows() /************************* mar_curs *******************************/ void -mar_curs(x, y) -int x, y; +mar_curs(int x, int y) { Min(&dirty_map_area.g_x, x); Min(&dirty_map_area.g_y, y); @@ -1337,27 +1329,21 @@ send_return() } int -K_Init(xev, availiable) -XEVENT *xev; -int availiable; +K_Init(XEVENT *xev, int availiable) { xev = xev; return (MU_KEYBD & availiable); } int -KM_Init(xev, availiable) -XEVENT *xev; -int availiable; +KM_Init(XEVENT *xev, int availiable) { xev = xev; return ((MU_KEYBD | MU_MESAG) & availiable); } int -M_Init(xev, availiable) -XEVENT *xev; -int availiable; +M_Init(XEVENT *xev, int availiable) { xev = xev; return (MU_MESAG & availiable); @@ -1366,8 +1352,7 @@ int availiable; #define More_Init K_Init int -More_Handler(xev) -XEVENT *xev; +More_Handler(XEVENT *xev) { int ev = xev->ev_mwich; @@ -1425,8 +1410,7 @@ mar_more() /************************* Gem_start_menu *******************************/ void -Gem_start_menu(win) -winid win; +Gem_start_menu(winid win) { win = win; if (invent_list) { @@ -1446,9 +1430,7 @@ winid win; /************************* mar_add_menu *******************************/ void -mar_add_menu(win, item) -winid win; -Gem_menu_item *item; +mar_add_menu(winid win, Gem_menu_item *item) { win = win; item->Gmi_next = invent_list; @@ -1544,8 +1526,7 @@ mar_putstr_text(winid window, int attr, const char *str) } int -mar_set_inv_win(Anzahl, Breite) -int Anzahl, Breite; +mar_set_inv_win(int Anzahl, int Breite) { OBJECT *z_ob = zz_oblist[LINES]; int retval = WIN_DIAL | MODAL | NO_ICONIFY; @@ -1620,8 +1601,7 @@ mar_status_dirty() /************************* mar_add_message *******************************/ void -mar_add_message(str) -const char *str; +mar_add_message(const char *str) { int i, mesg_hist = mar_get_msg_history(); char *tmp, *rest, buf[TBUFSZ]; @@ -1684,9 +1664,7 @@ const char *str; /************************* mar_add_status_str *******************************/ void -mar_add_status_str(str, line) -const char *str; -int line; +mar_add_status_str(const char *str, int line) { int i, last_diff = -1; GRECT area = { 0, line * status_font.ch, status_font.cw, status_font.ch }; @@ -1720,8 +1698,7 @@ int line; /************************* mar_set_menu_title *******************************/ void -mar_set_menu_title(str) -const char *str; +mar_set_menu_title(const char *str) { test_free(Menu_title); /* just in case */ Menu_title = mar_copy_of(str ? str : nullstr); @@ -1730,8 +1707,7 @@ const char *str; /************************* mar_set_menu_type *******************************/ void -mar_set_menu_type(how) -int how; +mar_set_menu_type(int how) { Inv_how = how; } @@ -1739,8 +1715,7 @@ int how; /************************* Inventory Utils *******************************/ void -set_all_on_page(start, page) -int start, page; +set_all_on_page(int start, int page) { Gem_menu_item *curr; @@ -1755,8 +1730,7 @@ int start, page; } void -unset_all_on_page(start, page) -int start, page; +unset_all_on_page(int start, int page) { Gem_menu_item *curr; @@ -1773,9 +1747,7 @@ int start, page; } void -invert_all_on_page(start, page, acc) -int start, page; -char acc; +invert_all_on_page(int start, int page, char acc) { Gem_menu_item *curr; @@ -1835,8 +1807,7 @@ scroll_top_dialog(char ch) #define Text_Init KM_Init int -Text_Handler(xev) -XEVENT *xev; +Text_Handler(XEVENT *xev) { int ev = xev->ev_mwich; @@ -1873,8 +1844,7 @@ XEVENT *xev; static long count = 0; int -Inv_Handler(xev) -XEVENT *xev; +Inv_Handler(XEVENT *xev) { int ev = xev->ev_mwich; Gem_menu_item *it; @@ -2044,10 +2014,7 @@ XEVENT *xev; /************************* draw_window *******************************/ static void -mar_draw_window(first, win, area) -int first; -WIN *win; -GRECT *area; +mar_draw_window(int first, WIN *win, GRECT *area) { OBJECT *obj = (OBJECT *) win->para; @@ -2195,8 +2162,7 @@ calc_std_winplace(int which, GRECT *place) } void -mar_display_nhwindow(wind) -winid wind; +mar_display_nhwindow(winid wind) { DIAINFO *dlg_info; OBJECT *z_ob; @@ -2435,15 +2401,13 @@ winid wind; /************************* create_window *******************************/ int -mar_hol_win_type(window) -winid window; +mar_hol_win_type(winid window) { return (Gem_nhwindow[window].gw_type); } winid -mar_create_window(type) -int type; +mar_create_window(int type) { winid newid; static char name[] = "Gem"; @@ -2504,8 +2468,7 @@ int type; } void -mar_change_menu_2_text(win) -winid win; +mar_change_menu_2_text(winid win) { Gem_nhwindow[win].gw_type = NHW_TEXT; } @@ -2534,8 +2497,7 @@ mar_clear_map() /************************* destroy_window *******************************/ void -mar_destroy_nhwindow(window) -winid window; +mar_destroy_nhwindow(winid window) { int i; @@ -2639,9 +2601,7 @@ mar_update_value() } int -Main_Init(xev, availiable) -XEVENT *xev; -int availiable; +Main_Init(XEVENT *xev, int availiable) { xev->ev_mb1mask = xev->ev_mb1state = 1; xev->ev_mb1clicks = xev->ev_mb2clicks = xev->ev_mb2mask = @@ -2655,8 +2615,7 @@ int availiable; */ /*ARGSUSED*/ int -mar_nh_poskey(x, y, mod) -int *x, *y, *mod; +mar_nh_poskey(int *x, int *y, int *mod) { static XEVENT xev; int retval, ev; @@ -2818,8 +2777,7 @@ int *x, *y, *mod; } int -Gem_nh_poskey(x, y, mod) -int *x, *y, *mod; +Gem_nh_poskey(int *x, int *y, int *mod) { mar_update_value(); return (mar_nh_poskey(x, y, mod)); @@ -2848,8 +2806,7 @@ Gem_doprev_message() int mar_set_rogue(int); int -mar_set_tile_mode(tiles) -int tiles; +mar_set_tile_mode(int tiles) { static int tile_mode = TRUE; static GRECT prev; @@ -2882,8 +2839,7 @@ int tiles; } int -mar_set_rogue(what) -int what; +mar_set_rogue(int what) { static int rogue = FALSE, prev_mode = TRUE; @@ -2901,9 +2857,7 @@ int what; } void -mar_add_pet_sign(window, x, y) -winid window; -int x, y; +mar_add_pet_sign(winid window, int x, int y) { if (window != WIN_ERR && window == WIN_MAP) { static int pla[8] = { 0, 0, 7, 7, 0, 0, 0, 0 }, @@ -2918,9 +2872,7 @@ int x, y; } void -mar_print_glyph(window, x, y, gl, bkgl) -winid window; -int x, y, gl, bkgl; +mar_print_glyph(winid window, int x, int y, int gl, int bkgl) { if (window != WIN_ERR && window == WIN_MAP) { static int pla[8]; @@ -2940,11 +2892,7 @@ int x, y, gl, bkgl; } void -mar_print_char(window, x, y, ch, col) -winid window; -int x, y; -char ch; -int col; +mar_print_char(winid window, int x, int y, char ch, int col) { if (window != WIN_ERR && window == WIN_MAP) { static int gem_color[16] = { 9, 2, 11, 10, 4, 7, 8, 15, @@ -2970,9 +2918,7 @@ int col; /************************* getlin *******************************/ void -Gem_getlin(ques, input) -const char *ques; -char *input; +Gem_getlin(const char *ques, char *input) { OBJECT *z_ob = zz_oblist[LINEGET]; int d_exit, length; @@ -3020,8 +2966,7 @@ char *input; #define Dia_Init K_Init int -Dia_Handler(xev) -XEVENT *xev; +Dia_Handler(XEVENT *xev) { int ev = xev->ev_mwich; char ch = (char) (xev->ev_mkreturn & 0x00FF); @@ -3081,8 +3026,7 @@ mar_ask_direction() #define any_init M_Init static int -any_handler(xev) -XEVENT *xev; +any_handler(XEVENT *xev) { int ev = xev->ev_mwich; @@ -3116,8 +3060,7 @@ send_yn_esc(char ch) #define single_init K_Init static int -single_handler(xev) -XEVENT *xev; +single_handler(XEVENT *xev) { int ev = xev->ev_mwich; @@ -3146,9 +3089,7 @@ XEVENT *xev; } char -Gem_yn_function(query, resp, def) -const char *query, *resp; -char def; +Gem_yn_function(const char *query, const char *resp, char def) { OBJECT *z_ob = zz_oblist[YNCHOICE]; int d_exit, i, len; @@ -3258,8 +3199,7 @@ char def; * This is an exact duplicate of copy_of() in X11/winmenu.c. */ static char * -mar_copy_of(s) -const char *s; +mar_copy_of(const char *s) { if (!s) s = nullstr; @@ -3269,16 +3209,14 @@ const char *s; const char *strRP = "raw_print", *strRPB = "raw_print_bold"; void -mar_raw_print(str) -const char *str; +mar_raw_print(const char *str) { xalert(1, FAIL, X_ICN_INFO, NULL, APPL_MODAL, BUTTONS_CENTERED, TRUE, strRP, str, NULL); } void -mar_raw_print_bold(str) -const char *str; +mar_raw_print_bold(const char *str) { char buf[BUFSZ]; diff --git a/win/gem/xpm2img.c b/win/gem/xpm2img.c index fed4ac08fc..d4d550903d 100644 --- a/win/gem/xpm2img.c +++ b/win/gem/xpm2img.c @@ -24,9 +24,7 @@ int width = 0, height = 0; int initflag; FILE *fp; int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { int i; int row, col, planeno; diff --git a/win/gnome/gnbind.c b/win/gnome/gnbind.c index cc40bb1372..cd2eb53d57 100644 --- a/win/gnome/gnbind.c +++ b/win/gnome/gnbind.c @@ -505,7 +505,7 @@ gnome_clear_nhwindow(winid wid) --more--, if necessary, in the tty window-port. */ void -gnome_display_nhwindow(winid wid, BOOLEAN_P block) +gnome_display_nhwindow(winid wid, boolean block) { if (gnome_windowlist[wid].win != NULL) { gtk_signal_emit(GTK_OBJECT(gnome_windowlist[wid].win), @@ -583,7 +583,7 @@ gnome_putstr(winid wid, int attr, const char *text) iff complain is TRUE. */ void -gnome_display_file(const char *filename, BOOLEAN_P must_exist) +gnome_display_file(const char *filename, boolean must_exist) { /* Strange -- for some reason it makes us create a new text window * instead of reusing any existing ones -- perhaps we can work out @@ -715,8 +715,8 @@ identifier */ void gnome_add_menu(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) { GHackMenuItem item; item.glyph = glyph; @@ -856,7 +856,7 @@ print_glyph(window, x, y, glyph, bkglyph) a 1-1 map between glyphs and distinct things on the map). */ void -gnome_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph, int bkglyph) +gnome_print_glyph(winid wid, xchar x, xchar y, int glyph, int bkglyph) { if (wid != -1 && gnome_windowlist[wid].win != NULL) { GdkImlibImage *im; @@ -1026,7 +1026,7 @@ char yn_function(const char *ques, const char *choices, char default) ports might use a popup. */ char -gnome_yn_function(const char *question, const char *choices, CHAR_P def) +gnome_yn_function(const char *question, const char *choices, char def) { int ch; int result = -1; diff --git a/win/gnome/gnbind.h b/win/gnome/gnbind.h index a4e6b91395..b14573f1d5 100644 --- a/win/gnome/gnbind.h +++ b/win/gnome/gnbind.h @@ -48,15 +48,15 @@ void gnome_resume_nhwindows(void); winid gnome_create_nhwindow(int type); void gnome_create_nhwindow_by_id(int type, winid i); void gnome_clear_nhwindow(winid wid); -void gnome_display_nhwindow(winid wid, BOOLEAN_P block); +void gnome_display_nhwindow(winid wid, boolean block); void gnome_destroy_nhwindow(winid wid); void gnome_curs(winid wid, int x, int y); void gnome_putstr(winid wid, int attr, const char *text); -void gnome_display_file(const char *filename, BOOLEAN_P must_exist); +void gnome_display_file(const char *filename, boolean must_exist); void gnome_start_menu(winid wid); void gnome_add_menu(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); void gnome_end_menu(winid wid, const char *prompt); int gnome_select_menu(winid wid, int how, MENU_ITEM_P **selected); /* No need for message_menu -- we'll use genl_message_menu instead */ @@ -68,14 +68,14 @@ void gnome_cliparound(int x, int y); * gnome_cliparound (which lacks the winid) simply calls this function. */ void gnome_cliparound_proper(winid wid, int x, int y); -void gnome_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph); +void gnome_print_glyph(winid wid, xchar x, xchar y, int glyph); void gnome_raw_print(const char *str); void gnome_raw_print_bold(const char *str); int gnome_nhgetch(void); int gnome_nh_poskey(int *x, int *y, int *mod); void gnome_nhbell(void); int gnome_doprev_message(void); -char gnome_yn_function(const char *question, const char *choices, CHAR_P def); +char gnome_yn_function(const char *question, const char *choices, char def); void gnome_getlin(const char *question, char *input); int gnome_get_ext_cmd(void); void gnome_number_pad(int state); diff --git a/win/gnome/gnmap.c b/win/gnome/gnmap.c index 98e80b485b..937912cedf 100644 --- a/win/gnome/gnmap.c +++ b/win/gnome/gnmap.c @@ -329,7 +329,7 @@ ghack_map_putstr(GtkWidget *win, int attr, const char *text, gpointer data) * ghack_map_print_glyph( ) * * ARGUMENTS: - * XCHAR_P x, y -- The coordinates where which to print the glyph + * xchar x, y -- The coordinates where which to print the glyph * GdkImlibImage* glyph -- The glyph image to print * * RETURNS: diff --git a/win/gnome/gnmenu.h b/win/gnome/gnmenu.h index f6ba3231d6..cf298fa058 100644 --- a/win/gnome/gnmenu.h +++ b/win/gnome/gnmenu.h @@ -15,11 +15,11 @@ GtkWidget *ghack_init_menu_window(void); struct _GHackMenuItem { int glyph; const ANY_P *identifier; - CHAR_P accelerator; - CHAR_P group_accel; + char accelerator; + char group_accel; int attr; const char *str; - BOOLEAN_P presel; + boolean presel; }; typedef struct _GHackMenuItem GHackMenuItem; diff --git a/win/share/gifread.c b/win/share/gifread.c index 28c5215e17..d86442fcca 100644 --- a/win/share/gifread.c +++ b/win/share/gifread.c @@ -20,7 +20,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) \ @@ -65,24 +65,22 @@ 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(*) [TILE_X])); -int NDECL(fclose_gif_file); +boolean fopen_gif_file(const char *, const char *); +boolean read_gif_tile(pixel(*) [TILE_X]); +int fclose_gif_file(void); static int -GetDataBlock(fd, buf) -FILE *fd; -unsigned char *buf; +GetDataBlock(FILE *fd, unsigned char *buf) { unsigned char count; @@ -102,9 +100,7 @@ unsigned char *buf; } static void -DoExtension(fd, label) -FILE *fd; -int label; +DoExtension(FILE *fd, int label) { static char buf[256]; char *str; @@ -169,9 +165,7 @@ int label; } static boolean -ReadColorMap(fd, number) -FILE *fd; -int number; +ReadColorMap(FILE *fd, int number) { int i; unsigned char rgb[3]; @@ -194,8 +188,7 @@ int number; * file, so if that image has a local colormap, overwrite the global one. */ static void -read_header(fd) -FILE *fd; +read_header(FILE *fd) { unsigned char buf[16]; unsigned char c; @@ -294,10 +287,7 @@ FILE *fd; } static int -GetCode(fd, code_size, flag) -FILE *fd; -int code_size; -int flag; +GetCode(FILE *fd, int code_size, int flag) { static unsigned char buf[280]; static int curbit, lastbit, done, last_byte; @@ -338,10 +328,7 @@ int flag; } static int -LWZReadByte(fd, flag, input_code_size) -FILE *fd; -int flag; -int input_code_size; +LWZReadByte(FILE *fd, int flag, int input_code_size) { static int fresh = FALSE; int code, incode; @@ -454,9 +441,7 @@ int input_code_size; } static void -ReadInterleavedImage(fd, len, height) -FILE *fd; -int len, height; +ReadInterleavedImage(FILE *fd, int len, int height) { int v; int xpos = 0, ypos = 0, pass = 0; @@ -508,9 +493,7 @@ int len, height; } static void -ReadTileStrip(fd, len) -FILE *fd; -int len; +ReadTileStrip(FILE *fd, int len) { int v; int xpos = 0, ypos = 0; @@ -530,9 +513,7 @@ int len; } boolean -fopen_gif_file(filename, type) -const char *filename; -const char *type; +fopen_gif_file(const char *filename, const char *type) { int i; @@ -599,8 +580,7 @@ const char *type; /* Read a tile. Returns FALSE when there are no more tiles */ boolean -read_gif_tile(pixels) -pixel (*pixels)[TILE_X]; +read_gif_tile(pixel (*pixels)[TILE_X]) { int i, j; @@ -670,9 +650,7 @@ static char *std_args[] = { "tilemap", /* dummy argv[0] */ "objects.txt", "other.gif", "other.txt" }; int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { pixel pixels[TILE_Y][TILE_X]; diff --git a/win/share/ppmwrite.c b/win/share/ppmwrite.c index 9fd052c6e4..4a6686f342 100644 --- a/win/share/ppmwrite.c +++ b/win/share/ppmwrite.c @@ -7,7 +7,7 @@ #include "tile.h" #ifndef MONITOR_HEAP -extern long *FDECL(alloc, (unsigned int)); +extern long *alloc(unsigned int); #endif FILE *ppm_file; @@ -20,8 +20,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(void); +static void WriteTileStrip(void); static void write_header() @@ -45,9 +45,7 @@ WriteTileStrip() } boolean -fopen_ppm_file(filename, type) -const char *filename; -const char *type; +fopen_ppm_file(const char *filename, const char *type) { int i; @@ -84,8 +82,7 @@ const char *type; } boolean -write_ppm_tile(pixels) -pixel (*pixels)[TILE_X]; +write_ppm_tile(pixel (*pixels)[TILE_X]) { int i, j; @@ -139,9 +136,7 @@ fclose_ppm_file() } int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { pixel pixels[TILE_Y][TILE_X]; diff --git a/win/share/thintile.c b/win/share/thintile.c index 6980623c00..94b7ce7e4d 100644 --- a/win/share/thintile.c +++ b/win/share/thintile.c @@ -98,9 +98,7 @@ write_thintile() Fprintf(outfile, "}\n"); } int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { while (filenum < 3) { tilecount_per_file = 0; diff --git a/win/share/tile.h b/win/share/tile.h index 566cc386c6..784d234abf 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(void); -extern void NDECL(init_colormap); -extern void NDECL(merge_colormap); +extern void init_colormap(void); +extern void merge_colormap(void); #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 00bc76ab91..e14794c058 100644 --- a/win/share/tile2bmp.c +++ b/win/share/tile2bmp.c @@ -27,7 +27,7 @@ #define BITCOUNT 8 -extern char *FDECL(tilename, (int, int)); +extern char *tilename(int, int); #define MAGICTILENO (340 + 440 + 231 + 340) @@ -142,9 +142,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) @@ -168,9 +168,7 @@ char bmpname[128]; FILE *fp; int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { int i, j; @@ -251,8 +249,7 @@ char *argv[]; } static void -build_bmfh(pbmfh) -BITMAPFILEHEADER *pbmfh; +build_bmfh(BITMAPFILEHEADER *pbmfh) { pbmfh->bfType = leshort(0x4D42); pbmfh->bfSize = lelong(BMPFILESIZE); @@ -263,8 +260,7 @@ BITMAPFILEHEADER *pbmfh; } static void -build_bmih(pbmih) -BITMAPINFOHEADER *pbmih; +build_bmih(BITMAPINFOHEADER *pbmih) { WORD cClrBits; int w, h; @@ -320,8 +316,7 @@ static int graymappings[] = { }; static void -build_bmptile(pixels) -pixel (*pixels)[TILE_X]; +build_bmptile(pixel (*pixels)[TILE_X]) { int cur_x, cur_y, cur_color, apply_color; int x, y; diff --git a/win/share/tilemap.c b/win/share/tilemap.c index e41d618e64..d89ffdda1d 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -9,14 +9,14 @@ #include "hack.h" -const char *FDECL(tilename, (int, int)); -void NDECL(init_tilemap); -void FDECL(process_substitutions, (FILE *)); +const char *tilename(int, int); +void init_tilemap(void); +void process_substitutions(FILE *); #if defined(MICRO) || defined(WIN32) #undef exit #if !defined(MSDOS) && !defined(WIN32) -extern void FDECL(exit, (int)); +extern void exit(int); #endif #endif @@ -98,8 +98,7 @@ struct substitute { * entry is the position of the tile within the monsters/objects/other set */ const char * -tilename(set, entry) -int set, entry; +tilename(int set, int entry) { int i, j, condnum, tilenum; static char buf[BUFSZ]; @@ -399,8 +398,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; diff --git a/win/share/tiletext.c b/win/share/tiletext.c index fdd40c00b0..63d0132b60 100644 --- a/win/share/tiletext.c +++ b/win/share/tiletext.c @@ -25,11 +25,11 @@ static const char *text_sets[] = { "monsters.txt", "objects.txt", "other.txt" }; #endif -extern const char *FDECL(tilename, (int, int)); -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); +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 \ @@ -37,8 +37,7 @@ static void FDECL(write_txttile, (FILE *, pixel (*)[TILE_X])); "(%d, %d, %d) " static void -read_text_colormap(txtfile) -FILE *txtfile; +read_text_colormap(FILE *txtfile) { int i, r, g, b; char c[2]; @@ -60,8 +59,7 @@ FILE *txtfile; #undef FORMAT_STRING static boolean -write_text_colormap(txtfile) -FILE *txtfile; +write_text_colormap(FILE *txtfile) { int i; char c; @@ -88,9 +86,7 @@ FILE *txtfile; } static boolean -read_txttile(txtfile, pixels) -FILE *txtfile; -pixel (*pixels)[TILE_X]; +read_txttile(FILE *txtfile, pixel (*pixels)[TILE_X]) { int ph, i, j, k; char buf[BUFSZ], ttype[BUFSZ]; @@ -167,9 +163,7 @@ pixel (*pixels)[TILE_X]; } static void -write_txttile(txtfile, pixels) -FILE *txtfile; -pixel (*pixels)[TILE_X]; +write_txttile(FILE *txtfile, pixel (*pixels)[TILE_X]) { const char *p; const char *type; @@ -252,9 +246,7 @@ merge_colormap() } boolean -fopen_text_file(filename, type) -const char *filename; -const char *type; +fopen_text_file(const char *filename, const char *type) { const char *p; int i; @@ -310,15 +302,13 @@ const char *type; } boolean -read_text_tile(pixels) -pixel (*pixels)[TILE_X]; +read_text_tile(pixel (*pixels)[TILE_X]) { return (read_txttile(tile_file, pixels)); } boolean -write_text_tile(pixels) -pixel (*pixels)[TILE_X]; +write_text_tile(pixel (*pixels)[TILE_X]) { write_txttile(tile_file, pixels); return TRUE; diff --git a/win/tty/getline.c b/win/tty/getline.c index 9c9efdf08e..5e84e4a75b 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -14,13 +14,12 @@ #include "func_tab.h" char morc = 0; /* tell the outside world what char you chose */ -STATIC_DCL boolean FDECL(ext_cmd_getlin_hook, (char *)); +STATIC_DCL 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_DCL void hooked_tty_getlin(const char *, char *, getlin_hook_proc); +extern int extcmd_via_menu(void); /* cmd.c */ extern char erase_char, kill_char; /* from appropriate tty.c file */ @@ -31,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, register char *bufp) { hooked_tty_getlin(query, bufp, (getlin_hook_proc) 0); } STATIC_OVL void -hooked_tty_getlin(query, bufp, hook) -const char *query; -register char *bufp; -getlin_hook_proc hook; +hooked_tty_getlin(const char *query, register char *bufp, getlin_hook_proc hook) { register char *obufp = bufp; register int c; @@ -188,8 +182,7 @@ getlin_hook_proc hook; } void -xwaitforspace(s) -register const char *s; /* chars allowed besides return */ +xwaitforspace(register const char *s) /* chars allowed besides return */ { register int c, x = ttyDisplay ? (int) ttyDisplay->dismiss_more : '\n'; @@ -231,8 +224,7 @@ register const char *s; /* chars allowed besides return */ * + base has enough room to hold our string */ STATIC_OVL boolean -ext_cmd_getlin_hook(base) -char *base; +ext_cmd_getlin_hook(char *base) { int oindex, com_index; diff --git a/win/tty/termcap.c b/win/tty/termcap.c index 262c89a465..9c4f208704 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -15,19 +15,19 @@ #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) #if !defined(UNIX) || !defined(TERMINFO) #ifndef TOS -static void FDECL(analyze_seq, (char *, int *, int *)); +static void analyze_seq(char *, int *, int *); #endif #endif -static void NDECL(init_hilite); -static void NDECL(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, ul_hack */ @@ -77,8 +77,7 @@ STATIC_VAR char tgotobuf[20]; #endif /* TERMLIB */ void -tty_startup(wid, hgt) -int *wid, *hgt; +tty_startup(int *wid, int *hgt) { register int i; #ifdef TERMLIB @@ -352,8 +351,7 @@ tty_shutdown() } void -tty_number_pad(state) -int state; +tty_number_pad(int state) { switch (state) { case -1: /* activate keypad mode (escape sequences) */ @@ -371,8 +369,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(void); /* We call this routine whenever DECgraphics mode is enabled, even if it @@ -444,12 +442,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)(void); /* 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)(void); /* defined in drawing.c */ +static void tty_ascgraphics_hilite_fixup(void); static void tty_ascgraphics_hilite_fixup() @@ -515,8 +513,7 @@ tty_end_screen() in trampoli.[ch]. */ void -nocmov(x, y) -int x, y; +nocmov(int x, int y) { if ((int) ttyDisplay->cury > y) { if (UP) { @@ -565,8 +562,7 @@ int x, y; } void -cmov(x, y) -register int x, y; +cmov(register int x, register int y) { xputs(tgoto(nh_CM, x, y)); ttyDisplay->cury = y; @@ -575,19 +571,17 @@ register int x, y; /* See note above. xputc() is a special function. */ void -xputc(c) #if defined(apollo) - int c; +xputc(int c) #else - char c; +xputc(char c) #endif { (void) putchar(c); } void -xputs(s) -const char *s; +xputs(const char *s) { #ifndef TERMLIB (void) fputs(s, stdout); @@ -997,9 +991,7 @@ kill_hilite() #ifndef TOS /* find the foreground and background colors set by nh_HI or nh_HE */ static void -analyze_seq(str, fg, bg) -char *str; -int *fg, *bg; +analyze_seq(char *str, int *fg, int *bg) { register int c, code; int len; @@ -1164,8 +1156,7 @@ kill_hilite() static char nulstr[] = ""; static char * -s_atr2str(n) -int n; +s_atr2str(int n) { switch (n) { case ATR_ULINE: @@ -1185,8 +1176,7 @@ int n; } static char * -e_atr2str(n) -int n; +e_atr2str(int n) { switch (n) { case ATR_ULINE: @@ -1202,8 +1192,7 @@ int n; } void -term_start_attr(attr) -int attr; +term_start_attr(int attr) { if (attr) { xputs(s_atr2str(attr)); @@ -1211,8 +1200,7 @@ int attr; } void -term_end_attr(attr) -int attr; +term_end_attr(int attr) { if (attr) { xputs(e_atr2str(attr)); @@ -1240,15 +1228,13 @@ term_end_color() } void -term_start_color(color) -int color; +term_start_color(int color) { xputs(hilites[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 a2e163ac03..41ca863e7e 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -14,12 +14,12 @@ #define C(c) (0x1f & (c)) #endif -STATIC_DCL void FDECL(redotoplin, (const char *)); -STATIC_DCL void FDECL(topl_putsym, (CHAR_P)); -STATIC_DCL void NDECL(remember_topl); -STATIC_DCL void FDECL(removetopl, (int)); -STATIC_DCL void FDECL(msghistory_snapshot, (BOOLEAN_P)); -STATIC_DCL void FDECL(free_msghistory_snapshot, (BOOLEAN_P)); +STATIC_DCL void redotoplin(const char *); +STATIC_DCL void topl_putsym(char); +STATIC_DCL void remember_topl(void); +STATIC_DCL void removetopl(int); +STATIC_DCL void msghistory_snapshot(boolean); +STATIC_DCL void free_msghistory_snapshot(boolean); int tty_doprev_message() @@ -126,8 +126,7 @@ tty_doprev_message() } STATIC_OVL void -redotoplin(str) -const char *str; +redotoplin(const char *str) { int otoplin = ttyDisplay->toplin; home(); @@ -168,8 +167,7 @@ remember_topl() } void -addtopl(s) -const char *s; +addtopl(const char *s) { register struct WinDesc *cw = wins[WIN_MESSAGE]; @@ -219,8 +217,7 @@ more() } void -update_topl(bp) -register const char *bp; +update_topl(register const char *bp) { register char *tl, *otl; register int n0; @@ -272,8 +269,7 @@ register const char *bp; STATIC_OVL void -topl_putsym(c) -char c; +topl_putsym(char c) { register struct WinDesc *cw = wins[WIN_MESSAGE]; @@ -314,16 +310,14 @@ char c; } void -putsyms(str) -const char *str; +putsyms(const char *str) { while (*str) topl_putsym(*str++); } STATIC_OVL void -removetopl(n) -register int n; +removetopl(register int n) { /* assume addtopl() has been done, so ttyDisplay->toplin is already set */ while (n-- > 0) @@ -333,9 +327,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 @@ -513,8 +505,7 @@ static char **snapshot_mesgs = 0; /* collect currently available message history data into a sequential array; optionally, purge that data from the active circular buffer set as we go */ STATIC_OVL void -msghistory_snapshot(purge) -boolean purge; /* clear message history buffer as we copy it */ +msghistory_snapshot(boolean purge) /* clear message history buffer as we copy it */ { char *mesg; int i, inidx, outidx; @@ -559,8 +550,7 @@ boolean purge; /* clear message history buffer as we copy it */ /* release memory allocated to message history snapshot */ STATIC_OVL void -free_msghistory_snapshot(purged) -boolean purged; /* True: took history's pointers, False: just cloned them */ +free_msghistory_snapshot(boolean purged) /* True: took history's pointers, False: just cloned them */ { if (snapshot_mesgs) { /* snapshot pointers are no longer in use */ @@ -590,8 +580,7 @@ boolean purged; /* True: took history's pointers, False: just cloned them */ * included among the output of the subsequent calls. */ char * -tty_getmsghistory(init) -boolean init; +tty_getmsghistory(boolean init) { static int nxtidx; char *nextmesg; @@ -631,9 +620,7 @@ boolean init; * message history for ^P recall without having displayed it. */ void -tty_putmsghistory(msg, restoring_msghist) -const char *msg; -boolean restoring_msghist; +tty_putmsghistory(const char *msg, boolean restoring_msghist) { static boolean initd = FALSE; int idx; diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 4c10ddeb99..d8471c27c2 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -104,8 +104,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 @@ -125,7 +125,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) @@ -137,32 +137,27 @@ 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 *)); -STATIC_DCL const char *FDECL(compress_str, (const char *)); -STATIC_DCL void FDECL(tty_putsym, (winid, int, int, CHAR_P)); -STATIC_DCL void FDECL(bail, (const char *)); /* __attribute__((noreturn)) */ -STATIC_DCL void FDECL(setup_rolemenu, (winid, BOOLEAN_P, int, int, int)); -STATIC_DCL void FDECL(setup_racemenu, (winid, BOOLEAN_P, int, int, int)); -STATIC_DCL void FDECL(setup_gendmenu, (winid, BOOLEAN_P, int, int, int)); -STATIC_DCL void FDECL(setup_algnmenu, (winid, BOOLEAN_P, int, int, int)); -STATIC_DCL boolean NDECL(reset_role_filtering); +STATIC_DCL void getret(void); +#endif +STATIC_DCL void erase_menu_or_text(winid, struct WinDesc *, boolean); +STATIC_DCL void free_window_info(struct WinDesc *, boolean); +STATIC_DCL void dmore(struct WinDesc *, const char *); +STATIC_DCL void set_item_state(winid, int, tty_menu_item *); +STATIC_DCL void set_all_on_page(winid, tty_menu_item *, tty_menu_item *); +STATIC_DCL void unset_all_on_page(winid, tty_menu_item *, tty_menu_item *); +STATIC_DCL void invert_all_on_page(winid, tty_menu_item *, tty_menu_item *, char); +STATIC_DCL void invert_all(winid, tty_menu_item *, tty_menu_item *, char); +STATIC_DCL void process_menu_window(winid, struct WinDesc *); +STATIC_DCL void process_text_window(winid, struct WinDesc *); +STATIC_DCL tty_menu_item *reverse(tty_menu_item *); +STATIC_DCL const char *compress_str(const char *); +STATIC_DCL void tty_putsym(winid, int, int, char); +STATIC_DCL void bail(const char *); /* __attribute__((noreturn) */ +STATIC_DCL void setup_rolemenu(winid, boolean, int, int, int); +STATIC_DCL void setup_racemenu(winid, boolean, int, int, int); +STATIC_DCL void setup_gendmenu(winid, boolean, int, int, int); +STATIC_DCL void setup_algnmenu(winid, boolean, int, int, int); +STATIC_DCL boolean reset_role_filtering(void); /* * A string containing all the default commands -- to add to a list @@ -177,8 +172,7 @@ static const char default_menu_cmds[] = { /* clean up and quit */ STATIC_OVL void -bail(mesg) -const char *mesg; +bail(const char *mesg) { clearlocks(); tty_exit_nhwindows(mesg); @@ -263,9 +257,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, i; @@ -895,10 +887,11 @@ reset_role_filtering() /* add entries a-Archeologist, b-Barbarian, &c to menu being built in 'win' */ STATIC_OVL 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; @@ -938,10 +931,7 @@ int race, gend, algn; /* all ROLE_NONE for !filtering case */ } STATIC_OVL 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; @@ -971,10 +961,7 @@ int role, gend, algn; } STATIC_DCL 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; @@ -1002,10 +989,7 @@ int role, race, algn; } STATIC_DCL 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; @@ -1166,8 +1150,7 @@ 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) @@ -1183,8 +1166,7 @@ tty_resume_nhwindows() } void -tty_exit_nhwindows(str) -const char *str; +tty_exit_nhwindows(const char *str) { winid i; @@ -1226,8 +1208,7 @@ const char *str; } winid -tty_create_nhwindow(type) -int type; +tty_create_nhwindow(int type) { struct WinDesc *newwin; int i; @@ -1339,10 +1320,7 @@ int type; } STATIC_OVL 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) { @@ -1357,9 +1335,7 @@ boolean clear; } STATIC_OVL void -free_window_info(cw, free_data) -struct WinDesc *cw; -boolean free_data; +free_window_info(struct WinDesc *cw, boolean free_data) { int i; @@ -1405,8 +1381,7 @@ boolean free_data; } void -tty_clear_nhwindow(window) -winid window; +tty_clear_nhwindow(winid window) { register struct WinDesc *cw = 0; @@ -1448,12 +1423,7 @@ winid window; } boolean -toggle_menu_curr(window, curr, lineno, in_view, counting, count) -winid window; -tty_menu_item *curr; -int lineno; -boolean in_view, counting; -long count; +toggle_menu_curr(winid window, tty_menu_item *curr, int lineno, boolean in_view, boolean counting, long count) { if (curr->selected) { if (counting && count > 0) { @@ -1487,9 +1457,8 @@ long count; } STATIC_OVL void -dmore(cw, s) -register struct WinDesc *cw; -const char *s; /* valid responses */ +dmore(register struct WinDesc *cw, + const char *s) /* valid responses */ { const char *prompt = cw->morestr ? cw->morestr : defmorestr; int offset = (cw->type == NHW_TEXT) ? 1 : 2; @@ -1507,10 +1476,7 @@ const char *s; /* valid responses */ } STATIC_OVL 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 ? '+' : '#') : '-'; @@ -1522,9 +1488,7 @@ tty_menu_item *item; } STATIC_OVL 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; @@ -1537,9 +1501,7 @@ tty_menu_item *page_start, *page_end; } STATIC_OVL 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; @@ -1553,10 +1515,10 @@ tty_menu_item *page_start, *page_end; } STATIC_OVL 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; @@ -1576,10 +1538,10 @@ char acc; /* group accelerator, 0 => all */ * Invert all entries that match the give group accelerator (or all if zero). */ STATIC_OVL 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; @@ -1606,9 +1568,7 @@ char acc; /* group accelerator, 0 => all */ } STATIC_OVL 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; @@ -1966,9 +1926,7 @@ struct WinDesc *cw; } STATIC_OVL 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; @@ -2033,9 +1991,8 @@ 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; short s_maxcol; @@ -2122,8 +2079,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; @@ -2165,8 +2121,7 @@ winid window; } void -tty_destroy_nhwindow(window) -winid window; +tty_destroy_nhwindow(winid window) { register struct WinDesc *cw = 0; @@ -2186,10 +2141,9 @@ 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, + register int x, register int y) /* not xchar: perhaps xchar is unsigned and + curx-x would be unsigned as well */ { struct WinDesc *cw = 0; int cx = ttyDisplay->curx; @@ -2277,10 +2231,7 @@ register int x, y; /* not xchar: perhaps xchar is unsigned and } STATIC_OVL 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; @@ -2305,8 +2256,7 @@ char ch; } STATIC_OVL const char * -compress_str(str) -const char *str; +compress_str(const char *str) { static char cbuf[BUFSZ]; /* compress in case line too long */ @@ -2328,10 +2278,7 @@ const char *str; } void -tty_putstr(window, attr, str) -winid window; -int attr; -const char *str; +tty_putstr(winid window, int attr, const char *str) { register struct WinDesc *cw = 0; register char *ob; @@ -2488,9 +2435,7 @@ const char *str; } void -tty_display_file(fname, complain) -const char *fname; -boolean complain; +tty_display_file(const char *fname, boolean complain) { #ifdef DEF_PAGER /* this implies that UNIX is defined */ { @@ -2582,8 +2527,7 @@ boolean complain; } void -tty_start_menu(window) -winid window; +tty_start_menu(winid window) { tty_clear_nhwindow(window); return; @@ -2595,15 +2539,14 @@ winid window; * later. */ void -tty_add_menu(window, glyph, identifier, ch, gch, attr, str, preselected) -winid window; /* window to use, must be of type NHW_MENU */ -int glyph UNUSED; /* glyph to display with item (not used) */ -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 */ -boolean preselected; /* item is marked as selected */ +tty_add_menu(winid window, /* window to use, must be of type NHW_MENU */ + int glyph UNUSED, /* glyph to display with item (not used) */ + 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 */ + boolean preselected) /* item is marked as selected */ { register struct WinDesc *cw = 0; tty_menu_item *item; @@ -2649,8 +2592,7 @@ boolean preselected; /* item is marked as selected */ /* Invert the given list, can handle NULL as an input. */ STATIC_OVL tty_menu_item * -reverse(curr) -tty_menu_item *curr; +reverse(tty_menu_item *curr) { tty_menu_item *next, *head = 0; @@ -2670,9 +2612,8 @@ 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; @@ -2772,10 +2713,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; @@ -2816,10 +2754,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) { @@ -2885,8 +2820,7 @@ tty_wait_synch() } void -docorner(xmin, ymax) -register int xmin, ymax; +docorner(register int xmin, register int ymax) { register int y; register struct WinDesc *cw = wins[WIN_MAP]; @@ -2948,8 +2882,7 @@ end_glyphout() #ifndef WIN32 void -g_putch(in_ch) -int in_ch; +g_putch(int in_ch) { register char ch = (char) in_ch; @@ -2991,8 +2924,7 @@ setclipped() } void -tty_cliparound(x, y) -int x, y; +tty_cliparound(int x, int y) { extern boolean restoring; int oldx = clipx, oldy = clipy; @@ -3030,11 +2962,7 @@ int x, y; */ void -tty_print_glyph(window, x, y, glyph, bkglyph) -winid window; -xchar x, y; -int glyph; -int bkglyph UNUSED; +tty_print_glyph(winid window, xchar x, xchar y, int glyph, int bkglyph UNUSED) { int ch; boolean reverse_on = FALSE; @@ -3101,8 +3029,7 @@ int bkglyph UNUSED; } void -tty_raw_print(str) -const char *str; +tty_raw_print(const char *str) { if (ttyDisplay) ttyDisplay->rawprint++; @@ -3115,8 +3042,7 @@ const char *str; } void -tty_raw_print_bold(str) -const char *str; +tty_raw_print_bold(const char *str) { if (ttyDisplay) ttyDisplay->rawprint++; @@ -3181,8 +3107,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; @@ -3210,8 +3135,7 @@ int *x, *y, *mod; } void -win_tty_init(dir) -int dir; +win_tty_init(int dir) { if (dir != WININIT) return; @@ -3224,8 +3148,7 @@ int dir; #ifdef POSITIONBAR void -tty_update_positionbar(posbar) -char *posbar; +tty_update_positionbar(char *posbar) { #ifdef MSDOS video_update_positionbar(posbar); @@ -3262,10 +3185,10 @@ struct color_option { int attr_bits; }; -static void FDECL(start_color_option, (struct color_option)); -static void FDECL(end_color_option, (struct color_option)); -static void FDECL(apply_color_option, (struct color_option, const char *)); -static void FDECL(add_colored_text, (const char *, char *)); +static void start_color_option(struct color_option); +static void end_color_option(struct color_option); +static void apply_color_option(struct color_option, const char *); +static void add_colored_text(const char *, char *); #endif void @@ -3317,9 +3240,7 @@ tty_status_init() * will have to add 2 to the passed "ptr" for the BL_GOLD case. */ void -tty_status_update(fldidx, ptr, chg, percent) -int fldidx, chg, percent; -genericptr_t ptr; +tty_status_update(int fldidx, genericptr_t ptr, int chg, int percent) { long cond, *condptr = (long *) ptr; register int i; @@ -3564,10 +3485,7 @@ genericptr_t ptr; * CLR_BRIGHT_MAGENTA, CLR_BRIGHT_CYAN, or CLR_WHITE (0 - 15). */ void -tty_status_threshold(fldidx, thresholdtype, threshold, behavior, under, over) -int fldidx, thresholdtype; -int behavior, under, over; -anything threshold; +tty_status_threshold(int fldidx, int thresholdtype, anything threshold, int behavior, int under, int over) { tty_status_hilites[fldidx].thresholdtype = thresholdtype; tty_status_hilites[fldidx].threshold = threshold; diff --git a/win/win32/mhmenu.c b/win/win32/mhmenu.c index 258eed46de..8394f95f57 100644 --- a/win/win32/mhmenu.c +++ b/win/win32/mhmenu.c @@ -25,11 +25,11 @@ typedef struct mswin_menu_item { int glyph; ANY_P identifier; - CHAR_P accelerator; - CHAR_P group_accel; + char accelerator; + char group_accel; int attr; char str[NHMENU_STR_SIZE]; - BOOLEAN_P presel; + boolean presel; int count; BOOL has_focus; } NHMenuItem, *PNHMenuItem; diff --git a/win/win32/mhmsg.h b/win/win32/mhmsg.h index 926f7d0eb3..1461e1fb5b 100644 --- a/win/win32/mhmsg.h +++ b/win/win32/mhmsg.h @@ -33,8 +33,8 @@ typedef struct mswin_nhmsg_putstr { } MSNHMsgPutstr, *PMSNHMsgPutstr; typedef struct mswin_nhmsg_print_glyph { - XCHAR_P x; - XCHAR_P y; + xchar x; + xchar y; int glyph; int bkglyph; } MSNHMsgPrintGlyph, *PMSNHMsgPrintGlyph; @@ -47,11 +47,11 @@ typedef struct mswin_nhmsg_cliparound { typedef struct mswin_nhmsg_add_menu { int glyph; const ANY_P *identifier; - CHAR_P accelerator; - CHAR_P group_accel; + char accelerator; + char group_accel; int attr; const char *str; - BOOLEAN_P presel; + boolean presel; } MSNHMsgAddMenu, *PMSNHMsgAddMenu; typedef struct mswin_nhmsg_cursor { diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 593131ad52..dba8f5344a 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -833,7 +833,7 @@ mswin_clear_nhwindow(winid wid) --more--, if necessary, in the tty window-port. */ void -mswin_display_nhwindow(winid wid, BOOLEAN_P block) +mswin_display_nhwindow(winid wid, boolean block) { logDebug("mswin_display_nhwindow(%d, %d)\n", wid, block); if (GetNHApp()->windowlist[wid].win != NULL) { @@ -1014,7 +1014,7 @@ mswin_putstr_ex(winid wid, int attr, const char *text, int app) iff complain is TRUE. */ void -mswin_display_file(const char *filename, BOOLEAN_P must_exist) +mswin_display_file(const char *filename, boolean must_exist) { dlb *f; TCHAR wbuf[BUFSZ]; @@ -1108,8 +1108,8 @@ identifier */ void mswin_add_menu(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) { logDebug("mswin_add_menu(%d, %d, %p, %c, %c, %d, %s, %d)\n", wid, glyph, identifier, (char) accelerator, (char) group_accel, attr, str, @@ -1272,7 +1272,7 @@ print_glyph(window, x, y, glyph, bkglyph) */ void -mswin_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph, int bkglyph) +mswin_print_glyph(winid wid, xchar x, xchar y, int glyph, int bkglyph) { logDebug("mswin_print_glyph(%d, %d, %d, %d, %d)\n", wid, x, y, glyph, bkglyph); @@ -1433,7 +1433,7 @@ char yn_function(const char *ques, const char *choices, char default) ports might use a popup. */ char -mswin_yn_function(const char *question, const char *choices, CHAR_P def) +mswin_yn_function(const char *question, const char *choices, char def) { char ch; char yn_esc_map = '\033'; @@ -1979,7 +1979,7 @@ mswin_preference_update(const char *pref) #define TEXT_BUFFER_SIZE 4096 char * -mswin_getmsghistory(BOOLEAN_P init) +mswin_getmsghistory(boolean init) { static PMSNHMsgGetText text = 0; static char *next_message = 0; @@ -2016,7 +2016,7 @@ mswin_getmsghistory(BOOLEAN_P init) } void -mswin_putmsghistory(const char *msg, BOOLEAN_P restoring) +mswin_putmsghistory(const char *msg, boolean restoring) { BOOL save_sound_opt; diff --git a/win/win32/winMS.h b/win/win32/winMS.h index e2720fccc9..ea71886aa2 100644 --- a/win/win32/winMS.h +++ b/win/win32/winMS.h @@ -135,30 +135,30 @@ void mswin_suspend_nhwindows(const char *); void mswin_resume_nhwindows(void); winid mswin_create_nhwindow(int type); void mswin_clear_nhwindow(winid wid); -void mswin_display_nhwindow(winid wid, BOOLEAN_P block); +void mswin_display_nhwindow(winid wid, boolean block); void mswin_destroy_nhwindow(winid wid); void mswin_curs(winid wid, int x, int y); void mswin_putstr(winid wid, int attr, const char *text); void mswin_putstr_ex(winid wid, int attr, const char *text, int); -void mswin_display_file(const char *filename, BOOLEAN_P must_exist); +void mswin_display_file(const char *filename, boolean must_exist); void mswin_start_menu(winid wid); void mswin_add_menu(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); void mswin_end_menu(winid wid, const char *prompt); int mswin_select_menu(winid wid, int how, MENU_ITEM_P **selected); 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, int bkglyph); +void mswin_print_glyph(winid wid, xchar x, xchar y, int glyph, int bkglyph); 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); void mswin_nhbell(void); int mswin_doprev_message(void); -char mswin_yn_function(const char *question, const char *choices, CHAR_P def); +char mswin_yn_function(const char *question, const char *choices, char def); void mswin_getlin(const char *question, char *input); int mswin_get_ext_cmd(void); void mswin_number_pad(int state); @@ -169,8 +169,8 @@ void mswin_start_screen(void); void mswin_end_screen(void); void mswin_outrip(winid wid, int how, time_t when); void mswin_preference_update(const char *pref); -char *mswin_getmsghistory(BOOLEAN_P init); -void mswin_putmsghistory(const char *msg, BOOLEAN_P); +char *mswin_getmsghistory(boolean init); +void mswin_putmsghistory(const char *msg, boolean); #ifdef STATUS_VIA_WINDOWPORT void mswin_status_init(void); diff --git a/win/win32/winhack.c b/win/win32/winhack.c index a85bdc478e..f7481e7408 100644 --- a/win/win32/winhack.c +++ b/win/win32/winhack.c @@ -47,7 +47,7 @@ Version _WIN_32IE Platform/IE /*#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); BOOL WINAPI @@ -64,7 +64,7 @@ NHWinApp _nethack_app; #endif // Foward declarations of functions included in this code module: -extern boolean FDECL(pcmain, (int, char **)); +extern boolean pcmain(int, char **); static void __cdecl mswin_moveloop(void *); #define MAX_CMDLINE_PARAM 255