un-macro some of display.h
I recently captured preprocessor output for a file and the amount of code being expanded--and subsequently compiled--for canspotmon() was quite an eye opener. This converts most of the macros it uses into function calls. The resulting executable generated for OSX (built for x86_64 and containing four interfaces) is about 5.5% smaller! and there wasn't any difference in speed that I could notice. The knowninvisible() macro has been in error for as far back as the git logs go (which include those for the second cvs repository, so over 20 years now).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 extern.h $NHDT-Date: 1652299940 2022/05/11 20:12:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1114 $ */
|
||||
/* NetHack 3.7 extern.h $NHDT-Date: 1652391728 2022/05/12 21:42:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1115 $ */
|
||||
/* Copyright (c) Steve Creps, 1988. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -393,6 +393,14 @@ extern int wiz_debug_cmd_bury(void);
|
||||
|
||||
/* ### display.c ### */
|
||||
|
||||
extern int tp_sensemon(struct monst *);
|
||||
extern int sensemon(struct monst *);
|
||||
extern int mon_warning(struct monst *);
|
||||
extern int mon_visible(struct monst *);
|
||||
extern int see_with_infrared(struct monst *);
|
||||
extern int canseemon(struct monst *);
|
||||
extern int knowninvisible(struct monst *);
|
||||
extern int is_safemon(struct monst *);
|
||||
extern void magic_map_background(xchar, xchar, int);
|
||||
extern void map_background(xchar, xchar, int);
|
||||
extern void map_trap(struct trap *, int);
|
||||
|
||||
Reference in New Issue
Block a user