diff --git a/src/core/serialisation.cpp b/src/core/serialisation.cpp index 775416db30..22cf6c9dbd 100644 --- a/src/core/serialisation.cpp +++ b/src/core/serialisation.cpp @@ -16,7 +16,7 @@ * @param bytes_to_write The amount of bytes we want to try to write. * @return True iff the given amount of bytes can be written to the packet. */ -static bool BufferCanWriteToPacket(const std::vector &buffer, size_t limit, size_t bytes_to_write) +[[maybe_unused]] static bool BufferCanWriteToPacket(const std::vector &buffer, size_t limit, size_t bytes_to_write) { return buffer.size() + bytes_to_write <= limit; } diff --git a/src/sl/extended_ver_sl.cpp b/src/sl/extended_ver_sl.cpp index c20051a878..dd4f4cedea 100644 --- a/src/sl/extended_ver_sl.cpp +++ b/src/sl/extended_ver_sl.cpp @@ -595,13 +595,13 @@ static void Save_SLXI() if (extra_data_length > 0) { SlWriteUint32(extra_data_length); - size_t written = SlGetBytesWritten(); + [[maybe_unused]] size_t written = SlGetBytesWritten(); info->save_proc(info, false); assert(SlGetBytesWritten() == written + extra_data_length); } if (chunk_count > 0) { SlWriteUint32(chunk_count); - size_t written = SlGetBytesWritten(); + [[maybe_unused]] size_t written = SlGetBytesWritten(); WriteChunkIdList(info->chunk_list, false); assert(SlGetBytesWritten() == written + (chunk_count * 4)); } diff --git a/src/spritecache.cpp b/src/spritecache.cpp index b08231aaf1..bc37f94725 100644 --- a/src/spritecache.cpp +++ b/src/spritecache.cpp @@ -1135,11 +1135,11 @@ void *GetRawSprite(SpriteID sprite, SpriteType type, uint8 zoom_levels, Allocato /* Load the sprite, if it is not loaded, yet */ if (sc->GetPtr() == nullptr) { - void *ptr = ReadSprite(sc, sprite, type, AllocSprite, nullptr, zoom_levels); + [[maybe_unused]] void *ptr = ReadSprite(sc, sprite, type, AllocSprite, nullptr, zoom_levels); assert(ptr == _last_sprite_allocation.GetPtr()); sc->Assign(std::move(_last_sprite_allocation)); } else if ((sc->total_missing_zoom_levels & zoom_levels) != 0) { - void *ptr = ReadSprite(sc, sprite, type, AllocSprite, nullptr, sc->total_missing_zoom_levels & zoom_levels); + [[maybe_unused]] void *ptr = ReadSprite(sc, sprite, type, AllocSprite, nullptr, sc->total_missing_zoom_levels & zoom_levels); assert(ptr == _last_sprite_allocation.GetPtr()); sc->Append(std::move(_last_sprite_allocation)); } diff --git a/src/viewport.cpp b/src/viewport.cpp index 37a97bdd96..cf21fa7b28 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -5601,8 +5601,8 @@ static void CheckOverflow(int &test, int &other, int max, int mult) test = max; } -static const uint X_DIRS = (1 << DIR_NE) | (1 << DIR_SW); -static const uint Y_DIRS = (1 << DIR_SE) | (1 << DIR_NW); +[[maybe_unused]] static const uint X_DIRS = (1 << DIR_NE) | (1 << DIR_SW); +[[maybe_unused]] static const uint Y_DIRS = (1 << DIR_SE) | (1 << DIR_NW); static const uint HORZ_DIRS = (1 << DIR_W) | (1 << DIR_E); //static const uint VERT_DIRS = (1 << DIR_N) | (1 << DIR_S);