From ed25aaaad9a3531a0969e019ea4108eb3d69e832 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 1 Sep 2023 17:59:30 -0400 Subject: [PATCH] Internals: Fix g++ std11 warning. No functional change. --- include/verilated.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/verilated.cpp b/include/verilated.cpp index 6ffa7f3d8..a1718a408 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -320,7 +320,7 @@ std::string VlRNG::get_randstate() const VL_MT_UNSAFE { const char* const stateCharsp = reinterpret_cast(&m_state); static_assert(sizeof(m_state) == 16, ""); std::string result{"R00112233445566770011223344556677"}; - for (int i = 0; i < sizeof(m_state); ++i) { + for (size_t i = 0; i < sizeof(m_state); ++i) { result[1 + i * 2] = 'a' + ((stateCharsp[i] >> 4) & 15); result[1 + i * 2 + 1] = 'a' + (stateCharsp[i] & 15); } @@ -332,7 +332,7 @@ void VlRNG::set_randstate(const std::string& state) VL_MT_UNSAFE { return; } char* const stateCharsp = reinterpret_cast(&m_state); - for (int i = 0; i < sizeof(m_state); ++i) { + for (size_t i = 0; i < sizeof(m_state); ++i) { stateCharsp[i] = (((state[1 + i * 2] - 'a') & 15) << 4) | ((state[1 + i * 2 + 1] - 'a') & 15); }