Commit Graph

150 Commits

Author SHA1 Message Date
Behdad Esfahbod 2337f0d047 Internally use hb_malloc/.../hb_free instead of malloc/.../free
Redefining those stock names as macros was conflicting with gcc 10
headers.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3044
2021-07-08 10:54:09 -07:00
Behdad Esfahbod ed2ee8a8c2 Revert "Disable -Wunused-macros under GCC"
This reverts commit 1b1413246b.

Err. It wasn't working. We already have that disabled in the files it
is warning about. Doesn't work.
2021-04-16 13:53:43 -06:00
Behdad Esfahbod 1b1413246b Disable -Wunused-macros under GCC
Since the pragram in hb-ot-shape-complex-indic-table.cc didn't seem to
silence GCC, eg:

../../src/hb-ot-shape-complex-indic-table.cc:55: warning: macro "ISC_TL" is not used [-Wunused-macros]
   55 | #define ISC_TL   INDIC_SYLLABIC_CATEGORY_TONE_LETTER                 /*    7 chars; Tone_Letter */

disable it at compiler level.
2021-04-16 13:32:02 -06:00
Behdad Esfahbod 2397689387 Remove hb_success_t
Was not rolled-out yet.  So just expand.
2021-03-29 17:49:16 -06:00
Behdad Esfahbod 05e845c49a Make previous commit gcc-only 2021-03-29 16:02:10 -07:00
Behdad Esfahbod b5e4032392 -Wno-unused-result
GCC doesn't let one turn off the warning using "(void) foo()".
People have introduced macros that do "unused << foo()" instead.
Until we do something similar, silence gcc.

