diff options
author | Geoff Thorpe <geoff@openssl.org> | 2003-10-29 20:24:15 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2003-10-29 20:24:15 +0000 |
commit | 27545970134d703ed96027aac9b67eced124eec3 (patch) | |
tree | 2f878acf303cc26e3b6db6a0ec25c10c91e3d32d /crypto/asn1/a_int.c | |
parent | 2ce90b9b7481381dff584726d84345a0260ca4d1 (diff) | |
download | openssl-27545970134d703ed96027aac9b67eced124eec3.tar.gz |
A general spring-cleaning (in autumn) to fix up signed/unsigned warnings.
I have tried to convert 'len' type variable declarations to unsigned as a
means to address these warnings when appropriate, but when in doubt I have
used casts in the comparisons instead. The better solution (that would get
us all lynched by API users) would be to go through and convert all the
function prototypes and structure definitions to use unsigned variables
except when signed is necessary. The proliferation of (signed) "int" for
strictly non-negative uses is unfortunate.
Diffstat (limited to 'crypto/asn1/a_int.c')
-rw-r--r-- | crypto/asn1/a_int.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index 78402cd985..4bb300c20b 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -313,12 +313,13 @@ err: int ASN1_INTEGER_set(ASN1_INTEGER *a, long v) { - int i,j,k; + int j,k; + unsigned int i; unsigned char buf[sizeof(long)+1]; long d; a->type=V_ASN1_INTEGER; - if (a->length < (sizeof(long)+1)) + if (a->length < (int)(sizeof(long)+1)) { if (a->data != NULL) OPENSSL_free(a->data); @@ -362,7 +363,7 @@ long ASN1_INTEGER_get(ASN1_INTEGER *a) else if (i != V_ASN1_INTEGER) return -1; - if (a->length > sizeof(long)) + if (a->length > (int)sizeof(long)) { /* hmm... a bit ugly */ return(0xffffffffL); |