From cf975ac653bff369f4ed7ba7fc04fae6ce2cec95 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 11 Oct 2018 14:07:44 -0400 Subject: [PATCH] Remove use of deprecated function --- src/hb-ot-layout.cc | 23 ++++++++++++----------- src/hb-ot-layout.h | 12 ++++++------ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 468d51708..8c9184251 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -482,12 +482,12 @@ hb_ot_layout_script_find_language (hb_face_t *face, } hb_bool_t -hb_ot_layout_script_select_language (hb_face_t *face, - hb_tag_t table_tag, - unsigned int script_index, - unsigned int language_count, - hb_tag_t *language_tags, - unsigned int *language_index /* OUT */) +hb_ot_layout_script_select_language (hb_face_t *face, + hb_tag_t table_tag, + unsigned int script_index, + unsigned int language_count, + const hb_tag_t *language_tags, + unsigned int *language_index /* OUT */) { static_assert ((OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX), ""); const OT::Script &s = get_gsubgpos_table (face, table_tag).get_script (script_index); @@ -772,11 +772,12 @@ _hb_ot_layout_collect_features_languages (hb_face_t *face, for (; *languages; languages++) { unsigned int language_index; - if (hb_ot_layout_script_find_language (face, - table_tag, - script_index, - *languages, - &language_index)) + if (hb_ot_layout_script_select_language (face, + table_tag, + script_index, + 1, + languages, + &language_index)) _hb_ot_layout_collect_features_features (face, table_tag, script_index, diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h index ab149cf26..eb0df8936 100644 --- a/src/hb-ot-layout.h +++ b/src/hb-ot-layout.h @@ -135,12 +135,12 @@ hb_ot_layout_script_get_language_tags (hb_face_t *face, hb_tag_t *language_tags /* OUT */); HB_EXTERN hb_bool_t -hb_ot_layout_script_select_language (hb_face_t *face, - hb_tag_t table_tag, - unsigned int script_index, - unsigned int language_count, - hb_tag_t *language_tags, - unsigned int *language_index /* OUT */); +hb_ot_layout_script_select_language (hb_face_t *face, + hb_tag_t table_tag, + unsigned int script_index, + unsigned int language_count, + const hb_tag_t *language_tags, + unsigned int *language_index /* OUT */); HB_EXTERN hb_bool_t hb_ot_layout_language_get_required_feature_index (hb_face_t *face,