Minor compiler warning fixes
diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh
index 7c298b0..4fae884 100644
--- a/src/hb-buffer-private.hh
+++ b/src/hb-buffer-private.hh
@@ -128,13 +128,13 @@
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,
diff --git a/src/hb-object-private.hh b/src/hb-object-private.hh
index 247f493..acd1b9e 100644
--- a/src/hb-object-private.hh
+++ b/src/hb-object-private.hh
@@ -179,11 +179,11 @@
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) {
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 300a13a..ea763e9 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -151,7 +151,7 @@
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;
@@ -183,9 +183,9 @@
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;
}
diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh
index 1381964..ce47e22 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -89,10 +89,10 @@
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;
}
@@ -150,10 +150,10 @@
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;
}
diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc
index 68e1321..a68f123 100644
--- a/src/hb-ot-map.cc
+++ b/src/hb-ot-map.cc
@@ -104,21 +104,23 @@
/* 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 */
diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc
index 4e7170c..edcd7fb 100644
--- a/src/hb-ot-shape-complex-arabic.cc
+++ b/src/hb-ot-shape-complex-arabic.cc
@@ -121,8 +121,7 @@
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 */
diff --git a/src/hb-view.cc b/src/hb-view.cc
index 104d95c..97352cd 100644
--- a/src/hb-view.cc
+++ b/src/hb-view.cc
@@ -72,8 +72,6 @@
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;
@@ -141,6 +139,7 @@
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;
@@ -346,7 +345,7 @@
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);
@@ -369,8 +368,8 @@
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);
@@ -526,6 +525,8 @@
int
main (int argc, char **argv)
{
+ static FT_Library ft_library;
+ static FT_Face ft_face;
cairo_status_t status;
setlocale (LC_ALL, "");