diff options
Diffstat (limited to 'src/cairo-wideint-private.h')
-rw-r--r-- | src/cairo-wideint-private.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cairo-wideint-private.h b/src/cairo-wideint-private.h index b9f8dae6..53d2546e 100644 --- a/src/cairo-wideint-private.h +++ b/src/cairo-wideint-private.h @@ -54,6 +54,8 @@ cairo_uquorem64_t I _cairo_uint64_divrem (cairo_uint64_t num, cairo_uint64_t den); +cairo_uint64_t I _cairo_double_to_uint64 (double i); +double I _cairo_uint64_to_double (uint64_t i); cairo_uint64_t I _cairo_uint32_to_uint64 (uint32_t i); #define _cairo_uint64_to_uint32(a) ((a).lo) cairo_uint64_t I _cairo_uint64_add (cairo_uint64_t a, cairo_uint64_t b); @@ -103,6 +105,16 @@ _cairo_uint64_divrem (cairo_uint64_t num, cairo_uint64_t den) return qr; } +/* + * These need to be functions or gcc will complain when used on the + * result of a function: + * + * warning: cast from function call of type ‘#cairo_uint64_t’ to + * non-matching type ‘double’ + */ +static cairo_always_inline cairo_uint64_t I _cairo_double_to_uint64 (double i) { return i; } +static cairo_always_inline double I _cairo_uint64_to_double (cairo_uint64_t i) { return i; } + #define _cairo_uint32_to_uint64(i) ((uint64_t) (i)) #define _cairo_uint64_to_uint32(i) ((uint32_t) (i)) #define _cairo_uint64_add(a,b) ((a) + (b)) |