diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2012-02-29 19:01:54 +0100 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2012-03-04 10:50:38 +0200 |
commit | ec250967e2f77b710fa6ba97aa46b0349f77dd6b (patch) | |
tree | 5b6111af55720972693eb6c533cf1299b96c894a | |
parent | 29a31db629c1ee7b6d1a00ef7ec0e4fd69234259 (diff) |
mingw: use uintptr_t when converting a pointer to an int
win64 uses 32 bit long, so we cannot use a long to hold a 64 bit
pointer. Thankfully, there's a [u]intptr_t type available exactly
for these uses.
-rw-r--r-- | draw.h | 4 | ||||
-rw-r--r-- | pixman_utils.c | 6 |
2 files changed, 5 insertions, 5 deletions
@@ -39,8 +39,8 @@ extern "C" { #endif -#define SPICE_GET_ADDRESS(addr) ((void *)(unsigned long)(addr)) -#define SPICE_SET_ADDRESS(addr, val) ((addr) = (unsigned long)(val)) +#define SPICE_GET_ADDRESS(addr) ((void *)(uintptr_t)(addr)) +#define SPICE_SET_ADDRESS(addr, val) ((addr) = (uintptr_t)(val)) typedef int32_t SPICE_FIXED28_4; diff --git a/pixman_utils.c b/pixman_utils.c index c04b01f..1136aa7 100644 --- a/pixman_utils.c +++ b/pixman_utils.c @@ -243,19 +243,19 @@ void spice_pixman_fill_rect(pixman_image_t *dest, byte_line += stride; w = byte_width; - while (w >= 1 && ((unsigned long)d & 1)) { + while (w >= 1 && ((uintptr_t)d & 1)) { *(uint8_t *)d = (value & 0xff); w--; d++; } - while (w >= 2 && ((unsigned long)d & 3)) { + while (w >= 2 && ((uintptr_t)d & 3)) { *(uint16_t *)d = value; w -= 2; d += 2; } - while (w >= 4 && ((unsigned long)d & 7)) { + while (w >= 4 && ((uintptr_t)d & 7)) { *(uint32_t *)d = value; w -= 4; |