forked from github/server
compiling with -pedantic on linux
This commit is contained in:
parent
d940f29a6c
commit
b95f663087
|
@ -7,7 +7,7 @@ if (${CMAKE_C_COMPILER} MATCHES ".*tcc")
|
|||
endif(${CMAKE_C_COMPILER} MATCHES ".*tcc")
|
||||
|
||||
if (${CMAKE_C_COMPILER} MATCHES ".*gcc")
|
||||
set(CMAKE_C_FLAGS "-g -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts")
|
||||
set(CMAKE_C_FLAGS "-g -pedantic -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
|
||||
endif(${CMAKE_C_COMPILER} MATCHES ".*gcc")
|
||||
|
||||
if (WIN32)
|
||||
|
|
|
@ -379,8 +379,8 @@ static order *monster_move(region * r, unit * u)
|
|||
return NULL;
|
||||
|
||||
reduce_weight(u);
|
||||
return create_order(K_MOVE, u->faction->locale, "%s", LOC(u->faction->locale,
|
||||
directions[d]));
|
||||
return create_order(K_MOVE, u->faction->locale, "%s",
|
||||
LOC(u->faction->locale, directions[d]));
|
||||
}
|
||||
|
||||
static int dragon_affinity_value(region * r, unit * u)
|
||||
|
@ -461,8 +461,8 @@ static order *make_movement_order(unit * u, const region * target, int moves,
|
|||
return NULL;
|
||||
|
||||
bytes =
|
||||
(int)strlcpy(bufp, (const char *)LOC(u->faction->locale, keywords[K_MOVE]),
|
||||
size);
|
||||
(int)strlcpy(bufp,
|
||||
(const char *)LOC(u->faction->locale, keywords[K_MOVE]), size);
|
||||
if (wrptr(&bufp, &size, bytes) != 0)
|
||||
WARN_STATIC_BUFFER();
|
||||
|
||||
|
@ -476,8 +476,8 @@ static order *make_movement_order(unit * u, const region * target, int moves,
|
|||
--size;
|
||||
}
|
||||
bytes =
|
||||
(int)strlcpy(bufp, (const char *)LOC(u->faction->locale, directions[dir]),
|
||||
size);
|
||||
(int)strlcpy(bufp,
|
||||
(const char *)LOC(u->faction->locale, directions[dir]), size);
|
||||
if (wrptr(&bufp, &size, bytes) != 0)
|
||||
WARN_STATIC_BUFFER();
|
||||
}
|
||||
|
@ -540,8 +540,8 @@ static order *monster_seeks_target(region * r, unit * u)
|
|||
}
|
||||
assert(d != NODIRECTION);
|
||||
|
||||
return create_order(K_MOVE, u->faction->locale, "%s", LOC(u->faction->locale,
|
||||
directions[d]));
|
||||
return create_order(K_MOVE, u->faction->locale, "%s",
|
||||
LOC(u->faction->locale, directions[d]));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -711,14 +711,19 @@ static order *plan_dragon(unit * u)
|
|||
case RC_WYRM:
|
||||
long_order = make_movement_order(u, tr, 1, allowed_dragon);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (rng_int() % 100 < 15) {
|
||||
const struct locale *lang = u->faction->locale;
|
||||
/* do a growl */
|
||||
if (rname(tr, lang)) {
|
||||
addlist(&u->orders, create_order(K_MAIL, lang, "%s '%s... %s %s %s'",
|
||||
LOC(lang, parameters[P_REGION]), random_growl(),
|
||||
u->number == 1 ? "Ich rieche" : "Wir riechen",
|
||||
addlist(&u->orders,
|
||||
create_order(K_MAIL, lang, "%s '%s... %s %s %s'",
|
||||
LOC(lang, parameters[P_REGION]),
|
||||
random_growl(),
|
||||
u->number ==
|
||||
1 ? "Ich rieche" : "Wir riechen",
|
||||
"etwas in", rname(tr, u->faction->locale)));
|
||||
}
|
||||
}
|
||||
|
@ -797,8 +802,8 @@ void plan_monsters(faction * f)
|
|||
if (ta && !monster_is_waiting(u)) {
|
||||
unit *tu = (unit *) ta->data.v;
|
||||
if (tu && tu->region == r) {
|
||||
addlist(&u->orders, create_order(K_ATTACK, u->faction->locale, "%i",
|
||||
tu->no));
|
||||
addlist(&u->orders,
|
||||
create_order(K_ATTACK, u->faction->locale, "%i", tu->no));
|
||||
} else if (tu) {
|
||||
tu = findunitg(ta->data.i, NULL);
|
||||
if (tu != NULL) {
|
||||
|
@ -833,8 +838,8 @@ void plan_monsters(faction * f)
|
|||
if (u->race->bonus[SK_WEAPONLESS] != -99) {
|
||||
if (eff_skill(u, SK_WEAPONLESS, u->region) < 1) {
|
||||
long_order =
|
||||
create_order(K_STUDY, f->locale, "'%s'", skillname(SK_WEAPONLESS,
|
||||
f->locale));
|
||||
create_order(K_STUDY, f->locale, "'%s'",
|
||||
skillname(SK_WEAPONLESS, f->locale));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -891,7 +896,8 @@ static int nrand(int start, int sub)
|
|||
if (rng_int() % 100 < start)
|
||||
res++;
|
||||
start -= sub;
|
||||
} while (start > 0);
|
||||
}
|
||||
while (start > 0);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -925,8 +931,8 @@ void spawn_dragons(void)
|
|||
|
||||
if (verbosity >= 2) {
|
||||
log_printf("%d %s in %s.\n", u->number,
|
||||
LOC(default_locale, rc_name(u->race, u->number != 1)), regionname(r,
|
||||
NULL));
|
||||
LOC(default_locale,
|
||||
rc_name(u->race, u->number != 1)), regionname(r, NULL));
|
||||
}
|
||||
|
||||
name_unit(u);
|
||||
|
@ -1000,8 +1006,8 @@ void spawn_undead(void)
|
|||
|
||||
if (verbosity >= 2) {
|
||||
log_printf("%d %s in %s.\n", u->number,
|
||||
LOC(default_locale, rc_name(u->race, u->number != 1)), regionname(r,
|
||||
NULL));
|
||||
LOC(default_locale,
|
||||
rc_name(u->race, u->number != 1)), regionname(r, NULL));
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
@ -88,6 +88,8 @@ static void equip_newunits(const struct equipment *eq, struct unit *u)
|
|||
case RC_CENTAUR:
|
||||
rsethorses(r, 250 + rng_int() % 51 + rng_int() % 51);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue