Remove some redundant parenthesis; no functional change.

This commit is contained in:
Markus Armbruster 2005-07-23 19:48:35 +00:00
parent 4861f837fb
commit 380b063f9c
41 changed files with 134 additions and 134 deletions

View file

@ -174,5 +174,5 @@ showship(struct coast **cpp, int x, int y)
/* check that last one! */
if (todelete)
free(todelete);
return (nship);
return nship;
}

View file

@ -57,7 +57,7 @@ desi(void)
if (player->argp[2]) {
cost = do_desi(natp, player->argp[1], player->argp[2], cash, 0);
if (cost < 0)
return (int)(-cost);
return (int)-cost;
if (chkmoney(cost, cash, player->argp[3]))
return RET_SYN;
}

View file

@ -450,10 +450,10 @@ static int
errcheck(int num, int min, int max)
{
if (num < min)
return (min);
return min;
else if (num > max)
return (max);
return (num);
return max;
return num;
}
static int

View file

@ -618,7 +618,7 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
load_spy = 1;
}
}
if ((!load_spy) &&
if (!load_spy &&
(sp->shp_nland >= mchr[(int)sp->shp_type].m_nland)) {
if (noisy) {
if (mchr[(int)sp->shp_type].m_nland)
@ -678,7 +678,7 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
land.lnd_x, land.lnd_y);
}
land.lnd_ship = (-1);
land.lnd_ship = -1;
sp->shp_nland--;
putland(land.lnd_uid, &land);
putship(sp->shp_uid, sp);
@ -1153,7 +1153,7 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
land.lnd_own = sectp->sct_own;
makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
land.lnd_y);
land.lnd_land = (-1);
land.lnd_land = -1;
lp->lnd_nland--;
putland(land.lnd_uid, &land);
putland(lp->lnd_uid, lp);

View file

@ -125,7 +125,7 @@ multifire(void)
emp_initque(&fired);
emp_initque(&defended);
type = (-1);
type = -1;
while ((type != EF_SECTOR) && (type != EF_SHIP) && (type != EF_LAND)) {
if (!(p = getstarg(player->argp[1],
"Firing from ship(s), sect(s), or land unit(s)? ",
@ -692,7 +692,7 @@ defend(struct emp_qelem *al, struct emp_qelem *dl, enum targ_type target,
emp_insque(&fp->queue, al);
}
return (dam);
return dam;
}
static void
@ -963,7 +963,7 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
}
}
return ((*nfiring) == 0 ? 0 : (dam / (*nfiring)));
return *nfiring == 0 ? 0 : dam / *nfiring;
}
static void

View file

@ -50,7 +50,9 @@ retr(void)
int nships;
struct nstr_item ni;
struct shpstr ship;
int isfleet = 0, rflags = (-2), zero;
int isfleet = 0;
int rflags = -2;
int zero;
unsigned int x;
s_char buf1[1024];
s_char buf2[1024];
@ -200,7 +202,9 @@ lretr(void)
int nunits;
struct nstr_item ni;
struct lndstr land;
int isarmy = 0, rflags = (-2), zero;
int isarmy = 0;
int rflags = -2;
int zero;
s_char buf1[1024];
s_char buf2[1024];
unsigned int x;

View file

@ -166,10 +166,10 @@ sail(void)
return RET_SYN;
cp = player->argp[2];
if ((*player->argp[0] == 'q') /*qsail command */ ||(cp && *cp == 'q')) {
return (show_sail(&nstr));
return show_sail(&nstr);
} else if (*player->argp[0] == 'u' /*unsail command */
|| (cp && *cp == '-')) {
return (cmd_unsail_ship(&nstr));
return cmd_unsail_ship(&nstr);
} else
return (cmd_sail_ship(&nstr));
return cmd_sail_ship(&nstr);
}

View file

@ -171,5 +171,5 @@ showsat(struct sky **skypp, int x, int y)
/* check that last one! */
if (todelete)
free(todelete);
return (nsat);
return nsat;
}

View file

@ -145,7 +145,7 @@ upda(void)
if (*game_hours != 0)
pr("Game hours are: %s\n", game_hours);
return (0);
return 0;
} else {
time_t now;
time_t upd_time;