Better hide nil objects and make them const
diff --git a/src/hb-icu.cc b/src/hb-icu.cc index 5cd0143..78cbc1a 100644 --- a/src/hb-icu.cc +++ b/src/hb-icu.cc
@@ -269,23 +269,22 @@ return ret; } -extern HB_INTERNAL hb_unicode_funcs_t _hb_unicode_funcs_icu; -hb_unicode_funcs_t _hb_icu_unicode_funcs = { - HB_OBJECT_HEADER_STATIC, - - NULL, /* parent */ - TRUE, /* immutable */ - { -#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_icu_unicode_##name, - HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS -#undef HB_UNICODE_FUNC_IMPLEMENT - } -}; - hb_unicode_funcs_t * hb_icu_get_unicode_funcs (void) { - return &_hb_icu_unicode_funcs; + static const hb_unicode_funcs_t _hb_icu_unicode_funcs = { + HB_OBJECT_HEADER_STATIC, + + NULL, /* parent */ + TRUE, /* immutable */ + { +#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_icu_unicode_##name, + HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_UNICODE_FUNC_IMPLEMENT + } + }; + + return const_cast<hb_unicode_funcs_t *> (&_hb_icu_unicode_funcs); }