WARNSify, fix .Nm usage

This commit is contained in:
lukem 1997-10-18 11:52:32 +00:00
parent acd4cefee0
commit ffe5b43454
12 changed files with 55 additions and 42 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: append.c,v 1.5 1995/03/26 03:27:37 glass Exp $ */
/* $NetBSD: append.c,v 1.6 1997/10/18 11:52:32 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)append.c 8.3 (Berkeley) 4/2/94";
#else
static char rcsid[] = "$NetBSD: append.c,v 1.5 1995/03/26 03:27:37 glass Exp $";
__RCSID("$NetBSD: append.c,v 1.6 1997/10/18 11:52:32 lukem Exp $");
#endif
#endif /* not lint */
@ -77,7 +78,7 @@ append(argv)
/* Read from disk, write to an archive; pad on write. */
SETCF(0, 0, afd, archive, WPAD);
for (eval = 0; file = *argv++;) {
for (eval = 0; (file = *argv++) != NULL;) {
if ((fd = open(file, O_RDONLY)) < 0) {
warn("%s", file);
eval = 1;

View File

@ -1,4 +1,4 @@
.\" $NetBSD: ar.1,v 1.10 1997/05/29 01:48:51 cgd Exp $
.\" $NetBSD: ar.1,v 1.11 1997/10/18 11:52:39 lukem Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@ -43,41 +43,41 @@
.Nm ar
.Nd create and maintain library archives
.Sh SYNOPSIS
.Nm ar
.Nm
.Fl d
.Op Fl \Tv
.Ar archive file ...
.Nm ar
.Nm ""
.Fl m
.Op Fl \Tv
.Ar archive file ...
.Nm ar
.Nm ""
.Fl m
.Op Fl abiTv
.Ar position archive file ...
.Nm ar
.Nm ""
.Fl p
.Op Fl \Tv
.Ar archive
.Op Ar file ...
.Nm ar
.Nm ""
.Fl q
.Op Fl cTv
.Ar archive file ...
.Nm ar
.Nm ""
.Fl r
.Op Fl cuTv
.Ar archive file ...
.Nm ar
.Nm ""
.Fl r
.Op Fl abciuTv
.Ar position archive file ...
.Nm ar
.Nm ""
.Fl t
.Op Fl \Tv
.Ar archive
.Op Ar file ...
.Nm ar
.Nm ""
.Fl x
.Op Fl ouTv
.Ar archive

View File

@ -1,4 +1,4 @@
.\" $NetBSD: ar.5,v 1.3 1997/01/09 12:40:08 tls Exp $
.\" $NetBSD: ar.5,v 1.4 1997/10/18 11:52:44 lukem Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -43,14 +43,14 @@
.Fd #include <ar.h>
.Sh DESCRIPTION
The archive command
.Nm ar
.Nm
combines several files into one.
Archives are mainly used as libraries of object files intended to be
loaded using the link-editor
.Xr ld 1 .
.Pp
A file created with
.Nm ar
.Nm
begins with the ``magic'' string "!<arch>\en".
The rest of the archive is made up of objects, each of which is composed
of a header for a file, a possible file name, and the file contents.
@ -109,7 +109,7 @@ character, although the size in the header does not reflect this.
.Xr stat 2
.Sh HISTORY
There have been at least four
.Nm ar
.Nm
formats.
The first was denoted by the leading ``magic'' number 0177555 (stored as
type int).

View File

@ -1,4 +1,4 @@
/* $NetBSD: ar.c,v 1.5 1995/03/26 03:27:44 glass Exp $ */
/* $NetBSD: ar.c,v 1.6 1997/10/18 11:52:50 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -36,17 +36,17 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)ar.c 8.3 (Berkeley) 4/2/94";
#else
static char rcsid[] = "$NetBSD: ar.c,v 1.5 1995/03/26 03:27:44 glass Exp $";
__RCSID("$NetBSD: ar.c,v 1.6 1997/10/18 11:52:50 lukem Exp $");
#endif
#endif /* not lint */
@ -69,6 +69,7 @@ u_int options;
char *archive, *envtmp, *posarg, *posname;
static void badoptions __P((char *));
static void usage __P((void));
int main __P((int, char **));
/*
* main --
@ -87,6 +88,7 @@ main(argc, argv)
if (argc < 3)
usage();
fcall = NULL;
/*
* Historic versions didn't require a '-' in front of the options.
@ -94,7 +96,7 @@ main(argc, argv)
*/
if (*argv[1] != '-') {
if (!(p = malloc((u_int)(strlen(argv[1]) + 2))))
err(1, NULL);
err(1, "malloc");
*p = '-';
(void)strcpy(p + 1, argv[1]);
argv[1] = p;

View File

@ -1,4 +1,4 @@
/* $NetBSD: archive.c,v 1.11 1997/07/19 22:19:35 perry Exp $ */
/* $NetBSD: archive.c,v 1.12 1997/10/18 11:52:55 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)archive.c 8.4 (Berkeley) 4/27/95";
#else
static char rcsid[] = "$NetBSD: archive.c,v 1.11 1997/07/19 22:19:35 perry Exp $";
__RCSID("$NetBSD: archive.c,v 1.12 1997/10/18 11:52:55 lukem Exp $");
#endif
#endif /* not lint */
@ -300,6 +301,7 @@ copy_ar(cfp, size)
int from, nr, nw, off, to;
char buf[8*1024];
nr = 0;
if (!(sz = size))
return;
@ -339,7 +341,7 @@ skip_arobj(fd)
{
off_t len;
len = chdr.size + (chdr.size + chdr.lname & 1);
len = chdr.size + ((chdr.size + chdr.lname) & 1);
if (lseek(fd, len, SEEK_CUR) == (off_t)-1)
error(archive);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: contents.c,v 1.5 1995/03/26 03:27:49 glass Exp $ */
/* $NetBSD: contents.c,v 1.6 1997/10/18 11:52:59 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)contents.c 8.3 (Berkeley) 4/2/94";
#else
static char rcsid[] = "$NetBSD: contents.c,v 1.5 1995/03/26 03:27:49 glass Exp $";
__RCSID("$NetBSD: contents.c,v 1.6 1997/10/18 11:52:59 lukem Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: delete.c,v 1.5 1995/03/26 03:27:52 glass Exp $ */
/* $NetBSD: delete.c,v 1.6 1997/10/18 11:53:04 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)delete.c 8.3 (Berkeley) 4/2/94";
#else
static char rcsid[] = "$NetBSD: delete.c,v 1.5 1995/03/26 03:27:52 glass Exp $";
__RCSID("$NetBSD: delete.c,v 1.6 1997/10/18 11:53:04 lukem Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: extract.c,v 1.6 1997/04/24 06:22:16 mycroft Exp $ */
/* $NetBSD: extract.c,v 1.7 1997/10/18 11:53:09 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)extract.c 8.3 (Berkeley) 4/2/94";
#else
static char rcsid[] = "$NetBSD: extract.c,v 1.6 1997/04/24 06:22:16 mycroft Exp $";
__RCSID("$NetBSD: extract.c,v 1.7 1997/10/18 11:53:09 lukem Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: misc.c,v 1.7 1997/01/09 12:40:10 tls Exp $ */
/* $NetBSD: misc.c,v 1.8 1997/10/18 11:53:17 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)misc.c 8.4 (Berkeley) 4/27/95";
#else
static char rcsid[] = "$NetBSD: misc.c,v 1.7 1997/01/09 12:40:10 tls Exp $";
__RCSID("$NetBSD: misc.c,v 1.8 1997/10/18 11:53:17 lukem Exp $");
#endif
#endif /* not lint */
@ -103,7 +104,7 @@ files(argv)
for (list = argv; *list; ++list)
if (compare(*list)) {
p = *list;
for (; list[0] = list[1]; ++list)
for (; (list[0] = list[1]) != NULL; ++list)
continue;
return (p);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: move.c,v 1.5 1995/03/26 03:27:57 glass Exp $ */
/* $NetBSD: move.c,v 1.6 1997/10/18 11:53:22 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)move.c 8.3 (Berkeley) 4/2/94";
#else
static char rcsid[] = "$NetBSD: move.c,v 1.5 1995/03/26 03:27:57 glass Exp $";
__RCSID("$NetBSD: move.c,v 1.6 1997/10/18 11:53:22 lukem Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: print.c,v 1.5 1995/03/26 03:27:59 glass Exp $ */
/* $NetBSD: print.c,v 1.6 1997/10/18 11:53:27 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)print.c 8.3 (Berkeley) 4/2/94";
#else
static char rcsid[] = "$NetBSD: print.c,v 1.5 1995/03/26 03:27:59 glass Exp $";
__RCSID("$NetBSD: print.c,v 1.6 1997/10/18 11:53:27 lukem Exp $");
#endif
#endif /* not lint */

View File

@ -1,4 +1,4 @@
/* $NetBSD: replace.c,v 1.7 1997/01/09 12:40:12 tls Exp $ */
/* $NetBSD: replace.c,v 1.8 1997/10/18 11:53:32 lukem Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)replace.c 8.4 (Berkeley) 4/27/95";
#else
static char rcsid[] = "$NetBSD: replace.c,v 1.7 1997/01/09 12:40:12 tls Exp $";
__RCSID("$NetBSD: replace.c,v 1.8 1997/10/18 11:53:32 lukem Exp $");
#endif
#endif /* not lint */
@ -147,7 +148,8 @@ useold: SETCF(afd, archive, curfd, tname, RPAD|WPAD);
}
/* Append any left-over arguments to the end of the after file. */
append: while (file = *argv++) {
append:
while ((file = *argv++) != NULL) {
if (options & AR_V)
(void)printf("a - %s\n", file);
if ((sfd = open(file, O_RDONLY)) < 0) {