Fix xdump lost column type on big endian hosts
Broken in commit 09248d0
(v4.3.8), which changed struct loststr member
lost_type from char to short, but neglected to update the ca_type in
lost_ca[].
On little endian hosts, the selector reads the least significant byte,
with sign extension. Happens to work, because the type values are all
sufficiently small integers.
On big endian hosts, the selector reads the most signiciant byte,
which is always zero (EF_SECTOR). Messes up xdump lost badly. Also
breaks lost * ?type=..., but that's exotic.
This commit is contained in:
parent
3c84a8756e
commit
c64c756eef
2 changed files with 3 additions and 3 deletions
|
@ -487,7 +487,7 @@ struct castr lost_ca[] = {
|
||||||
{"timestamp", fldoff(lost_timestamp), NSC_TIME, 0, NULL,
|
{"timestamp", fldoff(lost_timestamp), NSC_TIME, 0, NULL,
|
||||||
EF_BAD, 0},
|
EF_BAD, 0},
|
||||||
{"owner", fldoff(lost_owner), NSC_NATID, 0, NULL, EF_NATION, 0},
|
{"owner", fldoff(lost_owner), NSC_NATID, 0, NULL, EF_NATION, 0},
|
||||||
{"type", fldoff(lost_type), NSC_CHAR, 0, NULL, EF_TABLE, 0},
|
{"type", fldoff(lost_type), NSC_SHORT, 0, NULL, EF_TABLE, 0},
|
||||||
/* id's ca_table given by type, but can't express that: */
|
/* id's ca_table given by type, but can't express that: */
|
||||||
{"id", fldoff(lost_id), NSC_INT, 0, NULL, EF_BAD, 0},
|
{"id", fldoff(lost_id), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||||
{"x", fldoff(lost_x), NSC_XCOORD, 0, NULL, EF_BAD, 0},
|
{"x", fldoff(lost_x), NSC_XCOORD, 0, NULL, EF_BAD, 0},
|
||||||
|
|
|
@ -313,7 +313,7 @@ Player 00 Turn 00 starting
|
||||||
[0:640] Command : XDUMP meta lost 0
|
[0:640] Command : XDUMP meta lost 0
|
||||||
"timestamp" 12 0 0 -1
|
"timestamp" 12 0 0 -1
|
||||||
"owner" 5 0 0 9
|
"owner" 5 0 0 9
|
||||||
"type" 4 0 0 27
|
"type" 6 0 0 27
|
||||||
"id" 8 0 0 -1
|
"id" 8 0 0 -1
|
||||||
"x" 9 0 0 -1
|
"x" 9 0 0 -1
|
||||||
"y" 10 0 0 -1
|
"y" 10 0 0 -1
|
||||||
|
@ -1202,7 +1202,7 @@ CENSUS del dst
|
||||||
[0:636] Command : XDUMP meta lost 0
|
[0:636] Command : XDUMP meta lost 0
|
||||||
"timestamp" 12 0 0 -1
|
"timestamp" 12 0 0 -1
|
||||||
"owner" 5 0 0 9
|
"owner" 5 0 0 9
|
||||||
"type" 4 0 0 27
|
"type" 6 0 0 27
|
||||||
"id" 8 0 0 -1
|
"id" 8 0 0 -1
|
||||||
"x" 9 0 0 -1
|
"x" 9 0 0 -1
|
||||||
"y" 10 0 0 -1
|
"y" 10 0 0 -1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue