More cleanups to VS project.

This commit is contained in:
Stephen Anthony 2021-12-18 18:45:28 -03:30
parent aa74f00b7f
commit a952bef910
6 changed files with 20 additions and 7 deletions

View File

@ -24,7 +24,7 @@
* We can't control the quality of code from outside projects, so for now * We can't control the quality of code from outside projects, so for now
* just disable warnings for it. * just disable warnings for it.
*/ */
#ifdef __clang__ #if defined(__clang__)
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation" #pragma clang diagnostic ignored "-Wdocumentation"
#pragma clang diagnostic ignored "-Wdocumentation-unknown-command" #pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
@ -33,6 +33,10 @@
#pragma clang diagnostic ignored "-Wold-style-cast" #pragma clang diagnostic ignored "-Wold-style-cast"
#include <SDL.h> #include <SDL.h>
#pragma clang diagnostic pop #pragma clang diagnostic pop
#elif defined(BSPF_WINDOWS)
#pragma warning(push, 0)
#include <SDL.h>
#pragma warning(pop)
#else #else
#include <SDL.h> #include <SDL.h>
#endif #endif
@ -51,7 +55,8 @@ static inline string SDLVersion()
ostringstream buf; ostringstream buf;
SDL_version ver; SDL_version ver;
SDL_GetVersion(&ver); SDL_GetVersion(&ver);
buf << "SDL " << int(ver.major) << "." << int(ver.minor) << "." << int(ver.patch); buf << "SDL " << static_cast<int>(ver.major) << "." << static_cast<int>(ver.minor)
<< "." << static_cast<int>(ver.patch);
return buf.str(); return buf.str();
} }

View File

@ -417,7 +417,7 @@ enum StellaMod
// Test if specified modifier is pressed // Test if specified modifier is pressed
namespace StellaModTest namespace StellaModTest
{ {
inline bool isAlt(int mod) inline constexpr bool isAlt(int mod)
{ {
#if defined(BSPF_MACOS) || defined(MACOS_KEYS) #if defined(BSPF_MACOS) || defined(MACOS_KEYS)
return (mod & KBDM_GUI); return (mod & KBDM_GUI);
@ -426,12 +426,12 @@ namespace StellaModTest
#endif #endif
} }
inline bool isControl(int mod) inline constexpr bool isControl(int mod)
{ {
return (mod & KBDM_CTRL); return (mod & KBDM_CTRL);
} }
inline bool isShift(int mod) inline constexpr bool isShift(int mod)
{ {
return (mod & KBDM_SHIFT); return (mod & KBDM_SHIFT);
} }

View File

@ -95,7 +95,7 @@ class Properties
@return The value of the property @return The value of the property
*/ */
const string& get(PropType key) const { const string& get(PropType key) const {
uInt8 pos = static_cast<uInt8>(key); const uInt8 pos = static_cast<uInt8>(key);
return pos < static_cast<uInt8>(PropType::NumTypes) ? myProperties[pos] : EmptyString; return pos < static_cast<uInt8>(PropType::NumTypes) ? myProperties[pos] : EmptyString;
} }

View File

@ -22,11 +22,15 @@
* We can't control the quality of code from outside projects, so for now * We can't control the quality of code from outside projects, so for now
* just disable warnings for it. * just disable warnings for it.
*/ */
#ifdef __clang__ #if defined(__clang__)
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything" #pragma clang diagnostic ignored "-Weverything"
#include "json.hxx" #include "json.hxx"
#pragma clang diagnostic pop #pragma clang diagnostic pop
#elif defined(BSPF_WINDOWS)
#pragma warning(push, 0)
#include "json.hxx"
#pragma warning(pop)
#else #else
#include "json.hxx" #include "json.hxx"
#endif #endif

View File

@ -1826,6 +1826,7 @@
<ClInclude Include="..\common\sdl_blitter\Blitter.hxx" /> <ClInclude Include="..\common\sdl_blitter\Blitter.hxx" />
<ClInclude Include="..\common\sdl_blitter\BlitterFactory.hxx" /> <ClInclude Include="..\common\sdl_blitter\BlitterFactory.hxx" />
<ClInclude Include="..\common\sdl_blitter\QisBlitter.hxx" /> <ClInclude Include="..\common\sdl_blitter\QisBlitter.hxx" />
<ClInclude Include="..\common\SDL_lib.hxx" />
<ClInclude Include="..\common\StaggeredLogger.hxx" /> <ClInclude Include="..\common\StaggeredLogger.hxx" />
<ClInclude Include="..\common\StateManager.hxx" /> <ClInclude Include="..\common\StateManager.hxx" />
<ClInclude Include="..\common\StellaKeys.hxx" /> <ClInclude Include="..\common\StellaKeys.hxx" />

View File

@ -2333,6 +2333,9 @@
<ClInclude Include="..\httplib\httplib.h"> <ClInclude Include="..\httplib\httplib.h">
<Filter>Header Files\httplib</Filter> <Filter>Header Files\httplib</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\common\SDL_lib.hxx">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="stella.ico"> <None Include="stella.ico">