From 1fd62456007159265de2605b83a3560ced8411a5 Mon Sep 17 00:00:00 2001 From: toddouska Date: Mon, 3 Mar 2014 13:27:52 -0800 Subject: [PATCH] fix all clang warnings except Wpadded (diagnostic), Wconversion which inludes Wsign-conversion (implicit conversions part of standard) --- ctaocrypt/benchmark/benchmark.c | 2 +- ctaocrypt/src/ecc.c | 3 ++- ctaocrypt/src/tfm.c | 2 +- src/internal.c | 2 +- src/ocsp.c | 3 --- tests/api.c | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ctaocrypt/benchmark/benchmark.c b/ctaocrypt/benchmark/benchmark.c index 8fa17e725..4b4a3fa6d 100644 --- a/ctaocrypt/benchmark/benchmark.c +++ b/ctaocrypt/benchmark/benchmark.c @@ -956,7 +956,7 @@ void bench_eccKeyAgree(void) byte shared[1024]; byte sig[1024]; byte digest[32]; - word32 x; + word32 x = 0; ecc_init(&genKey); ecc_init(&genKey2); diff --git a/ctaocrypt/src/ecc.c b/ctaocrypt/src/ecc.c index 609a386f8..bf21125f3 100644 --- a/ctaocrypt/src/ecc.c +++ b/ctaocrypt/src/ecc.c @@ -971,7 +971,8 @@ static int ecc_mulmod(mp_int* k, ecc_point *G, ecc_point *R, mp_int* modulus, mp_int mu; mp_digit mp; unsigned long buf; - int first, bitbuf, bitcpy, bitcnt, mode, digidx; + int first = 1, bitbuf = 0, bitcpy = 0, bitcnt = 0, mode = 0, + digidx = 0; if (k == NULL || G == NULL || R == NULL || modulus == NULL) return ECC_BAD_ARG_E; diff --git a/ctaocrypt/src/tfm.c b/ctaocrypt/src/tfm.c index 9f71484d6..2fa280e9c 100644 --- a/ctaocrypt/src/tfm.c +++ b/ctaocrypt/src/tfm.c @@ -2402,7 +2402,7 @@ int mp_add_d(fp_int *a, fp_digit b, fp_int *c) #ifdef HAVE_ECC /* chars used in radix conversions */ -const char *fp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; +static const char *fp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; static int fp_read_radix(fp_int *a, const char *str, int radix) { diff --git a/src/internal.c b/src/internal.c index 5a4dfd564..bba554558 100644 --- a/src/internal.c +++ b/src/internal.c @@ -2817,7 +2817,7 @@ static int GetRecordHeader(CYASSL* ssl, const byte* input, word32* inOutIdx, #endif /* verify record type here as well */ - switch ((enum ContentType)rh->type) { + switch (rh->type) { case handshake: case change_cipher_spec: case application_data: diff --git a/src/ocsp.c b/src/ocsp.c index d03f66d88..cb55c4e04 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -94,13 +94,10 @@ static int xstat2err(int stat) switch (stat) { case CERT_GOOD: return 0; - break; case CERT_REVOKED: return OCSP_CERT_REVOKED; - break; default: return OCSP_CERT_UNKNOWN; - break; } } diff --git a/tests/api.c b/tests/api.c index efbce2d33..1342f251a 100644 --- a/tests/api.c +++ b/tests/api.c @@ -948,7 +948,7 @@ static int test_CyaSSL_read_write(void) FreeTcpReady(&ready); return test_result; -}; +} #endif