]> git.pond.sub.org Git - empserver/commitdiff
Remove some redundant parenthesis; no functional change.
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Jul 2005 19:48:35 +0000 (19:48 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Jul 2005 19:48:35 +0000 (19:48 +0000)
41 files changed:
include/ship.h
src/lib/as/as_cache.c
src/lib/as/as_costcomp.c
src/lib/as/as_extend.c
src/lib/as/as_hash.c
src/lib/as/as_init.c
src/lib/as/as_merge.c
src/lib/as/as_search.c
src/lib/as/as_winnow.c
src/lib/commands/coas.c
src/lib/commands/desi.c
src/lib/commands/edit.c
src/lib/commands/load.c
src/lib/commands/mfir.c
src/lib/commands/retr.c
src/lib/commands/sail.c
src/lib/commands/skyw.c
src/lib/commands/upda.c
src/lib/common/bestpath.c
src/lib/common/file.c
src/lib/common/path.c
src/lib/common/wantupd.c
src/lib/gen/io.c
src/lib/gen/plur.c
src/lib/gen/round.c
src/lib/gen/scthash.c
src/lib/lwp/lwp.c
src/lib/lwp/queue.c
src/lib/lwp/sem.c
src/lib/subs/attsub.c
src/lib/subs/fortdef.c
src/lib/subs/landgun.c
src/lib/subs/lndsub.c
src/lib/subs/mslsub.c
src/lib/subs/retreat.c
src/lib/update/mobility.c
src/lib/update/nat.c
src/lib/update/nxtsctp.c
src/lib/update/prepare.c
src/lib/update/sail.c
src/util/fairland.c

index 32e25064adea691c876ef26454c13d5cb825630c..f04a6accc07715b4e59a4327c5ca0447e0e92e8f 100644 (file)
@@ -209,10 +209,10 @@ struct mlist {
 #define SHP_BLD_WORK(lcm, hcm) (20 + (lcm) + 2 * (hcm))
 
  /* return codes from shp_check_nav */
-#define CN_NAVIGABLE   (0)
-#define CN_LANDLOCKED  (1)
-#define CN_CONSTRUCTION        (2)
-#define CN_ERROR       (-1)
+#define CN_NAVIGABLE   0
+#define CN_LANDLOCKED  1
+#define CN_CONSTRUCTION        2
+#define CN_ERROR       -1
 
 enum {
     SHP_AIROPS_EFF = 50,       /* min. efficiency for air ops */
index ca9b62cad0b464cda9e3af039736221b5d6e0a69..4c87f61891090f03ee691f322167e236346507b0 100644 (file)
@@ -176,20 +176,20 @@ as_find_cachepath(coord fx, coord fy, coord tx, coord ty)
 
     /* Is the cache on?  if not, return NULL */
     if (as_cachepath_on == 0)
-       return (NULL);
+       return NULL;
 
     /* Do we have any cached? */
     if (fromhead == (struct as_frompath **)0)
-       return (NULL);
+       return NULL;
 
     /* Yes! */
     for (from = fromhead[fy]; from; from = from->next) {
        if (from->x == fx) {
            for (to = from->tolist[ty]; to; to = to->next) {
                if (to->x == tx)
-                   return (to->path);
+                   return to->path;
            }
        }
     }
-    return (NULL);
+    return NULL;
 }
index c41490172682c4d69144c639740ee3c9ad25e60d..424b761c1e5c4d14bcda3e45e26cd5d098ce75e0 100644 (file)
@@ -33,15 +33,15 @@ as_costcomp(const void *p1, const void *p2)
 
     diff = (*n1)->lbcost - (*n2)->lbcost;
     if (diff < -0.0001)
-       return (-1);
+       return -1;
     if (diff > 0.0001)
-       return (1);
+       return 1;
 
     /* equal, check secondary cost */
     diff = (*n1)->seccost - (*n2)->seccost;
     if (diff < -0.0001)
-       return (-1);
+       return -1;
     if (diff > 0.0001)
-       return (1);
-    return (0);
+       return 1;
+    return 0;
 }
index 0f257e11c1b60235eb5202a7856e8641bc9f683e..a40edfee857054cedfb96d07b887c183395ec7d4 100644 (file)
@@ -40,14 +40,14 @@ as_extend(struct as_data *adp)
     i = (*adp->neighbor) (head->np->c, adp->neighbor_coords,
                          adp->userdata);
     if (i == 0)
-       return (NULL);
+       return NULL;
     /*
      * Get rid of neighbors that are more costly than ones we already have,
      * and sort the rest into an array of as_nodes.
      */
     i = as_winnow(adp, adp->neighbor_coords, i);
     if (i < 0)
-       return (NULL);
+       return NULL;
     if (i > 1)
        qsort(adp->neighbor_nodes, i,
              sizeof(*adp->neighbor_nodes), as_costcomp);
@@ -66,5 +66,5 @@ as_extend(struct as_data *adp)
     adp->tried->np->flags |= AS_TRIED;
 
     head = as_merge(adp, head, adp->neighbor_nodes);
-    return (head);
+    return head;
 }
