Commit Graph

82 Commits

Author SHA1 Message Date
Behdad Esfahbod 881ad720fe [algs] Remove passthru declaration
Let compiler figure it out.
2021-01-21 14:27:45 -07:00
Behdad Esfahbod ca0b7afee9 [set] Use hb_fill() 2021-01-21 12:22:00 -07:00
Garret Rieger 33368a12b7 uint32_t to unsigned in hb-set.hh 2021-01-21 12:12:05 -07:00
Garret Rieger 2a0d0b901f Make set clear work even when set is in failed state. 2021-01-21 12:12:05 -07:00
Garret Rieger 0ba73e980c [ENOMEM] handle allocation failures during page compaction. 2021-01-21 12:12:05 -07:00
Garret Rieger a4c3732f59 [ENOMEM] fix set clear() causing corruption if the set is in_error(). 2021-01-21 12:12:05 -07:00
Garret Rieger bbbcad0dbb Revert "[ENOMEM] don't perform set process operations if the other set is in an error state."
This reverts commit f3929abafe.
2020-09-16 12:23:38 -06:00
Garret Rieger f3929abafe [ENOMEM] don't perform set process operations if the other set is in an error state.
Running a process while the other set is in an error state can potentially corrupt this sets map map (for example by overwritting all of the major values with 0).
2020-09-16 10:36:30 -07:00
Behdad Esfahbod 689f3f57fa [set] Add << overload for range-sink 2020-04-24 08:16:03 -07:00
Ebrahim Byagowi 2dda6dd744 minor, tweak spacing
turn 8 spaces to tab, add space before Null/Crap
2020-04-20 16:18:29 +04:30
ariza d0aaba5c50 fixes oss-fuzz 20886
hb_set_t::resize () is needed after compact()
2020-02-26 09:35:32 -08:00
ariza 4081439d2a tweak reflecting review & add test cases 2020-02-25 15:03:12 -08:00
ariza de896278f7 coding & comment tweaks 2020-02-25 07:12:20 -08:00
ariza 173b745da8 fixed bug & added tests 2020-02-24 22:56:57 -08:00
ariza a5012e97c4 optimize hb_set_del_range()
fix issue #2193
2020-02-24 17:09:48 -08:00
Garret Rieger 5a10f3a055 Use vector instead of map during page compaction in hb-set. 2020-02-08 10:27:44 +03:30
Garret Rieger 2742c81624 Fix page_map corruption in hb_set_t during process().
If a process operation results in less pages then the current set has, it will likely corrupt the page_map since it overwrites page_map entries ahead of where it's processing. This fixes that problem by removing page_map entries that will be dropped. Then dropping orphaned pages and re-indexing retained pages.
2020-02-08 10:27:44 +03:30
Evgeniy Reizner b79ceac3c6 Prefer UINT_MAX instead of uint overflow.
Also, prefer HB_FEATURE_GLOBAL_START and HB_FEATURE_GLOBAL_END.
2019-12-15 11:46:05 -08:00
Behdad Esfahbod e5c7ee9f75 [set] Fix undefined-behavior shift in _previous()
harfbuzz/src/hb-set.hh:138:43: runtime error: shift exponent 64 is too large for 64-bit type 'hb_set_t::page_t::elt_t' (aka 'unsigned long long')
2019-11-20 14:22:01 -05:00
Behdad Esfahbod 78d5eca813 [set] Fix range-based-loop condition
Alternative to https://github.com/harfbuzz/harfbuzz/pull/2046
2019-11-18 13:09:29 -05:00
Ebrahim Byagowi b73313ade7 Don't seek of out-of-bound value even if the result is not used
Fixes this -fno-sanitize-recover=undefined fail,

/set/iter: hb-algs.hh:1016:60: runtime error: index 4294967295 out of bounds for type 'unsigned long long const[8]'
    #0 0x4d1e09 in hb_vector_size_t<unsigned long long, 64u>::operator[](unsigned int) const /home/user/code/harfbuzz/src/./hb-algs.hh:1016:60
    #1 0x4d8b5f in hb_set_t::page_t::previous(unsigned int*) const /home/user/code/harfbuzz/src/./hb-set.hh:139:53
    #2 0x4d0ada in hb_set_t::previous(unsigned int*) const /home/user/code/harfbuzz/src/./hb-set.hh:602:36
    #3 0x4cd76f in hb_set_previous /home/user/code/harfbuzz/src/hb-set.cc:494:15
    #4 0x4ca8af in test_set_iter /home/user/code/harfbuzz/test/api/test-set.c:310:3
    #5 0x7f3a4f3e0f49  (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72f49)
    #6 0x7f3a4f3e0e7a  (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72e7a)
    #7 0x7f3a4f3e1121 in g_test_run_suite (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x73121)
    #8 0x7f3a4f3e1140 in g_test_run (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x73140)
    #9 0x4c8894 in hb_test_run /home/user/code/harfbuzz/test/api/./hb-test.h:88:10
    #10 0x4c8894 in main /home/user/code/harfbuzz/test/api/test-set.c:408:10
    #11 0x7f3a4e3d2b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #12 0x41e7d9 in _start (/home/user/code/harfbuzz/test/api/test-set+0x41e7d9)
