提交 00a00bc1 编写于 作者: B Behdad Esfahbod

Fix two TODOs

上级 11ab889a
...@@ -90,7 +90,7 @@ struct SingleSubstFormat1 ...@@ -90,7 +90,7 @@ struct SingleSubstFormat1
TRACE_SERIALIZE (this); TRACE_SERIALIZE (this);
if (unlikely (!c->extend_min (*this))) return_trace (false); if (unlikely (!c->extend_min (*this))) return_trace (false);
if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs))) return_trace (false); if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs))) return_trace (false);
deltaGlyphID = delta; /* TODO(serialize) overflow? */ c->propagate_error ((deltaGlyphID = delta) == delta);
return_trace (true); return_trace (true);
} }
...@@ -231,15 +231,14 @@ struct SingleSubst ...@@ -231,15 +231,14 @@ struct SingleSubst
{ {
TRACE_SERIALIZE (this); TRACE_SERIALIZE (this);
if (unlikely (!c->extend_min (u.format))) return_trace (false); if (unlikely (!c->extend_min (u.format))) return_trace (false);
unsigned int format = 2; unsigned format = 2;
int delta = 0; unsigned delta = 0;
if (glyphs.length) if (glyphs.length)
{ {
format = 1; format = 1;
/* TODO(serialize) check for wrap-around */ delta = (unsigned) (substitutes[0] - glyphs[0]) & 0xFFFF;
delta = substitutes[0] - glyphs[0];
for (unsigned int i = 1; i < glyphs.length; i++) for (unsigned int i = 1; i < glyphs.length; i++)
if (delta != (int) (substitutes[i] - glyphs[i])) { if (delta != ((unsigned) (substitutes[i] - glyphs[i]) & 0xFFFF)) {
format = 2; format = 2;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册