[atomic] Hide compiler warnings

Add uint variants of _cairo_atomic_int_*() to hide the compiler warnings
about sign conversions.
This commit is contained in:
Chris Wilson 2009-06-05 18:34:29 +01:00
parent 4ae5e2d445
commit 24e51dd2ee
2 changed files with 6 additions and 3 deletions

View file

@ -95,6 +95,9 @@ _cairo_atomic_int_set (int *x, int value);
#endif
#define _cairo_atomic_uint_get(x) _cairo_atomic_int_get(x)
#define _cairo_atomic_uint_cmpxchg(x, oldv, newv) \
_cairo_atomic_int_cmpxchg((int *)x, oldv, newv)
#define _cairo_status_set_error(status, err) do { \
/* hide compiler warnings about cairo_status_t != int (gcc treats its as \

View file

@ -187,7 +187,7 @@ cairo_surface_status (cairo_surface_t *surface)
}
slim_hidden_def (cairo_surface_status);
static unsigned long
static unsigned int
_cairo_surface_allocate_unique_id (void)
{
static unsigned int unique_id;
@ -200,11 +200,11 @@ _cairo_surface_allocate_unique_id (void)
unsigned int old, id;
do {
old = _cairo_atomic_int_get (&unique_id);
old = _cairo_atomic_uint_get (&unique_id);
id = old + 1;
if (id == 0)
id = 1;
} while (! _cairo_atomic_int_cmpxchg (&unique_id, old, id));
} while (! _cairo_atomic_uint_cmpxchg (&unique_id, old, id));
return id;
#endif