From b687e952efa7407e323e8465df41e2e84b277b31 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 9 Oct 2019 03:29:25 -0700 Subject: Make C callbacks noexcept No telling what would happen if exceptions managed to get back into presumably C-based callers. --- alc/backends/dsound.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'alc/backends/dsound.cpp') diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp index b74f2d3e..c04ba9e4 100644 --- a/alc/backends/dsound.cpp +++ b/alc/backends/dsound.cpp @@ -124,13 +124,12 @@ al::vector CaptureDevices; bool checkName(const al::vector &list, const std::string &name) { - return std::find_if(list.cbegin(), list.cend(), - [&name](const DevMap &entry) -> bool - { return entry.name == name; } - ) != list.cend(); + auto match_name = [&name](const DevMap &entry) -> bool + { return entry.name == name; }; + return std::find_if(list.cbegin(), list.cend(), match_name) != list.cend(); } -BOOL CALLBACK DSoundEnumDevices(GUID *guid, const WCHAR *desc, const WCHAR*, void *data) +BOOL CALLBACK DSoundEnumDevices(GUID *guid, const WCHAR *desc, const WCHAR*, void *data) noexcept { if(!guid) return TRUE; -- cgit v1.2.3