src/hb-open-type.hh


Log

Author Commit Date CI Message
Behdad Esfahbod f0a1892f 2021-07-28T17:36:22 [serialize] Remove unnecessary pointer indirection
Behdad Esfahbod 03cd9c5c 2021-07-22T11:27:33 Align lfind() API to match bfind()
Behdad Esfahbod 29c9833e 2021-07-09T11:58:36 Remove Offset::serialize() Finishing https://github.com/harfbuzz/harfbuzz/pull/2355
Garret Rieger 0da9158f 2021-06-29T14:23:37 [subset] Remove OffsetTo::serialize(). Convert remaining uses of it to serialize_serialize() which correctly uses the object packer.
Garret Rieger 35458b6b 2021-06-11T13:14:51 [subset] Add serialize_serialize to OffsetTo. Similar to serialize_subset() this will serialize the new object and then link it to the offset.
Behdad Esfahbod 70110f6a 2021-03-31T17:04:02 Modify OffsetTo<>::sanitize() overflow check The code in question was introduced in 70eb2ff682. Rewrite it to not call sanitizer check_range() as we want to use check_range() for byte accounting. Part of https://github.com/harfbuzz/harfbuzz/pull/2923
Behdad Esfahbod 4dba749d 2021-03-31T16:09:39 Add SortedArray{16,32}Of<>
Behdad Esfahbod 5639e253 2021-03-31T16:04:43 Add Array16Of<>
Behdad Esfahbod 2520a82d 2021-03-31T15:34:26 s/LArrayOf/Array32Of/g
Behdad Esfahbod 5efe3609 2021-03-31T15:33:22 Rename (Unsized)OffsetListOf
Behdad Esfahbod 6c4e0491 2021-03-31T15:31:32 s/OffsetArrayOf/Array16OfOffset16To/g
Behdad Esfahbod 1fc6b69a 2021-03-31T15:30:35 s/UnsizedOffsetArrayOf/UnsizedArray16OfOffsetTo/g
Behdad Esfahbod 2a54c9f7 2021-03-31T15:26:42 .
Behdad Esfahbod 9b4b5849 2021-03-31T13:27:21 Fixup for recent OffsetTo<> changes
Behdad Esfahbod ad28f973 2021-03-31T12:49:14 Rename offset types to be explicit about their size Add Offset16To<>, Offset24To<>, and Offset32To<> for most use-cases.
Behdad Esfahbod 9ffc46b8 2021-03-31T11:26:18 Add VarIdx
Behdad Esfahbod 2179281c 2021-03-31T11:20:21 Add Offset24
Behdad Esfahbod 23976893 2021-03-29T17:34:23 Remove hb_success_t Was not rolled-out yet. So just expand.
Behdad Esfahbod 7a2eda78 2021-03-29T17:32:29 Move code around
Behdad Esfahbod bcb57dcc 2021-03-29T17:31:09 [sanitize] Add short-circuit to ArrayOfM1 Like the sibling ArrayOf types.
Garret Rieger b14475d2 2021-03-18T10:51:26 [subset] further changes to serializer error handling. - Rename enum type and enum members. - in_errors() now returns true for any error having been set. hb-subset now looks for offset overflow only errors to divert to repacker. - Added INT_OVERFLOW and ARRAY_OVERFLOW enum values.
Garret Rieger 73ed59f7 2021-03-17T15:53:10 [subset] store errors in the serializer as a flag set. Make check_assign/check_equal specify the type of error to set.
Behdad Esfahbod 486da35c 2021-02-23T13:58:14 m Add comments to IntType cast out operator Okay, bots seem to be happy. Merging.
Behdad Esfahbod d6bd00a4 2021-02-22T22:42:50 Revert back IntType out cast to signed/unsigned Previous commit didn't fix the bots. Putting it back now that I understand why I initially did the "Wide" casts. But only doing it for out-cast this time. This causes "narrowing" warnings whenever we are converting signed/unsigned to smaller HBUINT16 etc. But those are valuable warnings. We should address those separately instead of ignoring. Maybe we should start using uint16_t more liberally in the internal subsetter function signatures then.
Behdad Esfahbod 09836013 2021-02-22T22:33:17 Add back wider cast to IntType My local clang12 is fine, but many bots are not: ../src/hb-ot-cff1-table.hh: In instantiation of ‘bool CFF::Charset1_2<TYPE>::sanitize(hb_sanitize_context_t*, unsigned int) const [with TYPE = OT::IntType<unsigned char>]’: ../src/hb-ot-cff1-table.hh:554:13: required from here ../src/hb-ot-cff1-table.hh:377:60: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if (unlikely (!ranges[i].sanitize (c) || (num_glyphs < ranges[i].nLeft + 1))) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ Enabling the extra cast operator mentioned in previous commit to see if that fixes this case. Again, I'd be happy to say "use 1u instead of 1" if this was universally erred on. But since some compilers happily compile this while others err, it would be a huge headache. Let's see... https://github.com/harfbuzz/harfbuzz/pull/2875
Behdad Esfahbod 567cedcc 2021-02-22T22:09:15 Narrow down cast operators on IntType Say for USHORT, we were implementing casts from and to unsigned. With this change, we cast from and to uint16_t only. This allows compiler more opportunities to catch possible narrowing issues in the code. It needed a couple of fixes in the codebase though, because previously, if a USHORT was participating in arithmetic with signed numbers, eg. "u + 1", the result would have been unsigned. With this change, it would be signed. The correct fix is to update the code to read "u + 1u". That said, I think about conditionally adding back the cast out to signed/unsigned, to facilitate better type deduction. But I couldn't think of a real situation where that would help with anything. So I didn't add. Here's what it was: template <typename Type2 = hb_conditional<hb_is_signed (Type), signed, unsigned>, hb_enable_if (sizeof (Type) < sizeof (Type2))> operator hb_type_identity_t<Type2> () const { return v; } https://github.com/harfbuzz/harfbuzz/pull/2875
Behdad Esfahbod cc16b26e 2021-02-22T17:55:47 [constexpr] IntType See https://github.com/harfbuzz/harfbuzz/pull/2875
Behdad Esfahbod 8b2f9adf 2021-02-22T17:42:24 m Simplify Tag operator char*
Behdad Esfahbod e5b7bc42 2020-06-29T01:24:02 m Add default value to BEInt<> Size template parameter
Behdad Esfahbod 98374ceb 2021-02-05T13:40:10 Conditionalize IntType::cmp() so it never fails to compile Useful with lfind() since that calls hb_equal() which SFINAEs which cmp() to use.
Behdad Esfahbod 25c0a792 2020-12-10T14:29:47 Remove unused+wrong UnsizedArrayOf<> operators Said compiler is wrong to err since they are unused. But yeah, they didn't make sense and were copy/paste leftover. Fixes https://github.com/harfbuzz/harfbuzz/issues/2763
Ebrahim Byagowi 7e3edfa4 2020-07-18T19:03:36 minor
Ebrahim Byagowi 08d57d9e 2020-06-28T13:13:25 Add hb_array_t::lfind
Ebrahim Byagowi 385d64ee 2020-05-07T09:59:01 Add a not discardable bool type, hb_success_t
Ebrahim Byagowi 07acd1a0 2020-03-08T23:39:24 [subset] Rename src_base args to base to match sanitize methods So it will become easier to follow that serialize methods signatures should match with their sanitize methods counterparts.
ariza 188a0a47 2020-03-07T11:02:36 removed default base; replaced w/ bias if required
ariza 4aa354be 2020-02-20T05:03:15 chain second OffsetTo::serialize_copy() to first
ariza 4ca8e0d9 2020-02-19T12:52:18 re-implement Tail; rewrote name table with it
Qunxin Liu 82afc758 2020-02-04T13:24:37 [subset] GPOS4 MarkBase subsetting support
Behdad Esfahbod b1dc676e 2019-12-10T11:41:24 [algs] Reduce one more bsearch() impl Ouch, there were three more left. Down one. Two to go.
Ebrahim Byagowi 0558413f 2019-10-01T13:49:55 Minor, tweak spaces
Ebrahim Byagowi d512087e 2019-09-14T10:36:29 Rename GlyphID to HBGlyphID Avoid collision with macOS's ATSUnicodeTypes.h GlyphID
Behdad Esfahbod 229ef1d2 2019-09-10T10:31:07 Rename Fixed to HBFixed Fixes(!!) https://github.com/harfbuzz/harfbuzz/issues/1966
Behdad Esfahbod 0e294c45 2019-09-06T16:54:27 Rename VAR to HB_VAR_ARRAY
Behdad Esfahbod dc2c9aa0 2019-08-28T15:05:49 Rename
Behdad Esfahbod 42d887bd 2019-08-28T14:47:14 Beef up HeadlessArrayOf<> Should be merged with ArrayOf... https://github.com/harfbuzz/harfbuzz/issues/1937
Behdad Esfahbod 3ca809e3 2019-08-28T13:49:35 Add ArrayOf::pop()
Behdad Esfahbod 307bd6d7 2019-08-28T13:49:17 Add arithmetic operators to IntType<>
Behdad Esfahbod 062cad5e 2019-08-28T13:33:08 Add ArrayOf::serialize_append
Ebrahim Byagowi a0b4ac4d 2019-08-24T17:57:14 Turn 8 spaces to tab across the project According to the current code style of the project
Ebrahim Byagowi aab8e084 2019-07-26T02:19:22 minor spacing fix (#1869)
Behdad Esfahbod 6492b234 2019-06-17T14:19:13 Minor
Behdad Esfahbod 8938dd23 2019-06-17T14:12:11 Use injected class name
Behdad Esfahbod 1834cf86 2019-05-31T14:39:32 [serialize] Pass offset to serialize_subset()
Behdad Esfahbod 92604416 2019-05-31T14:34:34 [serialize] Pass offset to serialize_copy()
Behdad Esfahbod dfa5e429 2019-05-15T21:18:14 Add back symmetric OffsetTo<>::friend operator+ Finally seems to be working now.
Behdad Esfahbod 203ea58b 2019-05-15T16:14:40 More adjustment to OffsetTo<>::friend opeator+ Let's see if I break any bots. But yeah, it wasn't accepting a non-const pointer. It just happens that we don't use that in the code it seems.
Behdad Esfahbod 763ea422 2019-05-15T01:15:11 Another try
Behdad Esfahbod e1b2edb0 2019-05-15T01:12:04 Completely revert the thing back
Behdad Esfahbod c58eeb5f 2019-05-15T01:10:31 Another try at fix Fails locally. Trying to understand. Sigh
Behdad Esfahbod 004edf3b 2019-05-15T01:02:50 Ugh. How was the Travis bot happy before, but isn't now?! :(
Behdad Esfahbod e01c7b16 2019-05-15T00:52:17 Move OffsetTo operator+ back out of class Apparently there's different overload resolution rules that apply, at least with some (older?) version of gcc. hb-ot-name-table.hh: In member function ‘void OT::name::accelerator_t::init(hb_face_t*)’: hb-ot-name-table.hh:244:62: error: ambiguous overload for ‘operator+’ (operand types are ‘hb_blob_ptr_t<OT::name>’ and ‘OT::NNOffsetTo<OT::UnsizedArrayOf<OT::IntType<unsigned char, 1u> > > {aka const OT::OffsetTo<OT::UnsizedArrayOf<OT::IntType<unsigned char, 1u> >, OT::IntType<short unsigned int, 2u>, false>}’) this->pool = (const char *) (const void *) (this->table+this->table->stringOffset); ^ hb-ot-name-table.hh:244:62: note: candidates are: hb-ot-name-table.hh:244:62: note: operator+(const C*, long int) <built-in> hb-ot-name-table.hh:244:62: note: operator+(const char*, long int) <built-in>
Behdad Esfahbod b213042f 2019-05-15T00:50:48 Revert "Revert symmetric OffsetTo overloads" This reverts commit 01912efb74fc554a81c8cfe572145ce45b8fa58b. Actually this didn't break things. Fixing
Behdad Esfahbod 01912efb 2019-05-15T00:42:47 Revert symmetric OffsetTo overloads Reverts 57f65ae9355004044325dd6441cde761bca5e0a3 Caused ambiguous-overload on some gcc...
Behdad Esfahbod 57f65ae9 2019-05-14T22:52:59 Add symmetric friend operator+ for OffsetTo
Behdad Esfahbod 71208e50 2019-05-14T22:51:59 Move OffsetTo<> deref operators in-class as friends
Behdad Esfahbod 9bfe22af 2019-05-10T22:44:19 [sanitize] Fix previous commit
Behdad Esfahbod 4dcf6532 2019-05-10T22:23:24 [sanitize] Simplify
Behdad Esfahbod 23168c39 2019-05-10T22:11:51 [sanitize] Use hb_is_trivially_copyable()
Behdad Esfahbod 707ff5b5 2019-05-10T20:31:20 Minor
Behdad Esfahbod ed972d5d 2019-05-09T16:58:28 [iter] Rewrite test functions Notably, add hb_is_source_of(,) and hb_is_sink_of(,) to replace most uses of hb_is_iterator_of(,).
Behdad Esfahbod e2a51ff7 2019-05-08T16:41:39 Remove unused var
Behdad Esfahbod e8b45c19 2019-05-08T16:37:38 [array] Add .copy()
Behdad Esfahbod 7166bd56 2019-05-08T14:24:57 Minor
Behdad Esfahbod dfc57802 2019-05-07T23:26:09 Fix more double-promotion errors WHy do only some of the clang bots catch this I have no idea :(.
Behdad Esfahbod af571dbf 2019-05-07T21:39:20 [meta] Replace most hb_enable_if with hb_requires They do absolutely same thing. hb_requires is to encode constraints, whereas hb_enable_if is for more conditional enabling.
Behdad Esfahbod 83e3eabd 2019-05-07T20:58:43 Whitespace
Behdad Esfahbod 41248cce 2019-05-07T20:54:31 Remove MIN/MAX in favor of hb_min/hb_max
Behdad Esfahbod 95426ea9 2019-05-07T15:56:51 Add comment
Behdad Esfahbod b10f6593 2019-05-05T09:23:35 [dispatch] Use functionality from previous commit To remove a couple of unwanted wrapper methods
Behdad Esfahbod 8a32c9ee 2019-05-02T16:20:18 [serialize] Misc getting copy() to work
Behdad Esfahbod 998b0b68 2019-05-02T14:39:52 [serializer] Add copy() to (Unsized)ArrayOf
Behdad Esfahbod 88a41472 2019-05-02T14:22:31 [serializer] Accept exact type in serialize_subset/copy()
Behdad Esfahbod 88fdeeec 2019-05-02T14:14:33 [serialize] Take arguments in copy()
Behdad Esfahbod 273ed612 2019-05-02T14:04:51 [serializer] Add serialize_copy()
Ebrahim Byagowi 92588782 2019-04-30T13:05:10 Remove space between right angle brackets now that we have C++11 (#1689)
Behdad Esfahbod c69f0278 2019-04-24T16:31:37 Fix sign-compare error on 32-bit systems
Behdad Esfahbod 915b9ea5 2019-04-24T10:07:19 [serialize] Add c->check_assign() To check for assignment overflows.
Behdad Esfahbod 27377a7e 2019-04-24T09:22:14 Rely on variadic parameter pack more
Behdad Esfahbod 3ad20c38 2019-04-24T09:09:00 [serialize] Fix a few overflow TODO items
Behdad Esfahbod 441cca23 2019-04-23T23:49:21 Use hb_forward() when forwarding parameter pack
Behdad Esfahbod 20f31347 2019-04-23T12:58:52 Use variadic templates in OffsetTo<> and various ArrayOf<>s
Behdad Esfahbod 07776b60 2019-04-15T16:43:34 More tweaks to previous commit Delete assignment operator of OffsetTo<> instead of Offset<>. In simple ArrayOf<>::sanitize() assert that Type has assignment operator. Ideally we should SFINAE this and fallback to calling Type::sanitize() if assignment operator is not available. But we don't have a case of that in the codebase.
Behdad Esfahbod 699de689 2019-04-15T16:00:20 Delete default assignment operator Offset<>
Behdad Esfahbod 95df00ae 2019-04-12T17:50:03 Hide a few static methods Looks like static methods that do not get inlined end up exported. We have a lot more. Need to protect all at some point. Wish there was an easier way, like the visibility flag we pass that automatically hides all inline methods. Was exposed by check-symbols.sh when compiling on OS X 10.14 with: $ make CPPFLAGS=-Oz CXXFLAGS=-flto=thin LDFLAGS=-lc++
Behdad Esfahbod b52c0e54 2019-04-11T11:20:10 Use injected class name to simplify macros
Behdad Esfahbod 824fd342 2019-04-11T11:16:01 Rename a few macros
Behdad Esfahbod aa2293a5 2019-04-02T17:42:10 [serialize] Minor
Behdad Esfahbod e42b82c8 2019-04-02T17:21:54 [serialize] Handle non-nullable offsets
Behdad Esfahbod 7f73c974 2019-04-02T17:12:24 [serialize] Minor