mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-05 13:44:41 +02:00
Old Compiler Warning Cleanup (GCC 4.0.2)
1. Removed pragma disabling the warning for non-literal format strings on `printf()`. 2. Switched the `printf()` into two printf calls.
This commit is contained in:
@@ -1563,16 +1563,11 @@ static void* server_thread(void* args)
|
|||||||
#endif /* !NO_WOLFSSL_SERVER */
|
#endif /* !NO_WOLFSSL_SERVER */
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
|
||||||
#endif
|
|
||||||
static void print_stats(stats_t* wcStat, const char* desc, const char* cipher, const char *group, int verbose)
|
static void print_stats(stats_t* wcStat, const char* desc, const char* cipher, const char *group, int verbose)
|
||||||
{
|
{
|
||||||
const char* formatStr;
|
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
formatStr = "wolfSSL %s Benchmark on %s with group %s:\n"
|
fprintf(stderr,
|
||||||
|
"wolfSSL %s Benchmark on %s with group %s:\n"
|
||||||
"\tTotal : %9d bytes\n"
|
"\tTotal : %9d bytes\n"
|
||||||
"\tNum Conns : %9d\n"
|
"\tNum Conns : %9d\n"
|
||||||
"\tRx Total : %9.3f ms\n"
|
"\tRx Total : %9.3f ms\n"
|
||||||
@@ -1580,13 +1575,7 @@ static void print_stats(stats_t* wcStat, const char* desc, const char* cipher, c
|
|||||||
"\tRx : %9.3f MB/s\n"
|
"\tRx : %9.3f MB/s\n"
|
||||||
"\tTx : %9.3f MB/s\n"
|
"\tTx : %9.3f MB/s\n"
|
||||||
"\tConnect : %9.3f ms\n"
|
"\tConnect : %9.3f ms\n"
|
||||||
"\tConnect Avg : %9.3f ms\n";
|
"\tConnect Avg : %9.3f ms\n",
|
||||||
}
|
|
||||||
else {
|
|
||||||
formatStr = "%-6s %-33s %-25s %11d %9d %9.3f %9.3f %9.3f %9.3f %17.3f %15.3f\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(stderr, formatStr,
|
|
||||||
desc,
|
desc,
|
||||||
cipher,
|
cipher,
|
||||||
group,
|
group,
|
||||||
@@ -1598,6 +1587,23 @@ static void print_stats(stats_t* wcStat, const char* desc, const char* cipher, c
|
|||||||
wcStat->txTotal / wcStat->txTime / 1024 / 1024,
|
wcStat->txTotal / wcStat->txTime / 1024 / 1024,
|
||||||
wcStat->connTime * 1000,
|
wcStat->connTime * 1000,
|
||||||
wcStat->connTime * 1000 / wcStat->connCount);
|
wcStat->connTime * 1000 / wcStat->connCount);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fprintf(stderr,
|
||||||
|
"%-6s %-33s %-25s %11d %9d %9.3f %9.3f %9.3f "
|
||||||
|
"%9.3f %17.3f %15.3f\n",
|
||||||
|
desc,
|
||||||
|
cipher,
|
||||||
|
group,
|
||||||
|
wcStat->txTotal + wcStat->rxTotal,
|
||||||
|
wcStat->connCount,
|
||||||
|
wcStat->rxTime * 1000,
|
||||||
|
wcStat->txTime * 1000,
|
||||||
|
wcStat->rxTotal / wcStat->rxTime / 1024 / 1024,
|
||||||
|
wcStat->txTotal / wcStat->txTime / 1024 / 1024,
|
||||||
|
wcStat->connTime * 1000,
|
||||||
|
wcStat->connTime * 1000 / wcStat->connCount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Usage(void)
|
static void Usage(void)
|
||||||
@@ -1699,9 +1705,6 @@ static int SetupSupportedGroups(int verbose)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int bench_tls(void* args)
|
int bench_tls(void* args)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user