new gcc spouts more warnings, fix them.

This commit is contained in:
Enno Rehling 2012-05-18 21:25:21 -07:00
parent 3d50745d77
commit 07a75b6660
3 changed files with 25 additions and 42 deletions

View File

@ -222,15 +222,12 @@ int sp_stun(struct castorder * co)
battle *b = fi->side->battle; battle *b = fi->side->battle;
unit *mage = fi->unit; unit *mage = fi->unit;
message *m; message *m;
troop at;
/* Aus beiden Reihen nehmen */ /* Aus beiden Reihen nehmen */
int force = 0, enemies; int force = 0, enemies;
int stunned; int stunned;
if (power <= 0) if (power <= 0)
return 0; return 0;
at.fighter = fi;
at.index = 0;
switch (sp->id) { switch (sp->id) {
case SPL_SHOCKWAVE: case SPL_SHOCKWAVE:
@ -262,8 +259,7 @@ int sp_stun(struct castorder * co)
} }
} }
m = m = msg_message("cast_stun_effect", "mage spell amount", fi->unit, sp, stunned);
msg_message("cast_stun_effect", "mage spell amount", fi->unit, sp, stunned);
message_all(b, m); message_all(b, m);
msg_release(m); msg_release(m);
return level; return level;

View File

@ -981,12 +981,10 @@ static int sp_maelstrom(castorder * co)
/* Attribut auf Region. /* Attribut auf Region.
* Existiert schon ein curse, so wird dieser verstaerkt * Existiert schon ein curse, so wird dieser verstaerkt
* (Max(Dauer), Max(Staerke))*/ * (Max(Dauer), Max(Staerke))*/
c = c = create_curse(mage, &r->attribs, ct_find("maelstrom"), power, duration, effect, 0);
create_curse(mage, &r->attribs, ct_find("maelstrom"), power, duration,
effect, 0);
/* melden, 1x pro Partei */ /* melden, 1x pro Partei */
{ if (c) {
message *seen = msg_message("maelstrom_effect", "mage", mage); message *seen = msg_message("maelstrom_effect", "mage", mage);
message *unseen = msg_message("maelstrom_effect", "mage", NULL); message *unseen = msg_message("maelstrom_effect", "mage", NULL);
report_effect(r, mage, seen, unseen); report_effect(r, mage, seen, unseen);
@ -1185,13 +1183,15 @@ void patzer_ents(castorder * co)
ents = (int)(force * 10); ents = (int)(force * 10);
u = create_unit(r, get_monsters(), ents, new_race[RC_TREEMAN], 0, NULL, NULL); u = create_unit(r, get_monsters(), ents, new_race[RC_TREEMAN], 0, NULL, NULL);
if (u) {
message *unseen;
/* 'Erfolg' melden */ /* 'Erfolg' melden */
ADDMSG(&mage->faction->msgs, msg_message("regionmagic_patzer", ADDMSG(&mage->faction->msgs, msg_message("regionmagic_patzer",
"unit region command", mage, mage->region, co->order)); "unit region command", mage, mage->region, co->order));
/* melden, 1x pro Partei */ /* melden, 1x pro Partei */
{ unseen = msg_message("entrise", "region", r);
message *unseen = msg_message("entrise", "region", r);
report_effect(r, mage, unseen, unseen); report_effect(r, mage, unseen, unseen);
msg_release(unseen); msg_release(unseen);
} }
@ -1966,14 +1966,14 @@ static int sp_holyground(castorder * co)
unit *mage = co->magician.u; unit *mage = co->magician.u;
int cast_level = co->level; int cast_level = co->level;
double power = co->force; double power = co->force;
curse *c;
message *msg = msg_message("sp_holyground_effect", "mage region", mage, r); message *msg = msg_message("sp_holyground_effect", "mage region", mage, r);
report_spell(mage, r, msg); report_spell(mage, r, msg);
msg_release(msg); msg_release(msg);
if (!ctype) if (!ctype) {
ctype = ct_find("holyground"); ctype = ct_find("holyground");
c = create_curse(mage, &r->attribs, ctype, power * power, 1, zero_effect, 0); }
create_curse(mage, &r->attribs, ctype, power * power, 1, zero_effect, 0);
a_removeall(&r->attribs, &at_deathcount); a_removeall(&r->attribs, &at_deathcount);
@ -3152,7 +3152,7 @@ static int sp_magicboost(castorder * co)
add_trigger(&mage->attribs, "timer", trigger_timeout(5, tsummon)); add_trigger(&mage->attribs, "timer", trigger_timeout(5, tsummon));
ADDMSG(&mage->faction->msgs, msg_message("magicboost_effect", ADDMSG(&mage->faction->msgs, msg_message("magicboost_effect",
"unit region command", mage, mage->region, co->order)); "unit region command", c->magician, mage->region, co->order));
return cast_level; return cast_level;
} }
@ -3538,8 +3538,7 @@ static int sp_charmingsong(castorder * co)
add_trigger(&mage->faction->attribs, "destroy", trigger_killunit(target)); add_trigger(&mage->faction->attribs, "destroy", trigger_killunit(target));
} }
/* sperre ATTACKIERE, GIB PERSON und ueberspringe Migranten */ /* sperre ATTACKIERE, GIB PERSON und ueberspringe Migranten */
create_curse(mage, &target->attribs, ct_find("slavery"), force, duration, create_curse(mage, &target->attribs, ct_find("slavery"), force, duration, zero_effect, 0);
zero_effect, 0);
/* setze Partei um und loesche langen Befehl aus Sicherheitsgruenden */ /* setze Partei um und loesche langen Befehl aus Sicherheitsgruenden */
u_setfaction(target, mage->faction); u_setfaction(target, mage->faction);
@ -4596,13 +4595,11 @@ int sp_baddreams(castorder * co)
/* Nichts machen als ein entsprechendes Attribut in die Region legen. */ /* Nichts machen als ein entsprechendes Attribut in die Region legen. */
effect = -1; effect = -1;
c = c = create_curse(mage, &r->attribs, ct_find("gbdream"), power, duration, effect, 0);
create_curse(mage, &r->attribs, ct_find("gbdream"), power, duration, effect,
0);
/* Erfolg melden */ /* Erfolg melden */
ADDMSG(&mage->faction->msgs, msg_message("regionmagic_effect", ADDMSG(&mage->faction->msgs, msg_message("regionmagic_effect",
"unit region command", mage, mage->region, co->order)); "unit region command", c->magician, mage->region, co->order));
return cast_level; return cast_level;
} }
@ -4634,13 +4631,11 @@ int sp_gooddreams(castorder * co)
duration = (int)MAX(1, power / 2); /* Stufe 1 macht sonst mist */ duration = (int)MAX(1, power / 2); /* Stufe 1 macht sonst mist */
duration = 2 + rng_int() % duration; duration = 2 + rng_int() % duration;
effect = 1; effect = 1;
c = c = create_curse(mage, &r->attribs, ct_find("gbdream"), power, duration, effect, 0);
create_curse(mage, &r->attribs, ct_find("gbdream"), power, duration, effect,
0);
/* Erfolg melden */ /* Erfolg melden */
ADDMSG(&mage->faction->msgs, msg_message("regionmagic_effect", ADDMSG(&mage->faction->msgs, msg_message("regionmagic_effect",
"unit region command", mage, mage->region, co->order)); "unit region command", c->magician, mage->region, co->order));
return cast_level; return cast_level;
} }
@ -4779,11 +4774,9 @@ int sp_sweetdreams(castorder * co)
/* Nichts machen als ein entsprechendes Attribut an die Einheit legen. */ /* Nichts machen als ein entsprechendes Attribut an die Einheit legen. */
effect = 0.05; effect = 0.05;
c = c = create_curse(mage, &u->attribs, ct_find("orcish"), power, duration, effect, men);
create_curse(mage, &u->attribs, ct_find("orcish"), power, duration,
effect, men);
msg = msg_message("sp_sweetdreams_effect", "mage unit region", mage, u, r); msg = msg_message("sp_sweetdreams_effect", "mage unit region", c->magician, u, r);
r_addmessage(r, mage->faction, msg); r_addmessage(r, mage->faction, msg);
if (u->faction != mage->faction) { if (u->faction != mage->faction) {
r_addmessage(r, u->faction, msg); r_addmessage(r, u->faction, msg);
@ -4805,12 +4798,10 @@ int sp_disturbingdreams(castorder * co)
curse *c; curse *c;
effect = 10; effect = 10;
c = c = create_curse(mage, &r->attribs, ct_find("badlearn"), power, duration, effect, 0);
create_curse(mage, &r->attribs, ct_find("badlearn"), power, duration,
effect, 0);
ADDMSG(&mage->faction->msgs, msg_message("sp_disturbingdreams_effect", ADDMSG(&mage->faction->msgs, msg_message("sp_disturbingdreams_effect",
"mage region", mage, r)); "mage region", c->magician, r));
return cast_level; return cast_level;
} }
@ -5905,15 +5896,12 @@ int sp_movecastle(castorder * co)
if ((b->type == bt_find("caravan") || b->type == bt_find("dam") if ((b->type == bt_find("caravan") || b->type == bt_find("dam")
|| b->type == bt_find("tunnel"))) { || b->type == bt_find("tunnel"))) {
boolean damage = false;
direction_t d; direction_t d;
for (d = 0; d != MAXDIRECTIONS; ++d) { for (d = 0; d != MAXDIRECTIONS; ++d) {
if (rroad(r, d)) { if (rroad(r, d)) {
rsetroad(r, d, rroad(r, d) / 2); rsetroad(r, d, rroad(r, d) / 2);
damage = true;
} }
} }
/* if (damage) strcat(buf, " Die Straßen der Region wurden beschaedigt."); */
} }
msg = msg_message("sp_movecastle_effect", "building direction", b, dir); msg = msg_message("sp_movecastle_effect", "building direction", b, dir);

View File

@ -313,9 +313,8 @@ static int read_skill(struct storage *store, curse * c, void *target)
{ {
int skill; int skill;
if (store->version < CURSETYPE_VERSION) { if (store->version < CURSETYPE_VERSION) {
int men;
skill = store->r_int(store); skill = store->r_int(store);
men = store->r_int(store); store->r_int(store); /* men, deprecated */
} else { } else {
skill = store->r_int(store); skill = store->r_int(store);
} }