Remove some redundant casts.

This commit is contained in:
Markus Armbruster 2005-05-28 08:37:52 +00:00
parent e2fe05be18
commit ce6c039519
7 changed files with 16 additions and 16 deletions

View file

@ -188,7 +188,7 @@ dd(natid att, natid def_own, coord ax, coord ay, int noisy, int defending)
continue; continue;
if (firing.sct_own == 0) if (firing.sct_own == 0)
continue; continue;
if (firing.sct_effic < (u_char)FORTEFF) if (firing.sct_effic < FORTEFF)
continue; continue;
rel = getrel(getnatp(firing.sct_own), def_own); rel = getrel(getnatp(firing.sct_own), def_own);
rel2 = getrel(getnatp(firing.sct_own), att); 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; return 0;
} }
if (sp->sct_effic < (u_char)FORTEFF) if (sp->sct_effic < FORTEFF)
return 0; return 0;
own = sp->sct_own; own = sp->sct_own;

View file

@ -549,7 +549,7 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
a sub. */ a sub. */
if (*s != 's') if (*s != 's')
continue; continue;
if (sp->shp_mobil < (s_char)0) if (sp->shp_mobil < 0)
continue; continue;
gun = sp->shp_item[I_GUN]; gun = sp->shp_item[I_GUN];
if (gun < 1) if (gun < 1)

View 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"); 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"); mpr(pp->pln_own, "\tArming nuclear warheads...\n");
if (pcp->pl_flags & P_T) 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; hitchance = 100;
mpr(pp->pln_own, "\t%d%% hitchance...", hitchance); 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 */ /* missiles go one way, so we can use all the range */
if (plane.pln_range < mapdist(x, y, plane.pln_x, plane.pln_y)) if (plane.pln_range < mapdist(x, y, plane.pln_x, plane.pln_y))
continue; continue;
if (plane.pln_mobil <= (s_char)0) if (plane.pln_mobil <= 0)
continue; continue;
if (plane.pln_effic < 100) if (plane.pln_effic < 100)
continue; continue;

View file

@ -342,7 +342,7 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
while (nxtitem(ni, (s_char *)&plane)) { while (nxtitem(ni, (s_char *)&plane)) {
if (!player->owner) if (!player->owner)
continue; continue;
if (plane.pln_mobil <= (s_char)0) if (plane.pln_mobil <= 0)
continue; continue;
if (opt_MARKET) { if (opt_MARKET) {
if (ontradingblock(EF_PLANE, (int *)&plane)) { 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; needed = pp->pln_load / ip->i_lbs;
break; break;
case 'n': case 'n':
if (pp->pln_nuketype == (s_char)-1) if (pp->pln_nuketype == -1)
rval = -1; rval = -1;
break; break;
default: default:
@ -1128,7 +1128,7 @@ pln_damage(struct plnstr *pp, coord x, coord y, s_char type, int *nukedamp,
int effective = 1; int effective = 1;
int pinbomber = 0; 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", mpr(pp->pln_own, "Releasing RV's for %s detonation...\n",
pp->pln_flags & PLN_AIRBURST ? "airburst" : "groundburst"); pp->pln_flags & PLN_AIRBURST ? "airburst" : "groundburst");
*nukedamp = detonate(pp, x, y); *nukedamp = detonate(pp, x, y);

View file

@ -144,7 +144,7 @@ radmap2(int owner,
y = delty(&ns.range, (int)plane.pln_y); y = delty(&ns.range, (int)plane.pln_y);
if ((plane.pln_flags & PLN_LAUNCHED) && plane.pln_own != owner) { if ((plane.pln_flags & PLN_LAUNCHED) && plane.pln_own != owner) {
vis[y][x] = (s_char)100; vis[y][x] = 100;
rad[y][x] = '$'; rad[y][x] = '$';
} }
} }

View file

@ -182,7 +182,7 @@ takeover_plane(struct plnstr *pp, natid newown)
if (n < 0) if (n < 0)
n = 0; n = 0;
pp->pln_effic = n; 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; pp->pln_effic = 0;
mpr(newown, "%s blown up by the crew!\n", prplane(pp)); mpr(newown, "%s blown up by the crew!\n", prplane(pp));
wu(0, pp->pln_own, wu(0, pp->pln_own,
@ -198,7 +198,7 @@ takeover_plane(struct plnstr *pp, natid newown)
} }
if (opt_MARKET) if (opt_MARKET)
trdswitchown(EF_PLANE, (int *)pp, newown); trdswitchown(EF_PLANE, (int *)pp, newown);
if (pp->pln_mobil > (s_char)0) if (pp->pln_mobil > 0)
pp->pln_mobil = 0; pp->pln_mobil = 0;
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y); makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
pp->pln_own = newown; pp->pln_own = newown;

View file

@ -145,7 +145,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
plane.pln_tech, plane.pln_tech,
plane.pln_effic, plane.pln_effic,
plchr[(int)plane.pln_type].pl_name, plane.pln_uid); 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); pr("(%s)", nchr[(int)plane.pln_nuketype].n_name);
} }
} }
@ -166,7 +166,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
plane.pln_effic, plane.pln_effic,
plchr[(int)plane.pln_type].pl_name, plchr[(int)plane.pln_type].pl_name,
plane.pln_uid); plane.pln_uid);
if (plane.pln_nuketype != (s_char)-1) { if (plane.pln_nuketype != -1) {
pr("(%s)", pr("(%s)",
nchr[(int)plane.pln_nuketype]. nchr[(int)plane.pln_nuketype].
n_name); n_name);
@ -203,7 +203,7 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
plane.pln_tech, plane.pln_tech,
plane.pln_effic, plane.pln_effic,
plchr[(int)plane.pln_type].pl_name, plane.pln_uid); 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); 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_tech,
pp->pln_effic, pp->pln_effic,
plchr[(int)pp->pln_type].pl_name, tp->trd_unitid); 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); pr("(%s)", nchr[(int)pp->pln_nuketype].n_name);
} }
break; break;