Commit Graph

130 Commits

Author SHA1 Message Date
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
Behdad Esfahbod 2e48fd0779 Sprinkle constexpr around
Being conservative.  Also not sure it makes any real difference
in our codebase.
2019-07-02 17:55:58 -07:00
Behdad Esfahbod ec8e635e0c [ucd] Use custom encoding to shrink composition data
Saves another 2.5kb.

Part of https://github.com/harfbuzz/harfbuzz/issues/1652
2019-06-24 12:37:23 -07:00
Behdad Esfahbod 60653a7adb Remove HB_VECTOR_SIZE
It was cumbersome to get it to work reliably, for dubious performance
gain, mostly in the subsetter maybe...

Life is easier without.  It was disabled forever anyway.
2019-06-18 13:01:11 -07:00
Behdad Esfahbod 24060d3aa7 Add hb_bitwise_neg 2019-06-18 12:50:42 -07:00
Behdad Esfahbod 7cf9169078 Remove accidentally left cruft 2019-06-18 12:44:03 -07:00
Behdad Esfahbod ff9b9b1c89 Simplify HB_PARTIALIZE impl
+this works on gcc 4.8 as well as default code path.
2019-06-10 12:48:25 -07:00
Behdad Esfahbod 451edbd4d0 Revert "Test new solution for HB_PARTIALIZE"
This reverts commit a0c4900799.
2019-06-10 12:46:54 -07:00
Behdad Esfahbod a0c4900799 Test new solution for HB_PARTIALIZE
Just testing bots.  Will finish based on results.
2019-06-10 12:33:23 -07:00
Ebrahim Byagowi 9407ef8d4b
minor, add HB_USE_INTERNAL_QSORT
The only thing I need for a working wasm in a minimum libc,
otherwise I have to provide the very same qsort inside that libc
2019-06-10 15:17:43 +04:30
Ebrahim Byagowi c4669fda78
[algs] minor 2019-06-09 11:50:36 +04:30
Ebrahim Byagowi eff579f743 Update and use internal qsort everywhere 2019-06-08 12:53:27 -07:00
Behdad Esfahbod 973699c49b Disable clang gcc impersonator 2019-06-07 12:49:06 -07:00
Behdad Esfahbod e4e518f33d Fix build on gcc 4.8
Fixes https://github.com/harfbuzz/harfbuzz/issues/1724
2019-06-07 12:41:09 -07:00
Eli Zaretskii d5e5f37832 This makes minor changes to allow building HarfBuzz with
mingw.org's MinGW.

src/hb-algs.hh: Don't compile _BitScanForward and _BitScanReverse
for GCC >= 4.  mingw.org's MinGW doesn't have these functions.

src/hb-atomic.hh: MemoryBarrier does exist in mingw.org's MinGW,
but it is not a macro, it is an inline function.  __MINGW32_VERSION
is a macro that exists only in mingw.org's MinGW, so conditioning
on it should not affect MinGW64, where MemoryBarrier is a macro.

src/hb-uniscribe.cc: Define E_NOT_SUFFICIENT_BUFFER if it is not
defined (mingw.org's MinGW doesn't).

src/hb.hh: Don't include intrin.h for mingw.org's MinGW, since that
header is not available; instead, include windows.h.  Conditioned
on __MINGW32_VERSION to avoid affecting MinGW64.
2019-06-05 14:37:51 -07:00
Ebrahim Byagowi 760eb1bf93
Reapply possible bsearch overflow fix
Originally introduced in 21ede86 (#1314) but as it wasn't applied to hb_bsearch
accidentally removed while merging hb_bsearch_r to it.
2019-06-03 05:48:04 -07:00
Ebrahim Byagowi 8278ff7dce
minor 2019-06-02 00:36:30 +04:30
Ebrahim Byagowi 33d38e793e
Use a unified bsearch (#1741)
A part of #593
2019-06-02 00:19:57 +04:30
Behdad Esfahbod 619f5f1eb9 Fourth try at building VS bots
Based on https://github.com/harfbuzz/harfbuzz/issues/1730#issuecomment-497151210
2019-05-31 22:49:34 -07:00
Behdad Esfahbod aba3888d93 Third try at fixing VS build
https://github.com/harfbuzz/harfbuzz/issues/1730
2019-05-31 22:49:34 -07:00
Behdad Esfahbod 8aaecbb583 Second VS fix try
https://github.com/harfbuzz/harfbuzz/issues/1730
2019-05-31 22:49:34 -07:00