Fix a few minor issues raised by PVS Studio
This commit is contained in:
parent
f40a273e0c
commit
3a33fb19eb
|
@ -455,7 +455,7 @@ extern "C" CXBXKRNL_API void CxbxKrnlInit
|
|||
// Strip out the path, leaving only the XBE file name
|
||||
// NOTE: we assume that the XBE is always on the root of the D: drive
|
||||
// This is a safe assumption as the Xbox kernel ALWAYS mounts D: as the Xbe Path
|
||||
if (fileName.rfind('\\') >= 0)
|
||||
if (fileName.rfind('\\') != std::string::npos)
|
||||
fileName = fileName.substr(fileName.rfind('\\') + 1);
|
||||
|
||||
if (xboxkrnl::XeImageFileName.Buffer != NULL)
|
||||
|
|
|
@ -2467,10 +2467,11 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreateVertexShader)
|
|||
&Handle,
|
||||
g_dwVertexShaderUsage // TODO: HACK: Xbox has extensions!
|
||||
);
|
||||
if(pRecompiledBuffer)
|
||||
|
||||
if(pRecompiledBuffer != nullptr)
|
||||
{
|
||||
pRecompiledBuffer->Release();
|
||||
pRecompiledBuffer = NULL;
|
||||
pRecompiledBuffer = nullptr;
|
||||
}
|
||||
|
||||
//* Fallback to dummy shader.
|
||||
|
@ -2808,7 +2809,7 @@ HRESULT WINAPI XTL::EMUPATCH(D3DDevice_CreatePixelShader)
|
|||
);
|
||||
}
|
||||
|
||||
if (pRecompiledBuffer)
|
||||
if (pRecompiledBuffer != nullptr)
|
||||
{
|
||||
pRecompiledBuffer->Release();
|
||||
}
|
||||
|
@ -5621,7 +5622,7 @@ HRESULT WINAPI XTL::EMUPATCH(D3DTexture_LockRect)
|
|||
EmuVerifyResourceIsRegistered(pThis);
|
||||
|
||||
// check if we have an unregistered YUV2 resource
|
||||
if( (pThis != 0) && IsSpecialResource(pThis->Data) && (pThis->Data & X_D3DRESOURCE_DATA_FLAG_YUVSURF))
|
||||
if( (pThis != nullptr) && IsSpecialResource(pThis->Data) && (pThis->Data & X_D3DRESOURCE_DATA_FLAG_YUVSURF))
|
||||
{
|
||||
pLockedRect->Pitch = g_dwOverlayP;
|
||||
pLockedRect->pBits = (PVOID)pThis->Lock;
|
||||
|
|
|
@ -3636,14 +3636,14 @@ HRESULT WINAPI XTL::EMUPATCH(IDirectSoundBuffer8_SetNotificationPositions)
|
|||
// the pointer. Any buffer that uses this *MUST* be created with the
|
||||
// DSBCAPS_CTRLPOSITIONNOTIFY flag!
|
||||
|
||||
IDirectSoundNotify* pNotify = NULL;
|
||||
IDirectSoundNotify* pNotify = nullptr;
|
||||
|
||||
if( pThis )
|
||||
{
|
||||
if( pThis->EmuDirectSoundBuffer8 )
|
||||
{
|
||||
hr = pThis->EmuDirectSoundBuffer8->QueryInterface( IID_IDirectSoundNotify, (LPVOID*) pNotify );
|
||||
if( SUCCEEDED( hr ) )
|
||||
if( SUCCEEDED( hr ) && pNotify != nullptr )
|
||||
{
|
||||
hr = pNotify->SetNotificationPositions( dwNotifyCount, paNotifies );
|
||||
if( FAILED( hr ) )
|
||||
|
|
Loading…
Reference in New Issue