Warnings gefixt

This commit is contained in:
Enno Rehling 2002-05-09 11:23:49 +00:00
parent beefc1f7ec
commit 05d073373d
4 changed files with 4 additions and 5 deletions

View File

@ -2193,8 +2193,7 @@ tagbegin(struct xml_stack * stack)
assert(strcmp(stack->next->tag->name, "weapon")==0);
if (strcmp(type, "default")!=0) pos = 1;
if (state->wtype->damage[pos]) free(state->wtype->damage[pos]);
state->wtype->damage[pos] = strdup(xml_value(tag, "value"));
state->wtype->damage[pos] = gc_add(strdup(xml_value(tag, "value")));
} else if (strcmp(tag->name, "modifier")==0) {
int value = xml_ivalue(tag, "value");
assert(strcmp(stack->next->tag->name, "weapon")==0);

View File

@ -185,7 +185,7 @@ typedef struct weapon_mod {
typedef struct weapon_type {
const item_type * itype;
char * damage[2];
const char * damage[2];
unsigned int flags;
skill_t skill;
int minskill;

View File

@ -592,7 +592,7 @@ find_spellbyname(unit *u, char *name, const struct locale * lang)
sn=sn->next;
}
if (!sn) sn = init_spellnames(lang, m->magietyp);
if (findtoken(&sn->names, name, &sp)==E_TOK_NOMATCH) return NULL;
if (findtoken(&sn->names, name, (void**)&sp)==E_TOK_NOMATCH) return NULL;
for (spt = m->spellptr; spt; spt = spt->next) {
if (sp->id==spt->spellid) return sp;

View File

@ -264,4 +264,4 @@ is_watcher(const struct plane * p, const struct faction * f)
w = p->watchers;
while (w && w->faction!=f) w=w->next;
return (w!=NULL);
}
}