From 83408cf804a6908873c41b70bb7c43448e66ddd2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 6 Nov 2013 14:46:04 -0500 Subject: [PATCH] Fix llvm warnings on Mac Patch from Scott Fleischman. Warnings were: harfbuzz/src/hb-font-private.hh:121:42: Implicit conversion loses integer precision: 'long long' to 'hb_position_t' (aka 'int') harfbuzz/src/hb-font-private.hh:126:42: Implicit conversion loses integer precision: 'long long' to 'hb_position_t' (aka 'int') harfbuzz/src/hb-font-private.hh:400:85: Implicit conversion loses integer precision: 'long long' to 'hb_position_t' (aka 'int') harfbuzz/src/hb-ot-layout-common-private.hh:1115:37: Implicit conversion loses integer precision: 'long long' to 'int' harfbuzz/src/hb-ft.cc:421:97: Implicit conversion loses integer precision: 'unsigned long long' to 'int' harfbuzz/src/hb-ft.cc:422:97: Implicit conversion loses integer precision: 'unsigned long long' to 'int' --- src/hb-font-private.hh | 6 +++--- src/hb-ft.cc | 4 ++-- src/hb-ot-layout-common-private.hh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hb-font-private.hh b/src/hb-font-private.hh index 00c0cc3f2..aa6c515bc 100644 --- a/src/hb-font-private.hh +++ b/src/hb-font-private.hh @@ -118,12 +118,12 @@ struct hb_font_t { /* Convert from parent-font user-space to our user-space */ inline hb_position_t parent_scale_x_distance (hb_position_t v) { if (unlikely (parent && parent->x_scale != x_scale)) - return v * (int64_t) this->x_scale / this->parent->x_scale; + return (hb_position_t) (v * (int64_t) this->x_scale / this->parent->x_scale); return v; } inline hb_position_t parent_scale_y_distance (hb_position_t v) { if (unlikely (parent && parent->y_scale != y_scale)) - return v * (int64_t) this->y_scale / this->parent->y_scale; + return (hb_position_t) (v * (int64_t) this->y_scale / this->parent->y_scale); return v; } inline hb_position_t parent_scale_x_position (hb_position_t v) { @@ -397,7 +397,7 @@ struct hb_font_t { } private: - inline hb_position_t em_scale (int16_t v, int scale) { return v * (int64_t) scale / face->get_upem (); } + inline hb_position_t em_scale (int16_t v, int scale) { return (hb_position_t) (v * (int64_t) scale / face->get_upem ()); } }; #define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 113b0eb85..44e0b0bc2 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -418,8 +418,8 @@ hb_ft_font_create (FT_Face ft_face, _hb_ft_get_font_funcs (), ft_face, (hb_destroy_func_t) _do_nothing); hb_font_set_scale (font, - ((uint64_t) ft_face->size->metrics.x_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16, - ((uint64_t) ft_face->size->metrics.y_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16); + (int) (((uint64_t) ft_face->size->metrics.x_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16), + (int) (((uint64_t) ft_face->size->metrics.y_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16)); hb_font_set_ppem (font, ft_face->size->metrics.x_ppem, ft_face->size->metrics.y_ppem); diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 1e75930cd..367db9557 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -1112,7 +1112,7 @@ struct Device if (!pixels) return 0; - return pixels * (int64_t) scale / ppem; + return (int) (pixels * (int64_t) scale / ppem); }