sprinkle a little const, and now everything compiles with WARNS=3
This commit is contained in:
parent
a397ec1f77
commit
6310b59691
|
@ -1,9 +1,9 @@
|
|||
# $NetBSD: Makefile.inc,v 1.14 2002/09/27 21:04:46 thorpej Exp $
|
||||
# $NetBSD: Makefile.inc,v 1.15 2005/06/26 19:10:48 christos Exp $
|
||||
# @(#)Makefile.inc 8.1 (Berkeley) 5/31/93
|
||||
|
||||
.include <bsd.own.mk> # for MKDYNAMICROOT definition
|
||||
|
||||
WARNS?= 2
|
||||
WARNS?= 3
|
||||
BINDIR?= /bin
|
||||
|
||||
.if (${MKDYNAMICROOT} == "no")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cp.c,v 1.35 2003/09/14 19:20:18 jschauma Exp $ */
|
||||
/* $NetBSD: cp.c,v 1.36 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1993, 1994
|
||||
|
@ -43,7 +43,7 @@ __COPYRIGHT(
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: cp.c,v 1.35 2003/09/14 19:20:18 jschauma Exp $");
|
||||
__RCSID("$NetBSD: cp.c,v 1.36 2005/06/26 19:10:48 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -81,7 +81,8 @@ __RCSID("$NetBSD: cp.c,v 1.35 2003/09/14 19:20:18 jschauma Exp $");
|
|||
*--(p).p_end = '\0'; \
|
||||
}
|
||||
|
||||
PATH_T to = { to.p_path, "" };
|
||||
static char empty[] = "";
|
||||
PATH_T to = { to.p_path, empty };
|
||||
|
||||
uid_t myuid;
|
||||
int Rflag, fflag, iflag, pflag, rflag, vflag;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: extern.h,v 1.9 2003/09/14 19:20:18 jschauma Exp $ */
|
||||
/* $NetBSD: extern.h,v 1.10 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
|
@ -36,7 +36,7 @@
|
|||
|
||||
typedef struct {
|
||||
char *p_end; /* pointer to NULL at end of path */
|
||||
char *target_end; /* pointer to end of target base */
|
||||
char *target_end; /* pointer to end of target base */
|
||||
char p_path[MAXPATHLEN + 1]; /* pointer to the start of a path */
|
||||
} PATH_T;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: csh.c,v 1.35 2004/08/19 22:31:38 christos Exp $ */
|
||||
/* $NetBSD: csh.c,v 1.36 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
|
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1991, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)csh.c 8.2 (Berkeley) 10/12/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: csh.c,v 1.35 2004/08/19 22:31:38 christos Exp $");
|
||||
__RCSID("$NetBSD: csh.c,v 1.36 2005/06/26 19:10:48 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -98,7 +98,7 @@ static fpos_t seekf(void *, fpos_t, int);
|
|||
static int writef(void *, const char *, int);
|
||||
static int closef(void *);
|
||||
static int srccat(Char *, Char *);
|
||||
static int srcfile(char *, bool, bool);
|
||||
static int srcfile(const char *, bool, bool);
|
||||
static void phup(int);
|
||||
static void srcunit(int, bool, bool);
|
||||
static void mailchk(void);
|
||||
|
@ -645,7 +645,7 @@ srccat(Char *cp, Char *dp)
|
|||
* Source to a file putting the file descriptor in a safe place (> 2).
|
||||
*/
|
||||
static int
|
||||
srcfile(char *f, bool onlyown, bool flag)
|
||||
srcfile(const char *f, bool onlyown, bool flag)
|
||||
{
|
||||
int unit;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: csh.h,v 1.15 2003/08/07 09:05:04 agc Exp $ */
|
||||
/* $NetBSD: csh.h,v 1.16 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
|
@ -357,7 +357,7 @@ struct command {
|
|||
*/
|
||||
|
||||
extern struct biltins {
|
||||
char *bname;
|
||||
const char *bname;
|
||||
void (*bfunct)(Char **, struct command *);
|
||||
short minargs, maxargs;
|
||||
} bfunc[];
|
||||
|
@ -366,7 +366,7 @@ extern int nbfunc;
|
|||
extern int nsrchn;
|
||||
|
||||
extern struct srch {
|
||||
char *s_name;
|
||||
const char *s_name;
|
||||
short s_value;
|
||||
} srchn[];
|
||||
|
||||
|
@ -523,7 +523,7 @@ Char HISTSUB; /* auto-substitute character */
|
|||
/*
|
||||
* setname is a macro to save space (see sh.err.c)
|
||||
*/
|
||||
char *bname;
|
||||
const char *bname;
|
||||
|
||||
#define setname(a) (bname = (a))
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dir.c,v 1.23 2004/05/10 19:11:31 christos Exp $ */
|
||||
/* $NetBSD: dir.c,v 1.24 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
|
@ -34,7 +34,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)dir.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: dir.c,v 1.23 2004/05/10 19:11:31 christos Exp $");
|
||||
__RCSID("$NetBSD: dir.c,v 1.24 2005/06/26 19:10:48 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -57,7 +57,7 @@ static struct directory *dfind(Char *);
|
|||
static Char *dfollow(Char *);
|
||||
static void printdirs(void);
|
||||
static Char *dgoto(Char *);
|
||||
static void skipargs(Char ***, char *);
|
||||
static void skipargs(Char ***, const char *);
|
||||
static void dnewcwd(struct directory *);
|
||||
static void dset(Char *);
|
||||
|
||||
|
@ -157,7 +157,7 @@ dset(Char *dp)
|
|||
#define DIR_LINE 4
|
||||
|
||||
static void
|
||||
skipargs(Char ***v, char *str)
|
||||
skipargs(Char ***v, const char *str)
|
||||
{
|
||||
Char **n, *s;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: extern.h,v 1.16 2005/02/17 16:07:53 xtraeme Exp $ */
|
||||
/* $NetBSD: extern.h,v 1.17 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
|
@ -193,7 +193,7 @@ void unreadc(int);
|
|||
/*
|
||||
* misc.c
|
||||
*/
|
||||
int any(char *, int);
|
||||
int any(const char *, int);
|
||||
Char **blkcat(Char **, Char **);
|
||||
Char **blkcpy(Char **, Char **);
|
||||
Char **blkend(Char **);
|
||||
|
@ -213,7 +213,7 @@ int prefix(Char *, Char *);
|
|||
Char **saveblk(Char **);
|
||||
Char *strip(Char *);
|
||||
Char *quote(Char *);
|
||||
char *strsave(char *);
|
||||
char *strsave(const char *);
|
||||
char *strspl(char *, char *);
|
||||
void udvar(Char *) __attribute__((noreturn));
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: func.c,v 1.29 2004/05/13 15:25:58 christos Exp $ */
|
||||
/* $NetBSD: func.c,v 1.30 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
|
@ -34,7 +34,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)func.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: func.c,v 1.29 2004/05/13 15:25:58 christos Exp $");
|
||||
__RCSID("$NetBSD: func.c,v 1.30 2005/06/26 19:10:48 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -1110,7 +1110,7 @@ static const struct limits {
|
|||
|
||||
static const struct limits *findlim(Char *);
|
||||
static RLIM_TYPE getval(const struct limits *, Char **);
|
||||
static void limtail(Char *, char *);
|
||||
static void limtail(Char *, const char *);
|
||||
static void plim(const struct limits *, Char);
|
||||
static int setlim(const struct limits *, Char, RLIM_TYPE);
|
||||
|
||||
|
@ -1232,7 +1232,7 @@ getval(const struct limits *lp, Char **v)
|
|||
}
|
||||
|
||||
static void
|
||||
limtail(Char *cp, char *str)
|
||||
limtail(Char *cp, const char *str)
|
||||
{
|
||||
while (*cp && *cp == *str)
|
||||
cp++, str++;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: misc.c,v 1.16 2004/01/06 00:20:16 christos Exp $ */
|
||||
/* $NetBSD: misc.c,v 1.17 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
|
@ -34,7 +34,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: misc.c,v 1.16 2004/01/06 00:20:16 christos Exp $");
|
||||
__RCSID("$NetBSD: misc.c,v 1.17 2005/06/26 19:10:48 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -52,7 +52,7 @@ __RCSID("$NetBSD: misc.c,v 1.16 2004/01/06 00:20:16 christos Exp $");
|
|||
static int renum(int, int);
|
||||
|
||||
int
|
||||
any(char *s, int c)
|
||||
any(const char *s, int c)
|
||||
{
|
||||
if (!s)
|
||||
return (0); /* Check for nil pointer */
|
||||
|
@ -63,18 +63,19 @@ any(char *s, int c)
|
|||
}
|
||||
|
||||
char *
|
||||
strsave(char *s)
|
||||
strsave(const char *s)
|
||||
{
|
||||
char *n, *p;
|
||||
const char *n;
|
||||
char *p, *r;
|
||||
|
||||
if (s == NULL)
|
||||
s = "";
|
||||
for (p = s; *p++;)
|
||||
for (n = s; *n++;)
|
||||
continue;
|
||||
n = p = (char *)xmalloc((size_t)((p - s) * sizeof(char)));
|
||||
r = p = (char *)xmalloc((size_t)((n - s) * sizeof(char)));
|
||||
while ((*p++ = *s++) != '\0')
|
||||
continue;
|
||||
return (n);
|
||||
return (r);
|
||||
}
|
||||
|
||||
Char **
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: proc.c,v 1.28 2003/09/19 05:31:11 itojun Exp $ */
|
||||
/* $NetBSD: proc.c,v 1.29 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
|
@ -34,7 +34,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: proc.c,v 1.28 2003/09/19 05:31:11 itojun Exp $");
|
||||
__RCSID("$NetBSD: proc.c,v 1.29 2005/06/26 19:10:48 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -640,7 +640,7 @@ pprint(struct process *pp, bool flag)
|
|||
{
|
||||
static struct rusage zru;
|
||||
struct process *tp;
|
||||
char *format;
|
||||
const char *format;
|
||||
int jobflags, pstatus, reason, status;
|
||||
bool hadnl;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: time.c,v 1.14 2003/08/07 09:05:07 agc Exp $ */
|
||||
/* $NetBSD: time.c,v 1.15 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
|
@ -34,7 +34,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: time.c,v 1.14 2003/08/07 09:05:07 agc Exp $");
|
||||
__RCSID("$NetBSD: time.c,v 1.15 2005/06/26 19:10:48 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -128,7 +128,7 @@ prusage(struct rusage *r0, struct rusage *r1, struct timeval *e,
|
|||
struct timeval *b)
|
||||
{
|
||||
struct varent *vp;
|
||||
char *cp;
|
||||
const char *cp;
|
||||
long i;
|
||||
time_t t;
|
||||
int ms;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: date.c,v 1.39 2005/05/15 18:39:39 dsl Exp $ */
|
||||
/* $NetBSD: date.c,v 1.40 2005/06/26 19:10:48 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, 1987, 1988, 1993
|
||||
|
@ -40,7 +40,7 @@ __COPYRIGHT(
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: date.c,v 1.39 2005/05/15 18:39:39 dsl Exp $");
|
||||
__RCSID("$NetBSD: date.c,v 1.40 2005/06/26 19:10:48 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -75,7 +75,8 @@ static void usage(void);
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char buf[1024], *format;
|
||||
char buf[1024];
|
||||
const char *format;
|
||||
int ch;
|
||||
|
||||
setprogname(argv[0]);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.10 2002/11/29 13:11:10 lukem Exp $
|
||||
# $NetBSD: Makefile,v 1.11 2005/06/26 19:10:49 christos Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
|
||||
PROG= dd
|
||||
|
@ -10,6 +10,4 @@ CPPFLAGS+= -DNO_CONV
|
|||
SRCS+= conv_tab.c
|
||||
.endif
|
||||
|
||||
WARNS=2
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
|
10
bin/df/df.c
10
bin/df/df.c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: df.c,v 1.67 2004/12/31 09:54:28 augustss Exp $ */
|
||||
/* $NetBSD: df.c,v 1.68 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1990, 1993, 1994
|
||||
|
@ -45,7 +45,7 @@ __COPYRIGHT(
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)df.c 8.7 (Berkeley) 4/2/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: df.c,v 1.67 2004/12/31 09:54:28 augustss Exp $");
|
||||
__RCSID("$NetBSD: df.c,v 1.68 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -72,7 +72,7 @@ int selected(const char *);
|
|||
void maketypelist(char *);
|
||||
long regetmntinfo(struct statvfs **, long);
|
||||
void usage(void);
|
||||
void prthumanval(int64_t, char *);
|
||||
void prthumanval(int64_t, const char *);
|
||||
void prthuman(struct statvfs *, int64_t, int64_t);
|
||||
const char *
|
||||
strpct64(uint64_t, uint64_t, u_int);
|
||||
|
@ -294,7 +294,7 @@ regetmntinfo(struct statvfs **mntbufp, long mntsize)
|
|||
}
|
||||
|
||||
void
|
||||
prthumanval(int64_t bytes, char *pad)
|
||||
prthumanval(int64_t bytes, const char *pad)
|
||||
{
|
||||
char buf[6];
|
||||
|
||||
|
@ -331,7 +331,7 @@ prtstat(struct statvfs *sfsp, int maxwidth)
|
|||
{
|
||||
static long blocksize;
|
||||
static int headerlen, timesthrough;
|
||||
static char *header;
|
||||
static const char *header;
|
||||
static const char full[] = "100%";
|
||||
static const char empty[] = " 0%";
|
||||
int64_t used, availblks, inodes;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: buf.c,v 1.24 2005/02/17 16:29:26 xtraeme Exp $ */
|
||||
/* $NetBSD: buf.c,v 1.25 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/* buf.c: This file contains the scratch-file buffer routines for the
|
||||
ed line editor. */
|
||||
|
@ -33,7 +33,7 @@
|
|||
#if 0
|
||||
static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: buf.c,v 1.24 2005/02/17 16:29:26 xtraeme Exp $");
|
||||
__RCSID("$NetBSD: buf.c,v 1.25 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -206,7 +206,7 @@ int
|
|||
open_sbuf(void)
|
||||
{
|
||||
int u, fd;
|
||||
char *tmp;
|
||||
const char *tmp;
|
||||
size_t s;
|
||||
|
||||
isbinary = newline_added = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cbc.c,v 1.17 2005/02/17 16:29:26 xtraeme Exp $ */
|
||||
/* $NetBSD: cbc.c,v 1.18 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/* cbc.c: This file contains the encryption routines for the ed line editor */
|
||||
/*-
|
||||
|
@ -72,7 +72,7 @@
|
|||
#if 0
|
||||
static char *rcsid = "@(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: cbc.c,v 1.17 2005/02/17 16:29:26 xtraeme Exp $");
|
||||
__RCSID("$NetBSD: cbc.c,v 1.18 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -244,7 +244,7 @@ get_keyword(void)
|
|||
* print a warning message and, possibly, terminate
|
||||
*/
|
||||
void
|
||||
des_error(char *s /* the message */)
|
||||
des_error(const char *s /* the message */)
|
||||
{
|
||||
(void)sprintf(errmsg, "%s", s ? s : strerror(errno));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ed.h,v 1.32 2005/02/17 16:29:26 xtraeme Exp $ */
|
||||
/* $NetBSD: ed.h,v 1.33 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/* ed.h: type and constant definitions for the ed editor. */
|
||||
/*
|
||||
|
@ -202,7 +202,7 @@ void clear_undo_stack(void);
|
|||
int close_sbuf(void);
|
||||
int copy_lines(long);
|
||||
int delete_lines(long, long);
|
||||
void des_error(char *);
|
||||
void des_error(const char *);
|
||||
int display_lines(long, long, int);
|
||||
line_t *dup_line_node(line_t *);
|
||||
int exec_command(void);
|
||||
|
@ -256,12 +256,12 @@ int set_active_node(line_t *);
|
|||
void set_des_key(char *);
|
||||
void signal_hup(int);
|
||||
void signal_int(int);
|
||||
char *strip_escapes(char *);
|
||||
char *strip_escapes(const char *);
|
||||
int substitute_matching_text(pattern_t *, line_t *, int, int);
|
||||
char *translit_text(char *, int, int, int);
|
||||
void unmark_line_node(line_t *);
|
||||
void unset_active_nodes(line_t *, line_t *);
|
||||
long write_file(char *, char *, long, long);
|
||||
long write_file(const char *, const char *, long, long);
|
||||
long write_stream(FILE *, long, long);
|
||||
|
||||
/* global buffers */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: glbl.c,v 1.5 2005/02/17 16:29:26 xtraeme Exp $ */
|
||||
/* $NetBSD: glbl.c,v 1.6 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/* glob.c: This file contains the global command routines for the ed line
|
||||
editor */
|
||||
|
@ -33,7 +33,7 @@
|
|||
#if 0
|
||||
static char *rcsid = "@(#)glob.c,v 1.1 1994/02/01 00:34:40 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: glbl.c,v 1.5 2005/02/17 16:29:26 xtraeme Exp $");
|
||||
__RCSID("$NetBSD: glbl.c,v 1.6 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -87,11 +87,12 @@ exec_global(int interact, int gflag)
|
|||
int status;
|
||||
int n;
|
||||
char *cmd = NULL;
|
||||
|
||||
#ifdef BACKWARDS
|
||||
char cmdp[] = "p\n";
|
||||
|
||||
if (!interact) {
|
||||
if (!strcmp(ibufp, "\n"))
|
||||
cmd = "p\n"; /* null cmd-list == `p' */
|
||||
cmd = cmdp; /* null cmd-list == `p' */
|
||||
else if ((cmd = get_extended_line(&n, 0)) == NULL)
|
||||
return ERR;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: io.c,v 1.7 2005/02/17 16:29:26 xtraeme Exp $ */
|
||||
/* $NetBSD: io.c,v 1.8 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/* io.c: This file contains the i/o routines for the ed line editor */
|
||||
/*-
|
||||
|
@ -32,7 +32,7 @@
|
|||
#if 0
|
||||
static char *rcsid = "@(#)io.c,v 1.1 1994/02/01 00:34:41 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: io.c,v 1.7 2005/02/17 16:29:26 xtraeme Exp $");
|
||||
__RCSID("$NetBSD: io.c,v 1.8 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -148,7 +148,7 @@ get_stream_line(FILE *fp)
|
|||
|
||||
/* write_file: write a range of lines to a named file/pipe; return line count */
|
||||
long
|
||||
write_file(char *fn, char *mode, long n, long m)
|
||||
write_file(const char *fn, const char *mode, long n, long m)
|
||||
{
|
||||
FILE *fp;
|
||||
long size;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: main.c,v 1.16 2005/05/23 08:01:17 rillig Exp $ */
|
||||
/* $NetBSD: main.c,v 1.17 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/* main.c: This file contains the main control and user-interface routines
|
||||
for the ed line editor. */
|
||||
|
@ -39,7 +39,7 @@ __COPYRIGHT(
|
|||
#if 0
|
||||
static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp";
|
||||
#else
|
||||
__RCSID("$NetBSD: main.c,v 1.16 2005/05/23 08:01:17 rillig Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.17 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -101,10 +101,10 @@ char old_filename[MAXPATHLEN + 1] = ""; /* default filename */
|
|||
long current_addr; /* current address in editor buffer */
|
||||
long addr_last; /* last address in editor buffer */
|
||||
int lineno; /* script line number */
|
||||
char *prompt; /* command-line prompt */
|
||||
char *dps = "*"; /* default command-line prompt */
|
||||
const char *prompt; /* command-line prompt */
|
||||
const char *dps = "*"; /* default command-line prompt */
|
||||
|
||||
char *usage = "usage: %s [-] [-sxE] [-p string] [name]\n";
|
||||
const char *usage = "usage: %s [-] [-sxE] [-p string] [name]\n";
|
||||
|
||||
/* ed: line editor */
|
||||
int
|
||||
|
@ -1318,7 +1318,7 @@ has_trailing_escape(char *s, char *t)
|
|||
|
||||
/* strip_escapes: return copy of escaped string of at most length MAXPATHLEN */
|
||||
char *
|
||||
strip_escapes(char *s)
|
||||
strip_escapes(const char *s)
|
||||
{
|
||||
static char *file = NULL;
|
||||
static int filesz = 0;
|
||||
|
|
11
bin/ln/ln.c
11
bin/ln/ln.c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ln.c,v 1.29 2004/06/25 14:25:33 wiz Exp $ */
|
||||
/* $NetBSD: ln.c,v 1.30 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1987, 1993, 1994
|
||||
|
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993, 1994\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: ln.c,v 1.29 2004/06/25 14:25:33 wiz Exp $");
|
||||
__RCSID("$NetBSD: ln.c,v 1.30 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -62,7 +62,7 @@ int vflag; /* Verbose output */
|
|||
int (*linkf)(const char *, const char *);
|
||||
char linkch;
|
||||
|
||||
int linkit(char *, char *, int);
|
||||
int linkit(const char *, const char *, int);
|
||||
void usage(void);
|
||||
int main(int, char *[]);
|
||||
|
||||
|
@ -142,10 +142,11 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
int
|
||||
linkit(char *target, char *source, int isdir)
|
||||
linkit(const char *target, const char *source, int isdir)
|
||||
{
|
||||
struct stat sb;
|
||||
char *p, path[MAXPATHLEN];
|
||||
const char *p;
|
||||
char path[MAXPATHLEN];
|
||||
|
||||
if (!sflag) {
|
||||
/* If target doesn't exist, quit now. */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.32 2005/05/01 02:59:28 christos Exp $
|
||||
# $NetBSD: Makefile,v 1.33 2005/06/26 19:10:49 christos Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
|
||||
# To install on versions prior to BSD 4.4 the following may have to be
|
||||
|
@ -27,7 +27,6 @@
|
|||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
WARNS=3
|
||||
PROG= pax
|
||||
SRCS= ar_io.c ar_subs.c buf_subs.c cpio.c file_subs.c ftree.c\
|
||||
gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c tables.c\
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: extern.h,v 1.27 2004/03/27 14:49:13 simonb Exp $ */
|
||||
/* $NetBSD: extern.h,v 1.28 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
|
@ -53,8 +53,8 @@ int donlist_sysctl(void);
|
|||
void fmt_puts(char *, int *);
|
||||
void fmt_putc(int, int *);
|
||||
void elapsed(void *, VARENT *, int);
|
||||
double getpcpu(struct kinfo_proc2 *);
|
||||
double getpmem(struct kinfo_proc2 *);
|
||||
double getpcpu(const struct kinfo_proc2 *);
|
||||
double getpmem(const struct kinfo_proc2 *);
|
||||
void gname(void *, VARENT *, int);
|
||||
void groups(void *, VARENT *, int);
|
||||
void groupnames(void *, VARENT *, int);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: keyword.c,v 1.43 2004/11/16 04:58:14 christos Exp $ */
|
||||
/* $NetBSD: keyword.c,v 1.44 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
|
@ -34,7 +34,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: keyword.c,v 1.43 2004/11/16 04:58:14 christos Exp $");
|
||||
__RCSID("$NetBSD: keyword.c,v 1.44 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -206,7 +206,8 @@ showkey(void)
|
|||
{
|
||||
VAR *v;
|
||||
int i;
|
||||
char *p, *sep;
|
||||
const char *p;
|
||||
const char *sep;
|
||||
|
||||
i = 0;
|
||||
sep = "";
|
||||
|
@ -298,5 +299,5 @@ findvar(const char *p)
|
|||
static int
|
||||
vcmp(const void *a, const void *b)
|
||||
{
|
||||
return strcmp(a, ((VAR *)b)->name);
|
||||
return strcmp(a, ((const VAR *)b)->name);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: print.c,v 1.92 2005/06/07 08:53:13 he Exp $ */
|
||||
/* $NetBSD: print.c,v 1.93 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -70,7 +70,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: print.c,v 1.92 2005/06/07 08:53:13 he Exp $");
|
||||
__RCSID("$NetBSD: print.c,v 1.93 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -1148,7 +1148,8 @@ printval(bp, v, mode)
|
|||
{
|
||||
static char ofmt[32] = "%";
|
||||
int width, vok, fmtlen;
|
||||
char *fcp, *cp;
|
||||
const char *fcp;
|
||||
char *cp;
|
||||
int64_t val;
|
||||
u_int64_t uval;
|
||||
|
||||
|
|
33
bin/ps/ps.c
33
bin/ps/ps.c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ps.c,v 1.58 2005/06/01 15:30:33 lukem Exp $ */
|
||||
/* $NetBSD: ps.c,v 1.59 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -75,7 +75,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993, 1994\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: ps.c,v 1.58 2005/06/01 15:30:33 lukem Exp $");
|
||||
__RCSID("$NetBSD: ps.c,v 1.59 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -260,7 +260,8 @@ main(int argc, char *argv[])
|
|||
ttname = optarg;
|
||||
tty: {
|
||||
struct stat sb;
|
||||
char *ttypath, pathbuf[MAXPATHLEN];
|
||||
const char *ttypath;
|
||||
char pathbuf[MAXPATHLEN];
|
||||
|
||||
flag = 0;
|
||||
ttypath = NULL;
|
||||
|
@ -271,13 +272,15 @@ main(int argc, char *argv[])
|
|||
else if (strcmp(ttname, "co") == 0)
|
||||
ttypath = _PATH_CONSOLE;
|
||||
else if (strncmp(ttname, "pts/", 4) == 0 ||
|
||||
strncmp(ttname, "tty", 3) == 0)
|
||||
(void)snprintf(ttypath = pathbuf,
|
||||
strncmp(ttname, "tty", 3) == 0) {
|
||||
(void)snprintf(pathbuf,
|
||||
sizeof(pathbuf), "%s%s", _PATH_DEV, ttname);
|
||||
else if (*ttname != '/')
|
||||
(void)snprintf(ttypath = pathbuf,
|
||||
ttypath = pathbuf;
|
||||
} else if (*ttname != '/') {
|
||||
(void)snprintf(pathbuf,
|
||||
sizeof(pathbuf), "%s%s", _PATH_TTY, ttname);
|
||||
else
|
||||
ttypath = pathbuf;
|
||||
} else
|
||||
ttypath = ttname;
|
||||
what = KERN_PROC_TTY;
|
||||
if (flag == 0) {
|
||||
|
@ -560,20 +563,20 @@ scanvars(void)
|
|||
static int
|
||||
pscomp(const void *a, const void *b)
|
||||
{
|
||||
struct kinfo_proc2 *ka = (struct kinfo_proc2 *)a;
|
||||
struct kinfo_proc2 *kb = (struct kinfo_proc2 *)b;
|
||||
const struct kinfo_proc2 *ka = (const struct kinfo_proc2 *)a;
|
||||
const struct kinfo_proc2 *kb = (const struct kinfo_proc2 *)b;
|
||||
|
||||
int i;
|
||||
int64_t i64;
|
||||
VAR *v;
|
||||
struct varent *ve;
|
||||
sigset_t *sa, *sb;
|
||||
const sigset_t *sa, *sb;
|
||||
|
||||
#define V_SIZE(k) (k->p_vm_dsize + k->p_vm_ssize + k->p_vm_tsize)
|
||||
#define RDIFF_N(t, n) \
|
||||
if (((t *)((char *)ka + v->off))[n] > ((t *)((char *)kb + v->off))[n]) \
|
||||
if (((const t *)((const char *)ka + v->off))[n] > ((const t *)((const char *)kb + v->off))[n]) \
|
||||
return 1; \
|
||||
if (((t *)((char *)ka + v->off))[n] < ((t *)((char *)kb + v->off))[n]) \
|
||||
if (((const t *)((const char *)ka + v->off))[n] < ((const t *)((const char *)kb + v->off))[n]) \
|
||||
return -1;
|
||||
|
||||
#define RDIFF(type) RDIFF_N(type, 0); continue
|
||||
|
@ -606,8 +609,8 @@ pscomp(const void *a, const void *b)
|
|||
case UINT32:
|
||||
RDIFF(uint32_t);
|
||||
case SIGLIST:
|
||||
sa = (void *)((char *)a + v->off);
|
||||
sb = (void *)((char *)b + v->off);
|
||||
sa = (const void *)((const char *)a + v->off);
|
||||
sb = (const void *)((const char *)b + v->off);
|
||||
i = 0;
|
||||
do {
|
||||
if (sa->__bits[i] > sb->__bits[i])
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ps.h,v 1.24 2004/03/27 14:52:36 simonb Exp $ */
|
||||
/* $NetBSD: ps.h,v 1.25 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
|
@ -50,8 +50,8 @@ typedef struct varent {
|
|||
} VARENT;
|
||||
|
||||
typedef struct var {
|
||||
char *name; /* name(s) of variable */
|
||||
char *header; /* default header */
|
||||
const char *name; /* name(s) of variable */
|
||||
const char *header; /* default header */
|
||||
#define COMM 0x01 /* needs exec arguments and environment (XXX) */
|
||||
#define ARGV0 0x02 /* only print argv[0] */
|
||||
#define LJUST 0x04 /* left adjust on output (trailing blanks) */
|
||||
|
@ -69,7 +69,7 @@ typedef struct var {
|
|||
*/
|
||||
int off; /* offset in structure */
|
||||
enum type type; /* type of element */
|
||||
char *fmt; /* printf format */
|
||||
const char *fmt; /* printf format */
|
||||
|
||||
/* current longest element */
|
||||
int width; /* printing width */
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
# $NetBSD: Makefile,v 1.9 2004/10/16 18:07:16 christos Exp $
|
||||
# $NetBSD: Makefile,v 1.10 2005/06/26 19:10:49 christos Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
WARNS=3
|
||||
# XXX Unsupported Kerberos options were removed from man page
|
||||
# XXX Don't forget to update the man page if you fix Kerberos
|
||||
PROG= rcmd
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rcp.c,v 1.39 2005/03/11 02:55:23 ginsbach Exp $ */
|
||||
/* $NetBSD: rcp.c,v 1.40 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1990, 1992, 1993
|
||||
|
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1990, 1992, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: rcp.c,v 1.39 2005/03/11 02:55:23 ginsbach Exp $");
|
||||
__RCSID("$NetBSD: rcp.c,v 1.40 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -94,6 +94,7 @@ uid_t userid;
|
|||
int errs, rem;
|
||||
int pflag, iamremote, iamrecursive, targetshouldbedirectory;
|
||||
int family = AF_UNSPEC;
|
||||
static char dot[] = ".";
|
||||
|
||||
#define CMDNEEDS 64
|
||||
char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
|
||||
|
@ -115,7 +116,8 @@ main(int argc, char *argv[])
|
|||
{
|
||||
struct servent *sp;
|
||||
int ch, fflag, tflag;
|
||||
char *targ, *shell;
|
||||
char *targ;
|
||||
const char *shell;
|
||||
|
||||
fflag = tflag = 0;
|
||||
while ((ch = getopt(argc, argv, OPTIONS)) != -1)
|
||||
|
@ -253,7 +255,7 @@ toremote(char *targ, int argc, char *argv[])
|
|||
|
||||
*targ++ = 0;
|
||||
if (*targ == 0)
|
||||
targ = ".";
|
||||
targ = dot;
|
||||
|
||||
if ((thost = strchr(argv[argc - 1], '@')) != NULL) {
|
||||
/* user@host */
|
||||
|
@ -274,7 +276,7 @@ toremote(char *targ, int argc, char *argv[])
|
|||
if (src) { /* remote to remote */
|
||||
*src++ = 0;
|
||||
if (*src == 0)
|
||||
src = ".";
|
||||
src = dot;
|
||||
host = strchr(argv[i], '@');
|
||||
len = strlen(_PATH_RSH) + strlen(argv[i]) +
|
||||
strlen(src) + (tuser ? strlen(tuser) : 0) +
|
||||
|
@ -353,7 +355,7 @@ tolocal(int argc, char *argv[])
|
|||
}
|
||||
*src++ = 0;
|
||||
if (*src == 0)
|
||||
src = ".";
|
||||
src = dot;
|
||||
if ((host = strchr(argv[i], '@')) == NULL) {
|
||||
host = argv[i];
|
||||
suser = pwname;
|
||||
|
@ -518,7 +520,7 @@ rsource(char *name, struct stat *statp)
|
|||
while ((dp = readdir(dirp)) != NULL) {
|
||||
if (dp->d_ino == 0)
|
||||
continue;
|
||||
if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
|
||||
if (!strcmp(dp->d_name, dot) || !strcmp(dp->d_name, ".."))
|
||||
continue;
|
||||
if (strlen(name) + 1 + strlen(dp->d_name) >= MAXPATHLEN - 1) {
|
||||
run_err("%s/%s: name too long", name, dp->d_name);
|
||||
|
@ -545,7 +547,8 @@ sink(int argc, char *argv[])
|
|||
int amt, count, exists, first, mask, mode, ofd, omode;
|
||||
int setimes, targisdir;
|
||||
int wrerrno = 0; /* pacify gcc */
|
||||
char ch, *cp, *np, *targ, *why, *vect[1], buf[BUFSIZ];
|
||||
char ch, *cp, *np, *targ, *vect[1], buf[BUFSIZ];
|
||||
const char *why;
|
||||
off_t size;
|
||||
|
||||
#define atime tv[0]
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
# $NetBSD: Makefile,v 1.79 2004/10/30 19:29:27 christos Exp $
|
||||
# $NetBSD: Makefile,v 1.80 2005/06/26 19:10:49 christos Exp $
|
||||
# @(#)Makefile 8.4 (Berkeley) 5/5/95
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
WARNS=3
|
||||
YHEADER=1
|
||||
PROG= sh
|
||||
SHSRCS= alias.c cd.c echo.c error.c eval.c exec.c expand.c \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: print.c,v 1.21 2003/08/07 09:05:42 agc Exp $ */
|
||||
/* $NetBSD: print.c,v 1.22 2005/06/26 19:10:49 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
|
@ -34,7 +34,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: print.c,v 1.21 2003/08/07 09:05:42 agc Exp $");
|
||||
__RCSID("$NetBSD: print.c,v 1.22 2005/06/26 19:10:49 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -49,7 +49,7 @@ __RCSID("$NetBSD: print.c,v 1.21 2003/08/07 09:05:42 agc Exp $");
|
|||
|
||||
static void binit(const char *);
|
||||
static void bput(const char *);
|
||||
static char *ccval(const struct cchar *, int);
|
||||
static const char *ccval(const struct cchar *, int);
|
||||
|
||||
void
|
||||
print(struct termios *tp, struct winsize *wp, int ldisc, enum FMT fmt)
|
||||
|
@ -239,7 +239,7 @@ bput(const char *s)
|
|||
col += printf(" %s", s);
|
||||
}
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
ccval(const struct cchar *p, int c)
|
||||
{
|
||||
static char buf[5];
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
# $NetBSD: Makefile,v 1.10 2005/06/24 23:21:09 christos Exp $
|
||||
# $NetBSD: Makefile,v 1.11 2005/06/26 19:10:49 christos Exp $
|
||||
# $OpenBSD: Makefile,v 1.4 2002/06/05 17:34:56 mickey Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
WARNS=3
|
||||
PROG= systrace
|
||||
DPADD+= ${LIBEVENT}
|
||||
LDADD+= -levent
|
||||
|
|
Loading…
Reference in New Issue