forked from github/server
fix indentation
This commit is contained in:
parent
6fa471bb97
commit
de1e0ae916
|
@ -161,15 +161,15 @@ size_t report_status(const unit * u, const struct locale *lang, char *fsbuf, siz
|
||||||
const char *lname = locale_name(lang);
|
const char *lname = locale_name(lang);
|
||||||
struct locale *wloc = get_locale(lname);
|
struct locale *wloc = get_locale(lname);
|
||||||
log_warning("no translation for combat status %s in %s", combatstatus[u->status], lname);
|
log_warning("no translation for combat status %s in %s", combatstatus[u->status], lname);
|
||||||
locale_setstring(wloc, combatstatus[u->status], combatstatus[u->status]+7);
|
locale_setstring(wloc, combatstatus[u->status], combatstatus[u->status] + 7);
|
||||||
len = strlcpy(fsbuf, combatstatus[u->status]+7, buflen);
|
len = strlcpy(fsbuf, combatstatus[u->status] + 7, buflen);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
len = strlcpy(fsbuf, status, buflen);
|
len = strlcpy(fsbuf, status, buflen);
|
||||||
}
|
}
|
||||||
if (fval(u, UFL_NOAID)) {
|
if (fval(u, UFL_NOAID)) {
|
||||||
len += strlcat(fsbuf+len, ", ", buflen-len);
|
len += strlcat(fsbuf + len, ", ", buflen - len);
|
||||||
len += strlcat(fsbuf+len, LOC(lang, "status_noaid"), buflen-len);
|
len += strlcat(fsbuf + len, LOC(lang, "status_noaid"), buflen - len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
|
@ -201,7 +201,7 @@ const char *hp_status(const unit * u)
|
||||||
|
|
||||||
void
|
void
|
||||||
report_item(const unit * owner, const item * i, const faction * viewer,
|
report_item(const unit * owner, const item * i, const faction * viewer,
|
||||||
const char **name, const char **basename, int *number, bool singular)
|
const char **name, const char **basename, int *number, bool singular)
|
||||||
{
|
{
|
||||||
const resource_type *rsilver = get_resourcetype(R_SILVER);
|
const resource_type *rsilver = get_resourcetype(R_SILVER);
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ static size_t buforder(char *buffer, size_t size, const order * ord, int mode)
|
||||||
WARN_STATIC_BUFFER();
|
WARN_STATIC_BUFFER();
|
||||||
}
|
}
|
||||||
|
|
||||||
return bufp-buffer;
|
return bufp - buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** create a report of a list of items to a non-owner.
|
/** create a report of a list of items to a non-owner.
|
||||||
|
@ -381,7 +381,7 @@ void report_race(const struct unit *u, const char **name, const char **illusion)
|
||||||
|
|
||||||
void
|
void
|
||||||
report_building(const struct building *b, const char **name,
|
report_building(const struct building *b, const char **name,
|
||||||
const char **illusion)
|
const char **illusion)
|
||||||
{
|
{
|
||||||
if (name) {
|
if (name) {
|
||||||
*name = buildingtype(b->type, b, b->size);
|
*name = buildingtype(b->type, b, b->size);
|
||||||
|
@ -400,7 +400,7 @@ const char **illusion)
|
||||||
|
|
||||||
int
|
int
|
||||||
report_resources(const region * r, resource_report * result, int size,
|
report_resources(const region * r, resource_report * result, int size,
|
||||||
const faction * viewer, bool see_unit)
|
const faction * viewer, bool see_unit)
|
||||||
{
|
{
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
|
@ -487,7 +487,7 @@ const faction * viewer, bool see_unit)
|
||||||
|
|
||||||
int
|
int
|
||||||
bufunit(const faction * f, const unit * u, unsigned int indent, seen_mode mode, char *buf,
|
bufunit(const faction * f, const unit * u, unsigned int indent, seen_mode mode, char *buf,
|
||||||
size_t size)
|
size_t size)
|
||||||
{
|
{
|
||||||
int i, dh;
|
int i, dh;
|
||||||
int getarnt = fval(u, UFL_ANON_FACTION);
|
int getarnt = fval(u, UFL_ANON_FACTION);
|
||||||
|
@ -626,7 +626,7 @@ size_t size)
|
||||||
skill *sv;
|
skill *sv;
|
||||||
for (sv = u->skills; sv != u->skills + u->skill_size; ++sv) {
|
for (sv = u->skills; sv != u->skills + u->skill_size; ++sv) {
|
||||||
size_t bytes = spskill(bufp, size, f->locale, u, sv, &dh, 1);
|
size_t bytes = spskill(bufp, size, f->locale, u, sv, &dh, 1);
|
||||||
assert(bytes <=INT_MAX);
|
assert(bytes <= INT_MAX);
|
||||||
if (wrptr(&bufp, &size, (int)bytes) != 0)
|
if (wrptr(&bufp, &size, (int)bytes) != 0)
|
||||||
WARN_STATIC_BUFFER();
|
WARN_STATIC_BUFFER();
|
||||||
}
|
}
|
||||||
|
@ -796,7 +796,7 @@ size_t size)
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
spskill(char *buffer, size_t size, const struct locale * lang,
|
spskill(char *buffer, size_t size, const struct locale * lang,
|
||||||
const struct unit * u, struct skill * sv, int *dh, int days)
|
const struct unit * u, struct skill * sv, int *dh, int days)
|
||||||
{
|
{
|
||||||
char *bufp = buffer;
|
char *bufp = buffer;
|
||||||
int i, effsk;
|
int i, effsk;
|
||||||
|
@ -856,7 +856,7 @@ const struct unit * u, struct skill * sv, int *dh, int days)
|
||||||
WARN_STATIC_BUFFER();
|
WARN_STATIC_BUFFER();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return bufp-buffer;
|
return bufp - buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void split_paragraph(strlist ** SP, const char *s, unsigned int indent, unsigned int width, char mark)
|
void split_paragraph(strlist ** SP, const char *s, unsigned int indent, unsigned int width, char mark)
|
||||||
|
@ -927,7 +927,7 @@ void lparagraph(struct strlist **SP, char *s, unsigned int indent, char mark)
|
||||||
|
|
||||||
void
|
void
|
||||||
spunit(struct strlist **SP, const struct faction *f, const unit * u, unsigned int indent,
|
spunit(struct strlist **SP, const struct faction *f, const unit * u, unsigned int indent,
|
||||||
seen_mode mode)
|
seen_mode mode)
|
||||||
{
|
{
|
||||||
char buf[DISPLAYSIZE];
|
char buf[DISPLAYSIZE];
|
||||||
int dh = bufunit(f, u, indent, mode, buf, sizeof(buf));
|
int dh = bufunit(f, u, indent, mode, buf, sizeof(buf));
|
||||||
|
@ -1013,7 +1013,7 @@ static void cb_add_address(region *r, unit *ut, void *cbdata) {
|
||||||
address_data *data = (address_data *)cbdata;
|
address_data *data = (address_data *)cbdata;
|
||||||
faction *f = data->f;
|
faction *f = data->f;
|
||||||
|
|
||||||
if (ut->faction==f) {
|
if (ut->faction == f) {
|
||||||
unit *u;
|
unit *u;
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
faction *sf = visible_faction(f, u);
|
faction *sf = visible_faction(f, u);
|
||||||
|
@ -1141,7 +1141,7 @@ int get_regions_distance_arr(region *rc, int radius, region *result[], int size)
|
||||||
{
|
{
|
||||||
int n = 0, i;
|
int n = 0, i;
|
||||||
|
|
||||||
if (size>n) {
|
if (size > n) {
|
||||||
result[n++] = rc;
|
result[n++] = rc;
|
||||||
fset(rc, RF_MARK);
|
fset(rc, RF_MARK);
|
||||||
}
|
}
|
||||||
|
@ -1151,7 +1151,7 @@ int get_regions_distance_arr(region *rc, int radius, region *result[], int size)
|
||||||
|
|
||||||
r = result[i];
|
r = result[i];
|
||||||
dist = distance(rc, r);
|
dist = distance(rc, r);
|
||||||
if (dist<radius) {
|
if (dist < radius) {
|
||||||
region *adj[MAXDIRECTIONS];
|
region *adj[MAXDIRECTIONS];
|
||||||
int d;
|
int d;
|
||||||
|
|
||||||
|
@ -1223,10 +1223,10 @@ static void add_seen_nb(faction *f, region *r, seen_mode mode) {
|
||||||
get_neighbours(r, next);
|
get_neighbours(r, next);
|
||||||
for (d = 0; d != MAXDIRECTIONS; ++d) {
|
for (d = 0; d != MAXDIRECTIONS; ++d) {
|
||||||
region *rn = next[d];
|
region *rn = next[d];
|
||||||
if (rn && rn->seen.mode<seen_neighbour) {
|
if (rn && rn->seen.mode < seen_neighbour) {
|
||||||
rn->seen.mode = seen_neighbour;
|
rn->seen.mode = seen_neighbour;
|
||||||
if (first->index>rn->index) first = rn;
|
if (first->index > rn->index) first = rn;
|
||||||
if (last->index<rn->index) last = rn;
|
if (last->index < rn->index) last = rn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1390,7 +1390,7 @@ static region *firstregion(faction * f)
|
||||||
|
|
||||||
static void cb_add_seen(region *r, unit *u, void *cbdata) {
|
static void cb_add_seen(region *r, unit *u, void *cbdata) {
|
||||||
faction *f = (faction *)cbdata;
|
faction *f = (faction *)cbdata;
|
||||||
if (u->faction==f) {
|
if (u->faction == f) {
|
||||||
add_seen_nb(f, r, seen_travel);
|
add_seen_nb(f, r, seen_travel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1411,8 +1411,8 @@ void prepare_report(report_context *ctx, faction *f)
|
||||||
rule_region_owners = config_token("rules.region_owner_pay_building", bt_lighthouse->_name);
|
rule_region_owners = config_token("rules.region_owner_pay_building", bt_lighthouse->_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f->age<=2) {
|
if (f->age <= 2) {
|
||||||
if ((f->flags&FFL_PWMSG)==0) {
|
if ((f->flags&FFL_PWMSG) == 0) {
|
||||||
/* TODO: this assumes unencrypted passwords */
|
/* TODO: this assumes unencrypted passwords */
|
||||||
f->flags |= FFL_PWMSG;
|
f->flags |= FFL_PWMSG;
|
||||||
ADDMSG(&f->msgs, msg_message("changepasswd", "value", f->_password));
|
ADDMSG(&f->msgs, msg_message("changepasswd", "value", f->_password));
|
||||||
|
@ -1428,7 +1428,7 @@ void prepare_report(report_context *ctx, faction *f)
|
||||||
ctx->first = firstregion(f);
|
ctx->first = firstregion(f);
|
||||||
ctx->last = lastregion(f);
|
ctx->last = lastregion(f);
|
||||||
|
|
||||||
for (r = ctx->first; r!=ctx->last; r = r->next) {
|
for (r = ctx->first; r != ctx->last; r = r->next) {
|
||||||
unit *u;
|
unit *u;
|
||||||
building *b;
|
building *b;
|
||||||
int br = 0, c = 0, range = 0;
|
int br = 0, c = 0, range = 0;
|
||||||
|
@ -1702,7 +1702,7 @@ const char *trailinto(const region * r, const struct locale *lang)
|
||||||
size_t sz;
|
size_t sz;
|
||||||
|
|
||||||
sz = strlcpy(ref, tname, sizeof(ref));
|
sz = strlcpy(ref, tname, sizeof(ref));
|
||||||
sz += strlcat(ref+sz, "_trail", sizeof(ref)-sz);
|
sz += strlcat(ref + sz, "_trail", sizeof(ref) - sz);
|
||||||
s = LOC(lang, ref);
|
s = LOC(lang, ref);
|
||||||
if (s && *s) {
|
if (s && *s) {
|
||||||
if (strstr(s, "%s"))
|
if (strstr(s, "%s"))
|
||||||
|
|
Loading…
Reference in New Issue