FreeCalypso > hg > freecalypso-sw
diff rvinterf/etmsync/dspapidump.c @ 990:2a867e5768e9
fc-dspapidump fix: be independent of host byte order
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Sat, 12 Dec 2015 20:07:51 +0000 |
parents | 38c7078712ab |
children |
line wrap: on
line diff
--- a/rvinterf/etmsync/dspapidump.c Sat Dec 12 19:39:02 2015 +0000 +++ b/rvinterf/etmsync/dspapidump.c Sat Dec 12 20:07:51 2015 +0000 @@ -9,8 +9,8 @@ #include <stdlib.h> #include <string.h> #include <strings.h> +#include <stdint.h> #include <endian.h> -#include "localtypes.h" #include "exitcodes.h" #define APIF_ADDR 0xFFD00000 @@ -18,7 +18,7 @@ single_op_main() { - u16 buf[64], *linebase; + uint16_t buf[64], *linebase; unsigned off; int rc, i, j; @@ -30,7 +30,7 @@ printf("%04X:", off); linebase = buf + i * 8; for (j = 0; j < 8; j++) - printf(" %04X", linebase[j]); + printf(" %04X", le16toh(linebase[j])); putchar('\n'); off += 8; }