Module Name:    src
Committed By:   tsutsui
Date:           Wed Aug 12 17:59:51 UTC 2015

Modified Files:
        src/sys/arch/atari/stand/installboot: Makefile installboot.c

Log Message:
Try to shrink binary size a bit.

- omit usage of options in SMALLPROG case
- use bool instead of int where appropriate
- rely on zero-initialized-bss


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/atari/stand/installboot/Makefile
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/atari/stand/installboot/installboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/atari/stand/installboot/Makefile
diff -u src/sys/arch/atari/stand/installboot/Makefile:1.8 src/sys/arch/atari/stand/installboot/Makefile:1.9
--- src/sys/arch/atari/stand/installboot/Makefile:1.8	Mon Nov 24 08:08:23 2014
+++ src/sys/arch/atari/stand/installboot/Makefile	Wed Aug 12 17:59:51 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2014/11/24 08:08:23 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.9 2015/08/12 17:59:51 tsutsui Exp $
 
 WARNS=	4
 PROG=	installboot
@@ -6,7 +6,7 @@ NOMAN=	# defined
 SRCS=	installboot.c disklabel.c
 BINDIR=	/usr/mdec
 .ifndef SMALLPROG
-CPPFLAGS+=	-DCHECK_OS_BOOTVERSION
+CPPFLAGS+=	-DCHECK_OS_BOOTVERSION -DNO_USAGE
 LDADD=	-lkvm
 .endif
 

Index: src/sys/arch/atari/stand/installboot/installboot.c
diff -u src/sys/arch/atari/stand/installboot/installboot.c:1.34 src/sys/arch/atari/stand/installboot/installboot.c:1.35
--- src/sys/arch/atari/stand/installboot/installboot.c:1.34	Mon Nov 24 08:08:23 2014
+++ src/sys/arch/atari/stand/installboot/installboot.c	Wed Aug 12 17:59:51 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: installboot.c,v 1.34 2014/11/24 08:08:23 tsutsui Exp $	*/
+/*	$NetBSD: installboot.c,v 1.35 2015/08/12 17:59:51 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Waldi Ravens
@@ -73,23 +73,26 @@ static struct ahdi_root ahdiboot;
 static const char	mdecpath[] = PATH_MDEC;
 static const char	stdpath[] = PATH_STD;
 static const char	milanpath[] = PATH_MILAN;
-static int		nowrite = 0;
-static int		verbose = 0;
-static int		trackpercyl = 0;
-static int		secpertrack = 0;
-static int		milan = 0;
+static bool		nowrite;
+static bool		verbose;
+static int		trackpercyl;
+static int		secpertrack;
+static bool		milan;
 
 static void
 usage(void)
 {
 	fprintf(stderr,
 		"usage: installboot [options] device\n"
+#ifndef NO_USAGE
 		"where options are:\n"
 		"\t-N  do not actually write anything on the disk\n"
 		"\t-m  use Milan boot blocks\n"
 		"\t-t  number of tracks per cylinder (IDE disk)\n"
 		"\t-u  number of sectors per track (IDE disk)\n"
-		"\t-v  verbose mode\n");
+		"\t-v  verbose mode\n"
+#endif
+		);
 	exit(EXIT_FAILURE);
 }
 
@@ -110,10 +113,10 @@ main(int argc, char *argv[])
 	while ((c = getopt(argc, argv, "Nmt:u:v")) != -1) {
 		switch (c) {
 		  case 'N':
-			nowrite = 1;
+			nowrite = true;
 			break;
 		  case 'm':
-			milan = 1;
+			milan = true;
 			break;
 		  case 't':
 			trackpercyl = atoi(optarg);
@@ -122,7 +125,7 @@ main(int argc, char *argv[])
 			secpertrack = atoi(optarg);
 			break;
 		  case 'v':
-			verbose = 1;
+			verbose = true;
 			break;
 		  default:
 			usage();

Reply via email to