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);
wu(0, sectp->sct_own, buf);
}
}
- ++(*nshipsp);
+ ++*nshipsp;
return 0;
}
wu(0, sectp->sct_own, buf);
}
}
- ++(*nunitsp);
+ ++*nunitsp;
return 0;
}
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;
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;
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;
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;
i--;
} else {
mobil += (ship_mob_scale * (float)etu_per_update);
- (*nupdates)++;
+ *nupdates++;
}
}
}
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];
|| !*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;
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),
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;
}
}
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
/* No terrain to check? Everything is navigable! (this
probably means we are flying) */
- if (!(*terrain))
+ if (!*terrain)
return 1;
/* Are we checking this map? */
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;
}
break;
}
- if ((*radius) > range)
+ if (*radius > range)
*radius = range;
return range;
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];
*/
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;
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. */
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;
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);
}
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;
}