summaryrefslogtreecommitdiff
path: root/src/xcb_in.c
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-03-28 10:31:55 -0700
committerJamey Sharp <jamey@minilop.net>2010-04-17 18:20:41 -0700
commiteff3851ba80c42b5b3ba240f7e9049d7b0fac6f0 (patch)
tree206327bc24c2c0f962f8e59a2f84205cf4aba945 /src/xcb_in.c
parent6dd8228a137d280ce24cec604a419129d8ed0e8e (diff)
Fix strict-aliasing warning when getting generic event length.
xcb_ge_event_t has its length field in the same place that xcb_generic_reply_t does, so there's no need to cast the generic reply. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Danjou <julien@danjou.info>
Diffstat (limited to 'src/xcb_in.c')
-rw-r--r--src/xcb_in.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/xcb_in.c b/src/xcb_in.c
index 80f5523..a2f7312 100644
--- a/src/xcb_in.c
+++ b/src/xcb_in.c
@@ -154,9 +154,7 @@ static int read_packet(xcb_connection_t *c)
/* XGE events may have sizes > 32 */
if (genrep.response_type == XCB_XGE_EVENT)
- {
- eventlength = ((xcb_ge_event_t*)&genrep)->length * 4;
- }
+ eventlength = genrep.length * 4;
buf = malloc(length + eventlength +
(genrep.response_type == XCB_REPLY ? 0 : sizeof(uint32_t)));