From c30b9d04a85a634f4dcab959749825156e8d5369 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 20 Jan 2024 08:57:22 -0500 Subject: [PATCH] Change unused vars to standard void syntax. No functional change intended. --- examples/make_tracing_c/sim_main.cpp | 3 --- examples/make_tracing_sc/sc_main.cpp | 3 --- src/V3File.cpp | 5 +++-- src/VlcTop.cpp | 5 ++--- test_regress/driver.pl | 2 +- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/examples/make_tracing_c/sim_main.cpp b/examples/make_tracing_c/sim_main.cpp index a49225cdc..69f99cae2 100644 --- a/examples/make_tracing_c/sim_main.cpp +++ b/examples/make_tracing_c/sim_main.cpp @@ -20,9 +20,6 @@ double sc_time_stamp() { return 0; } int main(int argc, char** argv) { // This is a more complicated example, please also see the simpler examples/make_hello_c. - // Prevent unused variable warnings - if (false && argc && argv) {} - // Create logs/ directory in case we have traces to put under it Verilated::mkdir("logs"); diff --git a/examples/make_tracing_sc/sc_main.cpp b/examples/make_tracing_sc/sc_main.cpp index 59f1a55a4..208d4e43d 100644 --- a/examples/make_tracing_sc/sc_main.cpp +++ b/examples/make_tracing_sc/sc_main.cpp @@ -29,9 +29,6 @@ using namespace sc_dt; int sc_main(int argc, char* argv[]) { // This is a more complicated example, please also see the simpler examples/make_hello_c. - // Prevent unused variable warnings - if (false && argc && argv) {} - // Create logs/ directory in case we have traces to put under it Verilated::mkdir("logs"); diff --git a/src/V3File.cpp b/src/V3File.cpp index 4db49c97a..07486c3fb 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -361,7 +361,8 @@ private: return true; } bool readContentsFilter(const string& filename, StrList& outl) { - if (filename != "" || outl.empty()) {} // Prevent unused + (void)filename; // Prevent unused variable warning + (void)outl; // Prevent unused variable warning #ifdef INFILTER_PIPE writeFilter("read \"" + filename + "\"\n"); const string line = readFilterLine(); @@ -484,7 +485,7 @@ private: } } void startFilter(const string& command) { - if (command == "") {} // Prevent Unused + (void)command; // Prevent Unused variable warning #ifdef INFILTER_PIPE int fd_stdin[2]; // Can't use std::array int fd_stdout[2]; // Can't use std::array diff --git a/src/VlcTop.cpp b/src/VlcTop.cpp index 60ea127ac..7d9c83659 100644 --- a/src/VlcTop.cpp +++ b/src/VlcTop.cpp @@ -51,11 +51,10 @@ void VlcTop::readCoverage(const string& filename, bool nonfatal) { if (line[secspace] == '\'' && line[secspace + 1] == ' ') break; } const string point = line.substr(3, secspace - 3); - uint64_t hits = std::atoll(line.c_str() + secspace + 1); + const uint64_t hits = std::atoll(line.c_str() + secspace + 1); // UINFO(9," point '"<= VlcBuckets::sufficient()) { points().pointNumber(pointnum).testsCoveringInc(); diff --git a/test_regress/driver.pl b/test_regress/driver.pl index 692d6fd89..6bc4172de 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -1883,7 +1883,7 @@ sub _make_main { print $fh " srand48(5);\n"; # Ensure determinism print $fh " contextp->randReset(" . $self->{verilated_randReset} . ");\n" if defined $self->{verilated_randReset}; - print $fh " topp.reset(new ${vm_prefix}(\"top\"));\n"; + print $fh " topp.reset(new ${vm_prefix}{\"top\"});\n"; print $fh " contextp->internalsDump()\n;" if $self->{verilated_debug}; my $set;