diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-10-24 22:11:52 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-10-24 22:11:52 +0000 |
commit | 37168eec334581d5ef08daea94feafa0c1d904fd (patch) | |
tree | 87aed08220cb78210167f5d65b1dc4aeaa6f7c65 /Build/source/libs/harfbuzz/harfbuzz-src/src | |
parent | b493e58b4908b064bfb15670052a5b7817f6a860 (diff) |
harfbuzz 1.6.2. It does not yet compile since works for c++11 configuration are not done
git-svn-id: svn://tug.org/texlive/trunk@45593 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src')
6 files changed, 47 insertions, 50 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc index a00803c98d0..01d15f48e8b 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc @@ -332,13 +332,13 @@ hb_icu_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs HB_UNUSED, /* Normalise the codepoint using NFKD mode. */ icu_err = U_ZERO_ERROR; len = unorm2_normalize (unorm2_getNFKDInstance (&icu_err), utf16, len, normalized, ARRAY_LENGTH (normalized), &icu_err); - if (icu_err) + if (U_FAILURE (icu_err)) return 0; /* Convert the decomposed form from UTF-16 to UTF-32. */ icu_err = U_ZERO_ERROR; u_strToUTF32 ((UChar32*) decomposed, HB_UNICODE_MAX_DECOMPOSITION_LEN, &utf32_len, normalized, len, &icu_err); - if (icu_err) + if (U_FAILURE (icu_err)) return 0; return utf32_len; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh index 4abd4b715df..e695d788200 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos-private.hh @@ -160,7 +160,7 @@ struct hb_collect_glyphs_context_t : return HB_VOID; /* Return if new lookup was recursed to before. */ - if (recursed_lookups.has (lookup_index)) + if (recursed_lookups->has (lookup_index)) return HB_VOID; hb_set_t *old_before = before; @@ -176,7 +176,7 @@ struct hb_collect_glyphs_context_t : input = old_input; after = old_after; - recursed_lookups.add (lookup_index); + recursed_lookups->add (lookup_index); return HB_VOID; } @@ -187,7 +187,7 @@ struct hb_collect_glyphs_context_t : hb_set_t *after; hb_set_t *output; recurse_func_t recurse_func; - hb_set_t recursed_lookups; + hb_set_t *recursed_lookups; unsigned int nesting_level_left; unsigned int debug_depth; @@ -203,15 +203,15 @@ struct hb_collect_glyphs_context_t : after (glyphs_after ? glyphs_after : hb_set_get_empty ()), output (glyphs_output ? glyphs_output : hb_set_get_empty ()), recurse_func (nullptr), - recursed_lookups (), + recursed_lookups (nullptr), nesting_level_left (nesting_level_left_), debug_depth (0) { - recursed_lookups.init (); + recursed_lookups = hb_set_create (); } ~hb_collect_glyphs_context_t (void) { - recursed_lookups.fini (); + hb_set_destroy (recursed_lookups); } void set_recurse_func (recurse_func_t func) { recurse_func = func; } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc index 9d1d6f74846..624132d8961 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc @@ -939,18 +939,19 @@ hb_ot_shape_glyphs_closure (hb_font_t *font, for (unsigned int i = 0; i < count; i++) add_char (font, buffer->unicode, mirror, info[i].codepoint, glyphs); - hb_set_t lookups; - lookups.init (); - hb_ot_shape_plan_collect_lookups (shape_plan, HB_OT_TAG_GSUB, &lookups); + hb_set_t *lookups = hb_set_create (); + hb_ot_shape_plan_collect_lookups (shape_plan, HB_OT_TAG_GSUB, lookups); /* And find transitive closure. */ - hb_set_t copy; - copy.init (); + hb_set_t *copy = hb_set_create (); do { - copy.set (glyphs); - for (hb_codepoint_t lookup_index = -1; hb_set_next (&lookups, &lookup_index);) + copy->set (glyphs); + for (hb_codepoint_t lookup_index = -1; hb_set_next (lookups, &lookup_index);) hb_ot_layout_lookup_substitute_closure (font->face, lookup_index, glyphs); - } while (!copy.is_equal (glyphs)); + } while (!copy->is_equal (glyphs)); + hb_set_destroy (copy); + + hb_set_destroy (lookups); hb_shape_plan_destroy (shape_plan); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh index 3d617e2a595..b139ed67289 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh @@ -340,7 +340,7 @@ _hb_popcount64 (uint64_t mask) if (sizeof (long) >= sizeof (mask)) return __builtin_popcountl (mask); #endif - return _hb_popcount32 (mask) + _hb_popcount32 (mask >> 32); + return _hb_popcount32 (mask & 0xFFFFFFFF) + _hb_popcount32 (mask >> 32); } template <typename T> static inline unsigned int _hb_popcount (T mask); template <> inline unsigned int _hb_popcount<uint32_t> (uint32_t mask) { return _hb_popcount32 (mask); } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-private.hh index 689766c130c..0454a1896e0 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-private.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-private.hh @@ -156,6 +156,7 @@ struct hb_set_t elt_t const &elt (hb_codepoint_t g) const { return v[(g & MASK) / ELT_BITS]; } elt_t mask (hb_codepoint_t g) const { return elt_t (1) << (g & ELT_MASK); } }; + static_assert (page_t::PAGE_BITS == sizeof (page_t) * 8, ""); hb_object_header_t header; ASSERT_POD (); @@ -175,15 +176,6 @@ struct hb_set_t return true; } - inline void init (void) { - hb_object_init (this); - page_map.init (); - pages.init (); - } - inline void fini (void) { - page_map.finish (); - pages.finish (); - } inline void clear (void) { if (unlikely (hb_object_is_inert (this))) return; @@ -282,11 +274,11 @@ struct hb_set_t { if (unlikely (in_error)) return; - int na = pages.len; - int nb = other->pages.len; + unsigned int na = pages.len; + unsigned int nb = other->pages.len; unsigned int count = 0; - int a = 0, b = 0; + unsigned int a = 0, b = 0; for (; a < na && b < nb; ) { if (page_map[a].major == other->page_map[b].major) @@ -317,32 +309,35 @@ struct hb_set_t return; /* Process in-place backward. */ - a = na - 1, b = nb - 1; - for (; a >= 0 && b >= 0; ) + a = na; + b = nb; + for (; a && b; ) { if (page_map[a].major == other->page_map[b].major) { - Op::process (page_at (--count).v, page_at (a).v, other->page_at (b).v); a--; b--; + Op::process (page_at (--count).v, page_at (a).v, other->page_at (b).v); } else if (page_map[a].major > other->page_map[b].major) { + a--; if (Op::passthru_left) page_at (--count).v = page_at (a).v; - a--; } else { + b--; if (Op::passthru_right) page_at (--count).v = other->page_at (b).v; - b--; } } - while (a >= 0) - page_at (--count).v = page_at (--a).v; - while (b >= 0) - page_at (--count).v = other->page_at (--b).v; + if (Op::passthru_left) + while (a) + page_at (--count).v = page_at (--a).v; + if (Op::passthru_right) + while (b) + page_at (--count).v = other->page_at (--b).v; assert (!count); } @@ -369,14 +364,14 @@ struct hb_set_t return *codepoint != INVALID; } - page_map_t map = {major (*codepoint), 0}; + page_map_t map = {get_major (*codepoint), 0}; unsigned int i; page_map.bfind (&map, &i); if (i < page_map.len) { if (pages[page_map[i].index].next (codepoint)) { - *codepoint += page_map[i].major * PAGE_SIZE; + *codepoint += page_map[i].major * page_t::PAGE_BITS; return true; } i++; @@ -386,7 +381,7 @@ struct hb_set_t hb_codepoint_t m = pages[page_map[i].index].get_min (); if (m != INVALID) { - *codepoint = page_map[i].major * PAGE_SIZE + m; + *codepoint = page_map[i].major * page_t::PAGE_BITS + m; return true; } } @@ -424,7 +419,7 @@ struct hb_set_t unsigned int count = pages.len; for (unsigned int i = 0; i < count; i++) if (!page_at (i).is_empty ()) - return page_map[i].major * PAGE_SIZE + page_at (i).get_min (); + return page_map[i].major * page_t::PAGE_BITS + page_at (i).get_min (); return INVALID; } inline hb_codepoint_t get_max (void) const @@ -432,16 +427,15 @@ struct hb_set_t unsigned int count = pages.len; for (int i = count - 1; i >= 0; i++) if (!page_at (i).is_empty ()) - return page_map[i].major * PAGE_SIZE + page_at (i).get_max (); + return page_map[i].major * page_t::PAGE_BITS + page_at (i).get_max (); return INVALID; } - static const unsigned int PAGE_SIZE = sizeof (page_t) * 8; static const hb_codepoint_t INVALID = HB_SET_VALUE_INVALID; page_t *page_for_insert (hb_codepoint_t g) { - page_map_t map = {major (g), pages.len}; + page_map_t map = {get_major (g), pages.len}; unsigned int i; if (!page_map.bfind (&map, &i)) { @@ -456,7 +450,7 @@ struct hb_set_t } page_t *page_for (hb_codepoint_t g) { - page_map_t key = {major (g)}; + page_map_t key = {get_major (g)}; const page_map_t *found = page_map.bsearch (&key); if (found) return &pages[found->index]; @@ -464,7 +458,7 @@ struct hb_set_t } const page_t *page_for (hb_codepoint_t g) const { - page_map_t key = {major (g)}; + page_map_t key = {get_major (g)}; const page_map_t *found = page_map.bsearch (&key); if (found) return &pages[found->index]; @@ -472,7 +466,7 @@ struct hb_set_t } page_t &page_at (unsigned int i) { return pages[page_map[i].index]; } const page_t &page_at (unsigned int i) const { return pages[page_map[i].index]; } - unsigned int major (hb_codepoint_t g) const { return g / PAGE_SIZE; } + unsigned int get_major (hb_codepoint_t g) const { return g / page_t::PAGE_BITS; } }; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.cc index d33e525de4a..e2c788225d5 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set.cc @@ -45,7 +45,8 @@ hb_set_create (void) if (!(set = hb_object_create<hb_set_t> ())) return hb_set_get_empty (); - set->clear (); + set->page_map.init (); + set->pages.init (); return set; } @@ -95,7 +96,8 @@ hb_set_destroy (hb_set_t *set) { if (!hb_object_destroy (set)) return; - set->fini (); + set->page_map.finish (); + set->pages.finish (); free (set); } |