From 0f7b68451787b64e7c99151d3631f6d57ee3a66b Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Wed, 25 Jun 2025 16:41:44 -0400 Subject: Fix Ref comparison operators --- binaryninjaapi.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 0002aa77..be4e6313 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -347,19 +347,19 @@ namespace BinaryNinja { bool operator!() const { return m_obj == nullptr; } - bool operator==(const T* obj) const { return T::GetObject(m_obj) == T::GetObject(obj); } + bool operator==(T* obj) const { return T::GetObject(m_obj) == T::GetObject(obj); } bool operator==(const Ref& obj) const { return T::GetObject(m_obj) == T::GetObject(obj.m_obj); } - bool operator!=(const T* obj) const { return T::GetObject(m_obj) != T::GetObject(obj); } + bool operator!=(T* obj) const { return T::GetObject(m_obj) != T::GetObject(obj); } bool operator!=(const Ref& obj) const { return T::GetObject(m_obj) != T::GetObject(obj.m_obj); } - bool operator<(const T* obj) const { return T::GetObject(m_obj) < T::GetObject(obj); } + bool operator<(T* obj) const { return T::GetObject(m_obj) < T::GetObject(obj); } bool operator<(const Ref& obj) const { return T::GetObject(m_obj) < T::GetObject(obj.m_obj); } - bool operator>(const T* obj) const { return T::GetObject(m_obj) > T::GetObject(obj); } + bool operator>(T* obj) const { return T::GetObject(m_obj) > T::GetObject(obj); } bool operator>(const Ref& obj) const { return T::GetObject(m_obj) > T::GetObject(obj.m_obj); } @@ -369,19 +369,19 @@ namespace BinaryNinja { template bool operator==(T* a, const Ref& b) { - return a == b.GetPtr(); + return T::GetObject(a) == T::GetObject(b.GetPtr()); } template bool operator!=(T* a, const Ref& b) { - return a != b.GetPtr(); + return T::GetObject(a) != T::GetObject(b.GetPtr()); } template bool operator<(T* a, const Ref& b) { - return a < b.GetPtr(); + return T::GetObject(a) < T::GetObject(b.GetPtr()); } /*! @@ -398,11 +398,11 @@ namespace BinaryNinja { operator T*() const { return m_obj; } T* operator->() const { return m_obj; } T& operator*() const { return *m_obj; } - bool operator==(const T* obj) const { return T::GetObject(m_obj) == T::GetObject(obj); } + bool operator==(T* obj) const { return T::GetObject(m_obj) == T::GetObject(obj); } bool operator==(const Ref& obj) const { return T::GetObject(m_obj) == T::GetObject(obj.m_obj); } - bool operator!=(const T* obj) const { return T::GetObject(m_obj) != T::GetObject(obj); } + bool operator!=(T* obj) const { return T::GetObject(m_obj) != T::GetObject(obj); } bool operator!=(const Ref& obj) const { return T::GetObject(m_obj) != T::GetObject(obj.m_obj); } - bool operator<(const T* obj) const { return T::GetObject(m_obj) < T::GetObject(obj); } + bool operator<(T* obj) const { return T::GetObject(m_obj) < T::GetObject(obj); } bool operator<(const Ref& obj) const { return T::GetObject(m_obj) < T::GetObject(obj.m_obj); } T* GetPtr() const { return m_obj; } }; @@ -410,19 +410,19 @@ namespace BinaryNinja { template bool operator==(T* a, const CallbackRef& b) { - return a == b.GetPtr(); + return T::GetObject(a) == T::GetObjcet(b.GetPtr()); } template bool operator!=(T* a, const CallbackRef& b) { - return a != b.GetPtr(); + return T::GetObject(a) != T::GetObject(b.GetPtr()); } template bool operator<(T* a, const CallbackRef& b) { - return a < b.GetPtr(); + return T::GetObject(a) < T::GetObject(b.GetPtr()); } /*! -- cgit v1.3.1