]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Use nullptr instead of NULL
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 6 Aug 2020 14:59:57 +0000 (16:59 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 6 Aug 2020 14:59:57 +0000 (16:59 +0200)
src/Lockfile.cpp
src/MiniTrace.cpp
src/Util.cpp
src/hashutil.cpp
src/system.hpp

index c1576800f00d9bf12934fb536fff406f63f6fd87..ec6cfa83fff0a95db403bad0ab8c736a3acec7fb 100644 (file)
@@ -137,10 +137,10 @@ do_acquire_win32(const std::string& lockfile, uint32_t staleness_limit)
     handle = CreateFile(lockfile.c_str(),
                         GENERIC_WRITE, // desired access
                         0,             // shared mode (0 = not shared)
-                        NULL,          // security attributes
+                        nullptr,       // security attributes
                         CREATE_ALWAYS, // creation disposition
                         flags,         // flags and attributes
-                        NULL           // template file
+                        nullptr        // template file
     );
     if (handle != INVALID_HANDLE_VALUE) {
       break;
index 3cba8ecd8919d0cfa04e3f87151e9f676c5c9a4b..788d316061b9dbb7bfaaddaaca02cfa264e195d5 100644 (file)
@@ -36,7 +36,7 @@ get_system_tmp_dir()
 {
 #  ifndef _WIN32
   const char* tmpdir = getenv("TMPDIR");
-  if (tmpdir != NULL) {
+  if (tmpdir) {
     return tmpdir;
   }
 #  else
index d1b5398eb9bc21f2a03377e54170eb5b3b069d3f..8c17a79fde6c9daa68476a4b6b6c6d3c05f2414a 100644 (file)
@@ -1080,10 +1080,10 @@ real_path(const std::string& path, bool return_empty_on_error)
   HANDLE path_handle = CreateFile(c_path,
                                   GENERIC_READ,
                                   FILE_SHARE_READ,
-                                  NULL,
+                                  nullptr,
                                   OPEN_EXISTING,
                                   FILE_ATTRIBUTE_NORMAL,
-                                  NULL);
+                                  nullptr);
   if (INVALID_HANDLE_VALUE != path_handle) {
     bool ok = GetFinalPathNameByHandle(
       path_handle, buffer, buffer_size, FILE_NAME_NORMALIZED);
index 9cc76800855a5ccbddd40fed7ad5b3269dcac402..c8d13aaa58eced3a9b5ac9b9d8d9081725821d48 100644 (file)
@@ -419,7 +419,7 @@ hash_command_output(Hash& hash,
   si.cb = sizeof(STARTUPINFO);
 
   HANDLE pipe_out[2];
-  SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES), NULL, TRUE};
+  SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES), nullptr, TRUE};
   CreatePipe(&pipe_out[0], &pipe_out[1], &sa, 0);
   SetHandleInformation(pipe_out[0], HANDLE_FLAG_INHERIT, 0);
   si.hStdOutput = pipe_out[1];
index 845f21fd6009d3882deee66ad6020f98112cdca3..c96ea26e33d72c3614b4f6c6d7decf9e22f6c957 100644 (file)
@@ -78,7 +78,7 @@ const size_t READ_BUFFER_SIZE = 65536;
 #  endif
 #  include <windows.h>
 #  define mkdir(a, b) mkdir(a)
-#  define link(src, dst) (CreateHardLink(dst, src, NULL) ? 0 : -1)
+#  define link(src, dst) (CreateHardLink(dst, src, nullptr) ? 0 : -1)
 #  define execv(a, b) win32execute(a, b, 0, -1, -1)
 #  define DIR_DELIM_CH '\\'
 #  define PATH_DELIM ";"