]> git.pond.sub.org Git - empserver/commitdiff
Remove some redundant casts.
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 28 May 2005 08:37:52 +0000 (08:37 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 28 May 2005 08:37:52 +0000 (08:37 +0000)
src/lib/subs/fortdef.c
src/lib/subs/mission.c
src/lib/subs/mslsub.c
src/lib/subs/plnsub.c
src/lib/subs/radmap.c
src/lib/subs/takeover.c
src/lib/subs/trdsub.c

index 2c3b5d36c88d93fd003dc289d41780cf9c6707cc..0a99b691de84d7a96012a1105119479a81029f92 100644 (file)
@@ -188,7 +188,7 @@ dd(natid att, natid def_own, coord ax, coord ay, int noisy, int defending)
            continue;
        if (firing.sct_own == 0)
            continue;
-       if (firing.sct_effic < (u_char)FORTEFF)
+       if (firing.sct_effic < FORTEFF)
            continue;
        rel = getrel(getnatp(firing.sct_own), def_own);
        rel2 = getrel(getnatp(firing.sct_own), att);
@@ -231,7 +231,7 @@ sb(natid att, natid def, struct sctstr *sp, coord tx, coord ty, int noisy,
        return 0;
     }
 
-    if (sp->sct_effic < (u_char)FORTEFF)
+    if (sp->sct_effic < FORTEFF)
        return 0;
 
     own = sp->sct_own;
index 64416bff0bdfd68a7df2539beb686dd98595713e..82cfcece99b1fd372f12a1fbe6c2e1c22c73d56b 100644 (file)
@@ -549,7 +549,7 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
    a sub. */
                if (*s != 's')
                    continue;
-               if (sp->shp_mobil < (s_char)0)
+               if (sp->shp_mobil < 0)
                    continue;
                gun = sp->shp_item[I_GUN];
                if (gun < 1)
index c1b54b52129977441e21be4d1000df2f69072ad9..81ff012437db5331f37e492afe2899d23e7341f0 100644 (file)
@@ -123,7 +123,7 @@ msl_hit(struct plnstr *pp, int hardtarget, int type, int news_item,
 
     mpr(pp->pln_own, "\tSHWOOOOOSH!  Missile launched!\n");
 
-    if (pp->pln_nuketype != (s_char)-1)
+    if (pp->pln_nuketype != -1)
        mpr(pp->pln_own, "\tArming nuclear warheads...\n");
 
     if (pcp->pl_flags & P_T)
@@ -144,7 +144,7 @@ msl_hit(struct plnstr *pp, int hardtarget, int type, int news_item,
        }
     }
 
-    if (pp->pln_nuketype != (s_char)-1)
+    if (pp->pln_nuketype != -1)
        hitchance = 100;
 
     mpr(pp->pln_own, "\t%d%% hitchance...", hitchance);
@@ -193,7 +193,7 @@ msl_sel(struct emp_qelem *list, coord x, coord y, natid victim,
        /* missiles go one way, so we can use all the range */
        if (plane.pln_range < mapdist(x, y, plane.pln_x, plane.pln_y))
            continue;
-       if (plane.pln_mobil <= (s_char)0)
+       if (plane.pln_mobil <= 0)
            continue;
        if (plane.pln_effic < 100)
            continue;
index 5103d3818d3d6dabb51c4d13e2ff28d0f32334f3..c744661f6a332a429482b1af048103a933511e84 100644 (file)
@@ -342,7 +342,7 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
     while (nxtitem(ni, (s_char *)&plane)) {
        if (!player->owner)
            continue;
-       if (plane.pln_mobil <= (s_char)0)
+       if (plane.pln_mobil <= 0)
            continue;
        if (opt_MARKET) {
            if (ontradingblock(EF_PLANE, (int *)&plane)) {
@@ -635,7 +635,7 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission)
            needed = pp->pln_load / ip->i_lbs;
            break;
        case 'n':
-           if (pp->pln_nuketype == (s_char)-1)
+           if (pp->pln_nuketype == -1)
                rval = -1;
            break;
        default:
@@ -1128,7 +1128,7 @@ pln_damage(struct plnstr *pp, coord x, coord y, s_char type, int *nukedamp,
     int effective = 1;
     int pinbomber = 0;
 
-    if (pp->pln_nuketype != (s_char)-1) {
+    if (pp->pln_nuketype != -1) {
        mpr(pp->pln_own, "Releasing RV's for %s detonation...\n",
            pp->pln_flags & PLN_AIRBURST ? "airburst" : "groundburst");
        *nukedamp = detonate(pp, x, y);
index 71984fe4a1c59f448183e9419017f9e2d163a35d..b17d2801309b8db5a9da485f65606d3eecf818c2 100644 (file)
@@ -144,7 +144,7 @@ radmap2(int owner,
        y = delty(&ns.range, (int)plane.pln_y);
 
        if ((plane.pln_flags & PLN_LAUNCHED) && plane.pln_own != owner) {
-           vis[y][x] = (s_char)100;
+           vis[y][x] = 100;
            rad[y][x] = '$';
        }
     }
index 99c3f19fd24797f0e9cee132599e71cf88fb0638..ce0b55dbd0ba9dd970374b72b6b60304a9b0524d 100644 (file)
@@ -182,7 +182,7 @@ takeover_plane(struct plnstr *pp, natid newown)
     if (n < 0)
        n = 0;
     pp->pln_effic = n;
-    if (pp->pln_effic < PLANE_MINEFF || pp->pln_harden > (s_char)0) {
+    if (pp->pln_effic < PLANE_MINEFF || pp->pln_harden > 0) {
        pp->pln_effic = 0;
        mpr(newown, "%s blown up by the crew!\n", prplane(pp));
        wu(0, pp->pln_own,
@@ -198,7 +198,7 @@ takeover_plane(struct plnstr *pp, natid newown)
     }
     if (opt_MARKET)
        trdswitchown(EF_PLANE, (int *)pp, newown);
-    if (pp->pln_mobil > (s_char)0)
+    if (pp->pln_mobil > 0)
        pp->pln_mobil = 0;
     makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
     pp->pln_own = newown;
index a5ac2020237c1d35a9a1466a02b28c98ef8ef692..72cbdd26f6dd04addb6264f86d0aa90c66c82657 100644 (file)
@@ -145,7 +145,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
                       plane.pln_tech,
                       plane.pln_effic,
                       plchr[(int)plane.pln_type].pl_name, plane.pln_uid);
-                   if (plane.pln_nuketype != (s_char)-1) {
+                   if (plane.pln_nuketype != -1) {
                        pr("(%s)", nchr[(int)plane.pln_nuketype].n_name);
                    }
                }
@@ -166,7 +166,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
                                   plane.pln_effic,
                                   plchr[(int)plane.pln_type].pl_name,
                                   plane.pln_uid);
-                               if (plane.pln_nuketype != (s_char)-1) {
+                               if (plane.pln_nuketype != -1) {
                                    pr("(%s)",
                                       nchr[(int)plane.pln_nuketype].
                                       n_name);
@@ -203,7 +203,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
                       plane.pln_tech,
                       plane.pln_effic,
                       plchr[(int)plane.pln_type].pl_name, plane.pln_uid);
-                   if (plane.pln_nuketype != (s_char)-1) {
+                   if (plane.pln_nuketype != -1) {
                        pr("(%s)", nchr[(int)plane.pln_nuketype].n_name);
                    }
                }
@@ -219,7 +219,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
           pp->pln_tech,
           pp->pln_effic,
           plchr[(int)pp->pln_type].pl_name, tp->trd_unitid);
-       if (pp->pln_nuketype != (s_char)-1) {
+       if (pp->pln_nuketype != -1) {
            pr("(%s)", nchr[(int)pp->pln_nuketype].n_name);
        }
        break;