Remove silly superflous parenthesis.

This commit is contained in:
Markus Armbruster 2006-03-26 07:46:49 +00:00
parent beae3ea770
commit 0d0a305bf3
14 changed files with 31 additions and 31 deletions

View file

@ -464,13 +464,13 @@ getin(s_char **what, s_char **p, int *arg, s_char *buf)
if (**what == '\0')
return END;
while (**what && isspace(**what))
(*what)++;
*what++;
if (**what == '\0')
return RET_SYN;
for (*p = *what; **p && !isspace(**p); (*p)++) /* skip non spaces */
for (*p = *what; **p && !isspace(**p); *p++) /* skip non spaces */
continue;
while (**p && isspace(**p))
(*p)++;
*p++;
if (**p == '\0')
return RET_SYN;
*arg = atoi(*p);

View file

@ -804,7 +804,7 @@ load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
wu(0, sectp->sct_own, buf);
}
}
++(*nshipsp);
++*nshipsp;
return 0;
}
@ -1011,7 +1011,7 @@ load_comm_land(struct sctstr *sectp, struct lndstr *lp,
wu(0, sectp->sct_own, buf);
}
}
++(*nunitsp);
++*nunitsp;
return 0;
}

View file

@ -812,7 +812,7 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
if (!line_of_sight(NULL, ship.shp_x, ship.shp_y, ax, ay))
continue;
(*nfiring)++;
*nfiring++;
fp = malloc(sizeof(struct flist));
memset(fp, 0, sizeof(struct flist));
fp->type = targ_ship;
@ -843,7 +843,7 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
nshot = MIN(nshot, ship.shp_glim);
if (nshot == 0)
continue;
(*nfiring)++;
*nfiring++;
fp = malloc(sizeof(struct flist));
memset(fp, 0, sizeof(struct flist));
fp->type = targ_ship;
@ -896,7 +896,7 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
dam2 = (int)landunitgun(land.lnd_effic, land.lnd_dam, gun,
land.lnd_ammo, shell);
(*nfiring)++;
*nfiring++;
fp = malloc(sizeof(struct flist));
memset(fp, 0, sizeof(struct flist));
fp->type = targ_unit;
@ -949,7 +949,7 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
I_SHELL, 1);
if (gun == 0 || firing.sct_item[I_MILIT] < 5 || shell == 0)
continue;
(*nfiring)++;
*nfiring++;
fp = malloc(sizeof(struct flist));
memset(fp, 0, sizeof(struct flist));
fp->x = firing.sct_x;

View file

@ -340,7 +340,7 @@ eta_calc(struct shpstr *sp, s_char *path, int *len, int *nupdates)
i--;
} else {
mobil += (ship_mob_scale * (float)etu_per_update);
(*nupdates)++;
*nupdates++;
}
}
}

View file

@ -46,9 +46,9 @@ int
show(void)
{
s_char *p;
void (*cfunc) (int);
void (*sfunc) (int);
void (*bfunc) (int);
void (*cfunc)(int);
void (*sfunc)(int);
void (*bfunc)(int);
struct natstr *natp;
int tlev;
s_char buf[1024];
@ -126,11 +126,11 @@ show(void)
|| !*p)
return RET_SYN;
if (*p == 'B' || *p == 'b')
(*bfunc) (tlev);
bfunc(tlev);
else if (*p == 'C' || *p == 'c')
(*cfunc) (tlev);
cfunc(tlev);
else if (*p == 'S' || *p == 's')
(*sfunc) (tlev);
sfunc(tlev);
else
return RET_SYN;
return RET_OK;

View file

