diff options
author | markm <markm@FreeBSD.org> | 2001-12-02 12:36:35 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-12-02 12:36:35 +0000 |
commit | 9c4ab2cc6f3bb82ffeec94e189dddf1dd9441000 (patch) | |
tree | 8781c2ade3907af81b3cb15379555b839c1ecdfd /usr.bin/ar | |
parent | 54f12414b9d4516defafc83ba6476f53fd487c29 (diff) | |
download | FreeBSD-src-9c4ab2cc6f3bb82ffeec94e189dddf1dd9441000.zip FreeBSD-src-9c4ab2cc6f3bb82ffeec94e189dddf1dd9441000.tar.gz |
WARNS=2 fixup.
Diffstat (limited to 'usr.bin/ar')
-rw-r--r-- | usr.bin/ar/Makefile | 3 | ||||
-rw-r--r-- | usr.bin/ar/ar.c | 7 | ||||
-rw-r--r-- | usr.bin/ar/archive.c | 4 | ||||
-rw-r--r-- | usr.bin/ar/archive.h | 5 | ||||
-rw-r--r-- | usr.bin/ar/extern.h | 4 | ||||
-rw-r--r-- | usr.bin/ar/misc.c | 4 |
6 files changed, 15 insertions, 12 deletions
diff --git a/usr.bin/ar/Makefile b/usr.bin/ar/Makefile index d195769..61a27c40 100644 --- a/usr.bin/ar/Makefile +++ b/usr.bin/ar/Makefile @@ -2,9 +2,10 @@ # $FreeBSD$ PROG= ar -CFLAGS+=-I${.CURDIR} -Wall SRCS= append.c ar.c archive.c contents.c delete.c extract.c misc.c \ move.c print.c replace.c +CFLAGS+=-I${.CURDIR} +WARNS?= 2 MAN= ar.1aout ar.5 BINDIR= /usr/libexec/aout diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c index 73dab41..dc38da2 100644 --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -64,8 +64,9 @@ static const char sccsid[] = "@(#)ar.c 8.3 (Berkeley) 4/2/94"; CHDR chdr; u_int options; -char *archive, *envtmp, *posarg, *posname; -static void badoptions __P((char *)); +char *archive, *posarg, *posname; +const char *envtmp; +static void badoptions __P((const char *)); static void usage __P((void)); /* @@ -219,7 +220,7 @@ main(argc, argv) static void badoptions(arg) - char *arg; + const char *arg; { warnx("illegal option combination for %s", arg); diff --git a/usr.bin/ar/archive.c b/usr.bin/ar/archive.c index 32cdfa6..e09cb67 100644 --- a/usr.bin/ar/archive.c +++ b/usr.bin/ar/archive.c @@ -201,7 +201,7 @@ put_arobj(cfp, sb) CF *cfp; struct stat *sb; { - int lname; + size_t lname; char *name; struct ar_hdr *hdr; off_t size; @@ -253,7 +253,7 @@ put_arobj(cfp, sb) if (write(cfp->wfd, hb, sizeof(HDR)) != sizeof(HDR)) error(cfp->wname); if (lname) { - if (write(cfp->wfd, name, lname) != lname) + if ((size_t)write(cfp->wfd, name, lname) != lname) error(cfp->wname); already_written = lname; } diff --git a/usr.bin/ar/archive.h b/usr.bin/ar/archive.h index fb4ffeb..f517a95 100644 --- a/usr.bin/ar/archive.h +++ b/usr.bin/ar/archive.h @@ -34,6 +34,7 @@ * SUCH DAMAGE. * * @(#)archive.h 8.3 (Berkeley) 4/2/94 + * $FreeBSD$ */ /* Ar(1) options. */ @@ -65,9 +66,9 @@ extern u_int options; /* File copy structure. */ typedef struct { int rfd; /* read file descriptor */ - char *rname; /* read name */ + const char *rname; /* read name */ int wfd; /* write file descriptor */ - char *wname; /* write name */ + const char *wname; /* write name */ #define NOPAD 0x00 /* don't pad */ #define RPAD 0x01 /* pad on reads */ #define WPAD 0x02 /* pad on writes */ diff --git a/usr.bin/ar/extern.h b/usr.bin/ar/extern.h index 0efb771d..a27f72a 100644 --- a/usr.bin/ar/extern.h +++ b/usr.bin/ar/extern.h @@ -39,7 +39,7 @@ void badfmt __P((void)); int compare __P((char *)); int contents __P((char **)); int delete __P((char **)); -void error __P((char *)); +void error __P((const char *)); int extract __P((char **)); char *files __P((char **argv)); int move __P((char **)); @@ -50,5 +50,5 @@ int tmp __P((void)); extern char *archive; extern char *posarg, *posname; /* positioning file name */ -extern char *tname; /* temporary file "name" */ +extern const char *tname; /* temporary file "name" */ extern CHDR chdr; /* converted header */ diff --git a/usr.bin/ar/misc.c b/usr.bin/ar/misc.c index 0a0dd1b..e61d7b8 100644 --- a/usr.bin/ar/misc.c +++ b/usr.bin/ar/misc.c @@ -56,7 +56,7 @@ static const char rcsid[] = #include "extern.h" #include "pathnames.h" -char *tname = "temporary file"; /* temporary file "name" */ +const char *tname = "temporary file"; /* temporary file "name" */ int tmp() @@ -134,7 +134,7 @@ badfmt() void error(name) - char *name; + const char *name; { err(1, "%s", name); |