diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 4d6056c3a4..6d459dc274 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -223,7 +223,7 @@ void PType::SetValue(void *addr, int val) // //========================================================================== -int PType::GetValueInt(void *addr) +int PType::GetValueInt(void *addr) const { assert(0 && "Cannot get value for this type"); return 0; @@ -420,7 +420,7 @@ void PInt::SetValue(void *addr, int val) // //========================================================================== -int PInt::GetValueInt(void *addr) +int PInt::GetValueInt(void *addr) const { assert(((intptr_t)addr & (Align - 1)) == 0 && "unaligned address"); if (Size == 4) @@ -498,7 +498,7 @@ void PFloat::SetValue(void *addr, int val) // //========================================================================== -int PFloat::GetValueInt(void *addr) +int PFloat::GetValueInt(void *addr) const { assert(((intptr_t)addr & (Align - 1)) == 0 && "unaligned address"); if (Size == 4) diff --git a/src/dobjtype.h b/src/dobjtype.h index a51eaa16df..053b93072d 100644 --- a/src/dobjtype.h +++ b/src/dobjtype.h @@ -172,7 +172,8 @@ public: virtual void SetValue(void *addr, int val); // Gets the value of a variable of this type at (addr) - virtual int GetValueInt(void *addr); + virtual int GetValueInt(void *addr) const; + // Returns true if this type matches the two identifiers. Referring to the // above table, any type is identified by at most two characteristics. Each @@ -227,7 +228,7 @@ public: PInt(unsigned int size, bool unsign); virtual void SetValue(void *addr, int val); - virtual int GetValueInt(void *addr); + virtual int GetValueInt(void *addr) const; bool Unsigned; protected: @@ -241,7 +242,7 @@ public: PFloat(unsigned int size); virtual void SetValue(void *addr, int val); - virtual int GetValueInt(void *addr); + virtual int GetValueInt(void *addr) const; protected: PFloat(); };