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/dist/src/lib fix some more amd64 ...



details:   https://anonhg.NetBSD.org/src/rev/54cb302a0946
branches:  trunk
changeset: 757116:54cb302a0946
user:      agc <agc%NetBSD.org@localhost>
date:      Sun Aug 15 16:10:56 2010 +0000

description:
fix some more amd64 lint

diffstat:

 crypto/external/bsd/netpgp/dist/src/lib/bufgap.c       |   6 +-
 crypto/external/bsd/netpgp/dist/src/lib/compress.c     |   5 +-
 crypto/external/bsd/netpgp/dist/src/lib/keyring.c      |  12 ++--
 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c       |   6 +-
 crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c |  47 ++++++++---------
 crypto/external/bsd/netpgp/dist/src/lib/signature.c    |  10 +-
 crypto/external/bsd/netpgp/dist/src/lib/validate.c     |   8 +-
 crypto/external/bsd/netpgp/dist/src/lib/writer.c       |  10 +-
 8 files changed, 53 insertions(+), 51 deletions(-)

diffs (truncated from 406 to 300 lines):

diff -r 123eadbb0182 -r 54cb302a0946 crypto/external/bsd/netpgp/dist/src/lib/bufgap.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/bufgap.c  Sun Aug 15 09:26:57 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/bufgap.c  Sun Aug 15 16:10:56 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bufgap.c,v 1.3 2009/12/14 23:29:56 agc Exp $ */
+/* $NetBSD: bufgap.c,v 1.4 2010/08/15 16:10:56 agc Exp $ */
 
 /*-
  * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -117,7 +117,7 @@
        char    *cp;
 
        if (n < 0) {
-               n = strlen(s);
+               n = (int)strlen(s);
        }
        NEWARRAY(char, cp, n + 1, "strnsave", return NULL);
        (void) memcpy(cp, s, (size_t)n);
@@ -413,7 +413,7 @@
        int     i;
 
        if (n < 0) {
-               n = strlen(s);
+               n = (int)strlen(s);
        }
        for (i = 0 ; i < n ; i += rlen) {
                if (bp->bbc + bp->abc == bp->size) {
diff -r 123eadbb0182 -r 54cb302a0946 crypto/external/bsd/netpgp/dist/src/lib/compress.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/compress.c        Sun Aug 15 09:26:57 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/compress.c        Sun Aug 15 16:10:56 2010 +0000
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: compress.c,v 1.16 2010/08/15 07:52:26 agc Exp $");
+__RCSID("$NetBSD: compress.c,v 1.17 2010/08/15 16:10:56 agc Exp $");
 #endif
 
 #ifdef HAVE_ZLIB_H
@@ -346,10 +346,12 @@
 
        switch (type) {
        case OPS_C_ZIP:
+               /* LINTED */ /* this is a lint problem in zlib.h header */
                ret = (int)inflateInit2(&z.zstream, -15);
                break;
 
        case OPS_C_ZLIB:
+               /* LINTED */ /* this is a lint problem in zlib.h header */
                ret = (int)inflateInit(&z.zstream);
                break;
 
@@ -434,6 +436,7 @@
 
        /* all other fields set to zero by use of calloc */
 
