games - backgammon - use defined names instead of magic numbers.
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 14 Sep 2009 21:08:50 +0000 (14:08 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 14 Sep 2009 21:08:50 +0000 (14:08 -0700)
Submitted-by: Ulrich Spoerlein <uqs@spoerlein.net>
games/backgammon/common_source/save.c
games/backgammon/common_source/table.c

index 3250c7d..6a0f27a 100644 (file)
@@ -74,7 +74,7 @@ save(int n)
                writel (prompt);
                fs = fname;
                while ((*fs = readc()) != '\n')  {
-                       if (*fs == tty.c_cc[2])  {
+                       if (*fs == tty.c_cc[VERASE])  {
                                if (fs > fname)  {
                                        fs--;
                                        if (tflag)
index 6c3944e..7635023 100644 (file)
@@ -112,11 +112,11 @@ dochar:
                }
        }
 
-       if (c == tty.c_cc[2] && ncin > 0)  {
+       if (c == tty.c_cc[VERASE] && ncin > 0)  {
                if (tflag)
                        curmove (curr,curc-1);
                else  {
-                       if (tty.c_cc[2] == '\010')
+                       if (tty.c_cc[VERASE] == '\010')
                                writel ("\010 \010");
                        else
                                writec (cin[ncin-1]);
@@ -133,13 +133,13 @@ dochar:
                goto domove;
        }
 
-       if (c == tty.c_cc[3] && ncin > 0)  {
+       if (c == tty.c_cc[VKILL] && ncin > 0)  {
                if (tflag)  {
                        refresh();
                        curmove (curr,39);
                        ist = -1;
                        goto domove;
-               } else  if (tty.c_cc[2] == '\010')  {
+               } else  if (tty.c_cc[VERASE] == '\010')  {
                        for (j = 0; j < ncin; j++)
                                writel ("\010 \010");
                        ist = -1;