Fix bad boolean handling in config.

This commit is contained in:
Jan Vidar Krey 2010-04-09 10:41:01 +02:00
parent 8ec55a59f5
commit 321cddad8e

View File

@ -45,7 +45,6 @@
LOG_FATAL("Configuration error on line %d: '%s' must be either '1' or '0'", line_count, key); \ LOG_FATAL("Configuration error on line %d: '%s' must be either '1' or '0'", line_count, key); \
return -1; \ return -1; \
} \ } \
TARGET |= 0x80000000; \
return 0; \ return 0; \
} }
@ -86,16 +85,7 @@
} }
#define DEFAULT_BOOLEAN(KEY, VALUE) \ #define DEFAULT_BOOLEAN(KEY, VALUE) \
{ \ config->KEY = config->KEY & 0x000000ff;
if (config->KEY & 0x80000000) \
{ \
config->KEY = config->KEY & 0x000000ff; \
} \
else \
{ \
config->KEY = VALUE; \
} \
}
#define GET_STR(NAME) CFG_APPLY_STRING ( #NAME , config->NAME ) #define GET_STR(NAME) CFG_APPLY_STRING ( #NAME , config->NAME )
#define GET_INT(NAME) CFG_APPLY_INTEGER( #NAME , config->NAME ) #define GET_INT(NAME) CFG_APPLY_INTEGER( #NAME , config->NAME )