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: migrate global_clean_up_decl to wa...



details:   https://anonhg.NetBSD.org/src/rev/92b52e2b3797
branches:  trunk
changeset: 961778:92b52e2b3797
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Apr 18 09:39:53 2021 +0000

description:
lint: migrate global_clean_up_decl to warning_at

diffstat:

 usr.bin/xlint/lint1/func.c |  21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diffs (68 lines):

diff -r a87c5d475be2 -r 92b52e2b3797 usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Sun Apr 18 09:37:18 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Sun Apr 18 09:39:53 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.103 2021/04/10 18:06:53 rillig Exp $        */
+/*     $NetBSD: func.c,v 1.104 2021/04/18 09:39:53 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.103 2021/04/10 18:06:53 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.104 2021/04/18 09:39:53 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -1084,45 +1084,36 @@
 void
 global_clean_up_decl(bool silent)
 {
-       pos_t   cpos;
-
-       cpos = curr_pos;
 
        if (nargusg != -1) {
                if (!silent) {
-                       curr_pos = argsused_pos;
                        /* must precede function definition: ** %s ** */
-                       warning(282, "ARGSUSED");
+                       warning_at(282, argsused_pos, "ARGSUSED");
                }
                nargusg = -1;
        }
        if (nvararg != -1) {
                if (!silent) {
-                       curr_pos = vapos;
                        /* must precede function definition: ** %s ** */
-                       warning(282, "VARARGS");
+                       warning_at(282, vapos, "VARARGS");
                }
                nvararg = -1;
        }
        if (printflike_argnum != -1) {
                if (!silent) {
-                       curr_pos = printflike_pos;
                        /* must precede function definition: ** %s ** */
-                       warning(282, "PRINTFLIKE");
+                       warning_at(282, printflike_pos, "PRINTFLIKE");
                }
                printflike_argnum = -1;
        }
        if (scanflike_argnum != -1) {
                if (!silent) {
-                       curr_pos = scanflike_pos;
                        /* must precede function definition: ** %s ** */
-                       warning(282, "SCANFLIKE");
+                       warning_at(282, scanflike_pos, "SCANFLIKE");
                }
                scanflike_argnum = -1;
        }
 
-       curr_pos = cpos;
-
        dcs->d_asm = false;
 }
 



Home | Main Index | Thread Index | Old Index