@ -227,7 +227,7 @@ spyline(struct sctstr *sp)
prxy("%4d,%-4d", sp->sct_x, sp->sct_y, player->cnum);
pr(" %c%c %3d %3d %3d %3d %3d %3d %4d %4d %4d %3d %4d %4d %4d %3d %3d\n",
dchr[sp->sct_type].d_mnem,
(sp->sct_newtype == sp->sct_type) ? ' ' : dchr[sp->sct_newtype].d_mnem,
sp->sct_newtype == sp->sct_type ? ' ' : dchr[sp->sct_newtype].d_mnem,
sp->sct_own,
sp->sct_oldown,
roundintby((int)sp->sct_effic, 10),
@ -253,8 +253,8 @@ static void
insert(coord *table, int *len, coord x, coord y)
{
if (!check(table, len, x, y)) {
table[(*len)++] = x;
table[(*len)++] = y;
table[*len++] = x;
table[*len++] = y;
}
}

View file

@ -126,7 +126,7 @@ starv_sects(s_char *range)
pr("%3d ", sect.sct_own);
prxy("%4d,%-4d", nstr.x, nstr.y, player->cnum);
pr(" %c", dchr[sect.sct_type].d_mnem);
pr(" %c", (sect.sct_own != sect.sct_oldown ? '*' : ' '));
pr(" %c", sect.sct_own != sect.sct_oldown ? '*' : ' ');
if (sect.sct_newtype != sect.sct_type)
pr("%c", dchr[sect.sct_newtype].d_mnem);
else

View file

@ -246,7 +246,7 @@ owned_and_navigable(s_char *map, int x, int y, s_char *terrain, int own)
/* No terrain to check? Everything is navigable! (this
probably means we are flying) */
if (!(*terrain))
if (!*terrain)
return 1;
/* Are we checking this map? */

View file

@ -1065,7 +1065,7 @@ ask_olist(int combat_mode, struct combat *off, struct combat *def,
if (lnd_spyval(&land) > *a_spyp)
*a_spyp = lnd_spyval(&land);
if (llp->lcp->l_flags & L_ENGINEER)
++(*a_engineerp);
++*a_engineerp;
if (def->type == EF_SHIP && ++count >= maxland)
break;
}

View file

@ -966,7 +966,7 @@ oprange(struct genitem *gp, int type, int *radius)
break;
}
if ((*radius) > range)
if (*radius > range)
*radius = range;
return range;

View file

@ -66,7 +66,8 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
double mobility = (double)start->sct_mobil;
int dir;
int intcost;
int takedam = (*dam), out = 0;
int takedam = *dam;
int out = 0;
s_char bpath[512];
s_char buf2[512];
s_char prompt[128];
@ -228,7 +229,7 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
*/
if (takedam && chance(weight / 100.0) &&
((curx != oldx) || (cury != oldy)))
(*dam) += ground_interdict(curx, cury, player->cnum,
*dam += ground_interdict(curx, cury, player->cnum,
"commodities");
if (*dam >= 100)
break;

View file

@ -165,15 +165,14 @@ sail_find_fleet(struct fltheadstr **head, struct shpstr *sp)
return 0;
/* Find the fleet structure we belong to. */
for (fltp = (*head); (fltp && fltp->leader != follow);
fltp = fltp->next) ;
for (fltp = *head; fltp && fltp->leader != follow; fltp = fltp->next) ;
if (!fltp) {
fltp = malloc(sizeof(*fltp));
memset(fltp, 0, sizeof(*fltp));
/* Fix the links. */
fltp->next = (*head);
fltp->next = *head;
*head = fltp;
/* Set the leader. */
@ -265,7 +264,7 @@ sail_nav_fleet(struct fltheadstr *fltp)
sp = getshipp(fltp->leader);
own = sp->shp_own;
fltp_to_list(fltp, &ship_list); /* hack -KHS 1995 */
for (s = sp->shp_path; (*s) && (fltp->maxmoves > 0); s++) {
for (s = sp->shp_path; *s && fltp->maxmoves > 0; s++) {
dir = diridx(*s);
if (0 != shp_nav_one_sector(&ship_list, dir, own, 0))
fltp->maxmoves = 1;

View file

@ -95,7 +95,7 @@ upd_buildeff(struct natstr *np, struct sctstr *sp, int *workp,
vec[I_UW] = maxpop;
*workp = (vec[I_CIVIL] * sctwork) / 100.0
+ (vec[I_MILIT] * 2 / 5.0) + vec[I_UW];
*workp = roundavg((etu * (*workp)) / 100.0);
*workp = roundavg((etu * *workp) / 100.0);
buildeff_work = MIN((int)(*workp / 2), buildeff_work);
}

View file

@ -808,7 +808,7 @@ place_island(int c, int *xp, int *yp)
for (*yp = sy; *xp != sx || *yp != sy; *xp += 2) {
if (*xp >= WORLD_X) {
*yp = new_y(*yp + 1);
*xp = (*yp) % 2;
*xp = *yp % 2;
if (*xp == sx && *yp == sy)
break;
}