diff --git a/src/hb-font.cc b/src/hb-font.cc index 72dc044fa..34c2345dd 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -75,14 +75,12 @@ hb_font_get_kerning_nil (hb_font_t *font HB_UNUSED, hb_font_funcs_t _hb_font_funcs_nil = { HB_REFERENCE_COUNT_INVALID, /* ref_count */ - TRUE, /* immutable */ - { - hb_font_get_glyph_nil, - hb_font_get_contour_point_nil, - hb_font_get_glyph_metrics_nil, - hb_font_get_kerning_nil + hb_font_get_glyph_nil, + hb_font_get_contour_point_nil, + hb_font_get_glyph_metrics_nil, + hb_font_get_kerning_nil } }; @@ -94,6 +92,8 @@ hb_font_funcs_create (void) if (!HB_OBJECT_DO_CREATE (hb_font_funcs_t, ffuncs)) return &_hb_font_funcs_nil; + ffuncs->v = _hb_font_funcs_nil.v; + return ffuncs; } @@ -125,11 +125,7 @@ hb_font_funcs_copy (hb_font_funcs_t *other_ffuncs) if (!HB_OBJECT_DO_CREATE (hb_font_funcs_t, ffuncs)) return &_hb_font_funcs_nil; - *ffuncs = *other_ffuncs; - - /* re-init refcount */ - HB_OBJECT_DO_INIT (ffuncs); - ffuncs->immutable = FALSE; + ffuncs->v = other_ffuncs->v; return ffuncs; } diff --git a/src/hb-unicode.c b/src/hb-unicode.c index 69ba58c1b..77efb678e 100644 --- a/src/hb-unicode.c +++ b/src/hb-unicode.c @@ -40,9 +40,7 @@ static unsigned int hb_unicode_get_eastasian_width_nil (hb_codepoint_t unicode H hb_unicode_funcs_t _hb_unicode_funcs_nil = { HB_REFERENCE_COUNT_INVALID, /* ref_count */ - TRUE, /* immutable */ - { hb_unicode_get_general_category_nil, hb_unicode_get_combining_class_nil, @@ -60,8 +58,7 @@ hb_unicode_funcs_create (void) if (!HB_OBJECT_DO_CREATE (hb_unicode_funcs_t, ufuncs)) return &_hb_unicode_funcs_nil; - *ufuncs = _hb_unicode_funcs_nil; - HB_OBJECT_DO_INIT (ufuncs); + ufuncs->v = _hb_unicode_funcs_nil.v; return ufuncs; } @@ -94,9 +91,7 @@ hb_unicode_funcs_copy (hb_unicode_funcs_t *other_ufuncs) if (!HB_OBJECT_DO_CREATE (hb_unicode_funcs_t, ufuncs)) return &_hb_unicode_funcs_nil; - *ufuncs = *other_ufuncs; - HB_OBJECT_DO_INIT (ufuncs); - ufuncs->immutable = FALSE; + ufuncs->v = other_ufuncs->v; return ufuncs; }