Static analysis cleanups
This commit is contained in:
parent
6ab9f303da
commit
73f68bdc3f
@ -766,7 +766,7 @@ bool GetResolution(HWND hwndResolution, SIZE &resolution, BOOL bSelChange)
|
|||||||
String strCX = strResolution.GetToken(0, 'x');
|
String strCX = strResolution.GetToken(0, 'x');
|
||||||
String strCY = strResolution.GetToken(1, '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;
|
return false;
|
||||||
|
|
||||||
UINT cx = strCX.ToInt();
|
UINT cx = strCX.ToInt();
|
||||||
|
@ -177,7 +177,7 @@ SceneItem* Scene::InsertImageSource(UINT pos, XElement *sourceElement)
|
|||||||
item->SetRender(render);
|
item->SetRender(render);
|
||||||
|
|
||||||
API->EnterSceneMutex();
|
API->EnterSceneMutex();
|
||||||
if(bSceneStarted) source->BeginScene();
|
if(bSceneStarted && source) source->BeginScene();
|
||||||
sceneItems.Insert(pos, item);
|
sceneItems.Insert(pos, item);
|
||||||
API->LeaveSceneMutex();
|
API->LeaveSceneMutex();
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ void ConfigFile::LoadData()
|
|||||||
{
|
{
|
||||||
lpNextLine = schr(lpCurLine, '\r');
|
lpNextLine = schr(lpCurLine, '\r');
|
||||||
if (!lpNextLine)
|
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;
|
*lpNextLine = 0;
|
||||||
|
|
||||||
if((*lpCurLine == '[') && (*(lpNextLine-1) == ']'))
|
if((*lpCurLine == '[') && (*(lpNextLine-1) == ']'))
|
||||||
@ -112,7 +112,7 @@ void ConfigFile::LoadData()
|
|||||||
{
|
{
|
||||||
TSTR lpValuePtr = schr(lpCurLine, '=');
|
TSTR lpValuePtr = schr(lpCurLine, '=');
|
||||||
if (!lpValuePtr)
|
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)
|
if(lpValuePtr[1] != 0)
|
||||||
{
|
{
|
||||||
|
@ -408,8 +408,6 @@ public:
|
|||||||
color = data->GetInt(TEXT("color"), 0xFFFFFFFF);
|
color = data->GetInt(TEXT("color"), 0xFFFFFFFF);
|
||||||
if(opacity > 100)
|
if(opacity > 100)
|
||||||
opacity = 100;
|
opacity = 100;
|
||||||
else if(opacity < 0)
|
|
||||||
opacity = 0;
|
|
||||||
|
|
||||||
if (changeMonitor)
|
if (changeMonitor)
|
||||||
{
|
{
|
||||||
|
@ -216,7 +216,7 @@ void SetupIni()
|
|||||||
strIni.Clear() << lpAppDataPath << TEXT("\\profiles\\") << strProfile << TEXT(".ini");
|
strIni.Clear() << lpAppDataPath << TEXT("\\profiles\\") << strProfile << TEXT(".ini");
|
||||||
|
|
||||||
if(!AppConfig->Create(strIni))
|
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->SetString(TEXT("Audio"), TEXT("Device"), TEXT("Default"));
|
||||||
AppConfig->SetFloat (TEXT("Audio"), TEXT("MicVolume"), 1.0f);
|
AppConfig->SetFloat (TEXT("Audio"), TEXT("MicVolume"), 1.0f);
|
||||||
|
@ -471,7 +471,7 @@ OBS::OBS()
|
|||||||
strScenesConfig << lpAppDataPath << TEXT("\\scenes.xconfig");
|
strScenesConfig << lpAppDataPath << TEXT("\\scenes.xconfig");
|
||||||
|
|
||||||
if(!scenesConfig.Open(strScenesConfig))
|
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"));
|
XElement *scenes = scenesConfig.GetElement(TEXT("scenes"));
|
||||||
if(!scenes)
|
if(!scenes)
|
||||||
@ -598,7 +598,7 @@ OBS::OBS()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log(TEXT("Failed to initialize plugin %s"), strLocation);
|
Log(TEXT("Failed to initialize plugin %s"), strLocation.Array());
|
||||||
FreeLibrary(hPlugin);
|
FreeLibrary(hPlugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1402,7 +1402,7 @@ void OBS::DrawStatusBar(DRAWITEMSTRUCT &dis)
|
|||||||
|
|
||||||
if(dis.itemID == 4)
|
if(dis.itemID == 4)
|
||||||
{
|
{
|
||||||
DWORD green = 0xFF, red = 0xFF;
|
DWORD green = 0xFF, red;
|
||||||
|
|
||||||
statusBarData.bytesPerSec = App->bytesPerSec;
|
statusBarData.bytesPerSec = App->bytesPerSec;
|
||||||
statusBarData.strain = App->curStrain;
|
statusBarData.strain = App->curStrain;
|
||||||
|
@ -2571,7 +2571,7 @@ LRESULT CALLBACK OBS::OBSProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
|
|
||||||
App->EnableSceneSwitching(false);
|
App->EnableSceneSwitching(false);
|
||||||
|
|
||||||
if(App->bRunning)
|
if(App->bRunning && App->scene)
|
||||||
{
|
{
|
||||||
SceneItem* selectedItem = App->scene->GetSceneItem(selectedID);
|
SceneItem* selectedItem = App->scene->GetSceneItem(selectedID);
|
||||||
source = selectedItem->GetSource();
|
source = selectedItem->GetSource();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user