2019-09-18 23:16:52 +04:30
Ebrahim Byagowi a0b4ac4dce Turn 8 spaces to tab across the project
According to the current code style of the project
2019-08-27 02:40:41 +04:30
Behdad Esfahbod 4cb180d227 Revert "Use constexpr to replace passthru_ bools"
This reverts commit c4aa10ebc8.

Broke several compilers... Sigh.  The version without constexpr
didn't fully optimize out the unreachable code on clang.
So, revert it is...
2019-07-02 19:44:18 -07:00
Behdad Esfahbod c4aa10ebc8 Use constexpr to replace passthru_ bools 2019-07-02 19:15:03 -07:00
Behdad Esfahbod 08c3648c6e Oops, fix include 2019-05-17 16:21:34 -07:00
Behdad Esfahbod 24958b8868 [set] Use StructAtOffsetUnaligned 2019-05-17 16:20:36 -07:00
Behdad Esfahbod f7a458510d Add hb_bitwise_* ops 2019-05-15 16:53:12 -07:00
Behdad Esfahbod 889dc1eb06 [iter] Remove sort categorization
See comments.
2019-05-14 22:28:07 -07:00
Behdad Esfahbod 513762849a [iter] Track strictly-sorted iterators
This make output of hb_enumerate() sorted regardless of input iterator.
2019-05-13 15:36:14 -07:00
Behdad Esfahbod 4c2fd05ca5 [iter] Implement range-based for loops
Part of https://github.com/harfbuzz/harfbuzz/issues/1648
2019-05-06 19:57:35 -07:00
Behdad Esfahbod 824fd342d5 Rename a few macros 2019-04-11 11:16:01 -04:00
Behdad Esfahbod 5bffa9e375 More 2019-04-02 20:13:16 -07:00
Behdad Esfahbod 849a0f1758 [iter] Add hb_iter_with_fallback_t instead 2019-01-29 17:10:19 -08:00
Behdad Esfahbod 4d40ed9d1a [iter] Add hb_iter_with_mixin_t<> 2019-01-29 13:55:23 -08:00
Behdad Esfahbod 84a25d79c6 [iter] Rename 2019-01-29 13:39:19 -08:00
Behdad Esfahbod a30e13469e [iter] Add operator << to set / vector 2019-01-28 16:39:01 -05:00
Behdad Esfahbod d438e61042 [iter] Fix operator() impls 2019-01-28 16:34:04 -05:00
Behdad Esfahbod 090fe56dc6 Merge branch 'master' into iter 2019-01-25 16:06:52 +01:00
Behdad Esfahbod 70a52d6bd8 Convert all other enum class consts to static constexpr
Fixes https://github.com/harfbuzz/harfbuzz/issues/1553
2019-01-22 12:17:26 +01:00
Behdad Esfahbod c1cbbb9459 Use static constexpr for large class constants 2019-01-22 10:51:20 +01:00
Behdad Esfahbod a7de144df3 Implement uniform map interface
Coverage, ClassDef, hb_set_t, and hb_map_t implement.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 636786ecaf [iter] Rename __item_type__ to __item_t__ 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 815cde9fa3 [iter] Use is_sorted_iterator 2019-01-20 20:12:12 -05:00
Behdad Esfahbod b5d6fe1a45 [iter] Remove hb_sorted_iter_t
Not enforcing it using type hierarchy.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 5ec11ce13a [iter] Clarify readonly vs lvalue iterators
lvalue iterators must declare __item_type__ as a reference.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 6dc4a1c9b1 [iter] Remove const_iter 2019-01-20 20:12:12 -05:00
Behdad Esfahbod d3976b7e63 [iter] Make them work, mostly 2019-01-20 20:12:12 -05:00
Behdad Esfahbod bd1318b8cc Use static constexpr for large class constants 2019-01-20 19:47:52 -05:00
Behdad Esfahbod 043b610fa6 Fix sign compare warnings
../../third_party/harfbuzz-ng/src/src/hb-map.hh(56,45):  warning: comparison of integers of different signs: 'const hb_codepoint_t' (aka 'const unsigned int') and 'hb_map_t::(anonymous enum at ../../third_party/harfbuzz-ng/src/src/hb-map.hh:169:3)' [-Wsign-compare]
    bool is_unused () const    { return key == INVALID; }
2019-01-19 09:21:33 -05:00
Behdad Esfahbod fa333e34d6 [vector] Remove static_array
Was good idea, but with C++ types with constructor/destructor, was getting in
the way as compiler was destructing those items where it was not desired.
Since C++ does not allow zero-sized arrays, just remove it...
2018-12-27 17:56:22 -05:00