Skip to content

Commit

Permalink
[NFC] Use value initializer for OVERLAPPED
Browse files Browse the repository at this point in the history
To fix
../llvm/lib/Support/Windows/Path.inc(1265,21): warning: missing field
'InternalHigh' initializer [-Wmissing-field-initializers]
  OVERLAPPED OV = {0};

Differential Revision: https://reviews.llvm.org/D85480
  • Loading branch information
aeubanks committed Aug 7, 2020
1 parent 04bd5b5 commit 2b5502c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Support/Windows/Path.inc
Expand Up @@ -1262,7 +1262,7 @@ Expected<size_t> readNativeFileSlice(file_t FileHandle,

std::error_code tryLockFile(int FD, std::chrono::milliseconds Timeout) {
DWORD Flags = LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY;
OVERLAPPED OV = {0};
OVERLAPPED OV = {};
file_t File = convertFDToNativeFile(FD);
auto Start = std::chrono::steady_clock::now();
auto End = Start + Timeout;
Expand All @@ -1281,7 +1281,7 @@ std::error_code tryLockFile(int FD, std::chrono::milliseconds Timeout) {

std::error_code lockFile(int FD) {
DWORD Flags = LOCKFILE_EXCLUSIVE_LOCK;
OVERLAPPED OV = {0};
OVERLAPPED OV = {};
file_t File = convertFDToNativeFile(FD);
if (::LockFileEx(File, Flags, 0, MAXDWORD, MAXDWORD, &OV))
return std::error_code();
Expand All @@ -1290,7 +1290,7 @@ std::error_code lockFile(int FD) {
}

std::error_code unlockFile(int FD) {
OVERLAPPED OV = {0};
OVERLAPPED OV = {};
file_t File = convertFDToNativeFile(FD);
if (::UnlockFileEx(File, 0, MAXDWORD, MAXDWORD, &OV))
return std::error_code();
Expand Down

0 comments on commit 2b5502c

Please sign in to comment.