(svn r14176) -Fix: better 'safe' than ... 'save'

This commit is contained in:
smatz 2008-08-25 20:54:34 +00:00
parent 759fb5937d
commit e840aabf8d
6 changed files with 9 additions and 9 deletions

View File

@ -369,7 +369,7 @@ static void DrawCatenaryRailway(const TileInfo *ti)
/* /*
* The "wire"-sprite position is inside the tile, i.e. 0 <= sss->?_offset < TILE_SIZE. * The "wire"-sprite position is inside the tile, i.e. 0 <= sss->?_offset < TILE_SIZE.
* Therefore it is save to use GetSlopeZ() for the elevation. * Therefore it is safe to use GetSlopeZ() for the elevation.
* Also note, that the result of GetSlopeZ() is very special for bridge-ramps. * Also note, that the result of GetSlopeZ() is very special for bridge-ramps.
*/ */
AddSortableSpriteToDraw(sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset, AddSortableSpriteToDraw(sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,

View File

@ -1521,7 +1521,7 @@ static CommandCost ClearTile_Track(TileIndex tile, byte flags)
/** /**
* Get surface height in point (x,y) * Get surface height in point (x,y)
* On tiles with halftile foundations move (x,y) to a save point wrt. track * On tiles with halftile foundations move (x,y) to a safe point wrt. track
*/ */
static uint GetSaveSlopeZ(uint x, uint y, Track track) static uint GetSaveSlopeZ(uint x, uint y, Track track)
{ {
@ -2519,7 +2519,7 @@ static CommandCost TestAutoslopeOnRailTile(TileIndex tile, uint flags, uint z_ol
{ {
if (!_settings_game.construction.build_on_slopes || !AutoslopeEnabled()) return CMD_ERROR; if (!_settings_game.construction.build_on_slopes || !AutoslopeEnabled()) return CMD_ERROR;
/* Is the slope-rail_bits combination valid in general? I.e. is it save to call GetRailFoundation() ? */ /* Is the slope-rail_bits combination valid in general? I.e. is it safe to call GetRailFoundation() ? */
if (CmdFailed(CheckRailSlope(tileh_new, rail_bits, TRACK_BIT_NONE, tile))) return CMD_ERROR; if (CmdFailed(CheckRailSlope(tileh_new, rail_bits, TRACK_BIT_NONE, tile))) return CMD_ERROR;
/* Get the slopes on top of the foundations */ /* Get the slopes on top of the foundations */

View File

@ -1601,7 +1601,7 @@ static CommandCost TerraformTile_Road(TileIndex tile, uint32 flags, uint z_new,
case ROAD_TILE_NORMAL: { case ROAD_TILE_NORMAL: {
RoadBits bits = GetAllRoadBits(tile); RoadBits bits = GetAllRoadBits(tile);
RoadBits bits_copy = bits; RoadBits bits_copy = bits;
/* Check if the slope-road_bits combination is valid at all, i.e. it is save to call GetRoadFoundation(). */ /* Check if the slope-road_bits combination is valid at all, i.e. it is safe to call GetRoadFoundation(). */
if (!CmdFailed(CheckRoadSlope(tileh_new, &bits_copy, ROAD_NONE, ROAD_NONE))) { if (!CmdFailed(CheckRoadSlope(tileh_new, &bits_copy, ROAD_NONE, ROAD_NONE))) {
/* CheckRoadSlope() sometimes changes the road_bits, if it does not agree with them. */ /* CheckRoadSlope() sometimes changes the road_bits, if it does not agree with them. */
if (bits == bits_copy) { if (bits == bits_copy) {

View File

@ -1472,7 +1472,7 @@ static CommandCost TerraformTile_TunnelBridge(TileIndex tile, uint32 flags, uint
uint z_old; uint z_old;
Slope tileh_old = GetTileSlope(tile, &z_old); Slope tileh_old = GetTileSlope(tile, &z_old);
/* Check if new slope is valid for bridges in general (so we can savely call GetBridgeFoundation()) */ /* Check if new slope is valid for bridges in general (so we can safely call GetBridgeFoundation()) */
if ((direction == DIAGDIR_NW) || (direction == DIAGDIR_NE)) { if ((direction == DIAGDIR_NW) || (direction == DIAGDIR_NE)) {
CheckBridgeSlopeSouth(axis, &tileh_old, &z_old); CheckBridgeSlopeSouth(axis, &tileh_old, &z_old);
res = CheckBridgeSlopeSouth(axis, &tileh_new, &z_new); res = CheckBridgeSlopeSouth(axis, &tileh_new, &z_new);

View File

@ -671,13 +671,13 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
} }
#ifdef _M_AMD64 #ifdef _M_AMD64
extern "C" void *_get_save_esp(); extern "C" void *_get_safe_esp();
#endif #endif
static void Win32InitializeExceptions() static void Win32InitializeExceptions()
{ {
#ifdef _M_AMD64 #ifdef _M_AMD64
_safe_esp = _get_save_esp(); _safe_esp = _get_safe_esp();
#else #else
_asm { _asm {
mov _safe_esp, esp mov _safe_esp, esp

View File

@ -1,7 +1,7 @@
.CODE .CODE
PUBLIC _get_save_esp PUBLIC _get_safe_esp
_get_save_esp: _get_safe_esp:
MOV RAX,RSP MOV RAX,RSP
RET RET