diff options
author | SmallJoker <mk939@ymail.com> | 2021-08-17 20:00:47 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2021-08-17 20:00:47 +0200 |
commit | 3b842a7e021f61c119f060df5de035b71df1fe83 (patch) | |
tree | 6d658b861515337adf4ac12a3369577de66ce23f /src/settings.cpp | |
parent | 2eec997e979b8f2781970e5e2fdd8d4330aa4ec5 (diff) | |
download | minetest-3b842a7e021f61c119f060df5de035b71df1fe83.tar.gz minetest-3b842a7e021f61c119f060df5de035b71df1fe83.tar.bz2 minetest-3b842a7e021f61c119f060df5de035b71df1fe83.zip |
Fix inconsistent integer comparison warnings
Diffstat (limited to 'src/settings.cpp')
-rw-r--r-- | src/settings.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/settings.cpp b/src/settings.cpp index ba4629a6f..4def46112 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -49,7 +49,7 @@ SettingsHierarchy::SettingsHierarchy(Settings *fallback) Settings *SettingsHierarchy::getLayer(int layer) const { - if (layer < 0 || layer >= layers.size()) + if (layer < 0 || layer >= (int)layers.size()) throw BaseException("Invalid settings layer"); return layers[layer]; } @@ -57,7 +57,7 @@ Settings *SettingsHierarchy::getLayer(int layer) const Settings *SettingsHierarchy::getParent(int layer) const { - assert(layer >= 0 && layer < layers.size()); + assert(layer >= 0 && layer < (int)layers.size()); // iterate towards the origin (0) to find the next fallback layer for (int i = layer - 1; i >= 0; --i) { if (layers[i]) @@ -72,8 +72,8 @@ void SettingsHierarchy::onLayerCreated(int layer, Settings *obj) { if (layer < 0) throw BaseException("Invalid settings layer"); - if (layers.size() < layer+1) - layers.resize(layer+1); + if ((int)layers.size() < layer + 1) + layers.resize(layer + 1); Settings *&pos = layers[layer]; if (pos) |