Replace simple macros with inline functions for better type safety
Now that we use C++ for all source code, lets benefit from it!
The hb_be_int16/32_get/put/eq() macros grow code size if replaced with
inline functions, so leave them as is.
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 0f1021b..5810cc3 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -371,7 +371,7 @@
public:
inline void set (Type i) { hb_be_uint16_put (v,i); }
inline operator Type (void) const { return hb_be_uint16_get (v); }
- inline bool operator == (const BEInt<Type, 2>& o) const { return hb_be_uint16_cmp (v, o.v); }
+ inline bool operator == (const BEInt<Type, 2>& o) const { return hb_be_uint16_eq (v, o.v); }
inline bool operator != (const BEInt<Type, 2>& o) const { return !(*this == o); }
private: uint8_t v[2];
};
@@ -381,7 +381,7 @@
public:
inline void set (Type i) { hb_be_uint32_put (v,i); }
inline operator Type (void) const { return hb_be_uint32_get (v); }
- inline bool operator == (const BEInt<Type, 4>& o) const { return hb_be_uint32_cmp (v, o.v); }
+ inline bool operator == (const BEInt<Type, 4>& o) const { return hb_be_uint32_eq (v, o.v); }
inline bool operator != (const BEInt<Type, 4>& o) const { return !(*this == o); }
private: uint8_t v[4];
};