From fba60a84ae848ce661fefa7e7bb31754fe889b7b Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 9 Mar 2025 10:43:53 +1100 Subject: Avoid warnings by replacing &[0] with .data(), adding [[nodiscard]], replacing typedef with using, and initialising at declaration. --- win32/PlatWin.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'win32/PlatWin.cxx') diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 37c33d6ed..7598f9447 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -100,9 +100,9 @@ void LoadD2DOnce() noexcept { } } - typedef HRESULT (WINAPI *D2D1CFSig)(D2D1_FACTORY_TYPE factoryType, REFIID riid, + using D2D1CFSig = HRESULT (WINAPI *)(D2D1_FACTORY_TYPE factoryType, REFIID riid, CONST D2D1_FACTORY_OPTIONS *pFactoryOptions, IUnknown **factory); - typedef HRESULT (WINAPI *DWriteCFSig)(DWRITE_FACTORY_TYPE factoryType, REFIID iid, + using DWriteCFSig = HRESULT (WINAPI *)(DWRITE_FACTORY_TYPE factoryType, REFIID iid, IUnknown **factory); hDLLD2D = ::LoadLibraryEx(TEXT("D2D1.DLL"), {}, loadLibraryFlags); @@ -3212,7 +3212,7 @@ public: char *SetWords(const char *s) { words = std::vector(s, s+strlen(s)+1); - return &words[0]; + return words.data(); } }; -- cgit v1.2.3