Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint lint: rename LERROR to INTERNAL_ERROR
details: https://anonhg.NetBSD.org/src/rev/c8c9e5f544d6
branches: trunk
changeset: 960714:c8c9e5f544d6
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Mar 27 12:42:22 2021 +0000
description:
lint: rename LERROR to INTERNAL_ERROR
The '#ifndef' in tyname.c is meant to distinguish between lint1 and
lint2, it is not meant to be defined from anywhere outside the lint code
itself.
No functional change.
diffstat:
usr.bin/xlint/common/tyname.c | 14 +++++++-------
usr.bin/xlint/lint1/decl.c | 10 +++++-----
usr.bin/xlint/lint1/err.c | 6 +++---
usr.bin/xlint/lint1/externs1.h | 4 ++--
usr.bin/xlint/lint1/lex.c | 8 ++++----
usr.bin/xlint/lint1/lint1.h | 5 +++--
6 files changed, 24 insertions(+), 23 deletions(-)
diffs (201 lines):
diff -r 5e8c335112a8 -r c8c9e5f544d6 usr.bin/xlint/common/tyname.c
--- a/usr.bin/xlint/common/tyname.c Sat Mar 27 12:32:19 2021 +0000
+++ b/usr.bin/xlint/common/tyname.c Sat Mar 27 12:42:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tyname.c,v 1.35 2021/03/26 20:31:07 rillig Exp $ */
+/* $NetBSD: tyname.c,v 1.36 2021/03/27 12:42:22 rillig Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.35 2021/03/26 20:31:07 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.36 2021/03/27 12:42:22 rillig Exp $");
#endif
#include <limits.h>
@@ -45,8 +45,8 @@
#include PASS
-#ifndef LERROR
-#define LERROR(fmt, args...) \
+#ifndef INTERNAL_ERROR
+#define INTERNAL_ERROR(fmt, args...) \
do { \
(void)warnx("%s, %d: " fmt, __FILE__, __LINE__, ##args); \
abort(); \
@@ -180,7 +180,7 @@
case DCOMPLEX: return "double _Complex";
case LCOMPLEX: return "long double _Complex";
default:
- LERROR("tspec_name(%d)", t);
+ INTERNAL_ERROR("tspec_name(%d)", t);
return NULL;
}
}
@@ -244,7 +244,7 @@
return true;
#endif
default:
- LERROR("tyname(%d)", t);
+ INTERNAL_ERROR("tyname(%d)", t);
return false;
}
}
@@ -402,7 +402,7 @@
type_name_of_function(&buf, tp);
break;
default:
- LERROR("type_name(%d)", t);
+ INTERNAL_ERROR("type_name(%d)", t);
}
name = intern(buf.data);
diff -r 5e8c335112a8 -r c8c9e5f544d6 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c Sat Mar 27 12:32:19 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c Sat Mar 27 12:42:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.163 2021/03/27 11:08:00 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.164 2021/03/27 12:42:22 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: decl.c,v 1.163 2021/03/27 11:08:00 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.164 2021/03/27 12:42:22 rillig Exp $");
#endif
#include <sys/param.h>
@@ -823,7 +823,7 @@
case LCOMPLEX:
break;
default:
- LERROR("deftyp(%s)", tspec_name(t));
+ INTERNAL_ERROR("deftyp(%s)", tspec_name(t));
}
if (t != INT && t != CHAR && (s != NOTSPEC || l != NOTSPEC)) {
dcs->d_terr = true;
@@ -909,7 +909,7 @@
switch (tp->t_tspec) {
case FUNC:
/* compiler takes size of function */
- LERROR("%s", msgs[12]);
+ INTERNAL_ERROR("%s", msgs[12]);
/* NOTREACHED */
case STRUCT:
case UNION:
@@ -928,7 +928,7 @@
default:
elsz = size_in_bits(tp->t_tspec);
if (elsz <= 0)
- LERROR("length(%d)", elsz);
+ INTERNAL_ERROR("length(%d)", elsz);
break;
}
return elem * elsz;
diff -r 5e8c335112a8 -r c8c9e5f544d6 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sat Mar 27 12:32:19 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Sat Mar 27 12:42:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.95 2021/03/26 23:17:33 rillig Exp $ */
+/* $NetBSD: err.c,v 1.96 2021/03/27 12:42:22 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.95 2021/03/26 23:17:33 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.96 2021/03/27 12:42:22 rillig Exp $");
#endif
#include <sys/types.h>
@@ -480,7 +480,7 @@
}
void
-lerror(const char *file, int line, const char *msg, ...)
+internal_error(const char *file, int line, const char *msg, ...)
{
va_list ap;
const char *fn;
diff -r 5e8c335112a8 -r c8c9e5f544d6 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h Sat Mar 27 12:32:19 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h Sat Mar 27 12:42:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: externs1.h,v 1.90 2021/03/27 12:32:19 rillig Exp $ */
+/* $NetBSD: externs1.h,v 1.91 2021/03/27 12:42:22 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -124,7 +124,7 @@
extern void message(int, ...);
extern void gnuism(int, ...);
extern void c99ism(int, ...);
-extern void lerror(const char *, int, const char *, ...)
+extern void internal_error(const char *, int, const char *, ...)
__attribute__((__noreturn__,__format__(__printf__, 3, 4)));
extern void assert_failed(const char *, int, const char *, const char *)
__attribute__((__noreturn__));
diff -r 5e8c335112a8 -r c8c9e5f544d6 usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Sat Mar 27 12:32:19 2021 +0000
+++ b/usr.bin/xlint/lint1/lex.c Sat Mar 27 12:42:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.19 2021/03/27 12:32:19 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.20 2021/03/27 12:42:22 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.19 2021/03/27 12:32:19 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.20 2021/03/27 12:42:22 rillig Exp $");
#endif
#include <ctype.h>
@@ -785,7 +785,7 @@
errno = 0;
break;
default:
- LERROR("fcon(%s->%s)", cp, eptr);
+ INTERNAL_ERROR("fcon(%s->%s)", cp, eptr);
}
}
if (errno != 0)
@@ -1416,7 +1416,7 @@
if (sym != NULL) {
if (sym->s_kind != symtyp)
- LERROR("getsym(%d, %d)", sym->s_kind, symtyp);
+ INTERNAL_ERROR("getsym(%d, %d)", sym->s_kind, symtyp);
symtyp = FVFT;
freesb(sb);
return sym;
diff -r 5e8c335112a8 -r c8c9e5f544d6 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h Sat Mar 27 12:32:19 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h Sat Mar 27 12:42:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.89 2021/03/26 19:17:58 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.90 2021/03/27 12:42:22 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -442,7 +442,8 @@
(((p)->errs_bits[(n)/__NERRBITS] & (1 << ((n) % __NERRBITS))) != 0)
#define ERR_ZERO(p) (void)memset((p), 0, sizeof(*(p)))
-#define LERROR(fmt, args...) lerror(__FILE__, __LINE__, fmt, ##args)
+#define INTERNAL_ERROR(fmt, args...) \
+ internal_error(__FILE__, __LINE__, fmt, ##args)
#define lint_assert(cond) \
do { \
Home |
Main Index |
Thread Index |
Old Index