diff options
author | Ed Schouten <ed@FreeBSD.org> | 2011-10-14 07:28:39 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2011-10-14 07:28:39 +0000 |
commit | b7cf00e8d9bcf74fcfacde9a6d3a21eb709ae279 (patch) | |
tree | b08330824acc0c82822717d663781b107a8d806f /usr.bin/nl | |
parent | 51b671f6de4c707850ea09293ccf3ec4351c56a5 (diff) | |
download | src-test2-b7cf00e8d9bcf74fcfacde9a6d3a21eb709ae279.tar.gz src-test2-b7cf00e8d9bcf74fcfacde9a6d3a21eb709ae279.zip |
Notes
Diffstat (limited to 'usr.bin/nl')
-rw-r--r-- | usr.bin/nl/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/nl/nl.c | 20 |
2 files changed, 8 insertions, 14 deletions
diff --git a/usr.bin/nl/Makefile b/usr.bin/nl/Makefile index 07bef878c44e..9b1f292dfbee 100644 --- a/usr.bin/nl/Makefile +++ b/usr.bin/nl/Makefile @@ -2,6 +2,4 @@ PROG= nl -WARNS?= 2 - .include <bsd.prog.mk> diff --git a/usr.bin/nl/nl.c b/usr.bin/nl/nl.c index b3b78b1688d6..9c2ae64ac913 100644 --- a/usr.bin/nl/nl.c +++ b/usr.bin/nl/nl.c @@ -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, |