Fix minor warnings from clang.

This commit is contained in:
Stephen Anthony 2020-05-22 15:07:20 -02:30
parent b703d3df92
commit 94b1800cc4
2 changed files with 6 additions and 4 deletions

View File

@ -376,7 +376,7 @@ bool FrameBufferSDL2::adaptRefreshRate(Int32 displayIndex, SDL_DisplayMode& adap
SDL_DisplayMode closestSdlMode; SDL_DisplayMode closestSdlMode;
sdlMode.refresh_rate = wantedRefreshRate * m; sdlMode.refresh_rate = wantedRefreshRate * m;
if(SDL_GetClosestDisplayMode(displayIndex, &sdlMode, &closestSdlMode) == NULL) if(SDL_GetClosestDisplayMode(displayIndex, &sdlMode, &closestSdlMode) == nullptr)
{ {
Logger::error("ERROR: Closest display mode could not be retrieved"); Logger::error("ERROR: Closest display mode could not be retrieved");
return adapt; return adapt;
@ -515,6 +515,7 @@ bool FrameBufferSDL2::fullScreen() const
#endif #endif
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int FrameBufferSDL2::refreshRate() const int FrameBufferSDL2::refreshRate() const
{ {
ASSERT_MAIN_THREAD; ASSERT_MAIN_THREAD;
@ -525,8 +526,9 @@ int FrameBufferSDL2::refreshRate() const
if(SDL_GetCurrentDisplayMode(displayIndex, &sdlMode) == 0) if(SDL_GetCurrentDisplayMode(displayIndex, &sdlMode) == 0)
return sdlMode.refresh_rate; return sdlMode.refresh_rate;
if (myWindow != NULL) if(myWindow != nullptr)
Logger::error("Could not retrieve current display mode"); Logger::error("Could not retrieve current display mode");
return 0; return 0;
} }

View File

@ -185,7 +185,7 @@ class FrameBufferSDL2 : public FrameBuffer
Checks if the display refresh rate should be adapted to game refresh rate in (real) fullscreen mode Checks if the display refresh rate should be adapted to game refresh rate in (real) fullscreen mode
@param displayIndex The display which should be checked @param displayIndex The display which should be checked
@adaptedSdlMode The best matching mode if the refresh rate should be changed @param adaptedSdlMode The best matching mode if the refresh rate should be changed
@return True if the refresh rate should be changed @return True if the refresh rate should be changed
*/ */