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.
This commit is contained in:
Geoff Thorpe
2003-10-29 20:24:15 +00:00
parent 2ce90b9b74
commit 2754597013
37 changed files with 97 additions and 82 deletions

View File

@@ -85,14 +85,15 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
{
int i=0,l;
int i=0;
unsigned int l;
if (type != NULL)
{
l=EVP_CIPHER_CTX_iv_length(c);
OPENSSL_assert(l <= sizeof c->iv);
OPENSSL_assert(l <= sizeof(c->iv));
i=ASN1_TYPE_get_octetstring(type,c->oiv,l);
if (i != l)
if (i != (int)l)
return(-1);
else if (i > 0)
memcpy(c->iv,c->oiv,l);
@@ -102,12 +103,13 @@ int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
{
int i=0,j;
int i=0;
unsigned int j;
if (type != NULL)
{
j=EVP_CIPHER_CTX_iv_length(c);
OPENSSL_assert(j <= sizeof c->iv);
OPENSSL_assert(j <= sizeof(c->iv));
i=ASN1_TYPE_set_octetstring(type,c->oiv,j);
}
return(i);