Line breaks and other formatting issues. No functional changes.

This commit is contained in:
Markus Armbruster 2006-05-21 13:05:24 +00:00
parent 281840b604
commit 4c4fdca42b
37 changed files with 119 additions and 117 deletions

View file

@ -78,9 +78,11 @@ struct mob_acc_globals {
#define ATTRIBUTE(attrs) #define ATTRIBUTE(attrs)
#endif #endif
/* This uses a lot of thread stack with some versions of GNU libc, /*
which can lead to nasty heap smashes (observed with 2.2.93). * This uses a lot of thread stack with some versions of GNU libc,
Disabled for now, until we readjust thread stack sizes. */ * which can lead to nasty heap smashes (observed with 2.2.93).
* Disabled for now, until we readjust thread stack sizes.
*/
#if 0 #if 0
#define RESOLVE_IPADDRESS /* resolve ip addresses into hostnames */ #define RESOLVE_IPADDRESS /* resolve ip addresses into hostnames */
#endif #endif

View file

@ -602,11 +602,7 @@ extern int ufindpfx(char *, int);
/* radmap.c */ /* radmap.c */
extern int deltx(struct range *, coord); extern int deltx(struct range *, coord);
/* Prototype include a typedef name.
It should be moved after the typedef declaration */
extern int delty(struct range *, coord); extern int delty(struct range *, coord);
/* Prototype include a typedef name.
It should be moved after the typedef declaration */
extern void radmap(int, int, int, int, double); extern void radmap(int, int, int, int, double);
extern void radmapnopr(int, int, int, int, double); extern void radmapnopr(int, int, int, int, double);
extern void radmapupd(int, int, int, int, int, double); extern void radmapupd(int, int, int, int, int, double);

View file

@ -282,11 +282,12 @@ doexecute(char *p, FILE *auxfi)
/* copies 4k at a time to the socket */ /* copies 4k at a time to the socket */
while (termio(fd, sock, auxfi)) /*do copy */ while (termio(fd, sock, auxfi)) /*do copy */
; ;
/* Some platforms don't send the eof (cntl-D) at the end of /*
copying a file. If emp_client hangs at the end of an * Some platforms don't send the eof (cntl-D) at the end of
execute, include the following line and notify wolfpack * copying a file. If emp_client hangs at the end of an
of the platform you are using. * execute, include the following line and notify wolfpack
sendeof(sock); * of the platform you are using.
* sendeof(sock);
*/ */
close(fd); close(fd);
free(tag); free(tag);

View file

@ -32,7 +32,6 @@ static void as_free_queue(struct as_queue *queue);
void void
as_reset(struct as_data *adp) as_reset(struct as_data *adp)
{ {
as_free_queue(adp->head); as_free_queue(adp->head);
adp->head = NULL; adp->head = NULL;
as_free_queue(adp->tried); as_free_queue(adp->tried);

View file

@ -250,8 +250,8 @@ grab_sect(struct sctstr *sp, natid to)
if (lp->lnd_own != player->cnum) if (lp->lnd_own != player->cnum)
continue; continue;
wu(0, to, "\t%s ceded to you by %s\n", prland(lp), wu(0, to, "\t%s ceded to you by %s\n",
cname(player->cnum)); prland(lp), cname(player->cnum));
makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x, lp->lnd_y); makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x, lp->lnd_y);
makenotlost(EF_LAND, to, lp->lnd_uid, lp->lnd_x, lp->lnd_y); makenotlost(EF_LAND, to, lp->lnd_uid, lp->lnd_x, lp->lnd_y);
lp->lnd_own = to; lp->lnd_own = to;

View file

@ -96,7 +96,7 @@ do_conv(struct nstr_sect nstr, int uwtoconvert, int for_real)
/* /*
* Military units count according to the number of * Military units count according to the number of
* mil in them. (i.e. attack/defense modified don't * mil in them. (i.e. attack/defense modifier don't
* count. * count.
*/ */
snxtitem_xy(&ni, EF_LAND, sect.sct_x, sect.sct_y); snxtitem_xy(&ni, EF_LAND, sect.sct_x, sect.sct_y);

View file

@ -78,8 +78,8 @@ foll(void)
if (!player->owner) if (!player->owner)
continue; continue;
if (ship.shp_x != x || ship.shp_y != y) { if (ship.shp_x != x || ship.shp_y != y) {
pr("Ship #%d not in same sector as #%d\n", ship.shp_uid, pr("Ship #%d not in same sector as #%d\n",
leader); ship.shp_uid, leader);
continue; continue;
} }
if (ship.shp_uid == leader) { if (ship.shp_uid == leader) {

View file

@ -97,10 +97,12 @@ look(void)
civ = sect.sct_item[I_CIVIL]; civ = sect.sct_item[I_CIVIL];
mil = sect.sct_item[I_MILIT]; mil = sect.sct_item[I_MILIT];
if (civ) if (civ)
pr("with %s%d civ ", player->owner ? "" : "approx ", pr("with %s%d civ ",
player->owner ? "" : "approx ",
player->owner ? civ : roundintby(civ, 10)); player->owner ? civ : roundintby(civ, 10));
if (mil) if (mil)
pr("with %s%d mil ", player->owner ? "" : "approx ", pr("with %s%d mil ",
player->owner ? "" : "approx ",
player->owner ? mil : roundintby(mil, 10)); player->owner ? mil : roundintby(mil, 10));
pr("@ %s\n", xyas(x, y, player->cnum)); pr("@ %s\n", xyas(x, y, player->cnum));
if (opt_HIDDEN) { if (opt_HIDDEN) {

View file

@ -342,8 +342,8 @@ multifire(void)
continue; continue;
} }
if (fship.shp_effic < 60) { if (fship.shp_effic < 60) {
pr("Ship #%d is crippled (%d%%)\n", fshipno, pr("Ship #%d is crippled (%d%%)\n",
fship.shp_effic); fshipno, fship.shp_effic);
continue; continue;
} }
range = effrange(fship.shp_frnge, fship.shp_tech); range = effrange(fship.shp_frnge, fship.shp_tech);

View file

@ -170,8 +170,9 @@ move(void)
} }
amt_src = start.sct_item[vtype]; amt_src = start.sct_item[vtype];
if (amt_src < amount) { if (amt_src < amount) {
pr("Only %d %s left in %s!\n", amt_src, pr("Only %d %s left in %s!\n",
ip->i_name, xyas(start.sct_x, start.sct_y, player->cnum)); amt_src, ip->i_name,
xyas(start.sct_x, start.sct_y, player->cnum));
amount = amt_src; amount = amt_src;
amt_src = 0; amt_src = 0;
} else } else

View file

@ -451,14 +451,14 @@ sorde(void)
if (ship.shp_autonav & AN_AUTONAV) { if (ship.shp_autonav & AN_AUTONAV) {
/* Destination 1 */ /* Destination 1 */
prxy(" %3d,%-3d", ship.shp_destx[1], prxy(" %3d,%-3d",
ship.shp_desty[1], player->cnum); ship.shp_destx[1], ship.shp_desty[1], player->cnum);
/* Destination 2 */ /* Destination 2 */
if ((ship.shp_destx[1] != ship.shp_destx[0]) if ((ship.shp_destx[1] != ship.shp_destx[0])
|| (ship.shp_desty[1] != ship.shp_desty[0])) { || (ship.shp_desty[1] != ship.shp_desty[0])) {
prxy(" %3d,%-3d", ship.shp_destx[0], prxy(" %3d,%-3d",
ship.shp_desty[0], player->cnum); ship.shp_destx[0], ship.shp_desty[0], player->cnum);
} else } else
pr(" "); pr(" ");

View file

@ -62,8 +62,8 @@ range(void)
continue; continue;
plane.pln_range = (plane.pln_range_max < i) ? plane.pln_range = (plane.pln_range_max < i) ?
plane.pln_range_max : i; plane.pln_range_max : i;
pr("Plane %d range changed to %d\n", plane.pln_uid, pr("Plane %d range changed to %d\n",
plane.pln_range); plane.pln_uid, plane.pln_range);
putplane(plane.pln_uid, &plane); putplane(plane.pln_uid, &plane);
} }
@ -96,8 +96,8 @@ lrange(void)
if ((i = atoi(p)) < 0) if ((i = atoi(p)) < 0)
continue; continue;
land.lnd_rad_max = (i < land.lnd_rad) ? i : land.lnd_rad; land.lnd_rad_max = (i < land.lnd_rad) ? i : land.lnd_rad;
pr("%s reaction radius changed to %d\n", prland(&land), pr("%s reaction radius changed to %d\n",
land.lnd_rad_max); prland(&land), land.lnd_rad_max);
putland(land.lnd_uid, &land); putland(land.lnd_uid, &land);
} }

