Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit Fix some const qual (Piotr Pawel Stefaniak)



details:   https://anonhg.NetBSD.org/src/rev/efb0540c7c4a
branches:  trunk
changeset: 376069:efb0540c7c4a
user:      christos <christos%NetBSD.org@localhost>
date:      Tue May 30 11:53:40 2023 +0000

description:
Fix some const qual (Piotr Pawel Stefaniak)

diffstat:

 lib/libedit/tokenizer.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 0be12ab5f9ff -r efb0540c7c4a lib/libedit/tokenizer.c
--- a/lib/libedit/tokenizer.c   Tue May 30 04:14:30 2023 +0000
+++ b/lib/libedit/tokenizer.c   Tue May 30 11:53:40 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tokenizer.c,v 1.28 2016/04/11 18:56:31 christos Exp $  */
+/*     $NetBSD: tokenizer.c,v 1.29 2023/05/30 11:53:40 christos Exp $  */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)tokenizer.c        8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: tokenizer.c,v 1.28 2016/04/11 18:56:31 christos Exp $");
+__RCSID("$NetBSD: tokenizer.c,v 1.29 2023/05/30 11:53:40 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -85,7 +85,7 @@ typedef enum {
 struct TYPE(tokenizer) {
        Char    *ifs;           /* In field separator                    */
        size_t   argc, amax;    /* Current and maximum number of args    */
-       Char   **argv;          /* Argument list                         */
+       const Char   **argv;    /* Argument list                         */
        Char    *wptr, *wmax;   /* Space and limit on the word buffer    */
        Char    *wstart;        /* Beginning of next word                */
        Char    *wspace;        /* Space of word buffer                  */
@@ -424,7 +424,7 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, cons
                        tok->wmax = s + size;
                }
                if (tok->argc >= tok->amax - 4) {
-                       Char **p;
+                       const Char **p;
                        tok->amax += AINCR;
                        p = tok_realloc(tok->argv, tok->amax * sizeof(*p));
                        if (p == NULL) {
@@ -444,7 +444,7 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, cons
        if (cursoro != NULL)
                *cursoro = co;
        FUN(tok,finish)(tok);
-       *argv = (const Char **)tok->argv;
+       *argv = tok->argv;
        *argc = (int)tok->argc;
        return 0;
 }



Home | Main Index | Thread Index | Old Index