Commit Graph

296 Commits

Author SHA1 Message Date
Behdad Esfahbod 715e03bc21 Minor 2012-09-04 20:10:17 -04:00
Behdad Esfahbod a930c68e9c [OT] More serialize. Implements all basic GSUB subtables 2012-09-04 19:16:09 -04:00
Behdad Esfahbod 1f07e3382a [OT] Implement serialize() for MultiSubst 2012-09-03 23:28:34 -04:00
Behdad Esfahbod 4912030dfb Minor 2012-09-03 21:00:48 -04:00
Behdad Esfahbod 4b312fb288 [OT] Remove serialize alignment
Will reintroduce in a different way when we actually need it.
2012-09-01 21:56:06 -04:00
Behdad Esfahbod c61be03d6d [OT] A bit more serialize 2012-09-01 21:49:44 -04:00
Behdad Esfahbod abcc5ac1fd [OT] Improve serialize syntax
For some definition of improvement...
2012-09-01 21:30:17 -04:00
Behdad Esfahbod bc5be24014 [OT] Restart work on serialize() 2012-09-01 21:25:20 -04:00
Behdad Esfahbod 9f2348de58 [OT] Add serialize() for Coverage 2012-08-29 21:08:59 -04:00
Behdad Esfahbod e901b954c6 [OT] Start adding serialize() API 2012-08-29 20:26:08 -04:00
Behdad Esfahbod 7c8e844d92 Use namespace for OpenType tables
Avoids USHORT, SHORT, ULONG, LONG clashes with Windows API.
2012-08-28 17:57:49 -04:00
Behdad Esfahbod 70416de298 Minor 2012-06-09 00:56:41 -04:00
Behdad Esfahbod 99159e52a3 Use linear search for small counts
I see about 8% speedup with long strings with DejaVu Sans.
2012-06-09 00:50:40 -04:00
Behdad Esfahbod 0bb0f5d419 Add note re _NullPool 2012-06-07 17:42:48 -04:00
Behdad Esfahbod a00a63b5ef Add macros to check that types are POD 2012-06-06 03:07:01 -04:00
Behdad Esfahbod cf26e88a5a Finish off debug output beautification 2012-05-11 03:16:57 +02:00
Behdad Esfahbod 0ab8c86217 Annotate SANITIZE return values
More to come, for APPLY, CLOSURE, etc.
2012-05-11 02:11:52 +02:00
Behdad Esfahbod 1e08830b4f Beautify debug output 2012-05-11 00:43:57 +02:00
Behdad Esfahbod 6f45538017 More massaging trace messaging 2012-05-10 23:24:43 +02:00
Behdad Esfahbod 208109703c Better trace message support infrastructure
We have varargs in the trace interface now.  To be used soon...
2012-05-10 23:06:58 +02:00
Behdad Esfahbod ae9877dea6 Add hhea-table support 2011-08-17 15:00:10 +02:00
Behdad Esfahbod d7bf473ef2 Minor 2011-08-05 19:59:02 -04:00
Behdad Esfahbod c605bbbb6d Remove C++ guards from source files
Where causing issues for people with MSVC.
2011-08-04 20:00:53 -04:00
Behdad Esfahbod f60271c0c2 Add mingw32 support
With these changes, on Ubuntu I can do:

./configure --host=i586-mingw32msvc  && make
2011-08-02 10:00:55 -04:00
Behdad Esfahbod cc06c243d8 Streamline debugging infrastructure even more 2011-07-25 20:34:17 -04:00
Behdad Esfahbod 43ff203d8e Use variadic macros for debugging
Looks *so* much nicer!
2011-07-25 17:35:24 -04:00
Behdad Esfahbod decd4e3e16 Add sugar syntax for debug messages
Buffer debugging coming soon.
2011-07-25 16:47:02 -04:00
Behdad Esfahbod 31f18abecb Minor compiler warning fixes 2011-06-15 09:49:58 -04:00
Behdad Esfahbod b9452bfc16 Fix compiler warnings with -pedantic 2011-06-14 14:47:07 -04:00
Behdad Esfahbod 4f28fbdd80 Fix TTC header handling
Also change the Version type to avoid similar bugs in the future.

