From e5d10a43278b10875ef0a80be4af2d1b5692c1c9 Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Tue, 2 Jun 2020 09:28:11 +0200 Subject: ipc: fix endianness issues Use native byte-order for IPC and program serialization. This way we will be able to support both little- and big-endian architectures. Signed-off-by: Alexander Egorenkov --- executor/test.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'executor/test.h') diff --git a/executor/test.h b/executor/test.h index 1f940eb71..0d3587b84 100644 --- a/executor/test.h +++ b/executor/test.h @@ -8,7 +8,7 @@ static int test_copyin() { static uint16 buf[3]; - STORE_BY_BITMASK(uint16, , &buf[1], 0x1234, 0, 16); + STORE_BY_BITMASK(uint16, htole16, &buf[1], 0x1234, 0, 16); unsigned char x[sizeof(buf)]; memcpy(x, buf, sizeof(x)); if (x[0] != 0 || x[1] != 0 || @@ -18,7 +18,7 @@ static int test_copyin() x[0], x[1], x[2], x[3], x[4], x[5]); return 1; } - STORE_BY_BITMASK(uint16, , &buf[1], 0x555a, 5, 4); + STORE_BY_BITMASK(uint16, htole16, &buf[1], 0x555a, 5, 4); memcpy(x, buf, sizeof(x)); if (x[0] != 0 || x[1] != 0 || x[2] != 0x54 || x[3] != 0x13 || -- cgit mrf-deployment