xserver/Xext/sync/byteswap.c
Enrico Weigelt, metux IT consult 66505eecd5 Xext: sync: 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 19:08:16 +02:00

44 lines
1.1 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/Xdefs.h>
#include <X11/Xproto.h>
#include <X11/extensions/syncproto.h>
#include "include/misc.h"
#include "sync_intern.h"
void SyncSwapCounterNotifyEvent(xEvent *_from, xEvent *_to)
{
xSyncCounterNotifyEvent *from = (xSyncCounterNotifyEvent*)_from;
xSyncCounterNotifyEvent *to = (xSyncCounterNotifyEvent*)_to;
*to = *from;
swaps(&to->sequenceNumber);
swapl(&to->counter);
swapl(&to->wait_value_lo);
swapl(&to->wait_value_hi);
swapl(&to->counter_value_lo);
swapl(&to->counter_value_hi);
swapl(&to->time);
swaps(&to->count);
}
void SyncSwapAlarmNotifyEvent(xEvent *_from, xEvent *_to)
{
xSyncAlarmNotifyEvent *from = (xSyncAlarmNotifyEvent*)_from;
xSyncAlarmNotifyEvent *to = (xSyncAlarmNotifyEvent*)_to;
*to = *from;
swaps(&to->sequenceNumber);
swapl(&to->alarm);
swapl(&to->counter_value_lo);
swapl(&to->counter_value_hi);
swapl(&to->alarm_value_lo);
swapl(&to->alarm_value_hi);
swapl(&to->time);
}