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
|
@ -30,7 +30,7 @@
|
|||
* Thomas Ruschak, 1992
|
||||
* Ken Stevens, 1995
|
||||
* Steve McClure, 1998
|
||||
* Markus Armbruster, 2004-2010
|
||||
* Markus Armbruster, 2004-2013
|
||||
*/
|
||||
|
||||
#ifndef LAND_H
|
||||
|
@ -100,10 +100,10 @@ struct lchrstr {
|
|||
int l_dam; /* # of guns firing */
|
||||
int l_ammo; /* firing ammu used per shot */
|
||||
int l_aaf; /* aa fire */
|
||||
int l_flags; /* what special things can this unit do */
|
||||
unsigned char l_nxlight; /* maximum number of xlight planes */
|
||||
unsigned char l_nland; /* maximum number of units */
|
||||
signed char l_type; /* index in lchr[] */
|
||||
long l_flags; /* what special things can this unit do */
|
||||
};
|
||||
|
||||
/* Land unit ability flags */
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
* Ken Stevens, 1995
|
||||
* Steve McClure, 1998-2000
|
||||
* Ron Koenderink, 2005-2008
|
||||
* Markus Armbruster, 2005-2011
|
||||
* Markus Armbruster, 2005-2013
|
||||
*/
|
||||
|
||||
#ifndef NAT_H
|
||||
|
@ -91,6 +91,7 @@ struct natstr {
|
|||
natid nat_cnum; /* our country number */
|
||||
/* end of part matching struct empobj */
|
||||
enum nat_status nat_stat;
|
||||
int nat_flags; /* nation flags */
|
||||
char nat_cnam[20]; /* country name */
|
||||
char nat_pnam[20]; /* representative */
|
||||
char nat_hostaddr[46]; /* host addr of last user */
|
||||
|
@ -114,7 +115,6 @@ struct natstr {
|
|||
unsigned char nat_relate[MAXNOC];
|
||||
unsigned char nat_contact[MAXNOC];
|
||||
unsigned char nat_rejects[MAXNOC];
|
||||
long nat_flags; /* nation flags */
|
||||
};
|
||||
|
||||
/* nation relation codes */
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
* Thomas Ruschak, 1992
|
||||
* Ken Stevens, 1995
|
||||
* Steve McClure, 1998
|
||||
* Markus Armbruster, 2004-2010
|
||||
* Markus Armbruster, 2004-2013
|
||||
*/
|
||||
|
||||
#ifndef SHIP_H
|
||||
|
@ -116,7 +116,7 @@ struct mchrstr {
|
|||
char *m_name; /* full name of type of ship */
|
||||
int m_tech; /* tech required to build */
|
||||
int m_cost; /* how much it costs to build */
|
||||
long m_flags; /* what special things can this ship do */
|
||||
int m_flags; /* what special things can this ship do */
|
||||
unsigned char m_nplanes; /* maximum number of planes this ship holds */
|
||||
unsigned char m_nland; /* maximum number of units this ship holds */
|
||||
signed char m_type; /* index in mchr[] */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue