Add missing common.c.
[open-adventure.git] / misc.c
diff --git a/misc.c b/misc.c
index 546cf48cfb9d9aacd2d28586e77dc2102891efce..6fe53ce6335be67207f7150fb3f2e0f01aa1fe17 100644 (file)
--- a/misc.c
+++ b/misc.c
 
 #define PERCENT        63      /* partly hide the packed encoding */
 
-const char advent_to_ascii[] = {0, 32, 33, 34, 39, 40, 41, 42, 43, 44, 45, 46, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 37, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 35, 36, 38, 47, 58, 59, 60, 61, 62, 63, 64, 91, 92, 93, 94, 95, 96, 123, 124, 125, 126, 0};
-/* Rendered from the now-gone MPINIT() function */
-const char ascii_to_advent[] = {0, 74, 75, 76, 77, 78, 79, 80, 81, 82, 0, 0, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 0, 1, 2, 106, 107, 63, 108, 3, 4, 5, 6, 7, 8, 9, 10, 109, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 110, 111, 112, 113, 114, 115, 116, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 117, 118, 119, 120, 121, 122, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 123, 124, 125, 126, 83};
-
 /*  I/O routines (SPEAK, PSPEAK, RSPEAK, SETPRM, GETIN, YES) */
 
 void SPEAK(vocab_t msg)
@@ -28,7 +24,7 @@ void SPEAK(vocab_t msg)
     nparms=1;
     do {
        nxt=labs(LINES[msg])-1;
-       msg=msg+1;
+       ++msg;
        LNLENG=0;
        LNPOSN=1;
        state=0;
@@ -71,7 +67,7 @@ void SPEAK(vocab_t msg)
                    if (PARMS[nparms+1] < 0)
                        casemake=0;
                    PUTTXT(PARMS[nparms],&state,casemake);
-                   nparms=nparms+1;
+                   ++nparms;
                }
                ++nparms;
                continue;
@@ -254,7 +250,7 @@ long GETTXT(bool skip, bool onewrd, bool upper)
            return(text);
        if ((!skip) || INLINE[LNPOSN] != 0)
            break;
-       LNPOSN=LNPOSN+1;
+       ++LNPOSN;
     }
 
     text=0;
@@ -268,7 +264,7 @@ long GETTXT(bool skip, bool onewrd, bool upper)
            if (upper && current >= 37)
                current=current-26;
            text=text+current;
-           LNPOSN=LNPOSN+1;
+           ++LNPOSN;
            continue;
        }
        if (splitting != LNPOSN) {
@@ -279,7 +275,7 @@ long GETTXT(bool skip, bool onewrd, bool upper)
 
        text=text+current-PERCENT;
        splitting = -1;
-       LNPOSN=LNPOSN+1;
+       ++LNPOSN;
     }
 
     return text;
@@ -342,7 +338,7 @@ void PUTTXT(token_t word, long *state, long casemake)
        *state=*state+byte;
        if (*state < alph2 && *state >= alph1)*state=*state-26*casemake;
        INLINE[LNPOSN]=*state;
-       LNPOSN=LNPOSN+1;
+       ++LNPOSN;
        *state=0;
     }
 }
@@ -464,7 +460,7 @@ void CARRY(long object, long where)
        if (game.place[object] == -1)
            return;
        game.place[object]= -1;
-       game.holdng=game.holdng+1;
+       ++game.holdng;
     }
     if (game.atloc[where] == object) {
        game.atloc[where]=game.link[object];