Fix requiring C++11 algorithms. (#2339) (#2340)

This commit is contained in:
Stephen Henry 2020-05-17 16:44:42 +01:00 committed by GitHub
parent 4773a1e77c
commit cef0105dfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,7 +242,7 @@ public: // But only for verilated*.cpp
s_s.m_fdps.resize(31);
std::fill(s_s.m_fdps.begin(), s_s.m_fdps.end(), (FILE*)0);
s_s.m_fdFreeMct.resize(30);
std::iota(s_s.m_fdFreeMct.begin(), s_s.m_fdFreeMct.end(), 1);
for (int i = 0, id = 1; i < s_s.m_fdFreeMct.size(); i++, id++) { s_s.m_fdFreeMct[i] = id; }
}
~VerilatedImp() {}
@ -472,7 +472,9 @@ public: // But only for verilated*.cpp
s_s.m_fdps.resize(start + excess);
std::fill(s_s.m_fdps.begin() + start, s_s.m_fdps.end(), (FILE*)0);
s_s.m_fdFree.resize(excess);
std::iota(s_s.m_fdFree.begin(), s_s.m_fdFree.end(), start);
for (int i = 0, id = start; i < s_s.m_fdFree.size(); i++, id++) {
s_s.m_fdFree[i] = id;
}
}
IData idx = s_s.m_fdFree.back();
s_s.m_fdFree.pop_back();