Skip to content

Commit

Permalink
Utilization of INVALID_HANDLE_VALUE.
Browse files Browse the repository at this point in the history
Instances of reinterpret_cast<HANDLE>(-1) in
FilesystemPathImplWindows have been replaced with
INVALID_HANDLE_VALUE for readability.
  • Loading branch information
astrelsky committed Feb 6, 2019
1 parent 88bf9a2 commit 8239679
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/filesystem_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class FilesystemPathImplWindows : public FilesystemPathImpl

subpaths.clear();
HANDLE hFnd = FindFirstFile(examineDir.c_str(), &ffd);
if (hFnd == reinterpret_cast<HANDLE>(-1))
if (hFnd == INVALID_HANDLE_VALUE)
return false;

do
Expand Down Expand Up @@ -142,7 +142,7 @@ class FilesystemPathImplWindows : public FilesystemPathImpl
virtual bool isFile() override
{
WIN32_FIND_DATA ffd;
if (FindFirstFile(_path.c_str(), &ffd) == reinterpret_cast<HANDLE>(-1))
if (FindFirstFile(_path.c_str(), &ffd) == INVALID_HANDLE_VALUE)
return false;

return !(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
Expand All @@ -151,7 +151,7 @@ class FilesystemPathImplWindows : public FilesystemPathImpl
virtual bool isDirectory() override
{
WIN32_FIND_DATA ffd;
if (FindFirstFile(_path.c_str(), &ffd) == reinterpret_cast<HANDLE>(-1))
if (FindFirstFile(_path.c_str(), &ffd) == INVALID_HANDLE_VALUE)
return false;

return ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
Expand Down

0 comments on commit 8239679

Please sign in to comment.