]> git.pond.sub.org Git - empserver/commitdiff
Simplify routech[]
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 28 Aug 2008 01:30:56 +0000 (21:30 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 28 Aug 2008 01:30:56 +0000 (21:30 -0400)
routech[][1] hasn't been used in living memory.  Drop it, and simplify
to routech[].

include/path.h
src/lib/commands/path.c
src/lib/commands/rout.c
src/lib/global/dir.c

index e3bf92a9cd379947219881b64deff1ae374bd7c8..04c2d8f1bc748b3a383e95083d8de15524007bfe 100644 (file)
@@ -58,7 +58,7 @@ enum p_mode {                 /* How to find path to destination */
 extern signed char dirindex['z'-'a'+1];
 extern int diroff[DIR_MAP+1][2];
 extern char dirch[DIR_MAP+2];
 extern signed char dirindex['z'-'a'+1];
 extern int diroff[DIR_MAP+1][2];
 extern char dirch[DIR_MAP+2];
-extern char *routech[DIR_LAST+1][2];
+extern char *routech[DIR_LAST+1];
 
 /* src/lib/subs/paths.c */
 extern char *getpath(char *, char *, coord, coord, int, int, enum p_mode);
 
 /* src/lib/subs/paths.c */
 extern char *getpath(char *, char *, coord, coord, int, int, enum p_mode);
index f143a3642aad91d3761e77e046b89857c144cbf6..fa9d6cbadaddff676b2106114cd7501bda46b77a 100644 (file)
@@ -101,8 +101,7 @@ path(void)
        if (i == DIR_STOP)
            break;
        memcpy(&map[delty(&ns.range, cy)][deltx(&ns.range, cx) * 2],
        if (i == DIR_STOP)
            break;
        memcpy(&map[delty(&ns.range, cy)][deltx(&ns.range, cx) * 2],
-              routech[i][0],
-              3);
+              routech[i], 3);
        cx = xnorm(cx + diroff[i][0]);
        cy = ynorm(cy + diroff[i][1]);
     }
        cx = xnorm(cx + diroff[i][0]);
        cy = ynorm(cy + diroff[i][1]);
     }
index 0004a0742d5d2dddcee0e07fdfa6b5c8e141f6a8..a4eab2059b9f0e764f65fbfb39a2e9d29a9f3e9b 100644 (file)
@@ -98,7 +98,7 @@ rout(void)
        p = &map[ns.dy][ns.dx * 2];
        if ((dir = sect.sct_del[i_del] & 0x7) &&
            nstr_exec(cond, ncond, &sect))
        p = &map[ns.dy][ns.dx * 2];
        if ((dir = sect.sct_del[i_del] & 0x7) &&
            nstr_exec(cond, ncond, &sect))
-           memcpy(p, routech[dir][0], 3);
+           memcpy(p, routech[dir], 3);
        p[1] = dchr[sect.sct_type].d_mnem;
     }
     for (row = 0, y = ns.range.ly; row < ns.range.height; y++, row++) {
        p[1] = dchr[sect.sct_type].d_mnem;
     }
     for (row = 0, y = ns.range.ly; row < ns.range.height; y++, row++) {
index 9fa76ec0cc904b4785a0cb2a6979f1c56040e6d3..c08958c81220a3d7ebcbf2681e22ed3a84348acb 100644 (file)
@@ -63,12 +63,6 @@ signed char dirindex[] = {
 };
 
 /* must agree with dirch[] and DIR_ defines */
 };
 
 /* must agree with dirch[] and DIR_ defines */
-char *routech[][2] = {
-    {"   ", "$ $"},
-    {"  /", "$ /"},
-    {"  >", "$ >"},
-    {"  \\", "$ \\"},
-    {"/  ", "/ $"},
-    {"<  ", "< $"},
-    {"\\  ", "\\ $"}
+char *routech[] = {
+    "   ", "  /", "  >","  \\","/  ","<  ","\\  "
 };
 };