From 9682ef135f16cb3368b9c5970fdcec71301b687e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 8 Feb 2018 17:35:57 -0600 Subject: [PATCH] Minor fixups --- CMakeLists.txt | 2 +- src/hb-ot-cmap-table.hh | 6 +++--- src/hb-subset.cc | 6 +++--- test/api/hb-test.h | 5 +++++ test/api/test-subset-glyf.c | 4 ---- test/api/test-subset.c | 4 ---- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27a04b1fd..c21a42918 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,7 +253,7 @@ set (project_sources ${HB_FALLBACK_sources} ${HB_OT_sources} - ${HB_OT_RAGEL_GENERATED_sources} + ${HB_OT_RAGEL_GENERATED_sources} ) set (subset_project_sources diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 219eca7b2..537336806 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -27,7 +27,7 @@ #ifndef HB_OT_CMAP_TABLE_HH #define HB_OT_CMAP_TABLE_HH -#include "hb-open-type-private.hh" +#include "hb-open-type-private.hh" #include "hb-subset-plan.hh" namespace OT { @@ -504,7 +504,7 @@ struct cmap encodingRecord.sanitize (c, this)); } - inline bool subset(hb_subset_plan_t *plan, hb_face_t *source, hb_face_t *dest) const + inline bool subset (hb_subset_plan_t *plan, hb_face_t *source, hb_face_t *dest) const { // TODO something useful re: memory, write to dest size_t dest_sz = 64536; // as much as anyone would ever need @@ -514,7 +514,7 @@ struct cmap // Same version OT::cmap new_cmap; new_cmap.version = version; - new_cmap.encodingRecord.len.set(1); // one format 12 subtable + new_cmap.encodingRecord.len.set(1); // one format 12 subtable // TODO we need to actually build the format 12 subtable diff --git a/src/hb-subset.cc b/src/hb-subset.cc index f10f35ba4..a46cbd08f 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -26,7 +26,7 @@ */ #include "hb-object-private.hh" -#include "hb-open-type-private.hh" +#include "hb-open-type-private.hh" #include "hb-private.hh" @@ -109,7 +109,7 @@ hb_subset_input_destroy(hb_subset_input_t *subset_input) template hb_bool_t -subset(hb_subset_plan_t *plan, hb_face_t *source, hb_face_t *dest) +subset (hb_subset_plan_t *plan, hb_face_t *source, hb_face_t *dest) { OT::Sanitizer sanitizer; hb_blob_t *table_blob = sanitizer.sanitize (source->reference_table (TableType::tableTag)); @@ -119,7 +119,7 @@ subset(hb_subset_plan_t *plan, hb_face_t *source, hb_face_t *dest) } const TableType *table = OT::Sanitizer::lock_instance (table_blob); hb_bool_t result = table->subset(plan, source, dest); - + hb_blob_destroy (table_blob); // TODO string not numeric tag diff --git a/test/api/hb-test.h b/test/api/hb-test.h index 040f0c217..f6f107e28 100644 --- a/test/api/hb-test.h +++ b/test/api/hb-test.h @@ -161,6 +161,11 @@ typedef void (*hb_test_fixture_func_t) (void); #define g_test_fail() g_error("Test failed") #endif +#ifndef g_assert_cmpmem +#define g_assert_cmpmem(m1, l1, m2, l2) g_assert_true (l1 == l2 && memcmp (m1, m2, l1) == 0) +#endif + + static inline void hb_test_add_func (const char *test_path, hb_test_func_t test_func) diff --git a/test/api/test-subset-glyf.c b/test/api/test-subset-glyf.c index b7d569024..196047fe6 100644 --- a/test/api/test-subset-glyf.c +++ b/test/api/test-subset-glyf.c @@ -28,10 +28,6 @@ #include "hb-test.h" -#ifndef g_assert_cmpmem -#define g_assert_cmpmem(m1, l1, m2, l2) g_assert_true (l1 == l2 && memcmp (m1, m2, l1) == 0) -#endif - static char * read_file (const char *path, size_t *length) diff --git a/test/api/test-subset.c b/test/api/test-subset.c index 866a8333c..4184a563f 100644 --- a/test/api/test-subset.c +++ b/test/api/test-subset.c @@ -26,10 +26,6 @@ #include "hb-test.h" -#ifndef g_assert_cmpmem -#define g_assert_cmpmem(m1, l1, m2, l2) g_assert_true (l1 == l2 && memcmp (m1, m2, l1) == 0) -#endif - /* Unit tests for hb-subset.h */ static const char test_data[] = { 0, 1, 0, 0, /* sfntVersion */