Skip to content

Commit

Permalink
Cleanup: Replace C-style casts with C++ style casts
Browse files Browse the repository at this point in the history
  • Loading branch information
garbear committed Mar 30, 2018
1 parent 981f056 commit e0e0307
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions xbmc/guilib/StereoscopicsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void CStereoscopicsManager::Initialize(void)

RENDER_STEREO_MODE CStereoscopicsManager::GetStereoMode(void) const
{
return (RENDER_STEREO_MODE) m_settings.GetInt(CSettings::SETTING_VIDEOSCREEN_STEREOSCOPICMODE);
return static_cast<RENDER_STEREO_MODE>(m_settings.GetInt(CSettings::SETTING_VIDEOSCREEN_STEREOSCOPICMODE));
}

void CStereoscopicsManager::SetStereoModeByUser(const RENDER_STEREO_MODE &mode)
Expand Down Expand Up @@ -163,7 +163,7 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetNextSupportedStereoMode(const RENDE
{
RENDER_STEREO_MODE mode = currentMode;
do {
mode = (RENDER_STEREO_MODE) ((mode + step) % RENDER_STEREO_MODE_COUNT);
mode = static_cast<RENDER_STEREO_MODE>((mode + step) % RENDER_STEREO_MODE_COUNT);
if(CServiceBroker::GetRenderSystem().SupportsStereo(mode))
break;
} while (mode != currentMode);
Expand Down Expand Up @@ -227,7 +227,7 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeByUserChoice(const std::s
std::vector<RENDER_STEREO_MODE> selectableModes;
for (int i = RENDER_STEREO_MODE_OFF; i < RENDER_STEREO_MODE_COUNT; i++)
{
RENDER_STEREO_MODE selectableMode = (RENDER_STEREO_MODE) i;
RENDER_STEREO_MODE selectableMode = static_cast<RENDER_STEREO_MODE>(i);
if (CServiceBroker::GetRenderSystem().SupportsStereo(selectableMode))
{
selectableModes.push_back(selectableMode);
Expand All @@ -248,7 +248,7 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeByUserChoice(const std::s

int iItem = pDlgSelect->GetSelectedItem();
if (iItem > -1 && pDlgSelect->IsConfirmed())
mode = (RENDER_STEREO_MODE) selectableModes[iItem];
mode = static_cast<RENDER_STEREO_MODE>(selectableModes[iItem]);
else
mode = GetStereoMode();

Expand All @@ -264,7 +264,7 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeOfPlayingVideo(void) cons
{
int convertedMode = ConvertVideoToGuiStereoMode(playerMode);
if (convertedMode > -1)
mode = (RENDER_STEREO_MODE) convertedMode;
mode = static_cast<RENDER_STEREO_MODE>(convertedMode);
}

CLog::Log(LOGDEBUG, "StereoscopicsManager: autodetected stereo mode for movie mode %s is: %s", playerMode.c_str(), ConvertGuiStereoModeToString(mode));
Expand Down Expand Up @@ -302,7 +302,7 @@ std::string CStereoscopicsManager::GetLabelForStereoMode(const RENDER_STEREO_MOD

RENDER_STEREO_MODE CStereoscopicsManager::GetPreferredPlaybackMode(void) const
{
return (RENDER_STEREO_MODE) m_settings.GetInt(CSettings::SETTING_VIDEOSCREEN_PREFEREDSTEREOSCOPICMODE);
return static_cast<RENDER_STEREO_MODE>(m_settings.GetInt(CSettings::SETTING_VIDEOSCREEN_PREFEREDSTEREOSCOPICMODE));
}

int CStereoscopicsManager::ConvertVideoToGuiStereoMode(const std::string &mode)
Expand Down Expand Up @@ -485,7 +485,7 @@ bool CStereoscopicsManager::OnAction(const CAction &action)
{
int stereoMode = ConvertStringToGuiStereoMode(action.GetName());
if (stereoMode > -1)
SetStereoModeByUser( (RENDER_STEREO_MODE) stereoMode );
SetStereoModeByUser(static_cast<RENDER_STEREO_MODE>(stereoMode));
return true;
}

Expand Down Expand Up @@ -521,7 +521,7 @@ bool CStereoscopicsManager::IsVideoStereoscopic() const

void CStereoscopicsManager::OnStreamChange()
{
STEREOSCOPIC_PLAYBACK_MODE playbackMode = (STEREOSCOPIC_PLAYBACK_MODE) m_settings.GetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE);
STEREOSCOPIC_PLAYBACK_MODE playbackMode = static_cast<STEREOSCOPIC_PLAYBACK_MODE>(m_settings.GetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE));
RENDER_STEREO_MODE mode = GetStereoMode();

// early return if playback mode should be ignored and we're in no stereoscopic mode right now
Expand Down

0 comments on commit e0e0307

Please # to comment.