Clang on the other hand understands "(void) foo()".
2021-03-29 15:57:36 -07:00
Behdad Esfahbod 7cb22ba7eb
Include C headers with their C++ names (#2882)
Remove unnecessary includes.

Fixes build with some known broken SDKs (Nintendo Switch?)

https://en.cppreference.com/w/cpp/header

Fixes https://github.com/harfbuzz/harfbuzz/pull/2881
2021-03-01 11:44:06 -08:00
Behdad Esfahbod a3c35aee30 m Move HB_SCRIPT_MYANMAR_ZAWGYI 2021-02-20 15:45:34 -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 f0947717ff m[machinery] Move HB_VAR_ARRAY here 2021-02-20 15:44:25 -07:00
Behdad Esfahbod a89d9f25b4 m Err on -Wnarrowing instead of -Wc++11-narrowing
On clang, -Wnarrowing is synonym for -Wc++11-narrowing.
On gcc it isn't. So, use the widely-available one
2021-02-20 15:38:05 -07:00
Behdad Esfahbod 47f01c0726 m[algs] Move BEInt here 2021-02-20 15:14:50 -07:00
Behdad Esfahbod e5b7bc424d m Add default value to BEInt<> Size template parameter 2021-02-20 15:14:15 -07:00
Behdad Esfahbod 2caae4a59a m Move class traits 2021-02-20 15:13:52 -07:00
Behdad Esfahbod c2dbd6cc0f Remove static_assert of sizeof basic sized int types 2021-02-20 15:11:47 -07:00
Behdad Esfahbod e1706ffecd m [algs] Move flags here 2021-02-20 15:11:26 -07:00
Behdad Esfahbod 017f6b0d24 m Move static_assert_expr<> 2021-02-20 15:11:14 -07:00
Behdad Esfahbod 61f8d0e57d m Rename ASSERT_STATIC_EXPR_ZERO to static_assert_expr 2021-02-20 15:08:19 -07:00
Behdad Esfahbod 59cfffb1af m Change ASSERT_STATIC_EXPR_ZERO template arg type to bool 2021-02-20 15:07:28 -07:00
Behdad Esfahbod 1981d83d7f [constexpr] HB_MARK_AS_FLAG_T 2021-02-20 15:07:14 -07:00
Behdad Esfahbod a4a99de0eb [constexpr] bswap 2021-02-20 15:07:07 -07:00
Behdad Esfahbod f8ebe1dacd [constexpr] BEInt 2021-02-20 15:06:12 -07:00
Behdad Esfahbod 86993c09a1 Ignore -Wrange-loop-analysis
Fixes https://github.com/harfbuzz/harfbuzz/issues/2834
2021-02-19 17:10:06 -07:00
Ebrahim Byagowi 0ca3557048 Turn -Wunused-but-set-variable to warning
As #2555 turned out some glib headers are imposing that so let's turn it to warning
2020-08-12 00:38:00 +04:30
Ebrahim Byagowi 7c433ffde2
Add HB_CUSTOM_MALLOC definition
So one can use just HB_CUSTOM_MALLOC instead need for define each of hb_*alloc_impl
2020-07-15 09:38:12 +04:30
Hugo Beauzée-Luyssen 40ec187dec win32: Cleanup PARTITION handling
Use the WINAPI_PARTITION macro to filter desktop/app flavors.
We use a negated desktop check because the default (for mingw-w64 at
least) is to allow all API by combining desktop + app partitions.
This causes build failures if we were to filter using
WINAPI_PARTITION(WINAPI_FAMILY_APP) because it would always be true, but
those API also require Windows 8 or later, while we only require Vista

Fixes warnings like
../src/hb-blob.cc:572:47: warning: 'WINAPI_FAMILY_PC_APP' is not defined, evaluates to 0 [-Wundef]
 #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
                                              ^
../src/hb-blob.cc:572:86: warning: 'WINAPI_FAMILY_PHONE_APP' is not defined, evaluates to 0 [-Wundef]
 #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
2020-07-01 13:05:14 +04:30
Behdad Esfahbod a783840789 Always round up
Fixes https://github.com/harfbuzz/harfbuzz/issues/2496
2020-06-28 13:10:37 +04:30
Ebrahim Byagowi 385d64eef1 Add a not discardable bool type, hb_success_t 2020-05-07 10:26:45 +04:30
Behdad Esfahbod c37100e7d9 Clean up math.h and float.h includes 2020-04-18 16:02:55 -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
Behdad Esfahbod fd71c045b4 Hopefully fix up previous commit and bots 2019-10-28 17:06:53 -07:00
Behdad Esfahbod e832dc4c64 [config] Make HB_NO_ERRNO work with systems defining errno as a macro 2019-10-28 17:02:40 -07:00
Iceflower d6a83abd6a Define HB_UNUSED for clang 2019-09-26 14:12:20 +03:30
Ebrahim Byagowi 412d6cac3a Extract an avoid errno compile flag 2019-09-17 20:58:13 +04:30
Behdad Esfahbod 3f2cdf07a4 Change HB_VAR_ARRAY to 1 again
To fix MSVC bots, while I work on changing this to 0 permanently.
2019-09-08 15:08:02 -04:00
Behdad Esfahbod 861547d531 Change HB_VAR_ARRAY from 1 to 0
Going to see which compilers it breaks and special-case those...
2019-09-06 16:55:00 -04:00
Behdad Esfahbod 0e294c455e Rename VAR to HB_VAR_ARRAY 2019-09-06 16:54:27 -04:00
Ebrahim Byagowi a77bb7eb41 Move hb_codepoint_parse to hb_parse_uint 2019-09-04 02:04:09 +04:30
Ebrahim Byagowi d50d2fcbc7 Fallback if roundf didn't exist, like in dietlibc (#1953) 2019-09-02 19:32:05 -05:00
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 89228ccb9a Fix warning on IBM compilers
Fixes https://github.com/harfbuzz/harfbuzz/issues/1852
2019-07-22 07:07:37 -04:00
Ebrahim Byagowi eb8bd2f7ec Add hb_gdi_face_create API
Based on Konstantin Ritt work posted on mailing list
2019-07-21 14:22:19 -07:00
Ebrahim Byagowi 6a6bf7b7bc
Downgrade -Wdeprecated-declarations to warning
Fixes #1834 at least till fix of #1829
2019-07-17 21:22:38 +04:30
Behdad Esfahbod 8e3cde67df Fix MSVC build
MSVC warning:

c:\projects\harfbuzz\src\hb-ot-layout-gsubgpos.hh(2732): error C2121: '#': invalid character: possibly the result of a macro expansion [C:\projects\harfbuzz\build\harfbuzz.vcxproj]

Clang warning for it:

./hb-ot-layout-gsubgpos.hh:2729:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
2019-06-19 19:59:26 -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 6172ec5d87 Remove (unused) posix_memalign fallback
Was wrong.  The returned pointer couldn't be passed to free().  Ouch!
2019-06-18 12:41:56 -07:00
Ebrahim Byagowi 19b8eb08e5
Move HB_NO_SETLOCALE to closer place to its to unbreak HB_TINY build (#1768) 2019-06-11 01:33:30 +04:30
Ebrahim Byagowi a36ff94171 Add HB_NO_SETLOCALE 2019-06-10 12:54:02 -07:00