aboutsummaryrefslogtreecommitdiff
path: root/c/data.h
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-22 03:23:12 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-22 03:23:12 +0200
commitb87833b701a02fa960fab3fdb40d0b2d2c49a80e (patch)
tree521f653729196b42c3af066c82a4b5599d84e691 /c/data.h
parentd7bb04a09c7f04b0c3a8580d6a9ccd6313656fcf (diff)
downloadEpisodeBrowser-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.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/c/data.h b/c/data.h
index 23c9e5f..14e8920 100644
--- a/c/data.h
+++ b/c/data.h
@@ -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()