diff options
Diffstat (limited to 'firmware/common/structec.c')
-rw-r--r-- | firmware/common/structec.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/firmware/common/structec.c b/firmware/common/structec.c index ec7e1409fd..7c76874692 100644 --- a/firmware/common/structec.c +++ b/firmware/common/structec.c | |||
@@ -18,6 +18,7 @@ | |||
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | ||
20 | #include <string.h> | 20 | #include <string.h> |
21 | #include <inttypes.h> | ||
21 | #include "structec.h" | 22 | #include "structec.h" |
22 | #include "system.h" | 23 | #include "system.h" |
23 | #include "file.h" | 24 | #include "file.h" |
@@ -66,17 +67,17 @@ void structec_convert(void *structure, const char *ecinst, | |||
66 | /* Swap 2 bytes. */ | 67 | /* Swap 2 bytes. */ |
67 | case 's': | 68 | case 's': |
68 | { | 69 | { |
69 | unsigned short *data = (unsigned short *)buf; | 70 | uint16_t *data = (uint16_t *)buf; |
70 | *data = SWAP_16(*data); | 71 | *data = swap16(*data); |
71 | buf += 2; | 72 | buf += 2; |
72 | break; | 73 | break; |
73 | } | 74 | } |
74 | 75 | ||
75 | /* Swap 4 bytes. */ | 76 | /* Swap 4 bytes. */ |
76 | case 'l': | 77 | case 'l': |
77 | { | 78 | { |
78 | unsigned long *data = (unsigned long *)buf; | 79 | uint32_t *data = (uint32_t *)buf; |
79 | *data = SWAP_32(*data); | 80 | *data = swap32(*data); |
80 | buf += 4; | 81 | buf += 4; |
81 | break; | 82 | break; |
82 | } | 83 | } |