From 174fd1bf0ed5256cf62aa1cebf0774aafb4ff1cc Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 20 Apr 2020 22:01:47 -0400 Subject: [PATCH] Codacy cleanups. No functional change. --- include/verilated.h | 1 + test_regress/t/t_dpi_arg_output_type.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/verilated.h b/include/verilated.h index c49226ce4..c2bc2bfad 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -46,6 +46,7 @@ // Allow user to specify their own include file #ifdef VL_VERILATED_INCLUDE +// cppcheck-suppress preprocessorErrorDirective # include VL_VERILATED_INCLUDE #endif // clang-format on diff --git a/test_regress/t/t_dpi_arg_output_type.cpp b/test_regress/t/t_dpi_arg_output_type.cpp index 931f3775a..c257f53ff 100644 --- a/test_regress/t/t_dpi_arg_output_type.cpp +++ b/test_regress/t/t_dpi_arg_output_type.cpp @@ -131,13 +131,13 @@ void i_shortreal(float* o) { void i_chandle(void** o) { static int n = 0; printf("i_chandle %d\n", n); - *o = n++ % 2 ? reinterpret_cast(&i_chandle) : NULL; + *o = (n++ % 2) ? reinterpret_cast(&i_chandle) : NULL; } void i_string(const char** o) { static int n = 0; printf("i_string %d\n", n); - *o = n++ % 2 ? "Hello" : "World"; + *o = (n++ % 2) ? "Hello" : "World"; } void i_bit(svBit* o) { @@ -247,13 +247,13 @@ void i_shortreal_t(float* o) { void i_chandle_t(void** o) { static int n = 0; printf("i_chandle_t %d\n", n); - *o = n++ % 2 ? reinterpret_cast(&i_chandle) : NULL; + *o = (n++ % 2) ? reinterpret_cast(&i_chandle) : NULL; } void i_string_t(const char** o) { static int n = 0; printf("i_string_t %d\n", n); - *o = n++ % 2 ? "Hello" : "World"; + *o = (n++ % 2) ? "Hello" : "World"; } void i_bit_t(svBit* o) {