From 5179b96958f2db71c315c1d8c224bab87e2f4ae8 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Tue, 8 Oct 2019 11:09:12 +0330 Subject: [PATCH] [cff] minor on number_t --- src/hb-cff-interp-common.hh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/hb-cff-interp-common.hh b/src/hb-cff-interp-common.hh index fdc5c683a..780f61892 100644 --- a/src/hb-cff-interp-common.hh +++ b/src/hb-cff-interp-common.hh @@ -220,18 +220,15 @@ struct number_t void init () { set_real (0.0); } void fini () {} - void set_int (int v) { value = (double) v; } - int to_int () const { return (int) value; } + void set_int (int v) { value = v; } + int to_int () const { return value; } void set_fixed (int32_t v) { value = v / 65536.0; } - int32_t to_fixed () const { return (int32_t) (value * 65536.0); } + int32_t to_fixed () const { return value * 65536.0; } void set_real (double v) { value = v; } double to_real () const { return value; } - int ceil () const { return (int) ::ceil (value); } - int floor () const { return (int) ::floor (value); } - bool in_int_range () const { return ((double) (int16_t) to_int () == value); } @@ -248,7 +245,7 @@ struct number_t } protected: - double value; + double value; }; /* byte string */