From 11e49683672f489d2515344696593c1a6b5bb6ee Mon Sep 17 00:00:00 2001 From: "G.E" Date: Wed, 24 Apr 2024 15:55:57 +0300 Subject: [PATCH 1/2] cppcheck invalidPrintfArgType_uint warnings --- benchmarks/benchmarks.cpp | 4 ++-- tools/hsbench/engine_hyperscan.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/benchmarks.cpp b/benchmarks/benchmarks.cpp index d8b77992..5dc08ee4 100644 --- a/benchmarks/benchmarks.cpp +++ b/benchmarks/benchmarks.cpp @@ -102,7 +102,7 @@ static void run_benchmarks(int size, int loops, int max_matches, bool is_reverse avg_bw /= max_matches; total_sec /= 1000000.0; /*convert average time to us*/ - printf(KMAG "%s: %u matches, %u * %u iterations," KBLU " total elapsed time =" RST " %.3f s, " + printf(KMAG "%s: %d matches, %d * %d iterations," KBLU " total elapsed time =" RST " %.3f s, " KBLU "average time per call =" RST " %.3f μs," KBLU " max bandwidth = " RST " %.3f MB/s," KBLU " average bandwidth =" RST " %.3f MB/s \n", bench.label, max_matches, size ,loops, total_sec, avg_time, max_bw, avg_bw); } else { @@ -122,7 +122,7 @@ static void run_benchmarks(int size, int loops, int max_matches, bool is_reverse max_bw = total_size / total_sec; /*convert to MB/s*/ max_bw /= 1048576.0; - printf(KMAG "%s: no matches, %u * %u iterations," KBLU " total elapsed time =" RST " %.3f s, " + printf(KMAG "%s: no matches, %d * %d iterations," KBLU " total elapsed time =" RST " %.3f s, " KBLU "average time per call =" RST " %.3f μs ," KBLU " bandwidth = " RST " %.3f MB/s \n", bench.label, size ,loops, total_sec, avg_time, max_bw ); } diff --git a/tools/hsbench/engine_hyperscan.cpp b/tools/hsbench/engine_hyperscan.cpp index 95461de5..268b14d6 100644 --- a/tools/hsbench/engine_hyperscan.cpp +++ b/tools/hsbench/engine_hyperscan.cpp @@ -456,7 +456,7 @@ buildEngineHyperscan(const ExpressionMap &expressions, ScanMode scan_mode, if (err == HS_COMPILER_ERROR) { if (compile_err->expression >= 0) { - printf("Compile error for signature #%u: %s\n", + printf("Compile error for signature #%d: %s\n", compile_err->expression, compile_err->message); } else { printf("Compile error: %s\n", compile_err->message); From e291d498fa3fa7b4ae0a625d49a30a9d93eeee0e Mon Sep 17 00:00:00 2001 From: "G.E" Date: Wed, 24 Apr 2024 16:26:38 +0300 Subject: [PATCH 2/2] fixed merge mixup --- benchmarks/benchmarks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks.cpp b/benchmarks/benchmarks.cpp index ff6496a6..e48652e9 100644 --- a/benchmarks/benchmarks.cpp +++ b/benchmarks/benchmarks.cpp @@ -126,7 +126,7 @@ static void run_benchmarks(int size, int loops, int max_matches, /*convert to MB/s*/ max_bw /= 1048576.0; printf("%-18s, %-12s, %-10d, %-6d, %-10.3f, %-9.3f, %-8.3f, %-7s\n", - bench.label, size ,loops, total_sec, avg_time, max_bw ); + bench.label, "0", size, loops, total_sec, avg_time, max_bw, "0"); } }