Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/dd dd: fix lint warnings about effectively discarding 'c...



details:   https://anonhg.NetBSD.org/src/rev/5afd5b6d4e28
branches:  trunk
changeset: 989017:5afd5b6d4e28
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 09 21:31:36 2021 +0000

description:
dd: fix lint warnings about effectively discarding 'const'

args.c(153): warning: call to 'bsearch' effectively discards 'const'
    from argument [346]
args.c(383): dito
args.c(475): dito

No functional change.

diffstat:

 bin/dd/args.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (48 lines):

diff -r a566abcd2cd1 -r 5afd5b6d4e28 bin/dd/args.c
--- a/bin/dd/args.c     Sat Oct 09 21:25:39 2021 +0000
+++ b/bin/dd/args.c     Sat Oct 09 21:31:36 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: args.c,v 1.40 2019/01/30 01:40:02 mrg Exp $    */
+/*     $NetBSD: args.c,v 1.41 2021/10/09 21:31:36 rillig Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)args.c     8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: args.c,v 1.40 2019/01/30 01:40:02 mrg Exp $");
+__RCSID("$NetBSD: args.c,v 1.41 2021/10/09 21:31:36 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -127,7 +127,8 @@
 void
 jcl(char **argv)
 {
-       struct arg *ap, tmp;
+       const struct arg *ap;
+       struct arg tmp;
        char *oper, *arg;
 
        in.dbsz = out.dbsz = 512;
@@ -375,7 +376,8 @@
 static void
 f_conv(char *arg)
 {
-       struct conv *cp, tmp;
+       const struct conv *cp;
+       struct conv tmp;
 
        while (arg != NULL) {
                tmp.name = strsep(&arg, ",");
@@ -466,7 +468,8 @@
 f_ioflag(char *arg, u_int flagtype)
 {
        u_int ioflag = 0;
-       struct ioflag *cp, tmp;
+       const struct ioflag *cp;
+       struct ioflag tmp;
        const char *flagstr = (flagtype == C_IFLAG) ? "iflag" : "oflag";
 
        while (arg != NULL) {



Home | Main Index | Thread Index | Old Index