Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.

llvm-svn: 263300
diff --git a/lldb/source/Core/Logging.cpp b/lldb/source/Core/Logging.cpp
index d08d833..27a78d6 100644
--- a/lldb/source/Core/Logging.cpp
+++ b/lldb/source/Core/Logging.cpp
@@ -11,30 +11,31 @@
 
 // C Includes
 // C++ Includes
+#include <cstring>
 #include <atomic>
+
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/StreamFile.h"
-#include <string.h>
 
 using namespace lldb;
 using namespace lldb_private;
 
-
 // We want to avoid global constructors where code needs to be run so here we
 // control access to our static g_log_sp by hiding it in a singleton function
 // that will construct the static g_lob_sp the first time this function is
 // called.
 
 static std::atomic<bool> g_log_enabled {false};
-static Log * g_log = NULL;
+static Log * g_log = nullptr;
+
 static Log *
 GetLog ()
 {
     if (!g_log_enabled)
-        return NULL;
+        return nullptr;
     return g_log;
 }
 
@@ -62,7 +63,7 @@
     {
         uint32_t log_mask = log->GetMask().Get();
         if ((log_mask & mask) != mask)
-            return NULL;
+            return nullptr;
     }
     return log;
 }
@@ -84,7 +85,7 @@
 lldb_private::LogIfAnyCategoriesSet (uint32_t mask, const char *format, ...)
 {
     Log *log(GetLogIfAnyCategoriesSet (mask));
-    if (log)
+    if (log != nullptr)
     {
         va_list args;
         va_start (args, format);
@@ -97,9 +98,9 @@
 lldb_private::GetLogIfAnyCategoriesSet (uint32_t mask)
 {
     Log *log(GetLog ());
-    if (log && mask && (mask & log->GetMask().Get()))
+    if (log != nullptr && mask && (mask & log->GetMask().Get()))
         return log;
-    return NULL;
+    return nullptr;
 }
 
 void
@@ -107,13 +108,13 @@
 {
     Log *log(GetLog ());
 
-    if (log)
+    if (log != nullptr)
     {
         uint32_t flag_bits = 0;
-        if (categories[0] != NULL)
+        if (categories[0] != nullptr)
         {
             flag_bits = log->GetMask().Get();
-            for (size_t i = 0; categories[i] != NULL; ++i)
+            for (size_t i = 0; categories[i] != nullptr; ++i)
             {
                 const char *arg = categories[i];
 
@@ -164,8 +165,6 @@
             g_log_enabled = false;
         }
     }
-
-    return;
 }
 
 Log *
@@ -174,7 +173,7 @@
     // Try see if there already is a log - that way we can reuse its settings.
     // We could reuse the log in toto, but we don't know that the stream is the same.
     uint32_t flag_bits;
-    if (g_log)
+    if (g_log != nullptr)
         flag_bits = g_log->GetMask().Get();
     else
         flag_bits = 0;
@@ -182,15 +181,15 @@
     // Now make a new log with this stream if one was provided
     if (log_stream_sp)
     {
-        if (g_log)
+        if (g_log != nullptr)
             g_log->SetStream(log_stream_sp);
         else
             g_log = new Log(log_stream_sp);
     }
 
-    if (g_log)
+    if (g_log != nullptr)
     {
-        for (size_t i=0; categories[i] != NULL; ++i)
+        for (size_t i = 0; categories[i] != nullptr; ++i)
         {
             const char *arg = categories[i];
 
@@ -241,7 +240,6 @@
     return g_log;
 }
 
-
 void
 lldb_private::ListLogCategories (Stream *strm)
 {