fix WARNS=2
This commit is contained in:
parent
b8a6769184
commit
537f55c6b7
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dir.c,v 1.17 2001/09/14 14:03:59 wiz Exp $ */
|
||||
/* $NetBSD: dir.c,v 1.18 2001/11/03 13:35:39 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dir.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: dir.c,v 1.17 2001/09/14 14:03:59 wiz Exp $");
|
||||
__RCSID("$NetBSD: dir.c,v 1.18 2001/11/03 13:35:39 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -618,7 +618,7 @@ dfree(struct directory *dp)
|
||||
Char *
|
||||
dcanon(Char *cp, Char *p)
|
||||
{
|
||||
Char link[MAXPATHLEN];
|
||||
Char slink[MAXPATHLEN];
|
||||
char tlink[MAXPATHLEN];
|
||||
Char *newcp, *sp;
|
||||
Char *p1, *p2; /* general purpose */
|
||||
@ -685,8 +685,8 @@ dcanon(Char *cp, Char *p)
|
||||
if (sp != cp && !adrof(STRignore_symlinks) &&
|
||||
(cc = readlink(short2str(cp), tlink,
|
||||
sizeof tlink)) >= 0) {
|
||||
(void)Strcpy(link, str2short(tlink));
|
||||
link[cc] = '\0';
|
||||
(void)Strcpy(slink, str2short(tlink));
|
||||
slink[cc] = '\0';
|
||||
|
||||
if (slash)
|
||||
*p = '/';
|
||||
@ -699,7 +699,7 @@ dcanon(Char *cp, Char *p)
|
||||
*/
|
||||
for (p1 = p; *p1++;)
|
||||
continue;
|
||||
if (*link != '/') {
|
||||
if (*slink != '/') {
|
||||
/*
|
||||
* Relative path, expand it between the "yyy/" and the
|
||||
* "/..". First, back sp up to the character past "yyy/".
|
||||
@ -709,7 +709,7 @@ dcanon(Char *cp, Char *p)
|
||||
sp++;
|
||||
*sp = 0;
|
||||
/*
|
||||
* New length is "yyy/" + link + "/.." and rest
|
||||
* New length is "yyy/" + slink + "/.." and rest
|
||||
*/
|
||||
p1 = newcp = (Char *)xmalloc(
|
||||
(size_t)(((sp - cp) + cc + (p1 - p)) * sizeof(Char)));
|
||||
@ -718,7 +718,7 @@ dcanon(Char *cp, Char *p)
|
||||
*/
|
||||
for (p2 = cp; (*p1++ = *p2++) != '\0';)
|
||||
continue;
|
||||
for (p1--, p2 = link; (*p1++ = *p2++) != '\0';)
|
||||
for (p1--, p2 = slink; (*p1++ = *p2++) != '\0';)
|
||||
continue;
|
||||
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
|
||||
continue;
|
||||
@ -729,14 +729,14 @@ dcanon(Char *cp, Char *p)
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* New length is link + "/.." and rest
|
||||
* New length is slink + "/.." and rest
|
||||
*/
|
||||
p1 = newcp = (Char *)xmalloc(
|
||||
(size_t)((cc + (p1 - p)) * sizeof(Char)));
|
||||
/*
|
||||
* Copy new path into newcp
|
||||
*/
|
||||
for (p2 = link; (*p1++ = *p2++) != '\0';)
|
||||
for (p2 = slink; (*p1++ = *p2++) != '\0';)
|
||||
continue;
|
||||
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
|
||||
continue;
|
||||
@ -768,8 +768,8 @@ dcanon(Char *cp, Char *p)
|
||||
if (sp != cp && adrof(STRchase_symlinks) &&
|
||||
!adrof(STRignore_symlinks) &&
|
||||
(cc = readlink(short2str(cp), tlink, sizeof(tlink))) >= 0) {
|
||||
(void)Strcpy(link, str2short(tlink));
|
||||
link[cc] = '\0';
|
||||
(void)Strcpy(slink, str2short(tlink));
|
||||
slink[cc] = '\0';
|
||||
|
||||
/*
|
||||
* restore the '/'.
|
||||
@ -787,7 +787,7 @@ dcanon(Char *cp, Char *p)
|
||||
*/
|
||||
for (p1 = p; *p1++;)
|
||||
continue;
|
||||
if (*link != '/') {
|
||||
if (*slink != '/') {
|
||||
/*
|
||||
* Relative path, expand it between the "yyy/" and the
|
||||
* remainder. First, back sp up to the character past
|
||||
@ -798,7 +798,7 @@ dcanon(Char *cp, Char *p)
|
||||
sp++;
|
||||
*sp = 0;
|
||||
/*
|
||||
* New length is "yyy/" + link + "/.." and rest
|
||||
* New length is "yyy/" + slink + "/.." and rest
|
||||
*/
|
||||
p1 = newcp = (Char *)xmalloc(
|
||||
(size_t)(((sp - cp) + cc + (p1 - p)) * sizeof(Char)));
|
||||
@ -807,7 +807,7 @@ dcanon(Char *cp, Char *p)
|
||||
*/
|
||||
for (p2 = cp; (*p1++ = *p2++) != '\0';)
|
||||
continue;
|
||||
for (p1--, p2 = link; (*p1++ = *p2++) != '\0';)
|
||||
for (p1--, p2 = slink; (*p1++ = *p2++) != '\0';)
|
||||
continue;
|
||||
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
|
||||
continue;
|
||||
@ -818,14 +818,14 @@ dcanon(Char *cp, Char *p)
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* New length is link + the rest
|
||||
* New length is slink + the rest
|
||||
*/
|
||||
p1 = newcp = (Char *)xmalloc(
|
||||
(size_t)((cc + (p1 - p)) * sizeof(Char)));
|
||||
/*
|
||||
* Copy new path into newcp
|
||||
*/
|
||||
for (p2 = link; (*p1++ = *p2++) != '\0';)
|
||||
for (p2 = slink; (*p1++ = *p2++) != '\0';)
|
||||
continue;
|
||||
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
|
||||
continue;
|
||||
@ -870,7 +870,7 @@ dcanon(Char *cp, Char *p)
|
||||
/*
|
||||
* Start comparing dev & ino backwards
|
||||
*/
|
||||
p2 = Strcpy(link, cp);
|
||||
p2 = Strcpy(slink, cp);
|
||||
for (sp = NULL; *p2 && stat(short2str(p2), &statbuf) != -1;) {
|
||||
if (statbuf.st_dev == home_dev &&
|
||||
statbuf.st_ino == home_ino) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: exec.c,v 1.16 2001/09/14 14:04:00 wiz Exp $ */
|
||||
/* $NetBSD: exec.c,v 1.17 2001/11/03 13:35:39 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)exec.c 8.3 (Berkeley) 5/23/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: exec.c,v 1.16 2001/09/14 14:04:00 wiz Exp $");
|
||||
__RCSID("$NetBSD: exec.c,v 1.17 2001/11/03 13:35:39 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -607,19 +607,19 @@ executable(Char *dir, Char *name, bool dir_ok)
|
||||
void
|
||||
dowhich(Char **v, struct command *c)
|
||||
{
|
||||
struct wordent lex[3];
|
||||
struct wordent lexw[3];
|
||||
struct varent *vp;
|
||||
|
||||
lex[0].next = &lex[1];
|
||||
lex[1].next = &lex[2];
|
||||
lex[2].next = &lex[0];
|
||||
lexw[0].next = &lexw[1];
|
||||
lexw[1].next = &lexw[2];
|
||||
lexw[2].next = &lexw[0];
|
||||
|
||||
lex[0].prev = &lex[2];
|
||||
lex[1].prev = &lex[0];
|
||||
lex[2].prev = &lex[1];
|
||||
lexw[0].prev = &lexw[2];
|
||||
lexw[1].prev = &lexw[0];
|
||||
lexw[2].prev = &lexw[1];
|
||||
|
||||
lex[0].word = STRNULL;
|
||||
lex[2].word = STRret;
|
||||
lexw[0].word = STRNULL;
|
||||
lexw[2].word = STRret;
|
||||
|
||||
while (*++v) {
|
||||
if ((vp = adrof1(*v, &aliases)) != NULL) {
|
||||
@ -629,8 +629,8 @@ dowhich(Char **v, struct command *c)
|
||||
set(STRstatus, Strsave(STR0));
|
||||
}
|
||||
else {
|
||||
lex[1].word = *v;
|
||||
set(STRstatus, Strsave(tellmewhat(lex, NULL) ? STR0 : STR1));
|
||||
lexw[1].word = *v;
|
||||
set(STRstatus, Strsave(tellmewhat(lexw, NULL) ? STR0 : STR1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: glob.c,v 1.18 2001/09/14 14:04:00 wiz Exp $ */
|
||||
/* $NetBSD: glob.c,v 1.19 2001/11/03 13:35:39 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)glob.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: glob.c,v 1.18 2001/09/14 14:04:00 wiz Exp $");
|
||||
__RCSID("$NetBSD: glob.c,v 1.19 2001/11/03 13:35:39 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -672,7 +672,7 @@ backeval(Char *cp, bool literal)
|
||||
*/
|
||||
mypipe(pvec);
|
||||
if (pfork(&faket, -1) == 0) {
|
||||
struct wordent paraml;
|
||||
struct wordent fparaml;
|
||||
struct command *t;
|
||||
|
||||
(void)close(pvec[0]);
|
||||
@ -698,11 +698,11 @@ backeval(Char *cp, bool literal)
|
||||
evalvec = NULL;
|
||||
alvecp = NULL;
|
||||
evalp = NULL;
|
||||
(void) lex(¶ml);
|
||||
(void) lex(&fparaml);
|
||||
if (seterr)
|
||||
stderror(ERR_OLD);
|
||||
alias(¶ml);
|
||||
t = syntax(paraml.next, ¶ml, 0);
|
||||
alias(&fparaml);
|
||||
t = syntax(fparaml.next, &fparaml, 0);
|
||||
if (seterr)
|
||||
stderror(ERR_OLD);
|
||||
if (t)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lex.c,v 1.19 2001/09/14 14:04:00 wiz Exp $ */
|
||||
/* $NetBSD: lex.c,v 1.20 2001/11/03 13:35:39 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: lex.c,v 1.19 2001/09/14 14:04:00 wiz Exp $");
|
||||
__RCSID("$NetBSD: lex.c,v 1.20 2001/11/03 13:35:39 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -1476,9 +1476,9 @@ again:
|
||||
if (c >= 0)
|
||||
break;
|
||||
if (errno == EWOULDBLOCK) {
|
||||
int off = 0;
|
||||
int iooff = 0;
|
||||
|
||||
(void)ioctl(SHIN, FIONBIO, (ioctl_t) & off);
|
||||
(void)ioctl(SHIN, FIONBIO, (ioctl_t) & iooff);
|
||||
}
|
||||
else if (errno != EINTR)
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: parse.c,v 1.11 2001/09/14 14:04:00 wiz Exp $ */
|
||||
/* $NetBSD: parse.c,v 1.12 2001/11/03 13:35:39 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: parse.c,v 1.11 2001/09/14 14:04:00 wiz Exp $");
|
||||
__RCSID("$NetBSD: parse.c,v 1.12 2001/11/03 13:35:39 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -79,7 +79,7 @@ static int aleft;
|
||||
extern int hleft;
|
||||
|
||||
void
|
||||
alias(struct wordent *lex)
|
||||
alias(struct wordent *lexp)
|
||||
{
|
||||
jmp_buf osetexit;
|
||||
|
||||
@ -93,7 +93,7 @@ alias(struct wordent *lex)
|
||||
}
|
||||
if (--aleft == 0)
|
||||
stderror(ERR_ALIASLOOP);
|
||||
asyntax(lex->next, lex);
|
||||
asyntax(lexp->next, lexp);
|
||||
resexit(osetexit);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: proc.c,v 1.22 2001/09/14 14:04:00 wiz Exp $ */
|
||||
/* $NetBSD: proc.c,v 1.23 2001/11/03 13:35:39 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: proc.c,v 1.22 2001/09/14 14:04:00 wiz Exp $");
|
||||
__RCSID("$NetBSD: proc.c,v 1.23 2001/11/03 13:35:39 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -64,7 +64,6 @@ __RCSID("$NetBSD: proc.c,v 1.22 2001/09/14 14:04:00 wiz Exp $");
|
||||
#define BIGINDEX 9 /* largest desirable job index */
|
||||
|
||||
extern int insource;
|
||||
static struct rusage zru;
|
||||
|
||||
static void pflushall(void);
|
||||
static void pflush(struct process *);
|
||||
@ -648,6 +647,7 @@ pendjob(void)
|
||||
static int
|
||||
pprint(struct process *pp, bool flag)
|
||||
{
|
||||
static struct rusage zru;
|
||||
struct process *tp;
|
||||
char *format;
|
||||
int jobflags, pstatus, reason, status;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: set.c,v 1.16 2001/09/14 14:04:01 wiz Exp $ */
|
||||
/* $NetBSD: set.c,v 1.17 2001/11/03 13:35:40 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1991, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)set.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: set.c,v 1.16 2001/09/14 14:04:01 wiz Exp $");
|
||||
__RCSID("$NetBSD: set.c,v 1.17 2001/11/03 13:35:40 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -344,10 +344,10 @@ static Char *putp;
|
||||
Char *
|
||||
putn(int n)
|
||||
{
|
||||
static Char number[15];
|
||||
static Char numbers[15];
|
||||
int num;
|
||||
|
||||
putp = number;
|
||||
putp = numbers;
|
||||
if (n < 0) {
|
||||
n = -n;
|
||||
*putp++ = '-';
|
||||
@ -370,7 +370,7 @@ putn(int n)
|
||||
#endif
|
||||
putn1(n);
|
||||
*putp = 0;
|
||||
return (Strsave(number));
|
||||
return (Strsave(numbers));
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user