From bcc177b23da889c335e2c2c6beefd14518af62b4 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 10 Jan 2019 16:25:09 -0800 Subject: [PATCH] Fixes for build warnings. --- tests/api.c | 2 +- wolfcrypt/src/memory.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/api.c b/tests/api.c index 745d40a3b..88c95ba8f 100644 --- a/tests/api.c +++ b/tests/api.c @@ -21364,7 +21364,7 @@ static void test_CheckCertSignature(void) { #if !defined(NO_CERTS) && defined(WOLFSSL_SMALL_CERT_VERIFY) WOLFSSL_CERT_MANAGER* cm = NULL; -#if !defined(NO_FILESYSTEM) +#if !defined(NO_FILESYSTEM) && (!defined(NO_RSA) || defined(HAVE_ECC)) FILE* fp; byte cert[4096]; int certSz; diff --git a/wolfcrypt/src/memory.c b/wolfcrypt/src/memory.c index e55fad202..0b4f7d96c 100644 --- a/wolfcrypt/src/memory.c +++ b/wolfcrypt/src/memory.c @@ -1012,7 +1012,7 @@ void *xmalloc(size_t n, void* heap, int type, const char* func, else p32 = malloc(n + sizeof(word32) * 4); - p32[0] = n; + p32[0] = (word32)n; p = (void*)(p32 + 4); fprintf(stderr, "Alloc: %p -> %u (%d) at %s:%s:%d\n", p, (word32)n, type, @@ -1042,7 +1042,7 @@ void *xrealloc(void *p, size_t n, void* heap, int type, const char* func, p32 = realloc(oldp32, n + sizeof(word32) * 4); if (p32 != NULL) { - p32[0] = n; + p32[0] = (word32)n; newp = (void*)(p32 + 4); fprintf(stderr, "Alloc: %p -> %u (%d) at %s:%s:%d\n", newp, (word32)n,