Lint and overlong.

This commit is contained in:
David Garske
2025-05-06 17:01:36 -07:00
parent 760178c7dc
commit 72bff7d01e
2 changed files with 25 additions and 15 deletions

View File

@ -1221,7 +1221,8 @@ static int InitSha256(wc_Sha256* sha256)
sha256->digest[i] += S[i];
}
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SMALL_STACK_CACHE) && !defined(WOLFSSL_NO_MALLOC)
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_SMALL_STACK_CACHE) &&\
!defined(WOLFSSL_NO_MALLOC)
ForceZero(W, sizeof(word32) * WC_SHA256_BLOCK_SIZE);
XFREE(W, NULL, DYNAMIC_TYPE_TMP_BUFFER);
#endif

View File

@ -479,9 +479,12 @@ enum {
#include <wolfssl/wolfcrypt/port/intel/quickassist_mem.h>
#undef USE_WOLFSSL_MEMORY
#ifdef WOLFSSL_DEBUG_MEMORY
#define XMALLOC(s, h, t) IntelQaMalloc((s), (h), (t), __func__, __LINE__)
#define XFREE(p, h, t) IntelQaFree((p), (h), (t), __func__, __LINE__)
#define XREALLOC(p, n, h, t) IntelQaRealloc((p), (n), (h), (t), __func__, __LINE__)
#define XMALLOC(s, h, t) \
IntelQaMalloc((s), (h), (t), __func__, __LINE__)
#define XFREE(p, h, t) \
IntelQaFree((p), (h), (t), __func__, __LINE__)
#define XREALLOC(p, n, h, t) \
IntelQaRealloc((p), (n), (h), (t), __func__, __LINE__)
#else
#define XMALLOC(s, h, t) IntelQaMalloc((s), (h), (t))
#define XFREE(p, h, t) IntelQaFree((p), (h), (t))
@ -491,13 +494,20 @@ enum {
#include <wolfssl/wolfcrypt/port/intel/quickassist_sync.h>
#undef USE_WOLFSSL_MEMORY
#ifdef WOLFSSL_DEBUG_MEMORY
#define XMALLOC(s, h, t) wc_CryptoCb_IntelQaMalloc((s), (h), (t), __func__, __LINE__)
#define XFREE(p, h, t) wc_CryptoCb_IntelQaFree((p), (h), (t), __func__, __LINE__)
#define XREALLOC(p, n, h, t) wc_CryptoCb_IntelQaRealloc((p), (n), (h), (t), __func__, __LINE__)
#define XMALLOC(s, h, t) \
wc_CryptoCb_IntelQaMalloc((s), (h), (t), __func__, __LINE__)
#define XFREE(p, h, t) \
wc_CryptoCb_IntelQaFree((p), (h), (t), __func__, __LINE__)
#define XREALLOC(p, n, h, t) \
wc_CryptoCb_IntelQaRealloc((p), (n), (h), (t), __func__, \
__LINE__)
#else
#define XMALLOC(s, h, t) wc_CryptoCb_IntelQaMalloc((s), (h), (t))
#define XFREE(p, h, t) wc_CryptoCb_IntelQaFree((p), (h), (t))
#define XREALLOC(p, n, h, t) wc_CryptoCb_IntelQaRealloc((p), (n), (h), (t))
#define XMALLOC(s, h, t) \
wc_CryptoCb_IntelQaMalloc((s), (h), (t))
#define XFREE(p, h, t) \
wc_CryptoCb_IntelQaFree((p), (h), (t))
#define XREALLOC(p, n, h, t) \
wc_CryptoCb_IntelQaRealloc((p), (n), (h), (t))
#endif /* WOLFSSL_DEBUG_MEMORY */
#endif
#elif defined(XMALLOC_USER)
@ -508,7 +518,8 @@ enum {
extern void XFREE(void *p, void* heap, int type);
#elif defined(WOLFSSL_MEMORY_LOG)
#define XMALLOC(n, h, t) xmalloc(n, h, t, __func__, __FILE__, __LINE__)
#define XREALLOC(p, n, h, t) xrealloc(p, n, h, t, __func__, __FILE__, __LINE__)
#define XREALLOC(p, n, h, t) \
xrealloc(p, n, h, t, __func__, __FILE__, __LINE__)
#define XFREE(p, h, t) xfree(p, h, t, __func__, __FILE__, __LINE__)
/* prototypes for user heap override functions */
@ -741,11 +752,9 @@ enum {
#define WC_FREE_VAR(VAR_NAME, HEAP) WC_DO_NOTHING \
/* nothing to free, its stack */
#define WC_DECLARE_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
VAR_TYPE VAR_NAME[VAR_ITEMS][(VAR_SIZE) / sizeof(VAR_TYPE)] \
/* // NOLINT(bugprone-sizeof-expression) */
VAR_TYPE VAR_NAME[VAR_ITEMS][(VAR_SIZE) / sizeof(VAR_TYPE)] /* // NOLINT(bugprone-sizeof-expression) */
#define WC_ARRAY_ARG(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE) \
VAR_TYPE VAR_NAME[VAR_ITEMS][(VAR_SIZE) / sizeof(VAR_TYPE)] \
/* // NOLINT(bugprone-sizeof-expression) */
VAR_TYPE VAR_NAME[VAR_ITEMS][(VAR_SIZE) / sizeof(VAR_TYPE)] /* // NOLINT(bugprone-sizeof-expression) */
#define WC_ALLOC_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
WC_DO_NOTHING
#define WC_CALLOC_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \