提交 abcc5ac1 编写于 作者: B Behdad Esfahbod

[OT] Improve serialize syntax

For some definition of improvement...
上级 bc5be240
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册