View file

@ -191,12 +191,12 @@ sona(void)
prship(&targ), prship(&targ),
xyas(targ.shp_x, targ.shp_y, player->cnum)); xyas(targ.shp_x, targ.shp_y, player->cnum));
else else
pr("Sonar detects %s %s @ %s\n", cname(targ.shp_own), pr("Sonar detects %s %s @ %s\n",
prship(&targ), cname(targ.shp_own), prship(&targ),
xyas(targ.shp_x, targ.shp_y, player->cnum)); xyas(targ.shp_x, targ.shp_y, player->cnum));
} else } else
pr("Sonar detects %s %s @ %s\n", cname(targ.shp_own), pr("Sonar detects %s %s @ %s\n",
prship(&targ), cname(targ.shp_own), prship(&targ),
xyas(targ.shp_x, targ.shp_y, player->cnum)); xyas(targ.shp_x, targ.shp_y, player->cnum));
if (targ.shp_visib > vis[y][x]) { if (targ.shp_visib > vis[y][x]) {
@ -295,8 +295,8 @@ plane_sona(struct emp_qelem *plane_list, int x, int y,
prship(targ), prship(targ),
xyas(targ->shp_x, targ->shp_y, pp->pln_own)); xyas(targ->shp_x, targ->shp_y, pp->pln_own));
else else
mpr(pp->pln_own, "%s %s @ %s\n", cname(targ->shp_own), mpr(pp->pln_own, "%s %s @ %s\n",
prship(targ), cname(targ->shp_own), prship(targ),
xyas(targ->shp_x, targ->shp_y, pp->pln_own)); xyas(targ->shp_x, targ->shp_y, pp->pln_own));
} }
} }

