Remove ASSERT_POD
Newer compilers / language allows structs with constructor in union. So, this was not actually testing anything. Indeed, the recent change in DISALLOW_COPY *is* making some of our types non-POD. That broke some bots. Just remove this since it wasn't doing much, and I'd rather have DISALLOW_COPY.
This commit is contained in:
parent
6f0454e176
commit
35d410f2ba
|
@ -69,7 +69,6 @@ struct hb_blob_t
|
||||||
|
|
||||||
public:
|
public:
|
||||||
hb_object_header_t header;
|
hb_object_header_t header;
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
bool immutable;
|
bool immutable;
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,6 @@ HB_MARK_AS_FLAG_T (hb_buffer_scratch_flags_t);
|
||||||
struct hb_buffer_t
|
struct hb_buffer_t
|
||||||
{
|
{
|
||||||
hb_object_header_t header;
|
hb_object_header_t header;
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
/* Information about how the text in the buffer should be treated */
|
/* Information about how the text in the buffer should be treated */
|
||||||
hb_unicode_funcs_t *unicode; /* Unicode functions */
|
hb_unicode_funcs_t *unicode; /* Unicode functions */
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
struct hb_face_t
|
struct hb_face_t
|
||||||
{
|
{
|
||||||
hb_object_header_t header;
|
hb_object_header_t header;
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
hb_bool_t immutable;
|
hb_bool_t immutable;
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,6 @@
|
||||||
struct hb_font_funcs_t
|
struct hb_font_funcs_t
|
||||||
{
|
{
|
||||||
hb_object_header_t header;
|
hb_object_header_t header;
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
hb_bool_t immutable;
|
hb_bool_t immutable;
|
||||||
|
|
||||||
|
@ -102,7 +101,6 @@ DECLARE_NULL_INSTANCE (hb_font_funcs_t);
|
||||||
struct hb_font_t
|
struct hb_font_t
|
||||||
{
|
{
|
||||||
hb_object_header_t header;
|
hb_object_header_t header;
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
hb_bool_t immutable;
|
hb_bool_t immutable;
|
||||||
|
|
||||||
|
|
|
@ -82,10 +82,7 @@ static inline Type& StructAfter(TObject &X)
|
||||||
/* Check _assertion in a method environment */
|
/* Check _assertion in a method environment */
|
||||||
#define _DEFINE_INSTANCE_ASSERTION1(_line, _assertion) \
|
#define _DEFINE_INSTANCE_ASSERTION1(_line, _assertion) \
|
||||||
inline void _instance_assertion_on_line_##_line (void) const \
|
inline void _instance_assertion_on_line_##_line (void) const \
|
||||||
{ \
|
{ static_assert ((_assertion), ""); }
|
||||||
static_assert ((_assertion), ""); \
|
|
||||||
ASSERT_INSTANCE_POD (*this); /* Make sure it's POD. */ \
|
|
||||||
}
|
|
||||||
# define _DEFINE_INSTANCE_ASSERTION0(_line, _assertion) _DEFINE_INSTANCE_ASSERTION1 (_line, _assertion)
|
# define _DEFINE_INSTANCE_ASSERTION0(_line, _assertion) _DEFINE_INSTANCE_ASSERTION1 (_line, _assertion)
|
||||||
# define DEFINE_INSTANCE_ASSERTION(_assertion) _DEFINE_INSTANCE_ASSERTION0 (__LINE__, _assertion)
|
# define DEFINE_INSTANCE_ASSERTION(_assertion) _DEFINE_INSTANCE_ASSERTION0 (__LINE__, _assertion)
|
||||||
|
|
||||||
|
|
|
@ -195,12 +195,8 @@ struct hb_object_header_t
|
||||||
{
|
{
|
||||||
hb_reference_count_t ref_count;
|
hb_reference_count_t ref_count;
|
||||||
hb_atomic_ptr_t<hb_user_data_array_t> user_data;
|
hb_atomic_ptr_t<hb_user_data_array_t> user_data;
|
||||||
|
|
||||||
#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INIT, HB_ATOMIC_PTR_INIT (nullptr)}
|
|
||||||
|
|
||||||
private:
|
|
||||||
ASSERT_POD ();
|
|
||||||
};
|
};
|
||||||
|
#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INIT, HB_ATOMIC_PTR_INIT (nullptr)}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -194,8 +194,6 @@ arabic_fallback_synthesize_lookup (const hb_ot_shape_plan_t *plan,
|
||||||
|
|
||||||
struct arabic_fallback_plan_t
|
struct arabic_fallback_plan_t
|
||||||
{
|
{
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
unsigned int num_lookups;
|
unsigned int num_lookups;
|
||||||
bool free_lookups;
|
bool free_lookups;
|
||||||
|
|
||||||
|
|
|
@ -243,8 +243,6 @@ collect_features_arabic (hb_ot_shape_planner_t *plan)
|
||||||
|
|
||||||
struct arabic_shape_plan_t
|
struct arabic_shape_plan_t
|
||||||
{
|
{
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
/* The "+ 1" in the next array is to accommodate for the "NONE" command,
|
/* The "+ 1" in the next array is to accommodate for the "NONE" command,
|
||||||
* which is not an OpenType feature, but this simplifies the code by not
|
* which is not an OpenType feature, but this simplifies the code by not
|
||||||
* having to do a "if (... < NONE) ..." and just rely on the fact that
|
* having to do a "if (... < NONE) ..." and just rely on the fact that
|
||||||
|
|
|
@ -70,8 +70,6 @@ override_features_hangul (hb_ot_shape_planner_t *plan)
|
||||||
|
|
||||||
struct hangul_shape_plan_t
|
struct hangul_shape_plan_t
|
||||||
{
|
{
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
hb_mask_t mask_array[HANGUL_FEATURE_COUNT];
|
hb_mask_t mask_array[HANGUL_FEATURE_COUNT];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -252,8 +252,6 @@ struct would_substitute_feature_t
|
||||||
|
|
||||||
struct indic_shape_plan_t
|
struct indic_shape_plan_t
|
||||||
{
|
{
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
inline bool load_virama_glyph (hb_font_t *font, hb_codepoint_t *pglyph) const
|
inline bool load_virama_glyph (hb_font_t *font, hb_codepoint_t *pglyph) const
|
||||||
{
|
{
|
||||||
hb_codepoint_t glyph = virama_glyph.get_relaxed ();
|
hb_codepoint_t glyph = virama_glyph.get_relaxed ();
|
||||||
|
|
|
@ -174,8 +174,6 @@ struct would_substitute_feature_t
|
||||||
|
|
||||||
struct khmer_shape_plan_t
|
struct khmer_shape_plan_t
|
||||||
{
|
{
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
inline bool get_virama_glyph (hb_font_t *font, hb_codepoint_t *pglyph) const
|
inline bool get_virama_glyph (hb_font_t *font, hb_codepoint_t *pglyph) const
|
||||||
{
|
{
|
||||||
hb_codepoint_t glyph = virama_glyph;
|
hb_codepoint_t glyph = virama_glyph;
|
||||||
|
|
|
@ -171,8 +171,6 @@ collect_features_use (hb_ot_shape_planner_t *plan)
|
||||||
|
|
||||||
struct use_shape_plan_t
|
struct use_shape_plan_t
|
||||||
{
|
{
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
hb_mask_t rphf_mask;
|
hb_mask_t rphf_mask;
|
||||||
|
|
||||||
arabic_shape_plan_t *arabic_plan;
|
arabic_shape_plan_t *arabic_plan;
|
||||||
|
|
|
@ -48,8 +48,6 @@
|
||||||
template <typename mask_t, unsigned int shift>
|
template <typename mask_t, unsigned int shift>
|
||||||
struct hb_set_digest_lowest_bits_t
|
struct hb_set_digest_lowest_bits_t
|
||||||
{
|
{
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
enum { mask_bytes = sizeof (mask_t) };
|
enum { mask_bytes = sizeof (mask_t) };
|
||||||
enum { mask_bits = sizeof (mask_t) * 8 };
|
enum { mask_bits = sizeof (mask_t) * 8 };
|
||||||
static const unsigned int num_bits = 0
|
static const unsigned int num_bits = 0
|
||||||
|
@ -117,8 +115,6 @@ struct hb_set_digest_lowest_bits_t
|
||||||
template <typename head_t, typename tail_t>
|
template <typename head_t, typename tail_t>
|
||||||
struct hb_set_digest_combiner_t
|
struct hb_set_digest_combiner_t
|
||||||
{
|
{
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
inline void init (void) {
|
inline void init (void) {
|
||||||
head.init ();
|
head.init ();
|
||||||
tail.init ();
|
tail.init ();
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
struct hb_shape_plan_t
|
struct hb_shape_plan_t
|
||||||
{
|
{
|
||||||
hb_object_header_t header;
|
hb_object_header_t header;
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
hb_bool_t default_shaper_list;
|
hb_bool_t default_shaper_list;
|
||||||
hb_face_t *face_unsafe; /* We don't carry a reference to face. */
|
hb_face_t *face_unsafe; /* We don't carry a reference to face. */
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
struct hb_subset_input_t
|
struct hb_subset_input_t
|
||||||
{
|
{
|
||||||
hb_object_header_t header;
|
hb_object_header_t header;
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
hb_set_t *unicodes;
|
hb_set_t *unicodes;
|
||||||
hb_set_t *glyphs;
|
hb_set_t *glyphs;
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
struct hb_subset_plan_t
|
struct hb_subset_plan_t
|
||||||
{
|
{
|
||||||
hb_object_header_t header;
|
hb_object_header_t header;
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
bool drop_hints : 1;
|
bool drop_hints : 1;
|
||||||
bool drop_layout : 1;
|
bool drop_layout : 1;
|
||||||
|
|
|
@ -63,7 +63,6 @@ extern HB_INTERNAL const uint8_t _hb_modified_combining_class[256];
|
||||||
struct hb_unicode_funcs_t
|
struct hb_unicode_funcs_t
|
||||||
{
|
{
|
||||||
hb_object_header_t header;
|
hb_object_header_t header;
|
||||||
ASSERT_POD ();
|
|
||||||
|
|
||||||
hb_unicode_funcs_t *parent;
|
hb_unicode_funcs_t *parent;
|
||||||
|
|
||||||
|
|
26
src/hb.hh
26
src/hb.hh
|
@ -337,32 +337,6 @@ static_assert ((sizeof (hb_mask_t) == 4), "");
|
||||||
static_assert ((sizeof (hb_var_int_t) == 4), "");
|
static_assert ((sizeof (hb_var_int_t) == 4), "");
|
||||||
|
|
||||||
|
|
||||||
/* We like our types POD */
|
|
||||||
|
|
||||||
#define _ASSERT_TYPE_POD1(_line, _type) union _type_##_type##_on_line_##_line##_is_not_POD { _type instance; }
|
|
||||||
#define _ASSERT_TYPE_POD0(_line, _type) _ASSERT_TYPE_POD1 (_line, _type)
|
|
||||||
#define ASSERT_TYPE_POD(_type) _ASSERT_TYPE_POD0 (__LINE__, _type)
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
# define _ASSERT_INSTANCE_POD1(_line, _instance) \
|
|
||||||
HB_STMT_START { \
|
|
||||||
typedef __typeof__(_instance) _type_##_line; \
|
|
||||||
_ASSERT_TYPE_POD1 (_line, _type_##_line); \
|
|
||||||
} HB_STMT_END
|
|
||||||
#else
|
|
||||||
# define _ASSERT_INSTANCE_POD1(_line, _instance) typedef int _assertion_on_line_##_line##_not_tested
|
|
||||||
#endif
|
|
||||||
# define _ASSERT_INSTANCE_POD0(_line, _instance) _ASSERT_INSTANCE_POD1 (_line, _instance)
|
|
||||||
# define ASSERT_INSTANCE_POD(_instance) _ASSERT_INSTANCE_POD0 (__LINE__, _instance)
|
|
||||||
|
|
||||||
/* Check _assertion in a method environment */
|
|
||||||
#define _ASSERT_POD1(_line) \
|
|
||||||
HB_UNUSED inline void _static_assertion_on_line_##_line (void) const \
|
|
||||||
{ _ASSERT_INSTANCE_POD1 (_line, *this); /* Make sure it's POD. */ }
|
|
||||||
# define _ASSERT_POD0(_line) _ASSERT_POD1 (_line)
|
|
||||||
# define ASSERT_POD() _ASSERT_POD0 (__LINE__)
|
|
||||||
|
|
||||||
|
|
||||||
#define HB_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
#define HB_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||||
TypeName(const TypeName&); \
|
TypeName(const TypeName&); \
|
||||||
void operator=(const TypeName&)
|
void operator=(const TypeName&)
|
||||||
|
|
Loading…
Reference in New Issue