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 */
P_WISE, /* 6 */
P_FOOL,
#ifdef INSECT_POTION
P_WARMTH,
#else
P_STEEL,
#endif
P_HORSE,
P_BERSERK, /* 10 */
/* Stufe 4 */

View File

@ -84,9 +84,6 @@ extern "C" {
score_t score;
struct alliance *alliance;
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 attrib *attribs;
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("greatsword"), it_find("rustygreatsword"), 1.0);
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("chainmail"), it_find("rustychainmail"), 0.2f);
#endif
}
if (force > 0) {
@ -5454,7 +5452,8 @@ int sp_fetchastral(castorder * co)
return cast_level;
}
#ifdef SHOWASTRAL_NOT_BORKED
#define SHOWASTRAL_IS_BORKED
#ifndef SHOWASTRAL_IS_BORKED
int sp_showastral(castorder * co)
{
unit *u;
@ -6493,7 +6492,7 @@ static spelldata spell_functions[] = {
{ "analyze_magic", sp_analysemagic, 0 },
{ "concealing_aura", sp_itemcloak, 0 },
{ "tybiedfumbleshield", sp_fumbleshield, 0 },
#ifdef SHOWASTRAL_NOT_BORKED
#ifndef SHOWASTRAL_IS_BORKED
{ "show_astral", sp_showastral, 0 },
#endif
{ "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);
}
#ifndef NO_TESTS
static learn_fun inject_learn_fun = 0;
void inject_learn(learn_fun fun) {
inject_learn_fun = fun;
}
#endif
/** 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) {
int leveldays = STUDYDAYS * u->number;
int weeks = 0;
#ifndef NO_TESTS
if (inject_learn_fun) {
inject_learn_fun(u, sk, days);
return;
}
#endif
while (days >= leveldays) {
++weeks;
days -= leveldays;