View file

@ -109,8 +109,8 @@ torp(void)
continue; continue;
} }
if ((mchr[(int)sub.shp_type].m_flags & M_TORP) == 0) { if ((mchr[(int)sub.shp_type].m_flags & M_TORP) == 0) {
pr("Ship # %d: A %s can't fire torpedoes!\n", sub.shp_uid, pr("Ship # %d: A %s can't fire torpedoes!\n",
mchr[(int)sub.shp_type].m_name); sub.shp_uid, mchr[(int)sub.shp_type].m_name);
continue; continue;
} }
shells = sub.shp_item[I_SHELL]; shells = sub.shp_item[I_SHELL];

View file

@ -114,8 +114,8 @@ trad(void)
TRADE_DELAY / 3600.0 - (now - trade.trd_markettime) / 3600.0; TRADE_DELAY / 3600.0 - (now - trade.trd_markettime) / 3600.0;
if (tleft < 0.0) if (tleft < 0.0)
tleft = 0.0; tleft = 0.0;
pr("$%7ld %2d %5.2f hrs ", trade.trd_price, pr("$%7ld %2d %5.2f hrs ",
trade.trd_maxbidder, tleft); trade.trd_price, trade.trd_maxbidder, tleft);
(void)trade_desc(&trade, &tg); /* XXX */ (void)trade_desc(&trade, &tg); /* XXX */
pr("\n"); pr("\n");
if (trade.trd_owner == player->cnum && !player->god) if (trade.trd_owner == player->cnum && !player->god)

View file

