Remove superflous casts and parenthesis.

This commit is contained in:
Markus Armbruster 2006-05-21 12:24:30 +00:00
parent f883710417
commit cd73a47dfa
28 changed files with 136 additions and 145 deletions

View file

@ -112,7 +112,7 @@ buy(void)
bid = atof(p);
if (bid <= 0)
return RET_FAIL;
if (natp->nat_money < (bid * comm.com_amount * buytax)) {
if (natp->nat_money < bid * comm.com_amount * buytax) {
pr("This purchase would cost %.2f, %.2f more than you have.\n",
bid * comm.com_amount * buytax,
bid * comm.com_amount * buytax - natp->nat_money);
@ -131,12 +131,12 @@ buy(void)
for (q = 0; getcomm(q, &comt); q++) {
if (comt.com_maxbidder == player->cnum &&
comt.com_owner != 0 && comt.com_owner != player->cnum) {
tally += (comt.com_price * comt.com_amount) * buytax;
tally += comt.com_price * comt.com_amount * buytax;
}
}
canspend = natp->nat_money - tally;
getcomm(o, &comm);
if ((bid * comm.com_amount * buytax) > canspend) {
if (bid * comm.com_amount * buytax > canspend) {
pr("You have overextended yourself in the market\n");
pr("You can not bid on the current items at that price.\n");
return RET_OK;
@ -165,7 +165,7 @@ buy(void)
qty, ip->i_name, n);
return RET_FAIL;
}
if ((bid * comm.com_amount) > natp->nat_money) {
if (bid * comm.com_amount > natp->nat_money) {
pr("You don't have that much to spend!\n");
return RET_FAIL;
}

View file

@ -260,7 +260,7 @@ look_land(struct lndstr *lookland)
int dist;
drange = techfact(lookland->lnd_tech, lookland->lnd_spy);
drange = (drange * ((double)lookland->lnd_effic / 100.0));
drange *= lookland->lnd_effic / 100.0;
range = ldround(drange, 1);
if (range == 0)

View file

@ -364,7 +364,7 @@ multifire(void)
shots = gun;
guneff = seagun(fship.shp_effic, shots);
dam = (int)guneff;
shell -= ldround(((double)shots) / 2.0, 1);
shell -= ldround(shots / 2.0, 1);
fship.shp_item[I_SHELL] = shell;
if (opt_NOMOBCOST == 0)
fship.shp_mobil = MAX(fship.shp_mobil - 15, -100);
@ -414,8 +414,8 @@ multifire(void)
dam = (int)landunitgun(fland.lnd_effic, fland.lnd_dam, gun,
fland.lnd_ammo, shell);
if (target == targ_ship) {
if (chance(((double)fland.lnd_acc) / 100.0))
dam = ldround(((double)dam / 2.0), 1);
if (chance(fland.lnd_acc / 100.0))
dam = ldround(dam / 2.0, 1);
}
use_supply(&fland);
resupply_commod(&fland, I_SHELL); /* Get more shells */
@ -554,7 +554,7 @@ multifire(void)
prb *= prb;
if (chance(prb)) {
pr("Wind deflects shell%s.\n", splur(shots));
/* dam = (int)((double)dam / 2.0);*/
/* dam = (int)(dam / 2.0);*/
dam *= (90 - (random() % 11)) / 100.0;
if (dam < 0)
dam = 0;
@ -713,7 +713,7 @@ do_defdam(struct emp_qelem *list, double odds)
pr("\nDefenders fire back!\n");
first = 0;
}
dam = (odds * (double)fp->defdam);
dam = odds * fp->defdam;
if (fp->type == targ_ship) {
vict = fp->victim;

View file

@ -209,7 +209,7 @@ mission(void)
return RET_FAIL;
}
mobused = ldround((mission_mob_cost * (double)mobmax), 1);
mobused = ldround(mission_mob_cost * (double)mobmax, 1);
while (nxtitem(&ni, &item)) {
gp = (struct genitem *)&item;

View file

@ -75,10 +75,10 @@ rada(void)
if (!snxtsct(&ns, cp))
return RET_SYN;
tech = tfact(player->cnum, 8.0);
if (tech > ((double)WORLD_Y / 4.0))
tech = ((double)WORLD_Y / 4.0);
if (tech > ((double)WORLD_X / 8.0))
tech = ((double)WORLD_X / 8.0);
if (tech > WORLD_Y / 4.0)
tech = WORLD_Y / 4.0;
if (tech > WORLD_X / 8.0)
tech = WORLD_X / 8.0;
while (nxtsct(&ns, &sect)) {
if (sect.sct_type != SCT_RADAR)
continue;
@ -105,11 +105,11 @@ rada(void)
tf = 0.0;
pr("%s at ", prship(&ship));
tech = techfact(ship.shp_tech,
(double)mchr[(int)ship.shp_type].m_vrnge);
if (tech > ((double)WORLD_Y / 2.0))
tech = ((double)WORLD_Y / 2.0);
if (tech > ((double)WORLD_X / 4.0))
tech = ((double)WORLD_X / 4.0);
mchr[(int)ship.shp_type].m_vrnge);
if (tech > WORLD_Y / 2.0)
tech = WORLD_Y / 2.0;
if (tech > WORLD_X / 4.0)
tech = WORLD_X / 4.0;
radmap(ship.shp_x, ship.shp_y, ship.shp_effic,
(int)tech, tf);
}
@ -133,10 +133,10 @@ rada(void)
tf = 0.0;
pr("%s at ", prland(&land));
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))
tech = ((double)WORLD_X / 4.0);
if (tech > WORLD_Y / 2.0)
tech = WORLD_Y / 2.0;
if (tech > WORLD_X / 4.0)
tech = WORLD_X / 4.0;
radmap(land.lnd_x, land.lnd_y, land.lnd_effic,
(int)tech, tf);
}

View file

@ -152,7 +152,7 @@ spy(void)
continue;
}
/* catch spy N/200 chance, N = # military */
caught = chance((double)dsect.sct_item[I_MILIT] / 200.0);
caught = chance(dsect.sct_item[I_MILIT] / 200.0);
own = dsect.sct_own;
/* determine spyee relations with spyer */
relat = getrel(getnatp(own), player->cnum);

View file

@ -346,7 +346,7 @@ fire_dchrg(struct shpstr *sp, struct shpstr *targ, int ntargets)
return;
/* ok, all set.. now, we shoot */
shells -= ldround(((double)gun) / 2.0, 1);
shells -= ldround(gun / 2.0, 1);
sp->shp_item[I_SHELL] = shells;
putship(sp->shp_uid, sp);