Fix xdump trade column type on big endian hosts
Broken in commit 14ea670
(v4.3.8), which changed struct trdstr member
trd_type from char to short, but neglected to update the ca_type in
trade_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 trade badly.
This commit is contained in:
parent
c64c756eef
commit
347d3f3510
2 changed files with 3 additions and 3 deletions
|
@ -523,7 +523,7 @@ struct castr trade_ca[] = {
|
||||||
{"timestamp", fldoff(trd_timestamp), NSC_TIME, 0, NULL,
|
{"timestamp", fldoff(trd_timestamp), NSC_TIME, 0, NULL,
|
||||||
EF_BAD, NSC_EXTRA},
|
EF_BAD, NSC_EXTRA},
|
||||||
{"owner", fldoff(trd_owner), NSC_NATID, 0, NULL, EF_NATION, 0},
|
{"owner", fldoff(trd_owner), NSC_NATID, 0, NULL, EF_NATION, 0},
|
||||||
{"type", fldoff(trd_type), NSC_CHAR, 0, NULL, EF_TABLE, 0},
|
{"type", fldoff(trd_type), NSC_SHORT, 0, NULL, EF_TABLE, 0},
|
||||||
/* unitid's ca_table given by type, but can't express that: */
|
/* unitid's ca_table given by type, but can't express that: */
|
||||||
{"unitid", fldoff(trd_unitid), NSC_INT, 0, NULL, EF_BAD, 0},
|
{"unitid", fldoff(trd_unitid), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||||
{"price", fldoff(trd_price), NSC_INT, 0, NULL, EF_BAD, 0},
|
{"price", fldoff(trd_price), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||||
|
|
|
@ -240,7 +240,7 @@ Player 00 Turn 00 starting
|
||||||
[0:640] Command : XDUMP meta trade 0
|
[0:640] Command : XDUMP meta trade 0
|
||||||
"uid" 8 0 0 7
|
"uid" 8 0 0 7
|
||||||
"owner" 5 0 0 9
|
"owner" 5 0 0 9
|
||||||
"type" 4 0 0 27
|
"type" 6 0 0 27
|
||||||
"unitid" 8 0 0 -1
|
"unitid" 8 0 0 -1
|
||||||
"price" 8 0 0 -1
|
"price" 8 0 0 -1
|
||||||
"maxbidder" 8 0 0 9
|
"maxbidder" 8 0 0 9
|
||||||
|
@ -1161,7 +1161,7 @@ CENSUS del dst
|
||||||
[0:636] Command : XDUMP meta trade 0
|
[0:636] Command : XDUMP meta trade 0
|
||||||
"uid" 8 0 0 7
|
"uid" 8 0 0 7
|
||||||
"owner" 5 0 0 9
|
"owner" 5 0 0 9
|
||||||
"type" 4 0 0 27
|
"type" 6 0 0 27
|
||||||
"unitid" 8 0 0 -1
|
"unitid" 8 0 0 -1
|
||||||
"price" 8 0 0 -1
|
"price" 8 0 0 -1
|
||||||
"maxbidder" 8 0 0 9
|
"maxbidder" 8 0 0 9
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue