equal
deleted
inserted
replaced
|
1 #include "uint32.h" |
|
2 |
|
3 void uint32_unpack(char s[4],uint32 *u) |
|
4 { |
|
5 uint32 result; |
|
6 |
|
7 result = (unsigned char) s[3]; |
|
8 result <<= 8; |
|
9 result += (unsigned char) s[2]; |
|
10 result <<= 8; |
|
11 result += (unsigned char) s[1]; |
|
12 result <<= 8; |
|
13 result += (unsigned char) s[0]; |
|
14 |
|
15 *u = result; |
|
16 } |
|
17 |
|
18 void uint32_unpack_big(char s[4],uint32 *u) |
|
19 { |
|
20 uint32 result; |
|
21 |
|
22 result = (unsigned char) s[0]; |
|
23 result <<= 8; |
|
24 result += (unsigned char) s[1]; |
|
25 result <<= 8; |
|
26 result += (unsigned char) s[2]; |
|
27 result <<= 8; |
|
28 result += (unsigned char) s[3]; |
|
29 |
|
30 *u = result; |
|
31 } |