clean up GCC and VS build warnings

This commit is contained in:
John Safranek
2015-08-14 15:06:12 -07:00
parent 09b2da799f
commit 4fb0519b37
3 changed files with 16 additions and 10 deletions

View File

@@ -7422,8 +7422,9 @@ int SendFinished(WOLFSSL* ssl)
#ifndef NO_CERTS #ifndef NO_CERTS
int SendCertificate(WOLFSSL* ssl) int SendCertificate(WOLFSSL* ssl)
{ {
int length, ret = 0; int ret = 0;
word32 certSz, certChainSz, headerSz, listSz, maxFragment, payloadSz; word32 certSz, certChainSz, headerSz, listSz, payloadSz;
word32 length, maxFragment;
if (ssl->options.usingPSK_cipher || ssl->options.usingAnon_cipher) if (ssl->options.usingPSK_cipher || ssl->options.usingAnon_cipher)
return 0; /* not needed */ return 0; /* not needed */
@@ -7448,6 +7449,8 @@ int SendCertificate(WOLFSSL* ssl)
length += certChainSz; length += certChainSz;
listSz += certChainSz; listSz += certChainSz;
} }
else
certChainSz = 0;
} }
payloadSz = length; payloadSz = length;
@@ -7472,7 +7475,7 @@ int SendCertificate(WOLFSSL* ssl)
while (length > 0 && ret == 0) { while (length > 0 && ret == 0) {
byte* output = NULL; byte* output = NULL;
word32 fragSz; /* How much of the certificate data are we copying? */ word32 fragSz = 0;
word32 i = RECORD_HEADER_SZ; word32 i = RECORD_HEADER_SZ;
int sendSz = RECORD_HEADER_SZ; int sendSz = RECORD_HEADER_SZ;

View File

@@ -97,17 +97,15 @@
#endif /* WOLFSSSL_HAVE_MIN */ #endif /* WOLFSSSL_HAVE_MIN */
#ifndef WOLFSSL_HAVE_MAX #if defined(WOLFSSL_DTLS) && !defined(WOLFSSL_HAVE_MAX)
#define WOLFSSL_HAVE_MAX #define WOLFSSL_HAVE_MAX
#ifdef WOLFSSL_DTLS
static INLINE word32 max(word32 a, word32 b) static INLINE word32 max(word32 a, word32 b)
{ {
return a > b ? a : b; return a > b ? a : b;
} }
#endif /* WOLFSSL_DTLS */
#endif /* WOLFSSL_HAVE_MAX */ #endif /* WOLFSSL_DTLS && !WOLFSSL_HAVE_MAX */
#ifndef WOLFSSL_LEANPSK #ifndef WOLFSSL_LEANPSK

View File

@@ -194,9 +194,14 @@ WOLFSSL_LOCAL int UnLockMutex(wolfSSL_Mutex*);
/* Windows API defines its own min() macro. */ /* Windows API defines its own min() macro. */
#if defined(USE_WINDOWS_API) && defined(min) #if defined(USE_WINDOWS_API)
#define WOLFSSL_HAVE_MIN #ifdef min
#endif #define WOLFSSL_HAVE_MIN
#endif /* min */
#ifdef max
#define WOLFSSL_HAVE_MAX
#endif /* max */
#endif /* USE_WINDOWS_API */
#ifdef __cplusplus #ifdef __cplusplus