From 0b1bf105be397f1163ca2ce34e9e4919af37ecdb Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 30 Mar 2013 17:51:01 +0100 Subject: [PATCH] Revert 1c67c3f92a4399d5a6e914e4b27be3552d4f77ef Fixes issue 244 errorlibnfc.driver.acr122_usbToo small reply --- libnfc/drivers/acr122_usb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libnfc/drivers/acr122_usb.c b/libnfc/drivers/acr122_usb.c index 95b7a49..0c462ea 100644 --- a/libnfc/drivers/acr122_usb.c +++ b/libnfc/drivers/acr122_usb.c @@ -517,7 +517,13 @@ uint32_t htole32(uint32_t u32); uint32_t htole32(uint32_t u32) { - return (((u32 & 0xff) << 24) + ((u32 & 0xff00) << 8) + ((u32 & 0xff0000) >> 8) + (u32 >> 24)); + uint8_t u8[4]; + for (int i = 0; i < 4; i++) { + u8[i] = (u32 & 0xff); + u32 >>= 8; + } + uint32_t *pu32 = (uint32_t *)u8; + return *pu32; } static int