Module Name: src Committed By: rillig Date: Sat Feb 18 15:14:12 UTC 2023
Modified Files: src/usr.bin/xlint/common: tyname.c src/usr.bin/xlint/lint1: lint1.h Log Message: lint: replace INTERNAL_ERROR with plain assert To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/usr.bin/xlint/common/tyname.c cvs rdiff -u -r1.161 -r1.162 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/common/tyname.c diff -u src/usr.bin/xlint/common/tyname.c:1.53 src/usr.bin/xlint/common/tyname.c:1.54 --- src/usr.bin/xlint/common/tyname.c:1.53 Sun Jul 3 14:35:54 2022 +++ src/usr.bin/xlint/common/tyname.c Sat Feb 18 15:14:11 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: tyname.c,v 1.53 2022/07/03 14:35:54 rillig Exp $ */ +/* $NetBSD: tyname.c,v 1.54 2023/02/18 15:14:11 rillig Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -35,13 +35,13 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: tyname.c,v 1.53 2022/07/03 14:35:54 rillig Exp $"); +__RCSID("$NetBSD: tyname.c,v 1.54 2023/02/18 15:14:11 rillig Exp $"); #endif +#include <assert.h> #include <limits.h> #include <string.h> #include <stdlib.h> -#include <err.h> #if defined(IS_LINT1) #include "lint1.h" @@ -49,14 +49,6 @@ __RCSID("$NetBSD: tyname.c,v 1.53 2022/0 #include "lint2.h" #endif -#ifndef INTERNAL_ERROR -#define INTERNAL_ERROR(fmt, args...) \ - do { \ - (void)warnx("%s, %d: " fmt, __FILE__, __LINE__, ##args); \ - abort(); \ - } while (false) -#endif - /* A tree of strings. */ typedef struct name_tree_node { const char *ntn_name; @@ -151,8 +143,7 @@ const char * tspec_name(tspec_t t) { const char *name = ttab[t].tt_name; - if (name == NULL) - INTERNAL_ERROR("tspec_name(%d)", t); + assert(name != NULL); return name; } Index: src/usr.bin/xlint/lint1/lint1.h diff -u src/usr.bin/xlint/lint1/lint1.h:1.161 src/usr.bin/xlint/lint1/lint1.h:1.162 --- src/usr.bin/xlint/lint1/lint1.h:1.161 Sat Jan 21 13:07:22 2023 +++ src/usr.bin/xlint/lint1/lint1.h Sat Feb 18 15:14:11 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: lint1.h,v 1.161 2023/01/21 13:07:22 rillig Exp $ */ +/* $NetBSD: lint1.h,v 1.162 2023/02/18 15:14:11 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -458,9 +458,6 @@ typedef struct { #include "externs1.h" -#define INTERNAL_ERROR(fmt, args...) \ - internal_error(__FILE__, __LINE__, fmt, ##args) - #define lint_assert(cond) \ do { \ if (!(cond)) \