Module Name:    src
Committed By:   rillig
Date:           Fri Apr  2 22:05:44 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: lex.c lint1.h

Log Message:
lint: reduce memory usage

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.91 -r1.92 src/usr.bin/xlint/lint1/lint1.h

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/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.22 src/usr.bin/xlint/lint1/lex.c:1.23
--- src/usr.bin/xlint/lint1/lex.c:1.22	Fri Apr  2 12:16:50 2021
+++ src/usr.bin/xlint/lint1/lex.c	Fri Apr  2 22:05:43 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.22 2021/04/02 12:16:50 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.23 2021/04/02 22:05:43 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.22 2021/04/02 12:16:50 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.23 2021/04/02 22:05:43 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -56,13 +56,13 @@ __RCSID("$NetBSD: lex.c,v 1.22 2021/04/0
 
 
 /* Current position (it's also updated when an included file is parsed) */
-pos_t	curr_pos = { 1, "", 0 };
+pos_t	curr_pos = { "", 1, 0 };
 
 /*
  * Current position in C source (not updated when an included file is
  * parsed).
  */
-pos_t	csrc_pos = { 1, "", 0 };
+pos_t	csrc_pos = { "", 1, 0 };
 
 /* Are we parsing a gcc attribute? */
 bool attron;

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.91 src/usr.bin/xlint/lint1/lint1.h:1.92
--- src/usr.bin/xlint/lint1/lint1.h:1.91	Fri Apr  2 09:39:25 2021
+++ src/usr.bin/xlint/lint1/lint1.h	Fri Apr  2 22:05:43 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.91 2021/04/02 09:39:25 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.92 2021/04/02 22:05:43 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -59,8 +59,8 @@
  * Describes the position of a declaration or anything else.
  */
 typedef struct {
-	int	p_line;
 	const	char *p_file;
+	int	p_line;
 	int	p_uniq;			/* uniquifier */
 } pos_t;
 

Reply via email to