Use int instead of long for flags
As long as symbol_by_value(), show_capab() and togg() support only int, flags need to fit into int. Not a problem in practice, because no machine capable of running Empire has int narrower than 32 bits, and 32 bits suffice. Some flags members are long instead of int: struct lchrstr member l_flags, struct natstr member nat_flags, struct mchrstr member m_flags are long. Waste of space on machines with long wider than int. Change them to int. Rearrange struct lchrstr and struct natstr to avoid holes.
This commit is contained in:
parent
77f8846273
commit
e51b3fb842
9 changed files with 379 additions and 379 deletions
|
@ -27,7 +27,7 @@
|
|||
* nsc.c: Empire selection global structures
|
||||
*
|
||||
* Known contributors to this file:
|
||||
* Markus Armbruster, 2004-2010
|
||||
* Markus Armbruster, 2004-2013
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -288,7 +288,7 @@ struct castr mchr_ca[] = {
|
|||
{"nchoppers", fldoff(m_nchoppers), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"tech", fldoff(m_tech), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"cost", fldoff(m_cost), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"flags", fldoff(m_flags), NSC_LONG, 0, NULL,
|
||||
{"flags", fldoff(m_flags), NSC_INT, 0, NULL,
|
||||
EF_SHIP_CHR_FLAGS, NSC_BITS},
|
||||
{"nplanes", fldoff(m_nplanes), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"nland", fldoff(m_nland), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
|
@ -396,10 +396,10 @@ struct castr lchr_ca[] = {
|
|||
{"dam", fldoff(l_dam), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"ammo", fldoff(l_ammo), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"aaf", fldoff(l_aaf), NSC_INT, 0, NULL, EF_BAD, 0},
|
||||
{"flags", fldoff(l_flags), NSC_INT, 0, NULL,
|
||||
EF_LAND_CHR_FLAGS, NSC_BITS},
|
||||
{"nxlight", fldoff(l_nxlight), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"nland", fldoff(l_nland), NSC_UCHAR, 0, NULL, EF_BAD, 0},
|
||||
{"flags", fldoff(l_flags), NSC_LONG, 0, NULL,
|
||||
EF_LAND_CHR_FLAGS, NSC_BITS},
|
||||
{NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0}
|
||||
#undef CURSTR
|
||||
};
|
||||
|
@ -554,6 +554,8 @@ struct castr cou_ca[] = {
|
|||
EF_BAD, NSC_EXTRA},
|
||||
{"stat", fldoff(nat_stat), NSC_SITYPE(enum nat_status), 0, NULL,
|
||||
EF_NATION_STATUS, NSC_EXTRA},
|
||||
{"flags", fldoff(nat_flags), NSC_INT, 0, NULL,
|
||||
EF_NATION_FLAGS, NSC_BITS},
|
||||
{"cname", fldoff(nat_cnam), NSC_STRINGY, 20, NULL, EF_BAD, NSC_EXTRA},
|
||||
{"passwd", fldoff(nat_pnam), NSC_STRINGY, 20, NULL,
|
||||
EF_BAD, NSC_DEITY | NSC_EXTRA},
|
||||
|
@ -592,8 +594,6 @@ struct castr cou_ca[] = {
|
|||
EF_BAD, NSC_DEITY | NSC_EXTRA},
|
||||
{"rejects", fldoff(nat_rejects), NSC_UCHAR, MAXNOC, NULL,
|
||||
EF_NATION_REJECTS, NSC_EXTRA | NSC_BITS},
|
||||
{"flags", fldoff(nat_flags), NSC_LONG, 0, NULL,
|
||||
EF_NATION_FLAGS, NSC_BITS},
|
||||
{NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0}
|
||||
#undef CURSTR
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue