diff options
Diffstat (limited to 'libxcb/src')
-rw-r--r-- | libxcb/src/xcb_conn.c | 3 | ||||
-rw-r--r-- | libxcb/src/xcbint.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/libxcb/src/xcb_conn.c b/libxcb/src/xcb_conn.c index 46390e1da..00c458fc5 100644 --- a/libxcb/src/xcb_conn.c +++ b/libxcb/src/xcb_conn.c @@ -374,6 +374,9 @@ void _xcb_conn_shutdown(xcb_connection_t *c, int err) /* Return connection error state. * To make thread-safe, I need a seperate static * variable for every possible error. + * has_error is the first field in xcb_connection_t, so just + * return a casted int here; checking has_error (and only + * has_error) will be safe. */ xcb_connection_t *_xcb_conn_ret_error(int err) { diff --git a/libxcb/src/xcbint.h b/libxcb/src/xcbint.h index b25f03b3e..67cf5711e 100644 --- a/libxcb/src/xcbint.h +++ b/libxcb/src/xcbint.h @@ -192,6 +192,7 @@ void _xcb_ext_destroy(xcb_connection_t *c); /* xcb_conn.c */ struct xcb_connection_t { + /* This must be the first field; see _xcb_conn_ret_error(). */ int has_error; /* constant data */ |