summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-06-20 01:37:37 -0500
committerKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-06-20 01:37:37 -0500
commit1bc83d3616958ddedb74f3f13e5eb5701f24b2db (patch)
tree11f8a7e2f0753c5973848cfd31a4c9a0bfcb57ae
parent997791acc672b0f69fed8953d310d538b86e0e33 (diff)
downloaduserland-1bc83d3616958ddedb74f3f13e5eb5701f24b2db.tar.gz
userland-1bc83d3616958ddedb74f3f13e5eb5701f24b2db.tar.bz2
userland-1bc83d3616958ddedb74f3f13e5eb5701f24b2db.tar.xz
userland-1bc83d3616958ddedb74f3f13e5eb5701f24b2db.zip
usr.bin/tr: make buildable
-rw-r--r--usr.bin/tr/str.c11
-rw-r--r--usr.bin/tr/tr.c15
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 <sys/cdefs.h>
-#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 <sys/types.h>
#include <err.h>
@@ -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 <sys/cdefs.h>
-#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 <sys/types.h>
#include <err.h>
@@ -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)