diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx index 545a8e48f..64d97f50c 100644 --- a/src/common/bspf.hxx +++ b/src/common/bspf.hxx @@ -252,7 +252,7 @@ namespace BSPF // Find location (if any) of the second string within the first, // starting from 'startpos' in the first string - static size_t findIgnoreCase(string_view s1, string_view s2, size_t startpos = 0) + static constexpr size_t findIgnoreCase(string_view s1, string_view s2, size_t startpos = 0) { const auto pos = std::search(s1.cbegin()+startpos, s1.cend(), // NOLINT s2.cbegin(), s2.cend(), [](char ch1, char ch2) { @@ -262,7 +262,7 @@ namespace BSPF } // Test whether the first string contains the second one (case insensitive) - inline bool containsIgnoreCase(string_view s1, string_view s2) + inline constexpr bool containsIgnoreCase(string_view s1, string_view s2) { return findIgnoreCase(s1, s2) != string::npos; } diff --git a/src/os/windows/FSNodeWINDOWS.cxx b/src/os/windows/FSNodeWINDOWS.cxx index 2850e8cfe..99498fe4b 100644 --- a/src/os/windows/FSNodeWINDOWS.cxx +++ b/src/os/windows/FSNodeWINDOWS.cxx @@ -40,7 +40,7 @@ FSNodeWINDOWS::FSNodeWINDOWS(string_view p) bool FSNodeWINDOWS::setFlags() { // Get absolute path - TCHAR buf[MAX_PATH]; + static TCHAR buf[MAX_PATH]; if (GetFullPathName(_path.c_str(), MAX_PATH - 1, buf, NULL)) _path = buf;