Here's a small patch to remove a few 'comparison between signed and
unsigned' in crypto/bn/bn_lib.c, obtained by compiling openssl 0.9.4 with
gcc -W -Wall.
Brian
----------------------
--- bn_lib.c.old Fri Aug 20 15:59:12 1999
+++ bn_lib.c Fri Aug 20 15:57:03 1999
@@ -84,28 +84,28 @@
{
if (mult >= 0)
{
- if (mult > (sizeof(int)*8)-1)
+ if ((unsigned int)mult > (sizeof(int)*8)-1)
mult=sizeof(int)*8-1;
bn_limit_bits=mult;
bn_limit_num=1<<mult;
}
if (high >= 0)
{
- if (high > (sizeof(int)*8)-1)
+ if ((unsigned int)high > (sizeof(int)*8)-1)
high=sizeof(int)*8-1;
bn_limit_bits_high=high;
bn_limit_num_high=1<<high;
}
if (low >= 0)
{
- if (low > (sizeof(int)*8)-1)
+ if ((unsigned int)low > (sizeof(int)*8)-1)
low=sizeof(int)*8-1;
bn_limit_bits_low=low;
bn_limit_num_low=1<<low;
}
if (mont >= 0)
{
- if (mont > (sizeof(int)*8)-1)
+ if ((unsigned int)mont > (sizeof(int)*8)-1)
mont=sizeof(int)*8-1;
bn_limit_bits_mont=mont;
bn_limit_num_mont=1<<mont;
@@ -551,7 +551,7 @@
BN_ULONG ret=0;
n=BN_num_bytes(a);
- if (n > sizeof(BN_ULONG))
+ if ((unsigned int)n > sizeof(BN_ULONG))
return(BN_MASK2);
for (i=a->top-1; i>=0; i--)
{
@@ -569,7 +569,7 @@
int BN_set_word(BIGNUM *a, BN_ULONG w)
{
int i,n;
- if (bn_expand(a,sizeof(BN_ULONG)*8) == NULL) return(0);
+ if (bn_expand(a,(int)sizeof(BN_ULONG)*8) == NULL) return(0);
n=sizeof(BN_ULONG)/BN_BYTES;
a->neg=0;
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]