From 27a5da59baa005f8b645b97fbc138b4ea015aa1d Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 10 Jul 2018 10:05:13 +0400 Subject: [PATCH] Fix MSVC warnings C4456 --- apps/mwiniimporter/importer.cpp | 3 +-- apps/opencs/view/render/object.cpp | 4 ++-- apps/opencs/view/render/worldspacewidget.cpp | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/mwiniimporter/importer.cpp b/apps/mwiniimporter/importer.cpp index 6f5c2e2cdb..4fbe977201 100644 --- a/apps/mwiniimporter/importer.cpp +++ b/apps/mwiniimporter/importer.cpp @@ -874,7 +874,6 @@ void MwIniImporter::importGameFiles(multistrmap &cfg, const multistrmap &ini, co { std::vector> contentFiles; std::string baseGameFile("Game Files:GameFile"); - std::string gameFile(""); std::time_t defaultTime = 0; ToUTF8::Utf8Encoder encoder(mEncoding); @@ -890,7 +889,7 @@ void MwIniImporter::importGameFiles(multistrmap &cfg, const multistrmap &ini, co multistrmap::const_iterator it = ini.begin(); for (int i=0; it != ini.end(); i++) { - gameFile = baseGameFile; + std::string gameFile = baseGameFile; gameFile.append(std::to_string(i)); it = ini.find(gameFile); diff --git a/apps/opencs/view/render/object.cpp b/apps/opencs/view/render/object.cpp index dae6467c57..204bf4c2fa 100644 --- a/apps/opencs/view/render/object.cpp +++ b/apps/opencs/view/render/object.cpp @@ -372,10 +372,10 @@ osg::ref_ptr CSVRender::Object::makeRotateMarker (int axis) indices[j] -= VertexCount; } - size_t offset = i * IndicesPerSegment; + size_t elementOffset = i * IndicesPerSegment; for (size_t j = 0; j < IndicesPerSegment; ++j) { - primitives->setElement(offset++, indices[IndexPattern[j]]); + primitives->setElement(elementOffset++, indices[IndexPattern[j]]); } } diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index 084fb87e65..5b825fab1f 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -651,7 +651,6 @@ void CSVRender::WorldspaceWidget::mouseMoveEvent (QMouseEvent *event) if (mDragMode == InteractionType_PrimaryEdit) { - EditMode& editMode = dynamic_cast (*mEditMode->getCurrent()); editMode.drag (event->pos(), mDragX, mDragY, mDragFactor); // note: terraintexturemode only uses pos } }