rs: Fix various harmless warnings.

- Add /* FALLTHROUGH */ comments for intentional fall throughs in
  getargs().

- Remove id strings to quiet -Wunused-const-variable warnings from
  GCC.

- While here, remove __FBSDID.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D36830
This commit is contained in:
John Baldwin 2022-10-05 16:47:21 -07:00
parent ae70e8838c
commit bb31e1bbf2

View file

@ -29,25 +29,12 @@
* SUCH DAMAGE.
*/
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
static const char sccsid[] = "@(#)rs.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
/*
* rs - reshape a data array
* Author: John Kunze, Office of Comp. Affairs, UCB
* BEWARE: lots of unfinished edges
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <err.h>
#include <ctype.h>
#include <limits.h>
@ -402,11 +389,13 @@ getargs(int ac, char *av[])
switch (*p) {
case 'T':
flags |= MTRANSPOSE;
/* FALLTHROUGH */
case 't':
flags |= TRANSPOSE;
break;
case 'c': /* input col. separator */
flags |= ONEISEPONLY;
/* FALLTHROUGH */
case 's': /* one or more allowed */
if (p[1])
isep = *++p;
@ -415,6 +404,7 @@ getargs(int ac, char *av[])
break;
case 'C':
flags |= ONEOSEPONLY;
/* FALLTHROUGH */
case 'S':
if (p[1])
osep = *++p;
@ -428,6 +418,7 @@ getargs(int ac, char *av[])
break;
case 'K': /* skip N lines */
flags |= SKIPPRINT;
/* FALLTHROUGH */
case 'k': /* skip, do not print */
p = getnum(&skip, p, 0);
if (!skip)
@ -459,6 +450,7 @@ getargs(int ac, char *av[])
break;
case 'H': /* print shape only */
flags |= DETAILSHAPE;
/* FALLTHROUGH */
case 'h':
flags |= SHAPEONLY;
break;
@ -485,14 +477,19 @@ getargs(int ac, char *av[])
/*if (!osep)
osep = isep;*/
switch (ac) {
/*case 3:
opages = atoi(av[2]);*/
#if 0
case 3:
opages = atoi(av[2]);
/* FALLTHROUGH */
#endif
case 2:
if ((ocols = atoi(av[1])) < 0)
ocols = 0;
/* FALLTHROUGH */
case 1:
if ((orows = atoi(av[0])) < 0)
orows = 0;
/* FALLTHROUGH */
case 0:
break;
default: