Static analysis cleanups

This commit is contained in:
Richard Stanway 2013-04-30 23:11:08 -04:00
parent 6ab9f303da
commit 73f68bdc3f
7 changed files with 9 additions and 11 deletions

View File

@ -766,7 +766,7 @@ bool GetResolution(HWND hwndResolution, SIZE &resolution, BOOL bSelChange)
String strCX = strResolution.GetToken(0, 'x');
String strCY = strResolution.GetToken(1, 'x');
if(strCX.IsEmpty() || strCX.IsEmpty() || !ValidIntString(strCX) || !ValidIntString(strCY))
if(strCX.IsEmpty() || strCY.IsEmpty() || !ValidIntString(strCX) || !ValidIntString(strCY))
return false;
UINT cx = strCX.ToInt();

View File

@ -177,7 +177,7 @@ SceneItem* Scene::InsertImageSource(UINT pos, XElement *sourceElement)
item->SetRender(render);
API->EnterSceneMutex();
if(bSceneStarted) source->BeginScene();
if(bSceneStarted && source) source->BeginScene();
sceneItems.Insert(pos, item);
API->LeaveSceneMutex();

View File

@ -98,7 +98,7 @@ void ConfigFile::LoadData()
{
lpNextLine = schr(lpCurLine, '\r');
if (!lpNextLine)
CrashError(TEXT("Your %s file is corrupt, please delete it and re-launch OBS."), strFileName);
CrashError(TEXT("Your %s file is corrupt, please delete it and re-launch OBS."), strFileName.Array());
*lpNextLine = 0;
if((*lpCurLine == '[') && (*(lpNextLine-1) == ']'))
@ -112,7 +112,7 @@ void ConfigFile::LoadData()
{
TSTR lpValuePtr = schr(lpCurLine, '=');
if (!lpValuePtr)
CrashError(TEXT("Your %s file is corrupt, please delete it and re-launch OBS."), strFileName);
CrashError(TEXT("Your %s file is corrupt, please delete it and re-launch OBS."), strFileName.Array());
if(lpValuePtr[1] != 0)
{

View File

@ -408,8 +408,6 @@ public:
color = data->GetInt(TEXT("color"), 0xFFFFFFFF);
if(opacity > 100)
opacity = 100;
else if(opacity < 0)
opacity = 0;
if (changeMonitor)
{

View File

@ -216,7 +216,7 @@ void SetupIni()
strIni.Clear() << lpAppDataPath << TEXT("\\profiles\\") << strProfile << TEXT(".ini");
if(!AppConfig->Create(strIni))
CrashError(TEXT("Could not create '%s'"), strIni);
CrashError(TEXT("Could not create '%s'"), strIni.Array());
AppConfig->SetString(TEXT("Audio"), TEXT("Device"), TEXT("Default"));
AppConfig->SetFloat (TEXT("Audio"), TEXT("MicVolume"), 1.0f);

View File

@ -471,7 +471,7 @@ OBS::OBS()
strScenesConfig << lpAppDataPath << TEXT("\\scenes.xconfig");
if(!scenesConfig.Open(strScenesConfig))
CrashError(TEXT("Could not open '%s'"), strScenesConfig);
CrashError(TEXT("Could not open '%s'"), strScenesConfig.Array());
XElement *scenes = scenesConfig.GetElement(TEXT("scenes"));
if(!scenes)
@ -598,7 +598,7 @@ OBS::OBS()
}
else
{
Log(TEXT("Failed to initialize plugin %s"), strLocation);
Log(TEXT("Failed to initialize plugin %s"), strLocation.Array());
FreeLibrary(hPlugin);
}
}
@ -1402,7 +1402,7 @@ void OBS::DrawStatusBar(DRAWITEMSTRUCT &dis)
if(dis.itemID == 4)
{
DWORD green = 0xFF, red = 0xFF;
DWORD green = 0xFF, red;
statusBarData.bytesPerSec = App->bytesPerSec;
statusBarData.strain = App->curStrain;

View File

@ -2571,7 +2571,7 @@ LRESULT CALLBACK OBS::OBSProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
App->EnableSceneSwitching(false);
if(App->bRunning)
if(App->bRunning && App->scene)
{
SceneItem* selectedItem = App->scene->GetSceneItem(selectedID);
source = selectedItem->GetSource();