forked from github/server
soem warnings removed
This commit is contained in:
parent
39247a6133
commit
a7f70db795
|
@ -1835,7 +1835,7 @@ writeunit(FILE * F, const unit * u)
|
||||||
|
|
||||||
for (i=0;i!=u->skill_size;++i) {
|
for (i=0;i!=u->skill_size;++i) {
|
||||||
skill * sv = u->skills+i;
|
skill * sv = u->skills+i;
|
||||||
assert(sv->level>=0 && sv->weeks>=0 && sv->weeks<=sv->level*2+1);
|
assert(sv->weeks<=sv->level*2+1);
|
||||||
if (sv->level>0) {
|
if (sv->level>0) {
|
||||||
wi(F, sv->id);
|
wi(F, sv->id);
|
||||||
wi(F, sv->level);
|
wi(F, sv->level);
|
||||||
|
@ -1890,7 +1890,7 @@ readregion(FILE * F, int x, int y)
|
||||||
while (r->attribs) a_remove(&r->attribs, r->attribs);
|
while (r->attribs) a_remove(&r->attribs, r->attribs);
|
||||||
if (r->land) {
|
if (r->land) {
|
||||||
free(r->land); /* mem leak */
|
free(r->land); /* mem leak */
|
||||||
r->land->demands;
|
r->land->demands = 0; /* mem leak */
|
||||||
}
|
}
|
||||||
while (r->resources) {
|
while (r->resources) {
|
||||||
rawmaterial * rm = r->resources;
|
rawmaterial * rm = r->resources;
|
||||||
|
|
|
@ -696,7 +696,7 @@ transfermen(unit * u, unit * u2, int n)
|
||||||
if (sn==NULL) sn = add_skill(u2, sk);
|
if (sn==NULL) sn = add_skill(u2, sk);
|
||||||
sn->level = (unsigned char)level;
|
sn->level = (unsigned char)level;
|
||||||
sn->weeks = (unsigned char)weeks;
|
sn->weeks = (unsigned char)weeks;
|
||||||
assert(sn->level>=0 && sn->weeks>0 && sn->weeks<=sn->level*2+1);
|
assert(sn->weeks>0 && sn->weeks<=sn->level*2+1);
|
||||||
} else if (sn) {
|
} else if (sn) {
|
||||||
sk_set(sn, 0);
|
sk_set(sn, 0);
|
||||||
}
|
}
|
||||||
|
@ -863,7 +863,6 @@ get_skill(const unit * u, skill_t sk)
|
||||||
{
|
{
|
||||||
skill * sv = u->skills;
|
skill * sv = u->skills;
|
||||||
while (sv!=u->skills+u->skill_size) {
|
while (sv!=u->skills+u->skill_size) {
|
||||||
assert(sv->level>=0 && sv->weeks>=0);
|
|
||||||
if (sv->id==sk) return sv;
|
if (sv->id==sk) return sv;
|
||||||
++sv;
|
++sv;
|
||||||
}
|
}
|
||||||
|
@ -875,7 +874,6 @@ has_skill(const unit * u, skill_t sk)
|
||||||
{
|
{
|
||||||
skill * sv = u->skills;
|
skill * sv = u->skills;
|
||||||
while (sv!=u->skills+u->skill_size) {
|
while (sv!=u->skills+u->skill_size) {
|
||||||
assert(sv->level>=0 && sv->weeks>=0);
|
|
||||||
if (sv->id==sk) {
|
if (sv->id==sk) {
|
||||||
return (sv->level>0);
|
return (sv->level>0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue