Minor rename of static symbols to namespace them

This commit is contained in:
Behdad Esfahbod 2022-06-16 13:50:35 -06:00
parent e0a5231657
commit 19802dfdf0
3 changed files with 16 additions and 16 deletions

View File

@ -31,7 +31,7 @@
#include "hb-buffer.hh"
static const char *serialize_formats[] = {
static const char *_hb_buffer_serialize_formats[] = {
"text",
"json",
nullptr
@ -50,7 +50,7 @@ static const char *serialize_formats[] = {
const char **
hb_buffer_serialize_list_formats ()
{
return serialize_formats;
return _hb_buffer_serialize_formats;
}
/**
@ -91,8 +91,8 @@ hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format)
{
switch ((unsigned) format)
{
case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return serialize_formats[0];
case HB_BUFFER_SERIALIZE_FORMAT_JSON: return serialize_formats[1];
case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return _hb_buffer_serialize_formats[0];
case HB_BUFFER_SERIALIZE_FORMAT_JSON: return _hb_buffer_serialize_formats[1];
default:
case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return nullptr;
}

View File

@ -45,7 +45,7 @@ struct hb_ot_language_map_t
};
static const hb_ot_language_map_t
hb_ms_language_map[] =
_hb_ms_language_map[] =
{
{0x0001, "ar"}, /* ??? */
{0x0004, "zh"}, /* ??? */
@ -298,7 +298,7 @@ hb_ms_language_map[] =
};
static const hb_ot_language_map_t
hb_mac_language_map[] =
_hb_mac_language_map[] =
{
{ 0, "en"}, /* English */
{ 1, "fr"}, /* French */
@ -441,16 +441,16 @@ hb_language_t
_hb_ot_name_language_for_ms_code (unsigned int code)
{
return _hb_ot_name_language_for (code,
hb_ms_language_map,
ARRAY_LENGTH (hb_ms_language_map));
_hb_ms_language_map,
ARRAY_LENGTH (_hb_ms_language_map));
}
hb_language_t
_hb_ot_name_language_for_mac_code (unsigned int code)
{
return _hb_ot_name_language_for (code,
hb_mac_language_map,
ARRAY_LENGTH (hb_mac_language_map));
_hb_mac_language_map,
ARRAY_LENGTH (_hb_mac_language_map));
}
#endif /* HB_OT_NAME_LANGUAGE_STATIC_HH */

View File

@ -29,13 +29,13 @@
#include "hb-machinery.hh"
static const hb_shaper_entry_t all_shapers[] = {
static const hb_shaper_entry_t _hb_all_shapers[] = {
#define HB_SHAPER_IMPLEMENT(name) {#name, _hb_##name##_shape},
#include "hb-shaper-list.hh"
#undef HB_SHAPER_IMPLEMENT
};
#ifndef HB_NO_SHAPER
static_assert (0 != ARRAY_LENGTH_CONST (all_shapers), "No shaper enabled.");
static_assert (0 != ARRAY_LENGTH_CONST (_hb_all_shapers), "No shaper enabled.");
#endif
static inline void free_static_shapers ();
@ -49,11 +49,11 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_
if (!env || !*env)
return nullptr;
hb_shaper_entry_t *shapers = (hb_shaper_entry_t *) hb_calloc (1, sizeof (all_shapers));
hb_shaper_entry_t *shapers = (hb_shaper_entry_t *) hb_calloc (1, sizeof (_hb_all_shapers));
if (unlikely (!shapers))
return nullptr;
memcpy (shapers, all_shapers, sizeof (all_shapers));
memcpy (shapers, _hb_all_shapers, sizeof (_hb_all_shapers));
/* Reorder shaper list to prefer requested shapers. */
unsigned int i = 0;
@ -64,7 +64,7 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_
if (!end)
end = p + strlen (p);
for (unsigned int j = i; j < ARRAY_LENGTH (all_shapers); j++)
for (unsigned int j = i; j < ARRAY_LENGTH (_hb_all_shapers); j++)
if (end - p == (int) strlen (shapers[j].name) &&
0 == strncmp (shapers[j].name, p, end - p))
{
@ -86,7 +86,7 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_
return shapers;
}
static void destroy (const hb_shaper_entry_t *p) { hb_free ((void *) p); }
static const hb_shaper_entry_t *get_null () { return all_shapers; }
static const hb_shaper_entry_t *get_null () { return _hb_all_shapers; }
} static_shapers;
static inline