@ -128,8 +128,8 @@ lupgr(void)
continue; continue;
} }
if (land.lnd_tech >= tlev) { if (land.lnd_tech >= tlev) {
pr("%s tech: %d, yours is only %d\n", prland(&land), pr("%s tech: %d, yours is only %d\n",
land.lnd_tech, tlev); prland(&land), land.lnd_tech, tlev);
continue; continue;
} }
cost = lp->l_cost * UPGR_COST / 100; cost = lp->l_cost * UPGR_COST / 100;
@ -149,8 +149,8 @@ lupgr(void)
putland(land.lnd_uid, &land); putland(land.lnd_uid, &land);
putsect(&sect); putsect(&sect);
player->dolcost += cost; player->dolcost += cost;
pr("%s upgraded to tech %d, at a cost of %d\n", prland(&land), pr("%s upgraded to tech %d, at a cost of %d\n",
land.lnd_tech, cost); prland(&land), land.lnd_tech, cost);
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",
@ -212,8 +212,8 @@ supgr(void)
continue; continue;
} }
if (ship.shp_tech >= tlev) { if (ship.shp_tech >= tlev) {
pr("%s tech: %d, yours is only %d\n", prship(&ship), pr("%s tech: %d, yours is only %d\n",
ship.shp_tech, tlev); prship(&ship), ship.shp_tech, tlev);
continue; continue;
} }
cost = mp->m_cost * UPGR_COST / 100; cost = mp->m_cost * UPGR_COST / 100;
@ -232,8 +232,8 @@ supgr(void)
putship(ship.shp_uid, &ship); putship(ship.shp_uid, &ship);
putsect(&sect); putsect(&sect);
player->dolcost += cost; player->dolcost += cost;
pr("%s upgraded to tech %d, at a cost of %d\n", prship(&ship), pr("%s upgraded to tech %d, at a cost of %d\n",
ship.shp_tech, cost); prship(&ship), ship.shp_tech, cost);
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",
@ -295,8 +295,8 @@ pupgr(void)
continue; continue;
} }
if (plane.pln_tech >= tlev) { if (plane.pln_tech >= tlev) {
pr("%s tech: %d, yours is only %d\n", prplane(&plane), pr("%s tech: %d, yours is only %d\n",
plane.pln_tech, tlev); prplane(&plane), plane.pln_tech, tlev);
continue; continue;
} }
cost = pp->pl_cost * UPGR_COST / 100; cost = pp->pl_cost * UPGR_COST / 100;
@ -320,8 +320,8 @@ pupgr(void)
putplane(plane.pln_uid, &plane); putplane(plane.pln_uid, &plane);
putsect(&sect); putsect(&sect);
player->dolcost += cost; player->dolcost += cost;
pr("%s upgraded to tech %d, at a cost of %d\n", prplane(&plane), pr("%s upgraded to tech %d, at a cost of %d\n",
plane.pln_tech, cost); prplane(&plane), plane.pln_tech, cost);
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",

View file

@ -184,7 +184,8 @@ demand_check(void)
return 1; return 1;
} }
/* Check if enough countries want an update, /*
* Check if enough countries want an update,
* and if demand updates are allowed now. * and if demand updates are allowed now.
*/ */
int int
@ -198,7 +199,8 @@ demandupdatecheck(void)
return demand_check(); return demand_check();
} }
/* Is it time for a regular or scheduled update? /*
* Is it time for a regular or scheduled update?
* As well, if none of the above, check to see if * As well, if none of the above, check to see if
* a demand update can occur. * a demand update can occur.
*/ */
@ -230,7 +232,8 @@ updatetime(time_t *now)
return 0; return 0;
} }
/* Return the time, and delta seconds, of the next update. /*
* Return the time, and delta seconds, of the next update.
* If the policy is no regular updates, return the time of * If the policy is no regular updates, return the time of
* the next possible check. * the next possible check.
*/ */

View file

