diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-digest-private.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-digest-private.hh | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-digest-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-digest-private.hh index 9135136c00a..e099a826414 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-digest-private.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-set-digest-private.hh @@ -71,7 +71,7 @@ struct hb_set_digest_lowest_bits_t mask |= mask_for (g); } - inline void add_range (hb_codepoint_t a, hb_codepoint_t b) { + inline bool add_range (hb_codepoint_t a, hb_codepoint_t b) { if ((b >> shift) - (a >> shift) >= mask_bits - 1) mask = (mask_t) -1; else { @@ -79,6 +79,27 @@ struct hb_set_digest_lowest_bits_t mask_t mb = mask_for (b); mask |= mb + (mb - ma) - (mb < ma); } + return true; + } + + template <typename T> + inline void add_array (const T *array, unsigned int count, unsigned int stride=sizeof(T)) + { + for (unsigned int i = 0; i < count; i++) + { + add (*array); + array = (const T *) (stride + (const char *) array); + } + } + template <typename T> + inline bool add_sorted_array (const T *array, unsigned int count, unsigned int stride=sizeof(T)) + { + for (unsigned int i = 0; i < count; i++) + { + add (*array); + array = (const T *) (stride + (const char *) array); + } + return true; } inline bool may_have (hb_codepoint_t g) const { @@ -108,9 +129,23 @@ struct hb_set_digest_combiner_t tail.add (g); } - inline void add_range (hb_codepoint_t a, hb_codepoint_t b) { + inline bool add_range (hb_codepoint_t a, hb_codepoint_t b) { head.add_range (a, b); tail.add_range (a, b); + return true; + } + template <typename T> + inline void add_array (const T *array, unsigned int count, unsigned int stride=sizeof(T)) + { + head.add_array (array, count, stride); + tail.add_array (array, count, stride); + } + template <typename T> + inline bool add_sorted_array (const T *array, unsigned int count, unsigned int stride=sizeof(T)) + { + head.add_sorted_array (array, count, stride); + tail.add_sorted_array (array, count, stride); + return true; } inline bool may_have (hb_codepoint_t g) const { |