[repacker] remove VirtualOffset struct.
Make and add_virtual_link () specialization of add_link() instead.
This commit is contained in:
parent
bc4c5341d6
commit
5bfc7d1015
|
@ -51,12 +51,6 @@ enum hb_serialize_error_t {
|
||||||
};
|
};
|
||||||
HB_MARK_AS_FLAG_T (hb_serialize_error_t);
|
HB_MARK_AS_FLAG_T (hb_serialize_error_t);
|
||||||
|
|
||||||
// This is a 0 byte wide offset, used to add virtual links to the serializer object graph.
|
|
||||||
// It does not correspond to a real offset and exists soley to enforce an ordering constraint
|
|
||||||
// in the graph's packed order.
|
|
||||||
struct VirtualOffset {
|
|
||||||
};
|
|
||||||
|
|
||||||
struct hb_serialize_context_t
|
struct hb_serialize_context_t
|
||||||
{
|
{
|
||||||
typedef unsigned objidx_t;
|
typedef unsigned objidx_t;
|
||||||
|
@ -364,7 +358,7 @@ struct hb_serialize_context_t
|
||||||
assert (packed.tail ()->head == tail);
|
assert (packed.tail ()->head == tail);
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_link (VirtualOffset &ofs, objidx_t objidx)
|
void add_virtual_link (objidx_t objidx)
|
||||||
{
|
{
|
||||||
// This link is not associated with an actual offset and exists merely to enforce
|
// This link is not associated with an actual offset and exists merely to enforce
|
||||||
// an ordering constraint.
|
// an ordering constraint.
|
||||||
|
@ -374,7 +368,6 @@ struct hb_serialize_context_t
|
||||||
return;
|
return;
|
||||||
|
|
||||||
assert (current);
|
assert (current);
|
||||||
assert (current->head <= (const char *) &ofs);
|
|
||||||
|
|
||||||
auto& link = *current->links.push ();
|
auto& link = *current->links.push ();
|
||||||
if (current->links.in_error ())
|
if (current->links.in_error ())
|
||||||
|
|
|
@ -100,8 +100,7 @@ static void run_resolve_overflow_test (const char* name,
|
||||||
static void add_virtual_offset (unsigned id,
|
static void add_virtual_offset (unsigned id,
|
||||||
hb_serialize_context_t* c)
|
hb_serialize_context_t* c)
|
||||||
{
|
{
|
||||||
VirtualOffset* offset = c->start_embed<VirtualOffset> ();
|
c->add_virtual_link (id);
|
||||||
c->add_link (*offset, id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue