diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-22 03:23:12 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-22 03:23:12 +0200 |
commit | b87833b701a02fa960fab3fdb40d0b2d2c49a80e (patch) | |
tree | 521f653729196b42c3af066c82a4b5599d84e691 /c/data.h | |
parent | d7bb04a09c7f04b0c3a8580d6a9ccd6313656fcf (diff) | |
download | EpisodeBrowser-b87833b701a02fa960fab3fdb40d0b2d2c49a80e.tar.gz |
Change initialization style.
Because I don't want to have to remember what classes have
initializer_list overloads.
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() |