(I_NONE, I_CIVIL, I_MILIT, I_SHELL, I_GUN, I_PETROL, I_IRON, I_DUST,
I_BAR, I_FOOD, I_OIL, I_LCM, I_HCM, I_UW, I_RAD, I_MAX): Turn macros into enumeration constants. (i_type): New. Use where appropriate. No functional changes, except that I_NONE is now catched properly in a few places.
This commit is contained in:
parent
308430e751
commit
d30942632b
38 changed files with 143 additions and 134 deletions
|
@ -238,7 +238,7 @@ orde(void)
|
|||
level = 0; /* prevent negatives. */
|
||||
pr("You must use positive number! Level set to 0.\n");
|
||||
}
|
||||
ship.shp_tstart[sub] = (s_char)i1->i_vtype;
|
||||
ship.shp_tstart[sub] = i1->i_vtype;
|
||||
ship.shp_lstart[sub] = level;
|
||||
pr("Order Set \n");
|
||||
break;
|
||||
|
@ -258,7 +258,7 @@ orde(void)
|
|||
level = 0;
|
||||
pr("You must use positive number! Level set to 0.\n");
|
||||
}
|
||||
ship.shp_tend[sub] = (s_char)i1->i_vtype;
|
||||
ship.shp_tend[sub] = i1->i_vtype;
|
||||
ship.shp_lend[sub] = level;
|
||||
pr("Order Set \n");
|
||||
break;
|
||||
|
@ -286,7 +286,7 @@ orde(void)
|
|||
&& (ship.shp_lstart[1] != ' '))) {
|
||||
|
||||
coord tcord;
|
||||
s_char tcomm;
|
||||
i_type tcomm;
|
||||
short lev[TMAX];
|
||||
int i;
|
||||
|
||||
|
@ -354,10 +354,10 @@ eta_calc(struct shpstr *sp, s_char *path, int *len, int *nupdates)
|
|||
}
|
||||
|
||||
static void
|
||||
prhold(int hold, int itype, int amt)
|
||||
prhold(int hold, i_type itype, int amt)
|
||||
{
|
||||
if (itype != I_NONE && amt != 0) {
|
||||
if (CANT_HAPPEN((unsigned)itype > I_MAX))
|
||||
if (CANT_HAPPEN(itype <= I_NONE || itype > I_MAX))
|
||||
return;
|
||||
pr("%d-", hold + 1);
|
||||
pr("%c", ichr[itype].i_mnem);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue