summaryrefslogtreecommitdiffstats
path: root/Source/cmMachO.cxx
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2019-06-21 00:41:48 (GMT)
committerBrad King <brad.king@kitware.com>2019-06-24 13:36:09 (GMT)
commit5e52de7d5708c5d2faf00837bf5f10ed024cced1 (patch)
tree78012dbe66b15c98b4bee75730d7693583a99d4f /Source/cmMachO.cxx
parentcecf7e61c4816e4a3bb55df243c6bf84f6df6e58 (diff)
downloadCMake-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.cxx14
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
{