From ae251d0a5890518c91d19d03d401e0c4ff1527c5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 30 Oct 2005 16:46:46 +0000 Subject: [PATCH] (diroff, dirch, routech): Declare with array size. Define without. This requires moving routech[] declaration from map.h to path.h. Get rid of s_char. --- include/map.h | 2 -- include/path.h | 9 +++++---- src/lib/global/dir.c | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/map.h b/include/map.h index c4317a834..d4b1dcee8 100644 --- a/include/map.h +++ b/include/map.h @@ -39,8 +39,6 @@ #define MAPWIDTH(persec) ((WORLD_X/2)*(persec + 1)+1) -extern s_char *routech[7][2]; - extern void blankfill(s_char *, register struct range *, int); /* src/lib/subs/border.c */ extern int map_set(natid, coord, coord, s_char, int); diff --git a/include/path.h b/include/path.h index b6b339e67..0c936c073 100644 --- a/include/path.h +++ b/include/path.h @@ -34,8 +34,8 @@ #ifndef _PATH_H_ #define _PATH_H_ -#include "misc.h" /* s_char coord etc. */ -#include "sect.h" /* struct sctstr */ +#include "misc.h" +#include "sect.h" #include "xy.h" /* direction indices */ @@ -52,8 +52,9 @@ #define DIR_LAST 6 extern signed char dirindex['z'-'a'+1]; -extern int diroff[][2]; -extern s_char dirch[]; +extern int diroff[DIR_MAP+1][2]; +extern char dirch[DIR_MAP+2]; +extern char *routech[DIR_LAST+1][2]; /* src/lib/subs/paths.c */ extern char *getpath(char *, char *, coord, coord, int, int, int); diff --git a/src/lib/global/dir.c b/src/lib/global/dir.c index 3c503242d..8f9c53bb8 100644 --- a/src/lib/global/dir.c +++ b/src/lib/global/dir.c @@ -31,10 +31,10 @@ * Known contributors to this file: */ -#include "misc.h" +#include "path.h" /* must agree with DIR_ defines */ -s_char dirch[] = { +char dirch[] = { 'h', /* stop */ 'u', /* up-right */ 'j', /* right */ @@ -61,7 +61,7 @@ signed char dirindex[] = { }; /* must agree with dirch[] and DIR_ defines */ -s_char *routech[7][2] = { +char *routech[][2] = { {" ", "$ $"}, {" /", "$ /"}, {" >", "$ >"}, -- 2.43.0