Revert back IntType out cast to signed/unsigned

Previous commit didn't fix the bots. Putting it back now that I
understand why I initially did the "Wide" casts.  But only doing
it for out-cast this time.  This causes "narrowing" warnings
whenever we are converting signed/unsigned to smaller HBUINT16
etc.  But those are valuable warnings.  We should address those
separately instead of ignoring.

Maybe we should start using uint16_t more liberally in the
internal subsetter function signatures then.
pull/2875/head
Behdad Esfahbod 4 years ago
parent 0983601399
commit d6bd00a488
  1. 7
      src/hb-open-type.hh

@ -62,12 +62,7 @@ struct IntType
IntType () = default;
explicit constexpr IntType (Type V) : v {V} {}
IntType& operator = (Type i) { v = i; return *this; }
operator Type () const { return v; }
template <typename Type2 = hb_conditional<hb_is_signed (Type), signed, unsigned>,
hb_enable_if (sizeof (Type) < sizeof (Type2))>
operator hb_type_identity_t<Type2> () const { return v; }
operator hb_conditional<hb_is_signed (Type), signed, unsigned> () const { return v; }
bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; }
bool operator != (const IntType &o) const { return !(*this == o); }

Loading…
Cancel
Save