From f998bb2086342d6fdcd4295593eddea91396e0b6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 30 Nov 2018 12:52:21 -0500 Subject: [PATCH] More weird fixes In file included from hb-ot-name.cc:29: hb-ot-name-table.hh: In member function 'unsigned int OT::name::get_size() const': hb-ot-name-table.hh:157: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: hb-open-type.hh:354: note: candidate 1: const Type& OT::UnsizedArrayOf::operator[](unsigned int) const [with Type = OT::NameRecord] hb-ot-name-table.hh:157: note: candidate 2: operator[](const T*, int) hb-ot-name-table.hh: In member function 'void OT::name::accelerator_t::init(hb_face_t*)': hb-ot-name-table.hh:196: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: hb-dsalgs.hh:574: note: candidate 1: Type& hb_array_t::operator[](unsigned int) const [with Type = const OT::NameRecord] hb-ot-name-table.hh:196: note: candidate 2: operator[](T*, int) hb-ot-name-table.hh:197: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: hb-dsalgs.hh:574: note: candidate 1: Type& hb_array_t::operator[](unsigned int) const [with Type = const OT::NameRecord] hb-ot-name-table.hh:197: note: candidate 2: operator[](T*, int) hb-ot-name-table.hh:198: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: hb-dsalgs.hh:574: note: candidate 1: Type& hb_array_t::operator[](unsigned int) const [with Type = const OT::NameRecord] hb-ot-name-table.hh:198: note: candidate 2: operator[](T*, int) make[4]: *** [libharfbuzz_la-hb-ot-name.lo] Error 1 make[3]: *** [all-recursive] Error 1 --- src/hb-ot-name-table.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh index 4f24d7372..a903e1cdd 100644 --- a/src/hb-ot-name-table.hh +++ b/src/hb-ot-name-table.hh @@ -154,7 +154,7 @@ struct name enum { tableTag = HB_OT_TAG_name }; inline unsigned int get_size (void) const - { return min_size + count * nameRecordZ[0].min_size; } + { return min_size + count * nameRecordZ.item_size; } inline bool sanitize_records (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -189,7 +189,7 @@ struct name this->names.init (); this->names.alloc (all_names.len); - for (uint16_t i = 0; i < all_names.len; i++) + for (unsigned int i = 0; i < all_names.len; i++) { hb_ot_name_entry_t *entry = this->names.push ();