mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-15 09:10:38 +01:00
bugfix: fix cairo-wideint.c uint64_t usage and const return qualifiers
These patches were sent to the cairo mailing list by Mathieu Lacage <Mathieu.Lacage@sophia.inria.fr>: http://lists.freedesktop.org/archives/cairo/2006-December/008741.html _cairo_uint_96by64_32x64_divrem(): fixes misuse of the uint64_t type and cairo-wideint-private.h functions. http://lists.freedesktop.org/archives/cairo/2006-December/008742.html Remove const qualifiers from return types from cairo-wideint.c functions. http://lists.freedesktop.org/archives/cairo/2006-December/008747.html Fixes a typo in cairo-wideint-private.h: _cairo_uint128_to_int128_ had an extra trailing underscore.
This commit is contained in:
parent
94e086b7b9
commit
a4f5463cdd
2 changed files with 8 additions and 8 deletions
|
|
@ -218,7 +218,7 @@ cairo_uint128_t I _cairo_uint128_negate (cairo_uint128_t a);
|
|||
#define _cairo_uint128_negative(a) (_cairo_uint64_negative(a.hi))
|
||||
cairo_uint128_t I _cairo_uint128_not (cairo_uint128_t a);
|
||||
|
||||
#define _cairo_uint128_to_int128_(i) (i)
|
||||
#define _cairo_uint128_to_int128(i) (i)
|
||||
#define _cairo_int128_to_uint128(i) (i)
|
||||
|
||||
cairo_int128_t I _cairo_int32_to_int128 (int32_t i);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ _cairo_int32_to_int64 (int32_t i)
|
|||
return q;
|
||||
}
|
||||
|
||||
static const cairo_uint64_t
|
||||
static cairo_uint64_t
|
||||
_cairo_uint32s_to_uint64 (uint32_t h, uint32_t l)
|
||||
{
|
||||
cairo_uint64_t q;
|
||||
|
|
@ -407,7 +407,7 @@ _cairo_uint128_sub (cairo_uint128_t a, cairo_uint128_t b)
|
|||
#define uint64_lo32(i) ((i).lo)
|
||||
#define uint64_hi32(i) ((i).hi)
|
||||
|
||||
static const cairo_uint64_t
|
||||
static cairo_uint64_t
|
||||
uint64_lo (cairo_uint64_t i)
|
||||
{
|
||||
cairo_uint64_t s;
|
||||
|
|
@ -417,7 +417,7 @@ uint64_lo (cairo_uint64_t i)
|
|||
return s;
|
||||
}
|
||||
|
||||
static const cairo_uint64_t
|
||||
static cairo_uint64_t
|
||||
uint64_hi (cairo_uint64_t i)
|
||||
{
|
||||
cairo_uint64_t s;
|
||||
|
|
@ -427,7 +427,7 @@ uint64_hi (cairo_uint64_t i)
|
|||
return s;
|
||||
}
|
||||
|
||||
static const cairo_uint64_t
|
||||
static cairo_uint64_t
|
||||
uint64_shift32 (cairo_uint64_t i)
|
||||
{
|
||||
cairo_uint64_t s;
|
||||
|
|
@ -671,7 +671,7 @@ _cairo_uint_96by64_32x64_divrem (cairo_uint128_t num,
|
|||
cairo_uint64_t den)
|
||||
{
|
||||
cairo_uquorem64_t result;
|
||||
uint64_t B = _cairo_uint32s_to_uint64 (1, 0);
|
||||
cairo_uint64_t B = _cairo_uint32s_to_uint64 (1, 0);
|
||||
|
||||
/* These are the high 64 bits of the *96* bit numerator. We're
|
||||
* going to represent the numerator as xB + y, where x is a 64,
|
||||
|
|
@ -701,7 +701,7 @@ _cairo_uint_96by64_32x64_divrem (cairo_uint128_t num,
|
|||
* den = uB + v u, v : 32 bits
|
||||
*/
|
||||
uint32_t y = _cairo_uint128_to_uint32 (num);
|
||||
uint32_t u = uint64_hi (den);
|
||||
uint32_t u = uint64_hi32 (den);
|
||||
uint32_t v = _cairo_uint64_to_uint32 (den);
|
||||
|
||||
/* Compute a lower bound approximate quotient of num/den
|
||||
|
|
@ -738,7 +738,7 @@ _cairo_uint_96by64_32x64_divrem (cairo_uint128_t num,
|
|||
r = _cairo_uint64_to_uint32 (quorem.rem);
|
||||
}
|
||||
else {
|
||||
q = uint64_hi (x);
|
||||
q = uint64_hi32 (x);
|
||||
r = _cairo_uint64_to_uint32 (x);
|
||||
}
|
||||
quotient = q;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue