From ce6c0395199ef173abe9a76a10d5e2dd2485f072 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 28 May 2005 08:37:52 +0000 Subject: [PATCH] Remove some redundant casts. --- src/lib/subs/fortdef.c | 4 ++-- src/lib/subs/mission.c | 2 +- src/lib/subs/mslsub.c | 6 +++--- src/lib/subs/plnsub.c | 6 +++--- src/lib/subs/radmap.c | 2 +- src/lib/subs/takeover.c | 4 ++-- src/lib/subs/trdsub.c | 8 ++++---- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/lib/subs/fortdef.c b/src/lib/subs/fortdef.c index 2c3b5d36..0a99b691 100644 --- a/src/lib/subs/fortdef.c +++ b/src/lib/subs/fortdef.c @@ -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; diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index 64416bff..82cfcece 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -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) diff --git a/src/lib/subs/mslsub.c b/src/lib/subs/mslsub.c index c1b54b52..81ff0124 100644 --- a/src/lib/subs/mslsub.c +++ b/src/lib/subs/mslsub.c @@ -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; diff --git a/src/lib/subs/plnsub.c b/src/lib/subs/plnsub.c index 5103d381..c744661f 100644 --- a/src/lib/subs/plnsub.c +++ b/src/lib/subs/plnsub.c @@ -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); diff --git a/src/lib/subs/radmap.c b/src/lib/subs/radmap.c index 71984fe4..b17d2801 100644 --- a/src/lib/subs/radmap.c +++ b/src/lib/subs/radmap.c @@ -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] = '$'; } } diff --git a/src/lib/subs/takeover.c b/src/lib/subs/takeover.c index 99c3f19f..ce0b55db 100644 --- a/src/lib/subs/takeover.c +++ b/src/lib/subs/takeover.c @@ -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; diff --git a/src/lib/subs/trdsub.c b/src/lib/subs/trdsub.c index a5ac2020..72cbdd26 100644 --- a/src/lib/subs/trdsub.c +++ b/src/lib/subs/trdsub.c @@ -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;