fix codebase for -Wvla -Wdeclaration-after-statement; fix some whitespace.

This commit is contained in:
Daniel Pouzzner
2022-04-01 14:44:10 -05:00
parent bd0e222fec
commit ae3996fd0e
6 changed files with 300 additions and 239 deletions

View File

@ -10938,7 +10938,6 @@ static int ProcessCSR(WOLFSSL* ssl, byte* input, word32* inOutIdx,
{ {
int ret = 0; int ret = 0;
OcspRequest* request; OcspRequest* request;
WOLFSSL_ENTER("ProcessCSR");
#ifdef WOLFSSL_SMALL_STACK #ifdef WOLFSSL_SMALL_STACK
CertStatus* status; CertStatus* status;
@ -10950,6 +10949,8 @@ static int ProcessCSR(WOLFSSL* ssl, byte* input, word32* inOutIdx,
OcspResponse response[1]; OcspResponse response[1];
#endif #endif
WOLFSSL_ENTER("ProcessCSR");
do { do {
#ifdef HAVE_CERTIFICATE_STATUS_REQUEST #ifdef HAVE_CERTIFICATE_STATUS_REQUEST
if (ssl->status_request) { if (ssl->status_request) {

View File

@ -55210,7 +55210,7 @@ int wolfSSL_BN_rand(WOLFSSL_BIGNUM* bn, int bits, int top, int bottom)
} }
else if (top > 0) { else if (top > 0) {
if (mp_set_bit((mp_int*)bn->internal, bits - 1) if (mp_set_bit((mp_int*)bn->internal, bits - 1)
!= MP_OKAY || != MP_OKAY ||
mp_set_bit((mp_int*)bn->internal, bits - 2) mp_set_bit((mp_int*)bn->internal, bits - 2)
!= MP_OKAY) { != MP_OKAY) {
WOLFSSL_MSG("Failed to set top 2 bits"); WOLFSSL_MSG("Failed to set top 2 bits");

File diff suppressed because it is too large Load Diff

View File

@ -4787,7 +4787,7 @@ static WC_INLINE void wc_ecc_reset(ecc_key* key)
* Note this function is local to the file because of the argument type * Note this function is local to the file because of the argument type
* ecc_curve_spec. Having this argument allows for not having to load the * ecc_curve_spec. Having this argument allows for not having to load the
* curve type multiple times when generating a key with wc_ecc_make_key(). * curve type multiple times when generating a key with wc_ecc_make_key().
* For async the results are placed directly into pubOut, so this function * For async the results are placed directly into pubOut, so this function
* does not need to be called again * does not need to be called again
* *
* returns MP_OKAY on success * returns MP_OKAY on success

View File

@ -3457,10 +3457,11 @@ int wolfSSL_EVP_PBE_scrypt(const char *pass, size_t passlen,
word64 N, word64 r, word64 p, word64 N, word64 r, word64 p,
word64 maxmem, unsigned char *key, size_t keylen) word64 maxmem, unsigned char *key, size_t keylen)
{ {
(void)maxmem;
int ret; int ret;
int exp = 0; int exp = 0;
(void)maxmem;
WOLFSSL_ENTER("wolfSSL_EVP_PBE_scrypt"); WOLFSSL_ENTER("wolfSSL_EVP_PBE_scrypt");
if (r > INT32_MAX || p > INT32_MAX) { if (r > INT32_MAX || p > INT32_MAX) {

View File

@ -552,7 +552,7 @@ decouple library dependencies with standard string, memory and so on.
#define WC_DECLARE_ARRAY_DYNAMIC_DEC(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \ #define WC_DECLARE_ARRAY_DYNAMIC_DEC(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
VAR_TYPE* VAR_NAME[VAR_ITEMS]; \ VAR_TYPE* VAR_NAME[VAR_ITEMS]; \
int idx##VAR_NAME, inner_idx_##VAR_NAME; int idx##VAR_NAME, inner_idx_##VAR_NAME
#define WC_DECLARE_ARRAY_DYNAMIC_EXE(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \ #define WC_DECLARE_ARRAY_DYNAMIC_EXE(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
for (idx##VAR_NAME=0; idx##VAR_NAME<(VAR_ITEMS); idx##VAR_NAME++) { \ for (idx##VAR_NAME=0; idx##VAR_NAME<(VAR_ITEMS); idx##VAR_NAME++) { \
(VAR_NAME)[idx##VAR_NAME] = (VAR_TYPE*)XMALLOC(VAR_SIZE, (HEAP), DYNAMIC_TYPE_TMP_BUFFER); \ (VAR_NAME)[idx##VAR_NAME] = (VAR_TYPE*)XMALLOC(VAR_SIZE, (HEAP), DYNAMIC_TYPE_TMP_BUFFER); \