mirror of
https://github.com/verilator/verilator.git
synced 2026-08-31 10:04:40 +02:00
Internals: Add more const. No functional change.
This commit is contained in:
@@ -129,7 +129,7 @@ void VerilatedVcd::openNextImp(bool incFilename) {
|
||||
if (incFilename) {
|
||||
// Find _0000.{ext} in filename
|
||||
std::string name = m_filename;
|
||||
size_t pos = name.rfind('.');
|
||||
const size_t pos = name.rfind('.');
|
||||
if (pos > 8 && 0 == std::strncmp("_cat", name.c_str() + pos - 8, 4)
|
||||
&& std::isdigit(name.c_str()[pos - 4]) && std::isdigit(name.c_str()[pos - 3])
|
||||
&& std::isdigit(name.c_str()[pos - 2]) && std::isdigit(name.c_str()[pos - 1])) {
|
||||
@@ -299,10 +299,10 @@ void VerilatedVcd::bufferFlush() VL_MT_UNSAFE_ONE {
|
||||
if (VL_UNLIKELY(!isOpen())) return;
|
||||
char* wp = m_wrBufp;
|
||||
while (true) {
|
||||
ssize_t remaining = (m_writep - wp);
|
||||
const ssize_t remaining = (m_writep - wp);
|
||||
if (remaining == 0) break;
|
||||
errno = 0;
|
||||
ssize_t got = m_filep->write(wp, remaining);
|
||||
const ssize_t got = m_filep->write(wp, remaining);
|
||||
if (got > 0) {
|
||||
wp += got;
|
||||
m_wroteBytes += got;
|
||||
@@ -352,7 +352,7 @@ void VerilatedVcd::dumpHeader() {
|
||||
printStr("$version Generated by VerilatedVcd $end\n");
|
||||
printStr("$date ");
|
||||
{
|
||||
time_t tick = time(nullptr);
|
||||
const time_t tick = time(nullptr);
|
||||
tm ticktm;
|
||||
VL_LOCALTIME_R(&tick, &ticktm);
|
||||
constexpr int bufsize = 50;
|
||||
|
||||
Reference in New Issue
Block a user