index 9311dfc44bbeeb2c92134d18d1ec41f61242c496..0c7670426503b9221a796f87bd0741ff52b93fe6 100644 (file)
@@ -35,9 +35,9 @@ as_iscinq(struct as_data *adp, struct as_coord c)
 
     for (hp = adp->hashtab[hashval]; hp; hp = hp->next)
        if (hp->c.x == c.x && hp->c.y == c.y)
-           return (hp->qp);
+           return hp->qp;
 
-    return (NULL);
+    return NULL;
 }
 
 /*
index a31fc85f930dc3272ae836fffdc7c995644f1ca1..0ff8a9c95c22787d63e3be52d3facc3e98faf52d 100644 (file)
@@ -54,5 +54,5 @@ as_init(int maxneighbors,
     adp->seccost = seccostfunc;
     adp->userdata = userdata;
 
-    return (adp);
+    return adp;
 }
index 1f7a361c02466a4b3b5e69f6c7c347f9f10f4f2c..bccbc0ca6a3f80221dead99e0d25a40550fb6761 100644 (file)
@@ -77,5 +77,5 @@ as_merge(struct as_data *adp, struct as_queue *head,
        np->step++;
     }
 
-    return (head);
+    return head;
 }
index f59e025a69857b32c3fe6671d9d40a1ea46b6e9c..9b737e9cc2905bda3ca83c36cbb0131aa9eac656 100644 (file)
@@ -99,7 +99,7 @@ as_search(struct as_data *adp)
 #ifdef DEBUG
        fprintf(stderr, "Failed\n");
 #endif /* DEBUG */
-       return (-1);
+       return -1;
     }
 
     as_makepath(adp);
@@ -121,7 +121,7 @@ as_search(struct as_data *adp)
     }
 #endif /* DEBUG */
 
