From 01df5d59e56a1b060568f8cad2e89f7eea22fc70 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 29 Aug 2011 08:51:20 +0200 Subject: xwininfo libX11 libXmu libxcb mesa xserver xkeyboard-config git update 29 aug 2011 --- pixman/test/utils.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'pixman/test/utils.c') diff --git a/pixman/test/utils.c b/pixman/test/utils.c index 402560227..44188ea90 100644 --- a/pixman/test/utils.c +++ b/pixman/test/utils.c @@ -130,6 +130,14 @@ compute_crc32 (uint32_t in_crc32, return (crc32 ^ 0xFFFFFFFF); } +pixman_bool_t +is_little_endian (void) +{ + volatile uint16_t endian_check_var = 0x1234; + + return (*(volatile uint8_t *)&endian_check_var == 0x34); +} + /* perform endian conversion of pixel data */ void @@ -142,8 +150,7 @@ image_endian_swap (pixman_image_t *img) int i, j; /* swap bytes only on big endian systems */ - volatile uint16_t endian_check_var = 0x1234; - if (*(volatile uint8_t *)&endian_check_var != 0x12) + if (is_little_endian()) return; if (bpp == 8) -- cgit v1.2.3