mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Merge branch 'various_warn' into 'master'
Fix various warnings found by clang See merge request OpenMW/openmw!758
This commit is contained in:
commit
3423d3f882
5 changed files with 8 additions and 8 deletions
|
@ -57,7 +57,7 @@ int main(int argc, char** argv)
|
|||
else
|
||||
{
|
||||
const std::string& ext = ".omwsave";
|
||||
if (boost::filesystem::exists(boost::filesystem::path(outputFile))
|
||||
if (bfs::exists(bfs::path(outputFile))
|
||||
&& (outputFile.size() < ext.size() || outputFile.substr(outputFile.size()-ext.size()) != ext))
|
||||
{
|
||||
throw std::runtime_error("Output file already exists and does not end in .omwsave. Did you mean to use --compare?");
|
||||
|
|
|
@ -76,6 +76,7 @@ void CSMWorld::ImportLandTexturesCommand::redo()
|
|||
}
|
||||
|
||||
std::vector<std::string> oldTextures;
|
||||
oldTextures.reserve(texIndices.size());
|
||||
for (int index : texIndices)
|
||||
{
|
||||
oldTextures.push_back(LandTexture::createUniqueRecordId(oldPlugin, index));
|
||||
|
|
|
@ -201,7 +201,7 @@ QModelIndex CSMWorld::IdTree::parent (const QModelIndex& index) const
|
|||
const std::pair<int, int>& address(unfoldIndexAddress(id));
|
||||
|
||||
if (address.first >= this->rowCount() || address.second >= this->columnCount())
|
||||
throw "Parent index is not present in the model";
|
||||
throw std::logic_error("Parent index is not present in the model");
|
||||
|
||||
return createIndex(address.first, address.second);
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ unsigned int CSMWorld::IdTree::foldIndexAddress (const QModelIndex& index) const
|
|||
std::pair< int, int > CSMWorld::IdTree::unfoldIndexAddress (unsigned int id) const
|
||||
{
|
||||
if (id == 0)
|
||||
throw "Attempt to unfold index id of the top level data cell";
|
||||
throw std::runtime_error("Attempt to unfold index id of the top level data cell");
|
||||
|
||||
--id;
|
||||
int row = id / this->columnCount();
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace ESM
|
|||
void Region::blank()
|
||||
{
|
||||
mData.mClear = mData.mCloudy = mData.mFoggy = mData.mOvercast = mData.mRain =
|
||||
mData.mThunder = mData.mAsh, mData.mBlight = mData.mA = mData.mB = 0;
|
||||
mData.mThunder = mData.mAsh = mData.mBlight = mData.mA = mData.mB = 0;
|
||||
|
||||
mMapColor = 0;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "variantimp.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <cmath>
|
||||
|
||||
#include "esmreader.hpp"
|
||||
#include "esmwriter.hpp"
|
||||
|
@ -52,12 +53,10 @@ void ESM::readESMVariantValue(ESMReader& esm, Variant::Format format, VarType ty
|
|||
esm.getHNT (value, "FLTV");
|
||||
|
||||
if (type==VT_Short)
|
||||
{
|
||||
if (value!=value)
|
||||
out = 0; // nan
|
||||
if (std::isnan(value))
|
||||
out = 0;
|
||||
else
|
||||
out = static_cast<short> (value);
|
||||
}
|
||||
else if (type==VT_Long)
|
||||
out = static_cast<int> (value);
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue