summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Kotov <alexdobrohotov@yandex.ru>2024-02-24 20:25:58 +0000
committerAlexei Kotov <alexdobrohotov@yandex.ru>2024-02-24 20:25:58 +0000
commit01e0b25fd3933fbfd10d07c1602658a9db9bdab0 (patch)
tree924194b2a0198d4303f317e670f3910201f997a9
parent595e42ae43944bed3fd2ee91d35345cc0f40f923 (diff)
parentcf6b6020a013f279a42bc4e63bbb1d6393e4adec (diff)
Merge branch 'coverity' into 'master'
Fix some Coverity complaints See merge request OpenMW/openmw!3904
-rw-r--r--apps/openmw/mwlua/nearbybindings.cpp4
-rw-r--r--apps/openmw/mwlua/stats.cpp2
-rw-r--r--components/debug/debugdraw.cpp2
-rw-r--r--components/debug/debugdraw.hpp2
-rw-r--r--components/lua/asyncpackage.cpp2
5 files changed, 5 insertions, 7 deletions
diff --git a/apps/openmw/mwlua/nearbybindings.cpp b/apps/openmw/mwlua/nearbybindings.cpp
index 7eda965e96..af6980fb7f 100644
--- a/apps/openmw/mwlua/nearbybindings.cpp
+++ b/apps/openmw/mwlua/nearbybindings.cpp
@@ -163,8 +163,8 @@ namespace MWLua
ignore = parseIgnoreList(*options);
}
- context.mLuaManager->addAction([context, ignore, callback = LuaUtil::Callback::fromLua(callback), from,
- to] {
+ context.mLuaManager->addAction([context, ignore = std::move(ignore),
+ callback = LuaUtil::Callback::fromLua(callback), from, to] {
MWPhysics::RayCastingResult res;
MWBase::Environment::get().getWorld()->castRenderingRay(res, from, to, false, false, ignore);
context.mLuaManager->queueCallback(callback, sol::main_object(context.mLua->sol(), sol::in_place, res));
diff --git a/apps/openmw/mwlua/stats.cpp b/apps/openmw/mwlua/stats.cpp
index c6492c1ec2..eaa1f89d97 100644
--- a/apps/openmw/mwlua/stats.cpp
+++ b/apps/openmw/mwlua/stats.cpp
@@ -476,7 +476,7 @@ namespace MWLua
auto skillIncreasesForAttributeStatsT
= context.mLua->sol().new_usertype<SkillIncreasesForAttributeStats>("SkillIncreasesForAttributeStats");
- for (auto attribute : MWBase::Environment::get().getESMStore()->get<ESM::Attribute>())
+ for (const auto& attribute : MWBase::Environment::get().getESMStore()->get<ESM::Attribute>())
{
skillIncreasesForAttributeStatsT[ESM::RefId(attribute.mId).serializeText()] = sol::property(
[=](const SkillIncreasesForAttributeStats& stat) { return stat.get(context, attribute.mId); },
diff --git a/components/debug/debugdraw.cpp b/components/debug/debugdraw.cpp
index e7aa7d8cce..2bc7358259 100644
--- a/components/debug/debugdraw.cpp
+++ b/components/debug/debugdraw.cpp
@@ -316,8 +316,6 @@ Debug::DebugDrawer::DebugDrawer(const DebugDrawer& copy, const osg::CopyOp& copy
Debug::DebugDrawer::DebugDrawer(Shader::ShaderManager& shaderManager)
{
- mCurrentFrame = 0;
-
auto program = shaderManager.getProgram("debug");
setCullingActive(false);
diff --git a/components/debug/debugdraw.hpp b/components/debug/debugdraw.hpp
index 2518813cad..eb4219e06b 100644
--- a/components/debug/debugdraw.hpp
+++ b/components/debug/debugdraw.hpp
@@ -101,7 +101,7 @@ namespace Debug
void addLine(const osg::Vec3& start, const osg::Vec3& end, const osg::Vec3 color = colorWhite);
private:
- unsigned int mCurrentFrame;
+ unsigned int mCurrentFrame = 0;
std::array<osg::ref_ptr<DebugCustomDraw>, 2> mCustomDebugDrawer;
};
diff --git a/components/lua/asyncpackage.cpp b/components/lua/asyncpackage.cpp
index 6e13406511..5d563e6276 100644
--- a/components/lua/asyncpackage.cpp
+++ b/components/lua/asyncpackage.cpp
@@ -94,7 +94,7 @@ namespace LuaUtil
sol::table callbackMeta = Callback::makeMetatable(L);
api["callback"] = [callbackMeta](const AsyncPackageId& asyncId, sol::main_protected_function fn) -> sol::table {
- return Callback::make(asyncId, fn, callbackMeta);
+ return Callback::make(asyncId, std::move(fn), callbackMeta);
};
auto initializer = [](sol::table hiddenData) {