diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2019-06-21 00:41:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-06-24 13:36:09 (GMT) |
commit | 5e52de7d5708c5d2faf00837bf5f10ed024cced1 (patch) | |
tree | 78012dbe66b15c98b4bee75730d7693583a99d4f /Source/cmMachO.cxx | |
parent | cecf7e61c4816e4a3bb55df243c6bf84f6df6e58 (diff) | |
download | CMake-5e52de7d5708c5d2faf00837bf5f10ed024cced1.zip CMake-5e52de7d5708c5d2faf00837bf5f10ed024cced1.tar.gz CMake-5e52de7d5708c5d2faf00837bf5f10ed024cced1.tar.bz2 |
modermize: replace some raw pointers w/ `unique_ptr`
Diffstat (limited to 'Source/cmMachO.cxx')
-rw-r--r-- | Source/cmMachO.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx index d4af1e0..ac6dce9 100644 --- a/Source/cmMachO.cxx +++ b/Source/cmMachO.cxx @@ -2,9 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMachO.h" +#include "cmAlgorithms.h" #include "cmsys/FStream.hxx" -#include <algorithm> -#include <stddef.h> +#include <cstddef> #include <string> #include <vector> @@ -120,7 +120,7 @@ protected: // Implementation for reading Mach-O header and load commands. // This is 32 or 64 bit arch specific. -template <class T> +template <typename T> class cmMachOHeaderAndLoadCommandsImpl : public cmMachOHeaderAndLoadCommands { public: @@ -306,15 +306,11 @@ bool cmMachOInternal::read_mach_o(uint32_t file_offset) // External class implementation. cmMachO::cmMachO(const char* fname) - : Internal(nullptr) + : Internal(cm::make_unique<cmMachOInternal>(fname)) { - this->Internal = new cmMachOInternal(fname); } -cmMachO::~cmMachO() -{ - delete this->Internal; -} +cmMachO::~cmMachO() = default; std::string const& cmMachO::GetErrorMessage() const { |