Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/freebsd-src.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-10-06 02:47:21 +0300
committerJohn Baldwin <jhb@FreeBSD.org>2022-11-11 21:18:54 +0300
commit068c9d3de7c95903d7827d18327219d6be02db04 (patch)
treefa592b00a017cfa5a30b74d25d629cdb2b590f1d
parent587ab8e01930bb7196f55227cec263827165fc3f (diff)
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 (cherry picked from commit bb31e1bbf2ade7abd38eb29391e1ba0718723480)
-rw-r--r--usr.bin/rs/rs.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c
index 94675fc96338..99e48194b3c7 100644
--- a/usr.bin/rs/rs.c
+++ b/usr.bin/rs/rs.c
@@ -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: