[cairo-atomic] Hide compiler warnings for _cairo_status_set_error().

gcc treats cairo_status_t as an unsigned integer and so generates a
warning when passing it address as signed integer pointer to
_cairo_atomic_int_cmpxchg(). Use an ugly cast to hide the warning and
similarly to hide the warning about the unused result.
This commit is contained in:
Chris Wilson 2007-10-05 15:22:13 +01:00
parent 91d18eefe7
commit dd0f2d851c

View file

@ -81,8 +81,12 @@ _cairo_atomic_int_cmpxchg (int *x, int oldv, int newv);
#endif
#define _cairo_status_set_error(status, err) \
(void) _cairo_atomic_int_cmpxchg (status, CAIRO_STATUS_SUCCESS, err)
#define _cairo_status_set_error(status, err) do { \
/* hide compiler warnings about cairo_status_t != int (gcc treats its as \
* an unsigned integer instead, and about ignoring the return value. */ \
int ret__ = _cairo_atomic_int_cmpxchg ((int *) status, CAIRO_STATUS_SUCCESS, err); \
(void) ret__; \
} while (0)
CAIRO_END_DECLS