-    return (0);
+    return 0;
 }
 
 /*
index 2fd79122160b8884e14f355972b10278f0d587bf..f2a4b2e9338fb9c691590afc4141cbb4ed54974a 100644 (file)
@@ -91,7 +91,7 @@ as_winnow(struct as_data *adp, struct as_coord *coords, int ncoords)
 #endif /* DEBUG */
                if (qp->np->flags & AS_TRIED) {
                    /* should "never happen" */
-                   return (0);
+                   return 0;
                }
                /*
                 * The neighbor is better than a previously visited coordinate;
@@ -135,7 +135,7 @@ as_winnow(struct as_data *adp, struct as_coord *coords, int ncoords)
        np = as_newnode(adp->head->np, *cp, inclbcost, lbcost,
                        knowncost, seccost);
        if (np == NULL)
-           return (0);
+           return 0;
        if (fix_pointer) {
 #ifdef DEBUG
            fprintf(stderr, "Fixing pointer for %d, %d\n",
@@ -148,7 +148,7 @@ as_winnow(struct as_data *adp, struct as_coord *coords, int ncoords)
     }
     adp->neighbor_nodes[i] = NULL;
 
-    return (i);
+    return i;
 }
 
 
@@ -170,5 +170,5 @@ as_newnode(struct as_node *backp, struct as_coord c,
     np->step = backp->step;
     np->back = backp;
 
-    return (np);
+    return np;
 }
index 814e8b023de48c3128f4e3998a1043d77e55f8c1..12ad0d99475f1a5b68a13bb631ad2381c86e6dbf 100644 (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;
 }
index 523d9681bbd62e25082dde5aafc934d896ab4bf4..62eb7e5b5c838e68b399d524d011e89bbe6f6665 100644 (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;
     }
index 7d7af2192c1efc28b7fbaa690fdb20451d5d7e91..f77572502f1e7d3513d86487fb3bd065a815213b 100644 (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
index 4f7d71b31dfd5a892119b335480e092027912b51..fee70f9add4768b503914d6df2b920049fca2acc 100644 (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);
index 8fbcba828e4f9af39c233f64f39e6f7af1c6b2b9..e4f23059576bd233cfdd10b495e04ac16cfe17f8 100644 (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
index 6b6d3b9a5d231ae9feedcadd54f4054969f34528..e6837393a10e218da663a71e74ce06129e923690 100644 (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;
index 3c50f853386f9ea36adfbfc087e73d1bb9f4539f..23b5ed870acecd75cefe30905d2341c6e059fd70 100644 (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);
 }
index af58cb37cfa312b358ab360d09ff4e31175f7133..31cab8e4312b164fccee45cbd7931cb507b9105f 100644 (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;
 }
index 755fd4fba8db81b7ad61c92699e0eba0022e2cbd..bb3cebf5aa3817b8cbfbc96636bee97b6d44b3ab 100644 (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;
index aa84088401522c86a0e4bc65ec0073b772102768..6043fb66fe4e5d983b5d0e3ae2d46b0ec84e5677 100644 (file)
@@ -135,7 +135,7 @@ bestownedpath(s_char *bpath,
        mapbuf = malloc((WORLD_X * WORLD_Y) *
                                        sizeof(unsigned int));
     if (!mapbuf)
-       return ((s_char *)0);
+       return NULL;
     if (!mapindex) {
        mapindex = malloc(WORLD_X * sizeof(unsigned int *));
        if (mapindex) {
@@ -145,7 +145,7 @@ bestownedpath(s_char *bpath,
        }
     }
     if (!mapindex)
-       return ((s_char *)0);
+       return NULL;
 
     bpath[0] = 0;
     if (0 != (restr2 = (*terrain == 'R')))
@@ -163,11 +163,11 @@ bestownedpath(s_char *bpath,
     }
 
     if (!valid(x, y) || !valid(ex, ey))
-       return ((s_char *)0);
+       return NULL;
 
     if (restr2 && (!owned_and_navigable(bigmap, x, y, terrain, own) ||
                   !owned_and_navigable(bigmap, x, y, terrain, own)))
-       return ((s_char *)0);
+       return NULL;
 
     for (i = 0; i < WORLD_X; i++)
        for (j = 0; j < WORLD_Y; j++)
@@ -232,7 +232,7 @@ bestownedpath(s_char *bpath,
     } while (markedsectors);
 
     bpath[0] = 0;
-    return ((s_char *)0);      /* no route possible    */
+    return NULL;               /* no route possible    */
 }
 
 /* return TRUE if sector is passable */
@@ -249,7 +249,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))
-       return (1);
+       return 1;
 
     /* Are we checking this map? */
     if (map) {
@@ -257,14 +257,14 @@ owned_and_navigable(s_char *map, int x, int y, s_char *terrain, int own)
           since otherwise we'll never venture anywhere */
        mapspot = map[sctoff(x, y)];
        if (mapspot == ' ' || mapspot == 0)
-           return (1);
+           return 1;
 
        /* Now, is it marked with a 'x' or 'X'? If so, avoid it! */
        if (mapspot == 'x' || mapspot == 'X')
-           return (0);
+           return 0;
     } else {
        /* We don't know what it is since we have no map, so return ok! */
-       return (1);
+       return 1;
     }
 
     /* Now, check this bmap entry to see if it is one of the
@@ -283,10 +283,10 @@ owned_and_navigable(s_char *map, int x, int y, s_char *terrain, int own)
     }
     if (negate && *t) {
        /* We found it, so we say it's bad since we are negating */
-       return (0);
+       return 0;
     } else if (!negate && !*t) {
        /* We didn't find it, so we say it's bad since we aren't negating */
-       return (0);
+       return 0;
     }
 
     /* According to our bmap, this sector is ok so far. */
@@ -301,16 +301,16 @@ owned_and_navigable(s_char *map, int x, int y, s_char *terrain, int own)
            /* We can't sail through deity sectors, but we can sail
               through any ocean */
            if (rel < FRIENDLY && sect->sct_type != SCT_WATER)
-               return (0);
+               return 0;
        }
     }
     /* Ok, now, check these two sector types */
     /* check for bad harbors. */
     if (c == 'h' && sect->sct_effic < 2)
-       return (0);
+       return 0;
     /* check for bad bridges  */
     if (c == '=' && sect->sct_effic < 60)
-       return (0);
+       return 0;
     /* Woo-hoo, it's ok! */
-    return (1);
+    return 1;
 }
index 55358358f194b84f509e9930a1988997c8a3b22c..271e00aeb4706ceb8030d292879d1e3ae06c7f02 100644 (file)
@@ -175,7 +175,7 @@ ef_ptr(int type, int id)
        logerror("ef_ptr: (%s) only valid for EFF_MEM entries", ep->file);
        return NULL;
     }
-    return (ep->cache + ep->size * id);
+    return ep->cache + ep->size * id;
 }
 
 /*
index 3122e426eda8cb560805b899827564052a83ba8f..98d55b2b473ec930b0efb88efa0a2136a50c269c 100644 (file)
@@ -231,7 +231,7 @@ bp_neighbors(struct as_coord c, struct as_coord *cp, s_char *pp)
        cp[n].y = sy;
        n++;
     }
-    return (n);
+    return n;
 }
 
 /*
@@ -253,7 +253,7 @@ bp_lbcost(struct as_coord from, struct as_coord to, s_char *pp)
     offset = (sy * WORLD_X + sx) / 2;
     ts = (struct sctstr *)(ep->cache + ep->size * offset);
     cost = sector_mcost(ts, bp->bp_mobtype);
-    return (cost);
+    return cost;
 }
 
 /*
@@ -262,7 +262,7 @@ bp_lbcost(struct as_coord from, struct as_coord to, s_char *pp)
 static double
 bp_realcost(struct as_coord from, struct as_coord to, s_char *pp)
 {
-    return (bp_lbcost(from, to, pp));
+    return bp_lbcost(from, to, pp);
 }
 
 /*
@@ -369,12 +369,12 @@ BestShipPath(s_char *path, int fx, int fy, int tx, int ty, int owner)
     /* need to make sector database available to bestpath */
     map = ef_ptr(EF_BMAP, owner);
 
-    return (bestownedpath(path, map, fx, fy, tx, ty, ".=h", owner));
+    return bestownedpath(path, map, fx, fy, tx, ty, ".=h", owner);
 }
 
 s_char *
 BestAirPath(s_char *path, int fx, int fy, int tx, int ty)
 {
-    return (bestownedpath(path, 0, fx, fy, tx, ty, "", -1));
+    return bestownedpath(path, 0, fx, fy, tx, ty, "", -1);
     /*    return (bestpath(path, fx, fy, tx, ty, "")); */
 }
index ea2d8e6d8e8831a2dc1b3ce68623a42941c7da7e..d76468aa940ab41c201f7583b3da58fc8c9e538a 100644 (file)
@@ -139,7 +139,7 @@ demand_update_want(int *want, int *pop, int which)
     }
     *want = totwant;
     *pop = totpop;
-    return (whichwants);
+    return whichwants;
 }
 
 static int
@@ -154,20 +154,20 @@ demand_check(void)
 
     if (0 == update_wantmin) {
        logerror("no demand update allowed, wantmin = 0");
-       return (0);
+       return 0;
     }
 
     demand_update_want(&want, &pop, 0);
     if (want < update_wantmin) {
        logerror("no demand update, want = %d, min = %d",
                 want, update_wantmin);
-       return (0);
+       return 0;
     }
 
     time(&now);
     if (!demand_update_time(&now)) {
        logerror("no demand update, not within hours allowed.");
-       return (0);
+       return 0;
     }
 
 
@@ -183,10 +183,10 @@ demand_check(void)
     if (veto) {
        logerror("no demand update, %d has missed more than %d updates",
                 veto - 1, update_missed);
-       return (0);
+       return 0;
     }
 
