From 11bfe7a7bb0bb5b4b2266f4bc9a294788e47cc38 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 7 Mar 2024 19:20:00 -0500 Subject: [PATCH] cppcheck fixes. No functional change. --- include/verilated.cpp | 2 +- include/verilated_cov.cpp | 2 +- include/verilated_cov.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/verilated.cpp b/include/verilated.cpp index c90547c74..87a26c767 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -1220,7 +1220,7 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf inPct = true; inIgnore = false; } else if (!inPct && std::isspace(pos[0])) { // Format spaces - while (std::isspace(pos[1])) pos++; + while (std::isspace(pos[1])) ++pos; _vl_vsss_skipspace(fp, floc, fromp, fstr); } else if (!inPct) { // Expected Format _vl_vsss_skipspace(fp, floc, fromp, fstr); diff --git a/include/verilated_cov.cpp b/include/verilated_cov.cpp index 211ecdec6..3491aa376 100644 --- a/include/verilated_cov.cpp +++ b/include/verilated_cov.cpp @@ -121,7 +121,7 @@ private: public: // CONSTRUCTORS - VerilatedCovImp(VerilatedContext* contextp) + explicit VerilatedCovImp(VerilatedContext* contextp) : m_contextp{contextp} {} VL_UNCOPYABLE(VerilatedCovImp); diff --git a/include/verilated_cov.h b/include/verilated_cov.h index d047be195..51a0c3b4f 100644 --- a/include/verilated_cov.h +++ b/include/verilated_cov.h @@ -165,7 +165,7 @@ public: /// Return default filename for the current thread static std::string defaultFilename() VL_MT_SAFE { return threadCovp()->defaultFilename(); } /// Write all coverage data to a file for the current thread - static void write(const std::string filename) VL_MT_SAFE { threadCovp()->write(filename); } + static void write(const std::string& filename) VL_MT_SAFE { threadCovp()->write(filename); } static void write() VL_MT_SAFE { write(defaultFilename()); } /// Clear coverage points (and call delete on all items) for the current thread static void clear() VL_MT_SAFE { threadCovp()->clear(); }