Fix compiler warnings.

Add WARNS=1
This commit is contained in:
christos 1997-07-20 18:52:57 +00:00
parent bd4c20b09e
commit b22592e84f
7 changed files with 34 additions and 22 deletions

View File

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.8 1995/03/21 09:06:18 cgd Exp $
# $NetBSD: Makefile,v 1.9 1997/07/20 18:52:57 christos Exp $
# @(#)Makefile 8.1 (Berkeley) 6/2/93
WARNS= 1
PROG= ls
SRCS= cmp.c stat_flags.c ls.c print.c util.c

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmp.c,v 1.10 1996/07/08 10:32:01 mycroft Exp $ */
/* $NetBSD: cmp.c,v 1.11 1997/07/20 18:53:01 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cmp.c 8.1 (Berkeley) 5/31/93";
#else
static char rcsid[] = "$NetBSD: cmp.c,v 1.10 1996/07/08 10:32:01 mycroft Exp $";
__RCSID("$NetBSD: cmp.c,v 1.11 1997/07/20 18:53:01 christos Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.5 1995/03/21 09:06:24 cgd Exp $ */
/* $NetBSD: extern.h,v 1.6 1997/07/20 18:53:04 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -47,6 +47,7 @@ int sizecmp __P((const FTSENT *, const FTSENT *));
int revsizecmp __P((const FTSENT *, const FTSENT *));
char *flags_to_string __P((u_long, char *));
int string_to_flags __P((char **, u_long *, u_long *));
void prcopy __P((char *, char *, int));
void printcol __P((DISPLAY *));
void printlong __P((DISPLAY *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $ */
/* $NetBSD: ls.c,v 1.19 1997/07/20 18:53:07 christos Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@ -36,17 +36,17 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1989, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)ls.c 8.7 (Berkeley) 8/5/94";
#else
static char rcsid[] = "$NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $";
__RCSID("$NetBSD: ls.c,v 1.19 1997/07/20 18:53:07 christos Exp $");
#endif
#endif /* not lint */
@ -68,6 +68,7 @@ static char rcsid[] = "$NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $";
char *group_from_gid __P((u_int, int));
char *user_from_uid __P((u_int, int));
int main __P((int, char *[]));
static void display __P((FTSENT *, FTSENT *));
static int mastercmp __P((const FTSENT **, const FTSENT **));
@ -325,7 +326,7 @@ traverse(argc, argv, options)
if ((ftsp =
fts_open(argv, options, f_nosort ? NULL : mastercmp)) == NULL)
err(1, NULL);
err(1, "%s", "");
display(NULL, fts_children(ftsp, 0));
if (f_listdir)
@ -391,7 +392,8 @@ display(p, list)
u_long btotal, maxblock, maxinode, maxlen, maxnlink;
int bcfile, flen, glen, ulen, maxflags, maxgroup, maxuser;
int entries, needstats;
char *user, *group, *flags, buf[20]; /* 32 bits == 10 digits */
char *user, *group, buf[20]; /* 32 bits == 10 digits */
char *flags = NULL; /* pacify gcc */
/*
* If list is NULL there are two possibilities: that the parent
@ -467,7 +469,7 @@ display(p, list)
if ((np = malloc(sizeof(NAMES) +
ulen + glen + flen + 3)) == NULL)
err(1, NULL);
err(1, "%s", "");
np->user = &np->data[0];
(void)strcpy(np->user, user);

View File

@ -1,4 +1,4 @@
/* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */
/* $NetBSD: print.c,v 1.16 1997/07/20 18:53:10 christos Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)print.c 8.5 (Berkeley) 7/28/94";
#else
static char rcsid[] = "$NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $";
__RCSID("$NetBSD: print.c,v 1.16 1997/07/20 18:53:10 christos Exp $");
#endif
#endif /* not lint */
@ -101,7 +102,7 @@ printlong(dp)
continue;
sp = p->fts_statp;
if (f_inode)
(void)printf("%*lu ", dp->s_inode, sp->st_ino);
(void)printf("%*u ", dp->s_inode, sp->st_ino);
if (f_size)
(void)printf("%*qd ",
dp->s_block, howmany(sp->st_blocks, blocksize));
@ -143,7 +144,7 @@ printcol(dp)
static FTSENT **array;
static int lastentries = -1;
FTSENT *p;
int base, chcnt, cnt, col, colwidth, num;
int base, chcnt, col, colwidth, num;
int numcols, numrows, row;
/*
@ -154,7 +155,7 @@ printcol(dp)
lastentries = dp->entries;
if ((array =
realloc(array, dp->entries * sizeof(FTSENT *))) == NULL) {
warn(NULL);
warn("%s", "");
printscol(dp);
}
}
@ -212,7 +213,7 @@ printaname(p, inodefield, sizefield)
sp = p->fts_statp;
chcnt = 0;
if (f_inode)
chcnt += printf("%*lu ", (int)inodefield, sp->st_ino);
chcnt += printf("%*u ", (int)inodefield, sp->st_ino);
if (f_size)
chcnt += printf("%*qd ",
(int)sizefield, howmany(sp->st_blocks, blocksize));

View File

@ -1,4 +1,4 @@
/* $NetBSD: stat_flags.c,v 1.5 1995/09/07 06:43:01 jtc Exp $ */
/* $NetBSD: stat_flags.c,v 1.6 1997/07/20 18:53:12 christos Exp $ */
/*-
* Copyright (c) 1993
@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)stat_flags.c 8.2 (Berkeley) 7/28/94";
#else
static char rcsid[] = "$NetBSD: stat_flags.c,v 1.5 1995/09/07 06:43:01 jtc Exp $";
__RCSID("$NetBSD: stat_flags.c,v 1.6 1997/07/20 18:53:12 christos Exp $");
#endif
#endif /* not lint */
@ -46,6 +47,10 @@ static char rcsid[] = "$NetBSD: stat_flags.c,v 1.5 1995/09/07 06:43:01 jtc Exp $
#include <stddef.h>
#include <string.h>
#include <fts.h>
#include "ls.h"
#include "extern.h"
#define SAPPEND(s) { \
if (prefix != NULL) \

View File

@ -1,4 +1,4 @@
/* $NetBSD: util.c,v 1.12 1995/09/07 06:43:02 jtc Exp $ */
/* $NetBSD: util.c,v 1.13 1997/07/20 18:53:15 christos Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)util.c 8.5 (Berkeley) 4/28/95";
#else
static char rcsid[] = "$NetBSD: util.c,v 1.12 1995/09/07 06:43:02 jtc Exp $";
__RCSID("$NetBSD: util.c,v 1.13 1997/07/20 18:53:15 christos Exp $");
#endif
#endif /* not lint */