[OT] Improve serialize syntax
For some definition of improvement...
This commit is contained in:
parent
bc5be24014
commit
abcc5ac1fd
|
@ -600,9 +600,11 @@ struct GenericOffsetTo : OffsetType
|
|||
return StructAtOffset<Type> (base, offset);
|
||||
}
|
||||
|
||||
inline void set_offset (void *base, void *obj)
|
||||
inline Type& serialize (hb_serialize_context_t *c, void *base)
|
||||
{
|
||||
this->set ((char *) obj - (char *) base);
|
||||
Type *t = (Type *) c->head;
|
||||
this->set ((char *) t - (char *) base);
|
||||
return *t;
|
||||
}
|
||||
|
||||
inline bool sanitize (hb_sanitize_context_t *c, void *base) {
|
||||
|
|
|
@ -79,9 +79,8 @@ struct SingleSubstFormat1
|
|||
{
|
||||
TRACE_SERIALIZE ();
|
||||
if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
|
||||
if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
|
||||
deltaGlyphID.set (delta);
|
||||
coverage.set_offset (this, c->head);
|
||||
if (unlikely (!(this+coverage).serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
|
||||
return TRACE_RETURN (true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue