aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiff_ <spiff_@svn>2009-12-21 01:38:26 +0000
committerspiff_ <spiff_@svn>2009-12-21 01:38:26 +0000
commit34c650af122dd00390cef062500cd0f7e79fbec7 (patch)
tree9af4d6e34f9650b59b18514aa1951a02f356bece
parentdf53f9e68809e20c3be7ca4d401af68134545a08 (diff)
changed: remove HRESULT usage and replace by bool
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@25917 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--xbmc/Application.cpp24
-rw-r--r--xbmc/Application.h6
-rw-r--r--xbmc/XBApplicationEx.cpp10
-rw-r--r--xbmc/XBApplicationEx.h6
-rw-r--r--xbmc/xbmc.cpp2
5 files changed, 23 insertions, 25 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index ec0e85ecc7..24f6e42c48 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -454,7 +454,7 @@ void CApplication::Preflight()
#endif
}
-HRESULT CApplication::Create(HWND hWnd)
+bool CApplication::Create(HWND hWnd)
{
g_guiSettings.Initialize(); // Initialize default Settings
g_settings.Initialize(); //Initialize default AdvancedSettings
@@ -501,7 +501,7 @@ HRESULT CApplication::Create(HWND hWnd)
if (!CLog::Init(_P(g_stSettings.m_logFolder).c_str()))
{
fprintf(stderr,"Could not init logging classes. Permission errors on ~/.xbmc?\n");
- return E_FAIL;
+ return false;
}
@@ -583,7 +583,7 @@ HRESULT CApplication::Create(HWND hWnd)
if (SDL_Init(sdlFlags) != 0)
{
CLog::Log(LOGFATAL, "XBAppEx: Unable to initialize SDL: %s", SDL_GetError());
- return E_FAIL;
+ return false;
}
#endif
@@ -600,7 +600,7 @@ HRESULT CApplication::Create(HWND hWnd)
if (!g_Windowing.InitWindowSystem())
{
CLog::Log(LOGFATAL, "CApplication::Create: Unable to init windowing system");
- return E_FAIL;
+ return false;
}
// Create the Mouse and Keyboard devices
@@ -652,21 +652,21 @@ HRESULT CApplication::Create(HWND hWnd)
if (!g_Windowing.CreateNewWindow("XBMC", bFullScreen, g_settings.m_ResInfo[RES_WINDOW], OnEvent))
{
CLog::Log(LOGFATAL, "CApplication::Create: Unable to create window");
- return E_FAIL;
+ return false;
}
#else
bool bFullScreen = g_guiSettings.m_LookAndFeelResolution != RES_WINDOW;
if (!g_Windowing.CreateNewWindow("XBMC", bFullScreen, g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution], OnEvent))
{
CLog::Log(LOGFATAL, "CApplication::Create: Unable to create window");
- return E_FAIL;
+ return false;
}
#endif
if (!g_Windowing.InitRenderSystem())
{
CLog::Log(LOGFATAL, "CApplication::Create: Unable to init rendering system");
- return E_FAIL;
+ return false;
}
// set GUI res and force the clear of the screen
@@ -1075,7 +1075,7 @@ CProfile* CApplication::InitDirectoriesWin32()
#endif
}
-HRESULT CApplication::Initialize()
+bool CApplication::Initialize()
{
#ifdef HAS_DVD_DRIVE
// turn off cdio logging
@@ -1317,7 +1317,7 @@ HRESULT CApplication::Initialize()
// reset our screensaver (starts timers etc.)
ResetScreenSaver();
- return S_OK;
+ return true;
}
void CApplication::StartWebServer()
@@ -3216,7 +3216,7 @@ bool CApplication::ProcessKeyboard()
return false;
}
-HRESULT CApplication::Cleanup()
+bool CApplication::Cleanup()
{
try
{
@@ -3352,12 +3352,12 @@ HRESULT CApplication::Cleanup()
_CrtDumpMemoryLeaks();
while(1); // execution ends
#endif
- return S_OK;
+ return true;
}
catch (...)
{
CLog::Log(LOGERROR, "Exception in CApplication::Cleanup()");
- return E_FAIL;
+ return false;
}
}
diff --git a/xbmc/Application.h b/xbmc/Application.h
index d8d4182293..008c925141 100644
--- a/xbmc/Application.h
+++ b/xbmc/Application.h
@@ -85,14 +85,14 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
public:
CApplication(void);
virtual ~CApplication(void);
- virtual HRESULT Initialize();
+ virtual bool Initialize();
virtual void FrameMove();
virtual void Render();
virtual void DoRender();
virtual void RenderNoPresent();
virtual void Preflight();
- virtual HRESULT Create(HWND hWnd);
- virtual HRESULT Cleanup();
+ virtual bool Create(HWND hWnd);
+ virtual bool Cleanup();
void StartServices();
void StopServices();
diff --git a/xbmc/XBApplicationEx.cpp b/xbmc/XBApplicationEx.cpp
index 2912617ec8..ee43d636dd 100644
--- a/xbmc/XBApplicationEx.cpp
+++ b/xbmc/XBApplicationEx.cpp
@@ -40,18 +40,16 @@ CXBApplicationEx::~CXBApplicationEx()
}
/* Create the app */
-HRESULT CXBApplicationEx::Create(HWND hWnd)
+bool CXBApplicationEx::Create(HWND hWnd)
{
- HRESULT hr;
-
// Initialize the app's device-dependent objects
- if ( FAILED( hr = Initialize() ) )
+ if (!Initialize())
{
CLog::Log(LOGERROR, "XBAppEx: Call to Initialize() failed!" );
- return hr;
+ return false;
}
- return S_OK;
+ return true;
}
/* Destroy the app */
diff --git a/xbmc/XBApplicationEx.h b/xbmc/XBApplicationEx.h
index 3dec328d53..976c72d6cb 100644
--- a/xbmc/XBApplicationEx.h
+++ b/xbmc/XBApplicationEx.h
@@ -35,12 +35,12 @@ public:
bool m_AppFocused;
// Overridable functions for the 3D scene created by the app
- virtual HRESULT Initialize() { return S_OK; }
- virtual HRESULT Cleanup() { return S_OK; }
+ virtual bool Initialize() { return true; }
+ virtual bool Cleanup() { return true; }
public:
// Functions to create, run, and clean up the application
- virtual HRESULT Create(HWND hWnd);
+ virtual bool Create(HWND hWnd);
INT Run();
VOID Destroy();
diff --git a/xbmc/xbmc.cpp b/xbmc/xbmc.cpp
index a3b5fa308e..697d3db6fe 100644
--- a/xbmc/xbmc.cpp
+++ b/xbmc/xbmc.cpp
@@ -128,7 +128,7 @@ int main(int argc, char* argv[])
}
g_application.Preflight();
- if (g_application.Create(NULL) != S_OK)
+ if (!g_application.Create(NULL))
{
fprintf(stderr, "ERROR: Unable to create application. Exiting\n");
return -1;