xf86drm: Fix type-punned pointer build warning

CC       libdrm_la-xf86drmMode.lo
    ../xf86drmMode.c: In function 'drmHandleEvent':
    ../xf86drmMode.c:854:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
       e = (struct drm_event *)(&buffer[i]);
                   ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99350
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
main
Thierry Reding 2015-04-13 11:36:59 +02:00
parent 4bfbe4c69e
commit ecc2a09729
1 changed files with 1 additions and 1 deletions

View File

@ -901,7 +901,7 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx)
i = 0; i = 0;
while (i < len) { while (i < len) {
e = (struct drm_event *) &buffer[i]; e = (struct drm_event *)(buffer + i);
switch (e->type) { switch (e->type) {
case DRM_EVENT_VBLANK: case DRM_EVENT_VBLANK:
if (evctx->version < 1 || if (evctx->version < 1 ||