diff options
Diffstat (limited to 'c/data.h')
-rw-r--r-- | c/data.h | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -62,7 +62,7 @@ struct CfgA /* Variable template for obtaining the version of a given struct. */ template <typename T> -constexpr inline unsigned char Version = T{}.version; +constexpr inline unsigned char Version = T().version; template <typename T, typename = int> constexpr inline bool HasVersion = false; @@ -79,7 +79,7 @@ struct FileView static FileView Initialized(const wchar_t* filename, size_t c, size_t cInit = 0) { bool bExisting = GetFileAttributes(filename) != INVALID_FILE_ATTRIBUTES; - FileView fv{filename, c}; + FileView fv(filename, c); /* If file didn't exist, initialize it with defaults. */ if (!bExisting) { @@ -101,9 +101,9 @@ struct FileView hf = CreateFile(filename, GENERIC_READ|GENERIC_WRITE, 0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr); if (hf == INVALID_HANDLE_VALUE) - throw Win32Error{}; + throw Win32Error(); } else - throw Win32Error{}; + throw Win32Error(); } LARGE_INTEGER cbMap; @@ -111,11 +111,11 @@ struct FileView hm = CreateFileMapping(hf, nullptr, PAGE_READWRITE, cbMap.HighPart, cbMap.LowPart, nullptr); if (!hm) - throw Win32Error{}; + throw Win32Error(); view = reinterpret_cast<T*>(MapViewOfFile(hm, FILE_MAP_ALL_ACCESS, 0, 0, 0)); if (!view) - throw Win32Error{}; + throw Win32Error(); } ~FileView() |