From 75e4c0c1be6d5638549cd416412c81aae27e1303 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Tue, 30 Jan 2001 14:11:00 +0000 Subject: [PATCH] - bzero() -> memset() - Remove unneeded includes - WARNSfy --- sys/arch/news68k/stand/installboot/Makefile | 3 ++- .../news68k/stand/installboot/installboot.c | 20 +++++++------------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/sys/arch/news68k/stand/installboot/Makefile b/sys/arch/news68k/stand/installboot/Makefile index eb2be5890b9b..6392c70cad65 100644 --- a/sys/arch/news68k/stand/installboot/Makefile +++ b/sys/arch/news68k/stand/installboot/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.2 2001/01/23 11:30:54 tsutsui Exp $ +# $NetBSD: Makefile,v 1.3 2001/01/30 14:11:00 tsutsui Exp $ PROG= installboot SRCS= installboot.c loadfile.c MKMAN= no +WARNS?= 1 S= ${.CURDIR}/../../../.. LIBSA=${S}/lib/libsa diff --git a/sys/arch/news68k/stand/installboot/installboot.c b/sys/arch/news68k/stand/installboot/installboot.c index 5d8253683edf..4591fcaa8184 100644 --- a/sys/arch/news68k/stand/installboot/installboot.c +++ b/sys/arch/news68k/stand/installboot/installboot.c @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.c,v 1.3 2001/01/23 11:30:54 tsutsui Exp $ */ +/* $NetBSD: installboot.c,v 1.4 2001/01/30 14:11:01 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,15 +38,10 @@ #include #include -#include -#include -#include #include -#include #include #include #include -#include #include #include #include @@ -114,7 +109,6 @@ main(argc, argv) int devfd; char *protostore; size_t protosize; - size_t size; u_int32_t boot00[BOOTSECTOR_OFFSET / sizeof(u_int32_t)]; while ((c = getopt(argc, argv, "vn")) != EOF) { @@ -186,7 +180,7 @@ main(argc, argv) if (read(devfd, boot00, sizeof(boot00)) != sizeof(boot00)) err(1, "read boot00"); - bzero(boot00, LABELOFFSET); + memset(boot00, 0, LABELOFFSET); boot00[0] = 0x600001fe; /* jra +0x200 */ boot00[2] = 0x0; if (lseek(devfd, 0, SEEK_SET) != 0) @@ -255,28 +249,28 @@ loadprotoblocks(fname, size) entry_point_p = (int32_t *)(bp + nl[X_ENTRY_POINT].n_value - st); if ((int)block_table & 3) { - warn("%s: invalid address: block_table = %x", + warn("%s: invalid address: block_table = %p", fname, block_table); free((void *)bp); close(fd); return NULL; } if ((int)block_count_p & 3) { - warn("%s: invalid address: block_count_p = %x", + warn("%s: invalid address: block_count_p = %p", fname, block_count_p); free((void *)bp); close(fd); return NULL; } if ((int)block_size_p & 3) { - warn("%s: invalid address: block_size_p = %x", + warn("%s: invalid address: block_size_p = %p", fname, block_size_p); free((void *)bp); close(fd); return NULL; } if ((int)entry_point_p & 3) { - warn("%s: invalid address: entry_point_p = %x", + warn("%s: invalid address: entry_point_p = %p", fname, entry_point_p); free((void *)bp); close(fd); @@ -285,7 +279,7 @@ loadprotoblocks(fname, size) max_block_count = *block_count_p; if (verbose) { - printf("proto bootblock size: %ld\n", sz); + printf("proto bootblock size: %d\n", sz); } *size = sz;