1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Merge pull request #2268 from akortunov/scanfix

Fix some issues from the Coverity Scan report
This commit is contained in:
Bret Curtis 2019-03-19 17:27:48 +01:00 committed by GitHub
commit 26feedfcae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 19 deletions

View File

@ -102,6 +102,17 @@ bool parseOptions (int argc, char** argv, std::vector<std::string>& files)
bpo::parsed_options valid_opts = bpo::command_line_parser(argc, argv). bpo::parsed_options valid_opts = bpo::command_line_parser(argc, argv).
options(desc).positional(p).run(); options(desc).positional(p).run();
bpo::store(valid_opts, variables); bpo::store(valid_opts, variables);
bpo::notify(variables);
if (variables.count ("help"))
{
std::cout << desc << std::endl;
return false;
}
if (variables.count("input-file"))
{
files = variables["input-file"].as< std::vector<std::string> >();
return true;
}
} }
catch(std::exception &e) catch(std::exception &e)
{ {
@ -110,18 +121,6 @@ bool parseOptions (int argc, char** argv, std::vector<std::string>& files)
return false; return false;
} }
bpo::notify(variables);
if (variables.count ("help"))
{
std::cout << desc << std::endl;
return false;
}
if (variables.count("input-file"))
{
files = variables["input-file"].as< std::vector<std::string> >();
return true;
}
std::cout << "No input files or directories specified!" << std::endl; std::cout << "No input files or directories specified!" << std::endl;
std::cout << desc << std::endl; std::cout << desc << std::endl;
return false; return false;

View File

@ -226,6 +226,7 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
, mActivationDistanceOverride(-1) , mActivationDistanceOverride(-1)
, mGrab(true) , mGrab(true)
, mExportFonts(false) , mExportFonts(false)
, mRandomSeed(0)
, mScriptContext (0) , mScriptContext (0)
, mFSStrict (false) , mFSStrict (false)
, mScriptBlacklistUse (true) , mScriptBlacklistUse (true)

View File

@ -196,8 +196,6 @@ namespace MWInput
void InputManager::handleGuiArrowKey(int action) void InputManager::handleGuiArrowKey(int action)
{ {
// Temporary shut-down of this function until deemed necessary.
return;
if (SDL_IsTextInputActive()) if (SDL_IsTextInputActive())
return; return;
@ -402,7 +400,8 @@ namespace MWInput
case A_MoveRight: case A_MoveRight:
case A_MoveForward: case A_MoveForward:
case A_MoveBackward: case A_MoveBackward:
handleGuiArrowKey(action); // Temporary shut-down of this function until deemed necessary.
//handleGuiArrowKey(action);
break; break;
case A_Journal: case A_Journal:
toggleJournal (); toggleJournal ();

View File

@ -311,10 +311,11 @@ void VisController::operator() (osg::Node* node, osg::NodeVisitor* nv)
RollController::RollController(const Nif::NiFloatData *data) RollController::RollController(const Nif::NiFloatData *data)
: mData(data->mKeyList, 1.f) : mData(data->mKeyList, 1.f)
, mStartingTime(0)
{ {
} }
RollController::RollController() RollController::RollController() : mStartingTime(0)
{ {
} }

View File

@ -777,6 +777,7 @@ MWShadowTechnique::MWShadowTechnique(const MWShadowTechnique& vdsm, const osg::C
ShadowTechnique(vdsm,copyop) ShadowTechnique(vdsm,copyop)
{ {
_shadowRecievingPlaceholderStateSet = new osg::StateSet; _shadowRecievingPlaceholderStateSet = new osg::StateSet;
_enableShadows = vdsm._enableShadows;
} }
MWShadowTechnique::~MWShadowTechnique() MWShadowTechnique::~MWShadowTechnique()
@ -2011,18 +2012,20 @@ struct ConvexHull
Vertices unwantedEdgeEnds = findInternalEdges(vertex, connectedVertices); Vertices unwantedEdgeEnds = findInternalEdges(vertex, connectedVertices);
for (auto edgeEnd : unwantedEdgeEnds) for (auto edgeEnd : unwantedEdgeEnds)
{ {
for (auto itr = _edges.begin(); itr != _edges.end(); ++itr) for (auto itr = _edges.begin(); itr != _edges.end();)
{ {
if (*itr == Edge(vertex, edgeEnd)) if (*itr == Edge(vertex, edgeEnd))
{ {
_edges.erase(itr); itr = _edges.erase(itr);
break; break;
} }
else if (*itr == Edge(edgeEnd, vertex)) else if (*itr == Edge(edgeEnd, vertex))
{ {
_edges.erase(itr); itr = _edges.erase(itr);
break; break;
} }
else
++itr;
} }
} }
} }