diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index d093c1c70adbf380a9db49ccbe44bc5813fc97e1..0617e23d517e1ed4c04d2863a767584f2278e06d 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -104,7 +104,7 @@ struct TrackData const TrackTableEntry *trackTableEntry = nullptr; for (unsigned int i = 0; i < sizes; ++i) // For now we only seek for track entries with zero tracking value - if (trackTable[i].get_track_value () == 0.) + if (trackTable[i].get_track_value () == 0.f) trackTableEntry = &trackTable[0]; // We couldn't match any, exit @@ -127,8 +127,8 @@ struct TrackData float s0 = size_table[size_index - 1].to_float (); float s1 = size_table[size_index].to_float (); float t = (csspx - s0) / (s1 - s0); - return t * trackTableEntry->get_value (base, size_index) + - (1.0 - t) * trackTableEntry->get_value (base, size_index - 1); + return (float) t * trackTableEntry->get_value (base, size_index) + + ((float) 1.0 - t) * trackTableEntry->get_value (base, size_index - 1); } protected: diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 382fccb25088c7e94a314a067d2f54f336447968..efbaa7ad9367dc4b152a50b1360e94b9064751dc 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -684,8 +684,8 @@ typedef HBUINT16 UFWORD; struct F2DOT14 : HBINT16 { // 16384 means 1<<14 - inline float to_float (void) const { return ((int32_t) v) / 16384.0; } - inline void set_float (float f) { v.set (round (f * 16384.0)); } + inline float to_float (void) const { return ((int32_t) v) / 16384.f; } + inline void set_float (float f) { v.set (round (f * 16384.f)); } public: DEFINE_SIZE_STATIC (2); }; @@ -694,8 +694,8 @@ struct F2DOT14 : HBINT16 struct Fixed : HBINT32 { // 65536 means 1<<16 - inline float to_float (void) const { return ((int32_t) v) / 65536.0; } - inline void set_float (float f) { v.set (round (f * 65536.0)); } + inline float to_float (void) const { return ((int32_t) v) / 65536.f; } + inline void set_float (float f) { v.set (round (f * 65536.f)); } public: DEFINE_SIZE_STATIC (4); }; diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 66df2a7187bd15bf4974306139c0bb91ecd036bf..bd193f9dc4047708053b83a5db050c72920207ca 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -1280,7 +1280,7 @@ struct VarRegionList { int coord = i < coord_len ? coords[i] : 0; float factor = axes[i].evaluate (coord); - if (factor == 0.) + if (factor == 0.f) return 0.; v *= factor; }