Fix compiler warnings on AIX, Linux, HP, and Solaris.

git-svn-id: svn://10.0.0.236/trunk@103369 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
relyea%netscape.com 2001-09-20 22:14:09 +00:00
parent b762194700
commit 0ffcdcfc2e
7 changed files with 18 additions and 16 deletions

View File

@ -32,7 +32,7 @@
* may use your version of this file under either the MPL or the
* GPL.
*
* $Id: alg2268.c,v 1.2 2001-01-05 22:37:46 mcgreer%netscape.com Exp $
* $Id: alg2268.c,v 1.3 2001-09-20 22:14:04 relyea%netscape.com Exp $
*/
@ -146,7 +146,9 @@ RC2_CreateContext(unsigned char *key, unsigned int len,
RC2Context *cx;
PRUint8 *L,*L2;
int i;
#if !defined(IS_LITTLE_ENDIAN)
PRUint16 tmpS;
#endif
PRUint8 tmpB;
if (!key || len == 0 || len > (sizeof cx->B) || efLen8 > (sizeof cx->B)) {

View File

@ -403,6 +403,7 @@ rc4_wordconv(RC4Context *cx, unsigned char *output,
/* If buffers are relatively misaligned, shift the bytes in inWord
* to be aligned to the output buffer.
*/
nextInWord = 0;
if (inOffset < outOffset) {
/* Have more bytes than needed, shift remainder into nextInWord */
nextInWord = inWord LSH 8*(inOffset + byteCount);
@ -423,10 +424,7 @@ rc4_wordconv(RC4Context *cx, unsigned char *output,
/* move to next word of output */
pOutWord++;
/* inWord has been consumed, but there may be bytes in nextInWord */
if (inOffset == outOffset)
inWord = 0;
else
inWord = nextInWord;
inWord = nextInWord;
} else {
/* output is word-aligned */
pOutWord = (WORD *)output;

View File

@ -35,7 +35,7 @@
* Diffie-Hellman parameter generation, key generation, and secret derivation.
* KEA secret generation and verification.
*
* $Id: dh.c,v 1.5 2000-09-29 02:10:24 mcgreer%netscape.com Exp $
* $Id: dh.c,v 1.6 2001-09-20 22:14:06 relyea%netscape.com Exp $
*/
#include "prerr.h"
@ -213,7 +213,7 @@ DH_Derive(SECItem *publicValue,
{
mp_int p, Xa, Yb, ZZ;
mp_err err = MP_OKAY;
unsigned int len, nb;
unsigned int len = 0, nb;
unsigned char *secret = NULL;
if (!publicValue || !prime || !privateValue || !derivedSecret) {
PORT_SetError(SEC_ERROR_INVALID_ARGS);
@ -278,7 +278,7 @@ KEA_Derive(SECItem *prime,
mp_int p, Y, R, r, x, t, u, w;
mp_err err;
unsigned char *secret = NULL;
unsigned int len, offset;
unsigned int len = 0, offset;
if (!prime || !public1 || !public2 || !private1 || !private2 ||
!derivedSecret) {
PORT_SetError(SEC_ERROR_INVALID_ARGS);

View File

@ -461,7 +461,9 @@ void
MD5_End(MD5Context *cx, unsigned char *digest,
unsigned int *digestLen, unsigned int maxDigestLen)
{
#ifndef IS_LITTLE_ENDIAN
PRUint32 tmp;
#endif
PRUint32 lowInput, highInput;
PRUint32 inBufIndex = cx->lsbInput & 63;

View File

@ -35,7 +35,7 @@
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the GPL.
*
* $Id: mpi.c,v 1.35 2001-06-18 19:54:21 wtc%netscape.com Exp $
* $Id: mpi.c,v 1.36 2001-09-20 22:14:09 relyea%netscape.com Exp $
*/
#include "mpi-priv.h"
@ -2295,8 +2295,8 @@ mp_err s_mp_invmod_even_m(const mp_int *a, const mp_int *m, mp_int *c)
mp_int oddPart, evenPart; /* parts to combine via CRT. */
mp_int C2, tmp1, tmp2;
static const mp_digit d1 = 1;
static const mp_int one = { MP_ZPOS, 1, 1, (mp_digit *)&d1 };
/*static const mp_digit d1 = 1; */
/*static const mp_int one = { MP_ZPOS, 1, 1, (mp_digit *)&d1 }; */
if ((res = s_mp_ispow2(m)) >= 0) {
k = res;
@ -3363,7 +3363,7 @@ mp_err s_mp_div_d(mp_int *mp, mp_digit d, mp_digit *r)
}
#else
{
mp_digit norm, p;
mp_digit p;
MP_CHECKOK( mp_init_copy(&rem, mp) );

View File

@ -35,7 +35,7 @@
/*
* RSA key generation, public key op, private key op.
*
* $Id: rsa.c,v 1.25 2001-04-12 20:23:42 nicolson%netscape.com Exp $
* $Id: rsa.c,v 1.26 2001-09-20 22:14:06 relyea%netscape.com Exp $
*/
#include "secerr.h"
@ -626,7 +626,7 @@ RSA_PrivateKeyOp(RSAPrivateKey *key,
{
unsigned int modLen;
unsigned int offset;
SECStatus rv;
SECStatus rv = SECSuccess;
mp_err err;
mp_int n, c, m;
mp_int f, g;

View File

@ -49,8 +49,8 @@ struct SHA1ContextStr {
#define SHA_MASK 0x00FF00FF
#if defined(IS_LITTLE_ENDIAN)
#define SHA_HTONL(x) (A = (x), A = A << 16 | A >> 16, \
(A & SHA_MASK) << 8 | (A >> 8) & SHA_MASK)
#define SHA_HTONL(x) (A = (x), A = (A << 16) | (A >> 16), \
((A & SHA_MASK) << 8) | ((A >> 8) & SHA_MASK))
#else
#define SHA_HTONL(x) (x)
#endif