mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-01 09:07:58 +02:00
[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:
parent
91d18eefe7
commit
dd0f2d851c
1 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue