mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-08-03 07:16:31 -04:00
Resolve unused code warnings when compiling in Debug mode using MSVC
This commit is contained in:
parent
399ec4eccc
commit
bc05628fa8
@ -638,8 +638,9 @@ CUSTOM: customdata.lua
|
||||
sol::object deserialized = LuaUtil::deserialize(lua.sol(), data2.mScripts[0].mData, &serializer1);
|
||||
EXPECT_TRUE(deserialized.is<sol::table>());
|
||||
sol::table table = deserialized;
|
||||
for (const auto& [key, value] : table)
|
||||
if (!table.empty())
|
||||
{
|
||||
const auto [key, value] = *table.cbegin();
|
||||
EXPECT_TRUE(key.is<ESM::RefNum>());
|
||||
EXPECT_TRUE(value.is<ESM::RefNum>());
|
||||
EXPECT_EQ(key.as<ESM::RefNum>(), (ESM::RefNum{ 42, 34 }));
|
||||
|
@ -215,8 +215,6 @@ int main(int argc, char** argv)
|
||||
std::cerr << "ERROR: " << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
namespace
|
||||
|
@ -1117,8 +1117,8 @@ namespace MWRender
|
||||
|
||||
return keyframeController->getAsCallback();
|
||||
}
|
||||
|
||||
return asCallback;
|
||||
else
|
||||
return asCallback;
|
||||
}
|
||||
|
||||
void Animation::resetActiveGroups()
|
||||
|
@ -528,8 +528,6 @@ namespace Fx
|
||||
{
|
||||
return parseBool();
|
||||
}
|
||||
|
||||
error(Misc::StringUtils::format("failed setting uniform type"));
|
||||
}
|
||||
|
||||
template <class SrcT, class T>
|
||||
@ -557,10 +555,12 @@ namespace Fx
|
||||
{
|
||||
if constexpr (std::is_same_v<bool, SrcT>)
|
||||
error("bool arrays currently unsupported");
|
||||
|
||||
int size = parseInteger();
|
||||
if (size > 1)
|
||||
data.mArray = std::vector<SrcT>(size);
|
||||
else
|
||||
{
|
||||
int size = parseInteger();
|
||||
if (size > 1)
|
||||
data.mArray = std::vector<SrcT>(size);
|
||||
}
|
||||
}
|
||||
else if (key == "min")
|
||||
{
|
||||
|
@ -220,10 +220,11 @@ namespace Fx
|
||||
return osg::Uniform::FLOAT;
|
||||
else if constexpr (std::is_same_v<T, int>)
|
||||
return osg::Uniform::INT;
|
||||
else if constexpr (std::is_same_v<T, bool>)
|
||||
else
|
||||
{
|
||||
static_assert(std::is_same_v<T, bool>, "Non-exhaustive visitor");
|
||||
return osg::Uniform::BOOL;
|
||||
|
||||
return std::nullopt;
|
||||
}
|
||||
},
|
||||
mData);
|
||||
}
|
||||
@ -293,15 +294,14 @@ namespace Fx
|
||||
|
||||
return Misc::StringUtils::format("const int %s=%i;", mName, value);
|
||||
}
|
||||
else if constexpr (std::is_same_v<T, bool>)
|
||||
else
|
||||
{
|
||||
static_assert(std::is_same_v<T, bool>, "Non-exhaustive visitor");
|
||||
if (useUniform)
|
||||
return Misc::StringUtils::format("uniform bool %s;", uname);
|
||||
|
||||
return Misc::StringUtils::format("const bool %s=%s;", mName, value ? "true" : "false");
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
},
|
||||
mData);
|
||||
}
|
||||
|
@ -215,12 +215,13 @@ namespace LuaUtil
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if constexpr (std::is_same_v<T, LoadedData>)
|
||||
else
|
||||
{
|
||||
static_assert(std::is_same_v<T, LoadedData>, "Non-exhaustive visitor");
|
||||
return variant.mScripts.count(scriptId) != 0;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
mData);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user