Fix GCC 4.4.7 errors.

This commit is contained in:
Wilson Snyder 2020-02-08 07:09:41 -05:00
parent 134b5efd70
commit f7bad37e88
2 changed files with 4 additions and 6 deletions

View File

@ -20,6 +20,7 @@
//============================================================================= //=============================================================================
// SPDIFF_OFF // SPDIFF_OFF
#define __STDC_LIMIT_MACROS // UINT64_MAX
#include "verilatedos.h" #include "verilatedos.h"
#include "verilated.h" #include "verilated.h"
#include "verilated_fst_c.h" #include "verilated_fst_c.h"
@ -47,6 +48,7 @@
#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
# include <io.h> # include <io.h>
#else #else
# include <stdint.h>
# include <unistd.h> # include <unistd.h>
#endif #endif

View File

@ -41,9 +41,9 @@ template <typename T> class V3ConfigWildcardResolver {
Map m_mapWildcard; // Wildcard strings to entities Map m_mapWildcard; // Wildcard strings to entities
Map m_mapResolved; // Resolved strings to converged entities Map m_mapResolved; // Resolved strings to converged entities
typename Map::iterator m_last; // Last access, will probably hit again
public: public:
V3ConfigWildcardResolver() { m_last = m_mapResolved.end(); } V3ConfigWildcardResolver() {}
~V3ConfigWildcardResolver() {}
/// Update into maps from other /// Update into maps from other
void update(const V3ConfigWildcardResolver& other) { void update(const V3ConfigWildcardResolver& other) {
@ -63,10 +63,6 @@ public:
} }
// Access an entity and resolve wildcards that match it // Access an entity and resolve wildcards that match it
T* resolve(const string& name) { T* resolve(const string& name) {
// Lookup if recently accessed matches
if (VL_LIKELY(m_last != m_mapResolved.end()) && VL_LIKELY(m_last->first == name)) {
return &m_last->second;
}
// Lookup if it was resolved before, typically not // Lookup if it was resolved before, typically not
typename Map::iterator it = m_mapResolved.find(name); typename Map::iterator it = m_mapResolved.find(name);
if (VL_UNLIKELY(it != m_mapResolved.end())) { return &it->second; } if (VL_UNLIKELY(it != m_mapResolved.end())) { return &it->second; }