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.
This commit is contained in:
Behdad Esfahbod 2018-05-24 14:09:04 -07:00
parent 31c4236d96
commit 7f7b1370d3
6 changed files with 8 additions and 8 deletions

View File

@ -47,7 +47,7 @@
#include <stdio.h>
#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

View File

@ -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

View File

@ -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

View File

@ -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 <typename Type>
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<const Type *> (_hb_NullPool);
return *reinterpret_cast<Type const *> (_hb_NullPool);
}
#define Null(Type) Null<Type>()

View File

@ -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

View File

@ -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