]> git.pond.sub.org Git - empserver/commitdiff
Remove silly superflous parenthesis.
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 26 Mar 2006 07:46:49 +0000 (07:46 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 26 Mar 2006 07:46:49 +0000 (07:46 +0000)
14 files changed:
src/lib/commands/edit.c
src/lib/commands/load.c
src/lib/commands/mfir.c
src/lib/commands/orde.c
src/lib/commands/show.c
src/lib/commands/spy.c
src/lib/commands/strv.c
src/lib/common/bestpath.c
src/lib/subs/attsub.c
src/lib/subs/mission.c
src/lib/subs/move.c
src/lib/update/sail.c
src/lib/update/sect.c
src/util/fairland.c

index 96198e105e621cd6bc858a44c8ab72e9f3f4c63d..bfaeff6c091633cb54ddf35b9aa4da74852ce78e 100644 (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);
index a4b6bd699ec529bdc2525929caf6baedf1283406..ba29d4b379819db82a802aeb94f39eccbe43b5a7 100644 (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;
 }
 
index 9ab80192324d1f842004b459390dc32d04565ec1..fce169694282d38fd655acd5fbb5e7dd1cefb3e4 100644 (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;
index 3cd98a5d1d77c8ccdca6bccb28d960be9ab995da..d1647badbe7859cb9974381f7f1a9676de960056 100644 (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++;
        }
     }
 }
index 0bbbdf958fba8698c6902d0be5e19e3564cfbcba..c8748adba4009588721b38687fdbdf3f118797c2 100644 (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;
index 8cc46ebbb22971597dd787042aa471fea573fe59..01c632f3ec70aedd7afc8eddac96e01ba3bf8509 100644 (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;
     }
 }
 
index 708189f7b0dedf1486b46b71cc4220603739919a..2d01dedac080c673ee119b7668e2cfe478b5f167 100644 (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
index 62b5158f5c9be252f451a45eddd29cda73f2fcfc..fa374b18ffddb36bbb31b4bb80c202ff86496ebd 100644 (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? */
index 1ef23c10c42b85eff95346eca061a0b657fa57ea..6a14f7aab01981c64a9068481b722304c8632eac 100644 (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;
     }
index ce9e9ee340cbb959188f9ee790520c9e4ab93886..a6d912aaa8aa686fbf805ffc1f0bcd8b7181752e 100644 (file)
@@ -966,7 +966,7 @@ oprange(struct genitem *gp, int type, int *radius)
        break;
     }
 
-    if ((*radius) > range)
+    if (*radius > range)
        *radius = range;
 
     return range;
index 940f676bace650368f5ab53d8e2f3e538b2ebc48..833199db3cc68ae632dc3ae590e8498520d20e3e 100644 (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;
index 38b1839e4219ec6b1f6f8a509ef66f21bbb12809..0c4ec54c9c0c610a7f7ea720b3ef655429a49825 100644 (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;
index ba05b332a0834f8684075583a8e2bc5e362d9d85..ce093e29ed5ec7f04b5c02f570d502aee870e513 100644 (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);
        }
index 2d5b7f8855ebdd0b3022356d70e3ce6a0b95b287..2533b5b6ba59ec6ee14d31c27c741987f393b2fc 100644 (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;
            }