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

@ -180,7 +180,8 @@ extern void putcontact(struct natstr *np, natid them, int contact);
extern void agecontact(struct natstr *np); extern void agecontact(struct natstr *np);
extern int influx(struct natstr *np); extern int influx(struct natstr *np);
extern struct natstr *nat_reset(struct natstr *, enum nat_status, coord, coord); extern struct natstr *nat_reset(struct natstr *, enum nat_status,
coord, coord);
extern int check_nat_name(char *cname); extern int check_nat_name(char *cname);
extern int grant_btus(struct natstr *, int); extern int grant_btus(struct natstr *, int);

View file

@ -290,7 +290,8 @@ extern char *nstr_comp_val(char *, struct valstr *, int);
extern int nstr_exec(struct nscstr *, int, void *); extern int nstr_exec(struct nscstr *, int, void *);
/* src/lib/common/nstreval.c */ /* src/lib/common/nstreval.c */
extern struct valstr *nstr_mksymval(struct valstr *, struct castr *, int); extern struct valstr *nstr_mksymval(struct valstr *, struct castr *, int);
extern struct valstr *nstr_exec_val(struct valstr *, natid, void *, enum nsc_type); extern struct valstr *nstr_exec_val(struct valstr *, natid, void *,
enum nsc_type);
extern int nstr_promote(int); extern int nstr_promote(int);
extern char *symbol_by_value(int, struct symbol *); extern char *symbol_by_value(int, struct symbol *);
/* src/lib/global/nsc.c */ /* src/lib/global/nsc.c */

View file

@ -62,12 +62,10 @@ extern int display_mark(i_type, int);
extern int want_to_abandon(struct sctstr *, i_type, int, struct lndstr *); extern int want_to_abandon(struct sctstr *, i_type, int, struct lndstr *);
extern int would_abandon(struct sctstr *, i_type, int, struct lndstr *); extern int would_abandon(struct sctstr *, i_type, int, struct lndstr *);
extern int nav_map(int, int, int); extern int nav_map(int, int, int);
extern int do_unit_move(struct emp_qelem *land_list, int *together, extern int do_unit_move(struct emp_qelem *, int *, double *, double *);
double *minmob, double *maxmob);
extern int count_pop(int); extern int count_pop(int);
extern int scuttle_tradeship(struct shpstr *, int); extern int scuttle_tradeship(struct shpstr *, int);
extern void resnoise(struct sctstr *sptr, int public_amt, char *name, extern void resnoise(struct sctstr *, int, char *, int, int);
int old, int new);
extern int line_of_sight(char **rad, int ax, int ay, int bx, int by); extern int line_of_sight(char **rad, int ax, int ay, int bx, int by);
extern void plane_sona(struct emp_qelem *, int, int, struct shiplist **); extern void plane_sona(struct emp_qelem *, int, int, struct shiplist **);
extern char *prsub(struct shpstr *); extern char *prsub(struct shpstr *);
@ -657,8 +655,7 @@ extern double shp_mobcost(struct shpstr *);
extern void shp_set_tech(struct shpstr *, int); extern void shp_set_tech(struct shpstr *, int);
/* snxtitem.c */ /* snxtitem.c */
extern int snxtitem(struct nstr_item *, int, char *, char *); extern int snxtitem(struct nstr_item *, int, char *, char *);
extern void snxtitem_area(struct nstr_item *, int, extern void snxtitem_area(struct nstr_item *, int, struct range *);
struct range *);
extern void snxtitem_dist(struct nstr_item *, int, int, int, int); extern void snxtitem_dist(struct nstr_item *, int, int, int, int);
extern void snxtitem_xy(struct nstr_item *, int, coord, coord); extern void snxtitem_xy(struct nstr_item *, int, coord, coord);
extern void snxtitem_all(struct nstr_item *, int); extern void snxtitem_all(struct nstr_item *, int);
@ -740,8 +737,7 @@ extern void prod_nat(int);
/* nav_ship.c */ /* nav_ship.c */
extern int nav_ship(struct shpstr *); extern int nav_ship(struct shpstr *);
/* nav_util.c */ /* nav_util.c */
extern int load_it(struct shpstr *, struct sctstr *, extern int load_it(struct shpstr *, struct sctstr *, int);
int);
extern void unload_it(struct shpstr *); extern void unload_it(struct shpstr *);
/* nxtitemp.c */ /* nxtitemp.c */
extern void *nxtitemp(struct nstr_item *); extern void *nxtitemp(struct nstr_item *);

