ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/trunk/usr.bin/nl/nl.c
(Generate patch)

Comparing trunk/usr.bin/nl/nl.c (file contents):
Revision 11457 by laffer1, Fri Dec 20 23:32:25 2013 UTC vs.
Revision 11458 by laffer1, Sat Jul 7 16:51:00 2018 UTC

# Line 1 | Line 1
1 + /* $MidnightBSD$ */
2   /*-
3   * Copyright (c) 1999 The NetBSD Foundation, Inc.
4   * All rights reserved.
# Line 32 | Line 33
33   __COPYRIGHT(
34   "@(#) Copyright (c) 1999\
35   The NetBSD Foundation, Inc.  All rights reserved.");
36 < __RCSID("$MidnightBSD$");
36 > __RCSID("$FreeBSD: stable/10/usr.bin/nl/nl.c 226362 2011-10-14 07:28:39Z ed $");
37   #endif    
38  
39   #define _WITH_GETLINE
# Line 73 | Line 74 | struct numbering_property {
74   #define NP_LAST         HEADER
75  
76   static struct numbering_property numbering_properties[NP_LAST + 1] = {
77 <        { "footer",     number_none     },
78 <        { "body",       number_nonempty },
79 <        { "header",     number_none     }
77 >        { .name = "footer", .type = number_none },
78 >        { .name = "body", .type = number_nonempty },
79 >        { .name = "header", .type = number_none }
80   };
81  
82   #define max(a, b)       ((a) > (b) ? (a) : (b))
# Line 128 | Line 129 | static int width = 6;
129  
130  
131   int
132 < main(argc, argv)
132 <        int argc;
133 <        char *argv[];
132 > main(int argc, char *argv[])
133   {
134          int c;
135          long val;
# Line 258 | Line 257 | main(argc, argv)
257          delimlen = delim1len + delim2len;
258  
259          /* Allocate a buffer suitable for preformatting line number. */
260 <        intbuffersize = max(INT_STRLEN_MAXIMUM, width) + 1;     /* NUL */
260 >        intbuffersize = max((int)INT_STRLEN_MAXIMUM, width) + 1; /* NUL */
261          if ((intbuffer = malloc(intbuffersize)) == NULL)
262                  err(EXIT_FAILURE, "cannot allocate preformatting buffer");
263  
# Line 270 | Line 269 | main(argc, argv)
269   }
270  
271   static void
272 < filter()
272 > filter(void)
273   {
274          char *buffer;
275          size_t buffersize;
# Line 359 | Line 358 | nextline:
358   */
359  
360   static void
361 < parse_numbering(argstr, section)
363 <        const char *argstr;
364 <        int section;
361 > parse_numbering(const char *argstr, int section)
362   {
363          int error;
364          char errorbuf[NL_TEXTMAX];
# Line 403 | Line 400 | parse_numbering(argstr, section)
400   }
401  
402   static void
403 < usage()
403 > usage(void)
404   {
405  
406          (void)fprintf(stderr,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines