summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-12-12 23:20:16 +0000
committermarkm <markm@FreeBSD.org>2001-12-12 23:20:16 +0000
commitf7397edc4d0bd6a7fd6a0977b4b633014803df01 (patch)
tree5d25a0ea177cc25b4ce3bcdb0f8afa644442699e /usr.bin/sed
parente006d8bee036793ac728aedff3bf9301a15d581b (diff)
downloadFreeBSD-src-f7397edc4d0bd6a7fd6a0977b4b633014803df01.zip
FreeBSD-src-f7397edc4d0bd6a7fd6a0977b4b633014803df01.tar.gz
WARNS=2 partial fix; use NO_WERROR to protect against some hard-to-fix warnings.
Use __FBSDID(), kill register keyword.
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/Makefile4
-rw-r--r--usr.bin/sed/compile.c36
-rw-r--r--usr.bin/sed/extern.h2
-rw-r--r--usr.bin/sed/main.c13
-rw-r--r--usr.bin/sed/misc.c9
-rw-r--r--usr.bin/sed/process.c21
6 files changed, 42 insertions, 43 deletions
diff --git a/usr.bin/sed/Makefile b/usr.bin/sed/Makefile
index d6b13a2..8dc1e0c 100644
--- a/usr.bin/sed/Makefile
+++ b/usr.bin/sed/Makefile
@@ -1,7 +1,9 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
+# $FreeBSD$
PROG= sed
-CFLAGS+=-Wall
SRCS= compile.c main.c misc.c process.c
+NO_WERROR=yes
+
.include <bsd.prog.mk>
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c
index af281ae..f88e2b4 100644
--- a/usr.bin/sed/compile.c
+++ b/usr.bin/sed/compile.c
@@ -35,13 +35,12 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#ifndef lint
-#if 0
-static char sccsid[] = "@(#)compile.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)compile.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
#include <sys/types.h>
#include <sys/stat.h>
@@ -77,7 +76,7 @@ static char *compile_text __P((void));
static char *compile_tr __P((char *, char **));
static struct s_command
**compile_stream __P((struct s_command **));
-static char *duptoeol __P((char *, char *));
+static char *duptoeol __P((char *, const char *));
static void enterlabel __P((struct s_command *));
static struct s_command
*findlabel __P((char *));
@@ -157,7 +156,7 @@ static struct s_command **
compile_stream(link)
struct s_command **link;
{
- register char *p;
+ char *p;
static char lbuf[_POSIX2_LINE_MAX + 1]; /* To save stack */
struct s_command *cmd, *cmd2, *stack;
struct s_format *fp;
@@ -465,7 +464,8 @@ compile_subst(p, s)
struct s_subst *s;
{
static char lbuf[_POSIX2_LINE_MAX + 1];
- int asize, ref, size;
+ int asize, size;
+ u_char ref;
char c, *text, *op, *sp;
int more = 0;
@@ -722,8 +722,8 @@ compile_addr(p, a)
*/
static char *
duptoeol(s, ctype)
- register char *s;
- char *ctype;
+ char *s;
+ const char *ctype;
{
size_t len;
int ws;
@@ -784,9 +784,9 @@ static void
enterlabel(cp)
struct s_command *cp;
{
- register struct labhash **lhp, *lh;
- register u_char *p;
- register u_int h, c;
+ struct labhash **lhp, *lh;
+ u_char *p;
+ u_int h, c;
for (h = 0, p = (u_char *)cp->t; (c = *p) != 0; p++)
h = (h << 5) + h + c;
@@ -811,9 +811,9 @@ static struct s_command *
findlabel(name)
char *name;
{
- register struct labhash *lh;
- register u_char *p;
- register u_int h, c;
+ struct labhash *lh;
+ u_char *p;
+ u_int h, c;
for (h = 0, p = (u_char *)name; (c = *p) != 0; p++)
h = (h << 5) + h + c;
@@ -833,8 +833,8 @@ findlabel(name)
static void
uselabel()
{
- register struct labhash *lh, *next;
- register int i;
+ struct labhash *lh, *next;
+ int i;
for (i = 0; i < LHSZ; i++) {
for (lh = labels[i]; lh != NULL; lh = next) {
diff --git a/usr.bin/sed/extern.h b/usr.bin/sed/extern.h
index 0a88e97..0d13631 100644
--- a/usr.bin/sed/extern.h
+++ b/usr.bin/sed/extern.h
@@ -46,7 +46,7 @@ extern u_long linenum;
extern int appendnum;
extern int lastline;
extern int aflag, eflag, nflag;
-extern char *fname;
+extern const char *fname;
extern int rflags; /* regex flags to use */
void cfclose __P((struct s_command *, struct s_command *));
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 2811ca6..5ba910c 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -35,19 +35,18 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
-#endif /* not lint */
+#endif
#ifndef lint
-#if 0
-static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94";
+static const char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94";
#endif
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
#include <sys/types.h>
@@ -101,7 +100,7 @@ int rflags = 0;
* Current file and line number; line numbers restart across compilation
* units, but span across input files.
*/
-char *fname; /* File name. */
+const char *fname; /* File name. */
u_long linenum;
int lastline; /* TRUE on the last line of the last file */
diff --git a/usr.bin/sed/misc.c b/usr.bin/sed/misc.c
index d5ad374..dbe7b5d 100644
--- a/usr.bin/sed/misc.c
+++ b/usr.bin/sed/misc.c
@@ -35,13 +35,12 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#ifndef lint
-#if 0
-static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93";
+static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index baad0f1..dd8646f 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -35,13 +35,12 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#ifndef lint
-#if 0
-static char sccsid[] = "@(#)process.c 8.6 (Berkeley) 4/20/94";
+static const char sccsid[] = "@(#)process.c 8.6 (Berkeley) 4/20/94";
#endif
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
#include <sys/types.h>
#include <sys/stat.h>
@@ -459,10 +458,10 @@ flush_appends()
static void
lputs(s)
- register char *s;
+ char *s;
{
- register int count;
- register char *escapes, *p;
+ int count;
+ char *escapes, *p;
struct winsize win;
static int termwidth = -1;
@@ -544,8 +543,8 @@ regsub(sp, string, src)
SPACE *sp;
char *string, *src;
{
- register int len, no;
- register char c, *dst;
+ int len, no;
+ char c, *dst;
#define NEEDSP(reqlen) \
if (sp->len >= sp->blen - (reqlen) - 1) { \
@@ -618,7 +617,7 @@ cspace(sp, p, len, spflag)
*/
void
cfclose(cp, end)
- register struct s_command *cp, *end;
+ struct s_command *cp, *end;
{
for (; cp != end; cp = cp->next)
OpenPOWER on IntegriCloud