From owner-svn-src-all@FreeBSD.ORG Fri Oct 14 07:28:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AFF1106564A; Fri, 14 Oct 2011 07:28:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31BF88FC14; Fri, 14 Oct 2011 07:28:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9E7SeAd052357; Fri, 14 Oct 2011 07:28:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9E7SeoB052354; Fri, 14 Oct 2011 07:28:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201110140728.p9E7SeoB052354@svn.freebsd.org> From: Ed Schouten Date: Fri, 14 Oct 2011 07:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226362 - head/usr.bin/nl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2011 07:28:40 -0000 Author: ed Date: Fri Oct 14 07:28:39 2011 New Revision: 226362 URL: http://svn.freebsd.org/changeset/base/226362 Log: Make nl(1) build with WARNS=6. Obtained from: NetBSD Modified: head/usr.bin/nl/Makefile head/usr.bin/nl/nl.c Modified: head/usr.bin/nl/Makefile ============================================================================== --- head/usr.bin/nl/Makefile Fri Oct 14 07:26:20 2011 (r226361) +++ head/usr.bin/nl/Makefile Fri Oct 14 07:28:39 2011 (r226362) @@ -2,6 +2,4 @@ PROG= nl -WARNS?= 2 - .include Modified: head/usr.bin/nl/nl.c ============================================================================== --- head/usr.bin/nl/nl.c Fri Oct 14 07:26:20 2011 (r226361) +++ head/usr.bin/nl/nl.c Fri Oct 14 07:28:39 2011 (r226362) @@ -73,9 +73,9 @@ struct numbering_property { #define NP_LAST HEADER static struct numbering_property numbering_properties[NP_LAST + 1] = { - { "footer", number_none }, - { "body", number_nonempty }, - { "header", number_none } + { .name = "footer", .type = number_none }, + { .name = "body", .type = number_nonempty }, + { .name = "header", .type = number_none } }; #define max(a, b) ((a) > (b) ? (a) : (b)) @@ -128,9 +128,7 @@ static int width = 6; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int c; long val; @@ -258,7 +256,7 @@ main(argc, argv) delimlen = delim1len + delim2len; /* 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) err(EXIT_FAILURE, "cannot allocate preformatting buffer"); @@ -270,7 +268,7 @@ main(argc, argv) } static void -filter() +filter(void) { char *buffer; size_t buffersize; @@ -359,9 +357,7 @@ nextline: */ static void -parse_numbering(argstr, section) - const char *argstr; - int section; +parse_numbering(const char *argstr, int section) { int error; char errorbuf[NL_TEXTMAX]; @@ -403,7 +399,7 @@ parse_numbering(argstr, section) } static void -usage() +usage(void) { (void)fprintf(stderr,