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: remove redundant assignments to st...



details:   https://anonhg.NetBSD.org/src/rev/bc28b0f14b52
branches:  trunk
changeset: 362478:bc28b0f14b52
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Mar 01 20:00:47 2022 +0000

description:
lint: remove redundant assignments to string buffer length

No functional change.

diffstat:

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

diffs (32 lines):

diff -r a090aea8fd23 -r bc28b0f14b52 usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Tue Mar 01 06:41:27 2022 +0000
+++ b/usr.bin/xlint/lint1/lex.c Tue Mar 01 20:00:47 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.107 2022/03/01 00:17:12 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.108 2022/03/01 20:00:47 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.107 2022/03/01 00:17:12 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.108 2022/03/01 20:00:47 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -495,13 +495,11 @@
        if (sym != NULL) {
                lint_assert(block_level >= sym->s_block_level);
                sb->sb_name = sym->s_name;
-               sb->sb_len = strlen(sym->s_name);
                tok = sym->s_scl == TYPEDEF ? T_TYPENAME : T_NAME;
        } else {
                s = block_zero_alloc(yyleng + 1);
                (void)memcpy(s, yytext, yyleng + 1);
                sb->sb_name = s;
-               sb->sb_len = yyleng;
                tok = T_NAME;
        }
 



Home | Main Index | Thread Index | Old Index