diff --git a/src/ios.c b/src/ios.c index f4722dd..3f8818a 100644 --- a/src/ios.c +++ b/src/ios.c @@ -530,7 +530,7 @@ ios_read_uint (ios io, ios_off offset, int flags, *value = (c[4] << 32) | (c[3] << 24) | (c[2] << 16) | (c[1] << 8) | c[0]; else - *value = (c[0] << 32) | (c[1] << 24) | (c[2] << 16) | (c[2] << 8) + *value = (c[0] << 32) | (c[1] << 24) | (c[2] << 16) | (c[3] << 8) | c[4]; return IOS_OK; diff --git a/testsuite/poke.map/maps-uint-41.pk b/testsuite/poke.map/maps-uint-41.pk new file mode 100644 index 0000000..59b5d28 --- /dev/null +++ b/testsuite/poke.map/maps-uint-41.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian little } } */ +/* { dg-command { printf "%u8x\n", uint<8> @ 8#b } } */ +/* { dg-output "23" } */ diff --git a/testsuite/poke.map/maps-uint-42.pk b/testsuite/poke.map/maps-uint-42.pk new file mode 100644 index 0000000..b077f67 --- /dev/null +++ b/testsuite/poke.map/maps-uint-42.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian big } } */ +/* { dg-command { printf "%u8x\n", uint<8> @ 8#b } } */ +/* { dg-output "23" } */ diff --git a/testsuite/poke.map/maps-uint-43.pk b/testsuite/poke.map/maps-uint-43.pk new file mode 100644 index 0000000..e002587 --- /dev/null +++ b/testsuite/poke.map/maps-uint-43.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian little } } */ +/* { dg-command { printf "%u24x\n", uint<24> @ 8#b } } */ +/* { dg-output "674523" } */ diff --git a/testsuite/poke.map/maps-uint-44.pk b/testsuite/poke.map/maps-uint-44.pk new file mode 100644 index 0000000..19c595a --- /dev/null +++ b/testsuite/poke.map/maps-uint-44.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian big } } */ +/* { dg-command { printf "%u24x\n", uint<24> @ 8#b } } */ +/* { dg-output "234567" } */ diff --git a/testsuite/poke.map/maps-uint-45.pk b/testsuite/poke.map/maps-uint-45.pk new file mode 100644 index 0000000..5179aa8 --- /dev/null +++ b/testsuite/poke.map/maps-uint-45.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian little } } */ +/* { dg-command { printf "%u32x\n", uint<32> @ 8#b } } */ +/* { dg-output "89674523" } */ diff --git a/testsuite/poke.map/maps-uint-46.pk b/testsuite/poke.map/maps-uint-46.pk new file mode 100644 index 0000000..f6e5390 --- /dev/null +++ b/testsuite/poke.map/maps-uint-46.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian big } } */ +/* { dg-command { printf "%u32x\n", uint<32> @ 8#b } } */ +/* { dg-output "23456789" } */ diff --git a/testsuite/poke.map/maps-uint-47.pk b/testsuite/poke.map/maps-uint-47.pk new file mode 100644 index 0000000..e2124a3 --- /dev/null +++ b/testsuite/poke.map/maps-uint-47.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian little } } */ +/* { dg-command { printf "%u40x\n", uint<40> @ 8#b } } */ +/* { dg-output "ab89674523" } */ diff --git a/testsuite/poke.map/maps-uint-48.pk b/testsuite/poke.map/maps-uint-48.pk new file mode 100644 index 0000000..dc55e53 --- /dev/null +++ b/testsuite/poke.map/maps-uint-48.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian big } } */ +/* { dg-command { printf "%u40x\n", uint<40> @ 8#b } } */ +/* { dg-output "23456789ab" } */ diff --git a/testsuite/poke.map/maps-uint-49.pk b/testsuite/poke.map/maps-uint-49.pk new file mode 100644 index 0000000..c62777d --- /dev/null +++ b/testsuite/poke.map/maps-uint-49.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian little } } */ +/* { dg-command { printf "%u48x\n", uint<48> @ 8#b } } */ +/* { dg-output "cdab89674523" } */ diff --git a/testsuite/poke.map/maps-uint-50.pk b/testsuite/poke.map/maps-uint-50.pk new file mode 100644 index 0000000..da859b5 --- /dev/null +++ b/testsuite/poke.map/maps-uint-50.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian big } } */ +/* { dg-command { printf "%u48x\n", uint<48> @ 8#b } } */ +/* { dg-output "23456789abcd" } */ diff --git a/testsuite/poke.map/maps-uint-51.pk b/testsuite/poke.map/maps-uint-51.pk new file mode 100644 index 0000000..7ce5005 --- /dev/null +++ b/testsuite/poke.map/maps-uint-51.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian little } } */ +/* { dg-command { printf "%u56x\n", uint<56> @ 8#b } } */ +/* { dg-output "efcdab89674523" } */ diff --git a/testsuite/poke.map/maps-uint-52.pk b/testsuite/poke.map/maps-uint-52.pk new file mode 100644 index 0000000..2caf5a4 --- /dev/null +++ b/testsuite/poke.map/maps-uint-52.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian big } } */ +/* { dg-command { printf "%u56x\n", uint<56> @ 8#b } } */ +/* { dg-output "23456789abcdef" } */ diff --git a/testsuite/poke.map/maps-uint-53.pk b/testsuite/poke.map/maps-uint-53.pk new file mode 100644 index 0000000..a840c9d --- /dev/null +++ b/testsuite/poke.map/maps-uint-53.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian little } } */ +/* { dg-command { printf "%u64x\n", uint<64> @ 8#b } } */ +/* { dg-output "51efcdab89674523" } */ diff --git a/testsuite/poke.map/maps-uint-54.pk b/testsuite/poke.map/maps-uint-54.pk new file mode 100644 index 0000000..2d42031 --- /dev/null +++ b/testsuite/poke.map/maps-uint-54.pk @@ -0,0 +1,6 @@ +/* { dg-do run } */ +/* { dg-data {c*} {0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef 0x51 0x23 0x45 0x67 0x89 0xab 0xcd 0xef} } */ + +/* { dg-command { .set endian big } } */ +/* { dg-command { printf "%u64x\n", uint<64> @ 8#b } } */ +/* { dg-output "23456789abcdef51" } */