(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
|
@ -82,14 +82,6 @@
|
|||
/* Selector descriptors for characteristics tables */
|
||||
/* FIXME belongs into src/lib/global/ */
|
||||
|
||||
/* Return nsc_type for a signed integer with the same size as TYPE. */
|
||||
#define NSC_SITYPE(type) \
|
||||
(sizeof(type) == 1 ? NSC_CHAR \
|
||||
: sizeof(type) == sizeof(short) ? NSC_SHORT \
|
||||
: sizeof(type) == sizeof(int) ? NSC_INT \
|
||||
: sizeof(type) == sizeof(long) ? NSC_LONG \
|
||||
: 1/0)
|
||||
|
||||
static struct castr dchr_ca[] = {
|
||||
{NSC_STRING, 0, 0, offsetof(struct dchrstr, d_name), "name"},
|
||||
{NSC_INT, 0, 0, offsetof(struct dchrstr, d_mnem), "mnem"},
|
||||
|
@ -110,7 +102,7 @@ static struct castr dchr_ca[] = {
|
|||
static struct castr ichr_ca[] = {
|
||||
{NSC_STRING, 0, 0, offsetof(struct ichrstr, i_name), "name"},
|
||||
{NSC_INT, 0, 0, offsetof(struct ichrstr, i_mnem), "mnem"},
|
||||
{NSC_INT, 0, 0, offsetof(struct ichrstr, i_vtype), "vtype"},
|
||||
{NSC_SITYPE(i_type), 0, 0, offsetof(struct ichrstr, i_vtype), "vtype"},
|
||||
{NSC_INT, 0, 0, offsetof(struct ichrstr, i_value), "value"},
|
||||
{NSC_INT, 0, 0, offsetof(struct ichrstr, i_sell), "sell"},
|
||||
{NSC_INT, 0, 0, offsetof(struct ichrstr, i_lbs), "lbs"},
|
||||
|
@ -166,9 +158,9 @@ static struct castr mchr_ca[] = {
|
|||
static struct castr pchr_ca[] = {
|
||||
{NSC_STRING, 0, 0, offsetof(struct pchrstr, p_name), "name"},
|
||||
{NSC_STRING, 0, 0, offsetof(struct pchrstr, p_sname), "sname"},
|
||||
{NSC_UCHAR, 0, MAXPRCON, offsetof(struct pchrstr, p_ctype), "ctype"},
|
||||
{NSC_SITYPE(i_type), 0, MAXPRCON, offsetof(struct pchrstr, p_ctype), "ctype"},
|
||||
{NSC_USHORT, 0, MAXPRCON, offsetof(struct pchrstr, p_camt), "camt"},
|
||||
{NSC_INT, 0, 0, offsetof(struct pchrstr, p_type), "type"},
|
||||
{NSC_SITYPE(i_type), 0, 0, offsetof(struct pchrstr, p_type), "type"},
|
||||
{NSC_INT, 0, 0, offsetof(struct pchrstr, p_level), "level"},
|
||||
{NSC_INT, 0, 0, offsetof(struct pchrstr, p_cost), "cost"},
|
||||
{NSC_INT, 0, 0, offsetof(struct pchrstr, p_nrndx), "nrndx"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue