[buffer] HB_NODISCARD next_glyphs()

This commit is contained in:
Behdad Esfahbod 2021-03-15 14:08:08 -06:00
parent 4ae8aab83b
commit b05e5d9a79
3 changed files with 3 additions and 3 deletions

View File

@ -319,7 +319,7 @@ hb_buffer_t::swap_buffers ()
if (unlikely (!successful)) return;
assert (idx <= len);
next_glyphs (len - idx);
if (unlikely (!next_glyphs (len - idx))) return;
assert (have_output);
have_output = false;

View File

@ -280,7 +280,7 @@ struct hb_buffer_t
}
/* Copies n glyphs at idx to output and advance idx.
* If there's no output, just advance idx. */
bool next_glyphs (unsigned int n)
HB_NODISCARD bool next_glyphs (unsigned int n)
{
if (have_output)
{

View File

@ -348,7 +348,7 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan,
sizeof (buffer->info[0]),
&buffer->cur().glyph_index(),
sizeof (buffer->info[0]));
buffer->next_glyphs (done);
if (unlikely (!buffer->next_glyphs (done))) break;
}
while (buffer->idx < end && buffer->successful)
decompose_current_character (&c, might_short_circuit);