@ -437,8 +437,8 @@ empth_create(int prio, void (*entry)(void *), int size, int flags,
pThread = malloc(sizeof(*pThread)); pThread = malloc(sizeof(*pThread));
if (!pThread) { if (!pThread) {
logerror("not enough memory to create thread: %s (%s)", name, logerror("not enough memory to create thread: %s (%s)",
desc); name, desc);
return NULL; return NULL;
} }
memset(pThread, 0, sizeof(*pThread)); memset(pThread, 0, sizeof(*pThread));
@ -457,8 +457,8 @@ empth_create(int prio, void (*entry)(void *), int size, int flags,
pThread->ulThreadID = _beginthread(empth_threadMain, size, pThread); pThread->ulThreadID = _beginthread(empth_threadMain, size, pThread);
if (pThread->ulThreadID == -1) { if (pThread->ulThreadID == -1) {
logerror("can not create thread: %s (%s): %s", name, desc, logerror("can not create thread: %s (%s): %s",
strerror(errno)); name, desc, strerror(errno));
goto bad; goto bad;
} }

View file

@ -91,7 +91,8 @@ static void **udata;
*/ */
static pthread_mutex_t mtx_ctxsw; static pthread_mutex_t mtx_ctxsw;
static void empth_status(char *format, ...) ATTRIBUTE((format (printf, 1, 2))); static void empth_status(char *format, ...)
ATTRIBUTE((format (printf, 1, 2)));
static void empth_alarm(int sig); static void empth_alarm(int sig);
static void * static void *
@ -163,7 +164,6 @@ empth_init(void **ctx_ptr, int flags)
empth_t *ctx; empth_t *ctx;
struct sigaction act; struct sigaction act;
pthread_key_create(&ctx_key, NULL); pthread_key_create(&ctx_key, NULL);
pthread_mutex_init(&mtx_ctxsw, NULL); pthread_mutex_init(&mtx_ctxsw, NULL);
@ -211,8 +211,8 @@ empth_create(int prio, void (*entry)(void *), int size, int flags,
ctx = malloc(sizeof(empth_t)); ctx = malloc(sizeof(empth_t));
if (!ctx) { if (!ctx) {
logerror("not enough memory to create thread: %s (%s)", name, logerror("not enough memory to create thread: %s (%s)",
desc); name, desc);
return NULL; return NULL;
} }
ctx->name = strdup(name); ctx->name = strdup(name);
@ -223,8 +223,8 @@ empth_create(int prio, void (*entry)(void *), int size, int flags,
eno = pthread_attr_init(&attr); eno = pthread_attr_init(&attr);
if (eno) { if (eno) {
logerror("can not create thread attribute %s (%s): %s", name, desc, logerror("can not create thread attribute %s (%s): %s",
strerror(eno)); name, desc, strerror(eno));
goto bad; goto bad;
} }
if (size < PTHREAD_STACK_MIN) if (size < PTHREAD_STACK_MIN)
@ -234,8 +234,8 @@ empth_create(int prio, void (*entry)(void *), int size, int flags,
eno = pthread_create(&t, &attr, empth_start, ctx); eno = pthread_create(&t, &attr, empth_start, ctx);
if (eno) { if (eno) {
logerror("can not create thread: %s (%s): %s", name, desc, logerror("can not create thread: %s (%s): %s",
strerror(eno)); name, desc, strerror(eno));
goto bad; goto bad;
} }
empth_status("new thread id is %ld", (long)t); empth_status("new thread id is %ld", (long)t);

View file

@ -204,7 +204,7 @@ player_accept(void *unused)
empth_select(s, EMPTH_FD_READ); empth_select(s, EMPTH_FD_READ);
len = player_addrlen; len = player_addrlen;
ns = accept(s, sap, &len); ns = accept(s, sap, &len);
/* FIXME accept() can block on some systems (RST after select() reported s ready) */ /* FIXME accept() can block on some systems (RST after select() reports ready) */
if (ns < 0) { if (ns < 0) {
logerror("new socket accept"); logerror("new socket accept");
continue; continue;

View file

@ -313,8 +313,8 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
oesc); oesc);
gotilist[cn]++; gotilist[cn]++;
} }
PR(plane_owner, "Flying over %s ships in %s\n", cname(cn), PR(plane_owner, "Flying over %s ships in %s\n",
xyas(x, y, plane_owner)); cname(cn), xyas(x, y, plane_owner));
/* This makes going for ships in harbors tough */ /* This makes going for ships in harbors tough */
if (!evaded) { if (!evaded) {
/* We already fired flak up above. Now we intercept again if we haven't already */ /* We already fired flak up above. Now we intercept again if we haven't already */
@ -494,10 +494,10 @@ ac_intercept(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
} }
if (icount == 0) if (icount == 0)
return; return;
PR(plane_owner, "%d %s fighter%s rising to intercept!\n", icount, PR(plane_owner, "%d %s fighter%s rising to intercept!\n",
cname(def_own), icount == 1 ? " is" : "s are"); icount, cname(def_own), icount == 1 ? " is" : "s are");
PR(def_own, "%d fighter%s intercepting %s planes!\n", icount, PR(def_own, "%d fighter%s intercepting %s planes!\n",
icount == 1 ? " is" : "s are", cname(plane_owner)); icount, icount == 1 ? " is" : "s are", cname(plane_owner));
ac_combat_headers(plane_owner, def_own); ac_combat_headers(plane_owner, def_own);
ac_airtoair(esc_list, &int_list); ac_airtoair(esc_list, &int_list);
ac_airtoair(bomb_list, &int_list); ac_airtoair(bomb_list, &int_list);

View file

@ -515,8 +515,8 @@ att_abort(int combat_mode, struct combat *off, struct combat *def)
} }
if (off && def->sct_dcp->d_mcst <= 0) { if (off && def->sct_dcp->d_mcst <= 0) {
pr("You can't %s a %s sector!\n", att_mode[combat_mode], pr("You can't %s a %s sector!\n",
def->sct_dcp->d_name); att_mode[combat_mode], def->sct_dcp->d_name);
return abort_attack(); return abort_attack();
} }
if (!off || off->relations_checked) if (!off || off->relations_checked)

View file

@ -75,8 +75,8 @@ check_cost(int looping, int cost, long cash, int *warnedp,
if (looping && cash > 0 && player->dolcost > cash / 2 && *warnedp < 1) { if (looping && cash > 0 && player->dolcost > cash / 2 && *warnedp < 1) {
*warnedp = 1; *warnedp = 1;
pr("WARNING. You have just spent over half of your money.\n"); pr("WARNING. You have just spent over half of your money.\n");
pr("You started with $%ld and now you only have $%ld left\n", cash, pr("You started with $%ld and now you only have $%ld left\n",
cash - (long)player->dolcost); cash, cash - (long)player->dolcost);
} }
return 0; return 0;
} }

View file

@ -168,8 +168,7 @@ move_ground(struct sctstr *start, struct sctstr *end,
break; break;
else if (dir == DIR_VIEW) { else if (dir == DIR_VIEW) {
pr("%d%% %s with %d civilians.\n", sect.sct_effic, pr("%d%% %s with %d civilians.\n", sect.sct_effic,
dchr[sect.sct_type].d_name, dchr[sect.sct_type].d_name, sect.sct_item[I_CIVIL]);
sect.sct_item[I_CIVIL]);
continue; continue;
} }
/* /*

View file

@ -334,8 +334,8 @@ msl_intercept(coord x, coord y, natid bombown, int hardtarget,
if (!destroyed && if (!destroyed &&
msl_hit(pp, hardtarget, EF_PLANE, news_item, news_item, msl_hit(pp, hardtarget, EF_PLANE, news_item, news_item,
att_name, x, y, bombown)) { att_name, x, y, bombown)) {
mpr(bombown, "%s destroyed by %s %s!\n", att_name, mpr(bombown, "%s destroyed by %s %s!\n",
cname(pp->pln_own), def_name); att_name, cname(pp->pln_own), def_name);
if (sect.sct_own) if (sect.sct_own)
mpr(sect.sct_own, "%s %s intercepted!\n", who, att_name); mpr(sect.sct_own, "%s %s intercepted!\n", who, att_name);
if (sect.sct_own != pp->pln_own) if (sect.sct_own != pp->pln_own)
@ -360,8 +360,8 @@ msl_intercept(coord x, coord y, natid bombown, int hardtarget,
if (destroyed) if (destroyed)
return destroyed; return destroyed;
if (icount) { if (icount) {
mpr(bombown, "%s made it through %s defenses!\n", att_name, mpr(bombown, "%s made it through %s defenses!\n",
def_name); att_name, def_name);
if (sect.sct_own) if (sect.sct_own)
mpr(sect.sct_own, "%s made it through %s defenses!\n", mpr(sect.sct_own, "%s made it through %s defenses!\n",
att_name, def_name); att_name, def_name);

View file

@ -51,8 +51,8 @@ nuk_postread(int n, void *ptr)
struct plnstr plane; struct plnstr plane;
if (np->nuk_uid != n) { if (np->nuk_uid != n) {
logerror("nuk_postread: Error - %d != %d, zeroing.\n", np->nuk_uid, logerror("nuk_postread: Error - %d != %d, zeroing.\n",
n); np->nuk_uid, n);
memset(np, 0, sizeof(struct nukstr)); memset(np, 0, sizeof(struct nukstr));
} }

View file

@ -51,8 +51,8 @@ pln_postread(int n, void *ptr)
struct lndstr theland; struct lndstr theland;
if (pp->pln_uid != n) { if (pp->pln_uid != n) {
logerror("pln_postread: Error - %d != %d, zeroing.\n", pp->pln_uid, logerror("pln_postread: Error - %d != %d, zeroing.\n",
n); pp->pln_uid, n);
memset(pp, 0, sizeof(struct plnstr)); memset(pp, 0, sizeof(struct plnstr));
} }

View file

@ -240,15 +240,14 @@ pln_newlanding(struct emp_qelem *list, coord tx, coord ty, int cno)
pr("\t%s cannot land on ship #%d! %s aborts!\n", pr("\t%s cannot land on ship #%d! %s aborts!\n",
prplane(&plp->plane), cno, prplane(&plp->plane)); prplane(&plp->plane), cno, prplane(&plp->plane));
else if (!put_plane_on_ship(&plp->plane, &ship)) else if (!put_plane_on_ship(&plp->plane, &ship))
pr("\tNo room on ship #%d! %s aborts!\n", cno, pr("\tNo room on ship #%d! %s aborts!\n",
prplane(&plp->plane)); cno, prplane(&plp->plane));
else { else {
if (plp->plane.pln_own != ship.shp_own) { if (plp->plane.pln_own != ship.shp_own) {
/* plp->plane.pln_own = ship.shp_own;*/ /* plp->plane.pln_own = ship.shp_own;*/
wu(0, ship.shp_own, wu(0, ship.shp_own, "%s %s lands on your %s\n",
"%s %s lands on your %s\n", cname(player->cnum), prplane(&plp->plane),
cname(player->cnum), prship(&ship));
prplane(&plp->plane), prship(&ship));
} }
} }
} else { } else {

View file

@ -119,8 +119,8 @@ setrel(natid us, natid them, int rel)
if (addendum && us == player->cnum && !update_pending) if (addendum && us == player->cnum && !update_pending)
pr("%s\n", addendum); pr("%s\n", addendum);
mpr(us, "Diplomatic relations with %s %s to \"%s\".\n", themname, mpr(us, "Diplomatic relations with %s %s to \"%s\".\n",
whichway, relates[rel]); themname, whichway, relates[rel]);
if (!(getrejects(us, themnp) & REJ_TELE)) if (!(getrejects(us, themnp) & REJ_TELE))
mpr(them, mpr(them,
"Country %s (#%d) has %s their relations with you to \"%s\"!\n", "Country %s (#%d) has %s their relations with you to \"%s\"!\n",

View file

@ -312,8 +312,8 @@ retreat_ship1(struct shpstr *sp, char code, int orig)
} }
if (orig) { if (orig) {
wu(0, sp->shp_own, "%s %s, and retreated to %s\n", prship(sp), wu(0, sp->shp_own, "%s %s, and retreated to %s\n",
conditions[findcondition(code)].desc[orig], prship(sp), conditions[findcondition(code)].desc[orig],
xyas(sp->shp_x, sp->shp_y, sp->shp_own)); xyas(sp->shp_x, sp->shp_y, sp->shp_own));
} else { } else {
wu(0, sp->shp_own, "%s %s, and ended up at %s\n", wu(0, sp->shp_own, "%s %s, and ended up at %s\n",

View file

@ -86,8 +86,8 @@ satmap(int x, int y, int eff, int range, int flags, int type)
} }
range = range * (eff / 100.0); range = range * (eff / 100.0);
pr("%s efficiency %d%%, max range %d\n", xyas(x, y, player->cnum), pr("%s efficiency %d%%, max range %d\n",
eff, range); xyas(x, y, player->cnum), eff, range);
memset(noise, 0, sizeof(noise)); memset(noise, 0, sizeof(noise));
if (eff < 100) { if (eff < 100) {
pr("Some noise on the transmission...\n"); pr("Some noise on the transmission...\n");
@ -334,8 +334,8 @@ satdisp(struct sctstr *sp, int acc, int showstuff)
first = 0; first = 0;
} }
pr("\t%4d %4d %-16.16s ", land.lnd_own, land.lnd_uid, pr("\t%4d %4d %-16.16s ",
lchr[(int)land.lnd_type].l_name); land.lnd_own, land.lnd_uid, lchr[(int)land.lnd_type].l_name);
prxy("%4d,%-4d ", land.lnd_x, land.lnd_y, player->cnum); prxy("%4d,%-4d ", land.lnd_x, land.lnd_y, player->cnum);
pr("%3d%%\n", land.lnd_effic); pr("%3d%%\n", land.lnd_effic);
} }

View file

@ -50,8 +50,8 @@ shp_postread(int n, void *ptr)
struct shpstr *sp = ptr; struct shpstr *sp = ptr;
if (sp->shp_uid != n) { if (sp->shp_uid != n) {
logerror("shp_postread: Error - %d != %d, zeroing.\n", sp->shp_uid, logerror("shp_postread: Error - %d != %d, zeroing.\n",
n); sp->shp_uid, n);
memset(sp, 0, sizeof(struct shpstr)); memset(sp, 0, sizeof(struct shpstr));
} }

View file

@ -518,8 +518,8 @@ show_sect_build(int foo)
pr("Infrastructure building - adding 1 point of efficiency costs:\n"); pr("Infrastructure building - adding 1 point of efficiency costs:\n");
pr(" type lcms hcms mobility $$$$\n"); pr(" type lcms hcms mobility $$$$\n");
for (x = 0; intrchr[x].in_name; x++) { for (x = 0; intrchr[x].in_name; x++) {
pr("%-20s %4d %4d %8d %4d\n", intrchr[x].in_name, pr("%-20s %4d %4d %8d %4d\n",
intrchr[x].in_lcms, intrchr[x].in_hcms, intrchr[x].in_name, intrchr[x].in_lcms, intrchr[x].in_hcms,
intrchr[x].in_mcost, intrchr[x].in_dcost); intrchr[x].in_mcost, intrchr[x].in_dcost);
} }
} }
@ -569,8 +569,8 @@ show_sect_capab(int foo)
j = dchr[x].d_prd; j = dchr[x].d_prd;
pr("%c %-23s %-7s ", dchr[x].d_mnem, dchr[x].d_name, pr("%c %-23s %-7s ",
pchr[j].p_sname); dchr[x].d_mnem, dchr[x].d_name, pchr[j].p_sname);
(void)CANT_HAPPEN(MAXPRCON > 3); /* output has only three columns */ (void)CANT_HAPPEN(MAXPRCON > 3); /* output has only three columns */
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (i < MAXPRCON if (i < MAXPRCON

View file

@ -168,8 +168,8 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
} }
getsect(sp->shp_x, sp->shp_y, &sect); getsect(sp->shp_x, sp->shp_y, &sect);
if (sect.sct_type != SCT_WATER) if (sect.sct_type != SCT_WATER)
pr(" in a %s %s", cname(sect.sct_own), pr(" in a %s %s",
dchr[sect.sct_type].d_name); cname(sect.sct_own), dchr[sect.sct_type].d_name);
else else
pr(" at sea"); pr(" at sea");
break; break;

