diff --git a/src/attributes/movement.c b/src/attributes/movement.c index ca8b6fc2f..aa6d6504f 100644 --- a/src/attributes/movement.c +++ b/src/attributes/movement.c @@ -49,7 +49,7 @@ attrib_type at_movement = { bool get_movement(attrib * const *alist, int type) { - const attrib *a = a_findc(*alist, &at_movement); + const attrib *a = a_find(*alist, &at_movement); if (a == NULL) return false; if (a->data.i & type) diff --git a/src/attributes/raceprefix.c b/src/attributes/raceprefix.c index 79d77916d..6a150a8e6 100644 --- a/src/attributes/raceprefix.c +++ b/src/attributes/raceprefix.c @@ -45,10 +45,10 @@ void set_prefix(attrib ** ap, const char *str) a->data.v = _strdup(str); } -const char *get_prefix(const attrib * a) +const char *get_prefix(attrib * a) { char *str; - a = a_findc(a, &at_raceprefix); + a = a_find(a, &at_raceprefix); if (a == NULL) return NULL; str = (char *)a->data.v; diff --git a/src/attributes/raceprefix.h b/src/attributes/raceprefix.h index 64c81acfc..e1e9f0be0 100644 --- a/src/attributes/raceprefix.h +++ b/src/attributes/raceprefix.h @@ -24,7 +24,7 @@ extern "C" { extern struct attrib_type at_raceprefix; extern void set_prefix(struct attrib **ap, const char *str); - extern const char *get_prefix(const struct attrib *a); + extern const char *get_prefix(struct attrib *a); #ifdef __cplusplus } diff --git a/src/kernel/ally.c b/src/kernel/ally.c index 611db8d7b..9a74a2320 100644 --- a/src/kernel/ally.c +++ b/src/kernel/ally.c @@ -180,10 +180,10 @@ alliedgroup(const struct plane *pl, const struct faction *f, } mode = ally_mode(sf, mode) | (mode & autoalliance(pl, f, f2)); if (AllianceRestricted()) { - if (a_findc(f->attribs, &at_npcfaction)) { + if (a_find(f->attribs, &at_npcfaction)) { return mode; } - if (a_findc(f2->attribs, &at_npcfaction)) { + if (a_find(f2->attribs, &at_npcfaction)) { return mode; } if (f->alliance != f2->alliance) { @@ -232,7 +232,7 @@ int alliedunit(const unit * u, const faction * f2, int mode) sf = u->faction->allies; if (fval(u, UFL_GROUP)) { - const attrib *a = a_findc(u->attribs, &at_group); + const attrib *a = a_find(u->attribs, &at_group); if (a != NULL) sf = ((group *)a->data.v)->allies; } diff --git a/src/kernel/race.c b/src/kernel/race.c index f372bb8ae..92bdac19f 100644 --- a/src/kernel/race.c +++ b/src/kernel/race.c @@ -242,10 +242,10 @@ const char *rc_name_s(const race * rc, name_t n) const char *raceprefix(const unit * u) { - const attrib *asource = u->faction->attribs; + attrib *asource = u->faction->attribs; if (fval(u, UFL_GROUP)) { - const attrib *agroup = a_findc(u->attribs, &at_group); + attrib *agroup = a_find(u->attribs, &at_group); if (agroup != NULL) asource = ((const group *)(agroup->data.v))->attribs; } diff --git a/src/move.c b/src/move.c index 19b0b86af..cd6361605 100644 --- a/src/move.c +++ b/src/move.c @@ -122,7 +122,7 @@ get_followers(unit * target, region * r, const region_list * route_end, unit *uf; for (uf = r->units; uf; uf = uf->next) { if (fval(uf, UFL_FOLLOWING) && !fval(uf, UFL_NOTMOVING)) { - const attrib *a = a_findc(uf->attribs, &at_follow); + const attrib *a = a_find(uf->attribs, &at_follow); if (a && a->data.v == target) { follower *fnew = (follower *)malloc(sizeof(follower)); fnew->uf = uf; diff --git a/src/reports.c b/src/reports.c index b33f5f1cb..11c235011 100644 --- a/src/reports.c +++ b/src/reports.c @@ -354,7 +354,7 @@ const char **illusion) bt_illusion = bt_find("illusioncastle"); if (bt_illusion && b->type == bt_illusion) { - const attrib *a = a_findc(b->attribs, &at_icastle); + const attrib *a = a_find(b->attribs, &at_icastle); if (a != NULL) { *illusion = buildingtype(icastle_type(a), b, b->size); } diff --git a/src/spells.c b/src/spells.c index 6724f39a5..e7240b8dc 100644 --- a/src/spells.c +++ b/src/spells.c @@ -3091,9 +3091,9 @@ static int sp_summonshadowlords(castorder * co) static bool chaosgate_valid(const connection * b) { - const attrib *a = a_findc(b->from->attribs, &at_direction); + const attrib *a = a_find(b->from->attribs, &at_direction); if (!a) - a = a_findc(b->to->attribs, &at_direction); + a = a_find(b->to->attribs, &at_direction); if (!a) return false; return true; diff --git a/src/util/attrib.c b/src/util/attrib.c index 9db46836a..c076b74f2 100644 --- a/src/util/attrib.c +++ b/src/util/attrib.c @@ -101,13 +101,6 @@ attrib *a_find(attrib * a, const attrib_type * at) return a; } -const attrib *a_findc(const attrib * a, const attrib_type * at) -{ - while (a && a->type != at) - a = a->nexttype; - return a; -} - static attrib *a_insert(attrib * head, attrib * a) { attrib **pa; diff --git a/src/util/attrib.h b/src/util/attrib.h index 2703de0cb..14adeffb8 100644 --- a/src/util/attrib.h +++ b/src/util/attrib.h @@ -68,7 +68,6 @@ extern "C" { extern attrib *a_select(attrib * a, const void *data, bool(*compare) (const attrib *, const void *)); extern attrib *a_find(attrib * a, const attrib_type * at); - extern const attrib *a_findc(const attrib * a, const attrib_type * at); extern attrib *a_add(attrib ** pa, attrib * at); extern int a_remove(attrib ** pa, attrib * at); extern void a_removeall(attrib ** a, const attrib_type * at); diff --git a/src/vortex.c b/src/vortex.c index 1d558bb49..57dac78f8 100644 --- a/src/vortex.c +++ b/src/vortex.c @@ -149,7 +149,7 @@ attrib *create_special_direction(region * r, region * rt, int duration, spec_direction *special_direction(const region * from, const region * to) { - const attrib *a = a_findc(from->attribs, &at_direction); + const attrib *a = a_find(from->attribs, &at_direction); while (a != NULL && a->type == &at_direction) { spec_direction *sd = (spec_direction *)a->data.v;