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: use an unsigned counter for tempor...



details:   https://anonhg.NetBSD.org/src/rev/e60ac967a0f3
branches:  trunk
changeset: 363485:e60ac967a0f3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Mar 13 15:17:08 2022 +0000

description:
lint: use an unsigned counter for temporary variable names

No functional change.

diffstat:

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

diffs (44 lines):

diff -r f66bfa93a09a -r e60ac967a0f3 usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Sun Mar 13 15:08:41 2022 +0000
+++ b/usr.bin/xlint/lint1/lex.c Sun Mar 13 15:17:08 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.111 2022/03/13 15:08:41 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.112 2022/03/13 15:17:08 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.111 2022/03/13 15:08:41 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.112 2022/03/13 15:17:08 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -1447,21 +1447,21 @@
  * the name illegal.
  */
 sym_t *
-mktempsym(type_t *t)
+mktempsym(type_t *tp)
 {
-       static int n = 0;
+       static unsigned n = 0;
        char *s = level_zero_alloc(block_level, 64);
        sym_t *sym = block_zero_alloc(sizeof(*sym));
        scl_t scl;
 
-       (void)snprintf(s, 64, "%.8d_tmp", n++);
+       (void)snprintf(s, 64, "%.8u_tmp", n++);
 
        scl = dcs->d_scl;
        if (scl == NOSCL)
                scl = block_level > 0 ? AUTO : EXTERN;
 
        sym->s_name = s;
-       sym->s_type = t;
+       sym->s_type = tp;
        sym->s_block_level = block_level;
        sym->s_scl = scl;
        sym->s_kind = FVFT;



Home | Main Index | Thread Index | Old Index