View file

@ -61,8 +61,8 @@ scuttle_it(struct shpstr *sp)
sp->shp_autonav &= ~AN_SCUTTLE; sp->shp_autonav &= ~AN_SCUTTLE;
if (!(sectp = getsectp(sp->shp_x, sp->shp_y))) { if (!(sectp = getsectp(sp->shp_x, sp->shp_y))) {
wu(0, 0, "bad sector (%d,%d) ship %d\n", sp->shp_x, sp->shp_y, wu(0, 0, "bad sector (%d,%d) ship %d\n",
sp->shp_uid); sp->shp_x, sp->shp_y, sp->shp_uid);
return; return;
} }
if (sectp->sct_type != SCT_HARBR || sectp->sct_effic < 2) { if (sectp->sct_type != SCT_HARBR || sectp->sct_effic < 2) {

View file

@ -79,8 +79,8 @@ shutdown_sequence(void *unused)
} else if (shutdown_pending == 1) { } else if (shutdown_pending == 1) {
pr_wall("%sServer shutting down in 1 minute!\n", header); pr_wall("%sServer shutting down in 1 minute!\n", header);
} else if (shutdown_pending <= 5) { } else if (shutdown_pending <= 5) {
pr_wall("%sServer shutting down in %d minutes!\n", header, pr_wall("%sServer shutting down in %d minutes!\n",
shutdown_pending); header, shutdown_pending);
} else if (shutdown_pending <= 60 } else if (shutdown_pending <= 60
&& shutdown_pending % 10 == 0) { && shutdown_pending % 10 == 0) {
pr_wall("%sThe server will be shutting down in %d minutes!\n", pr_wall("%sThe server will be shutting down in %d minutes!\n",