Reported by Grigori Goronzy.
2011-05-31 12:33:11 -04:00
Behdad Esfahbod 4101ca7dbb Plug more leaks
All good now.
2011-05-11 14:30:56 -04:00
Behdad Esfahbod 1c9f8717eb [API] Simplify blob API, remove lock 2011-05-06 22:59:42 -04:00
Behdad Esfahbod 4911062d5b [API] Rename hb_blob_create_empty() to hb_blob_get_empty() 2011-05-02 19:36:39 -04:00
Behdad Esfahbod 080a0eb7d8 Add _hb_unsigned_int_mul_overflows 2011-04-28 16:01:01 -04:00
Behdad Esfahbod 153142dac8 Replace simple macros with inline functions for better type safety
Now that we use C++ for all source code, lets benefit from it!

The hb_be_int16/32_get/put/eq() macros grow code size if replaced with
inline functions, so leave them as is.
2011-04-27 02:07:46 -04:00
Behdad Esfahbod 2409d5f8d7 Update Copyright headers 2011-04-21 17:14:28 -04:00
Behdad Esfahbod c57d454acc Rename all private sources and headers to C++ files
So we can liberally use the simple features of C++ that parts of the
codebase is already using.
2011-04-20 18:50:27 -04:00
Behdad Esfahbod 9417c1c0d2 [API] Make hb_face_reference_table() return empty blob instead of NULL
The idea here is that:

  - Like pretty much all other API in harfbuzz, user does not have to
    check for NULL.

  - In any caller code, the case of missing table should be handled
    exactly the same way that a too-short table is handled.  Turning
    a non-existent talbe into a table of size 0 makes the user code
    safer.
