Commit 8215e7a9 authored by Nils Larsch's avatar Nils Larsch
Browse files

fix warnings when building openssl with the following compiler options:

        -Wmissing-prototypes -Wcomment -Wformat -Wimplicit -Wmain -Wmultichar
        -Wswitch -Wshadow -Wtrigraphs -Werror -Wchar-subscripts
        -Wstrict-prototypes -Wreturn-type -Wpointer-arith  -W -Wunused
        -Wno-unused-parameter -Wuninitialized
parent f7622f86
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ static int do_buf(unsigned char *buf, int buflen,

static int do_hex_dump(char_io *io_ch, void *arg, unsigned char *buf, int buflen)
{
	const static char hexdig[] = "0123456789ABCDEF";
	static const char hexdig[] = "0123456789ABCDEF";
	unsigned char *p, *q;
	char hextmp[2];
	if(arg) {
@@ -279,7 +279,7 @@ static int do_dump(unsigned long lflags, char_io *io_ch, void *arg, ASN1_STRING
 * otherwise it is the number of bytes per character
 */

const static signed char tag2nbyte[] = {
static const signed char tag2nbyte[] = {
	-1, -1, -1, -1, -1,	/* 0-4 */
	-1, -1, -1, -1, -1,	/* 5-9 */
	-1, -1, 0, -1,		/* 10-13 */
+1 −1
Original line number Diff line number Diff line
@@ -419,7 +419,7 @@ end:

const char *ASN1_tag2str(int tag)
{
	const static char *tag2str[] = {
	static const char *tag2str[] = {
	 "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING", /* 0-4 */
	 "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL", /* 5-9 */
	 "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>", 	    /* 10-13 */
+2 −2
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ void BF_encrypt(BF_LONG *data, const BF_KEY *key)
	{
#ifndef BF_PTR2
	register BF_LONG l,r;
    const register BF_LONG *p,*s;
	register const BF_LONG *p,*s;

	p=key->P;
	s= &(key->S[0]);
@@ -150,7 +150,7 @@ void BF_decrypt(BF_LONG *data, const BF_KEY *key)
	{
#ifndef BF_PTR2
	register BF_LONG l,r;
    const register BF_LONG *p,*s;
	register const BF_LONG *p,*s;

	p=key->P;
	s= &(key->S[0]);
+4 −2
Original line number Diff line number Diff line
@@ -699,9 +699,11 @@ int RAND_pseudo_bytes(unsigned char *buf,int num);
#define bn_check_top(a) \
	do { \
		const BIGNUM *_bnum2 = (a); \
		if (_bnum2 != NULL) { \
			assert((_bnum2->top == 0) || \
				(_bnum2->d[_bnum2->top - 1] != 0)); \
			bn_pollute(_bnum2); \
		} \
	} while(0)

#define bn_fix_top(a)		bn_check_top(a)
+3 −6
Original line number Diff line number Diff line
@@ -185,9 +185,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
	BN_ULONG d0,d1;
	int num_n,div_n;

	if (dv)
	bn_check_top(dv);
	if (rm)
	bn_check_top(rm);
	bn_check_top(num);
	bn_check_top(divisor);
@@ -394,7 +392,6 @@ X) -> 0x%08X\n",
	BN_CTX_end(ctx);
	return(1);
err:
	if (rm)
	bn_check_top(rm);
	BN_CTX_end(ctx);
	return(0);
Loading