Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/ksh Stop using the register keyword in ksh(1)



details:   https://anonhg.NetBSD.org/src/rev/1a2dece82998
branches:  trunk
changeset: 322578:1a2dece82998
user:      kamil <kamil%NetBSD.org@localhost>
date:      Tue May 08 16:37:59 2018 +0000

description:
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie

diffstat:

 bin/ksh/c_ksh.c   |  12 ++++----
 bin/ksh/c_sh.c    |  28 ++++++++++----------
 bin/ksh/emacs.c   |  42 +++++++++++++++---------------
 bin/ksh/eval.c    |  38 +++++++++++++-------------
 bin/ksh/exec.c    |  24 ++++++++--------
 bin/ksh/expand.h  |   6 ++--
 bin/ksh/expr.c    |   6 ++--
 bin/ksh/history.c |  26 +++++++++---------
 bin/ksh/io.c      |   8 ++--
 bin/ksh/lex.c     |  20 +++++++-------
 bin/ksh/mail.c    |  20 +++++++-------
 bin/ksh/main.c    |  16 +++++-----
 bin/ksh/misc.c    |  34 ++++++++++++------------
 bin/ksh/syn.c     |  46 ++++++++++++++++----------------
 bin/ksh/table.c   |  44 +++++++++++++++---------------
 bin/ksh/trap.c    |   8 ++--
 bin/ksh/tree.c    |  62 ++++++++++++++++++++++----------------------
 bin/ksh/var.c     |  76 +++++++++++++++++++++++++++---------------------------
 bin/ksh/vi.c      |   6 ++--
 19 files changed, 261 insertions(+), 261 deletions(-)

diffs (truncated from 1794 to 300 lines):

diff -r 09695531fe8c -r 1a2dece82998 bin/ksh/c_ksh.c
--- a/bin/ksh/c_ksh.c   Tue May 08 11:42:43 2018 +0000
+++ b/bin/ksh/c_ksh.c   Tue May 08 16:37:59 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c_ksh.c,v 1.27 2018/01/24 09:53:20 kamil Exp $ */
+/*     $NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $ */
 
 /*
  * built-in Korn commands: c_*
@@ -6,7 +6,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.27 2018/01/24 09:53:20 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $");
 #endif
 
 #include <sys/stat.h>
@@ -317,7 +317,7 @@
        Xinit(xs, xp, 128, ATEMP);
 
        while (*wp != NULL) {
-               register int c;
+               int c;
                s = *wp;
                while ((c = *s++) != '\0') {
                        Xcheck(xs, xp);
@@ -995,8 +995,8 @@
 c_unalias(wp)
        char **wp;
 {
-       register struct table *t = &aliases;
-       register struct tbl *ap;
+       struct table *t = &aliases;
+       struct tbl *ap;
        int rv = 0, all = 0;
        int optc;
 
@@ -1389,7 +1389,7 @@
        char **wp;
 {
        int rv = 0, macro = 0, list = 0;
-       register char *cp;
+       char *cp;
        int optc;
 
        while ((optc = ksh_getopt(wp, &builtin_opt, "lm")) != EOF)
diff -r 09695531fe8c -r 1a2dece82998 bin/ksh/c_sh.c
--- a/bin/ksh/c_sh.c    Tue May 08 11:42:43 2018 +0000
+++ b/bin/ksh/c_sh.c    Tue May 08 16:37:59 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c_sh.c,v 1.23 2017/06/30 04:41:19 kamil Exp $  */
+/*     $NetBSD: c_sh.c,v 1.24 2018/05/08 16:37:59 kamil Exp $  */
 
 /*
  * built-in Bourne commands
@@ -6,7 +6,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: c_sh.c,v 1.23 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: c_sh.c,v 1.24 2018/05/08 16:37:59 kamil Exp $");
 #endif
 
 #include <sys/stat.h>
@@ -31,8 +31,8 @@
 c_shift(wp)
        char **wp;
 {
-       register struct block *l = e->loc;
-       register int n;
+       struct block *l = e->loc;
+       int n;
        long val;
        char *arg;
 
@@ -63,8 +63,8 @@
 c_umask(wp)
        char **wp;
 {
-       register int i;
-       register char *cp;
+       int i;
+       char *cp;
        int symbolic = 0;
        int old_umask;
        int optc;
@@ -245,11 +245,11 @@
 c_read(wp)
        char **wp;
 {
-       register int c = 0;
+       int c = 0;
        int expandv = 1, history = 0;
        int expanding;
        int ecode = 0;
-       register char *cp;
+       char *cp;
        int fd = 0;
        struct shf *shf;
        int optc;
@@ -429,7 +429,7 @@
 c_eval(wp)
        char **wp;
 {
-       register struct source *s;
+       struct source *s;
        int rv;
 
        if (ksh_getopt(wp, &builtin_opt, null) == '?')
@@ -475,7 +475,7 @@
 {
        int i;
        char *s;
-       register Trap *p;
+       Trap *p;
 
        if (ksh_getopt(wp, &builtin_opt, null) == '?')
                return 1;
@@ -635,7 +635,7 @@
 {
        int argi, setargs;
        struct block *l = e->loc;
-       register char **owp = wp;
+       char **owp = wp;
 
        if (wp[1] == NULL) {
                static const char *const args [] = { "set", "-", NULL };
@@ -669,7 +669,7 @@
 c_unset(wp)
        char **wp;
 {
-       register char *id;
+       char *id;
        int optc, unset_var = 1;
        int ret = 0;
 
@@ -816,8 +816,8 @@
        clock_t t;
 {
        static char temp[22]; /* enough for 64 bit clock_t */
