Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/m4 use TOKEN_LINE from MirBSD
details: https://anonhg.NetBSD.org/src/rev/f73b85255904
branches: trunk
changeset: 762912:f73b85255904
user: christos <christos%NetBSD.org@localhost>
date: Sat Mar 05 16:37:50 2011 +0000
description:
use TOKEN_LINE from MirBSD
diffstat:
usr.bin/m4/mdef.h | 4 +++-
usr.bin/m4/misc.c | 6 +++---
usr.bin/m4/trace.c | 6 +++---
3 files changed, 9 insertions(+), 7 deletions(-)
diffs (74 lines):
diff -r f7a272a152de -r f73b85255904 usr.bin/m4/mdef.h
--- a/usr.bin/m4/mdef.h Sat Mar 05 15:36:50 2011 +0000
+++ b/usr.bin/m4/mdef.h Sat Mar 05 16:37:50 2011 +0000
@@ -1,5 +1,5 @@
/* $OpenBSD: mdef.h,v 1.29 2006/03/20 20:27:45 espie Exp $ */
-/* $NetBSD: mdef.h,v 1.13 2009/10/26 21:11:28 christos Exp $ */
+/* $NetBSD: mdef.h,v 1.14 2011/03/05 16:37:50 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -166,6 +166,8 @@
#define CURRENT_NAME (infile[ilevel].name)
#define CURRENT_LINE (infile[ilevel].lineno)
+#define TOKEN_LINE(f) (f->lineno - (f->c == '\n' ? 1 : 0))
+
/*
* macros for readibility and/or speed
*
diff -r f7a272a152de -r f73b85255904 usr.bin/m4/misc.c
--- a/usr.bin/m4/misc.c Sat Mar 05 15:36:50 2011 +0000
+++ b/usr.bin/m4/misc.c Sat Mar 05 16:37:50 2011 +0000
@@ -1,5 +1,5 @@
/* $OpenBSD: misc.c,v 1.41 2009/10/14 17:19:47 sthen Exp $ */
-/* $NetBSD: misc.c,v 1.20 2009/11/06 15:13:27 joerg Exp $ */
+/* $NetBSD: misc.c,v 1.21 2011/03/05 16:37:50 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -36,7 +36,7 @@
#include "nbtool_config.h"
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: misc.c,v 1.20 2009/11/06 15:13:27 joerg Exp $");
+__RCSID("$NetBSD: misc.c,v 1.21 2011/03/05 16:37:50 christos Exp $");
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
@@ -395,7 +395,7 @@
void
doprintlineno(struct input_file *f)
{
- pbunsigned(f->lineno);
+ pbunsigned(TOKEN_LINE(f));
}
void
diff -r f7a272a152de -r f73b85255904 usr.bin/m4/trace.c
--- a/usr.bin/m4/trace.c Sat Mar 05 15:36:50 2011 +0000
+++ b/usr.bin/m4/trace.c Sat Mar 05 16:37:50 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trace.c,v 1.6 2009/10/26 21:11:28 christos Exp $ */
+/* $NetBSD: trace.c,v 1.7 2011/03/05 16:37:50 christos Exp $ */
/* $OpenBSD: trace.c,v 1.15 2006/03/24 08:03:44 espie Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
@@ -28,7 +28,7 @@
#include "nbtool_config.h"
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: trace.c,v 1.6 2009/10/26 21:11:28 christos Exp $");
+__RCSID("$NetBSD: trace.c,v 1.7 2011/03/05 16:37:50 christos Exp $");
#include <sys/types.h>
#include <err.h>
@@ -143,7 +143,7 @@
if (trace_flags & TRACE_FILENAME)
fprintf(traceout, "%s:", inp->name);
if (trace_flags & TRACE_LINENO)
- fprintf(traceout, "%lu:", inp->lineno);
+ fprintf(traceout, "%lu:", TOKEN_LINE(inp));
fprintf(traceout, " -%d- ", frame_level());
if (trace_flags & TRACE_ID)
fprintf(traceout, "id %lu: ", expansion_id);
Home |
Main Index |
Thread Index |
Old Index