[PATCH libXi] Fix XISelectEvents on 64 bits, strict alignement architectures.

Peter Hutterer peter.hutterer at who-t.net
Sun Apr 3 15:44:27 PDT 2011


On Fri, Apr 01, 2011 at 10:49:09PM +0200, Matthieu Herrb wrote:
> Use Data() to send the struct xXIEventMask on the wire instead of
> Data32() which expects a pointer to a 64bits value on LP64
> architectures.
> ---
>  src/XISelEv.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/XISelEv.c b/src/XISelEv.c
> index a9c997a..3a1f65d 100644
> --- a/src/XISelEv.c
> +++ b/src/XISelEv.c
> @@ -83,7 +83,7 @@ XISelectEvents(Display* dpy, Window win, XIEventMask* masks, int num_masks)
>           * and they need to be padded with 0 */
>          buff = calloc(1, mask.mask_len * 4);
>          memcpy(buff, current->mask, current->mask_len);
> -        Data32(dpy, &mask, sizeof(xXIEventMask));
> +        Data(dpy, &mask, sizeof(xXIEventMask));

I've added a cast to (char*) here. Data32 did this as part of the macro,
Data() doesn't.

merged, thanks

Cheers,
  Peter
>          Data(dpy, buff, mask.mask_len * 4);
>          free(buff);
>      }
> -- 
> 1.7.3.5



More information about the xorg-devel mailing list