From 98df36b3a5dc34a85ac64301831bbbe890652266 Mon Sep 17 00:00:00 2001 From: lukem Date: Thu, 18 Oct 2001 04:37:56 +0000 Subject: [PATCH] make this mostly WARNS=2 safe --- usr.sbin/mtree/compare.c | 7 +++---- usr.sbin/mtree/create.c | 10 +++++----- usr.sbin/mtree/misc.c | 6 +++--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/usr.sbin/mtree/compare.c b/usr.sbin/mtree/compare.c index 97d52fd33a0c..1c077e06e145 100644 --- a/usr.sbin/mtree/compare.c +++ b/usr.sbin/mtree/compare.c @@ -1,4 +1,4 @@ -/* $NetBSD: compare.c,v 1.29 2001/10/09 04:50:00 lukem Exp $ */ +/* $NetBSD: compare.c,v 1.30 2001/10/18 04:37:56 lukem Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: compare.c,v 1.29 2001/10/09 04:50:00 lukem Exp $"); +__RCSID("$NetBSD: compare.c,v 1.30 2001/10/18 04:37:56 lukem Exp $"); #endif #endif /* not lint */ @@ -114,8 +114,7 @@ compare(const char *name, NODE *s, FTSENT *p) { u_int32_t len, val, flags; int fd, label; - const char *cp; - char *tab; + const char *cp, *tab; char md5buf[35]; tab = NULL; diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c index cd3b9042a157..201972435603 100644 --- a/usr.sbin/mtree/create.c +++ b/usr.sbin/mtree/create.c @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.32 2001/10/09 04:50:01 lukem Exp $ */ +/* $NetBSD: create.c,v 1.33 2001/10/18 04:37:56 lukem Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.32 2001/10/09 04:50:01 lukem Exp $"); +__RCSID("$NetBSD: create.c,v 1.33 2001/10/18 04:37:56 lukem Exp $"); #endif #endif /* not lint */ @@ -84,15 +84,15 @@ cwalk(void) { FTS *t; FTSENT *p; - time_t clock; + time_t clocktime; char *argv[2], host[MAXHOSTNAMELEN + 1]; - (void)time(&clock); + (void)time(&clocktime); (void)gethostname(host, sizeof(host)); host[sizeof(host) - 1] = '\0'; (void)printf( "#\t user: %s\n#\tmachine: %s\n#\t tree: %s\n#\t date: %s", - getlogin(), host, fullpath, ctime(&clock)); + getlogin(), host, fullpath, ctime(&clocktime)); argv[0] = "."; argv[1] = NULL; diff --git a/usr.sbin/mtree/misc.c b/usr.sbin/mtree/misc.c index 6ffe0d0ed155..a3bfce105b17 100644 --- a/usr.sbin/mtree/misc.c +++ b/usr.sbin/mtree/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.16 2001/10/09 04:50:01 lukem Exp $ */ +/* $NetBSD: misc.c,v 1.17 2001/10/18 04:37:56 lukem Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #include #ifndef lint -__RCSID("$NetBSD: misc.c,v 1.16 2001/10/09 04:50:01 lukem Exp $"); +__RCSID("$NetBSD: misc.c,v 1.17 2001/10/18 04:37:56 lukem Exp $"); #endif /* not lint */ #include @@ -135,7 +135,7 @@ int keycompare(const void *a, const void *b) { - return (strcmp(((KEY *)a)->name, ((KEY *)b)->name)); + return (strcmp(((const KEY *)a)->name, ((const KEY *)b)->name)); } void