diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-03-03 00:51:40 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-03-03 00:51:40 +0000 |
commit | 34ede34acd5d51ef552d5f8edf9b5d1a4fd0502a (patch) | |
tree | 7847f4c86dbd523cb4038b4ec3b9a8d1a082fe56 /lldb/source/Core/DataBufferHeap.cpp | |
parent | 6b500dc5f9c37ded310ebf626f655a33030b7914 (diff) | |
download | bcm5719-llvm-34ede34acd5d51ef552d5f8edf9b5d1a4fd0502a.tar.gz bcm5719-llvm-34ede34acd5d51ef552d5f8edf9b5d1a4fd0502a.zip |
Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.
llvm-svn: 262570
Diffstat (limited to 'lldb/source/Core/DataBufferHeap.cpp')
-rw-r--r-- | lldb/source/Core/DataBufferHeap.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lldb/source/Core/DataBufferHeap.cpp b/lldb/source/Core/DataBufferHeap.cpp index ba1314448bb..4e5389e053e 100644 --- a/lldb/source/Core/DataBufferHeap.cpp +++ b/lldb/source/Core/DataBufferHeap.cpp @@ -9,6 +9,11 @@ #include "lldb/Core/DataBufferHeap.h" +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes + using namespace lldb_private; //---------------------------------------------------------------------- @@ -44,32 +49,26 @@ DataBufferHeap::DataBufferHeap (const void *src, lldb::offset_t src_len) : // Virtual destructor since this class inherits from a pure virtual // base class. //---------------------------------------------------------------------- -DataBufferHeap::~DataBufferHeap () -{ -} +DataBufferHeap::~DataBufferHeap() = default; //---------------------------------------------------------------------- -// Return a pointer to the bytes owned by this object, or NULL if +// Return a pointer to the bytes owned by this object, or nullptr if // the object contains no bytes. //---------------------------------------------------------------------- uint8_t * DataBufferHeap::GetBytes () { - if (m_data.empty()) - return NULL; - return &m_data[0]; + return (m_data.empty() ? nullptr : m_data.data()); } //---------------------------------------------------------------------- -// Return a const pointer to the bytes owned by this object, or NULL +// Return a const pointer to the bytes owned by this object, or nullptr // if the object contains no bytes. //---------------------------------------------------------------------- const uint8_t * DataBufferHeap::GetBytes () const { - if (m_data.empty()) - return NULL; - return &m_data[0]; + return (m_data.empty() ? nullptr : m_data.data()); } //---------------------------------------------------------------------- @@ -81,7 +80,6 @@ DataBufferHeap::GetByteSize () const return m_data.size(); } - //---------------------------------------------------------------------- // Sets the number of bytes that this object should be able to // contain. This can be used prior to copying data into the buffer. |