1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Cleanup c-style casts from FileWatcher.cpp

This commit is contained in:
Tulio Leao
2020-07-14 12:42:54 -03:00
committed by Gymnasiast
parent 5abbbf1357
commit 5afe6407a1

View File

@@ -134,8 +134,8 @@ void FileWatcher::WatchDirectory()
std::array<char, 1024> eventData;
DWORD bytesReturned;
while (ReadDirectoryChangesW(
_directoryHandle, eventData.data(), (DWORD)eventData.size(), TRUE, FILE_NOTIFY_CHANGE_LAST_WRITE, &bytesReturned,
nullptr, nullptr))
_directoryHandle, eventData.data(), static_cast<DWORD>(eventData.size()), TRUE, FILE_NOTIFY_CHANGE_LAST_WRITE,
&bytesReturned, nullptr, nullptr))
{
auto onFileChanged = OnFileChanged;
if (onFileChanged)
@@ -144,7 +144,7 @@ void FileWatcher::WatchDirectory()
size_t offset = 0;
do
{
notifyInfo = (FILE_NOTIFY_INFORMATION*)(eventData.data() + offset);
notifyInfo = reinterpret_cast<FILE_NOTIFY_INFORMATION*>(eventData.data() + offset);
offset += notifyInfo->NextEntryOffset;
std::wstring fileNameW(notifyInfo->FileName, notifyInfo->FileNameLength / sizeof(wchar_t));