View file

@ -183,7 +183,8 @@ sysdep_stdin_init(void)
* which individual events are active. * which individual events are active.
*/ */
static int static int
w32_select(int nfds, fd_set *rdfd, fd_set *wrfd, fd_set *errfd, struct timeval* time) w32_select(int nfds, fd_set *rdfd, fd_set *wrfd, fd_set *errfd,
struct timeval *time)
{ {
HANDLE handles[3]; HANDLE handles[3];
SOCKET sock; SOCKET sock;

View file

@ -129,8 +129,7 @@ info(void)
pr(".\n"); pr(".\n");
return RET_FAIL; return RET_FAIL;
} }
snprintf(filename, sizeof(filename), "%s/%s", infodir, snprintf(filename, sizeof(filename), "%s/%s", infodir, last);
last);
fp = fopen(filename, "r"); fp = fopen(filename, "r");
if (fp == NULL) { if (fp == NULL) {
pr("Error reading info file for %s\n", name); pr("Error reading info file for %s\n", name);
@ -210,8 +209,7 @@ apro(void)
while ((dp = readdir(info_dp))) { while ((dp = readdir(info_dp))) {
if (dp->d_name[0] == '.') if (dp->d_name[0] == '.')
continue; continue;
snprintf(filename, sizeof(filename), "%s/%s", infodir, snprintf(filename, sizeof(filename), "%s/%s", infodir, dp->d_name);
dp->d_name);
fp = fopen(filename, "r"); fp = fopen(filename, "r");
alreadyhit = 0; alreadyhit = 0;
nll = nlhl = 0; nll = nlhl = 0;
@ -357,8 +355,7 @@ info(void)
pr(".\n"); pr(".\n");
return RET_FAIL; return RET_FAIL;
} }
snprintf(filename, sizeof(filename), "%s/%s", snprintf(filename, sizeof(filename), "%s/%s", infodir, last);
infodir, last);
fp = fopen(filename, "rb"); fp = fopen(filename, "rb");
if (fp == NULL) { if (fp == NULL) {
pr("Error reading info file for %s\n", name); pr("Error reading info file for %s\n", name);

View file

@ -201,8 +201,7 @@ launch_missile(struct plnstr *pp)
return RET_FAIL; return RET_FAIL;
} }
n = atoi(cp); n = atoi(cp);
if ((n < 0) || !getship(n, &target_ship) || if ((n < 0) || !getship(n, &target_ship) || !target_ship.shp_own) {
!target_ship.shp_own) {
pr("Bad ship number!\n"); pr("Bad ship number!\n");
return RET_FAIL; return RET_FAIL;
} }

View file

@ -106,8 +106,7 @@ ltend(void)
continue; continue;
ontarget = target.lnd_item[ip->i_uid]; ontarget = target.lnd_item[ip->i_uid];
if (ontarget == 0 && amt < 0) { if (ontarget == 0 && amt < 0) {
pr("No %s on %s\n", pr("No %s on %s\n", ip->i_name, prland(&target));
ip->i_name, prland(&target));
continue; continue;
} }
lbase = &lchr[(int)target.lnd_type]; lbase = &lchr[(int)target.lnd_type];

View file

@ -75,8 +75,7 @@ nati(void)
pr("%d%% eff %s at %s has %d civilian%s & %d military\n", pr("%d%% eff %s at %s has %d civilian%s & %d military\n",
sect.sct_effic, sect.sct_effic,
sect.sct_type == SCT_CAPIT ? "capital" : "mountain capital", sect.sct_type == SCT_CAPIT ? "capital" : "mountain capital",
xyas(sect.sct_x, sect.sct_y, cnum), civ, splur(civ), xyas(sect.sct_x, sect.sct_y, cnum), civ, splur(civ), mil);
mil);
} }
} }
pr(" The treasury has $%.2f", (double)natp->nat_money); pr(" The treasury has $%.2f", (double)natp->nat_money);

View file

@ -108,8 +108,7 @@ do_unit_move(struct emp_qelem *ulist, int *together,
else else
lnd_mar(ulist, minmob, maxmob, together, player->cnum); lnd_mar(ulist, minmob, maxmob, together, player->cnum);
if (QEMPTY(ulist)) { if (QEMPTY(ulist)) {
pr("No %s left\n", pr("No %s left\n", type == EF_SHIP ? "ships" : "lands");
type == EF_SHIP ? "ships" : "lands");
if (type == EF_SHIP && strlen(pathtaken) > 1) { if (type == EF_SHIP && strlen(pathtaken) > 1) {
pathtaken[strlen(pathtaken) - 1] = '\0'; pathtaken[strlen(pathtaken) - 1] = '\0';
pr("Path taken: %s\n", pathtaken); pr("Path taken: %s\n", pathtaken);
@ -140,8 +139,7 @@ do_unit_move(struct emp_qelem *ulist, int *together,
else else
lnd_mar(ulist, minmob, maxmob, together, player->cnum); lnd_mar(ulist, minmob, maxmob, together, player->cnum);
if (QEMPTY(ulist)) { if (QEMPTY(ulist)) {
pr("No %s left\n", pr("No %s left\n", type == EF_SHIP ? "ships" : "lands");
type == EF_SHIP ? "ships" : "lands");
if (type == EF_SHIP && strlen(pathtaken) > 1) { if (type == EF_SHIP && strlen(pathtaken) > 1) {
pathtaken[strlen(pathtaken) - 1] = '\0'; pathtaken[strlen(pathtaken) - 1] = '\0';
pr("Path taken: %s\n", pathtaken); pr("Path taken: %s\n", pathtaken);

View file

@ -198,8 +198,7 @@ orde(void)
i1 = whatitem(player->argp[5], "Commodity? "); i1 = whatitem(player->argp[5], "Commodity? ");
if (!i1) if (!i1)
return RET_FAIL; return RET_FAIL;
p1 = getstarg(player->argp[6], "Amount? ", p1 = getstarg(player->argp[6], "Amount? ", buf);
buf);
if (!p1) if (!p1)
return RET_SYN; return RET_SYN;
if (!check_ship_ok(&ship)) if (!check_ship_ok(&ship))
@ -218,8 +217,7 @@ orde(void)
i1 = whatitem(player->argp[5], "Commodity? "); i1 = whatitem(player->argp[5], "Commodity? ");
if (!i1) if (!i1)
return RET_FAIL; return RET_FAIL;
p1 = getstarg(player->argp[6], "Amount? ", p1 = getstarg(player->argp[6], "Amount? ", buf);
buf);
if (!p1) if (!p1)
return RET_SYN; return RET_SYN;
if (!check_ship_ok(&ship)) if (!check_ship_ok(&ship))

View file

@ -121,8 +121,7 @@ radar(int type)
tech = WORLD_Y / 2.0; tech = WORLD_Y / 2.0;
if (tech > WORLD_X / 4.0) if (tech > WORLD_X / 4.0)
tech = WORLD_X / 4.0; tech = WORLD_X / 4.0;
radmap(item.gen.x, item.gen.y, item.gen.effic, radmap(item.gen.x, item.gen.y, item.gen.effic, (int)tech, tf);
(int)tech, tf);
} }
break; break;
default: default:

View file

@ -61,8 +61,7 @@ upda(void)
pr("The current time is %19.19s.\n\n", ctime(&now)); pr("The current time is %19.19s.\n\n", ctime(&now));
if (next && update_window) { if (next && update_window) {
pr("The next update window starts at %19.19s.\n", pr("The next update window starts at %19.19s.\n", ctime(&next));
ctime(&next));
stop = next + update_window; stop = next + update_window;
pr("The next update window stops at %19.19s.\n", ctime(&stop)); pr("The next update window stops at %19.19s.\n", ctime(&stop));
} }
@ -74,8 +73,7 @@ upda(void)
case UPD_DEMAND_SCHED: case UPD_DEMAND_SCHED:
pr("Demand updates occur at update CHECK times.\n"); pr("Demand updates occur at update CHECK times.\n");
if (next) { if (next) {
pr("The next update check is at %19.19s.\n", pr("The next update check is at %19.19s.\n", ctime(&next));
ctime(&next));
} }
pr("Demand updates require %d country(s) to want one.\n", pr("Demand updates require %d country(s) to want one.\n",
update_wantmin); update_wantmin);

View file

@ -146,8 +146,7 @@ lupgr(void)
if (land.lnd_own != player->cnum) if (land.lnd_own != player->cnum)
wu(0, land.lnd_own, wu(0, land.lnd_own,
"%s upgraded by %s to tech %d, at a cost of %d\n", "%s upgraded by %s to tech %d, at a cost of %d\n",
prland(&land), cname(player->cnum), land.lnd_tech, prland(&land), cname(player->cnum), land.lnd_tech, cost);
cost);
} }
if (n == 0) { if (n == 0) {
pr("No land units\n"); pr("No land units\n");
@ -228,8 +227,7 @@ supgr(void)
if (ship.shp_own != player->cnum) if (ship.shp_own != player->cnum)
wu(0, ship.shp_own, wu(0, ship.shp_own,
"%s upgraded by %s to tech %d, at a cost of %d\n", "%s upgraded by %s to tech %d, at a cost of %d\n",
prship(&ship), cname(player->cnum), ship.shp_tech, prship(&ship), cname(player->cnum), ship.shp_tech, cost);
cost);
} }
if (n == 0) { if (n == 0) {
pr("No ships\n"); pr("No ships\n");
@ -317,8 +315,7 @@ pupgr(void)
if (plane.pln_own != player->cnum) if (plane.pln_own != player->cnum)
wu(0, plane.pln_own, wu(0, plane.pln_own,
"%s upgraded by %s to tech %d, at a cost of %d\n", "%s upgraded by %s to tech %d, at a cost of %d\n",
prplane(&plane), cname(player->cnum), plane.pln_tech, prplane(&plane), cname(player->cnum), plane.pln_tech, cost);
cost);
} }
if (n == 0) { if (n == 0) {
pr("No planes.\n"); pr("No planes.\n");

View file

@ -69,8 +69,7 @@ read_builtin_tables(void)
lineno = 1; lineno = 1;
res = xundump(fp, ep->file, &lineno, ep->uid); res = xundump(fp, ep->file, &lineno, ep->uid);
if (res >= 0 && getc(fp) != EOF) { if (res >= 0 && getc(fp) != EOF) {
fprintf(stderr, "%s: Junk after the table\n", fprintf(stderr, "%s: Junk after the table\n", ep->file);
ep->file);
res = EF_BAD; res = EF_BAD;
} }
fclose(fp); fclose(fp);

View file

@ -93,8 +93,7 @@ bp_init(void)
* string in path. Return 0 on success, -1 on error. * string in path. Return 0 on success, -1 on error.
*/ */
static int static int
best_path(struct sctstr *from, struct sctstr *to, char *path, best_path(struct sctstr *from, struct sctstr *to, char *path, int mob_type)
int mob_type)
{ {
static struct bestp *mybestpath; static struct bestp *mybestpath;
struct as_data *adp; struct as_data *adp;

View file

@ -340,7 +340,6 @@ delete_update(time_t t, time_t sched[], int n)
{ {
int i = find_update(t, sched); int i = find_update(t, sched);
if (t == sched[i]) if (t == sched[i])
memmove(sched + i, sched + i + 1, memmove(sched + i, sched + i + 1, (n - 1 - i) * sizeof(*sched));
(n - 1 - i) * sizeof(*sched));
return i; return i;
} }

View file

@ -69,7 +69,7 @@ static int board_abort(struct combat *off, struct combat *def);
static int land_board_abort(struct combat *off, struct combat *def); static int land_board_abort(struct combat *off, struct combat *def);
static int ask_off(int combat_mode, struct combat *off, static int ask_off(int combat_mode, struct combat *off,
struct combat *def); struct combat *def);
static void get_dlist(struct combat *def, struct emp_qelem *list, int a_spy, static void get_dlist(struct combat *def, struct emp_qelem *, int a_spy,
int *d_spyp); int *d_spyp);
static int get_ototal(int combat_mode, struct combat *off, static int get_ototal(int combat_mode, struct combat *off,
struct emp_qelem *olist, double osupport, int check); struct emp_qelem *olist, double osupport, int check);
@ -136,8 +136,7 @@ pr_com(int inon, struct combat *com, natid who)
} else if (com->type == EF_SHIP) { } else if (com->type == EF_SHIP) {
return prbuf("%s%s %s(#%d)", return prbuf("%s%s %s(#%d)",
inon ? inon == 1 ? "on " : "onto " : "", inon ? inon == 1 ? "on " : "onto " : "",
com->shp_mcp->m_name, com->shp_name, com->shp_mcp->m_name, com->shp_name, com->shp_uid);
com->shp_uid);
} else if (com->type == EF_LAND) { } else if (com->type == EF_LAND) {
return prbuf("%s%s #%d", return prbuf("%s%s #%d",
inon ? inon == 1 ? "on " : "onto " : "", inon ? inon == 1 ? "on " : "onto " : "",
@ -217,8 +216,7 @@ att_get_combat(struct combat *com, int isdef)
return att_combat_init(com, EF_BAD); return att_combat_init(com, EF_BAD);
} }
if (opt_MARKET) { if (opt_MARKET) {
if (isdef && player->owner && if (isdef && player->owner && ontradingblock(EF_SHIP, &ship)) {
ontradingblock(EF_SHIP, &ship)) {
pr("%s is on the trading block.\n", prcom(0, com)); pr("%s is on the trading block.\n", prcom(0, com));
return att_combat_init(com, EF_BAD); return att_combat_init(com, EF_BAD);
} }
@ -287,7 +285,8 @@ att_get_combat(struct combat *com, int isdef)
mil); mil);
com->troops = mil; com->troops = mil;
} else { /* attacker */ } else { /* attacker */
if (owner != player->cnum && getrel(getnatp(owner), player->cnum) != ALLIED) { if (owner != player->cnum
&& getrel(getnatp(owner), player->cnum) != ALLIED) {
/* must be EF_SECTOR */ /* must be EF_SECTOR */
if (com->mil) if (com->mil)
pr("WARNING: Your %d mil in %s were destroyed because %s just took the sector!\n", pr("WARNING: Your %d mil in %s were destroyed because %s just took the sector!\n",
@ -682,7 +681,9 @@ att_show(struct combat *def)
if (!trechk(player->cnum, def->own, LNDATT)) if (!trechk(player->cnum, def->own, LNDATT))
return abort_attack(); return abort_attack();
} }
pr("%s is about %d%% efficient and has approximately %d mil on board.\n", prcom(0, def), roundintby((int)def->eff, 10), roundintby(def->troops, 10)); pr("%s is about %d%% efficient and has approximately %d mil on board.\n",
prcom(0, def), roundintby((int)def->eff, 10),
roundintby(def->troops, 10));
} }
/* Ok, everything is fine */ /* Ok, everything is fine */
return 0; return 0;
@ -2486,7 +2487,10 @@ ask_move_in_off(struct combat *off, struct combat *def)
left = commdamage(num_mil, dam, I_MILIT); left = commdamage(num_mil, dam, I_MILIT);
if (left < num_mil) { if (left < num_mil) {
if (left) { if (left) {
pr("%d of the mil you were moving were destroyed!\nOnly %d mil made it to %s\n", num_mil - left, left, xyas(def->x, def->y, player->cnum)); pr("%d of the mil you were moving were destroyed!\n"
"Only %d mil made it to %s\n",
num_mil - left, left,
xyas(def->x, def->y, player->cnum));
} else { } else {
pr("All of the mil you were moving were destroyed!\n"); pr("All of the mil you were moving were destroyed!\n");
} }

View file

@ -90,8 +90,7 @@ sct_prewrite(int id, void *old, void *new)
} }
if (prev_own != own) if (prev_own != own)
lost_and_found(EF_SECTOR, prev_own, own, lost_and_found(EF_SECTOR, prev_own, own, 0, sp->sct_x, sp->sct_y);
0, sp->sct_x, sp->sct_y);
} }
void void

View file

@ -147,8 +147,7 @@ snxtitem_area(struct nstr_item *np, int type, struct range *range)
} }
void void
snxtitem_dist(struct nstr_item *np, int type, int cx, int cy, snxtitem_dist(struct nstr_item *np, int type, int cx, int cy, int dist)
int dist)
{ {
memset(np, 0, sizeof(*np)); memset(np, 0, sizeof(*np));
xydist_range(cx, cy, dist, &np->range); xydist_range(cx, cy, dist, &np->range);

View file

@ -72,8 +72,7 @@ delete_old_announcements(void)
} }
sprintf(tmp_filename, "%s.tmp", annfil); sprintf(tmp_filename, "%s.tmp", annfil);
if ((tmpfp = fopen(tmp_filename, "wb")) == NULL) { if ((tmpfp = fopen(tmp_filename, "wb")) == NULL) {
logerror("can't open telegram file %s for writing", logerror("can't open telegram file %s for writing", tmp_filename);
tmp_filename);
if (fclose(annfp) != 0) if (fclose(annfp) != 0)
logerror("can't close telegram file %s", annfil); logerror("can't close telegram file %s", annfil);
return; return;
@ -85,8 +84,7 @@ delete_old_announcements(void)
copy_file = 0; copy_file = 0;
} }
if (fclose(tmpfp) != 0) { if (fclose(tmpfp) != 0) {
logerror("can't close temporary telegram file %s", logerror("can't close temporary telegram file %s", tmp_filename);
tmp_filename);
copy_file = 0; copy_file = 0;
} }
#if defined(_WIN32) #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 * Truncate any extra people that may be around
*/ */
static void static void
trunc_people(struct sctstr *sp, struct natstr *np, trunc_people(struct sctstr *sp, struct natstr *np, short *vec)
short *vec)
{ {
int maxpop = max_pop(np->nat_level[NAT_RLEV], sp); 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 int
plague_people(struct natstr *np, short *vec, plague_people(struct natstr *np, short *vec,
int *pstage, int *ptime, int *pstage, int *ptime, int etus)
int etus)
{ {
int stage; int stage;
double plg_num; double plg_num;

View file

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

View file

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

View file

@ -44,8 +44,9 @@ install_service(char *program_name, char *service_name, char *config_file)
SERVICE_DESCRIPTION sdBuf; SERVICE_DESCRIPTION sdBuf;
if (config_file != NULL) if (config_file != NULL)
snprintf(&program_name[strlen(program_name)], _MAX_PATH-strlen(program_name), " -e %s", snprintf(&program_name[strlen(program_name)],
config_file); _MAX_PATH - strlen(program_name),
" -e %s", config_file);
if (service_name == NULL) if (service_name == NULL)
service_name = DEFAULT_SERVICE_NAME; service_name = DEFAULT_SERVICE_NAME;

View file

@ -203,20 +203,19 @@ main(int argc, char **argv)
/* silently ignore operands for backward compatibility */ /* silently ignore operands for backward compatibility */
#if defined(_WIN32) #if defined(_WIN32)
if ((!daemonize || flags || config_file != NULL) && if ((!daemonize || flags || config_file != NULL)
remove_service_set) { && remove_service_set) {
fprintf(stderr, "Can't use -p, -s, -d or -e with either " fprintf(stderr, "Can't use -p, -s, -d or -e with either "
"-u or -U options\n"); "-u or -U options\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if ((!daemonize || flags) && install_service_set) { if ((!daemonize || flags) && install_service_set) {
fprintf(stderr, "Can't use -d, -p or -s with either " fprintf(stderr,
"-i or -I options\n"); "Can't use -d, -p or -s with either -i or -I options\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (install_service_set && remove_service_set) { if (install_service_set && remove_service_set) {
fprintf(stderr, "Can't use both -u or -U and -i or -I " fprintf(stderr, "Can't use both -u or -U and -i or -I options\n");
"options\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View file

@ -85,8 +85,7 @@ update_init(void)
stacksize = 100000 + stacksize = 100000 +
/* finish_sects */ WORLD_X * WORLD_Y * (2 * sizeof(double) + /* finish_sects */ WORLD_X * WORLD_Y * (2 * sizeof(double) +
sizeof(char *)); sizeof(char *));
update_thread = empth_create(update_sched, stacksize, 0, update_thread = empth_create(update_sched, stacksize, 0, "Update", dp);
"Update", dp);
if (!update_thread) if (!update_thread)
exit_nomem(); exit_nomem();
} }

View file

@ -1123,7 +1123,9 @@ output(void)
} }
} }
if (AIRPORT_MARKER) if (AIRPORT_MARKER)
printf("\n\nEach continent is marked by a \"*\" on the map (to distinguish them from\nthe islands). You can redesignate these airfields to wilderness sectors\none at a time, each time you add a new country to the game.\n"); printf("\n\nEach continent is marked by a \"*\" on the map (to distinguish them from\n"
"the islands). You can redesignate these airfields to wilderness sectors\n"
"one at a time, each time you add a new country to the game.\n");
} }
static int static int