WARNS=2 fixes, use __FBSDID(), kill register keyword.

This commit is contained in:
Mark Murray 2001-12-11 23:36:25 +00:00
parent 1be5d70444
commit 787324755c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87705
2 changed files with 37 additions and 35 deletions

View File

@ -31,13 +31,13 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
#if 0
static char sccsid[] = "@(#)str.c 8.2 (Berkeley) 4/28/95";
static const char sccsid[] = "@(#)str.c 8.2 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/cdefs.h>
#include <sys/types.h>
@ -61,9 +61,9 @@ static void genseq __P((STR *));
int
next(s)
register STR *s;
STR *s;
{
register int ch;
int ch;
switch (s->state) {
case EOS:
@ -111,15 +111,17 @@ next(s)
return (next(s));
}
return (1);
default:
return (0);
}
/* NOTREACHED */
}
static int
bracket(s)
register STR *s;
STR *s;
{
register char *p;
char *p;
switch (s->str[1]) {
case ':': /* "[:class:]" */
@ -149,43 +151,43 @@ bracket(s)
}
typedef struct {
char *name;
const char *name;
int (*func) __P((int));
int *set;
} CLASS;
static CLASS classes[] = {
#undef isalnum
{ "alnum", isalnum, },
{ "alnum", isalnum, NULL },
#undef isalpha
{ "alpha", isalpha, },
{ "alpha", isalpha, NULL },
#undef isblank
{ "blank", isblank, },
{ "blank", isblank, NULL },
#undef iscntrl
{ "cntrl", iscntrl, },
{ "cntrl", iscntrl, NULL },
#undef isdigit
{ "digit", isdigit, },
{ "digit", isdigit, NULL },
#undef isgraph
{ "graph", isgraph, },
{ "graph", isgraph, NULL },
#undef islower
{ "lower", islower, },
{ "lower", islower, NULL },
#undef isprint
{ "print", isprint, },
{ "print", isprint, NULL },
#undef ispunct
{ "punct", ispunct, },
{ "punct", ispunct, NULL },
#undef isspace
{ "space", isspace, },
{ "space", isspace, NULL },
#undef isupper
{ "upper", isupper, },
{ "upper", isupper, NULL },
#undef isxdigit
{ "xdigit", isxdigit, },
{ "xdigit", isxdigit, NULL },
};
static void
genclass(s)
STR *s;
{
register int cnt, (*func) __P((int));
int cnt, (*func) __P((int));
CLASS *cp, tmp;
int *p;
@ -211,7 +213,7 @@ static int
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));
}
/*
@ -301,9 +303,9 @@ genseq(s)
*/
static int
backslash(s)
register STR *s;
STR *s;
{
register int ch, cnt, val;
int ch, cnt, val;
for (cnt = val = 0;;) {
ch = (u_char)*++s->str;

View File

@ -31,24 +31,24 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#endif
#ifndef lint
#if 0
static char sccsid[] = "@(#)tr.c 8.2 (Berkeley) 5/4/95";
static const char sccsid[] = "@(#)tr.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <locale.h>
#include <sys/types.h>
#include <err.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -102,7 +102,7 @@ main(argc, argv)
int argc;
char **argv;
{
register int ch, cnt, lastch, *p;
int ch, cnt, lastch, *p;
int cflag, dflag, sflag, isstring2;
(void) setlocale(LC_CTYPE, "");
@ -250,7 +250,7 @@ setup(string, arg, str, cflag)
STR *str;
int cflag;
{
register int cnt, *p;
int cnt, *p;
str->str = arg;
bzero(string, NCHARS * sizeof(int));