mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r17001) -Codechange: replace some more assert(0)s to NOT_REACHED() and document why they (assert(0)) have to stay for the remaining cases.
This commit is contained in:
parent
c2fdb85c0d
commit
097e79a86d
|
@ -1799,8 +1799,7 @@ static bool AirportMove(Aircraft *v, const AirportFTAClass *apc)
|
||||||
} while (current != NULL);
|
} while (current != NULL);
|
||||||
|
|
||||||
DEBUG(misc, 0, "[Ap] cannot move further on Airport! (pos %d state %d) for vehicle %d", v->pos, v->state, v->index);
|
DEBUG(misc, 0, "[Ap] cannot move further on Airport! (pos %d state %d) for vehicle %d", v->pos, v->state, v->index);
|
||||||
assert(0);
|
NOT_REACHED();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns true if the road ahead is busy, eg. you must wait before proceeding */
|
/* returns true if the road ahead is busy, eg. you must wait before proceeding */
|
||||||
|
|
|
@ -116,6 +116,8 @@ void CDECL error(const char *s, ...)
|
||||||
ShowOSErrorBox(buf, true);
|
ShowOSErrorBox(buf, true);
|
||||||
if (_video_driver != NULL) _video_driver->Stop();
|
if (_video_driver != NULL) _video_driver->Stop();
|
||||||
|
|
||||||
|
/* Don't go into NOT_REACHED here; NOT_REACHED is using error, so
|
||||||
|
* using it would result in an infinite loop instead of errors. */
|
||||||
assert(0);
|
assert(0);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1248,8 +1248,7 @@ static char *GetSpecialNameString(char *buff, int ind, int64 *argv, const char *
|
||||||
return strecpy(buff, GetScreenshotFormatDesc(i), last);
|
return strecpy(buff, GetScreenshotFormatDesc(i), last);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(0);
|
NOT_REACHED();
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
|
|
|
@ -690,13 +690,13 @@ static void GetTileDesc_Water(TileIndex tile, TileDesc *td)
|
||||||
case WATER_CLASS_SEA: td->str = STR_WATER_DESCRIPTION_WATER; break;
|
case WATER_CLASS_SEA: td->str = STR_WATER_DESCRIPTION_WATER; break;
|
||||||
case WATER_CLASS_CANAL: td->str = STR_LANDINFO_CANAL; break;
|
case WATER_CLASS_CANAL: td->str = STR_LANDINFO_CANAL; break;
|
||||||
case WATER_CLASS_RIVER: td->str = STR_LANDINFO_RIVER; break;
|
case WATER_CLASS_RIVER: td->str = STR_LANDINFO_RIVER; break;
|
||||||
default: assert(0); break;
|
default: NOT_REACHED(); break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WATER_TILE_COAST: td->str = STR_WATER_DESCRIPTION_COAST_OR_RIVERBANK; break;
|
case WATER_TILE_COAST: td->str = STR_WATER_DESCRIPTION_COAST_OR_RIVERBANK; break;
|
||||||
case WATER_TILE_LOCK : td->str = STR_LANDINFO_LOCK; break;
|
case WATER_TILE_LOCK : td->str = STR_LANDINFO_LOCK; break;
|
||||||
case WATER_TILE_DEPOT: td->str = STR_WATER_DESCRIPTION_SHIP_DEPOT; break;
|
case WATER_TILE_DEPOT: td->str = STR_WATER_DESCRIPTION_SHIP_DEPOT; break;
|
||||||
default: assert(0); break;
|
default: NOT_REACHED(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
td->owner[0] = GetTileOwner(tile);
|
td->owner[0] = GetTileOwner(tile);
|
||||||
|
|
|
@ -275,9 +275,7 @@ public:
|
||||||
* - PfCalcEstimate() gives too large numbers
|
* - PfCalcEstimate() gives too large numbers
|
||||||
* - PfCalcCost() gives too small numbers
|
* - PfCalcCost() gives too small numbers
|
||||||
* - You have used negative cost penalty in some cases (cost bonus) */
|
* - You have used negative cost penalty in some cases (cost bonus) */
|
||||||
assert(0);
|
NOT_REACHED();
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue