diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index 96198e10..bfaeff6c 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -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); diff --git a/src/lib/commands/load.c b/src/lib/commands/load.c index a4b6bd69..ba29d4b3 100644 --- a/src/lib/commands/load.c +++ b/src/lib/commands/load.c @@ -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; } diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index 9ab80192..fce16969 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -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; diff --git a/src/lib/commands/orde.c b/src/lib/commands/orde.c index 3cd98a5d..d1647bad 100644 --- a/src/lib/commands/orde.c +++ b/src/lib/commands/orde.c @@ -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++; } } } diff --git a/src/lib/commands/show.c b/src/lib/commands/show.c index 0bbbdf95..c8748adb 100644 --- a/src/lib/commands/show.c +++ b/src/lib/commands/show.c @@ -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; diff --git a/src/lib/commands/spy.c b/src/lib/commands/spy.c index 8cc46ebb..01c632f3 100644 --- a/src/lib/commands/spy.c +++ b/src/lib/commands/spy.c @@ -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; } } diff --git a/src/lib/commands/strv.c b/src/lib/commands/strv.c index 708189f7..2d01deda 100644 --- a/src/lib/commands/strv.c +++ b/src/lib/commands/strv.c @@ -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 diff --git a/src/lib/common/bestpath.c b/src/lib/common/bestpath.c index 62b5158f..fa374b18 100644 --- a/src/lib/common/bestpath.c +++ b/src/lib/common/bestpath.c @@ -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? */ diff --git a/src/lib/subs/attsub.c b/src/lib/subs/attsub.c index 1ef23c10..6a14f7aa 100644 --- a/src/lib/subs/attsub.c +++ b/src/lib/subs/attsub.c @@ -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; } diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index ce9e9ee3..a6d912aa 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -966,7 +966,7 @@ oprange(struct genitem *gp, int type, int *radius) break; } - if ((*radius) > range) + if (*radius > range) *radius = range; return range; diff --git a/src/lib/subs/move.c b/src/lib/subs/move.c index 940f676b..833199db 100644 --- a/src/lib/subs/move.c +++ b/src/lib/subs/move.c @@ -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; diff --git a/src/lib/update/sail.c b/src/lib/update/sail.c index 38b1839e..0c4ec54c 100644 --- a/src/lib/update/sail.c +++ b/src/lib/update/sail.c @@ -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; diff --git a/src/lib/update/sect.c b/src/lib/update/sect.c index ba05b332..ce093e29 100644 --- a/src/lib/update/sect.c +++ b/src/lib/update/sect.c @@ -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); } diff --git a/src/util/fairland.c b/src/util/fairland.c index 2d5b7f88..2533b5b6 100644 --- a/src/util/fairland.c +++ b/src/util/fairland.c @@ -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; }