Module Name: src
Committed By: lukem
Date: Mon Apr 13 23:50:49 UTC 2009
Modified Files:
src/usr.bin/tr: str.c
Log Message:
Fix WARNS=4 (-Wcast-qual -Wextra)
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/tr/str.c
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/tr/str.c
diff -u src/usr.bin/tr/str.c:1.11 src/usr.bin/tr/str.c:1.12
--- src/usr.bin/tr/str.c:1.11 Wed Jan 17 00:21:44 2007
+++ src/usr.bin/tr/str.c Mon Apr 13 23:50:49 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: str.c,v 1.11 2007/01/17 00:21:44 hubertf Exp $ */
+/* $NetBSD: str.c,v 1.12 2009/04/13 23:50:49 lukem Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)str.c 8.2 (Berkeley) 4/28/95";
#endif
-__RCSID("$NetBSD: str.c,v 1.11 2007/01/17 00:21:44 hubertf Exp $");
+__RCSID("$NetBSD: str.c,v 1.12 2009/04/13 23:50:49 lukem Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -148,24 +148,24 @@
}
typedef struct {
- char *name;
+ const char *name;
int (*func) __P((int));
int *set;
} CLASS;
static CLASS classes[] = {
- { "alnum", isalnum, },
- { "alpha", isalpha, },
- { "blank", isblank, },
- { "cntrl", iscntrl, },
- { "digit", isdigit, },
- { "graph", isgraph, },
- { "lower", islower, },
- { "print", isprint, },
- { "punct", ispunct, },
- { "space", isspace, },
- { "upper", isupper, },
- { "xdigit", isxdigit, },
+ { "alnum", isalnum, NULL, },
+ { "alpha", isalpha, NULL, },
+ { "blank", isblank, NULL, },
+ { "cntrl", iscntrl, NULL, },
+ { "digit", isdigit, NULL, },
+ { "graph", isgraph, NULL, },
+ { "lower", islower, NULL, },
+ { "print", isprint, NULL, },
+ { "punct", ispunct, NULL, },
+ { "space", isspace, NULL, },
+ { "upper", isupper, NULL, },
+ { "xdigit", isxdigit, NULL, },
};
static void
@@ -198,7 +198,7 @@
c_class(a, b)
const void *a, *b;
{
- return (strcmp(((CLASS *)a)->name, ((CLASS *)b)->name));
+ return (strcmp(((const CLASS *)a)->name, ((const CLASS *)b)->name));
}
/*