contant name conflict resolved

This commit is contained in:
Enno Rehling 2018-10-26 16:08:46 +02:00
parent d1b4a47e1f
commit 557c624200
1 changed files with 7 additions and 7 deletions

View File

@ -79,10 +79,10 @@ const char *racenames[MAXRACES] = {
"clone" "clone"
}; };
#define MAXOPTIONS 4 #define MAX_OPTIONS 4
typedef struct rcoption { typedef struct rcoption {
unsigned char key[MAXOPTIONS]; unsigned char key[MAX_OPTIONS];
variant value[MAXOPTIONS]; variant value[MAX_OPTIONS];
} rcoption; } rcoption;
enum { enum {
@ -106,7 +106,7 @@ static void rc_setoption(race *rc, int k, const char *value) {
v = rc->options->value; v = rc->options->value;
} else { } else {
int i; int i;
for (i=0;!v && i < MAXOPTIONS;++i) { for (i=0;!v && i < MAX_OPTIONS;++i) {
if (rc->options->key[i]==key) { if (rc->options->key[i]==key) {
v = rc->options->value+i; v = rc->options->value+i;
break; break;
@ -114,7 +114,7 @@ static void rc_setoption(race *rc, int k, const char *value) {
if (rc->options->key[i]==RCO_NONE) { if (rc->options->key[i]==RCO_NONE) {
v = rc->options->value+i; v = rc->options->value+i;
rc->options->key[i] = key; rc->options->key[i] = key;
if (i+1 < MAXOPTIONS) { if (i+1 < MAX_OPTIONS) {
rc->options->key[i+1]=RCO_NONE; rc->options->key[i+1]=RCO_NONE;
} }
break; break;
@ -145,7 +145,7 @@ static void rc_setoption(race *rc, int k, const char *value) {
static variant *rc_getoption(const race *rc, int key) { static variant *rc_getoption(const race *rc, int key) {
if (rc->options) { if (rc->options) {
int i; int i;
for (i=0;i!=MAXOPTIONS && rc->options->key[i]!=RCO_NONE;++i) { for (i=0;i!=MAX_OPTIONS && rc->options->key[i]!=RCO_NONE;++i) {
if (rc->options->key[i]==key) { if (rc->options->key[i]==key) {
return rc->options->value+i; return rc->options->value+i;
} }
@ -269,7 +269,7 @@ void free_races(void) {
rcoption * opt = races->options; rcoption * opt = races->options;
if (opt) { if (opt) {
for (i=0;i!=MAXOPTIONS && opt->key[i]!=RCO_NONE;++i) { for (i=0;i!=MAX_OPTIONS && opt->key[i]!=RCO_NONE;++i) {
if (opt->key[i]==RCO_HUNGER) { if (opt->key[i]==RCO_HUNGER) {
free(opt->value[i].v); free(opt->value[i].v);
} }