Fix last gcc warnings for release build

This commit is contained in:
paradust7
2026-10-06 21:55:23 +02:00
committed by sfan5
parent 0f1e38d2a3
commit d6ca815f3a
10 changed files with 24 additions and 11 deletions
+3 -2
View File
@@ -686,10 +686,11 @@ IGUIListBox *CGUIEnvironment::addListBox(const core::rect<s32> &rectangle,
IGUIListBox *b = new CGUIListBox(this, parent ? parent : this, id, rectangle,
true, drawBackground, false);
IGUIFont *builtin_font = getBuiltInFont();
if (CurrentSkin && CurrentSkin->getSpriteBank()) {
b->setSpriteBank(CurrentSkin->getSpriteBank());
} else if (getBuiltInFont() && getBuiltInFont()->getType() == EGFT_BITMAP) {
b->setSpriteBank(((IGUIFontBitmap *)getBuiltInFont())->getSpriteBank());
} else if (builtin_font && builtin_font->getType() == EGFT_BITMAP) {
b->setSpriteBank(((IGUIFontBitmap *)builtin_font)->getSpriteBank());
}
b->drop();
+1 -1
View File
@@ -333,7 +333,7 @@ void SkinnedMesh::calculateStaticBoundingBox()
if (animated[v])
continue;
auto pos = getMeshBuffer(mb)->getVertexBuffer()->getPosition(v);
auto pos = buf->getVertexBuffer()->getPosition(v);
if (!first) {
StaticPartsBox.addInternalPoint(pos);
} else {
+1 -1
View File
@@ -520,7 +520,7 @@ void PlayerDatabaseSQLite3::savePlayer(RemotePlayer *player)
sqlite3_vrfy(sqlite3_step(m_stmt_player_remove_inventory_items), SQLITE_DONE);
sqlite3_reset(m_stmt_player_remove_inventory_items);
const auto &inventory_lists = sao->getInventory()->getLists();
const auto &inventory_lists = player->inventory.getLists();
std::ostringstream oss;
for (u16 i = 0; i < inventory_lists.size(); i++) {
const InventoryList *list = inventory_lists[i];
+9 -2
View File
@@ -13,6 +13,7 @@
#include <IGUIFont.h>
#include "client/renderingengine.h"
#include "irrlicht_changes/CGUITTFont.h"
#include "debug.h"
#include "log.h"
#include "client/texturesource.h"
#include "util/string.h"
@@ -985,12 +986,18 @@ void GUITable::allocationComplete()
const GUITable::Row* GUITable::getRow(s32 i) const
{
if (i >= 0 && i < (s32) m_visible_rows.size())
if (i >= 0 && (size_t)i < m_visible_rows.size())
return &m_rows[m_visible_rows[i]];
return NULL;
}
const GUITable::Row* GUITable::getRowChecked(s32 i) const
{
sanity_check(i >= 0 && (size_t)i < m_visible_rows.size());
return &m_rows[m_visible_rows[i]];
}
bool GUITable::doesRowStartWith(const Row *row, const core::stringw &str) const
{
if (row == NULL)
@@ -1231,7 +1238,7 @@ void GUITable::toggleVisibleTree(s32 row_i, int dir, bool move_selection)
else if (!was_open && !do_open) {
// Move selection to parent
assert(getRow(sel) != NULL);
while (sel > 0 && getRow(sel - 1)->indent >= row->indent)
while (sel > 0 && getRowChecked(sel - 1)->indent >= row->indent)
sel--;
sel--;
if (sel < 0) // was root already selected?
+3
View File
@@ -216,6 +216,9 @@ protected:
// Returns the i-th visible row (NULL if i is invalid)
const Row *getRow(s32 i) const;
// Returns the i-th visible row (i must be valid)
const Row *getRowChecked(s32 i) const;
// Key navigation helper
bool doesRowStartWith(const Row *row, const core::stringw &str) const;
+1 -1
View File
@@ -110,7 +110,7 @@ std::unique_ptr<MapBlock> MapSector::detachBlock(MapBlock *block)
// Remove from container
auto it = m_blocks.find(block_y);
assert(it != m_blocks.end());
sanity_check(it != m_blocks.end());
std::unique_ptr<MapBlock> ret = std::move(it->second);
assert(ret.get() == block);
m_blocks.erase(it);
+2 -2
View File
@@ -78,10 +78,10 @@ void ModChannelMgr::registerChannel(const std::string &channel)
bool ModChannelMgr::setChannelState(const std::string &channel, ModChannelState state)
{
if (!channelRegistered(channel))
auto channel_it = m_registered_channels.find(channel);
if (channel_it == m_registered_channels.end())
return false;
auto channel_it = m_registered_channels.find(channel);
channel_it->second->setState(state);
return true;
+2 -2
View File
@@ -105,7 +105,7 @@ void NodeMetaRef::handleToTable(lua_State *L, IMetadata *_meta)
MetaDataRef::handleToTable(L, _meta);
NodeMetadata *meta = dynamic_cast<NodeMetadata*>(_meta);
assert(meta);
sanity_check(meta);
// inventory
Inventory *inv = meta->getInventory();
@@ -125,7 +125,7 @@ bool NodeMetaRef::handleFromTable(lua_State *L, int table, IMetadata *_meta)
return false;
NodeMetadata *meta = dynamic_cast<NodeMetadata*>(_meta);
assert(meta);
sanity_check(meta);
// inventory
Inventory *inv = meta->getInventory();
@@ -392,6 +392,7 @@ SECTION("simple skin")
const auto mesh = loadMesh(model_stem + "simple_skin.gltf");
REQUIRE(mesh != nullptr);
auto csm = dynamic_cast<const SkinnedMesh*>(mesh);
REQUIRE(csm);
const auto joints = csm->getAllJoints();
REQUIRE(joints.size() == 3);
@@ -144,6 +144,7 @@ void TestMapSettingsManager::testMapSettingsManager()
// Now make our Params and see if the values are correctly sourced
MapgenParams *params = mgr.makeMapgenParams();
UASSERT(params);
UASSERT(params->mgtype == MAPGEN_V5);
UASSERT(params->chunksize == v3s16(5));
UASSERT(params->water_level == 15);