diff --git a/src/common/attributes/otherfaction.c b/src/common/attributes/otherfaction.c index 03fe411f3..c4a23fe81 100644 --- a/src/common/attributes/otherfaction.c +++ b/src/common/attributes/otherfaction.c @@ -29,13 +29,13 @@ void write_of(const struct attrib * a, FILE* F) { - const faction * f = (faction*)a->data.v; - fprintf(F, "%d ", f->no); + const faction * f = (faction*)a->data.v; + fprintf(F, "%d ", f->no); } int read_of(struct attrib * a, FILE* F) /* return 1 on success, 0 if attrib needs removal */ - { +{ int of, result; result = fscanf(F, "%d", &of); if (result<0) return result; @@ -45,39 +45,39 @@ read_of(struct attrib * a, FILE* F) /* return 1 on success, 0 if attrib needs re } attrib_type at_otherfaction = { - "otherfaction", NULL, NULL, NULL, write_of, read_of, ATF_UNIQUE + "otherfaction", NULL, NULL, NULL, write_of, read_of, ATF_UNIQUE }; struct faction * -get_otherfaction(const struct attrib * a) + get_otherfaction(const struct attrib * a) { - return (faction*)(a->data.v); + return (faction*)(a->data.v); } struct attrib * -make_otherfaction(struct faction * f) + make_otherfaction(struct faction * f) { - attrib * a = a_new(&at_otherfaction); - a->data.v = (void*)f; - return a; + attrib * a = a_new(&at_otherfaction); + a->data.v = (void*)f; + return a; } void init_otherfaction(void) { - at_register(&at_otherfaction); + at_register(&at_otherfaction); } faction * visible_faction(const faction *f, const unit * u) { - if (!alliedunit(u, f, HELP_FSTEALTH)) { - attrib *a = a_find(u->attribs, &at_otherfaction); - if (a) { - faction *fv = get_otherfaction(a); - assert (fv != NULL); /* fv should never be NULL! */ - return fv; - } - } - return u->faction; + if (!alliedunit(u, f, HELP_FSTEALTH)) { + attrib *a = a_find(u->attribs, &at_otherfaction); + if (a) { + faction *fv = get_otherfaction(a); + assert (fv != NULL); /* fv should never be NULL! */ + return fv; + } + } + return u->faction; }