Module Name: src
Committed By: dholland
Date: Sun Aug 11 01:00:13 UTC 2013
Modified Files:
src/usr.bin/tr: Makefile str.c
Log Message:
Pass -Wpointer-sign.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/tr/Makefile
cvs rdiff -u -r1.24 -r1.25 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/Makefile
diff -u src/usr.bin/tr/Makefile:1.8 src/usr.bin/tr/Makefile:1.9
--- src/usr.bin/tr/Makefile:1.8 Fri Aug 10 12:10:28 2012
+++ src/usr.bin/tr/Makefile Sun Aug 11 01:00:13 2013
@@ -1,11 +1,7 @@
-# $NetBSD: Makefile,v 1.8 2012/08/10 12:10:28 joerg Exp $
+# $NetBSD: Makefile,v 1.9 2013/08/11 01:00:13 dholland Exp $
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= tr
SRCS= str.c tr.c
-.for f in str tr
-COPTS.${f}.c+= -Wno-pointer-sign
-.endfor
-
.include <bsd.prog.mk>
Index: src/usr.bin/tr/str.c
diff -u src/usr.bin/tr/str.c:1.24 src/usr.bin/tr/str.c:1.25
--- src/usr.bin/tr/str.c:1.24 Sun Aug 11 00:52:17 2013
+++ src/usr.bin/tr/str.c Sun Aug 11 01:00:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: str.c,v 1.24 2013/08/11 00:52:17 dholland Exp $ */
+/* $NetBSD: str.c,v 1.25 2013/08/11 01:00:13 dholland 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.24 2013/08/11 00:52:17 dholland Exp $");
+__RCSID("$NetBSD: str.c,v 1.25 2013/08/11 01:00:13 dholland Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -57,7 +57,7 @@ struct str {
int lastch; /* last character */
int equiv[2]; /* equivalence set */
int *set; /* set of characters */
- unsigned const char *str; /* user's string */
+ const char *str; /* user's string */
};
static int backslash(STR *);
@@ -112,7 +112,7 @@ next(STR *s, int *ret)
*ret = s->lastch;
return 1;
case NORMAL:
- switch (ch = *s->str) {
+ switch (ch = (unsigned char)*s->str) {
case '\0':
s->state = EOS;
*ret = s->lastch;
@@ -261,7 +261,7 @@ genequiv(STR *s)
if (*s->str != '=')
errx(1, "misplaced equivalence equals sign");
} else {
- s->equiv[0] = s->str[0];
+ s->equiv[0] = (unsigned char)s->str[0];
if (s->str[1] != '=')
errx(1, "misplaced equivalence equals sign");
}
@@ -278,7 +278,7 @@ genrange(STR *s)
const char *savestart;
savestart = s->str++;
- stopval = *s->str == '\\' ? backslash(s) : *s->str++;
+ stopval = *s->str == '\\' ? backslash(s) : (unsigned char)*s->str++;
if (stopval < (u_char)s->lastch) {
s->str = savestart;
return 0;
@@ -300,7 +300,7 @@ genseq(STR *s)
if (*s->str == '\\')
s->lastch = backslash(s);
else
- s->lastch = *s->str++;
+ s->lastch = (unsigned char)*s->str++;
if (*s->str != '*')
errx(1, "misplaced sequence asterisk");
@@ -313,7 +313,7 @@ genseq(STR *s)
++s->str;
break;
default:
- if (isdigit(*s->str)) {
+ if (isdigit((unsigned char)*s->str)) {
s->cnt = strtol(s->str, &ep, 0);
if (*ep == ']') {
s->str = ep + 1;
@@ -337,7 +337,7 @@ backslash(STR *s)
int ch, cnt, val;
for (cnt = val = 0;;) {
- ch = *++s->str;
+ ch = (unsigned char)*++s->str;
if (!isascii(ch) || !isdigit(ch))
break;
val = val * 8 + ch - '0';