xserver/Xext/xfixes/byteswap.c
Enrico Weigelt, metux IT consult 06775174d1 Xext: xfixes: 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-15 17:28:32 +02:00

39 lines
1.2 KiB
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/xfixesproto.h>
#include "include/misc.h"
#include "xfixes_intern.h"
void XFixesSwapSelectionNotifyEvent(xEvent* _from, xEvent* _to)
{
xXFixesSelectionNotifyEvent *from = (xXFixesSelectionNotifyEvent*) _from;
xXFixesSelectionNotifyEvent *to = (xXFixesSelectionNotifyEvent*) _to;
to->type = from->type;
cpswaps(from->sequenceNumber, to->sequenceNumber);
cpswapl(from->window, to->window);
cpswapl(from->owner, to->owner);
cpswapl(from->selection, to->selection);
cpswapl(from->timestamp, to->timestamp);
cpswapl(from->selectionTimestamp, to->selectionTimestamp);
}
void XFixesSwapCursorNotifyEvent(xEvent* _from, xEvent* _to)
{
xXFixesCursorNotifyEvent *from = (xXFixesCursorNotifyEvent*) _from;
xXFixesCursorNotifyEvent *to = (xXFixesCursorNotifyEvent*) _to;
to->type = from->type;
cpswaps(from->sequenceNumber, to->sequenceNumber);
cpswapl(from->window, to->window);
cpswapl(from->cursorSerial, to->cursorSerial);
cpswapl(from->timestamp, to->timestamp);
cpswapl(from->name, to->name);
}