mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-31 19:33:34 +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 {
|
do {
|
||||||
bool b = LoadNextSprite(start, file_index, sprite_id, container_ver);
|
bool b = LoadNextSprite(start, file_index, sprite_id, container_ver);
|
||||||
|
(void)b; // Unused without asserts
|
||||||
assert(b);
|
assert(b);
|
||||||
sprite_id++;
|
sprite_id++;
|
||||||
} while (++start <= end);
|
} while (++start <= end);
|
||||||
|
@ -2053,6 +2053,7 @@ uint GetCompanySettingIndex(const char *name)
|
|||||||
{
|
{
|
||||||
uint i;
|
uint i;
|
||||||
const SettingDesc *sd = GetSettingFromName(name, &i);
|
const SettingDesc *sd = GetSettingFromName(name, &i);
|
||||||
|
(void)sd; // Unused without asserts
|
||||||
assert(sd != nullptr && (sd->desc.flags & SGF_PER_COMPANY) != 0);
|
assert(sd != nullptr && (sd->desc.flags & SGF_PER_COMPANY) != 0);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -2159,6 +2160,7 @@ void IConsoleSetSetting(const char *name, int value)
|
|||||||
{
|
{
|
||||||
uint index;
|
uint index;
|
||||||
const SettingDesc *sd = GetSettingFromName(name, &index);
|
const SettingDesc *sd = GetSettingFromName(name, &index);
|
||||||
|
(void)sd; // Unused without asserts
|
||||||
assert(sd != nullptr);
|
assert(sd != nullptr);
|
||||||
SetSettingValue(index, value);
|
SetSettingValue(index, value);
|
||||||
}
|
}
|
||||||
|
@ -1386,6 +1386,7 @@ static void AddWindowToZOrdering(Window *w)
|
|||||||
/* Search down the z-ordering for its location. */
|
/* Search down the z-ordering for its location. */
|
||||||
Window *v = _z_front_window;
|
Window *v = _z_front_window;
|
||||||
uint last_z_priority = UINT_MAX;
|
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))) {
|
while (v != nullptr && (v->window_class == WC_INVALID || GetWindowZPriority(v->window_class) > GetWindowZPriority(w->window_class))) {
|
||||||
if (v->window_class != WC_INVALID) {
|
if (v->window_class != WC_INVALID) {
|
||||||
/* Sanity check z-ordering, while we're at it. */
|
/* Sanity check z-ordering, while we're at it. */
|
||||||
|
Loading…
Reference in New Issue
Block a user