-    return (1);
+    return 1;
 }
 
 /* Check if enough countries want an update,
@@ -197,10 +197,10 @@ demandupdatecheck(void)
 {
     if (UDDEM_COMSET != update_demandpolicy) {
        logerror("no demand update, not policy.");
-       return (0);
+       return 0;
     }
 
-    return (demand_check());
+    return demand_check();
 }
 
 /* Is it time for a regular or scheduled update?
@@ -212,27 +212,27 @@ updatetime(time_t *now)
 {
     if (opt_BLITZ && update_policy == UDP_BLITZ) {
        logerror("BLITZ Update.");
-       return (1);
+       return 1;
     }
 
     if (UDP_NORMAL == update_policy) {
        logerror("Regular update, etu type.");
-       return (1);
+       return 1;
     }
 
     if (UDP_TIMES == update_policy) {
        if (scheduled_update_time(now)) {
            logerror("Scheduled update.");
-           return (1);
+           return 1;
        }
     }
     if (opt_DEMANDUPDATE) {
        if (demand_check()) {
            logerror("Demand update, at check time.");
-           return (1);
+           return 1;
        }
     }
-    return (0);
+    return 0;
 }
 
 /* Return the time, and delta seconds, of the next update.
index 95fc032b24c7771eac264ab3b8d6086855fa37e7..389cfc8813a29cd9bd924c8eb00239c57fed732a 100644 (file)
@@ -405,19 +405,19 @@ io_noblocking(struct iop *iop, int value)
 int
 io_conn(struct iop *iop)
 {
-    return (iop->flags & IO_CONN);
+    return iop->flags & IO_CONN;
 }
 
 int
 io_error(struct iop *iop)
 {
-    return (iop->flags & IO_ERROR);
+    return iop->flags & IO_ERROR;
 }
 
 int
 io_eof(struct iop *iop)
 {
-    return (iop->flags & IO_EOF);
+    return iop->flags & IO_EOF;
 }
 
 int
index ecb0e7135e6ed5c1825d6b5c7ec1e725105610ad..06da17a443372a9cad9627f400f450a645a9572b 100644 (file)
 s_char *
 plur(int n, s_char *no, s_char *yes)
 {
-    return (n == 1 ? no : yes);
+    return n == 1 ? no : yes;
 }
 
 s_char *
 splur(int n)
 {
-    return (n == 1 ? "" : "s");
+    return n == 1 ? "" : "s";
 }
 
 s_char *
 esplur(int n)
 {
-    return (n == 1 ? "" : "es");
+    return n == 1 ? "" : "es";
 }
 
 s_char *
 iesplur(int n)
 {
-    return (n == 1 ? "y" : "ies");
+    return n == 1 ? "y" : "ies";
 }
index 68cb1726a891a5f846103eaaf9a92ca5ef13016e..15906cf8eb02b11bdc2a6dc6321c75993553f65e 100644 (file)
@@ -39,7 +39,7 @@ roundintby(int n, int m)
     register int r11;
 
     r11 = (m >> 1) + n;
-    return (r11 / m * m);
+    return r11 / m * m;
 }
 
 int
@@ -48,5 +48,5 @@ ldround(double a4, int ac)
     int f4;
 
     f4 = ac / 2.0 + a4;
-    return (f4 / ac * ac);
+    return f4 / ac * ac;
 }
index 526ec9fe4670c0619a4748e13876cb60d8677c94..08dc256652563c1cff53deea87e29a43f002cd1e 100644 (file)
@@ -40,5 +40,5 @@ scthash(int x, int y, int tsize)
        x = -x;
     if (y < 0)
        y = -y;
-    return ((x * 10 + y) % tsize);
+    return (x * 10 + y) % tsize;
 }
index 6d7e0e901d38ce23d34daf73dd4c80358f98c262..558e33759c3ccde8928876ea7efa08efcb146f85 100644 (file)
@@ -216,7 +216,7 @@ lwpCreate(int priority, void (*entry)(void *), int size, int flags, char *name,
     unsigned long stackp;
 
     if (!(newp = malloc(sizeof(struct lwpProc))))
-       return (0);
+       return 0;
     if (flags & LWP_STACKCHECK) {
        /* Add a 1K buffer on each side of the stack */
        size += 2 * LWP_REDZONE;
