From 1bc83d3616958ddedb74f3f13e5eb5701f24b2db Mon Sep 17 00:00:00 2001 From: Kiyoshi Aman Date: Thu, 20 Jun 2019 01:37:37 -0500 Subject: usr.bin/tr: make buildable --- usr.bin/tr/str.c | 11 ++--------- usr.bin/tr/tr.c | 15 +-------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/usr.bin/tr/str.c b/usr.bin/tr/str.c index a9dccde..e1e1768 100644 --- a/usr.bin/tr/str.c +++ b/usr.bin/tr/str.c @@ -29,14 +29,6 @@ * SUCH DAMAGE. */ -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)str.c 8.2 (Berkeley) 4/28/95"; -#endif -__RCSID("$NetBSD: str.c,v 1.30 2018/05/26 11:20:30 leot Exp $"); -#endif /* not lint */ - #include #include @@ -229,6 +221,7 @@ static const CLASS classes[] = { { "upper", isupper }, { "xdigit", isxdigit }, }; +const int classes_len = 12; typedef struct { const char *name; @@ -247,7 +240,7 @@ genclass(const char *class, size_t len) /* Find the class */ key.name = class; key.len = len; - cp = bsearch(&key, classes, __arraycount(classes), sizeof(classes[0]), + cp = bsearch(&key, classes, classes_len, sizeof(classes[0]), c_class); if (cp == NULL) { errx(1, "unknown class %.*s", (int)len, class); diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c index 8221880..cd6f716 100644 --- a/usr.bin/tr/tr.c +++ b/usr.bin/tr/tr.c @@ -29,19 +29,6 @@ * SUCH DAMAGE. */ -#include -#ifndef lint -__COPYRIGHT("@(#) Copyright (c) 1988, 1993\ - The Regents of the University of California. All rights reserved."); -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)tr.c 8.2 (Berkeley) 5/4/95"; -#endif -__RCSID("$NetBSD: tr.c,v 1.20 2013/08/11 01:54:35 dholland Exp $"); -#endif /* not lint */ - #include #include @@ -55,7 +42,7 @@ __RCSID("$NetBSD: tr.c,v 1.20 2013/08/11 01:54:35 dholland Exp $"); static int string1[NCHARS], string2[NCHARS]; static void setup(int *, const char *, int, int); -__dead static void usage(void); +static void usage(void); int main(int argc, char **argv) -- cgit v1.2.3-70-g09d2