-       register int i;
-       register char *cp = temp + sizeof(temp);
+       int i;
+       char *cp = temp + sizeof(temp);
 
        /* note: posix says must use max precision, ie, if clk_tck is
         * 1000, must print 3 places after decimal (if non-zero, else 1).
diff -r 09695531fe8c -r 1a2dece82998 bin/ksh/emacs.c
--- a/bin/ksh/emacs.c   Tue May 08 11:42:43 2018 +0000
+++ b/bin/ksh/emacs.c   Tue May 08 16:37:59 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: emacs.c,v 1.37 2017/06/30 04:41:19 kamil Exp $ */
+/*     $NetBSD: emacs.c,v 1.38 2018/05/08 16:37:59 kamil Exp $ */
 
 /*
  *  Emacs-like command line editing and history
@@ -10,7 +10,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: emacs.c,v 1.37 2017/06/30 04:41:19 kamil Exp $");
+__RCSID("$NetBSD: emacs.c,v 1.38 2018/05/08 16:37:59 kamil Exp $");
 #endif
 
 #include "config.h"
@@ -454,7 +454,7 @@
        char    *s;
 {
        char *cp = xcp;
-       register int    adj = x_adj_done;
+       int     adj = x_adj_done;
 
        if (x_do_ins(s, strlen(s)) < 0)
                return -1;
@@ -619,7 +619,7 @@
 x_bword()
 {
        int     nc = 0;
-       register char *cp = xcp;
+       char *cp = xcp;
 
        if (cp == xbuf)  {
                x_e_putc(BEL);
@@ -646,7 +646,7 @@
 x_fword()
 {
        int     nc = 0;
-       register char   *cp = xcp;
+       char    *cp = xcp;
 
        if (cp == xep)  {
                x_e_putc(BEL);
@@ -670,7 +670,7 @@
 
 static void
 x_goto(cp)
-       register char *cp;
+       char *cp;
 {
   if (cp < xbp || cp >= (xbp + x_displen))
   {
@@ -700,7 +700,7 @@
 x_bs(c)
        int c;
 {
-       register int i;
+       int i;
        i = x_size(c);
        while (i--)
                x_e_putc('\b');
@@ -708,9 +708,9 @@
 
 static int
 x_size_str(cp)
-       register char *cp;
+       char *cp;
 {
-       register int size = 0;
+       int size = 0;
        while (*cp)
                size += x_size(*cp++);
        return size;
@@ -729,9 +729,9 @@
 
 static void
 x_zots(str)
-       register char *str;
+       char *str;
 {
-  register int adj = x_adj_done;
+  int  adj = x_adj_done;
 
   x_lastcp();
   while (*str && str < xlp && adj == x_adj_done)
@@ -870,7 +870,7 @@
 
 static void
 x_load_hist(hp)
-       register char **hp;
+       char **hp;
 {
        int     oldsize;
 
@@ -915,7 +915,7 @@
 {
        int offset = -1;        /* offset of match in xbuf, else -1 */
        char pat [256+1];       /* pattern buffer */
-       register char *p = pat;
+       char *p = pat;
        Findex f;
 
        *p = '\0';
@@ -978,7 +978,7 @@
        int sameline;
        int offset;
 {
-       register char **hp;
+       char **hp;
        int i;
 
        for (hp = x_histp - (sameline ? 0 : 1) ; hp >= histlist; --hp) {
@@ -1349,7 +1349,7 @@
        int c;
 {
        static char buf[8];
-       register char *p = buf;
+       char *p = buf;
 
        if (iscntrl((unsigned char)c))  {
                *p++ = '^';
@@ -1473,7 +1473,7 @@
 x_init_emacs()
 {
        size_t i;
-       register int j;
+       int j;
        char *locale;
 
        ainit(AEDIT);
@@ -1627,7 +1627,7 @@
        int c;
 {
        char    newbuf [256+1];
-       register char *ip, *op;
+       char    *ip, *op;
        int     i, len;
 
        i = xep - xbuf;
@@ -1926,7 +1926,7 @@
 x_e_puts(s)
        const char *s;
 {
-  register int adj = x_adj_done;
+  int  adj = x_adj_done;
 
   while (*s && adj == x_adj_done)
     x_e_putc(*s++);
@@ -2007,7 +2007,7 @@
 x_prev_histword(c)



Home | Main Index | Thread Index | Old Index