Skip to content

Commit

Permalink
Fixed cppcheck error
Browse files Browse the repository at this point in the history
  • Loading branch information
SChernykh committed Apr 25, 2024
1 parent f4ed9e9 commit bbddf40
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/block_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ struct BlockCache::Impl : public nocopy_nomove
#elif defined(_WIN32)

Impl()
: m_file(CreateFile(cache_name, GENERIC_ALL, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL))
, m_map(0)
{
m_file = CreateFile(cache_name, GENERIC_ALL, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL);
if (m_file == INVALID_HANDLE_VALUE) {
LOGERR(1, "couldn't open " << cache_name << ", error " << static_cast<uint32_t>(GetLastError()));
return;
Expand Down Expand Up @@ -140,8 +141,8 @@ struct BlockCache::Impl : public nocopy_nomove
}
}

HANDLE m_file = INVALID_HANDLE_VALUE;
HANDLE m_map = 0;
HANDLE m_file;
HANDLE m_map;

#else
// Not implemented on other platforms
Expand Down

0 comments on commit bbddf40

Please sign in to comment.