[coretext] Fix double promotion warnings by making casts explicit

This commit is contained in:
Ebrahim Byagowi 2019-09-14 10:56:00 +04:30
parent cbbb6fa455
commit f3214df6f6
1 changed files with 2 additions and 2 deletions

View File

@ -302,7 +302,7 @@ _hb_coretext_shaper_font_data_create (hb_font_t *font)
if (unlikely (!face_data)) return nullptr; if (unlikely (!face_data)) return nullptr;
CGFontRef cg_font = (CGFontRef) (const void *) face->data.coretext; CGFontRef cg_font = (CGFontRef) (const void *) face->data.coretext;
CGFloat font_size = font->ptem <= 0.f ? HB_CORETEXT_DEFAULT_FONT_SIZE : font->ptem; CGFloat font_size = (CGFloat) (font->ptem <= 0.f ? HB_CORETEXT_DEFAULT_FONT_SIZE : font->ptem);
CTFontRef ct_font = create_ct_font (cg_font, font_size); CTFontRef ct_font = create_ct_font (cg_font, font_size);
if (unlikely (!ct_font)) if (unlikely (!ct_font))
@ -327,7 +327,7 @@ retry:
const hb_coretext_font_data_t *data = font->data.coretext; const hb_coretext_font_data_t *data = font->data.coretext;
if (unlikely (!data)) return nullptr; if (unlikely (!data)) return nullptr;
if (fabs (CTFontGetSize ((CTFontRef) data) - font->ptem) > .5) if (fabs (CTFontGetSize ((CTFontRef) data) - (CGFloat) font->ptem) > .5)
{ {
/* XXX-MT-bug /* XXX-MT-bug
* Note that evaluating condition above can be dangerous if another thread * Note that evaluating condition above can be dangerous if another thread