Futureproofing hypothetical type mismatches

If we ever want huge maps with COLNO or ROWNO larger than signed char,
this will at least allow the game to compile and start when typedef'ing
xchar to int. Trying to use huge maps exposes more bugs.
This commit is contained in:
Pasi Kallinen
2020-11-14 13:41:31 +02:00
parent 08310c8a71
commit 289c8d654d
8 changed files with 130 additions and 138 deletions

View File

@@ -48,8 +48,8 @@ static void FDECL(write_ls, (NHFILE *, light_source *));
static int FDECL(maybe_write_ls, (NHFILE *, int, BOOLEAN_P));
/* imported from vision.c, for small circles */
extern char circle_data[];
extern char circle_start[];
extern xchar circle_data[];
extern xchar circle_start[];
/* Create a new light source. Caller (and extern.h) doesn't need to know
@@ -144,13 +144,13 @@ anything *id;
/* Mark locations that are temporarily lit via mobile light sources. */
void
do_light_sources(cs_rows)
char **cs_rows;
xchar **cs_rows;
{
int x, y, min_x, max_x, max_y, offset;
char *limits;
xchar *limits;
short at_hero_range = 0;
light_source *ls;
char *row;
xchar *row;
for (ls = g.light_base; ls; ls = ls->next) {
ls->flags &= ~LSF_SHOW;