2011-04-20 17:21:23 -04:00
Behdad Esfahbod 11e3ec444a Fix a few more "unreachable code" warnings 2010-11-03 15:11:04 -04:00
Behdad Esfahbod 993d1e786a Fix missing negation in unreachable code!
Mozilla bug #603346
2010-10-12 11:17:30 -04:00
Behdad Esfahbod 8f08c32750 Minor cleanup 2010-10-08 19:51:03 -04:00
Behdad Esfahbod 7f97d2cd90 Pedantic 2010-10-01 19:09:01 -04:00
Behdad Esfahbod 4e573715ae Improve cmp function parameter namings and casts
No semantic change.
2010-09-28 16:28:57 -04:00
Behdad Esfahbod acdba3f90b Prefer C linkage 2010-07-23 15:39:27 -04:00
Behdad Esfahbod 81408cd51c Don't use "operator ="
Some compilers don't like operator = defined on members of union members
either.  Reported by Ginn Chen for Sun Studio compilers.
2010-07-23 14:46:57 -04:00
Behdad Esfahbod 4f801bd658 Mozilla bug 580233 - check for zero-length record in hb sanitizer.
Patch / report by Jonathan Kew.
2010-07-21 16:37:01 -04:00
Behdad Esfahbod 17e9ff938b Fix 64bit issues with debug prints 2010-07-15 11:21:34 -07:00
Behdad Esfahbod fd56ae4963 Don't bother sorting, it's a safe font error if the array is not sorted 2010-07-08 00:53:40 -04:00
Behdad Esfahbod cc8a4abea6 Use bsearch where applicable 2010-07-08 00:40:04 -04:00
Behdad Esfahbod 0f0cd9d361 Fix header tags 2010-06-09 06:32:56 -04:00
Behdad Esfahbod 280af1bddb Let hb_face_get_table() return NULL if table not found 2010-05-20 18:33:35 +01:00
Behdad Esfahbod cf5585cfa6 Add 'head' table 2010-05-19 12:03:35 -04:00
Behdad Esfahbod e29caf3f94 Add LONGDATETIME 2010-05-19 11:47:17 -04:00
Behdad Esfahbod d7cfb3b2d1 s/\<context\>/c/g 2010-05-13 14:18:49 -04:00
Behdad Esfahbod f679635893 Don't use variable-length-arrays 2010-05-13 13:34:17 -04:00
Behdad Esfahbod 75651b2087 Fix warnings 2010-05-10 23:44:51 -04:00
Behdad Esfahbod 4c20d8c057 Sprinkle a few strategic likely()'s
Shrinks the code size by some 2% even.
2010-05-10 23:27:54 -04:00
Behdad Esfahbod f7adc5e9be Shrink NullPool now that we have accurate size tracking 2010-05-10 22:41:50 -04:00
Behdad Esfahbod b5db4f1e4e Clean up NO_INDEX 2010-05-10 22:22:22 -04:00
Behdad Esfahbod 458ecbb60b Fix tracing order 2010-05-10 21:11:35 -04:00
Behdad Esfahbod 48146e5612 Don't fail sanitize on NULL data 2010-05-10 20:07:56 -04:00
Behdad Esfahbod d2c2ca8faf Fix comment 2010-05-10 19:58:25 -04:00
Behdad Esfahbod b435ab7e29 Fix accessing tables from NULL pointer 2010-05-10 19:51:57 -04:00
Behdad Esfahbod fd671e0243 Remove unused macro 2010-05-10 19:02:32 -04:00
Behdad Esfahbod 0eb9fc6e37 Change DEFINE_SIZE_VAR to DEFINE_SIZE_ARRAY 2010-05-10 19:01:17 -04:00
Behdad Esfahbod 596e471aa5 Cleanup DEFINE_SIZE_VAR2 2010-05-10 18:48:29 -04:00
Behdad Esfahbod 33afa4e2dc Minor 2010-05-10 18:35:02 -04:00
Behdad Esfahbod b961518b96 Simplify array access 2010-05-10 18:20:54 -04:00
Behdad Esfahbod 54842374c2 Fix check_struct to check min_size instead of sizeof 2010-05-10 18:13:32 -04:00
Behdad Esfahbod ed07422c33 Further cleanup of sizeof 2010-05-10 18:08:46 -04:00
Behdad Esfahbod a82ef7a893 Remove CastP completely 2010-05-10 17:55:03 -04:00
Behdad Esfahbod 40cbefe858 Remove unnecessary casts 2010-05-10 17:47:22 -04:00
Behdad Esfahbod 09766b1ec5 Make StructAtOffset take a pointer
Is safer.
2010-05-10 17:36:03 -04:00
Behdad Esfahbod bea34c7cbb Further cleanup of DEFINE_SIZE 2010-05-10 17:28:16 -04:00
Behdad Esfahbod 0abcc3b48c Cleanup 2010-05-10 17:04:20 -04:00
Behdad Esfahbod b3651231bf Remove ASSERT_SIZE in favor of the safer DEFINE_SIZE_STATIC 2010-05-10 16:59:57 -04:00
Behdad Esfahbod 569da92bc6 Cleanup ASSERT_SIZE_VAR 2010-05-10 16:46:36 -04:00
Behdad Esfahbod 65f46b0033 Simplify DEFINE_NULL_DATA
Using ::min_size.
2010-05-06 19:35:19 -04:00
Behdad Esfahbod e45d3f86f9 Start cleaning up get_size()
So we know when the size is static and when dynamic.
2010-05-06 19:33:31 -04:00
Behdad Esfahbod b157617644 Remove the last of SANITIZE macros: SANITIZE_SELF 2010-05-06 14:48:27 -04:00
Behdad Esfahbod 4f252fedc7 Remove SANITIZE macro 2010-05-06 13:30:23 -04:00
Behdad Esfahbod 41a93d2c1f Remove SANITIZE_WITH_BASE 2010-05-06 12:55:14 -04:00
Behdad Esfahbod f5fab0c718 Remove SANITIZE_MEM 2010-05-06 10:26:52 -04:00
Behdad Esfahbod 4ad2cc5dec Rename check to check_range 2010-05-06 09:24:56 -04:00
Behdad Esfahbod 1cd1e117d0 Remove SANITIZE_ARRAY 2010-05-05 20:15:14 -04:00
Behdad Esfahbod 583d7f9586 Cosmetic 2010-05-05 01:49:22 -04:00
Behdad Esfahbod 705e215268 Minor 2010-05-05 01:40:25 -04:00
Behdad Esfahbod b18eafd0f6 Minor 2010-05-05 01:39:26 -04:00
Behdad Esfahbod 27e302dc8e I keep changing my mind about this 2010-05-05 00:26:16 -04:00
Behdad Esfahbod 39840474af Remove SANITIZE_ARG_DEF and SANITIZE_ARG 2010-05-05 00:23:19 -04:00
Behdad Esfahbod b261e2ad5c Remove trace from sanitize_shallow() 2010-05-05 00:20:16 -04:00
Behdad Esfahbod dfc8cbe854 Add hb_trace_t 2010-05-05 00:19:46 -04:00
Behdad Esfahbod 20e3dd5d29 Make sanitize_depth variable automatic and not passed through function args 2010-05-04 23:32:49 -04:00
Behdad Esfahbod 4a446ac351 Use function template for pass-thru argument 2010-05-04 22:56:20 -04:00
Behdad Esfahbod 98daaf183d Make _hb_sanitize_*() methods of the context object 2010-05-04 22:42:49 -04:00
Behdad Esfahbod bb029af943 Remove SANITIZE_THIS 2010-05-04 15:28:52 -04:00
Behdad Esfahbod 2226fc93d1 Rename SANITIZE_BASE to SANITIZE_WITH_BASE 2010-05-04 15:12:17 -04:00
Behdad Esfahbod 89da1346ec Remove SANITIZE_OBJ 2010-05-04 15:01:45 -04:00
Behdad Esfahbod 4d4cce9626 Remove SANITIZE_THIS2 2010-05-04 14:57:55 -04:00
Behdad Esfahbod be74284673 Remove SANITIZE_THIS3 2010-05-04 14:47:05 -04:00
Behdad Esfahbod fbab9f9bd8 Remove SANITIZE_BASE2 2010-05-04 14:42:10 -04:00
Behdad Esfahbod 73c7dbf7f5 Remove SANITIZE2 2010-05-04 14:40:55 -04:00
Behdad Esfahbod c9f14687a3 Remove the NEUTER macro, move code to a method 2010-05-04 14:38:08 -04:00
Behdad Esfahbod 30fa2821c2 Make internal method private 2010-05-04 14:28:18 -04:00
Behdad Esfahbod 64d3fc8d0d Cosmetic: Rename HB_LIKELY/HB_UNLIKELY to likely/unlikely 2010-05-03 22:51:19 -04:00
Behdad Esfahbod fa3b3d5844 Mark a couple functions as inline 2010-05-03 22:47:22 -04:00
Behdad Esfahbod 6b84198f9d Merge remote branch 'jrmuizel/master' 2010-05-03 22:46:52 -04:00
Jeff Muizelaar eaf29edb8f HB_UNUSED is unneeded on static inline functions 2010-05-03 22:27:56 -04:00
Behdad Esfahbod f0abcd6940 Whitespace 2010-05-02 18:14:25 -04:00
Behdad Esfahbod 33d13fdda9 Rename HB_GNUC_UNUSED -> HB_UNUSED 2010-04-29 13:56:44 -04:00
Behdad Esfahbod 7d3a126334 Define HB_FUNC for portability to non-gcc 2010-04-29 13:54:01 -04:00
Behdad Esfahbod fa030175ca [sanitize] Make debug code always available to the compiler
Such that we don't break debug build all the time.
2010-04-29 13:48:26 -04:00
Behdad Esfahbod 602e4f8d55 Use const_cast 2010-04-29 02:28:54 -04:00
Behdad Esfahbod 1376fb7bf9 [apply] Use a context object to reduce number of parameters passed around 2010-04-29 02:19:21 -04:00
Behdad Esfahbod 173fde7087 Further simplify tracing 2010-04-29 01:47:30 -04:00
Behdad Esfahbod bc20045743 Simplify trace code 2010-04-29 01:40:26 -04:00
Behdad Esfahbod 807c5b03a2 [sanitize] Make debug code always available to the compiler
Such that we don't break debug build all the time.
2010-04-28 23:28:07 -04:00
Behdad Esfahbod a92f0fda7f Fix debug build 2010-04-28 13:09:40 -04:00
Behdad Esfahbod 66d6eb30eb Rename Var to Obj 2010-04-25 23:01:45 -04:00
Behdad Esfahbod ad3653751b Typo 2010-04-23 19:43:40 -04:00
Behdad Esfahbod 990443e5f2 Remove lock_instance() 2010-04-23 17:53:32 -04:00
Behdad Esfahbod 187454c595 Add different casts from pointer and ref to avoid bugs 2010-04-23 17:44:28 -04:00
Behdad Esfahbod efb324a46f Remove GET_FOR_DATA macros
The major-version check is now handled by sanitize.  If major
doesn't match, we reject and fall back to the Null object.
2010-04-23 16:28:27 -04:00
Behdad Esfahbod f1aaa2a436 Add TODO 2010-04-23 15:19:50 -04:00
Behdad Esfahbod 1d720192b1 Fix compile warnings (HB_GNUC_UNUSED) 2010-04-23 14:39:10 -04:00
Behdad Esfahbod 8dfdca599c No need to keep blob in sanitize context 2010-04-23 14:07:34 -04:00
Behdad Esfahbod 254933c397 When sanitizing, delay making writable
Before, as soon as we needed to make an edit, we tried to make the blob
writable inplace.  That grows code unnecessarily though.  We can simply
fail, make writable, then start again.  That's indeed what the fallback
was doing anyway.
2010-04-23 13:57:10 -04:00
Behdad Esfahbod d632ec4000 Cosmetic 2010-04-22 18:42:05 -04:00
Behdad Esfahbod a3263aa773 Convert the last set of cast macros to templates 2010-04-22 18:42:01 -04:00
Behdad Esfahbod c38188a191 Remove unused macro 2010-04-22 16:52:09 -04:00
Behdad Esfahbod dc228048a8 Remove integrity check in Tag sanitize
Serves no useful purpose.
2010-04-22 13:22:41 -04:00
Behdad Esfahbod c293581e96 Add coment 2010-04-22 11:20:28 -04:00
Behdad Esfahbod 1faa76c6e8 Remove unnecessary casts 2010-04-22 10:54:26 -04:00
Behdad Esfahbod 565c80bd29 Make sure semicolon is expected after DEFINE_NULL_DATA() 2010-04-22 10:26:35 -04:00
Behdad Esfahbod e5546a4352 Watch for overflow in Array sanitize 2010-04-22 00:48:54 -04:00
Behdad Esfahbod 4f5f1c34dd Rename const_sub_array to sub_array since all consts are implicit now 2010-04-22 00:27:39 -04:00
Behdad Esfahbod c755cb3e3a Change header comment 2010-04-22 00:11:43 -04:00
Behdad Esfahbod 243d20e011 More cast simplification 2010-04-21 23:57:01 -04:00
Behdad Esfahbod 0dfcc13a46 Rename ConstCharP to CharP (overloaded now) 2010-04-21 23:41:26 -04:00
Behdad Esfahbod 62c0fd7573 Cleanup de-const-casting during sanitize 2010-04-21 23:30:48 -04:00
Behdad Esfahbod dd15587056 Add more comments 2010-04-21 23:13:33 -04:00
Behdad Esfahbod c85c362067 Add comment 2010-04-21 23:12:54 -04:00
Behdad Esfahbod 2467c669c2 Add comment 2010-04-21 23:11:45 -04:00
Behdad Esfahbod 29c3f5e1b6 Improve comment 2010-04-21 23:01:00 -04:00
Behdad Esfahbod 01c01618e9 Further simplify IntType struct defs 2010-04-21 22:49:56 -04:00
Behdad Esfahbod 2cb08458f6 Rename const_array() to array() (overloaded) 2010-04-21 22:37:31 -04:00
Behdad Esfahbod 2e2f43edf2 Remove ArrayAfter, use StructAfter in place 2010-04-21 22:30:36 -04:00
Behdad Esfahbod e961c86c57 Convert NEXT() and ARRAY_AFTER() macros to templates 2010-04-21 15:56:11 -04:00
Behdad Esfahbod 198facdc55 Use templates for const char * casts 2010-04-21 13:35:36 -04:00
Behdad Esfahbod e032ed9f75 Use templates for defining int typess 2010-04-21 04:51:55 -04:00