From: Joel Rosdahl Date: Thu, 6 Aug 2020 14:59:57 +0000 (+0200) Subject: Use nullptr instead of NULL X-Git-Tag: v4.0~207 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0007ccd76629effa391e2e5a59f4c93f00129c91;p=thirdparty%2Fccache.git Use nullptr instead of NULL --- diff --git a/src/Lockfile.cpp b/src/Lockfile.cpp index c1576800f..ec6cfa83f 100644 --- a/src/Lockfile.cpp +++ b/src/Lockfile.cpp @@ -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; diff --git a/src/MiniTrace.cpp b/src/MiniTrace.cpp index 3cba8ecd8..788d31606 100644 --- a/src/MiniTrace.cpp +++ b/src/MiniTrace.cpp @@ -36,7 +36,7 @@ get_system_tmp_dir() { # ifndef _WIN32 const char* tmpdir = getenv("TMPDIR"); - if (tmpdir != NULL) { + if (tmpdir) { return tmpdir; } # else diff --git a/src/Util.cpp b/src/Util.cpp index d1b5398eb..8c17a79fd 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -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); diff --git a/src/hashutil.cpp b/src/hashutil.cpp index 9cc768008..c8d13aaa5 100644 --- a/src/hashutil.cpp +++ b/src/hashutil.cpp @@ -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]; diff --git a/src/system.hpp b/src/system.hpp index 845f21fd6..c96ea26e3 100644 --- a/src/system.hpp +++ b/src/system.hpp @@ -78,7 +78,7 @@ const size_t READ_BUFFER_SIZE = 65536; # endif # include # 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 ";"