mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 11:17:29 +02:00
Implement peer review feedback
Fix items that were missed from peer review Remove dead code Add ret capture of return from XVSNPRINTF
This commit is contained in:
@ -4577,8 +4577,6 @@ static void bench_rsa_helper(int doAsync, RsaKey rsaKey[BENCH_MAX_PENDING],
|
|||||||
/* MDK5 compiler regard this as a executable statement, and does not allow declarations after the line. */
|
/* MDK5 compiler regard this as a executable statement, and does not allow declarations after the line. */
|
||||||
DECLARE_ARRAY_DYNAMIC_DEC(enc, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT);
|
DECLARE_ARRAY_DYNAMIC_DEC(enc, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT);
|
||||||
#else
|
#else
|
||||||
int idxenc;
|
|
||||||
int inner_idx_enc;
|
|
||||||
byte* enc[BENCH_MAX_PENDING];
|
byte* enc[BENCH_MAX_PENDING];
|
||||||
#endif
|
#endif
|
||||||
#if !defined(WOLFSSL_RSA_VERIFY_INLINE) && !defined(WOLFSSL_RSA_PUBLIC_ONLY)
|
#if !defined(WOLFSSL_RSA_VERIFY_INLINE) && !defined(WOLFSSL_RSA_PUBLIC_ONLY)
|
||||||
@ -4586,8 +4584,6 @@ static void bench_rsa_helper(int doAsync, RsaKey rsaKey[BENCH_MAX_PENDING],
|
|||||||
/* MDK5 compiler regard this as a executable statement, and does not allow declarations after the line. */
|
/* MDK5 compiler regard this as a executable statement, and does not allow declarations after the line. */
|
||||||
DECLARE_ARRAY_DYNAMIC_DEC(out, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT);
|
DECLARE_ARRAY_DYNAMIC_DEC(out, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT);
|
||||||
#else
|
#else
|
||||||
int idxout;
|
|
||||||
int inner_idx_out;
|
|
||||||
byte* out[BENCH_MAX_PENDING];
|
byte* out[BENCH_MAX_PENDING];
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
|
@ -441,11 +441,7 @@ int wc_ReadDirFirst(ReadDirCtx* ctx, const char* path, char** name)
|
|||||||
XSTRNCPY(ctx->name, path, MAX_FILENAME_SZ - 3);
|
XSTRNCPY(ctx->name, path, MAX_FILENAME_SZ - 3);
|
||||||
XSTRNCPY(ctx->name + pathLen, "\\*", MAX_FILENAME_SZ - pathLen);
|
XSTRNCPY(ctx->name + pathLen, "\\*", MAX_FILENAME_SZ - pathLen);
|
||||||
|
|
||||||
#ifdef _WIN32_WCE
|
|
||||||
ctx->hFind = FindFirstFileA((LPCWSTR) ctx->name, &ctx->FindFileData);
|
|
||||||
#else
|
|
||||||
ctx->hFind = FindFirstFileA(ctx->name, &ctx->FindFileData);
|
ctx->hFind = FindFirstFileA(ctx->name, &ctx->FindFileData);
|
||||||
#endif
|
|
||||||
if (ctx->hFind == INVALID_HANDLE_VALUE) {
|
if (ctx->hFind == INVALID_HANDLE_VALUE) {
|
||||||
WOLFSSL_MSG("FindFirstFile for path verify locations failed");
|
WOLFSSL_MSG("FindFirstFile for path verify locations failed");
|
||||||
return BAD_PATH_ERROR;
|
return BAD_PATH_ERROR;
|
||||||
|
@ -556,17 +556,17 @@ decouple library dependencies with standard string, memory and so on.
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((int)n <= 0) return -1;
|
if ((int)n <= 0) return -1;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
|
|
||||||
ret = vsnprintf(s, n, format, ap);
|
ret = XVSNPRINTF(s, n, format, ap);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#define XSNPRINTF _xsnprintf_
|
#define XSNPRINTF _xsnprintf_
|
||||||
@ -597,11 +597,7 @@ decouple library dependencies with standard string, memory and so on.
|
|||||||
|
|
||||||
if ((int)bufsize <= 0) return -1;
|
if ((int)bufsize <= 0) return -1;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
#ifndef _WIN32_WCE
|
ret = XVSNPRINTF(buffer, bufsize, format, ap);
|
||||||
ret = vsnprintf(buffer, bufsize, format, ap);
|
|
||||||
#else
|
|
||||||
ret = _vsnprintf(buffer, bufsize, format, ap);
|
|
||||||
#endif
|
|
||||||
if (ret >= (int)bufsize)
|
if (ret >= (int)bufsize)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
@ -631,6 +631,7 @@ WOLFSSL_API int wolfCrypt_Cleanup(void);
|
|||||||
#define XSEEK_END SEEK_END
|
#define XSEEK_END SEEK_END
|
||||||
#define XBADFILE NULL
|
#define XBADFILE NULL
|
||||||
#define XFGETS fgets
|
#define XFGETS fgets
|
||||||
|
#define XVSNPRINTF _vsnprintf
|
||||||
|
|
||||||
#elif defined(FUSION_RTOS)
|
#elif defined(FUSION_RTOS)
|
||||||
#include <fclstdio.h>
|
#include <fclstdio.h>
|
||||||
@ -883,7 +884,8 @@ WOLFSSL_API int wolfCrypt_Cleanup(void);
|
|||||||
time_t windows_time(time_t* timer);
|
time_t windows_time(time_t* timer);
|
||||||
|
|
||||||
#define FindNextFileA(h, d) FindNextFile(h, (LPWIN32_FIND_DATAW) d)
|
#define FindNextFileA(h, d) FindNextFile(h, (LPWIN32_FIND_DATAW) d)
|
||||||
#define FindFirstFileA(fn, d) FindFirstFile(fn, (LPWIN32_FIND_DATAW) d)
|
#define FindFirstFileA(fn, d) FindFirstFile((LPCWSTR) fn, \
|
||||||
|
(LPWIN32_FIND_DATAW) d)
|
||||||
#define XTIME(t1) windows_time((t1))
|
#define XTIME(t1) windows_time((t1))
|
||||||
#define WOLFSSL_GMTIME
|
#define WOLFSSL_GMTIME
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user