Source-Changes-HG archive

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

[src/trunk]: src/crypto/external/bsd/netpgp netpgp: fix or suppress a few lin...



details:   https://anonhg.NetBSD.org/src/rev/8d9d5922b7d6
branches:  trunk
changeset: 369659:8d9d5922b7d6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 27 08:58:31 2022 +0000

description:
netpgp: fix or suppress a few lint warnings

No functional change.

diffstat:

 crypto/external/bsd/netpgp/bin/netpgpverify/Makefile   |  6 +++++-
 crypto/external/bsd/netpgp/dist/src/lib/keyring.c      |  5 +----
 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c       |  6 ++----
 crypto/external/bsd/netpgp/dist/src/libmj/mj.c         |  1 -
 crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c |  4 ++--
 crypto/external/bsd/netpgp/lib/verify/Makefile         |  6 +++++-
 6 files changed, 15 insertions(+), 13 deletions(-)

diffs (126 lines):

diff -r 5223e00a65f4 -r 8d9d5922b7d6 crypto/external/bsd/netpgp/bin/netpgpverify/Makefile
--- a/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile      Sat Aug 27 08:57:23 2022 +0000
+++ b/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile      Sat Aug 27 08:58:31 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.18 2019/10/13 07:28:04 mrg Exp $
+#      $NetBSD: Makefile,v 1.19 2022/08/27 08:58:31 rillig Exp $
 
 PROG=netpgpverify
 BINDIR=                /usr/bin
@@ -19,6 +19,10 @@
 LDFLAGS+=-g -O0
 .endif
 
+LINTFLAGS.bzlib.c+=    -X 161  # constant in conditional context
+LINTFLAGS.bzlib.c+=    -X 220  # fallthrough on case statement
+LINTFLAGS.zlib.c+=     -X 220  # fallthrough on case statement
+
 MAN=   netpgpverify.1
 WARNS= 5
 
diff -r 5223e00a65f4 -r 8d9d5922b7d6 crypto/external/bsd/netpgp/dist/src/lib/keyring.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Sat Aug 27 08:57:23 2022 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Sat Aug 27 08:58:31 2022 +0000
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: keyring.c,v 1.57 2020/10/14 05:19:41 jhigh Exp $");
+__RCSID("$NetBSD: keyring.c,v 1.58 2022/08/27 08:58:32 rillig Exp $");
 #endif
 
 #ifdef HAVE_FCNTL_H
@@ -837,11 +837,8 @@
        unsigned                res = 1;
        pgp_key_t               *key;
        unsigned                n;
-       unsigned                keyc = (keyring != NULL) ? keyring->keyc : 0;
-       char                    *cp;
        pgp_content_enum        type;
        pgp_armor_type_t        atype;
-       char                    keyid[PGP_KEY_ID_SIZE * 3];
 
        fd = pgp_setup_file_write(&output, filename, 1);
        if (fd < 0) {
diff -r 5223e00a65f4 -r 8d9d5922b7d6 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Sat Aug 27 08:57:23 2022 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Sat Aug 27 08:58:31 2022 +0000
@@ -34,7 +34,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: netpgp.c,v 1.105 2022/08/27 08:35:01 rillig Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.106 2022/08/27 08:58:32 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -471,7 +471,7 @@
 {
        uint64_t         now;
        int64_t          t;
-       char            *mult;
+       const char      *mult;
 
        if (s == NULL) {
                return 0;
@@ -584,8 +584,6 @@
 static void
 pobj(FILE *fp, mj_t *obj, int depth)
 {
-       unsigned         i;
-       char            *s;
 
        if (obj == NULL) {
                (void) fprintf(stderr, "No object found\n");
diff -r 5223e00a65f4 -r 8d9d5922b7d6 crypto/external/bsd/netpgp/dist/src/libmj/mj.c
--- a/crypto/external/bsd/netpgp/dist/src/libmj/mj.c    Sat Aug 27 08:57:23 2022 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/libmj/mj.c    Sat Aug 27 08:58:31 2022 +0000
@@ -299,7 +299,6 @@
                        *bp = 0x0;
                        return bp - buf;
                }
-               break;
        case MJ_ARRAY:
                cc = snprintf(buf, size, "[ ");
                for (i = 0 ; i < atom->c ; i++) {
diff -r 5223e00a65f4 -r 8d9d5922b7d6 crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c
--- a/crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c    Sat Aug 27 08:57:23 2022 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/netpgpverify/rsa.c    Sat Aug 27 08:58:31 2022 +0000
@@ -502,7 +502,7 @@
        return (dsa == NULL) ? 0 : PGPV_BN_num_bits(dsa->p);
 }
 
-unsigned 
+unsigned
 netpgpv_dsa_verify(const signature_t *signature,
        const netpgpv_dsa_pubkey_t *pubdsa, const uint8_t *calculated,
        size_t hash_length)
@@ -513,7 +513,7 @@
        int                  ret;
 
        if (signature == NULL || pubdsa == NULL || calculated == NULL) {
-               return -1;
+               return (unsigned)-1;
        }
        (void) memset(&osig, 0x0, sizeof(osig));
        (void) memset(&odsa, 0x0, sizeof(odsa));
diff -r 5223e00a65f4 -r 8d9d5922b7d6 crypto/external/bsd/netpgp/lib/verify/Makefile
--- a/crypto/external/bsd/netpgp/lib/verify/Makefile    Sat Aug 27 08:57:23 2022 +0000
+++ b/crypto/external/bsd/netpgp/lib/verify/Makefile    Sat Aug 27 08:58:31 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2020/05/03 21:46:37 christos Exp $
+# $NetBSD: Makefile,v 1.14 2022/08/27 08:58:32 rillig Exp $
 
 LIB=netpgpverify
 SRCS+=b64.c
@@ -30,6 +30,10 @@
 COPTS+=                        ${${ACTIVE_CC} == "gcc":? -Wno-implicit-fallthrough :}
 COPTS.libverify.c+=    ${GCC_NO_FORMAT_TRUNCATION}
 
+LINTFLAGS.bzlib.c+=    -X 161  # constant in conditional context
+LINTFLAGS.bzlib.c+=    -X 220  # fallthrough on case statement
+LINTFLAGS.zlib.c+=     -X 220  # fallthrough on case statement
+
 LDFLAGS+=-Wl,--version-script=${.CURDIR}/verify.map
 
 .include <bsd.lib.mk>



Home | Main Index | Thread Index | Old Index