Merge pull request #1403 from cconlon/shadow_warnings

Fix shadow warnings on older compilers in tls_bench example
This commit is contained in:
toddouska 2018-02-27 08:32:56 -08:00 committed by GitHub
commit 91141e43c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -574,7 +574,7 @@ static void* server_thread(void* args)
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral" #pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif #endif
static void print_stats(stats_t* stat, const char* desc, const char* cipher, int verbose) static void print_stats(stats_t* wcStat, const char* desc, const char* cipher, int verbose)
{ {
const char* formatStr; const char* formatStr;
@ -596,14 +596,14 @@ static void print_stats(stats_t* stat, const char* desc, const char* cipher, int
printf(formatStr, printf(formatStr,
desc, desc,
cipher, cipher,
stat->txTotal + stat->rxTotal, wcStat->txTotal + wcStat->rxTotal,
stat->connCount, wcStat->connCount,
stat->txTime * 1000, wcStat->txTime * 1000,
stat->rxTime * 1000, wcStat->rxTime * 1000,
stat->txTotal / stat->txTime / 1024 / 1024, wcStat->txTotal / wcStat->txTime / 1024 / 1024,
stat->rxTotal / stat->rxTime / 1024 / 1024, wcStat->rxTotal / wcStat->rxTime / 1024 / 1024,
stat->connTime * 1000, wcStat->connTime * 1000,
stat->connTime * 1000 / stat->connCount); wcStat->connTime * 1000 / wcStat->connCount);
} }
#ifdef __GNUC__ #ifdef __GNUC__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
@ -613,7 +613,7 @@ int bench_tls(void)
{ {
info_t theadInfo[THREAD_COUNT]; info_t theadInfo[THREAD_COUNT];
info_t* info; info_t* info;
int i, shutdown; int i, doShutdown;
char *cipher, *next_cipher, ciphers[4096]; char *cipher, *next_cipher, ciphers[4096];
#ifdef DEBUG_WOLFSSL #ifdef DEBUG_WOLFSSL
@ -672,15 +672,15 @@ int bench_tls(void)
/* Suspend shutdown until all threads are closed */ /* Suspend shutdown until all threads are closed */
do { do {
shutdown = 1; doShutdown = 1;
for (i = 0; i < THREAD_COUNT; ++i) { for (i = 0; i < THREAD_COUNT; ++i) {
info = &theadInfo[i]; info = &theadInfo[i];
if (!info->to_client.done || !info->to_server.done) { if (!info->to_client.done || !info->to_server.done) {
shutdown = 0; doShutdown = 0;
} }
} }
} while (!shutdown); } while (!doShutdown);
#ifdef SHOW_VERBOSE_OUTPUT #ifdef SHOW_VERBOSE_OUTPUT
printf("Shutdown complete\n"); printf("Shutdown complete\n");