summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2020-09-25 12:22:48 +0100
committerCharles Pigott <charlespigott@googlemail.com>2020-12-06 19:27:39 +0000
commitcfa1b1e006b45780355a67d228124b8542c6335d (patch)
tree3604b9b22d16be9a55470b4037a147f613d714ee /src
parentad47ebc1a8cb2a7d678b80a388890f5b61eb0302 (diff)
downloadopenttd-cfa1b1e006b45780355a67d228124b8542c6335d.tar.xz
Fix: Compile warnings when asserts are disabled
Diffstat (limited to 'src')
-rw-r--r--src/gfxinit.cpp1
-rw-r--r--src/settings.cpp2
-rw-r--r--src/window.cpp1
3 files changed, 4 insertions, 0 deletions
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index ba8069025..d1d05f4bd 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -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);
diff --git a/src/settings.cpp b/src/settings.cpp
index 505638e94..2966a3e22 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -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);
}
diff --git a/src/window.cpp b/src/window.cpp
index 3281e9f56..6fd4d0d0b 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -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. */