(u_char, u_short, u_int): BSDisms. Figuring out whether sys/types.h
defines them would be possible, but isn't worth the trouble. Replace by unabbreviated types.
This commit is contained in:
parent
21bf6b41d4
commit
8054aafb9a
22 changed files with 109 additions and 113 deletions
|
@ -67,17 +67,17 @@ struct lndstr {
|
||||||
short lnd_ship; /* pointer to transporting ship */
|
short lnd_ship; /* pointer to transporting ship */
|
||||||
s_char lnd_harden; /* for missiles */
|
s_char lnd_harden; /* for missiles */
|
||||||
short lnd_retreat; /* retreat percentage */
|
short lnd_retreat; /* retreat percentage */
|
||||||
u_char lnd_fuel; /* How much fuel do we have */
|
unsigned char lnd_fuel; /* How much fuel do we have */
|
||||||
u_char lnd_nxlight; /* How many xlight planes on board? */
|
unsigned char lnd_nxlight; /* How many xlight planes on board? */
|
||||||
int lnd_rflags; /* When do I retreat? */
|
int lnd_rflags; /* When do I retreat? */
|
||||||
char lnd_rpath[RET_LEN]; /* retreat path */
|
char lnd_rpath[RET_LEN]; /* retreat path */
|
||||||
u_char lnd_rad_max; /* max radius for this unit */
|
unsigned char lnd_rad_max; /* max radius for this unit */
|
||||||
u_char lnd_scar; /* how experienced the unit is (not used) */
|
unsigned char lnd_scar; /* how experienced the unit is (not used) */
|
||||||
short lnd_item[I_MAX+1]; /* amount of items on board */
|
short lnd_item[I_MAX+1]; /* amount of items on board */
|
||||||
short lnd_pstage; /* plague stage */
|
short lnd_pstage; /* plague stage */
|
||||||
short lnd_ptime; /* how many etus remain in this stage */
|
short lnd_ptime; /* how many etus remain in this stage */
|
||||||
short lnd_land; /* pointer to transporting unit */
|
short lnd_land; /* pointer to transporting unit */
|
||||||
u_char lnd_nland;
|
unsigned char lnd_nland;
|
||||||
time_t lnd_access; /* Last time mob was updated (MOB_ACCESS) */
|
time_t lnd_access; /* Last time mob was updated (MOB_ACCESS) */
|
||||||
float lnd_att; /* attack multiplier */
|
float lnd_att; /* attack multiplier */
|
||||||
float lnd_def; /* defense multiplier */
|
float lnd_def; /* defense multiplier */
|
||||||
|
@ -91,10 +91,10 @@ struct lndstr {
|
||||||
int lnd_dam; /* # of guns firing */
|
int lnd_dam; /* # of guns firing */
|
||||||
int lnd_ammo; /* firing ammu used per shot */
|
int lnd_ammo; /* firing ammu used per shot */
|
||||||
int lnd_aaf; /* aa fire */
|
int lnd_aaf; /* aa fire */
|
||||||
u_char lnd_fuelc; /* fuel capacity */
|
unsigned char lnd_fuelc; /* fuel capacity */
|
||||||
u_char lnd_fuelu; /* fuel used per 10 mob */
|
unsigned char lnd_fuelu; /* fuel used per 10 mob */
|
||||||
u_char lnd_maxlight; /* maximum number of xlight planes */
|
unsigned char lnd_maxlight; /* maximum number of xlight planes */
|
||||||
u_char lnd_maxland; /* maximum number of units */
|
unsigned char lnd_maxland; /* maximum number of units */
|
||||||
time_t lnd_timestamp; /* Last time this unit was touched */
|
time_t lnd_timestamp; /* Last time this unit was touched */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -120,10 +120,10 @@ struct lchrstr {
|
||||||
int l_dam; /* # of guns firing */
|
int l_dam; /* # of guns firing */
|
||||||
int l_ammo; /* firing ammu used per shot */
|
int l_ammo; /* firing ammu used per shot */
|
||||||
int l_aaf; /* aa fire */
|
int l_aaf; /* aa fire */
|
||||||
u_char l_fuelc; /* fuel capacity */
|
unsigned char l_fuelc; /* fuel capacity */
|
||||||
u_char l_fuelu; /* fuel used per 10 mob */
|
unsigned char l_fuelu; /* fuel used per 10 mob */
|
||||||
u_char l_nxlight; /* maximum number of xlight planes */
|
unsigned char l_nxlight; /* maximum number of xlight planes */
|
||||||
u_char l_nland; /* maximum number of units */
|
unsigned char l_nland; /* maximum number of units */
|
||||||
signed char l_type; /* index in lchr[] */
|
signed char l_type; /* index in lchr[] */
|
||||||
long l_flags; /* what special things can this unit do */
|
long l_flags; /* what special things can this unit do */
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,9 +43,6 @@
|
||||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
typedef unsigned char u_char;
|
|
||||||
typedef unsigned short u_short;
|
|
||||||
typedef unsigned int u_int;
|
|
||||||
typedef long ssize_t;
|
typedef long ssize_t;
|
||||||
|
|
||||||
/* integral mismatch, due to misuse of sector short */
|
/* integral mismatch, due to misuse of sector short */
|
||||||
|
@ -88,7 +85,7 @@ struct mob_acc_globals {
|
||||||
#define RESOLVE_IPADDRESS /* resolve ip addresses into hostnames */
|
#define RESOLVE_IPADDRESS /* resolve ip addresses into hostnames */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef u_char natid; /* NSC_NATID must match this */
|
typedef unsigned char natid; /* NSC_NATID must match this */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO s_char has to go. Use plain char for characters and strings,
|
* TODO s_char has to go. Use plain char for characters and strings,
|
||||||
|
|
|
@ -100,10 +100,10 @@ struct natstr {
|
||||||
coord nat_xorg, nat_yorg; /* origin location in abs coords */
|
coord nat_xorg, nat_yorg; /* origin location in abs coords */
|
||||||
s_char nat_dayno; /* day of the year mod 128 */
|
s_char nat_dayno; /* day of the year mod 128 */
|
||||||
s_char nat_update; /* Want an update or not. */
|
s_char nat_update; /* Want an update or not. */
|
||||||
u_char nat_missed; /* How many updates missed */
|
unsigned char nat_missed; /* How many updates missed */
|
||||||
u_short nat_tgms; /* # of telegrams to be announced */
|
unsigned short nat_tgms; /* # of telegrams to be announced */
|
||||||
u_short nat_ann; /* # of annos pending */
|
unsigned short nat_ann; /* # of annos pending */
|
||||||
u_short nat_minused; /* number of minutes used today */
|
unsigned short nat_minused; /* number of minutes used today */
|
||||||
short nat_btu; /* bureaucratic time units */
|
short nat_btu; /* bureaucratic time units */
|
||||||
long nat_reserve; /* military reserves */
|
long nat_reserve; /* military reserves */
|
||||||
long nat_money; /* moola */
|
long nat_money; /* moola */
|
||||||
|
|
|
@ -63,8 +63,8 @@ struct plnstr {
|
||||||
short pln_mission; /* mission code */
|
short pln_mission; /* mission code */
|
||||||
short pln_radius; /* mission radius */
|
short pln_radius; /* mission radius */
|
||||||
/* end of part matching struct genitem */
|
/* end of part matching struct genitem */
|
||||||
u_char pln_range; /* total distance, not radius */
|
unsigned char pln_range; /* total distance, not radius */
|
||||||
u_char pln_range_max; /* max range for this plane */
|
unsigned char pln_range_max; /* max range for this plane */
|
||||||
short pln_ship; /* pointer to carrier */
|
short pln_ship; /* pointer to carrier */
|
||||||
short pln_land; /* pointer to carrier */
|
short pln_land; /* pointer to carrier */
|
||||||
int pln_att; /* plane air-air attack/defense values */
|
int pln_att; /* plane air-air attack/defense values */
|
||||||
|
|
|
@ -45,7 +45,7 @@ enum { MAXPRCON = 3 };
|
||||||
struct pchrstr {
|
struct pchrstr {
|
||||||
int p_uid;
|
int p_uid;
|
||||||
i_type p_ctype[MAXPRCON]; /* constituent types */
|
i_type p_ctype[MAXPRCON]; /* constituent types */
|
||||||
u_short p_camt[MAXPRCON]; /* constituent amounts */
|
unsigned short p_camt[MAXPRCON]; /* constituent amounts */
|
||||||
i_type p_type; /* product item type, or I_NONE if level */
|
i_type p_type; /* product item type, or I_NONE if level */
|
||||||
int p_level; /* level index (NAT_?LEV), or -1 if item */
|
int p_level; /* level index (NAT_?LEV), or -1 if item */
|
||||||
int p_cost; /* dollars / product unit */
|
int p_cost; /* dollars / product unit */
|
||||||
|
|
|
@ -390,8 +390,8 @@ extern int ldround(double, int);
|
||||||
extern int roundintby(int, int);
|
extern int roundintby(int, int);
|
||||||
extern int scthash(register int, register int, int);
|
extern int scthash(register int, register int, int);
|
||||||
extern int tcp_listen(char *, char *, size_t *);
|
extern int tcp_listen(char *, char *, size_t *);
|
||||||
/* plur.c */
|
|
||||||
extern s_char *numstr(s_char buf[], int n);
|
extern s_char *numstr(s_char buf[], int n);
|
||||||
|
/* plur.c */
|
||||||
extern s_char *esplur(int n);
|
extern s_char *esplur(int n);
|
||||||
extern s_char *splur(int n);
|
extern s_char *splur(int n);
|
||||||
extern s_char *iesplur(int n);
|
extern s_char *iesplur(int n);
|
||||||
|
@ -482,10 +482,10 @@ extern int dd(natid, natid, coord, coord, int, int);
|
||||||
extern int sb(natid, natid, struct sctstr *, coord, coord, int, int);
|
extern int sb(natid, natid, struct sctstr *, coord, coord, int, int);
|
||||||
extern int shipdef(natid, natid, coord, coord);
|
extern int shipdef(natid, natid, coord, coord);
|
||||||
/* getbit.c */
|
/* getbit.c */
|
||||||
extern int emp_getbit(int, int, u_char *);
|
extern int emp_getbit(int, int, unsigned char *);
|
||||||
extern void emp_setbit(int, int, u_char *);
|
extern void emp_setbit(int, int, unsigned char *);
|
||||||
extern void emp_setbitmap(int, int, u_char *, int *);
|
extern void emp_setbitmap(int, int, unsigned char *, int *);
|
||||||
extern void bitinit2(struct nstr_sect *, u_char *, int);
|
extern void bitinit2(struct nstr_sect *, unsigned char *, int);
|
||||||
/* getele.c */
|
/* getele.c */
|
||||||
extern int getele(char *, char *);
|
extern int getele(char *, char *);
|
||||||
/* land.c */
|
/* land.c */
|
||||||
|
|
|
@ -49,43 +49,43 @@ struct sctstr {
|
||||||
coord sct_x; /* x coord of sector */
|
coord sct_x; /* x coord of sector */
|
||||||
coord sct_y; /* y coord of sector */
|
coord sct_y; /* y coord of sector */
|
||||||
/* end of part matching struct genitem */
|
/* end of part matching struct genitem */
|
||||||
u_char sct_type; /* sector type */
|
unsigned char sct_type; /* sector type */
|
||||||
u_char sct_effic; /* 0% to 100% */
|
unsigned char sct_effic; /* 0% to 100% */
|
||||||
short sct_mobil; /* mobility units */
|
short sct_mobil; /* mobility units */
|
||||||
u_char sct_loyal; /* updates until civilans "converted" */
|
unsigned char sct_loyal; /* updates until civilans "converted" */
|
||||||
u_char sct_terr; /* territory 0 id # of sector */
|
unsigned char sct_terr; /* territory 0 id # of sector */
|
||||||
u_char sct_terr1; /* territory 1 id # of sector */
|
unsigned char sct_terr1; /* territory 1 id # of sector */
|
||||||
u_char sct_terr2; /* territory 2 id # of sector */
|
unsigned char sct_terr2; /* territory 2 id # of sector */
|
||||||
u_char sct_terr3; /* territory 3 id # of sector */
|
unsigned char sct_terr3; /* territory 3 id # of sector */
|
||||||
coord sct_dist_x; /* Dist sector */
|
coord sct_dist_x; /* Dist sector */
|
||||||
coord sct_dist_y;
|
coord sct_dist_y;
|
||||||
short sct_avail; /* available workforce for "other things" */
|
short sct_avail; /* available workforce for "other things" */
|
||||||
short sct_flags; /* temporary flags */
|
short sct_flags; /* temporary flags */
|
||||||
short sct_fill; /* gunk */
|
short sct_fill; /* gunk */
|
||||||
u_char sct_work; /* pct of civ actually working */
|
unsigned char sct_work; /* pct of civ actually working */
|
||||||
u_char sct_coastal; /* is this a coastal sector? */
|
unsigned char sct_coastal; /* is this a coastal sector? */
|
||||||
u_char sct_newtype; /* for changing designations */
|
unsigned char sct_newtype; /* for changing designations */
|
||||||
u_char sct_min; /* ease of mining ore */
|
unsigned char sct_min; /* ease of mining ore */
|
||||||
u_char sct_gmin; /* amount of gold ore */
|
unsigned char sct_gmin; /* amount of gold ore */
|
||||||
u_char sct_fertil; /* fertility of soil */
|
unsigned char sct_fertil; /* fertility of soil */
|
||||||
u_char sct_oil; /* oil content */
|
unsigned char sct_oil; /* oil content */
|
||||||
u_char sct_uran; /* uranium ore content */
|
unsigned char sct_uran; /* uranium ore content */
|
||||||
natid sct_oldown; /* old owner of sector (for liberation) */
|
natid sct_oldown; /* old owner of sector (for liberation) */
|
||||||
u_char sct_updated; /* Has this sect been updated? */
|
unsigned char sct_updated; /* Has this sect been updated? */
|
||||||
u_char sct_off; /* Should this sector produce? */
|
unsigned char sct_off; /* Should this sector produce? */
|
||||||
short sct_item[I_MAX+1]; /* amount of items stored here */
|
short sct_item[I_MAX+1]; /* amount of items stored here */
|
||||||
short sct_del[I_MAX+1]; /* delivieries */
|
short sct_del[I_MAX+1]; /* delivieries */
|
||||||
short sct_dist[I_MAX+1]; /* distribution thresholds */
|
short sct_dist[I_MAX+1]; /* distribution thresholds */
|
||||||
short sct_mines; /* number of mines */
|
short sct_mines; /* number of mines */
|
||||||
short sct_pstage; /* plague stage */
|
short sct_pstage; /* plague stage */
|
||||||
short sct_ptime; /* how many etus remain in this stage */
|
short sct_ptime; /* how many etus remain in this stage */
|
||||||
u_char sct_che; /* number of guerrillas */
|
unsigned char sct_che; /* number of guerrillas */
|
||||||
natid sct_che_target; /* nation targeted by che */
|
natid sct_che_target; /* nation targeted by che */
|
||||||
u_short sct_fallout;
|
unsigned short sct_fallout;
|
||||||
time_t sct_access; /* Last time mob was updated (MOB_ACCESS) */
|
time_t sct_access; /* Last time mob was updated (MOB_ACCESS) */
|
||||||
u_char sct_road; /* Road value of a sector */
|
unsigned char sct_road; /* Road value of a sector */
|
||||||
u_char sct_rail; /* Rail value of a sector */
|
unsigned char sct_rail; /* Rail value of a sector */
|
||||||
u_char sct_defense; /* Defensive value of a sector */
|
unsigned char sct_defense; /* Defensive value of a sector */
|
||||||
time_t sct_timestamp; /* Last time this sector was written to */
|
time_t sct_timestamp; /* Last time this sector was written to */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ struct dchrstr {
|
||||||
char d_mnem; /* map symbol */
|
char d_mnem; /* map symbol */
|
||||||
int d_prd; /* product type */
|
int d_prd; /* product type */
|
||||||
int d_mcst; /* movement cost */
|
int d_mcst; /* movement cost */
|
||||||
d_navigation d_nav; /* navigation capability */
|
d_navigation d_nav; /* navigation capability */
|
||||||
i_packing d_pkg; /* type of packaging in these sects */
|
i_packing d_pkg; /* type of packaging in these sects */
|
||||||
float d_ostr; /* offensive strength */
|
float d_ostr; /* offensive strength */
|
||||||
float d_dstr; /* defensive strength */
|
float d_dstr; /* defensive strength */
|
||||||
|
@ -203,10 +203,10 @@ extern struct dchrstr bigcity_dchr;
|
||||||
/* Each cost is per point of efficency */
|
/* Each cost is per point of efficency */
|
||||||
struct sctintrins {
|
struct sctintrins {
|
||||||
char *in_name;
|
char *in_name;
|
||||||
u_char in_lcms;
|
unsigned char in_lcms;
|
||||||
u_char in_hcms;
|
unsigned char in_hcms;
|
||||||
u_char in_dcost;
|
unsigned char in_dcost;
|
||||||
u_char in_mcost;
|
unsigned char in_mcost;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct sctintrins intrchr[INT_DEF + 2];
|
extern struct sctintrins intrchr[INT_DEF + 2];
|
||||||
|
|
|
@ -75,8 +75,8 @@ struct shpstr {
|
||||||
short shp_mission; /* mission code */
|
short shp_mission; /* mission code */
|
||||||
short shp_radius; /* mission radius */
|
short shp_radius; /* mission radius */
|
||||||
/* end of part matching struct genitem */
|
/* end of part matching struct genitem */
|
||||||
u_char shp_nplane; /* number of planes on board */
|
unsigned char shp_nplane; /* number of planes on board */
|
||||||
u_char shp_nland; /* number of land units on board */
|
unsigned char shp_nland; /* number of land units on board */
|
||||||
short shp_armor;
|
short shp_armor;
|
||||||
short shp_speed;
|
short shp_speed;
|
||||||
short shp_visib;
|
short shp_visib;
|
||||||
|
@ -88,19 +88,19 @@ struct shpstr {
|
||||||
i_type shp_tend[TMAX]; /* what goods to pick up at end point */
|
i_type shp_tend[TMAX]; /* what goods to pick up at end point */
|
||||||
short shp_lstart[TMAX]; /* How much do we pick up at the start */
|
short shp_lstart[TMAX]; /* How much do we pick up at the start */
|
||||||
short shp_lend[TMAX]; /* How much do we pick up at the end */
|
short shp_lend[TMAX]; /* How much do we pick up at the end */
|
||||||
u_char shp_autonav; /* autonavigation flags */
|
unsigned char shp_autonav; /* autonavigation flags */
|
||||||
short shp_item[I_MAX+1]; /* amount of items on board */
|
short shp_item[I_MAX+1]; /* amount of items on board */
|
||||||
short shp_pstage; /* plague stage */
|
short shp_pstage; /* plague stage */
|
||||||
short shp_ptime; /* how many etus remain in this stage */
|
short shp_ptime; /* how many etus remain in this stage */
|
||||||
time_t shp_access; /* Last time mob was updated (MOB_ACCESS) */
|
time_t shp_access; /* Last time mob was updated (MOB_ACCESS) */
|
||||||
time_t shp_timestamp; /* Last time this ship was touched. */
|
time_t shp_timestamp; /* Last time this ship was touched. */
|
||||||
u_char shp_mobquota; /* mobility quota */
|
unsigned char shp_mobquota; /* mobility quota */
|
||||||
char shp_path[MAXSHPPATH];
|
char shp_path[MAXSHPPATH];
|
||||||
short shp_follow;
|
short shp_follow;
|
||||||
char shp_name[MAXSHPNAMLEN]; /* name set with the "name" command */
|
char shp_name[MAXSHPNAMLEN]; /* name set with the "name" command */
|
||||||
u_char shp_fuel; /* How much fuel do we have */
|
unsigned char shp_fuel; /* How much fuel do we have */
|
||||||
u_char shp_nchoppers; /* How many choppers on board? */
|
unsigned char shp_nchoppers; /* How many choppers on board? */
|
||||||
u_char shp_nxlight; /* How many xlight planes on board? */
|
unsigned char shp_nxlight; /* How many xlight planes on board? */
|
||||||
coord shp_orig_x;
|
coord shp_orig_x;
|
||||||
coord shp_orig_y; /* Where we were built */
|
coord shp_orig_y; /* Where we were built */
|
||||||
natid shp_orig_own; /* Who built us */
|
natid shp_orig_own; /* Who built us */
|
||||||
|
@ -139,16 +139,16 @@ struct mchrstr {
|
||||||
int m_vrnge; /* how well it can see */
|
int m_vrnge; /* how well it can see */
|
||||||
int m_frnge; /* how far it can fire */
|
int m_frnge; /* how far it can fire */
|
||||||
int m_glim; /* how many guns it can fire */
|
int m_glim; /* how many guns it can fire */
|
||||||
u_char m_nxlight; /* maximum number of xlight planes */
|
unsigned char m_nxlight; /* maximum number of xlight planes */
|
||||||
u_char m_nchoppers; /* maximum number of choppers */
|
unsigned char m_nchoppers; /* maximum number of choppers */
|
||||||
u_char m_fuelc; /* fuel capacity */
|
unsigned char m_fuelc; /* fuel capacity */
|
||||||
u_char m_fuelu; /* fuel used per 10 mob */
|
unsigned char m_fuelu; /* fuel used per 10 mob */
|
||||||
char *m_name; /* full name of type of ship */
|
char *m_name; /* full name of type of ship */
|
||||||
int m_tech; /* tech required to build */
|
int m_tech; /* tech required to build */
|
||||||
int m_cost; /* how much it costs to build */
|
int m_cost; /* how much it costs to build */
|
||||||
long m_flags; /* what special things can this ship do */
|
long m_flags; /* what special things can this ship do */
|
||||||
u_char m_nplanes; /* maximum number of planes this ship holds */
|
unsigned char m_nplanes; /* maximum number of planes this ship holds */
|
||||||
u_char m_nland; /* maximum number of units this ship holds */
|
unsigned char m_nland; /* maximum number of units this ship holds */
|
||||||
signed char m_type; /* index in mchr[] */
|
signed char m_type; /* index in mchr[] */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -538,7 +538,7 @@ doland(s_char op, int arg, s_char *p, struct sctstr *sect)
|
||||||
case 'e':
|
case 'e':
|
||||||
new = errcheck(arg, 0, 100);
|
new = errcheck(arg, 0, 100);
|
||||||
noise(sect, 1, "Efficiency", (int)sect->sct_effic, new);
|
noise(sect, 1, "Efficiency", (int)sect->sct_effic, new);
|
||||||
sect->sct_effic = (u_char)new;
|
sect->sct_effic = (unsigned char)new;
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
new = errcheck(arg, -127, 255);
|
new = errcheck(arg, -127, 255);
|
||||||
|
@ -548,39 +548,39 @@ doland(s_char op, int arg, s_char *p, struct sctstr *sect)
|
||||||
case 'i':
|
case 'i':
|
||||||
new = errcheck(arg, 0, 127);
|
new = errcheck(arg, 0, 127);
|
||||||
noise(sect, 1, "Iron ore content", (int)sect->sct_min, new);
|
noise(sect, 1, "Iron ore content", (int)sect->sct_min, new);
|
||||||
sect->sct_min = (u_char)new;
|
sect->sct_min = (unsigned char)new;
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
new = errcheck(arg, 0, 127);
|
new = errcheck(arg, 0, 127);
|
||||||
noise(sect, 1, "Gold content", (int)sect->sct_gmin, new);
|
noise(sect, 1, "Gold content", (int)sect->sct_gmin, new);
|
||||||
sect->sct_gmin = (u_char)new;
|
sect->sct_gmin = (unsigned char)new;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
new = errcheck(arg, 0, 127);
|
new = errcheck(arg, 0, 127);
|
||||||
noise(sect, 1, "Fertility", (int)sect->sct_fertil, new);
|
noise(sect, 1, "Fertility", (int)sect->sct_fertil, new);
|
||||||
sect->sct_fertil = (u_char)new;
|
sect->sct_fertil = (unsigned char)new;
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
new = errcheck(arg, 0, 127);
|
new = errcheck(arg, 0, 127);
|
||||||
noise(sect, 1, "Oil content", (int)sect->sct_oil, new);
|
noise(sect, 1, "Oil content", (int)sect->sct_oil, new);
|
||||||
sect->sct_oil = (u_char)new;
|
sect->sct_oil = (unsigned char)new;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
new = errcheck(arg, 0, 127);
|
new = errcheck(arg, 0, 127);
|
||||||
noise(sect, 1, "Uranium content", (int)sect->sct_uran, new);
|
noise(sect, 1, "Uranium content", (int)sect->sct_uran, new);
|
||||||
sect->sct_uran = (u_char)new;
|
sect->sct_uran = (unsigned char)new;
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
new = errcheck(arg, 0, 100);
|
new = errcheck(arg, 0, 100);
|
||||||
noise(sect, 1, "Workforce percentage", (int)sect->sct_work, new);
|
noise(sect, 1, "Workforce percentage", (int)sect->sct_work, new);
|
||||||
sect->sct_work = (u_char)new;
|
sect->sct_work = (unsigned char)new;
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
new = errcheck(arg, 0, 127);
|
new = errcheck(arg, 0, 127);
|
||||||
pr("Loyalty of %s changed from %d to %d%%\n",
|
pr("Loyalty of %s changed from %d to %d%%\n",
|
||||||
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
xyas(sect->sct_x, sect->sct_y, player->cnum),
|
||||||
sect->sct_loyal, new);
|
sect->sct_loyal, new);
|
||||||
sect->sct_loyal = (u_char)new;
|
sect->sct_loyal = (unsigned char)new;
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
old = sect->sct_che;
|
old = sect->sct_che;
|
||||||
|
@ -1136,7 +1136,7 @@ doplane(s_char op, int arg, s_char *p, struct plnstr *plane)
|
||||||
plane->pln_def = (s_char)arg;
|
plane->pln_def = (s_char)arg;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
plane->pln_range = (u_char)arg;
|
plane->pln_range = (unsigned char)arg;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
plane->pln_ship = arg;
|
plane->pln_ship = arg;
|
||||||
|
|
|
@ -61,7 +61,7 @@ look(void)
|
||||||
int x, y;
|
int x, y;
|
||||||
int civ;
|
int civ;
|
||||||
int mil;
|
int mil;
|
||||||
u_char *bitmap;
|
unsigned char *bitmap;
|
||||||
int changed = 0;
|
int changed = 0;
|
||||||
|
|
||||||
if (!snxtitem(&ni, EF_SHIP, player->argp[1]))
|
if (!snxtitem(&ni, EF_SHIP, player->argp[1]))
|
||||||
|
@ -186,7 +186,7 @@ llook(void)
|
||||||
int x, y;
|
int x, y;
|
||||||
int civ;
|
int civ;
|
||||||
int mil;
|
int mil;
|
||||||
u_char *bitmap;
|
unsigned char *bitmap;
|
||||||
int changed = 0;
|
int changed = 0;
|
||||||
|
|
||||||
if (!snxtitem(&ni, EF_LAND, player->argp[1]))
|
if (!snxtitem(&ni, EF_LAND, player->argp[1]))
|
||||||
|
|
|
@ -232,7 +232,7 @@ multifire(void)
|
||||||
continue;
|
continue;
|
||||||
if (item.sect.sct_type != SCT_FORTR)
|
if (item.sect.sct_type != SCT_FORTR)
|
||||||
continue;
|
continue;
|
||||||
if (item.sect.sct_effic < ((u_char)FORTEFF)) {
|
if (item.sect.sct_effic < FORTEFF) {
|
||||||
pr("Fort not efficient enough to fire!\n");
|
pr("Fort not efficient enough to fire!\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,7 @@ nav_map(int x, int y, int show_designations)
|
||||||
int i;
|
int i;
|
||||||
/* Note this is not re-entrant anyway, so we keep the buffers
|
/* Note this is not re-entrant anyway, so we keep the buffers
|
||||||
around */
|
around */
|
||||||
static u_char *bitmap = NULL;
|
static unsigned char *bitmap = NULL;
|
||||||
static s_char *wmapbuf = NULL;
|
static s_char *wmapbuf = NULL;
|
||||||
static s_char **wmap = NULL;
|
static s_char **wmap = NULL;
|
||||||
s_char what[64];
|
s_char what[64];
|
||||||
|
|
|
@ -89,7 +89,7 @@ prod(void)
|
||||||
int used; /* production w/infinite workforce */
|
int used; /* production w/infinite workforce */
|
||||||
i_type it;
|
i_type it;
|
||||||
i_type vtype;
|
i_type vtype;
|
||||||
u_char *resource;
|
unsigned char *resource;
|
||||||
s_char maxc[MAXPRCON][10];
|
s_char maxc[MAXPRCON][10];
|
||||||
s_char use[MAXPRCON][10];
|
s_char use[MAXPRCON][10];
|
||||||
int lcms, hcms;
|
int lcms, hcms;
|
||||||
|
@ -100,7 +100,7 @@ prod(void)
|
||||||
int type;
|
int type;
|
||||||
int eff;
|
int eff;
|
||||||
int maxpop;
|
int maxpop;
|
||||||
u_char otype;
|
int otype;
|
||||||
|
|
||||||
if (!snxtsct(&nstr, player->argp[1]))
|
if (!snxtsct(&nstr, player->argp[1]))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
@ -199,7 +199,7 @@ prod(void)
|
||||||
goto is_enlist;
|
goto is_enlist;
|
||||||
if (pp->p_nrndx != 0) {
|
if (pp->p_nrndx != 0) {
|
||||||
unit_work++;
|
unit_work++;
|
||||||
resource = (u_char *)§ + pp->p_nrndx;
|
resource = (unsigned char *)§ + pp->p_nrndx;
|
||||||
p_e = (*resource * p_e) / 100.0;
|
p_e = (*resource * p_e) / 100.0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -79,7 +79,7 @@ setres(void)
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Iron ore content",
|
resnoise(§, 1, "Iron ore content",
|
||||||
(int)sect.sct_min, amt);
|
(int)sect.sct_min, amt);
|
||||||
sect.sct_min = (u_char)amt;
|
sect.sct_min = (unsigned char)amt;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -98,7 +98,7 @@ setres(void)
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Gold content",
|
resnoise(§, 1, "Gold content",
|
||||||
(int)sect.sct_gmin, amt);
|
(int)sect.sct_gmin, amt);
|
||||||
sect.sct_gmin = (u_char)amt;
|
sect.sct_gmin = (unsigned char)amt;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -116,7 +116,7 @@ setres(void)
|
||||||
amt = 0;
|
amt = 0;
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Oil content", (int)sect.sct_oil, amt);
|
resnoise(§, 1, "Oil content", (int)sect.sct_oil, amt);
|
||||||
sect.sct_oil = (u_char)amt;
|
sect.sct_oil = (unsigned char)amt;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -135,7 +135,7 @@ setres(void)
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Fertility content",
|
resnoise(§, 1, "Fertility content",
|
||||||
(int)sect.sct_fertil, amt);
|
(int)sect.sct_fertil, amt);
|
||||||
sect.sct_fertil = (u_char)amt;
|
sect.sct_fertil = (unsigned char)amt;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -154,7 +154,7 @@ setres(void)
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Uranium content",
|
resnoise(§, 1, "Uranium content",
|
||||||
(int)sect.sct_uran, amt);
|
(int)sect.sct_uran, amt);
|
||||||
sect.sct_uran = (u_char)amt;
|
sect.sct_uran = (unsigned char)amt;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -87,7 +87,7 @@ setsector(void)
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Iron ore content",
|
resnoise(§, 1, "Iron ore content",
|
||||||
(int)sect.sct_min, current);
|
(int)sect.sct_min, current);
|
||||||
sect.sct_min = (u_char)current;
|
sect.sct_min = (unsigned char)current;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -108,7 +108,7 @@ setsector(void)
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Gold content",
|
resnoise(§, 1, "Gold content",
|
||||||
(int)sect.sct_gmin, current);
|
(int)sect.sct_gmin, current);
|
||||||
sect.sct_gmin = (u_char)current;
|
sect.sct_gmin = (unsigned char)current;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -131,7 +131,7 @@ setsector(void)
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Oil content",
|
resnoise(§, 1, "Oil content",
|
||||||
(int)sect.sct_oil, current);
|
(int)sect.sct_oil, current);
|
||||||
sect.sct_oil = (u_char)current;
|
sect.sct_oil = (unsigned char)current;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -204,7 +204,7 @@ setsector(void)
|
||||||
current = 100;
|
current = 100;
|
||||||
pr("Efficiency in %s changed to %d.\n",
|
pr("Efficiency in %s changed to %d.\n",
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum), current);
|
xyas(sect.sct_x, sect.sct_y, player->cnum), current);
|
||||||
sect.sct_effic = (u_char)current;
|
sect.sct_effic = (unsigned char)current;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -291,7 +291,7 @@ setsector(void)
|
||||||
current = 100;
|
current = 100;
|
||||||
pr("Work in %s changed to %d.\n",
|
pr("Work in %s changed to %d.\n",
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum), current);
|
xyas(sect.sct_x, sect.sct_y, player->cnum), current);
|
||||||
sect.sct_work = (u_char)current;
|
sect.sct_work = (unsigned char)current;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -312,7 +312,7 @@ setsector(void)
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Fertility content",
|
resnoise(§, 1, "Fertility content",
|
||||||
(int)sect.sct_fertil, current);
|
(int)sect.sct_fertil, current);
|
||||||
sect.sct_fertil = (u_char)current;
|
sect.sct_fertil = (unsigned char)current;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -333,7 +333,7 @@ setsector(void)
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Uranium content",
|
resnoise(§, 1, "Uranium content",
|
||||||
(int)sect.sct_uran, current);
|
(int)sect.sct_uran, current);
|
||||||
sect.sct_uran = (u_char)current;
|
sect.sct_uran = (unsigned char)current;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
static int bmnxtsct(struct nstr_sect *);
|
static int bmnxtsct(struct nstr_sect *);
|
||||||
static s_char map_char(u_char type, natid own, int owner_or_god);
|
static s_char map_char(unsigned char type, natid own, int owner_or_god);
|
||||||
|
|
||||||
int
|
int
|
||||||
draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp)
|
draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp)
|
||||||
|
@ -66,7 +66,7 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp)
|
||||||
int i;
|
int i;
|
||||||
/* Note this is not re-entrant anyway, so we keep the buffers
|
/* Note this is not re-entrant anyway, so we keep the buffers
|
||||||
around */
|
around */
|
||||||
static u_char *bitmap = NULL;
|
static unsigned char *bitmap = NULL;
|
||||||
static s_char *wmapbuf = NULL;
|
static s_char *wmapbuf = NULL;
|
||||||
static s_char **wmap = NULL;
|
static s_char **wmap = NULL;
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ bmnxtsct(struct nstr_sect *np)
|
||||||
* If OWNER_OR_GOD, the map is for the sector's owner or a deity.
|
* If OWNER_OR_GOD, the map is for the sector's owner or a deity.
|
||||||
*/
|
*/
|
||||||
static s_char
|
static s_char
|
||||||
map_char(u_char type, natid own, int owner_or_god)
|
map_char(unsigned char type, natid own, int owner_or_god)
|
||||||
{
|
{
|
||||||
if (type > SCT_MAXDEF) {
|
if (type > SCT_MAXDEF) {
|
||||||
logerror("bad sector type %d\n", type);
|
logerror("bad sector type %d\n", type);
|
||||||
|
|
|
@ -61,8 +61,8 @@
|
||||||
|
|
||||||
#define fldoff(str, fld) offsetof(struct str, fld)
|
#define fldoff(str, fld) offsetof(struct str, fld)
|
||||||
|
|
||||||
#define NSC_IELT(name, pfx, sfx, base, itype) \
|
#define NSC_IELT(name, pfx, sfx, base, itype) \
|
||||||
{NSC_SHORT, 0, 0, ((base) + (itype)*sizeof(u_short)), \
|
{NSC_SHORT, 0, 0, ((base) + (itype)*sizeof(unsigned short)), \
|
||||||
sizeof(sfx) == 1 ? name : pfx sfx, EF_BAD}
|
sizeof(sfx) == 1 ? name : pfx sfx, EF_BAD}
|
||||||
|
|
||||||
#define NSC_IVEC(base, sfx) \
|
#define NSC_IVEC(base, sfx) \
|
||||||
|
|
|
@ -125,7 +125,7 @@ static int *bitmaps[5] = {
|
||||||
#define GCFy(y) ((y + WORLD_Y) % WORLD_Y)
|
#define GCFy(y) ((y + WORLD_Y) % WORLD_Y)
|
||||||
|
|
||||||
int
|
int
|
||||||
emp_getbit(int x, int y, u_char *bitmap)
|
emp_getbit(int x, int y, unsigned char *bitmap)
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ emp_getbit(int x, int y, u_char *bitmap)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
emp_setbit(int x, int y, u_char *bitmap)
|
emp_setbit(int x, int y, unsigned char *bitmap)
|
||||||
{
|
{
|
||||||
register int id;
|
register int id;
|
||||||
|
|
||||||
|
@ -143,8 +143,7 @@ emp_setbit(int x, int y, u_char *bitmap)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
emp_setbitmap(register int x, register int y, register u_char *bitmap,
|
emp_setbitmap(int x, int y, unsigned char *bitmap, int *bitmaps)
|
||||||
int *bitmaps)
|
|
||||||
{
|
{
|
||||||
register int *mp;
|
register int *mp;
|
||||||
register int id;
|
register int id;
|
||||||
|
@ -159,7 +158,7 @@ emp_setbitmap(register int x, register int y, register u_char *bitmap,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
bitinit2(struct nstr_sect *np, u_char *bitmap, int country)
|
bitinit2(struct nstr_sect *np, unsigned char *bitmap, int country)
|
||||||
{
|
{
|
||||||
struct sctstr sect;
|
struct sctstr sect;
|
||||||
int eff;
|
int eff;
|
||||||
|
|
|
@ -60,7 +60,7 @@ produce(struct natstr *np, struct sctstr *sp, short *vec, int work,
|
||||||
struct pchrstr *product;
|
struct pchrstr *product;
|
||||||
double p_e;
|
double p_e;
|
||||||
double prodeff;
|
double prodeff;
|
||||||
u_char *resource;
|
unsigned char *resource;
|
||||||
double output;
|
double output;
|
||||||
int actual;
|
int actual;
|
||||||
int unit_work;
|
int unit_work;
|
||||||
|
@ -85,7 +85,7 @@ produce(struct natstr *np, struct sctstr *sp, short *vec, int work,
|
||||||
p_e = neweff / 100.0;
|
p_e = neweff / 100.0;
|
||||||
if (product->p_nrndx != 0) {
|
if (product->p_nrndx != 0) {
|
||||||
unit_work++;
|
unit_work++;
|
||||||
resource = (u_char *)sp + product->p_nrndx;
|
resource = (unsigned char *)sp + product->p_nrndx;
|
||||||
p_e = (*resource * p_e) / 100.0;
|
p_e = (*resource * p_e) / 100.0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -65,7 +65,7 @@ upd_buildeff(struct natstr *np, struct sctstr *sp, int *workp,
|
||||||
int work_cost = 0;
|
int work_cost = 0;
|
||||||
int buildeff_work = *workp / 2;
|
int buildeff_work = *workp / 2;
|
||||||
int n, hcms, lcms, neweff;
|
int n, hcms, lcms, neweff;
|
||||||
u_char old_type = *desig;
|
unsigned char old_type = *desig;
|
||||||
|
|
||||||
*cost = 0;
|
*cost = 0;
|
||||||
neweff = sp->sct_effic;
|
neweff = sp->sct_effic;
|
||||||
|
|
|
@ -119,7 +119,7 @@ upd_ship(struct shpstr *sp, int etus,
|
||||||
int max_oil;
|
int max_oil;
|
||||||
int max_food;
|
int max_food;
|
||||||
struct pchrstr *product;
|
struct pchrstr *product;
|
||||||
u_char *resource;
|
unsigned char *resource;
|
||||||
int dep;
|
int dep;
|
||||||
int n;
|
int n;
|
||||||
int mult;
|
int mult;
|
||||||
|
@ -180,7 +180,7 @@ upd_ship(struct shpstr *sp, int etus,
|
||||||
if (sp->shp_item[I_OIL] + oil_gained > max_oil)
|
if (sp->shp_item[I_OIL] + oil_gained > max_oil)
|
||||||
oil_gained = max_oil - sp->shp_item[I_OIL];
|
oil_gained = max_oil - sp->shp_item[I_OIL];
|
||||||
if (product->p_nrdep != 0 && oil_gained > 0) {
|
if (product->p_nrdep != 0 && oil_gained > 0) {
|
||||||
resource = (u_char *)sectp + product->p_nrndx;
|
resource = (unsigned char *)sectp + product->p_nrndx;
|
||||||
if (*resource * 100 < product->p_nrdep * oil_gained)
|
if (*resource * 100 < product->p_nrdep * oil_gained)
|
||||||
oil_gained = *resource * 100 / product->p_nrdep;
|
oil_gained = *resource * 100 / product->p_nrdep;
|
||||||
dep = roundavg(oil_gained * product->p_nrdep / 100.0);
|
dep = roundavg(oil_gained * product->p_nrdep / 100.0);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# indent needs to know type names do to a proper job.
|
# indent needs to know type names do to a proper job.
|
||||||
# Type names located with grep typedef, then extracted by hand:
|
# Type names located with grep typedef, then extracted by hand:
|
||||||
types="coord empth_sem_t empth_t i_packing i_type loc_Sem_t loc_Thread_t natid ns_seltype nsc_cat nsc_flags nsc_type packed_nsc_cat packed_nsc_type s_char stkalign_t u_char u_int u_short"
|
types="coord empth_sem_t empth_t i_packing i_type loc_Sem_t loc_Thread_t natid ns_seltype nsc_cat nsc_flags nsc_type packed_nsc_cat packed_nsc_type s_char stkalign_t"
|
||||||
|
|
||||||
opts="-kr -cdw -cp8 -ncs -psl -ss"
|
opts="-kr -cdw -cp8 -ncs -psl -ss"
|
||||||
for t in $types
|
for t in $types
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue