summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'lldb')
-rw-r--r--lldb/source/Utility/FileSpec.cpp2
-rw-r--r--lldb/source/Utility/Stream.cpp4
-rw-r--r--lldb/source/Utility/StringList.cpp2
-rw-r--r--lldb/source/Utility/StructuredData.cpp6
-rw-r--r--lldb/source/Utility/TildeExpressionResolver.cpp2
-rw-r--r--lldb/source/Utility/UUID.cpp4
6 files changed, 9 insertions, 11 deletions
diff --git a/lldb/source/Utility/FileSpec.cpp b/lldb/source/Utility/FileSpec.cpp
index 5a43cfec857..954968b7a8a 100644
--- a/lldb/source/Utility/FileSpec.cpp
+++ b/lldb/source/Utility/FileSpec.cpp
@@ -424,7 +424,7 @@ std::string FileSpec::GetPath(bool denormalize) const {
}
const char *FileSpec::GetCString(bool denormalize) const {
- return ConstString{GetPath(denormalize)}.AsCString(NULL);
+ return ConstString{GetPath(denormalize)}.AsCString(nullptr);
}
void FileSpec::GetPath(llvm::SmallVectorImpl<char> &path,
diff --git a/lldb/source/Utility/Stream.cpp b/lldb/source/Utility/Stream.cpp
index ab5863d8a8c..54691c7066d 100644
--- a/lldb/source/Utility/Stream.cpp
+++ b/lldb/source/Utility/Stream.cpp
@@ -93,9 +93,9 @@ void Stream::QuotedCString(const char *cstr, const char *format) {
//------------------------------------------------------------------
void Stream::Address(uint64_t addr, uint32_t addr_size, const char *prefix,
const char *suffix) {
- if (prefix == NULL)
+ if (prefix == nullptr)
prefix = "";
- if (suffix == NULL)
+ if (suffix == nullptr)
suffix = "";
// int addr_width = m_addr_size << 1;
// Printf ("%s0x%0*" PRIx64 "%s", prefix, addr_width, addr, suffix);
diff --git a/lldb/source/Utility/StringList.cpp b/lldb/source/Utility/StringList.cpp
index fe7c1c4b5a6..20bde1a39ac 100644
--- a/lldb/source/Utility/StringList.cpp
+++ b/lldb/source/Utility/StringList.cpp
@@ -83,7 +83,7 @@ size_t StringList::GetMaxStringLength() const {
const char *StringList::GetStringAtIndex(size_t idx) const {
if (idx < m_strings.size())
return m_strings[idx].c_str();
- return NULL;
+ return nullptr;
}
void StringList::Join(const char *separator, Stream &strm) {
diff --git a/lldb/source/Utility/StructuredData.cpp b/lldb/source/Utility/StructuredData.cpp
index b7f900d52bb..26a96d5972e 100644
--- a/lldb/source/Utility/StructuredData.cpp
+++ b/lldb/source/Utility/StructuredData.cpp
@@ -144,7 +144,7 @@ static StructuredData::ObjectSP ParseJSONValue(JSONParser &json_parser) {
}
StructuredData::ObjectSP StructuredData::ParseJSON(std::string json_text) {
- JSONParser json_parser(json_text.c_str());
+ JSONParser json_parser(json_text);
StructuredData::ObjectSP object_sp = ParseJSONValue(json_parser);
return object_sp;
}
@@ -169,11 +169,11 @@ StructuredData::Object::GetObjectForDotSeparatedPath(llvm::StringRef path) {
if (this->GetType() == lldb::eStructuredDataTypeArray) {
std::pair<llvm::StringRef, llvm::StringRef> match = path.split('[');
- if (match.second.size() == 0) {
+ if (match.second.empty()) {
return this->shared_from_this();
}
errno = 0;
- uint64_t val = strtoul(match.second.str().c_str(), NULL, 10);
+ uint64_t val = strtoul(match.second.str().c_str(), nullptr, 10);
if (errno == 0) {
return this->GetAsArray()->GetItemAtIndex(val);
}
diff --git a/lldb/source/Utility/TildeExpressionResolver.cpp b/lldb/source/Utility/TildeExpressionResolver.cpp
index 34ca0254613..4e2be77c49c 100644
--- a/lldb/source/Utility/TildeExpressionResolver.cpp
+++ b/lldb/source/Utility/TildeExpressionResolver.cpp
@@ -59,7 +59,7 @@ bool StandardTildeExpressionResolver::ResolvePartial(StringRef Expr,
struct passwd *user_entry;
Expr = Expr.drop_front();
- while ((user_entry = getpwent()) != NULL) {
+ while ((user_entry = getpwent()) != nullptr) {
StringRef ThisName(user_entry->pw_name);
if (!ThisName.startswith(Expr))
continue;
diff --git a/lldb/source/Utility/UUID.cpp b/lldb/source/Utility/UUID.cpp
index 6c9eb2137ae..b00878792c7 100644
--- a/lldb/source/Utility/UUID.cpp
+++ b/lldb/source/Utility/UUID.cpp
@@ -51,9 +51,7 @@ std::string UUID::GetAsString(llvm::StringRef separator) const {
return result;
}
-void UUID::Dump(Stream *s) const {
- s->PutCString(GetAsString().c_str());
-}
+void UUID::Dump(Stream *s) const { s->PutCString(GetAsString()); }
static inline int xdigit_to_int(char ch) {
ch = tolower(ch);
OpenPOWER on IntegriCloud