mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-31 11:23:21 +00:00
Fix: Compile warnings when asserts are disabled
This commit is contained in:
parent
ad47ebc1a8
commit
cfa1b1e006
@ -105,6 +105,7 @@ static void LoadGrfFileIndexed(const char *filename, const SpriteID *index_tbl,
|
||||
|
||||
do {
|
||||
bool b = LoadNextSprite(start, file_index, sprite_id, container_ver);
|
||||
(void)b; // Unused without asserts
|
||||
assert(b);
|
||||
sprite_id++;
|
||||
} while (++start <= end);
|
||||
|
@ -2053,6 +2053,7 @@ uint GetCompanySettingIndex(const char *name)
|
||||
{
|
||||
uint i;
|
||||
const SettingDesc *sd = GetSettingFromName(name, &i);
|
||||
(void)sd; // Unused without asserts
|
||||
assert(sd != nullptr && (sd->desc.flags & SGF_PER_COMPANY) != 0);
|
||||
return i;
|
||||
}
|
||||
@ -2159,6 +2160,7 @@ void IConsoleSetSetting(const char *name, int value)
|
||||
{
|
||||
uint index;
|
||||
const SettingDesc *sd = GetSettingFromName(name, &index);
|
||||
(void)sd; // Unused without asserts
|
||||
assert(sd != nullptr);
|
||||
SetSettingValue(index, value);
|
||||
}
|
||||
|
@ -1386,6 +1386,7 @@ static void AddWindowToZOrdering(Window *w)
|
||||
/* Search down the z-ordering for its location. */
|
||||
Window *v = _z_front_window;
|
||||
uint last_z_priority = UINT_MAX;
|
||||
(void)last_z_priority; // Unused without asserts
|
||||
while (v != nullptr && (v->window_class == WC_INVALID || GetWindowZPriority(v->window_class) > GetWindowZPriority(w->window_class))) {
|
||||
if (v->window_class != WC_INVALID) {
|
||||
/* Sanity check z-ordering, while we're at it. */
|
||||
|
Loading…
Reference in New Issue
Block a user