Break long lines more tastefully

This commit is contained in:
Markus Armbruster 2010-05-18 22:19:34 +02:00
parent 373651359e
commit 7465574195
28 changed files with 69 additions and 92 deletions

View file

@ -72,8 +72,7 @@ delete_old_announcements(void)
}
sprintf(tmp_filename, "%s.tmp", annfil);
if ((tmpfp = fopen(tmp_filename, "wb")) == NULL) {
logerror("can't open telegram file %s for writing",
tmp_filename);
logerror("can't open telegram file %s for writing", tmp_filename);
if (fclose(annfp) != 0)
logerror("can't close telegram file %s", annfil);
return;
@ -85,8 +84,7 @@ delete_old_announcements(void)
copy_file = 0;
}
if (fclose(tmpfp) != 0) {
logerror("can't close temporary telegram file %s",
tmp_filename);
logerror("can't close temporary telegram file %s", tmp_filename);
copy_file = 0;
}
#if defined(_WIN32)

View file

@ -213,8 +213,7 @@ starve_some(short *vec, i_type whom, int num)
* Truncate any extra people that may be around
*/
static void
trunc_people(struct sctstr *sp, struct natstr *np,
short *vec)
trunc_people(struct sctstr *sp, struct natstr *np, short *vec)
{
int maxpop = max_pop(np->nat_level[NAT_RLEV], sp);

View file

@ -144,8 +144,7 @@ infect_people(struct natstr *np, struct sctstr *sp)
*/
int
plague_people(struct natstr *np, short *vec,
int *pstage, int *ptime,
int etus)
int *pstage, int *ptime, int etus)
{
int stage;
double plg_num;

View file

@ -399,8 +399,7 @@ domove:
if (sp->sct_own == target)
wu(0, target, " body count: troops: %d, rebels: %d\n", mc, cc);
else
wu(0, target,
" rebels murder %d military\n", mc);
wu(0, target, " rebels murder %d military\n", mc);
nreport(actor, N_FREEDOM_FIGHT, victim, 1);
}
if (sp->sct_own != victim)

View file

@ -78,8 +78,7 @@ upd_buildeff(struct natstr *np, struct sctstr *sp, int *workp,
}
neweff = n;
*cost += work_cost;
if (!n && IS_BIG_CITY(old_type) &&
!IS_BIG_CITY(*desig)) {
if (!n && IS_BIG_CITY(old_type) && !IS_BIG_CITY(*desig)) {
// FIXME use trunc_people() and total_work()
int maxpop = max_population(np->nat_level[NAT_RLEV], *desig, n);
if (vec[I_CIVIL] > maxpop)
@ -154,8 +153,8 @@ enlist(short *vec, int etu, int *cost)
/* Fallout is calculated here. */
static void
meltitems(int etus, int fallout, int own, short *vec, int type, int x, int y,
int uid)
meltitems(int etus, int fallout, int own, short *vec,
int type, int x, int y, int uid)
{
i_type n;
int melt;
@ -200,15 +199,15 @@ do_fallout(struct sctstr *sp, int etus)
return;
if (etus > 24)
etus = 24;
meltitems(etus, sp->sct_fallout, sp->sct_own, sp->sct_item, EF_SECTOR,
sp->sct_x, sp->sct_y, 0);
meltitems(etus, sp->sct_fallout, sp->sct_own, sp->sct_item,
EF_SECTOR, sp->sct_x, sp->sct_y, 0);
for (i = 0; NULL != (lp = getlandp(i)); i++) {
if (!lp->lnd_own)
continue;
if (lp->lnd_x != sp->sct_x || lp->lnd_y != sp->sct_y)
continue;
meltitems(etus, sp->sct_fallout, lp->lnd_own, lp->lnd_item, EF_LAND,
lp->lnd_x, lp->lnd_y, lp->lnd_uid);
meltitems(etus, sp->sct_fallout, lp->lnd_own, lp->lnd_item,
EF_LAND, lp->lnd_x, lp->lnd_y, lp->lnd_uid);
}
for (i = 0; NULL != (spp = getshipp(i)); i++) {
if (!spp->shp_own)
@ -217,8 +216,8 @@ do_fallout(struct sctstr *sp, int etus)
continue;
if (mchr[(int)spp->shp_type].m_flags & M_SUB)
continue;
meltitems(etus, sp->sct_fallout, spp->shp_own, spp->shp_item, EF_SHIP,
spp->shp_x, spp->shp_y, spp->shp_uid);
meltitems(etus, sp->sct_fallout, spp->shp_own, spp->shp_item,
EF_SHIP, spp->shp_x, spp->shp_y, spp->shp_uid);
}
}