remove some ifdef options to maybe accelerate cppcheck.

This commit is contained in:
Enno Rehling 2017-12-09 11:00:37 +01:00
parent 8efc7f1829
commit abd9b94d37
4 changed files with 5 additions and 15 deletions

View File

@ -41,11 +41,7 @@ extern "C" {
/* Stufe 3 */ /* Stufe 3 */
P_WISE, /* 6 */ P_WISE, /* 6 */
P_FOOL, P_FOOL,
#ifdef INSECT_POTION
P_WARMTH,
#else
P_STEEL, P_STEEL,
#endif
P_HORSE, P_HORSE,
P_BERSERK, /* 10 */ P_BERSERK, /* 10 */
/* Stufe 4 */ /* Stufe 4 */

View File

@ -84,9 +84,6 @@ extern "C" {
score_t score; score_t score;
struct alliance *alliance; struct alliance *alliance;
int alliance_joindate; /* the turn on which the faction joined its current alliance (or left the last one) */ int alliance_joindate; /* the turn on which the faction joined its current alliance (or left the last one) */
#ifdef VICTORY_DELAY
unsigned char victory_delay;
#endif
struct unit *units; struct unit *units;
struct attrib *attribs; struct attrib *attribs;
struct message_list *msgs; struct message_list *msgs;

View File

@ -1280,10 +1280,8 @@ static int sp_rosthauch(castorder * co)
add_ironweapon(it_find("axe"), it_find("rustyaxe"), 1.0); add_ironweapon(it_find("axe"), it_find("rustyaxe"), 1.0);
add_ironweapon(it_find("greatsword"), it_find("rustygreatsword"), 1.0); add_ironweapon(it_find("greatsword"), it_find("rustygreatsword"), 1.0);
add_ironweapon(it_find("halberd"), it_find("rustyhalberd"), 0.5f); add_ironweapon(it_find("halberd"), it_find("rustyhalberd"), 0.5f);
#ifndef NO_RUSTY_ARMOR
add_ironweapon(it_find("shield"), it_find("rustyshield"), 0.5f); add_ironweapon(it_find("shield"), it_find("rustyshield"), 0.5f);
add_ironweapon(it_find("chainmail"), it_find("rustychainmail"), 0.2f); add_ironweapon(it_find("chainmail"), it_find("rustychainmail"), 0.2f);
#endif
} }
if (force > 0) { if (force > 0) {
@ -5454,7 +5452,8 @@ int sp_fetchastral(castorder * co)
return cast_level; return cast_level;
} }
#ifdef SHOWASTRAL_NOT_BORKED #define SHOWASTRAL_IS_BORKED
#ifndef SHOWASTRAL_IS_BORKED
int sp_showastral(castorder * co) int sp_showastral(castorder * co)
{ {
unit *u; unit *u;
@ -6493,7 +6492,7 @@ static spelldata spell_functions[] = {
{ "analyze_magic", sp_analysemagic, 0 }, { "analyze_magic", sp_analysemagic, 0 },
{ "concealing_aura", sp_itemcloak, 0 }, { "concealing_aura", sp_itemcloak, 0 },
{ "tybiedfumbleshield", sp_fumbleshield, 0 }, { "tybiedfumbleshield", sp_fumbleshield, 0 },
#ifdef SHOWASTRAL_NOT_BORKED #ifndef SHOWASTRAL_IS_BORKED
{ "show_astral", sp_showastral, 0 }, { "show_astral", sp_showastral, 0 },
#endif #endif
{ "resist_magic", sp_resist_magic_bonus, 0 }, { "resist_magic", sp_resist_magic_bonus, 0 },

View File

@ -811,23 +811,21 @@ void produceexp(struct unit *u, skill_t sk, int n)
produceexp_ex(u, sk, n, learn_skill); produceexp_ex(u, sk, n, learn_skill);
} }
#ifndef NO_TESTS
static learn_fun inject_learn_fun = 0; static learn_fun inject_learn_fun = 0;
void inject_learn(learn_fun fun) { void inject_learn(learn_fun fun) {
inject_learn_fun = fun; inject_learn_fun = fun;
} }
#endif
/** days should be scaled by u->number; STUDYDAYS * u->number is one week worth of learning */ /** days should be scaled by u->number; STUDYDAYS * u->number is one week worth of learning */
void learn_skill(unit *u, skill_t sk, int days) { void learn_skill(unit *u, skill_t sk, int days) {
int leveldays = STUDYDAYS * u->number; int leveldays = STUDYDAYS * u->number;
int weeks = 0; int weeks = 0;
#ifndef NO_TESTS
if (inject_learn_fun) { if (inject_learn_fun) {
inject_learn_fun(u, sk, days); inject_learn_fun(u, sk, days);
return; return;
} }
#endif
while (days >= leveldays) { while (days >= leveldays) {
++weeks; ++weeks;
days -= leveldays; days -= leveldays;