From 7f7b1370d37b9187f688dea5e6fee5ea7c2b7290 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 24 May 2018 14:09:04 -0700 Subject: [PATCH] Fix Uniscribe build If a pointer type was passed to Null(), reinterpret_cast<> was complaining about qualifiers being removed. Turns out I need the const on the other side of "Type" to fix that. Also remove unused const from NullPool type. --- src/dump-emoji.cc | 2 +- src/dump-fon.cc | 2 +- src/hb-ot-layout.cc | 2 +- src/hb-private.hh | 6 +++--- src/hb-subset.cc | 2 +- src/main.cc | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dump-emoji.cc b/src/dump-emoji.cc index 280c5c9be..dc8f83d2c 100644 --- a/src/dump-emoji.cc +++ b/src/dump-emoji.cc @@ -47,7 +47,7 @@ #include #ifndef HB_NO_VISIBILITY -const void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; +void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; #endif diff --git a/src/dump-fon.cc b/src/dump-fon.cc index 748de1ab6..db96790a9 100644 --- a/src/dump-fon.cc +++ b/src/dump-fon.cc @@ -27,7 +27,7 @@ #include "hb-open-type-private.hh" #ifndef HB_NO_VISIBILITY -const void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; +void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; #endif diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 7f9b6be88..6cb24eaf1 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -47,7 +47,7 @@ #ifndef HB_NO_VISIBILITY -const void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; +void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; #endif diff --git a/src/hb-private.hh b/src/hb-private.hh index 0d1cc0ef3..d2540d3b6 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -550,16 +550,16 @@ static #else extern HB_INTERNAL #endif -const void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] +void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] #ifdef HB_NO_VISIBILITY = {} #endif ; /* Generic nul-content Null objects. */ template -static inline const Type& Null (void) { +static inline Type const & Null (void) { static_assert (sizeof (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE."); - return *reinterpret_cast (_hb_NullPool); + return *reinterpret_cast (_hb_NullPool); } #define Null(Type) Null() diff --git a/src/hb-subset.cc b/src/hb-subset.cc index e974d0f4d..94d65156d 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -45,7 +45,7 @@ #if !defined(HB_NO_VISIBILITY) && !defined(HB_SUBSET_BUILTIN) -const void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; +void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; #endif diff --git a/src/main.cc b/src/main.cc index 2fec52f97..88625b4cd 100644 --- a/src/main.cc +++ b/src/main.cc @@ -38,7 +38,7 @@ using namespace OT; #ifndef HB_NO_VISIBILITY -const void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; +void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; thread_local void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; #endif