diff --git a/src/util/name.cpp b/src/util/name.cpp index fd02761b0c..7374e727a0 100644 --- a/src/util/name.cpp +++ b/src/util/name.cpp @@ -204,7 +204,7 @@ bool operator==(name const & a, char const * b) { strcmp(a.get_string(), b) == 0; } -int name::cmp(object * i1, object * i2) { +int name::cmp_core(object * i1, object * i2) { buffer limbs1, limbs2; copy_limbs(i1, limbs1); copy_limbs(i2, limbs2); diff --git a/src/util/name.h b/src/util/name.h index 9c79851734..475f30f9e5 100644 --- a/src/util/name.h +++ b/src/util/name.h @@ -53,7 +53,7 @@ public: static unsigned get_numeral(object * o) { return unbox(cnstr_obj(o, 1)); } static unsigned hash(object * o) { return cnstr_scalar(o, 2*sizeof(object*)); } // NOLINT static bool eq_core(object * o1, object * o2); - static int cmp(object * o1, object * o2); + static int cmp_core(object * o1, object * o2); size_t size_core(bool unicode) const; private: friend name read_name(deserializer & d); @@ -106,7 +106,7 @@ public: friend bool operator==(name const & a, char const * b); friend bool operator!=(name const & a, char const * b) { return !(a == b); } /** \brief Total order on hierarchical names. */ - friend int cmp(name const & a, name const & b) { return cmp(a.raw(), b.raw()); } + friend int cmp(name const & a, name const & b) { return cmp_core(a.raw(), b.raw()); } friend bool operator<(name const & a, name const & b) { return cmp(a, b) < 0; } friend bool operator>(name const & a, name const & b) { return cmp(a, b) > 0; } friend bool operator<=(name const & a, name const & b) { return cmp(a, b) <= 0; } diff --git a/src/util/object_ref.h b/src/util/object_ref.h index a15f0576a8..28f0766013 100644 --- a/src/util/object_ref.h +++ b/src/util/object_ref.h @@ -32,7 +32,6 @@ public: return *this; } object * raw() const { return m_obj; } - operator object*() const { return m_obj; } static void swap(object_ref & a, object_ref & b) { std::swap(a.m_obj, b.m_obj); } }; @@ -47,7 +46,7 @@ inline object_ref mk_cnstr(unsigned tag, object * o1, object * o2, unsigned scal /* The following definition is a low level hack that relies on the fact that sizeof(object_ref) == sizeof(object *). */ inline object_ref const & cnstr_obj_ref(object_ref const & ref, unsigned i) { static_assert(sizeof(object_ref) == sizeof(object *), "unexpected object_ref size"); // NOLINT - lean_assert(is_cnstr(ref)); + lean_assert(is_cnstr(ref.raw())); return reinterpret_cast(reinterpret_cast(ref.raw()) + sizeof(constructor))[i]; }