fix CTRL macro for ANSI C
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 3 Jan 1988 15:12:40 +0000 (07:12 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 3 Jan 1988 15:12:40 +0000 (07:12 -0800)
SCCS-vsn: usr.bin/ex/ex.h 7.9
SCCS-vsn: usr.bin/ex/ex_cmds.c 7.12
SCCS-vsn: usr.bin/ex/ex_cmds2.c 7.6
SCCS-vsn: usr.bin/ex/ex_cmdsub.c 7.9
SCCS-vsn: usr.bin/ex/ex_get.c 7.8
SCCS-vsn: usr.bin/ex/ex_put.c 7.11
SCCS-vsn: usr.bin/ex/ex_tty.c 7.12
SCCS-vsn: usr.bin/ex/ex_vget.c 6.10
SCCS-vsn: usr.bin/ex/ex_vmain.c 7.9
SCCS-vsn: usr.bin/ex/ex_voper.c 7.6
SCCS-vsn: usr.bin/ex/ex_vops2.c 6.10

usr/src/usr.bin/ex/ex.h
usr/src/usr.bin/ex/ex_cmds.c
usr/src/usr.bin/ex/ex_cmds2.c
usr/src/usr.bin/ex/ex_cmdsub.c
usr/src/usr.bin/ex/ex_get.c
usr/src/usr.bin/ex/ex_put.c
usr/src/usr.bin/ex/ex_tty.c
usr/src/usr.bin/ex/ex_vget.c
usr/src/usr.bin/ex/ex_vmain.c
usr/src/usr.bin/ex/ex_voper.c
usr/src/usr.bin/ex/ex_vops2.c

index 85c37be..6b645b6 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)ex.h        7.8 (Berkeley) %G%
+ *     @(#)ex.h        7.9 (Berkeley) %G%
  */
 
 #ifdef V6
  */
 
 #ifdef V6
@@ -175,9 +175,9 @@ extern       struct option options[NOPTS + 1];
 #ifndef vms
 #undef CTRL
 #endif
 #ifndef vms
 #undef CTRL
 #endif
-#define        CTRL(c) ('c' & 037)
-#define        NL      CTRL(j)
-#define        CR      CTRL(m)
+#define        CTRL(c) (c & 037)
+#define        NL      CTRL('j')
+#define        CR      CTRL('m')
 #define        DELETE  0177            /* See also ATTN, QUIT in ex_tune.h */
 #define        ESCAPE  033
 
 #define        DELETE  0177            /* See also ATTN, QUIT in ex_tune.h */
 #define        ESCAPE  033
 
index 9fd1788..64c3919 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char *sccsid = "@(#)ex_cmds.c   7.11 (Berkeley) %G%";
+static char *sccsid = "@(#)ex_cmds.c   7.12 (Berkeley) %G%";
 #endif not lint
 
 #include "ex.h"
 #endif not lint
 
 #include "ex.h"
@@ -131,7 +131,7 @@ error("Offset out-of-bounds|Offset after command too large");
                 * the set of available commands here to save work below.
                 */
                if (inopen) {
                 * the set of available commands here to save work below.
                 */
                if (inopen) {
-                       if (c=='\n' || c=='\r' || c==CTRL(d) || c==EOF) {
+                       if (c=='\n' || c=='\r' || c==CTRL('d') || c==EOF) {
                                if (addr2)
                                        dot = addr2;
                                if (c == EOF)
                                if (addr2)
                                        dot = addr2;
                                if (c == EOF)
@@ -770,7 +770,7 @@ caseline:
                        notempty();
                        if (addr2 == 0) {
                                if (UP != NOSTR && c == '\n' && !inglobal)
                        notempty();
                        if (addr2 == 0) {
                                if (UP != NOSTR && c == '\n' && !inglobal)
-                                       c = CTRL(k);
+                                       c = CTRL('k');
                                if (inglobal)
                                        addr1 = addr2 = dot;
                                else {
                                if (inglobal)
                                        addr1 = addr2 = dot;
                                else {
@@ -784,7 +784,7 @@ caseline:
                        if (seensemi)
                                addr1 = addr2;
                        getline(*addr1);
                        if (seensemi)
                                addr1 = addr2;
                        getline(*addr1);
-                       if (c == CTRL(k)) {
+                       if (c == CTRL('k')) {
                                flush1();
                                destline--;
                                if (hadpr)
                                flush1();
                                destline--;
                                if (hadpr)
@@ -847,7 +847,7 @@ numberit:
 
 /* ^D */
 /* EOF */
 
 /* ^D */
 /* EOF */
-               case CTRL(d):
+               case CTRL('d'):
                case EOF:
                        if (exitoneof) {
                                if (addr2 != 0)
                case EOF:
                        if (exitoneof) {
                                if (addr2 != 0)
index a267543..6bb4c3a 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char *sccsid = "@(#)ex_cmds2.c  7.5 (Berkeley) %G%";
+static char *sccsid = "@(#)ex_cmds2.c  7.6 (Berkeley) %G%";
 #endif not lint
 
 #include "ex.h"
 #endif not lint
 
 #include "ex.h"
@@ -515,7 +515,7 @@ vcontin(ask)
                         * Gobble ^Q/^S since the tty driver should be eating
                         * them (as far as the user can see)
                         */
                         * Gobble ^Q/^S since the tty driver should be eating
                         * them (as far as the user can see)
                         */
-                       while (peekkey() == CTRL(Q) || peekkey() == CTRL(S))
+                       while (peekkey() == CTRL('Q') || peekkey() == CTRL('S'))
                                ignore(getkey());
 #endif
                        if(getkey() == ':') {
                                ignore(getkey());
 #endif
                        if(getkey() == ':') {
index bec0d1a..471dd3e 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char *sccsid = "@(#)ex_cmdsub.c 7.8 (Berkeley) %G%";
+static char *sccsid = "@(#)ex_cmdsub.c 7.9 (Berkeley) %G%";
 #endif not lint
 
 #include "ex.h"
 #endif not lint
 
 #include "ex.h"
@@ -1108,7 +1108,7 @@ mapcmd(un, ab)
        ignore(skipwh());
        for (p=lhs; ; ) {
                c = ex_getchar();
        ignore(skipwh());
        for (p=lhs; ; ) {
                c = ex_getchar();
-               if (c == CTRL(v)) {
+               if (c == CTRL('v')) {
                        c = ex_getchar();
                } else if (!un && any(c, " \t")) {
                        /* End of lhs */
                        c = ex_getchar();
                } else if (!un && any(c, " \t")) {
                        /* End of lhs */
@@ -1131,7 +1131,7 @@ mapcmd(un, ab)
                error("Missing rhs");
        for (p=rhs; ; ) {
                c = ex_getchar();
                error("Missing rhs");
        for (p=rhs; ; ) {
                c = ex_getchar();
-               if (c == CTRL(v)) {
+               if (c == CTRL('v')) {
                        c = ex_getchar();
                } else if (endcmd(c) && c!='"') {
                        ungetchar(c);
                        c = ex_getchar();
                } else if (endcmd(c) && c!='"') {
                        ungetchar(c);
index 7dbcc91..f39715a 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char *sccsid = "@(#)ex_get.c    7.7 (Berkeley) %G%";
+static char *sccsid = "@(#)ex_get.c    7.8 (Berkeley) %G%";
 #endif not lint
 
 #include "ex.h"
 #endif not lint
 
 #include "ex.h"
@@ -30,7 +30,7 @@ ex_getchar()
 
        do
                c = getcd();
 
        do
                c = getcd();
-       while (!globp && c == CTRL(d));
+       while (!globp && c == CTRL('d'));
        return (c);
 }
 
        return (c);
 }
 
@@ -44,7 +44,7 @@ again:
                return (c);
        c &= TRIM;
        if (!inopen)
                return (c);
        c &= TRIM;
        if (!inopen)
-               if (!globp && c == CTRL(d))
+               if (!globp && c == CTRL('d'))
                        setlastchar('\n');
                else if (junk(c)) {
                        checkjunk(c);
                        setlastchar('\n');
                else if (junk(c)) {
                        checkjunk(c);
@@ -99,7 +99,7 @@ top:
                if (c < 0)
                        return (lastc = EOF);
                if (c == 0 || inline[c-1] != '\n')
                if (c < 0)
                        return (lastc = EOF);
                if (c == 0 || inline[c-1] != '\n')
-                       inline[c++] = CTRL(d);
+                       inline[c++] = CTRL('d');
                if (inline[c-1] == '\n')
                        noteinp();
                inline[c] = 0;
                if (inline[c-1] == '\n')
                        noteinp();
                inline[c] = 0;
@@ -147,7 +147,7 @@ gettty()
                                lastin = lindent(dot + 1);
 #endif
                        tab(lastin + offset);
                                lastin = lindent(dot + 1);
 #endif
                        tab(lastin + offset);
-                       while ((c = getcd()) == CTRL(d)) {
+                       while ((c = getcd()) == CTRL('d')) {
                                if (lastin == 0 && isatty(0) == -1) {
                                        holdcm = 0;
                                        return (EOF);
                                if (lastin == 0 && isatty(0) == -1) {
                                        holdcm = 0;
                                        return (EOF);
@@ -160,7 +160,7 @@ gettty()
                        case '^':
                        case '0':
                                ch = getcd();
                        case '^':
                        case '0':
                                ch = getcd();
-                               if (ch == CTRL(d)) {
+                               if (ch == CTRL('d')) {
                                        if (c == '0')
                                                lastin = 0;
                                        if (!OS) {
                                        if (c == '0')
                                                lastin = 0;
                                        if (!OS) {
index 601b40b..2c4cb9d 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char *sccsid = "@(#)ex_put.c    7.10 (Berkeley) %G%";
+static char *sccsid = "@(#)ex_put.c    7.11 (Berkeley) %G%";
 #endif not lint
 
 #include "ex.h"
 #endif not lint
 
 #include "ex.h"
@@ -982,9 +982,9 @@ tostart()
 ttcharoff()
 {
        nttyc.t_quitc = '\377';
 ttcharoff()
 {
        nttyc.t_quitc = '\377';
-       if (nttyc.t_startc != CTRL(q))
+       if (nttyc.t_startc != CTRL('q'))
                nttyc.t_startc = '\377';
                nttyc.t_startc = '\377';
-       if (nttyc.t_stopc != CTRL(s))
+       if (nttyc.t_stopc != CTRL('s'))
                nttyc.t_stopc = '\377';
 # ifdef TIOCLGET
        nlttyc.t_suspc = '\377';        /* ^Z */
                nttyc.t_stopc = '\377';
 # ifdef TIOCLGET
        nlttyc.t_suspc = '\377';        /* ^Z */
@@ -1005,9 +1005,9 @@ ttcharoff()
         * their start/stop chars.  As long as they can't we can't get
         * into trouble so we just leave them alone.
         */
         * their start/stop chars.  As long as they can't we can't get
         * into trouble so we just leave them alone.
         */
-       if (tty.c_cc[VSTART] != CTRL(q))
+       if (tty.c_cc[VSTART] != CTRL('q'))
                tty.c_cc[VSTART] = '\377';
                tty.c_cc[VSTART] = '\377';
-       if (tty.c_cc[VSTOP] != CTRL(s))
+       if (tty.c_cc[VSTOP] != CTRL('s'))
                tty.c_cc[VSTOP] = '\377';
 # endif
 }
                tty.c_cc[VSTOP] = '\377';
 # endif
 }
index 19da7b1..94aea47 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char *sccsid = "@(#)ex_tty.c    7.11 (Berkeley) %G%";
+static char *sccsid = "@(#)ex_tty.c    7.12 (Berkeley) %G%";
 #endif not lint
 
 #include "ex.h"
 #endif not lint
 
 #include "ex.h"
@@ -112,10 +112,10 @@ setterm(type)
                if (ldisc == NTTYDISC) {
                        sc[0] = olttyc.t_suspc;
                        sc[1] = 0;
                if (ldisc == NTTYDISC) {
                        sc[0] = olttyc.t_suspc;
                        sc[1] = 0;
-                       if (olttyc.t_suspc == CTRL(z)) {
+                       if (olttyc.t_suspc == CTRL('z')) {
                                for (i=0; i<=4; i++)
                                        if (arrows[i].cap &&
                                for (i=0; i<=4; i++)
                                        if (arrows[i].cap &&
-                                           arrows[i].cap[0] == CTRL(z))
+                                           arrows[i].cap[0] == CTRL('z'))
                                                addmac(sc, (char *) NULL,
                                                        (char *) NULL, arrows);
                        } else
                                                addmac(sc, (char *) NULL,
                                                        (char *) NULL, arrows);
                        } else
index cfe1e95..4789454 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)ex_vget.c  6.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)ex_vget.c  6.10 (Berkeley) %G%";
 #endif not lint
 
 #include "ex.h"
 #endif not lint
 
 #include "ex.h"
@@ -137,7 +137,7 @@ again:
                        Peek2key = 0;
                        break;
                case 'q':       /* f2 -> ^C */
                        Peek2key = 0;
                        break;
                case 'q':       /* f2 -> ^C */
-                       c = CTRL(c);
+                       c = CTRL('c');
                        Peek2key = 0;
                        break;
                case 'p':       /* f1 -> esc */
                        Peek2key = 0;
                        break;
                case 'p':       /* f1 -> esc */
@@ -216,8 +216,8 @@ getesc()
        c = getkey();
        switch (c) {
 
        c = getkey();
        switch (c) {
 
-       case CTRL(v):
-       case CTRL(q):
+       case CTRL('v'):
+       case CTRL('q'):
                c = getkey();
                return (c);
 
                c = getkey();
                return (c);
 
@@ -275,13 +275,13 @@ readecho(c)
                ex_putchar('\n');
        vscrap();
        Pline = OP;
                ex_putchar('\n');
        vscrap();
        Pline = OP;
-       if (Peek_key != ATTN && Peek_key != QUIT && Peek_key != CTRL(h)) {
+       if (Peek_key != ATTN && Peek_key != QUIT && Peek_key != CTRL('h')) {
                cursor = sc;
                vclreol();
                return (0);
        }
 blewit:
                cursor = sc;
                vclreol();
                return (0);
        }
 blewit:
-       OPeek = Peek_key==CTRL(h) ? 0 : Peek_key; Peek_key = 0;
+       OPeek = Peek_key==CTRL('h') ? 0 : Peek_key; Peek_key = 0;
        splitw = 0;
        vclean();
        vshow(dot, NOLINE);
        splitw = 0;
        vclean();
        vshow(dot, NOLINE);
@@ -405,7 +405,7 @@ beep()
        if (VB)
                vputp(VB, 0);
        else
        if (VB)
                vputp(VB, 0);
        else
-               vputc(CTRL(g));
+               vputc(CTRL('g'));
 }
 
 /*
 }
 
 /*
index 5bfba8e..fc50f53 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char *sccsid = "@(#)ex_vmain.c  7.8 (Berkeley) %G%";
+static char *sccsid = "@(#)ex_vmain.c  7.9 (Berkeley) %G%";
 #endif not lint
 
 #include "ex.h"
 #endif not lint
 
 #include "ex.h"
@@ -192,9 +192,9 @@ reread:
                 *              will probably foul this up, but nobody has
                 *              one of them.
                 */
                 *              will probably foul this up, but nobody has
                 *              one of them.
                 */
-               case CTRL(l):
-               case CTRL(r):
-                       if (c == CTRL(l) || (KR && *KR==CTRL(l))) {
+               case CTRL('l'):
+               case CTRL('r'):
+                       if (c == CTRL('l') || (KR && *KR==CTRL('l'))) {
                                vclear();
                                vdirty(0, vcnt);
                        }
                                vclear();
                                vdirty(0, vcnt);
                        }
@@ -300,7 +300,7 @@ reread:
                 *              redrawn almost as it was.  In this case
                 *              one should simply move the cursor.
                 */
                 *              redrawn almost as it was.  In this case
                 *              one should simply move the cursor.
                 */
-               case CTRL(u):
+               case CTRL('u'):
                        if (hadcnt)
                                ex_vSCROLL = cnt;
                        cnt = ex_vSCROLL;
                        if (hadcnt)
                                ex_vSCROLL = cnt;
                        cnt = ex_vSCROLL;
@@ -316,7 +316,7 @@ reread:
                /*
                 * ^D           Scroll down.  Like scroll up.
                 */
                /*
                 * ^D           Scroll down.  Like scroll up.
                 */
-               case CTRL(d):
+               case CTRL('d'):
 #ifdef TRACE
                if (trace)
                        fprintf(trace, "before vdown in ^D, dot=%d, wdot=%d, dol=%d\n", lineno(dot), lineno(wdot), lineno(dol));
 #ifdef TRACE
                if (trace)
                        fprintf(trace, "before vdown in ^D, dot=%d, wdot=%d, dol=%d\n", lineno(dot), lineno(wdot), lineno(dol));
@@ -345,7 +345,7 @@ reread:
                 * ^E           Glitch the screen down (one) line.
                 *              Cursor left on same line in file.
                 */
                 * ^E           Glitch the screen down (one) line.
                 *              Cursor left on same line in file.
                 */
-               case CTRL(e):
+               case CTRL('e'):
                        if (state != VISUAL)
                                continue;
                        if (!hadcnt)
                        if (state != VISUAL)
                                continue;
                        if (!hadcnt)
@@ -360,7 +360,7 @@ reread:
                /*
                 * ^Y           Like ^E but up
                 */
                /*
                 * ^Y           Like ^E but up
                 */
-               case CTRL(y):
+               case CTRL('y'):
                        if (state != VISUAL)
                                continue;
                        if (!hadcnt)
                        if (state != VISUAL)
                                continue;
                        if (!hadcnt)
@@ -409,7 +409,7 @@ reread:
                 * ^F           Window forwards, with 2 lines of continuity.
                 *              Count repeats.
                 */
                 * ^F           Window forwards, with 2 lines of continuity.
                 *              Count repeats.
                 */
-               case CTRL(f):
+               case CTRL('f'):
                        vsave();
                        if (vcnt > 2) {
                                addr = dot + (vcnt - vcline) - 2 + (cnt-1)*basWLINES;
                        vsave();
                        if (vcnt > 2) {
                                addr = dot + (vcnt - vcline) - 2 + (cnt-1)*basWLINES;
@@ -424,7 +424,7 @@ reread:
                 * ^B           Window backwards, with 2 lines of continuity.
                 *              Inverse of ^F.
                 */
                 * ^B           Window backwards, with 2 lines of continuity.
                 *              Inverse of ^F.
                 */
-               case CTRL(b):
+               case CTRL('b'):
                        vsave();
                        if (one + vcline != dot && vcnt > 2) {
                                addr = dot - vcline + 2 - (cnt-1)*basWLINES;
                        vsave();
                        if (one + vcline != dot && vcnt > 2) {
                                addr = dot - vcline + 2 - (cnt-1)*basWLINES;
@@ -833,7 +833,7 @@ pfixup:
                 *              Like a :e #, and thus can be used after a
                 *              "No Write" diagnostic.
                 */
                 *              Like a :e #, and thus can be used after a
                 *              "No Write" diagnostic.
                 */
-               case CTRL(^):
+               case CTRL('^'):
                        forbid (hadcnt);
                        vsave();
                        ckaw();
                        forbid (hadcnt);
                        vsave();
                        ckaw();
@@ -848,7 +848,7 @@ pfixup:
                 * ^]           Takes word after cursor as tag, and then does
                 *              tag command.  Read ``go right to''.
                 */
                 * ^]           Takes word after cursor as tag, and then does
                 *              tag command.  Read ``go right to''.
                 */
-               case CTRL(]):
+               case CTRL(']'):
                        grabtag();
                        oglobp = globp;
                        globp = "tag";
                        grabtag();
                        oglobp = globp;
                        globp = "tag";
@@ -868,7 +868,7 @@ pfixup:
                 *
                 * BUG:         Was ^S but doesn't work in cbreak mode
                 */
                 *
                 * BUG:         Was ^S but doesn't work in cbreak mode
                 */
-               case CTRL(g):
+               case CTRL('g'):
                        oglobp = globp;
                        globp = "file";
 gogo:
                        oglobp = globp;
                        globp = "file";
 gogo:
@@ -882,7 +882,7 @@ gogo:
                 *      to shell.  Only works with Berkeley/IIASA process
                 *      control in kernel.
                 */
                 *      to shell.  Only works with Berkeley/IIASA process
                 *      control in kernel.
                 */
-               case CTRL(z):
+               case CTRL('z'):
                        forbid(dosusp == 0 || !ldisc);
                        vsave();
                        oglobp = globp;
                        forbid(dosusp == 0 || !ldisc);
                        vsave();
                        oglobp = globp;
index 8cbc780..ae48c9d 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char *sccsid = "@(#)ex_voper.c  7.5 (Berkeley) %G%";
+static char *sccsid = "@(#)ex_voper.c  7.6 (Berkeley) %G%";
 #endif not lint
 
 #include "ex.h"
 #endif not lint
 
 #include "ex.h"
@@ -390,7 +390,7 @@ fixup:
         * ^H           Back a character.
         */
        case 'h':
         * ^H           Back a character.
         */
        case 'h':
-       case CTRL(h):
+       case CTRL('h'):
                dir = -1;
                /* fall into ... */
 
                dir = -1;
                /* fall into ... */
 
@@ -484,7 +484,7 @@ errlab:
         *              console of the VAX since it puts console in LSI mode.
         */
        case 'k':
         *              console of the VAX since it puts console in LSI mode.
         */
        case 'k':
-       case CTRL(p):
+       case CTRL('p'):
                wdot = dot - cnt;
                if (vmoving == 0)
                        vmoving = 1, vmovcol = column(cursor);
                wdot = dot - cnt;
                if (vmoving == 0)
                        vmoving = 1, vmovcol = column(cursor);
@@ -531,7 +531,7 @@ errlab:
         *
         * LF           Linefeed is a convenient synonym for ^N.
         */
         *
         * LF           Linefeed is a convenient synonym for ^N.
         */
-       case CTRL(n):
+       case CTRL('n'):
        case 'j':
        case NL:
                wdot = dot + cnt;
        case 'j':
        case NL:
                wdot = dot + cnt;
index d9f2865..8a00e03 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)ex_vops2.c 6.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)ex_vops2.c 6.10 (Berkeley) %G%";
 #endif not lint
 
 #include "ex.h"
 #endif not lint
 
 #include "ex.h"
@@ -494,12 +494,12 @@ vgetline(cnt, gcursor, aescaped, commch)
                         */
 #ifndef USG3TTY
                        if (c == tty.sg_erase)
                         */
 #ifndef USG3TTY
                        if (c == tty.sg_erase)
-                               c = CTRL(h);
+                               c = CTRL('h');
                        else if (c == tty.sg_kill)
                                c = -1;
 #else
                        if (c == tty.c_cc[VERASE])
                        else if (c == tty.sg_kill)
                                c = -1;
 #else
                        if (c == tty.c_cc[VERASE])
-                               c = CTRL(h);
+                               c = CTRL('h');
                        else if (c == tty.c_cc[VKILL])
                                c = -1;
 #endif
                        else if (c == tty.c_cc[VKILL])
                                c = -1;
 #endif
@@ -527,7 +527,7 @@ vgetline(cnt, gcursor, aescaped, commch)
                         *              This is hard because stuff has
                         *              already been saved for repeat.
                         */
                         *              This is hard because stuff has
                         *              already been saved for repeat.
                         */
-                       case CTRL(h):
+                       case CTRL('h'):
 bakchar:
                                cp = gcursor - 1;
                                if (cp < ogcursor) {
 bakchar:
                                cp = gcursor - 1;
                                if (cp < ogcursor) {
@@ -548,7 +548,7 @@ bakchar:
                        /*
                         * ^W           Back up a white/non-white word.
                         */
                        /*
                         * ^W           Back up a white/non-white word.
                         */
-                       case CTRL(w):
+                       case CTRL('w'):
                                wdkind = 1;
                                for (cp = gcursor; cp > ogcursor && isspace(cp[-1]); cp--)
                                        continue;
                                wdkind = 1;
                                for (cp = gcursor; cp > ogcursor && isspace(cp[-1]); cp--)
                                        continue;
@@ -610,8 +610,8 @@ vbackup:
                         *
                         * ^V           Synonym for ^Q
                         */
                         *
                         * ^V           Synonym for ^Q
                         */
-                       case CTRL(q):
-                       case CTRL(v):
+                       case CTRL('q'):
+                       case CTRL('v'):
                                x = destcol, y = destline;
                                ex_putchar('^');
                                vgoto(y, x);
                                x = destcol, y = destline;
                                ex_putchar('^');
                                vgoto(y, x);
@@ -749,8 +749,8 @@ vbackup:
                 *              Unless in repeat where this means these
                 *              were superquoted in.
                 */
                 *              Unless in repeat where this means these
                 *              were superquoted in.
                 */
-               case CTRL(d):
-               case CTRL(t):
+               case CTRL('d'):
+               case CTRL('t'):
                        if (vglobp)
                                goto def;
                        /* fall into ... */
                        if (vglobp)
                                goto def;
                        /* fall into ... */
@@ -758,11 +758,11 @@ vbackup:
                /*
                 * ^D|QUOTE     Is a backtab (in a repeated command).
                 */
                /*
                 * ^D|QUOTE     Is a backtab (in a repeated command).
                 */
-               case CTRL(d) | QUOTE:
+               case CTRL('d') | QUOTE:
                        *gcursor = 0;
                        cp = vpastwh(genbuf);
                        c = whitecnt(genbuf);
                        *gcursor = 0;
                        cp = vpastwh(genbuf);
                        c = whitecnt(genbuf);
-                       if (ch == CTRL(t)) {
+                       if (ch == CTRL('t')) {
                                /*
                                 * ^t just generates new indent replacing
                                 * current white space rounded up to soft
                                /*
                                 * ^t just generates new indent replacing
                                 * current white space rounded up to soft