/* Generic nul-content Null objects. */
template <typename Type>
-static inline const Type& Null () {
+static inline const Type& Null (void) {
ASSERT_STATIC (Type::min_size <= sizeof (_NullPool));
return *CastP<Type> (_NullPool);
}
#define DEFINE_NULL_DATA(Type, data) \
static const char _Null##Type[Type::min_size + 1] = data; /* +1 is for nul-termination in data */ \
template <> \
-inline const Type& Null<Type> () { \
+inline const Type& Null<Type> (void) { \
return *CastP<Type> (_Null##Type); \
} /* The following line really exists such that we end in a place needing semicolon */ \
ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type))
{
public:
inline void set (Type i) { hb_be_uint16_put (v,i); }
- inline operator Type () const { return hb_be_uint16_get (v); }
+ 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 !(*this == o); }
private: uint8_t v[2];
{
public:
inline void set (Type i) { hb_be_uint32_put (v,i); }
- inline operator Type () const { return hb_be_uint32_get (v); }
+ 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 !(*this == o); }
private: uint8_t v[4];
if (unlikely (i >= len)) return Null(Type);
return array[i];
}
- inline unsigned int get_size () const
+ inline unsigned int get_size (void) const
{ return len.static_size + len * Type::static_size; }
inline bool sanitize (hb_sanitize_context_t *c) {
if (unlikely (i >= len || !i)) return Null(Type);
return array[i-1];
}
- inline unsigned int get_size () const
+ inline unsigned int get_size (void) const
{ return len.static_size + (len ? len - 1 : 0) * Type::static_size; }
inline bool sanitize_shallow (hb_sanitize_context_t *c) {
template <typename SearchType>
inline int search (const SearchType &x) const {
class Cmp {
- public: static int cmp (const void *p1, const void *p2) {
- const SearchType *a = reinterpret_cast<const SearchType *>(p1);
- const Type *b = reinterpret_cast<const Type *>(p2);
- return b->cmp (*a);
- }
+ public: static int cmp (const SearchType *a, const Type *b) { return b->cmp (*a); }
};
- const Type *p = (const Type *) bsearch (&x, this->array, this->len, sizeof (this->array[0]), Cmp::cmp);
+ const Type *p = (const Type *) bsearch (&x, this->array, this->len, sizeof (this->array[0]), (hb_compare_func_t) Cmp::cmp);
return p ? p - this->array : -1;
}
};