Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint/lint1 lint: constify keyword in lexer



details:   https://anonhg.NetBSD.org/src/rev/e3a1c57c0808
branches:  trunk
changeset: 984438:e3a1c57c0808
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Jul 08 02:59:22 2021 +0000

description:
lint: constify keyword in lexer

No functional change.

diffstat:

 usr.bin/xlint/lint1/lex.c   |  8 ++++----
 usr.bin/xlint/lint1/lint1.h |  4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r ba7932ef2dad -r e3a1c57c0808 usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Wed Jul 07 11:51:45 2021 +0000
+++ b/usr.bin/xlint/lint1/lex.c Thu Jul 08 02:59:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.51 2021/07/06 20:17:15 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.52 2021/07/08 02:59:22 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.51 2021/07/06 20:17:15 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.52 2021/07/08 02:59:22 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -258,7 +258,7 @@
 
 
 static void
-add_keyword(struct kwtab *kw, u_int deco)
+add_keyword(const struct kwtab *kw, u_int deco)
 {
        sym_t *sym;
        size_t h;
@@ -452,7 +452,7 @@
        for (sym = symtab[sb->sb_hash]; sym != NULL; sym = sym->s_link) {
                if (strcmp(sym->s_name, sb->sb_name) == 0) {
                        if (sym->s_keyword != NULL) {
-                               struct kwtab *kw = sym->s_keyword;
+                               const struct kwtab *kw = sym->s_keyword;
                                if (!kw->kw_attr || attron)
                                        return sym;
                        } else if (!attron && sym->s_kind == symtyp)
diff -r ba7932ef2dad -r e3a1c57c0808 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h       Wed Jul 07 11:51:45 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h       Thu Jul 08 02:59:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.112 2021/07/06 04:44:20 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.113 2021/07/08 02:59:22 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -244,7 +244,7 @@
        pos_t   s_set_pos;      /* position of first initialization */
        pos_t   s_use_pos;      /* position of first use */
        symt_t  s_kind;         /* type of symbol */
-       void   *s_keyword;
+       const struct kwtab *s_keyword;
        bool    s_bitfield : 1;
        bool    s_set : 1;      /* variable set, label defined */
        bool    s_used : 1;     /* variable/label used */



Home | Main Index | Thread Index | Old Index