From 2ab7f903d7f16c97f26a749d1f038e50590ee991 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Wed, 10 Apr 2019 11:09:44 +0200 Subject: [PATCH] make use of std::make_unique to test that MSVC2015 can handle that --- apps/openmw/mwmechanics/aipackage.cpp | 2 +- components/nifbullet/bulletnifloader.cpp | 1 - components/vfs/bsaarchive.cpp | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/aipackage.cpp b/apps/openmw/mwmechanics/aipackage.cpp index 90da9d1609..c9a3717499 100644 --- a/apps/openmw/mwmechanics/aipackage.cpp +++ b/apps/openmw/mwmechanics/aipackage.cpp @@ -261,7 +261,7 @@ const MWMechanics::PathgridGraph& MWMechanics::AiPackage::getPathGridGraph(const CacheMap::iterator found = cache.find(id); if (found == cache.end()) { - cache.insert(std::make_pair(id, std::unique_ptr(new MWMechanics::PathgridGraph(cell)))); + cache.insert(std::make_pair(id, std::make_unique(MWMechanics::PathgridGraph(cell)))); } return *cache[id].get(); } diff --git a/components/nifbullet/bulletnifloader.cpp b/components/nifbullet/bulletnifloader.cpp index 72933fc32a..1bc8d1c5f8 100644 --- a/components/nifbullet/bulletnifloader.cpp +++ b/components/nifbullet/bulletnifloader.cpp @@ -92,7 +92,6 @@ osg::ref_ptr BulletNifLoader::load(const Nif::File& nif) if (findBoundingBox(node)) { std::unique_ptr compound (new btCompoundShape); - std::unique_ptr boxShape(new btBoxShape(getbtVector(mShape->mCollisionBoxHalfExtents))); btTransform transform = btTransform::getIdentity(); transform.setOrigin(getbtVector(mShape->mCollisionBoxTranslate)); diff --git a/components/vfs/bsaarchive.cpp b/components/vfs/bsaarchive.cpp index 925c1076e3..9646b62afa 100644 --- a/components/vfs/bsaarchive.cpp +++ b/components/vfs/bsaarchive.cpp @@ -10,10 +10,10 @@ BsaArchive::BsaArchive(const std::string &filename) Bsa::BsaVersion bsaVersion = Bsa::CompressedBSAFile::detectVersion(filename); if (bsaVersion == Bsa::BSAVER_COMPRESSED) { - mFile = std::unique_ptr(new Bsa::CompressedBSAFile()); + mFile = std::make_unique(Bsa::CompressedBSAFile()); } else { - mFile = std::unique_ptr(new Bsa::BSAFile()); + mFile = std::make_unique(Bsa::BSAFile()); } mFile->open(filename);