xserver/Xext/xv/byteswap.c
Enrico Weigelt, metux IT consult d13cf6f431 Xext: xv: fix mismatching event swap prototypes
Instead of hard typecasts on event proc assignment, better accept the
expected parameter types and do the typecast inside the functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-17 19:45:49 +02:00

36 lines
880 B
C

/* SPDX-License-Identifier: X11 OR MIT OR AGPL-3.0-or-later
*
* Copyright © 2026 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#include <dix-config.h>
#include <X11/Xproto.h>
#include <X11/extensions/Xvproto.h>
#include "include/misc.h"
#include "xv_intern.h"
void XvSwapVideoNotifyEvent(xEvent *_from, xEvent *_to)
{
xvEvent *from = (xvEvent*)_from;
xvEvent *to = (xvEvent*)_to;
*to = *from;
swaps(&to->u.videoNotify.sequenceNumber);
swapl(&to->u.videoNotify.time);
swapl(&to->u.videoNotify.drawable);
swapl(&to->u.videoNotify.port);
}
void XvSwapPortNotifyEvent(xEvent* _from, xEvent *_to)
{
xvEvent *from = (xvEvent*)_from;
xvEvent *to = (xvEvent*)_to;
*to = *from;
swaps(&to->u.portNotify.sequenceNumber);
swapl(&to->u.portNotify.time);
swapl(&to->u.portNotify.port);
swapl(&to->u.portNotify.value);
}