From e65bff09433b66c207f1c40cd6e5b73c7f19d7cd Mon Sep 17 00:00:00 2001 From: ariza Date: Wed, 19 Feb 2020 13:38:04 -0800 Subject: [PATCH] workaround whence_t as bit-field --- src/hb-serialize.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-serialize.hh b/src/hb-serialize.hh index ec4e3542f..5609b6369 100644 --- a/src/hb-serialize.hh +++ b/src/hb-serialize.hh @@ -77,7 +77,7 @@ struct hb_serialize_context_t { bool is_wide: 1; bool is_signed: 1; - whence_t whence: 2; + unsigned whence: 2; unsigned position: 28; unsigned bias; objidx_t objidx; @@ -293,7 +293,7 @@ struct hb_serialize_context_t link.is_wide = sizeof (T) == 4; link.is_signed = hb_is_signed (hb_unwrap_type (T)); - link.whence = whence; + link.whence = (unsigned)whence; link.position = (const char *) &ofs - current->head; if (whence == Head) { @@ -323,7 +323,7 @@ struct hb_serialize_context_t const object_t* child = packed[link.objidx]; if (unlikely (!child)) { err_other_error(); return; } unsigned offset; - switch (link.whence) { + switch ((whence_t)link.whence) { case Head: offset = child->head - parent->head; break; case Tail: offset = child->head - parent->tail; break; case Absolute: offset = (head - start) + (child->head - tail); break;