@@ -224,7 +224,7 @@ lwpCreate(int priority, void (*entry)(void *), int size, int flags, char *name,
     size += LWP_EXTRASTACK;
     size += sizeof(stkalign_t);
     if (!(s = malloc(size)))
-       return (0);
+       return 0;
     newp->flags = flags;
     newp->name = strdup(name);
     newp->desc = strdup(desc);
@@ -290,7 +290,7 @@ lwpCreate(int priority, void (*entry)(void *), int size, int flags, char *name,
     lwpInitContext(newp, sp);  /* architecture-dependent: from arch.c */
 #endif /* UCONTEXT */
     lwpReschedule();
-    return (newp);
+    return newp;
 }
 
 void
@@ -335,7 +335,7 @@ lwpGetUD(struct lwpProc *p)
 {
     if (!p)
        p = LwpCurrent;
-    return (p->ud);
+    return p->ud;
 }
 
 /*
@@ -415,7 +415,7 @@ lwpSetPriority(int new)
     lwpStatus(LwpCurrent, "resetting priority (%d -> %d)", old, new);
     if (new < old)
        lwpYield();
-    return (old);
+    return old;
 }
 
 /*
@@ -433,9 +433,9 @@ lwpInitSystem(int pri, char **ctxptr, int flags)
        pri = 1;
     /* *LwpContextPtr = 0; */
     if (!(LwpCurrent = calloc(1, sizeof(struct lwpProc))))
-       return (0);
+       return 0;
     if (!(stack = malloc(64)))
-       return (0);
+       return 0;
     if (LWP_MAX_PRIO <= pri)
        pri = LWP_MAX_PRIO - 1;
     if (LwpMaxpri < pri)
@@ -453,7 +453,7 @@ lwpInitSystem(int pri, char **ctxptr, int flags)
     sel = lwpCreate(0, lwpSelect, 16384, flags, "EventHandler",
                    "Select (main loop) Event Handler", 0, 0, 0);
     lwpInitSelect(sel);
-    return (LwpCurrent);
+    return LwpCurrent;
 }
 
 /* lwpStackCheckInit
index 73e0695d47784f79ad73f76460e5d83fcece9044..61e8ea66db0b9a3d927fde0ec950d6e96320bbd7 100644 (file)
@@ -33,7 +33,7 @@ lwpGetFirst(struct lwpQueue *q)
 
     if ((head = q->head) && !(q->head = head->next))
        q->tail = 0;
-    return (head);
+    return head;
 }
 
 void
index 0557222146d7d7b5460e46ea3264e2a1dab1e7fa..2ede982137cf68328a5f829ff5f4e7e5149691ae 100644 (file)
@@ -43,11 +43,11 @@ lwpCreateSem(char *name, int count)
     struct lwpSem *new;
 
     if (!(new = malloc(sizeof(struct lwpSem))))
-       return (0);
+       return 0;
     new->name = strdup(name);
     new->count = count;
     new->q.head = new->q.tail = 0;
-    return (new);
+    return new;
 }
 
 /*
index 57c22dc81163db086949eca75e0460ace2333d79..5758c9b620968694c6d8e250488f43b501d4540e 100644 (file)
@@ -2181,7 +2181,7 @@ take_casualty(int combat_mode, struct combat *off, struct emp_qelem *olist)
     }
 
     if (QEMPTY(olist))
-       return (CASUALTY_LUMP - to_take);
+       return CASUALTY_LUMP - to_take;
 
     /*
      *  Need to take some casualties from attacking units
@@ -2199,11 +2199,11 @@ take_casualty(int combat_mode, struct combat *off, struct emp_qelem *olist)
        }
     }
     if (biggest == (struct emp_qelem *)0)
-       return (CASUALTY_LUMP - to_take);
+       return CASUALTY_LUMP - to_take;
 
     llp = (struct llist *)biggest;
     cas = lnd_take_casualty(combat_mode, llp, to_take);
-    return (CASUALTY_LUMP - (to_take - cas));
+    return CASUALTY_LUMP - (to_take - cas);
 }
 
 /* Send reacting defense units back to where they came from (at no mob cost) */
@@ -2594,16 +2594,14 @@ take_move_in_mob(int combat_mode, struct llist *llp, struct combat *off,
        if (off->shp_mcp->m_flags & M_LAND) {
            if (llp->lcp->l_flags & L_MARINE)
                llp->land.lnd_mobil -=
-                   ((float)etu_per_update * land_mob_scale * 0.5);
+                   (float)etu_per_update * land_mob_scale * 0.5;
            else
-               llp->land.lnd_mobil -= ((float)etu_per_update
-                                       * land_mob_scale);
+               llp->land.lnd_mobil -= (float)etu_per_update * land_mob_scale;
        } else {
            if (llp->lcp->l_flags & L_MARINE)
                llp->land.lnd_mobil = 0;
            else
-               llp->land.lnd_mobil = (((float)etu_per_update
-                                       * land_mob_scale) * (-1));
+               llp->land.lnd_mobil = -(float)etu_per_update * land_mob_scale;
        }
        break;
     case A_BOARD:
index 562a35440f65b1958faddfd8ac82f0bd54e25321..c8c74901544ce107e0d62ef8aff0ada323e4aeb9 100644 (file)
@@ -141,7 +141,7 @@ sd(natid att, natid own, coord x, coord y, int noisy, int defending,
            }
        }
     }
-    return (int)100 - (eff * 100);
+    return (int)100 - eff * 100;
 }
 
 int
