Module Name:    src
Committed By:   lukem
Date:           Sun Apr 12 23:37:12 UTC 2009

Modified Files:
        src/usr.bin/nl: nl.c

Log Message:
Fix -Wextra and -Wsign-compare issues


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/nl/nl.c

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

Modified files:

Index: src/usr.bin/nl/nl.c
diff -u src/usr.bin/nl/nl.c:1.9 src/usr.bin/nl/nl.c:1.10
--- src/usr.bin/nl/nl.c:1.9	Mon Jul 21 14:19:24 2008
+++ src/usr.bin/nl/nl.c	Sun Apr 12 23:37:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: nl.c,v 1.9 2008/07/21 14:19:24 lukem Exp $	*/
+/*	$NetBSD: nl.c,v 1.10 2009/04/12 23:37:12 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: nl.c,v 1.9 2008/07/21 14:19:24 lukem Exp $");
+__RCSID("$NetBSD: nl.c,v 1.10 2009/04/12 23:37:12 lukem Exp $");
 #endif    
 
 #include <errno.h>
@@ -69,9 +69,9 @@
 #define NP_LAST		HEADER
 
 static struct numbering_property numbering_properties[NP_LAST + 1] = {
-	{ "footer",	number_none	},
-	{ "body",	number_nonempty	},
-	{ "header",	number_none	}
+	{ "footer",	number_none,	{ 0, 0, 0, 0 } },
+	{ "body",	number_nonempty, { 0, 0, 0, 0 } },
+	{ "header",	number_none,	{ 0, 0, 0, 0 } },
 };
 
 #define max(a, b)	((a) > (b) ? (a) : (b))
@@ -276,7 +276,7 @@
 	}
 
 	/* Allocate a buffer suitable for preformatting line number. */
-	intbuffersize = max(INT_STRLEN_MAXIMUM, width) + 1;	/* NUL */
+	intbuffersize = max((int)INT_STRLEN_MAXIMUM, width) + 1; /* NUL */
 	if ((intbuffer = malloc(intbuffersize)) == NULL) {
 		perror("cannot allocate preformatting buffer");
 		exit(EXIT_FAILURE);

Reply via email to