+       /* LINTED */ /* this is a lint problem in zlib.h header */
        if ((int)deflateInit(&zip->stream, level) != Z_OK) {
                (void) fprintf(stderr, "__ops_writez: can't initialise\n");
                return 0;
diff -r 123eadbb0182 -r 54cb302a0946 crypto/external/bsd/netpgp/dist/src/lib/keyring.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Sun Aug 15 09:26:57 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/keyring.c Sun Aug 15 16:10:56 2010 +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.42 2010/08/15 07:52:26 agc Exp $");
+__RCSID("$NetBSD: keyring.c,v 1.43 2010/08/15 16:10:56 agc Exp $");
 #endif
 
 #ifdef HAVE_FCNTL_H
@@ -858,22 +858,22 @@
        size_t                   j;
        int                      i;
 
-       for (i = j = 0 ; j < len && userid[i] && userid[i + 1] ; i += 2, j++) {
+       for (i = 0, j = 0 ; j < len && userid[i] && userid[i + 1] ; i += 2, j++) {
                if ((hi = strchr(uppers, userid[i])) == NULL) {
                        if ((hi = strchr(lowers, userid[i])) == NULL) {
                                break;
                        }
-                       hichar = (hi - lowers);
+                       hichar = (uint8_t)(hi - lowers);
                } else {
-                       hichar = (hi - uppers);
+                       hichar = (uint8_t)(hi - uppers);
                }
                if ((lo = strchr(uppers, userid[i + 1])) == NULL) {
                        if ((lo = strchr(lowers, userid[i + 1])) == NULL) {
                                break;
                        }
-                       lochar = (lo - lowers);
+                       lochar = (uint8_t)(lo - lowers);
                } else {
-                       lochar = (lo - uppers);
+                       lochar = (uint8_t)(lo - uppers);
                }
                keyid[j] = (hichar << 4) | (lochar);
        }
diff -r 123eadbb0182 -r 54cb302a0946 crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Sun Aug 15 09:26:57 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/netpgp.c  Sun Aug 15 16:10:56 2010 +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.68 2010/08/15 07:52:27 agc Exp $");
+__RCSID("$NetBSD: netpgp.c,v 1.69 2010/08/15 16:10:56 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -367,7 +367,7 @@
        if (s == NULL) {
                return 0;
        }
-       now = strtoull(s, NULL, 10);
+       now = (uint64_t)strtoull(s, NULL, 10);
        if ((mult = strchr("hdwmy", s[strlen(s) - 1])) != NULL) {
                switch(*mult) {
                case 'h':
@@ -459,7 +459,7 @@
                        (void) fprintf(io->errs, "isarmoured: can't open '%s'\n", f);
                        return 0;
                }
-               if (fgets(buf, sizeof(buf), fp) != NULL) {
+               if (fgets(buf, (int)sizeof(buf), fp) != NULL) {
                        armoured = (strncmp(buf, text, strlen(text)) == 0);
                }
                (void) fclose(fp);
diff -r 123eadbb0182 -r 54cb302a0946 crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c    Sun Aug 15 09:26:57 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c    Sun Aug 15 16:10:56 2010 +0000
@@ -58,7 +58,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: packet-parse.c,v 1.39 2010/08/13 18:29:40 agc Exp $");
+__RCSID("$NetBSD: packet-parse.c,v 1.40 2010/08/15 16:10:56 agc Exp $");
 #endif
 
 #ifdef HAVE_OPENSSL_CAST_H
@@ -254,7 +254,7 @@
                if (readinfo->alength + n > readinfo->asize) {
                        uint8_t *temp;
 
-                       readinfo->asize = (readinfo->asize * 2) + n;
+                       readinfo->asize = (readinfo->asize * 2) + (unsigned)n;
                        temp = realloc(readinfo->accumulated, readinfo->asize);
                        if (temp == NULL) {
                                (void) fprintf(stderr,
@@ -271,11 +271,11 @@
                                n);
        }
        /* we track length anyway, because it is used for packet offsets */
-       readinfo->alength += n;
+       readinfo->alength += (unsigned)n;
        /* and also the position */
-       readinfo->position += n;
-
-       return n;
+       readinfo->position += (unsigned)n;
+
+       return (int)n;
 }
 
 int 
@@ -415,9 +415,9 @@
                OPS_ERROR(errors, OPS_E_R_READ_FAILED, "Read failed");
                return 0;
        }
-       region->last_read = r;
+       region->last_read = (unsigned)r;
        do {
-               region->readc += r;
+               region->readc += (unsigned)r;
                if (region->parent && region->length > region->parent->length) {
                        (void) fprintf(stderr,
                                "ops_limited_read: bad length\n");
@@ -1528,7 +1528,7 @@
                        (void) fprintf(stderr, "parse_one_sig_subpacket: bad alloc\n");
                        return 0;
                }
-               if (!limread(pkt.u.ss_raw.raw, pkt.u.ss_raw.length,
+               if (!limread(pkt.u.ss_raw.raw, (unsigned)pkt.u.ss_raw.length,
                                &subregion, stream)) {
                        return 0;
                }
@@ -1643,12 +1643,12 @@
                        return 0;
                }
                if (!limread_data(&pkt.u.ss_notation.name,
-                               pkt.u.ss_notation.name.len,
+                               (unsigned)pkt.u.ss_notation.name.len,
                                &subregion, stream)) {
                        return 0;
                }
                if (!limread_data(&pkt.u.ss_notation.value,
-                          pkt.u.ss_notation.value.len,
+                          (unsigned)pkt.u.ss_notation.value.len,
                           &subregion, stream)) {
                        return 0;
                }
@@ -2125,7 +2125,8 @@
        pkt.u.one_pass_sig.key_alg = (__ops_pubkey_alg_t)c;
 
        if (!limread(pkt.u.one_pass_sig.keyid,
-                         sizeof(pkt.u.one_pass_sig.keyid), region, stream)) {
+                         (unsigned)sizeof(pkt.u.one_pass_sig.keyid),
+                         region, stream)) {
                return 0;
        }
 
@@ -2163,7 +2164,7 @@
        size_t          n;
 
        for (n = 0; n < stream->hashc; ++n) {
-               stream->hashes[n].hash.add(&stream->hashes[n].hash, data, length);
+               stream->hashes[n].hash.add(&stream->hashes[n].hash, data, (unsigned)length);
        }
 }
 
@@ -2365,8 +2366,8 @@
        if (crypted) {
                __ops_packet_t  seckey;
                __ops_hash_t    hashes[(OPS_MAX_KEY_SIZE + OPS_MIN_HASH_SIZE - 1) / OPS_MIN_HASH_SIZE];
+               unsigned        passlen;
                uint8_t         key[OPS_MAX_KEY_SIZE + OPS_MAX_HASH_SIZE];
-               size_t          passlen;
                char           *passphrase;
                int             hashsize;
                int             keysize;
@@ -2447,7 +2448,7 @@
                                /* FALLTHROUGH */
                        case OPS_S2KS_SIMPLE:
                                hashes[n].add(&hashes[n],
-                                       (uint8_t *) passphrase, passlen);
+                                       (uint8_t *)passphrase, (unsigned)passlen);
                                break;
 
                        case OPS_S2KS_ITERATED_AND_SALTED:
@@ -2668,7 +2669,7 @@
                return 0;
        }
        if (!limread(pkt.u.pk_sesskey.key_id,
-                         sizeof(pkt.u.pk_sesskey.key_id), region, stream)) {
+                         (unsigned)sizeof(pkt.u.pk_sesskey.key_id), region, stream)) {
                return 0;
        }
        if (__ops_get_debug_level(__FILE__)) {
@@ -2718,8 +2719,8 @@
                        &pkt);
                return 1;
        }
-       n = __ops_decrypt_decode_mpi(unencoded_m_buf, sizeof(unencoded_m_buf),
-                       enc_m, secret);
+       n = __ops_decrypt_decode_mpi(unencoded_m_buf,
+                       (unsigned)sizeof(unencoded_m_buf), enc_m, secret);
        if (n < 1) {
                ERRP(&stream->cbinfo, pkt, "decrypted message too short");
                return 0;
@@ -2797,11 +2798,9 @@
 
        decrypt = __ops_get_decrypt(stream);
        if (decrypt) {
-               uint8_t   buf[OPS_MAX_BLOCK_SIZE + 2] = "";
-               size_t          b = decrypt->blocksize;
-               /* __ops_packet_t pkt; */
-               __ops_region_t    encregion;
-
+               __ops_region_t  encregion;
+               unsigned        b = decrypt->blocksize;
+               uint8_t         buf[OPS_MAX_BLOCK_SIZE + 2] = "";
 
                __ops_reader_push_decrypt(stream, decrypt, region);
 
@@ -3057,7 +3056,7 @@
 
        case OPS_PTAG_CT_PUBLIC_KEY:
        case OPS_PTAG_CT_PUBLIC_SUBKEY:
-               ret = parse_pubkey(pkt.u.ptag.type, &region, stream);
+               ret = parse_pubkey((__ops_content_enum)pkt.u.ptag.type, &region, stream);
                break;
 
        case OPS_PTAG_CT_TRUST:
diff -r 123eadbb0182 -r 54cb302a0946 crypto/external/bsd/netpgp/dist/src/lib/signature.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/signature.c       Sun Aug 15 09:26:57 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/signature.c       Sun Aug 15 16:10:56 2010 +0000
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: signature.c,v 1.30 2010/08/15 07:52:27 agc Exp $");
+__RCSID("$NetBSD: signature.c,v 1.31 2010/08/15 16:10:56 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -834,13 +834,13 @@
 unsigned 
 __ops_add_time(__ops_create_sig_t *sig, int64_t when, const char *type)



Home | Main Index | Thread Index | Old Index