index 9ada9e5d4ef3f581db39528aa3ff09bcddddbd28..750184fc4d02a40c9f3534a1b5fd4aab3edb9b24 100644 (file)
@@ -79,7 +79,7 @@ roundrange(double r)
 
     f = r - ((int)r);
     if (chance(f))
-       return (((int)r) + 1);
+       return ((int)r) + 1;
     else
-       return ((int)r);
+       return (int)r;
 }
index 8ce218cf0a4a656422465e9c8f1987bb248fec46..19aa016734c7ee6c599aa01b2a0b56b0ae2fa99b 100644 (file)
@@ -130,7 +130,7 @@ defense_val(struct lndstr *lp)
     if (value < 1.0 && men > 0 && !(lcp->l_flags & L_SPY))
        return 1;
 
-    return (int)(value);
+    return (int)value;
 }
 
 int
@@ -188,8 +188,6 @@ lnd_take_casualty(int combat_mode, struct llist *llp, int cas)
     s_char orig;
     int mob;
 
-
-
     taken = lnd_getmil(&(llp->land));
     /* Spies always die */
     if (llp->lcp->l_flags & L_SPY) {
@@ -274,7 +272,7 @@ lnd_take_casualty(int combat_mode, struct llist *llp, int cas)
                orig = llp->land.lnd_mobil;
                llp->land.lnd_mobil = (s_char)mob;
                if (llp->land.lnd_mobil > orig)
-                   llp->land.lnd_mobil = (-127);
+                   llp->land.lnd_mobil = -127;
                sprintf(buf, "retreats at %d%% efficiency to %s!",
                        llp->land.lnd_effic,
                        xyas(bx, by, llp->land.lnd_own));
@@ -346,9 +344,9 @@ int
 lnd_spyval(struct lndstr *lp)
 {
     if (lchr[(int)lp->lnd_type].l_flags & L_RECON)
-       return (lp->lnd_spy * (lp->lnd_effic / 100.0)) + 2;
+       return lp->lnd_spy * (lp->lnd_effic / 100.0) + 2;
     else
-       return (lp->lnd_spy * (lp->lnd_effic / 100.0));
+       return lp->lnd_spy * (lp->lnd_effic / 100.0);
 }
 
 int
index 9153f61d99828bbbabae84e35ac0e52aa0a6ec29..da3387e53478e91433c5afaab125110d61bcaf71 100644 (file)
@@ -306,7 +306,7 @@ msl_intercept(coord x, coord y, natid bombown, int hardtarget,
     if (icount == 0) {
        if (sect.sct_own != 0)
            mpr(sect.sct_own, "No %ss launched to intercept.\n", def_name);
-       return (destroyed);
+       return destroyed;
     }
 
     /* attempt to destroy incoming missile */
@@ -359,7 +359,7 @@ msl_intercept(coord x, coord y, natid bombown, int hardtarget,
        free(qp);
     }
     if (destroyed)
-       return (destroyed);
+       return destroyed;
     if (icount) {
        mpr(bombown, "%s made it through %s defenses!\n", att_name,
            def_name);
@@ -367,7 +367,7 @@ msl_intercept(coord x, coord y, natid bombown, int hardtarget,
            mpr(sect.sct_own, "%s made it through %s defenses!\n",
                att_name, def_name);
     }
-    return (destroyed);
+    return destroyed;
 }
 
 /* Keep launching missiles on list until mindam damage has been done */
index 141860f75a5e47a9e754016f42fee25456d3ee04..f8f3f6bbec86284bc4cc0c0cd14f11374ad0f918 100644 (file)
@@ -347,11 +347,11 @@ findcondition(s_char code)
     x = 0;
     while (conditions[x].code) {
        if (conditions[x].code == code)
-           return (x);
+           return x;
        x++;
     }
 
-    return (x);
+    return x;
 }
 
 int
index 4f7e570978fba0c4c28e896b4ffd2ee8ceb0edf4..05d5300eda6846bb0285d8d21a7934463b60f98f 100644 (file)
@@ -91,7 +91,7 @@ increase_mob(time_t *counter, float mult)
     *counter = *counter - left;
 
     if (updating_mob)
-       return (newetus);
+       return newetus;
     return 0;
 }
 
index 35726bed7fa34ff99abf39c10bcb4c71b667ac5d..d213e5e0e3aa7c5b36c7181646da69a2d9e02953 100644 (file)
@@ -115,7 +115,7 @@ limit_level(double level, int type, int flag)
            above = logx(above_easy + 1.0, logbase);
        if (above > 250)
            above = 250;
