Fix all VC++ warnings and errors in the current commit's builds.

This commit is contained in:
ThePhD 2015-06-22 22:29:04 -04:00
parent 5f13bbd9d4
commit 8e545d5961
9 changed files with 13 additions and 13 deletions

View File

@ -219,7 +219,7 @@ struct hb_language_item_t {
}
inline hb_language_item_t & operator = (const char *s) {
lang = (hb_language_t) strdup (s);
lang = (hb_language_t) _strdup (s);
for (unsigned char *p = (unsigned char *) lang; *p; p++)
*p = canon_map[*p];
@ -518,7 +518,7 @@ hb_user_data_array_t::set (hb_user_data_key_t *key,
}
}
hb_user_data_item_t item = {key, data, destroy};
bool ret = !!items.replace_or_insert (item, lock, replace);
bool ret = !!items.replace_or_insert (item, lock, replace != 0);
return ret;
}

View File

@ -106,7 +106,7 @@ _hb_fallback_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
*/
hb_codepoint_t space;
bool has_space = font->get_glyph (' ', 0, &space);
bool has_space = font->get_glyph (' ', 0, &space) != 0;
buffer->clear_positions ();

View File

@ -719,7 +719,7 @@ hb_ot_layout_lookup_would_substitute_fast (hb_face_t *face,
hb_bool_t zero_context)
{
if (unlikely (lookup_index >= hb_ot_layout_from_face (face)->gsub_lookup_count)) return false;
OT::hb_would_apply_context_t c (face, glyphs, glyphs_length, zero_context);
OT::hb_would_apply_context_t c (face, glyphs, glyphs_length, zero_context != 0);
const OT::SubstLookup& l = hb_ot_layout_from_face (face)->gsub->get_lookup (lookup_index);

View File

@ -89,7 +89,7 @@ hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
for (unsigned int table_index = 0; table_index < 2; table_index++) {
hb_tag_t table_tag = table_tags[table_index];
found_script[table_index] = hb_ot_layout_table_choose_script (face, table_tag, script_tags, &script_index[table_index], &chosen_script[table_index]);
found_script[table_index] = hb_ot_layout_table_choose_script (face, table_tag, script_tags, &script_index[table_index], &chosen_script[table_index]) != 0;
hb_ot_layout_script_find_language (face, table_tag, script_index[table_index], language_tag, &language_index[table_index]);
}
}

View File

@ -305,7 +305,7 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan,
{
/* Have <LV>, <LVT>, or <LV,T> */
hb_codepoint_t s = u;
bool has_glyph = font->has_glyph (s);
bool has_glyph = font->has_glyph (s) != 0;
unsigned int lindex = (s - SBase) / NCount;
unsigned int nindex = (s - SBase) % NCount;
unsigned int vindex = nindex / TCount;

View File

@ -68,7 +68,7 @@ compose_hebrew (const hb_ot_shape_normalize_context_t *c,
0xFB4Au /* TAV */
};
bool found = c->unicode->compose (a, b, ab);
bool found = c->unicode->compose (a, b, ab) != 0;
if (!found && !c->plan->has_mark)
{

View File

@ -1847,7 +1847,7 @@ decompose_indic (const hb_ot_shape_normalize_context_t *c,
}
}
return c->unicode->decompose (ab, a, b);
return c->unicode->decompose (ab, a, b) != 0;
}
static bool
@ -1863,7 +1863,7 @@ compose_indic (const hb_ot_shape_normalize_context_t *c,
/* Composition-exclusion exceptions that we want to recompose. */
if (a == 0x09AFu && b == 0x09BCu) { *ab = 0x09DFu; return true; }
return c->unicode->compose (a, b, ab);
return c->unicode->compose (a, b, ab) != 0;
}

View File

@ -88,7 +88,7 @@ decompose_unicode (const hb_ot_shape_normalize_context_t *c,
hb_codepoint_t *a,
hb_codepoint_t *b)
{
return c->unicode->decompose (ab, a, b);
return c->unicode->decompose (ab, a, b) != 0;
}
static bool
@ -97,7 +97,7 @@ compose_unicode (const hb_ot_shape_normalize_context_t *c,
hb_codepoint_t b,
hb_codepoint_t *ab)
{
return c->unicode->compose (a, b, ab);
return c->unicode->compose (a, b, ab) != 0;
}
static inline void
@ -139,7 +139,7 @@ decompose (const hb_ot_shape_normalize_context_t *c, bool shortest, hb_codepoint
(b && !font->get_glyph (b, 0, &b_glyph)))
return 0;
bool has_a = font->get_glyph (a, 0, &a_glyph);
bool has_a = font->get_glyph (a, 0, &a_glyph) != 0;
if (shortest && has_a) {
/* Output a and b */
output_char (buffer, a, a_glyph);

View File

@ -538,7 +538,7 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
{
bool ret = false;
unsigned int count = c->buffer->len;
bool has_positioning = hb_ot_layout_has_positioning (c->face);
bool has_positioning = hb_ot_layout_has_positioning (c->face) != 0;
/* If the font has no GPOS, AND, no fallback positioning will
* happen, AND, direction is forward, then when zeroing mark
* widths, we shift the mark with it, such that the mark