[cairo-commit] src/cairo-wideint.c src/cairo-wideint-private.h
M. Joonas Pihlaja
joonas at kemper.freedesktop.org
Mon Dec 4 18:38:21 PST 2006
src/cairo-wideint-private.h | 2 +-
src/cairo-wideint.c | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
New commits:
diff-tree a4f5463cdd5e2b088cd009de332db821ef0bd806 (from 94e086b7b9f4129bde3e32b7005e2a33788f334a)
Author: Mathieu Lacage <Mathieu.Lacage at sophia.inria.fr>
Date: Tue Dec 5 03:59:11 2006 +0200
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 at 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.
diff --git a/src/cairo-wideint-private.h b/src/cairo-wideint-private.h
index 3d5ae13..7d459ea 100644
--- a/src/cairo-wideint-private.h
+++ b/src/cairo-wideint-private.h
@@ -218,7 +218,7 @@ cairo_uint128_t I _cairo_uint128_negate
#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);
diff --git a/src/cairo-wideint.c b/src/cairo-wideint.c
index 4de3994..62944ed 100644
--- a/src/cairo-wideint.c
+++ b/src/cairo-wideint.c
@@ -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, c
#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_u
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_u
* 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_u
r = _cairo_uint64_to_uint32 (quorem.rem);
}
else {
- q = uint64_hi (x);
+ q = uint64_hi32 (x);
r = _cairo_uint64_to_uint32 (x);
}
quotient = q;
More information about the cairo-commit
mailing list