(ship_bomb, deli, do_demo, fuel, grin, look_ship)
(ltend, multifire, quite_bigdef, mine, landmine) (do_loan, prod, printdiff, sell, sona, stre) (tend, fire_dchrg, vers, work, ac_planedamage) (ac_shipflak, ask_off, get_mine_dsupport, att_fight) (ask_move_in_off, detonate, sd, land_gun) (land_unitgun, lnd_fort_interdiction, lnd_fortify) (perform_mission, pln_mine, pln_mobcost) (retreat_ship1, retreat_land1, shp_sweep) (shp_fort_interdiction, shp_missle_defense) (new_work, growfood, upd_land, land_repair) (get_materials, do_mob_ship, do_mob_land) (load_it, unload_it, prod_plane, produce) (guerrilla, upd_buildeff, spread_fallout) (upd_ship, ship_repair, min, dmin, MIN): Remove min() and dmin() functions and replace with a MIN macro in misc.h. Remove local MIN macros and use the new one in misc.h. This change removes the need for the special case for _WIN32. (fuel, look_ship, multifire, mission, sona) (plane_sona, ef_open, player_accept, player_main) (ac_dog, att_get_combat, calc_mobcost) (ask_move_in_off, intelligence_report) (build_mission_list_type, perform_mission) (show_mission, use_supply, dodistribute) (allocate_memory, max, dmax, MAX): Remove max() and dmax() functions and replace with a MAX macro in misc.h. Remove local MAX macros and use the new one in misc.h. This change removes the need for the special case for _WIN32.
This commit is contained in:
parent
b89de57d51
commit
04a8b84592
48 changed files with 152 additions and 251 deletions
|
@ -174,8 +174,8 @@ fuel(void)
|
|||
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||
continue;
|
||||
}
|
||||
move_amt = min(tot_fuel, fuel_amt);
|
||||
move_amt = min(move_amt, max_amt);
|
||||
move_amt = MIN(tot_fuel, fuel_amt);
|
||||
move_amt = MIN(move_amt, max_amt);
|
||||
|
||||
if (move_amt == 0)
|
||||
continue;
|
||||
|
@ -187,21 +187,21 @@ fuel(void)
|
|||
extra = ((float)move_amt / 5.0) - (move_amt / 5);
|
||||
if (extra > 0.0)
|
||||
sect.sct_item[I_PETROL]
|
||||
= max((pet_amt - move_amt / 5) - 1, 0);
|
||||
= MAX((pet_amt - move_amt / 5) - 1, 0);
|
||||
else
|
||||
sect.sct_item[I_PETROL]
|
||||
= max((pet_amt - move_amt / 5), 0);
|
||||
= MAX((pet_amt - move_amt / 5), 0);
|
||||
} else {
|
||||
sect.sct_item[I_PETROL] = 0;
|
||||
move_amt -= pet_amt * 5;
|
||||
extra = ((float)move_amt / 50.0) - (move_amt / 50);
|
||||
sect.sct_item[I_OIL] = max(oil_amt - move_amt / 50, 0);
|
||||
sect.sct_item[I_OIL] = MAX(oil_amt - move_amt / 50, 0);
|
||||
if (extra > 0.0)
|
||||
sect.sct_item[I_OIL]
|
||||
= max((oil_amt - move_amt / 50) - 1, 0);
|
||||
= MAX((oil_amt - move_amt / 50) - 1, 0);
|
||||
else
|
||||
sect.sct_item[I_OIL]
|
||||
= max((oil_amt - move_amt / 50), 0);
|
||||
= MAX((oil_amt - move_amt / 50), 0);
|
||||
}
|
||||
|
||||
/* load plague */
|
||||
|
@ -250,8 +250,8 @@ fuel(void)
|
|||
continue;
|
||||
}
|
||||
tot_fuel = oil_amt * 50 + pet_amt * 5;
|
||||
move_amt = min(tot_fuel, fuel_amt);
|
||||
move_amt = min(move_amt, max_amt);
|
||||
move_amt = MIN(tot_fuel, fuel_amt);
|
||||
move_amt = MIN(move_amt, max_amt);
|
||||
|
||||
if (move_amt == 0)
|
||||
continue;
|
||||
|
@ -263,22 +263,22 @@ fuel(void)
|
|||
extra = ((float)move_amt / 5.0) - (move_amt / 5);
|
||||
if (extra > 0.0)
|
||||
item2.ship.shp_item[I_PETROL]
|
||||
= max((pet_amt - move_amt / 5) - 1, 0);
|
||||
= MAX((pet_amt - move_amt / 5) - 1, 0);
|
||||
else
|
||||
item2.ship.shp_item[I_PETROL]
|
||||
= max((pet_amt - move_amt / 5), 0);
|
||||
= MAX((pet_amt - move_amt / 5), 0);
|
||||
} else {
|
||||
item2.ship.shp_item[I_PETROL] = 0;
|
||||
move_amt -= pet_amt * 5;
|
||||
extra = ((float)move_amt / 50.0) - (move_amt / 50);
|
||||
item2.ship.shp_item[I_OIL]
|
||||
= max(oil_amt - (move_amt / 50), 0);
|
||||
= MAX(oil_amt - (move_amt / 50), 0);
|
||||
if (extra > 0.0)
|
||||
item2.ship.shp_item[I_OIL]
|
||||
= max((oil_amt - move_amt / 50) - 1, 0);
|
||||
= MAX((oil_amt - move_amt / 50) - 1, 0);
|
||||
else
|
||||
item2.ship.shp_item[I_OIL]
|
||||
= max((oil_amt - move_amt / 50), 0);
|
||||
= MAX((oil_amt - move_amt / 50), 0);
|
||||
}
|
||||
|
||||
/* load plague */
|
||||
|
@ -335,8 +335,8 @@ fuel(void)
|
|||
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||
continue;
|
||||
}
|
||||
move_amt = min(tot_fuel, fuel_amt);
|
||||
move_amt = min(move_amt, max_amt);
|
||||
move_amt = MIN(tot_fuel, fuel_amt);
|
||||
move_amt = MIN(move_amt, max_amt);
|
||||
|
||||
if (move_amt == 0)
|
||||
continue;
|
||||
|
@ -348,21 +348,21 @@ fuel(void)
|
|||
extra = ((float)move_amt / 5.0) - (move_amt / 5);
|
||||
if (extra > 0.0)
|
||||
sect.sct_item[I_PETROL]
|
||||
= max((pet_amt - move_amt / 5) - 1, 0);
|
||||
= MAX((pet_amt - move_amt / 5) - 1, 0);
|
||||
else
|
||||
sect.sct_item[I_PETROL]
|
||||
= max((pet_amt - move_amt / 5), 0);
|
||||
= MAX((pet_amt - move_amt / 5), 0);
|
||||
} else {
|
||||
sect.sct_item[I_PETROL] = 0;
|
||||
move_amt -= pet_amt * 5;
|
||||
extra = ((float)move_amt / 50.0) - (move_amt / 50);
|
||||
sect.sct_item[I_OIL] = max(oil_amt - move_amt / 50, 0);
|
||||
sect.sct_item[I_OIL] = MAX(oil_amt - move_amt / 50, 0);
|
||||
if (extra > 0.0)
|
||||
sect.sct_item[I_OIL]
|
||||
= max((oil_amt - move_amt / 50) - 1, 0);
|
||||
= MAX((oil_amt - move_amt / 50) - 1, 0);
|
||||
else
|
||||
sect.sct_item[I_OIL]
|
||||
= max((oil_amt - move_amt / 50), 0);
|
||||
= MAX((oil_amt - move_amt / 50), 0);
|
||||
}
|
||||
|
||||
/* load plague */
|
||||
|
@ -412,8 +412,8 @@ fuel(void)
|
|||
continue;
|
||||
}
|
||||
tot_fuel = oil_amt * 50 + pet_amt * 5;
|
||||
move_amt = min(tot_fuel, fuel_amt);
|
||||
move_amt = min(move_amt, max_amt);
|
||||
move_amt = MIN(tot_fuel, fuel_amt);
|
||||
move_amt = MIN(move_amt, max_amt);
|
||||
|
||||
if (move_amt == 0)
|
||||
continue;
|
||||
|
@ -425,22 +425,22 @@ fuel(void)
|
|||
extra = ((float)move_amt / 5.0) - (move_amt / 5);
|
||||
if (extra > 0.0)
|
||||
item2.land.lnd_item[I_PETROL]
|
||||
= max((pet_amt - move_amt / 5) - 1, 0);
|
||||
= MAX((pet_amt - move_amt / 5) - 1, 0);
|
||||
else
|
||||
item2.land.lnd_item[I_PETROL]
|
||||
= max((pet_amt - move_amt / 5), 0);
|
||||
= MAX((pet_amt - move_amt / 5), 0);
|
||||
} else {
|
||||
item2.land.lnd_item[I_PETROL] = 0;
|
||||
move_amt -= pet_amt * 5;
|
||||
extra = ((float)move_amt / 50.0) - (move_amt / 50);
|
||||
item2.land.lnd_item[I_OIL]
|
||||
= max(oil_amt - move_amt / 50, 0);
|
||||
= MAX(oil_amt - move_amt / 50, 0);
|
||||
if (extra > 0.0)
|
||||
item2.land.lnd_item[I_OIL]
|
||||
= max((oil_amt - move_amt / 50) - 1, 0);
|
||||
= MAX((oil_amt - move_amt / 50) - 1, 0);
|
||||
else
|
||||
item2.land.lnd_item[I_OIL]
|
||||
= max((oil_amt - move_amt / 50), 0);
|
||||
= MAX((oil_amt - move_amt / 50), 0);
|
||||
}
|
||||
|
||||
/* load plague */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue