Removed the addr_t conversion operators from FixedWidthPointer which makes comparison against NULL work properly.

This commit is contained in:
Alex Smith
2012-06-22 18:22:11 +01:00
parent 474aa3b76e
commit 62d36f9833
12 changed files with 30 additions and 26 deletions
+14 -10
View File
@@ -25,11 +25,6 @@ public:
return (Type *)(addr_t)fValue;
}
operator addr_t() const
{
return (addr_t)fValue;
}
Type& operator*() const
{
return *(Type *)*this;
@@ -90,11 +85,6 @@ public:
return (OtherType*)(addr_t)fValue;
}
operator addr_t() const
{
return (addr_t)fValue;
}
FixedWidthPointer& operator=(const FixedWidthPointer& p)
{
fValue = p.fValue;
@@ -121,5 +111,19 @@ private:
uint64 fValue;
} _PACKED;
template<typename Type>
inline bool
operator==(const FixedWidthPointer<Type>& a, void* b)
{
return a.Get() == (addr_t)b;
}
template<typename Type>
inline bool
operator!=(const FixedWidthPointer<Type>& a, void* b)
{
return a.Get() != (addr_t)b;
}
#endif /* KERNEL_UTIL_FIXED_WIDTH_POINTER_H */