diff --git a/src/display.c b/src/display.c index b98fc88c8..31c92d14c 100644 --- a/src/display.c +++ b/src/display.c @@ -2309,7 +2309,10 @@ glyphinfo_at(coordxy x, coordxy y, int glyph) */ static void -get_bkglyph_and_framecolor(coordxy x, coordxy y, int *bkglyph, uint32 *framecolor) +get_bkglyph_and_framecolor( + coordxy x, coordxy y, + int *bkglyph, + uint32 *framecolor) { int idx, tmp_bkglyph = GLYPH_UNEXPLORED; struct rm *lev = &levl[x][y]; @@ -3179,7 +3182,8 @@ const seenV seenv_matrix[3][3] = { { SV4, SV5, SV6 } }; -#define sign(z) ((z) < 0 ? -1 : ((z) > 0 ? 1 : 0)) +/* negative: -1, zero: 0, positive +1; same as sgn() function (hacklib.c) */ +#define sign(z) ((z) < 0 ? -1 : ((z) != 0)) /* Set the seen vector of lev as if seen from (x0,y0) to (x,y). */ static void @@ -3193,6 +3197,8 @@ set_seenv( lev->seenv |= seenv_matrix[sign(dy) + 1][sign(dx) + 1]; } +#undef sign + /* Called by blackout(vault.c) when vault guard removes temporary corridor, turning spot back into stone; is an adjacent spot. */ void @@ -3640,4 +3646,20 @@ fn_cmap_to_glyph(int cmap) { return cmap_to_glyph(cmap); } + +/* for 'onefile' processing where end of this file isn't necessarily the + end of the source code seen by the compiler (there are lots of other + macros defined above...) */ +#undef remember_topology +#undef DETECTED +#undef PHYSICALLY_SEEN +#undef is_worm_tail +#undef TMP_AT_MAX_GLYPHS +#undef Glyphinfo_at +#undef reset_glyph_bbox +#undef HAS_ROGUE_IBM_GRAPHICS +#undef HI_DOMESTIC +#undef GMAP_SET +#undef GMAP_ROGUELEVEL + /*display.c*/ diff --git a/src/insight.c b/src/insight.c index cb35b8c6e..ef00fca02 100644 --- a/src/insight.c +++ b/src/insight.c @@ -3222,4 +3222,14 @@ ustatusline(void) Upolyd ? u.mhmax : u.uhpmax, u.uac, info); } +/* for 'onefile' processing where end of this file isn't necessarily the + end of the source code seen by the compiler */ +#undef enl_msg +#undef you_are +#undef you_have +#undef you_can +#undef you_have_been +#undef you_have_never +#undef you_have_X + /*insight.c*/ diff --git a/src/light.c b/src/light.c index b37a2cd40..e09073516 100644 --- a/src/light.c +++ b/src/light.c @@ -871,4 +871,10 @@ wiz_light_sources(void) return ECMD_OK; } +/* for 'onefile' processing where end of this file isn't necessarily the + end of the source code seen by the compiler */ +#undef LSF_SHOW +#undef LSF_NEEDS_FIXUP +#undef mon_is_local + /*light.c*/ diff --git a/src/monst.c b/src/monst.c index 2ac7f0781..04c80bd8b 100644 --- a/src/monst.c +++ b/src/monst.c @@ -28,16 +28,18 @@ #define WT_ELF 800 #define WT_DRAGON 4500 -#define MON(nam, sym, lvl, gen, atk, siz, mr1, mr2, flg1, flg2, flg3, d, col, bn) \ - { \ - {(const char *) 0, (const char *) 0, nam}, \ - sym, lvl, gen, atk, siz, mr1, mr2, flg1, flg2, flg3, d, C(col) \ +#define MON(nam, sym, lvl, gen, atk, siz, mr1, mr2, \ + flg1, flg2, flg3, d, col, bn) \ + { \ + { (const char *) 0, (const char *) 0, nam }, \ + sym, lvl, gen, atk, siz, mr1, mr2, flg1, flg2, flg3, d, C(col) \ } -#define MON3(namm, namf, namn, sym, lvl, gen, atk, siz, mr1, mr2, flg1, flg2, flg3, d, col, bn) \ - { \ - {namm, namf, namn}, \ - sym, lvl, gen, atk, siz, mr1, mr2, flg1, flg2, flg3, d, C(col) \ +#define MON3(namm, namf, namn, sym, lvl, gen, atk, siz, mr1, mr2, \ + flg1, flg2, flg3, d, col, bn) \ + { \ + { namm, namf, namn }, \ + sym, lvl, gen, atk, siz, mr1, mr2, flg1, flg2, flg3, d, C(col) \ } /* LVL() and SIZ() collect several fields to cut down on number of args * for MON() @@ -71,11 +73,29 @@ struct permonst mons[SIZE(mons_init)]; void monst_globals_init(void) { - memcpy(mons, mons_init, sizeof(mons)); + memcpy(mons, mons_init, sizeof mons); return; } const struct attack c_sa_yes[NATTK] = SEDUCTION_ATTACKS_YES; const struct attack c_sa_no[NATTK] = SEDUCTION_ATTACKS_NO; +/* for 'onefile' processing where end of this file isn't necessarily the + end of the source code seen by the compiler */ +#undef C +#define C(c) (0x1f & (c)) /* global.h */ +#ifdef TEXTCOLOR +#undef HI_DOMESTIC +#undef HI_LORD +#endif +#undef NO_ATTK +#undef WT_ELF +#undef WT_DRAGON +#undef MON +#undef MON3 +#undef LVL +#undef SIZ +#undef ATTK +#undef A + /*monst.c*/ diff --git a/src/nhlobj.c b/src/nhlobj.c index 584a8f4a1..ef8303528 100644 --- a/src/nhlobj.c +++ b/src/nhlobj.c @@ -655,3 +655,8 @@ l_obj_register(lua_State *L) return 0; } +/* for 'onefile' processing where end of this file isn't necessarily the + end of the source code seen by the compiler */ +#undef lobj_is_ok + +/*nhlobj.c*/