Module Name:    src
Committed By:   rillig
Date:           Sun Apr 18 09:39:53 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: func.c

Log Message:
lint: migrate global_clean_up_decl to warning_at


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/usr.bin/xlint/lint1/func.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.103 src/usr.bin/xlint/lint1/func.c:1.104
--- src/usr.bin/xlint/lint1/func.c:1.103	Sat Apr 10 18:06:53 2021
+++ src/usr.bin/xlint/lint1/func.c	Sun Apr 18 09:39:53 2021
@@ -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 @@ do_return(tnode_t *tn)
 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;
 }
 

Reply via email to