Commit Graph

150 Commits

Author SHA1 Message Date
Behdad Esfahbod c0f57ccc88 [algs] Add default-construtor to hb_pair_t 2022-01-16 07:01:05 -07:00
Behdad Esfahbod 8a69e00639 [meta] Use std::addressof() instead of hb_addressof() 2022-01-13 16:17:34 -07:00
Behdad Esfahbod 47afb3ef04 [meta] Replace hb_is_pointer with std::is_pointer 2022-01-13 15:27:41 -07:00
Behdad Esfahbod 985b63b3ee [map] Allow invalid items to be pointer to static object
By derefencing them when necessary.

Also, we do not rely on trivially-copyable, so remove that assertion.
2022-01-13 13:33:07 -07:00
Behdad Esfahbod 1e27f95dc1 [algs] Add hb_coerce() 2022-01-13 13:10:47 -07:00
Behdad Esfahbod cfe2b66114 [algs] Fix hash chaining to std::hash() 2022-01-13 12:18:59 -07:00
Behdad Esfahbod 53847dba92 [algs] Call std::hash from hb_hash() 2022-01-12 10:35:28 -07:00
Behdad Esfahbod 943921cf0c [meta] Use more std type_traits 2021-11-02 00:26:46 -06:00
Behdad Esfahbod 6d555ce82e [meta] Use std::forward instead of hb_forward() 2021-11-02 00:18:22 -06:00
Behdad Esfahbod 30c05e8b55 [algs] include <new> 2021-11-01 23:57:00 -06:00
Behdad Esfahbod 3604f5f248 [algs] Include <initializer_list> 2021-11-01 22:37:42 -06:00
Behdad Esfahbod 8c05569930 [algs] Add hb_swap() ala, and using, std::swap()
Use it in vector.

Use ADL idiom.
2021-11-01 17:59:17 -06:00
Behdad Esfahbod f09d5ed0f5 [algs] Remove hb_bitwise_non() 2021-08-19 13:06:10 -06:00
Behdad Esfahbod b94f24ec79 [bit-set-invertible] Implement set algebra 2021-08-19 00:48:00 -06:00
Behdad Esfahbod 6afefe1dc3 [algs] Remove unnecessary struct tag names 2021-08-19 00:27:03 -06:00
Behdad Esfahbod bf2c87bfe6 Add hb_memcpy() that does len=0 check 2021-07-27 13:26:00 -06:00
Behdad Esfahbod cc16b26ef4 [constexpr] IntType
See https://github.com/harfbuzz/harfbuzz/pull/2875
2021-02-22 21:59:56 -07:00
Behdad Esfahbod c55bf55154 Remove HB_CONST_FUNC and HB_PURE_FUNC
They are not necessary for inline functions.
2021-02-20 15:45:12 -07:00
Behdad Esfahbod cba9893ac5 m[algs] Move roundf() here 2021-02-20 15:44:47 -07:00
Behdad Esfahbod 69464e9da0 [algs] Another try at fixing BEInt constexpr
../src/hb-algs.hh:120:3: error: body of constexpr function ‘constexpr BEInt<Type, 2>::operator Type() const [with Type = short unsigned int]’ not a return-statement
2021-02-20 15:42:44 -07:00
Behdad Esfahbod ff7bf88192 m[algs] Fix BEInt -Wnarrowing errors 2021-02-20 15:39:29 -07:00
Behdad Esfahbod e208f80449 Make constexpr BEInt<Type, 2>::operator Type() C++11-compatible
Multiple return values not permitted until C++14
2021-02-20 15:31:43 -07:00
Behdad Esfahbod 47f01c0726 m[algs] Move BEInt here 2021-02-20 15:14:50 -07:00
Behdad Esfahbod e1706ffecd m [algs] Move flags here 2021-02-20 15:11:26 -07:00
Behdad Esfahbod ed04174a64 Whitespace 2021-02-09 18:48:05 -07:00
Behdad Esfahbod 921b4e46b0 [algs] Add hb_equal()
Use in hb_array_t::lfind()
2021-02-01 11:30:39 -08:00
Behdad Esfahbod 881ad720fe [algs] Remove passthru declaration
Let compiler figure it out.
2021-01-21 14:27:45 -07:00
Behdad Esfahbod 7c241651ac [algs] Don't forward rvalue twice
Part of https://github.com/harfbuzz/harfbuzz/issues/2293
2020-11-30 16:38:53 -07:00
David Corbett b207eab842 Round-trip OpenType tags through BCP 47 2020-05-15 15:00:15 -07:00
Ebrahim Byagowi 818f109bde Use float in avar calculation instead ints and checking their overflows 2020-04-17 00:53:39 +04:30
Ebrahim Byagowi 9ffa50fe5d Add an appropriate fallback to hb_int_mul_overflows 2020-04-17 00:38:38 +04:30
Ebrahim Byagowi 96d792ae80 [avar] Prevent mul overflow
Fixes https://crbug.com/oss-fuzz/21350
2020-03-26 15:01:14 +00:00
Ebrahim Byagowi b398748d8b
[algs] Add hb_clamp
Similar to stl and glsl's clamp
2020-03-04 11:18:19 +03:30
Behdad Esfahbod fa7edf87c9 [bsearch] Massage API some more 2019-12-09 17:51:41 -06:00
Behdad Esfahbod 70aa5071d8 [algs] Adjust return value of hb_ctz(0) to be 32 instead of 0 2019-12-09 17:48:10 -06:00
Behdad Esfahbod 48eef2724c [algs/array] Consolidate the last two bsearch implementations!
Yay!  Seems to work.
2019-12-06 05:04:11 +00:00
Behdad Esfahbod ed35dea8c0 Fourth try... sighs 2019-12-06 04:37:11 +00:00
Behdad Esfahbod 34f5cc2cc8 Second try at fixing build 2019-12-06 04:09:33 +00:00
Behdad Esfahbod 14ce5ab0b7 First try at fixing build errors 2019-12-06 03:54:46 +00:00
Behdad Esfahbod 2274270c6a [algs] Streamline bsearch some more 2019-12-06 03:42:21 +00:00
Behdad Esfahbod bd55d4b49f [algs] Streamline bsearch() API more towards hb_array_t::bsearch_impl()
Preparing to merge the two finally!
2019-12-06 03:35:24 +00:00
Ebrahim Byagowi 670fec231d Minor, add a zero length tolerant memset, hb_memset 2019-10-10 09:21:08 +03:30
Ebrahim Byagowi 65690b5a4b [number] Add whole buffer check and test it 2019-09-04 02:04:09 +04:30
Ebrahim Byagowi 3661eb6105 Don't check null terminaion of source in hb_codepoint_parse
This isn't what intended originally, just checking if consumed
all the buffer is enough.
2019-09-04 02:04:09 +04:30
Ebrahim Byagowi b5e6805ee7 [number] Minor tweak on parser related codes 2019-09-04 02:04:09 +04:30
Ebrahim Byagowi a77bb7eb41 Move hb_codepoint_parse to hb_parse_uint 2019-09-04 02:04:09 +04:30
Behdad Esfahbod 3bc86fb237 [algs] Fix hb_inc/dec signature 2019-08-31 12:24:56 -05:00
Behdad Esfahbod 2d5643aed4 [algs] Add hb_inc() and hb_dec()) 2019-08-31 12:24:56 -05:00
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