diff --git a/panda/src/express/weakPointerToBase.I b/panda/src/express/weakPointerToBase.I index 941b15c5ed..86c978da62 100644 --- a/panda/src/express/weakPointerToBase.I +++ b/panda/src/express/weakPointerToBase.I @@ -113,7 +113,7 @@ reassign(const PointerToBase ©) { // This double-casting is a bit of a cheat to get around the // inheritance issue--it's difficult to declare a template class to // be a friend. - reassign((To *)((const WeakPointerToBase &)copy)._void_ptr); + reassign((To *)((const WeakPointerToBase *)©)->_void_ptr); } //////////////////////////////////////////////////////////////////// @@ -302,7 +302,7 @@ operator >= (const WeakPointerToBase &other) const { template INLINE bool WeakPointerToBase:: operator == (const PointerToBase &other) const { - return (To *)_void_ptr == (To *)((WeakPointerToBase &)other)._void_ptr; + return (To *)_void_ptr == (To *)((WeakPointerToBase *)&other)->_void_ptr; } //////////////////////////////////////////////////////////////////// @@ -313,7 +313,7 @@ operator == (const PointerToBase &other) const { template INLINE bool WeakPointerToBase:: operator != (const PointerToBase &other) const { - return (To *)_void_ptr != (To *)((WeakPointerToBase &)other)._void_ptr; + return (To *)_void_ptr != (To *)((WeakPointerToBase *)&other)->_void_ptr; } //////////////////////////////////////////////////////////////////// @@ -324,7 +324,7 @@ operator != (const PointerToBase &other) const { template INLINE bool WeakPointerToBase:: operator > (const PointerToBase &other) const { - return (To *)_void_ptr > (To *)((WeakPointerToBase &)other)._void_ptr; + return (To *)_void_ptr > (To *)((WeakPointerToBase *)&other)->_void_ptr; } //////////////////////////////////////////////////////////////////// @@ -335,7 +335,7 @@ operator > (const PointerToBase &other) const { template INLINE bool WeakPointerToBase:: operator <= (const PointerToBase &other) const { - return (To *)_void_ptr <= (To *)((WeakPointerToBase &)other)._void_ptr; + return (To *)_void_ptr <= (To *)((WeakPointerToBase *)&other)->_void_ptr; } //////////////////////////////////////////////////////////////////// @@ -346,7 +346,7 @@ operator <= (const PointerToBase &other) const { template INLINE bool WeakPointerToBase:: operator >= (const PointerToBase &other) const { - return (To *)_void_ptr >= (To *)((WeakPointerToBase &)other)._void_ptr; + return (To *)_void_ptr >= (To *)((WeakPointerToBase *)&other)->_void_ptr; } #endif // WIN32_VC @@ -380,7 +380,7 @@ operator < (const WeakPointerToBase &other) const { template INLINE bool WeakPointerToBase:: operator < (const PointerToBase &other) const { - return (To *)_void_ptr < (To *)((WeakPointerToBase &)other)._void_ptr; + return (To *)_void_ptr < (To *)((WeakPointerToBase *)&other)->_void_ptr; } #endif // CPPPARSER