aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/utils.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-08-29 08:51:20 +0200
committermarha <marha@users.sourceforge.net>2011-08-29 08:51:20 +0200
commit01df5d59e56a1b060568f8cad2e89f7eea22fc70 (patch)
tree9db83037fd85d0974b60fc1a05e0665083f26000 /pixman/test/utils.c
parentfd1f4d9fe3ea67fa6def8ee4927a8f71e0440f12 (diff)
downloadvcxsrv-01df5d59e56a1b060568f8cad2e89f7eea22fc70.tar.gz
vcxsrv-01df5d59e56a1b060568f8cad2e89f7eea22fc70.tar.bz2
vcxsrv-01df5d59e56a1b060568f8cad2e89f7eea22fc70.zip
xwininfo libX11 libXmu libxcb mesa xserver xkeyboard-config git update 29
aug 2011
Diffstat (limited to 'pixman/test/utils.c')
-rw-r--r--pixman/test/utils.c11
1 files changed, 9 insertions, 2 deletions
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)