diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx index f31e4624e..ae49b7fa7 100644 --- a/src/common/bspf.hxx +++ b/src/common/bspf.hxx @@ -135,7 +135,7 @@ namespace BSPF #endif // Get next power of two greater than or equal to the given value - inline size_t nextPowerOfTwo(size_t size) { + inline constexpr size_t nextPowerOfTwo(size_t size) { if(size < 2) return 1; size_t power2 = 1; while(power2 < size) @@ -145,7 +145,7 @@ namespace BSPF // Get next multiple of the given value // Note that this only works when multiple is a power of two - inline size_t nextMultipleOf(size_t size, size_t multiple) { + inline constexpr size_t nextMultipleOf(size_t size, size_t multiple) { return (size + multiple - 1) & ~(multiple - 1); } @@ -244,7 +244,7 @@ namespace BSPF { auto pos = std::search(s1.cbegin()+startpos, s1.cend(), s2.cbegin(), s2.cend(), [](char ch1, char ch2) { - return toupper(uInt8(ch1)) == toupper(uInt8(ch2)); + return toupper(static_cast(ch1)) == toupper(static_cast(ch2)); }); return pos == s1.cend() ? string::npos : pos - (s1.cbegin()+startpos); } @@ -265,7 +265,7 @@ namespace BSPF size_t pos = 1; for(uInt32 j = 1; j < s2.size(); ++j) { - size_t found = findIgnoreCase(s1, s2.substr(j, 1), pos); + const size_t found = findIgnoreCase(s1, s2.substr(j, 1), pos); if(found == string::npos) return false; pos += found + 1; @@ -282,7 +282,7 @@ namespace BSPF inline bool matchesCamelCase(const string_view s1, const string_view s2) { // skip leading '_' for matching - uInt32 ofs = (s1[0] == '_' && s2[0] == '_') ? 1 : 0; + const uInt32 ofs = (s1[0] == '_' && s2[0] == '_') ? 1 : 0; if(startsWithIgnoreCase(s1.substr(ofs), s2.substr(ofs, 1))) { @@ -292,7 +292,7 @@ namespace BSPF { if(std::isupper(s2[j])) { - size_t found = s1.find_first_of(s2[j], pos + ofs); + const size_t found = s1.find_first_of(s2[j], pos + ofs); if(found == string::npos) return false; @@ -306,7 +306,7 @@ namespace BSPF } else { - size_t found = findIgnoreCase(s1, s2.substr(j, 1), pos + ofs); + const size_t found = findIgnoreCase(s1, s2.substr(j, 1), pos + ofs); if(found == string::npos) return false; @@ -335,7 +335,7 @@ namespace BSPF // Trim leading and trailing whitespace from a string inline string trim(const string& str) { - string::size_type first = str.find_first_not_of(' '); + const string::size_type first = str.find_first_not_of(' '); return (first == string::npos) ? EmptyString : str.substr(first, str.find_last_not_of(' ')-first+1); } diff --git a/src/emucore/PlusROM.hxx b/src/emucore/PlusROM.hxx index 104ef9a3f..0871e951e 100644 --- a/src/emucore/PlusROM.hxx +++ b/src/emucore/PlusROM.hxx @@ -152,7 +152,7 @@ class PlusROM : public Serializable string myPath; std::array myRxBuffer, myTxBuffer; - uInt8 myRxReadPos, myRxWritePos, myTxPos; + uInt8 myRxReadPos{0}, myRxWritePos{0}, myTxPos{0}; std::deque> myPendingRequests; diff --git a/src/httplib/http_lib.hxx b/src/httplib/http_lib.hxx index 5e5f894bf..2990d2c1f 100644 --- a/src/httplib/http_lib.hxx +++ b/src/httplib/http_lib.hxx @@ -22,11 +22,15 @@ * We can't control the quality of code from outside projects, so for now * just disable warnings for it. */ -#ifdef __clang__ +#if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Weverything" #include "httplib.h" #pragma clang diagnostic pop +#elif defined(BSPF_WINDOWS) + #pragma warning(push, 0) + #include "httplib.h" + #pragma warning(pop) #else #include "httplib.h" #endif diff --git a/src/sqlite/sqlite3.h b/src/sqlite/sqlite3.h index 51649099b..4d7af08ca 100644 --- a/src/sqlite/sqlite3.h +++ b/src/sqlite/sqlite3.h @@ -24,11 +24,15 @@ * We can't control the quality of code from outside projects, so for now * just disable warnings for it. */ -#ifdef __clang__ +#if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Weverything" #include "source/sqlite3.h" #pragma clang diagnostic pop +#elif defined(BSPF_WINDOWS) + #pragma warning(push, 0) + #include "source/sqlite3.h" + #pragma warning(pop) #else #include "source/sqlite3.h" #endif diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj index 8bb0d477b..51b36c7ba 100755 --- a/src/windows/Stella.vcxproj +++ b/src/windows/Stella.vcxproj @@ -262,7 +262,7 @@ StreamingSIMDExtensions stdcpp17 true - 4100;4127;4146;4244;%(DisableSpecificWarnings) + 4100;4127;4146;4244;26440;26446;26472;26455;%(DisableSpecificWarnings) CompileAsCpp NoListing $(IntDir)asm\windows\%(RelativeDir) @@ -296,7 +296,7 @@ StreamingSIMDExtensions stdcpp17 true - 4100;4127;4146;4244;%(DisableSpecificWarnings) + 4100;4127;4146;4244;26440;26446;26472;26455;%(DisableSpecificWarnings) CompileAsCpp NoListing $(IntDir)asm\windows\%(RelativeDir) @@ -332,7 +332,7 @@ $(IntDir)obj\\windows\%(RelativeDir) stdcpp17 true - 4100;4127;4146;4244;%(DisableSpecificWarnings) + 4100;4127;4146;4244;26440;26446;26472;26455;%(DisableSpecificWarnings) CompileAsCpp NoListing $(IntDir)asm\windows\%(RelativeDir) @@ -368,7 +368,7 @@ $(IntDir)obj\\windows\%(RelativeDir) stdcpp17 true - 4100;4127;4146;4244;%(DisableSpecificWarnings) + 4100;4127;4146;4244;26440;26446;26472;26455;%(DisableSpecificWarnings) CompileAsCpp NoListing $(IntDir)asm\windows\%(RelativeDir) @@ -402,7 +402,7 @@ StreamingSIMDExtensions stdcpp17 true - 4100;4127;4146;4244;%(DisableSpecificWarnings) + 4100;4127;4146;4244;26440;26446;26472;26455;%(DisableSpecificWarnings) CompileAsCpp NoListing $(IntDir)asm\windows\%(RelativeDir) @@ -437,7 +437,7 @@ StreamingSIMDExtensions stdcpp17 true - 4100;4127;4146;4244;%(DisableSpecificWarnings) + 4100;4127;4146;4244;26440;26446;26472;26455;%(DisableSpecificWarnings) CompileAsCpp NoListing $(IntDir)asm\windows\%(RelativeDir) @@ -472,7 +472,7 @@ StreamingSIMDExtensions stdcpp17 true - 4100;4127;4146;4244;%(DisableSpecificWarnings) + 4100;4127;4146;4244;26440;26446;26472;26455;%(DisableSpecificWarnings) CompileAsCpp NoListing $(IntDir)asm\windows\%(RelativeDir) @@ -510,7 +510,7 @@ $(IntDir)obj\\windows\%(RelativeDir) stdcpp17 true - 4100;4127;4146;4244;%(DisableSpecificWarnings) + 4100;4127;4146;4244;26440;26446;26472;26455;%(DisableSpecificWarnings) CompileAsCpp NoListing $(IntDir)asm\windows\%(RelativeDir) @@ -549,7 +549,7 @@ $(IntDir)obj\\windows\%(RelativeDir) stdcpp17 true - 4100;4127;4146;4244;%(DisableSpecificWarnings) + 4100;4127;4146;4244;26440;26446;26472;26455;%(DisableSpecificWarnings) CompileAsCpp NoListing $(IntDir)asm\windows\%(RelativeDir) @@ -588,7 +588,7 @@ $(IntDir)obj\\windows\%(RelativeDir) stdcpp17 true - 4100;4127;4146;4244;%(DisableSpecificWarnings) + 4100;4127;4146;4244;26440;26446;26472;26455;%(DisableSpecificWarnings) CompileAsCpp All $(IntDir)asm\windows\%(RelativeDir) @@ -2144,6 +2144,8 @@ + + diff --git a/src/windows/Stella.vcxproj.filters b/src/windows/Stella.vcxproj.filters index 05fe80c8b..b8a1b4b76 100644 --- a/src/windows/Stella.vcxproj.filters +++ b/src/windows/Stella.vcxproj.filters @@ -91,6 +91,9 @@ {ea737878-f4b5-4334-a356-353c6b68bdcd} + + {e216a718-4078-4a08-b134-4987ec071e31} + @@ -2324,6 +2327,12 @@ Header Files\gui + + Header Files\httplib + + + Header Files\httplib +