summaryrefslogtreecommitdiffstats
path: root/uint16_unpack.c
diff options
context:
space:
mode:
Diffstat (limited to 'uint16_unpack.c')
-rw-r--r--uint16_unpack.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/uint16_unpack.c b/uint16_unpack.c
index 3821853..9b04821 100644
--- a/uint16_unpack.c
+++ b/uint16_unpack.c
@@ -3,19 +3,19 @@
__inline void u16_unpack(const char s[2],u16 *u)
{
u16 result;
-
+
result = (unsigned char) s[1]; result <<= 8;
result += (unsigned char) s[0];
-
+
*u = result;
}
__inline void u16_unpack_big(const char s[2],u16 *u)
{
u16 result;
-
+
result = (unsigned char) s[0]; result <<= 8;
result += (unsigned char) s[1];
-
+
*u = result;
}