Remove redundant casts of argument to (prototyped) double parameter.
This commit is contained in:
parent
7c3899bf89
commit
7ed308526c
19 changed files with 82 additions and 93 deletions
|
@ -550,7 +550,7 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
|
|||
}
|
||||
mcp = &mchr[(int)ship.shp_type];
|
||||
if (gun > 0 && shell > 0 && !(mcp->m_flags & M_SUB)) {
|
||||
flak = (int)(techfact(ship.shp_tech, (double)gun) * 2.0);
|
||||
flak = (int)(techfact(ship.shp_tech, gun) * 2.0);
|
||||
ship.shp_item[I_SHELL] = shell;
|
||||
putship(ship.shp_uid, &ship);
|
||||
PR(ship.shp_own, "Flak! Firing %d guns from ship %s\n",
|
||||
|
@ -775,7 +775,7 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
|
|||
if (unitno < 0)
|
||||
continue;
|
||||
|
||||
flak = (int)(techfact(land.lnd_tech, (double)land.lnd_aaf) * 3.0);
|
||||
flak = (int)(techfact(land.lnd_tech, land.lnd_aaf) * 3.0);
|
||||
if (flak) {
|
||||
PR(land.lnd_own,
|
||||
"Flak! Firing flak guns from unit %s (aa rating %d)\n",
|
||||
|
|
|
@ -127,7 +127,7 @@ look_ship(struct shpstr *lookship)
|
|||
int dist;
|
||||
|
||||
range = (int)techfact(lookship->shp_tech,
|
||||
(double)mchr[(int)lookship->shp_type].m_vrnge);
|
||||
mchr[(int)lookship->shp_type].m_vrnge);
|
||||
range = range * (lookship->shp_effic / 100.0);
|
||||
smcp = &mchr[(int)lookship->shp_type];
|
||||
if (smcp->m_flags & M_SUB)
|
||||
|
@ -259,7 +259,7 @@ look_land(struct lndstr *lookland)
|
|||
int i;
|
||||
int dist;
|
||||
|
||||
drange = techfact(lookland->lnd_tech, (double)lookland->lnd_spy);
|
||||
drange = techfact(lookland->lnd_tech, lookland->lnd_spy);
|
||||
drange = (drange * ((double)lookland->lnd_effic / 100.0));
|
||||
range = ldround(drange, 1);
|
||||
|
||||
|
@ -280,7 +280,7 @@ look_land(struct lndstr *lookland)
|
|||
if (!(chance(LND_SPY_DETECT_CHANCE(lp->lnd_effic))))
|
||||
continue;
|
||||
}
|
||||
vrange = ldround((double)((lp->lnd_vis * range) / 20.0), 1);
|
||||
vrange = ldround((lp->lnd_vis * range) / 20.0, 1);
|
||||
dist = mapdist(lp->lnd_x, lp->lnd_y,
|
||||
lookland->lnd_x, lookland->lnd_y);
|
||||
if (dist > vrange)
|
||||
|
@ -288,7 +288,7 @@ look_land(struct lndstr *lookland)
|
|||
|
||||
pr("%s (#%d) %s (approx %d mil) @ %s\n",
|
||||
cname(lp->lnd_own), lp->lnd_own,
|
||||
prland(lp), ldround((double)total_mil(lp), 20),
|
||||
prland(lp), ldround(total_mil(lp), 20),
|
||||
xyas(lp->lnd_x, lp->lnd_y, player->cnum));
|
||||
if (opt_HIDDEN)
|
||||
setcont(player->cnum, lp->lnd_own, FOUND_LOOK);
|
||||
|
@ -300,7 +300,7 @@ look_land(struct lndstr *lookland)
|
|||
continue;
|
||||
if (pp->pln_flags & PLN_LAUNCHED)
|
||||
continue;
|
||||
vrange = ldround((double)((10 * range) / 20.0), 1);
|
||||
vrange = ldround((10 * range) / 20.0, 1);
|
||||
dist = mapdist(pp->pln_x, pp->pln_y,
|
||||
lookland->lnd_x, lookland->lnd_y);
|
||||
if (dist > vrange)
|
||||
|
|
|
@ -803,9 +803,8 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
|
|||
if (ship.shp_mobil <= 0)
|
||||
continue;
|
||||
*/
|
||||
erange = ship.shp_effic *
|
||||
techfact(ship.shp_tech, ((double)ship.shp_frnge))
|
||||
/ 100.0;
|
||||
erange = ship.shp_effic
|
||||
* techfact(ship.shp_tech, ship.shp_frnge) / 100.0;
|
||||
erange = (double)roundrange(erange);
|
||||
range = mapdist(ship.shp_x, ship.shp_y, ax, ay);
|
||||
if (range > erange)
|
||||
|
|
|
@ -131,9 +131,9 @@ navi(void)
|
|||
}
|
||||
radmapnopr(shp->shp_x, shp->shp_y, (int)shp->shp_effic,
|
||||
(int)techfact(shp->shp_tech,
|
||||
(double)mchr[(int)shp->shp_type].m_vrnge),
|
||||
(double)((mchr[(int)shp->shp_type].m_flags & M_SONAR)
|
||||
? techfact(shp->shp_tech, 1.0) : 0.0));
|
||||
mchr[(int)shp->shp_type].m_vrnge),
|
||||
(mchr[(int)shp->shp_type].m_flags & M_SONAR)
|
||||
? techfact(shp->shp_tech, 1.0) : 0.0);
|
||||
if (cp == 0 || *cp == '\0')
|
||||
cp = &dirch[DIR_STOP];
|
||||
if (*cp == 'M' ||
|
||||
|
|
|
@ -132,7 +132,7 @@ rada(void)
|
|||
}
|
||||
tf = 0.0;
|
||||
pr("%s at ", prland(&land));
|
||||
tech = techfact(land.lnd_tech, (double)land.lnd_spy);
|
||||
tech = techfact(land.lnd_tech, land.lnd_spy);
|
||||
if (tech > ((double)WORLD_Y / 2.0))
|
||||
tech = ((double)WORLD_Y / 2.0);
|
||||
if (tech > ((double)WORLD_X / 4.0))
|
||||
|
|
|
@ -115,7 +115,7 @@ sona(void)
|
|||
getsect(ship.shp_x, ship.shp_y, §);
|
||||
if (sect.sct_type != SCT_WATER)
|
||||
continue;
|
||||
range = (int)techfact(ship.shp_tech, (double)mcp->m_vrnge);
|
||||
range = (int)techfact(ship.shp_tech, mcp->m_vrnge);
|
||||
srange = MIN(7, 7 * range * ship.shp_effic / 200);
|
||||
pr("%s at %s efficiency %d%%, max range %d\n",
|
||||
prship(&ship),
|
||||
|
@ -248,9 +248,7 @@ plane_sona(struct emp_qelem *plane_list, int x, int y,
|
|||
pcp = ip->pcp;
|
||||
if (!(pcp->pl_flags & P_A)) /* if it isn't an ASW plane */
|
||||
continue;
|
||||
range =
|
||||
(int)techfact(pp->pln_tech,
|
||||
(double)((100 - pp->pln_acc) / 10));
|
||||
range = (int)techfact(pp->pln_tech, (100 - pp->pln_acc) / 10);
|
||||
/*
|
||||
for (i=0; targ = getshipp(i); i++) {
|
||||
*/
|
||||
|
|
|
@ -165,7 +165,7 @@ torp(void)
|
|||
continue;
|
||||
}
|
||||
erange = ((double)sub.shp_effic / 100.0) *
|
||||
techfact(sub.shp_tech, ((double)sub.shp_frnge));
|
||||
techfact(sub.shp_tech, sub.shp_frnge);
|
||||
erange = (double)roundrange(erange);
|
||||
pr("Effective torpedo range is %.1f\n", erange);
|
||||
shells -= SHP_TORP_SHELLS;
|
||||
|
@ -263,7 +263,7 @@ anti_torp(int f, int ntorping, int vshipown)
|
|||
if (!canshoot(&dd, &sub))
|
||||
continue;
|
||||
|
||||
erange = techfact(dd.shp_tech, ((double)dd.shp_frnge)) / 2.0;
|
||||
erange = techfact(dd.shp_tech, dd.shp_frnge) / 2.0;
|
||||
|
||||
erange = (double)roundrange(erange);
|
||||
|
||||
|
|
|
@ -245,7 +245,7 @@ tran_plane(void)
|
|||
return RET_FAIL;
|
||||
}
|
||||
dam = 1;
|
||||
mcost = move_ground(§, &endsect, (double)weight,
|
||||
mcost = move_ground(§, &endsect, weight,
|
||||
player->argp[3], tran_map, 0, &dam);
|
||||
dam /= count;
|
||||
if (mcost < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue