soem warnings removed

This commit is contained in:
Enno Rehling 2002-03-03 15:26:17 +00:00
parent 39247a6133
commit a7f70db795
3 changed files with 5 additions and 7 deletions

View File

@ -1835,7 +1835,7 @@ writeunit(FILE * F, const unit * u)
for (i=0;i!=u->skill_size;++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) {
wi(F, sv->id);
wi(F, sv->level);
@ -1890,7 +1890,7 @@ readregion(FILE * F, int x, int y)
while (r->attribs) a_remove(&r->attribs, r->attribs);
if (r->land) {
free(r->land); /* mem leak */
r->land->demands;
r->land->demands = 0; /* mem leak */
}
while (r->resources) {
rawmaterial * rm = r->resources;

View File

@ -696,7 +696,7 @@ transfermen(unit * u, unit * u2, int n)
if (sn==NULL) sn = add_skill(u2, sk);
sn->level = (unsigned char)level;
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) {
sk_set(sn, 0);
}
@ -863,7 +863,6 @@ get_skill(const unit * u, skill_t sk)
{
skill * sv = u->skills;
while (sv!=u->skills+u->skill_size) {
assert(sv->level>=0 && sv->weeks>=0);
if (sv->id==sk) return sv;
++sv;
}
@ -875,7 +874,6 @@ has_skill(const unit * u, skill_t sk)
{
skill * sv = u->skills;
while (sv!=u->skills+u->skill_size) {
assert(sv->level>=0 && sv->weeks>=0);
if (sv->id==sk) {
return (sv->level>0);
}