diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index 01ec250c3..08781869f 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -210,9 +210,10 @@ struct hb_buffer_t HB_INTERNAL void clear_output (); HB_INTERNAL void clear_positions (); - HB_INTERNAL bool replace_glyphs (unsigned int num_in, - unsigned int num_out, - const hb_codepoint_t *glyph_data); + HB_INTERNAL HB_NODISCARD + bool replace_glyphs (unsigned int num_in, + unsigned int num_out, + const hb_codepoint_t *glyph_data); bool replace_glyph (hb_codepoint_t glyph_index) { diff --git a/src/hb-ot-shape-complex-hangul.cc b/src/hb-ot-shape-complex-hangul.cc index 533e928dc..2f1bf5e1a 100644 --- a/src/hb-ot-shape-complex-hangul.cc +++ b/src/hb-ot-shape-complex-hangul.cc @@ -231,7 +231,7 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan HB_UNUSED, chars[0] = 0x25CCu; chars[1] = u; } - buffer->replace_glyphs (1, 2, chars); + (void) buffer->replace_glyphs (1, 2, chars); } else { @@ -273,7 +273,7 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_codepoint_t s = SBase + (l - LBase) * NCount + (v - VBase) * TCount + tindex; if (font->has_glyph (s)) { - buffer->replace_glyphs (t ? 3 : 2, 1, &s); + (void) buffer->replace_glyphs (t ? 3 : 2, 1, &s); end = start + 1; continue; } @@ -323,9 +323,7 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_codepoint_t new_s = s + new_tindex; if (font->has_glyph (new_s)) { - buffer->replace_glyphs (2, 1, &new_s); - if (unlikely (!buffer->successful)) - break; + (void) buffer->replace_glyphs (2, 1, &new_s); end = start + 1; continue; } @@ -349,7 +347,7 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan HB_UNUSED, (!tindex || font->has_glyph (decomposed[2]))) { unsigned int s_len = tindex ? 3 : 2; - buffer->replace_glyphs (1, s_len, decomposed); + (void) buffer->replace_glyphs (1, s_len, decomposed); /* If we decomposed an LV because of a non-combining T following, * we want to include this T in the syllable. diff --git a/src/hb-ot-shape-normalize.cc b/src/hb-ot-shape-normalize.cc index 1453d2e3b..776e29902 100644 --- a/src/hb-ot-shape-normalize.cc +++ b/src/hb-ot-shape-normalize.cc @@ -229,7 +229,7 @@ handle_variation_selector_cluster (const hb_ot_shape_normalize_context_t *c, if (font->get_variation_glyph (buffer->cur().codepoint, buffer->cur(+1).codepoint, &buffer->cur().glyph_index())) { hb_codepoint_t unicode = buffer->cur().codepoint; - buffer->replace_glyphs (2, 1, &unicode); + (void) buffer->replace_glyphs (2, 1, &unicode); } else {