inline void reset_masks (hb_mask_t mask)
{
- for (unsigned int i = 0; i < len; i++)
- info[i].mask = mask;
+ for (unsigned int j = 0; j < len; j++)
+ info[j].mask = mask;
}
inline void add_masks (hb_mask_t mask)
{
- for (unsigned int i = 0; i < len; i++)
- info[i].mask |= mask;
+ for (unsigned int j = 0; j < len; j++)
+ info[j].mask |= mask;
}
inline void set_masks (hb_mask_t value,
hb_mask_t mask,
inline bool set_user_data (hb_user_data_key_t *key,
void * data,
- hb_destroy_func_t destroy) {
+ hb_destroy_func_t destroy_func) {
if (unlikely (!this || this->is_inert ()))
return false;
- return user_data.set (key, data, destroy);
+ return user_data.set (key, data, destroy_func);
}
inline void *get_user_data (hb_user_data_key_t *key) {
template <int max_depth>
struct hb_trace_t {
- explicit hb_trace_t (unsigned int *pdepth, const char *what, const char *function, const void *obj) : pdepth(pdepth) {
+ explicit hb_trace_t (unsigned int *pdepth_, const char *what, const char *function, const void *obj) : pdepth(pdepth_) {
(void) (*pdepth < max_depth &&
fprintf (stderr, "%s(%p) %-*d-> %s\n", what, obj, *pdepth, *pdepth, function));
if (max_depth) ++*pdepth;
struct hb_sanitize_context_t
{
- inline void init (hb_blob_t *blob)
+ inline void init (hb_blob_t *b)
{
- this->blob = hb_blob_reference (blob);
+ this->blob = hb_blob_reference (b);
this->writable = false;
}
hb_tag_t *record_tags /* OUT */) const
{
if (record_count) {
- const Record<Type> *array = this->sub_array (start_offset, record_count);
+ const Record<Type> *arr = this->sub_array (start_offset, record_count);
unsigned int count = *record_count;
for (unsigned int i = 0; i < count; i++)
- record_tags[i] = array[i].tag;
+ record_tags[i] = arr[i].tag;
}
return this->len;
}
unsigned int *_indexes /* OUT */) const
{
if (_count) {
- const USHORT *array = this->sub_array (start_offset, _count);
+ const USHORT *arr = this->sub_array (start_offset, _count);
unsigned int count = *_count;
for (unsigned int i = 0; i < count; i++)
- _indexes[i] = array[i];
+ _indexes[i] = arr[i];
}
return this->len;
}
/* Sort features and merge duplicates */
- feature_infos.sort ();
- unsigned int j = 0;
- for (unsigned int i = 1; i < feature_infos.len; i++)
- if (feature_infos[i].tag != feature_infos[j].tag)
- feature_infos[++j] = feature_infos[i];
- else {
- if (feature_infos[i].global)
- feature_infos[j] = feature_infos[i];
+ {
+ feature_infos.sort ();
+ unsigned int j = 0;
+ for (unsigned int i = 1; i < feature_infos.len; i++)
+ if (feature_infos[i].tag != feature_infos[j].tag)
+ feature_infos[++j] = feature_infos[i];
else {
- feature_infos[j].global = false;
- feature_infos[j].max_value = MAX (feature_infos[j].max_value, feature_infos[i].max_value);
- /* Inherit default_value from j */
+ if (feature_infos[i].global)
+ feature_infos[j] = feature_infos[i];
+ else {
+ feature_infos[j].global = false;
+ feature_infos[j].max_value = MAX (feature_infos[j].max_value, feature_infos[i].max_value);
+ /* Inherit default_value from j */
+ }
}
- }
- feature_infos.shrink (j + 1);
+ feature_infos.shrink (j + 1);
+ }
/* Allocate bits now */
static const struct arabic_state_table_entry {
uint8_t prev_action;
uint8_t curr_action;
- uint8_t next_state;
- uint8_t padding;
+ uint16_t next_state;
} arabic_state_table[][NUM_STATE_MACHINE_COLS] =
{
/* jt_U, jt_R, jt_D, jg_ALAPH, jg_DALATH_RISH */
static cairo_surface_t *surface = NULL;
static cairo_pattern_t *fore_pattern = NULL;
static cairo_pattern_t *back_pattern = NULL;
-static FT_Library ft_library;
-static FT_Face ft_face;
static cairo_font_face_t *cairo_face;
break;
case 'm':
switch (sscanf (optarg, "%d %d %d %d", &margin_t, &margin_r, &margin_b, &margin_l)) {
+ default: break;
case 1: margin_r = margin_t;
case 2: margin_b = margin_t;
case 3: margin_l = margin_r;
static cairo_glyph_t *
_hb_cr_text_glyphs (cairo_t *cr,
- const char *text, int len,
+ const char *utf8, int len,
unsigned int *pnum_glyphs)
{
cairo_scaled_font_t *scaled_font = cairo_get_scaled_font (cr);
hb_buffer_set_language (hb_buffer, hb_language_from_string (language));
if (len < 0)
- len = strlen (text);
- hb_buffer_add_utf8 (hb_buffer, text, len, 0, len);
+ len = strlen (utf8);
+ hb_buffer_add_utf8 (hb_buffer, utf8, len, 0, len);
hb_shape (hb_font, hb_buffer, features, num_features);
int
main (int argc, char **argv)
{
+ static FT_Library ft_library;
+ static FT_Face ft_face;
cairo_status_t status;
setlocale (LC_ALL, "");
hb_user_data_key_t key[2];
{
- unsigned int i;
+ unsigned int j;
data_t data[2] = {{MAGIC0, FALSE}, {MAGIC1, FALSE}};
deadlock_test_t deadlock_test;
g_assert_cmpuint (global_data, ==, 1);
global_data = 0;
- for (i = 2; i < 1000; i++)
- g_assert (o->set_user_data (obj, &key[i], &data[i], global_free_up));
- for (i = 2; i < 1000; i++)
- g_assert (o->get_user_data (obj, &key[i]) == &data[i]);
- for (i = 100; i < 1000; i++)
- g_assert (o->set_user_data (obj, &key[i], NULL, NULL));
- for (i = 2; i < 100; i++)
- g_assert (o->get_user_data (obj, &key[i]) == &data[i]);
- for (i = 100; i < 1000; i++)
- g_assert (!o->get_user_data (obj, &key[i]));
+ for (j = 2; j < 1000; j++)
+ g_assert (o->set_user_data (obj, &key[j], &data[j], global_free_up));
+ for (j = 2; j < 1000; j++)
+ g_assert (o->get_user_data (obj, &key[j]) == &data[j]);
+ for (j = 100; j < 1000; j++)
+ g_assert (o->set_user_data (obj, &key[j], NULL, NULL));
+ for (j = 2; j < 100; j++)
+ g_assert (o->get_user_data (obj, &key[j]) == &data[j]);
+ for (j = 100; j < 1000; j++)
+ g_assert (!o->get_user_data (obj, &key[j]));
g_assert_cmpuint (global_data, ==, 900);
/* Test set_user_data where the destroy() func calls user_data functions.
}
static hb_codepoint_t
-default_value (hb_codepoint_t default_value, hb_codepoint_t unicode)
+default_value (hb_codepoint_t _default_value, hb_codepoint_t unicode)
{
- return default_value == RETURNS_UNICODE_ITSELF ? unicode : default_value;
+ return _default_value == RETURNS_UNICODE_ITSELF ? unicode : _default_value;
}
static void