mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-01-09 22:25:28 +00:00
quic: Prevent side effects calling C macros
In some architectures GLib macros to change endianness use the argument multiple times causing possible side effects. This happens for instance using Debian SID and MIPS. This fixes https://gitlab.freedesktop.org/spice/spice-common/issues/1. Reported-by: Laurent Bigonville <bigon@debian.org> Tested-by: Laurent Bigonville <bigon@debian.org> Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Victor Toso <victortoso@redhat.com>
This commit is contained in:
parent
6b93b3fce8
commit
90f95c2f8c
@ -452,7 +452,8 @@ static inline void read_io_word(Encoder *encoder)
|
||||
if (spice_extra_checks) {
|
||||
spice_assert(encoder->io_now < encoder->io_end);
|
||||
}
|
||||
encoder->io_next_word = GUINT32_FROM_LE(*(encoder->io_now++));
|
||||
encoder->io_next_word = GUINT32_FROM_LE(*(encoder->io_now));
|
||||
encoder->io_now++;
|
||||
}
|
||||
|
||||
static inline void decode_eatbits(Encoder *encoder, int len)
|
||||
@ -585,7 +586,8 @@ static int decode_state_run(Encoder *encoder, CommonState *state)
|
||||
|
||||
static inline void init_decode_io(Encoder *encoder)
|
||||
{
|
||||
encoder->io_next_word = encoder->io_word = GUINT32_FROM_LE(*(encoder->io_now++));
|
||||
encoder->io_next_word = encoder->io_word = GUINT32_FROM_LE(*(encoder->io_now));
|
||||
encoder->io_now++;
|
||||
encoder->io_available_bits = 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user