-       return ((above) < 0) ? easy : (easy + above);
+       return above < 0 ? easy : easy + above;
     } else
        return level;
 }
index 40a7829b4d0b011f3dddb3f9a700f38f40cb1dc8..c05501a6d2e8e0ea1b4cb234ca4d52f92bd004d8 100644 (file)
@@ -69,7 +69,7 @@ nxtsctp(struct nstr_sect *np)
            if (np->curdist > np->dist)
                continue;
        }
-       return (getsectp(np->x, np->y));
+       return getsectp(np->x, np->y);
     }
     /*NOTREACHED*/
 }
index da8b193a3cfb4dcc066346b9ded5a7d3fb0477c9..d47854916618644400297db29fc10518a442bf56 100644 (file)
@@ -157,7 +157,7 @@ upd_slmilcosts(natid n, int etu)
            totalmil += mil;
     }
     mil_pay = totalmil * etu * money_mil;
-    return (mil_pay);
+    return mil_pay;
 }
 
 int
index a16931aed66c7c75b47200e88d089e03ed87ecc8..6045e5d8618d7ca54922ea7ad13927b843b81a43 100644 (file)
@@ -99,7 +99,7 @@ sail_find_fleet(struct fltheadstr **head, struct shpstr *sp)
     s_char *cp;
 
     if (sp->shp_own == 0)
-       return (0);
+       return 0;
 
 
 
@@ -111,7 +111,7 @@ sail_find_fleet(struct fltheadstr **head, struct shpstr *sp)
            wu(0, sp->shp_own,
               "Ship #%d, following #%d, which you don't own.\n",
               sp->shp_uid, ap->shp_uid);
-           return (0);
+           return 0;
        }
        /* Not a follower. */
        if (ap->shp_path[0] != 'f')
@@ -124,7 +124,7 @@ sail_find_fleet(struct fltheadstr **head, struct shpstr *sp)
        wu(0, sp->shp_own,
           "Ship #%d, following #%d, which you don't own.\n",
           sp->shp_uid, follow);
-       return (0);
+       return 0;
     }
 
     /* This should prevent infinite loops. */
@@ -132,7 +132,7 @@ sail_find_fleet(struct fltheadstr **head, struct shpstr *sp)
        wu(0, sp->shp_own,
           "Ship #%d, too many follows (circular follow?).\n",
           sp->shp_uid);
-       return (0);
+       return 0;
     }
 
     for (stop = 0, cp = ap->shp_path; (!stop) && (*cp); cp++) {
@@ -160,7 +160,7 @@ sail_find_fleet(struct fltheadstr **head, struct shpstr *sp)
 
     /* if this ship is not sailing anywhere then ignore it. */
     if (!*ap->shp_path)
-       return (0);
+       return 0;
 
     /* Find the fleet structure we belong to. */
     for (fltp = (*head); (fltp && fltp->leader != follow);
@@ -189,7 +189,7 @@ sail_find_fleet(struct fltheadstr **head, struct shpstr *sp)
           "Ship %d not in same sector as its sailing fleet\n",
           sp->shp_uid);
        fltp->real_q = LEADER_WRONGSECT;
-       return (0);
+       return 0;
     }
 
     this = malloc(sizeof(*this));
@@ -245,7 +245,7 @@ sail_nav_fleet(struct fltheadstr *fltp)
     default:
        wu(0, fltp->own, "Your fleet lead by %d is trapped by land.\n",
           fltp->leader);
-       return (0);
+       return 0;
     }
     for (fe = fltp->head; fe; fe = fe->next) {
        sp = getshipp(fe->num);
@@ -257,7 +257,7 @@ sail_nav_fleet(struct fltheadstr *fltp)
        }
     }
     if (error)
-       return (0);
+       return 0;
     sp = getshipp(fltp->leader);
     own = sp->shp_own;
     fltp_to_list(fltp, &ship_list);    /* hack -KHS 1995 */
index b6f0d7a13057952a3fc0c54535ec92fc030c4de0..c22228fe91f608d063143c27052c6f6c5f3efb08 100644 (file)
@@ -154,7 +154,7 @@ FILE *sect_fptr;                    /* the file we write everything to */
 struct sctstr **sects;
 struct sctstr *sectsbuf;
 int fl_status;                 /* is anything wrong? */
-#define STATUS_NO_ROOM (1)     /* there was no room to grow */
+#define STATUS_NO_ROOM 1       /* there was no room to grow */
 #define NUMTRIES 10            /* keep trying to grow this many times */
 
 const char *numletter =