mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-29 22:45:36 +00:00
Fix some Coverity Scan complaints
This commit is contained in:
parent
2114f84939
commit
225e834b88
9 changed files with 17 additions and 17 deletions
|
@ -584,7 +584,7 @@ void MwIniImporter::importGameFiles(
|
|||
reader.close();
|
||||
}
|
||||
|
||||
auto sortedFiles = dependencySort(unsortedFiles);
|
||||
auto sortedFiles = dependencySort(std::move(unsortedFiles));
|
||||
|
||||
// hard-coded dependency Morrowind - Tribunal - Bloodmoon
|
||||
if (findString(sortedFiles, "Morrowind.esm") != sortedFiles.end())
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace
|
|||
MWGui::BookPage::ClickCallback callback = [this](intptr_t linkId) { notifyTopicClicked(linkId); };
|
||||
|
||||
getPage(LeftBookPage)->adviseLinkClicked(callback);
|
||||
getPage(RightBookPage)->adviseLinkClicked(callback);
|
||||
getPage(RightBookPage)->adviseLinkClicked(std::move(callback));
|
||||
|
||||
getPage(LeftBookPage)->eventMouseWheel
|
||||
+= MyGUI::newDelegate(this, &JournalWindowImpl::notifyMouseWheel);
|
||||
|
@ -140,7 +140,7 @@ namespace
|
|||
|
||||
getPage(LeftTopicIndex)->adviseLinkClicked(callback);
|
||||
getPage(CenterTopicIndex)->adviseLinkClicked(callback);
|
||||
getPage(RightTopicIndex)->adviseLinkClicked(callback);
|
||||
getPage(RightTopicIndex)->adviseLinkClicked(std::move(callback));
|
||||
}
|
||||
|
||||
adjustButton(PrevPageBTN);
|
||||
|
@ -376,7 +376,7 @@ namespace
|
|||
setVisible(PageTwoNum, relPages > 1);
|
||||
|
||||
getPage(LeftBookPage)->showPage((relPages > 0) ? book : Book(), page + 0);
|
||||
getPage(RightBookPage)->showPage((relPages > 0) ? book : Book(), page + 1);
|
||||
getPage(RightBookPage)->showPage((relPages > 0) ? std::move(book) : Book(), page + 1);
|
||||
|
||||
setText(PageOneNum, page + 1);
|
||||
setText(PageTwoNum, page + 2);
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace MWLua
|
|||
if (asTable)
|
||||
{
|
||||
AnimationPriorities priorities = AnimationPriorities(Priority::Priority_Default);
|
||||
for (auto entry : asTable.value())
|
||||
for (const auto& entry : asTable.value())
|
||||
{
|
||||
if (!entry.first.is<BoneGroup>() || !entry.second.is<Priority>())
|
||||
throw std::runtime_error("Priority table must consist of BoneGroup-Priority pairs only");
|
||||
|
|
|
@ -711,7 +711,7 @@ namespace MWMechanics
|
|||
mMovementAnimationHasMovement = true;
|
||||
|
||||
clearStateAnimation(mCurrentMovement);
|
||||
mCurrentMovement = movementAnimName;
|
||||
mCurrentMovement = std::move(movementAnimName);
|
||||
|
||||
// For non-flying creatures, MW uses the Walk animation to calculate the animation velocity
|
||||
// even if we are running. This must be replicated, otherwise the observed speed would differ drastically.
|
||||
|
|
|
@ -844,7 +844,7 @@ namespace MWRender
|
|||
}
|
||||
}
|
||||
}
|
||||
SceneUtil::ForceControllerSourcesVisitor assignVisitor(src);
|
||||
SceneUtil::ForceControllerSourcesVisitor assignVisitor(std::move(src));
|
||||
node->accept(assignVisitor);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace MWWorld
|
|||
global.load(reader, isDeleted);
|
||||
|
||||
if (const auto iter = mVariables.find(global.mId); iter != mVariables.end())
|
||||
iter->second = global;
|
||||
iter->second = std::move(global);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ namespace MWWorld
|
|||
continue;
|
||||
ESM::ActiveSpells::ActiveSpellParams params;
|
||||
params.mId = id;
|
||||
params.mDisplayName = name;
|
||||
params.mDisplayName = std::move(name);
|
||||
params.mCasterActorId = creatureStats.mActorId;
|
||||
params.mType = ESM::ActiveSpells::Type_Enchantment;
|
||||
params.mWorsenings = -1;
|
||||
|
|
|
@ -115,20 +115,20 @@ namespace LuaUtil
|
|||
std::string_view handlerName = cast<std::string_view>(key);
|
||||
sol::function fn = cast<sol::function>(handler);
|
||||
if (handlerName == HANDLER_INIT)
|
||||
onInit = fn;
|
||||
onInit = std::move(fn);
|
||||
else if (handlerName == HANDLER_LOAD)
|
||||
onLoad = fn;
|
||||
onLoad = std::move(fn);
|
||||
else if (handlerName == HANDLER_SAVE)
|
||||
script.mOnSave = fn;
|
||||
script.mOnSave = std::move(fn);
|
||||
else if (handlerName == HANDLER_INTERFACE_OVERRIDE)
|
||||
script.mOnOverride = fn;
|
||||
script.mOnOverride = std::move(fn);
|
||||
else
|
||||
{
|
||||
auto it = mEngineHandlers.find(handlerName);
|
||||
if (it == mEngineHandlers.end())
|
||||
Log(Debug::Error) << "Not supported handler '" << handlerName << "' in " << debugName;
|
||||
else
|
||||
insertHandler(it->second->mList, scriptId, fn);
|
||||
insertHandler(it->second->mList, scriptId, std::move(fn));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -503,7 +503,7 @@ namespace Shader
|
|||
{
|
||||
break;
|
||||
}
|
||||
shaderSource = source;
|
||||
shaderSource = std::move(source);
|
||||
|
||||
std::vector<std::string> linkedShaderNames;
|
||||
if (!Manager.createSourceFromTemplate(
|
||||
|
@ -554,7 +554,7 @@ namespace Shader
|
|||
if (!addLineDirectivesAfterConditionalBlocks(source)
|
||||
|| !parseIncludes(mPath, source, templateName, fileNumber, {}, insertedPaths))
|
||||
return nullptr;
|
||||
mHotReloadManager->templateIncludedFiles[templateName] = insertedPaths;
|
||||
mHotReloadManager->templateIncludedFiles[templateName] = std::move(insertedPaths);
|
||||
templateIt = mShaderTemplates.insert(std::make_pair(templateName, source)).first;
|
||||
}
|
||||
|
||||
|
@ -597,7 +597,7 @@ namespace Shader
|
|||
if (!vert || !frag)
|
||||
throw std::runtime_error("failed initializing shader: " + templateName);
|
||||
|
||||
return getProgram(vert, frag, programTemplate);
|
||||
return getProgram(std::move(vert), std::move(frag), programTemplate);
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::Program> ShaderManager::getProgram(osg::ref_ptr<osg::Shader> vertexShader,
|
||||
|
|
Loading…
Reference in a new issue