From b87833b701a02fa960fab3fdb40d0b2d2c49a80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 22 Aug 2022 03:23:12 +0200 Subject: Change initialization style. Because I don't want to have to remember what classes have initializer_list overloads. --- c/data.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'c/data.h') 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 -constexpr inline unsigned char Version = T{}.version; +constexpr inline unsigned char Version = T().version; template 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(MapViewOfFile(hm, FILE_MAP_ALL_ACCESS, 0, 0, 0)); if (!view) - throw Win32Error{}; + throw Win32Error(); } ~FileView() -- cgit v1.2.3