Skip to content

Commit

Permalink
Static analysis code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaldaien committed Dec 21, 2024
1 parent 794ea8f commit b801cf9
Show file tree
Hide file tree
Showing 23 changed files with 403 additions and 398 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
24.12.21.1
24.12.21.2
==========
+ Fixed typo that has been preventing SK's D3D11 texture cache from evaluating
the list of freeable textures when cache capacity exceeds user-defined
limit for several years... oops?
+ Fixed various other small issues, nothing as serious as the one above.

24.12.21.1
==========
+ Fixed cursor auto-hide changes accidentally introduced in 24.12.21

Expand Down
40 changes: 40 additions & 0 deletions SpecialK.suppress
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,22 @@
<CodeCurrent>3170002416</CodeCurrent>
<CodeNext>125</CodeNext>
</SpecialK>
<SpecialK>
<FileName>d3d11_shader.cpp</FileName>
<ErrorCode>V568</ErrorCode>
<Message>It's odd that 'sizeof()' operator evaluates the size of a pointer to a class, but not the size of the 'pDesc' class object.</Message>
<CodePrev>0</CodePrev>
<CodeCurrent>460572845</CodeCurrent>
<CodeNext>0</CodeNext>
</SpecialK>
<SpecialK>
<FileName>d3d11_shader.cpp</FileName>
<ErrorCode>V568</ErrorCode>
<Message>It's odd that 'sizeof()' operator evaluates the size of a pointer to a class, but not the size of the 'pDesc' class object.</Message>
<CodePrev>4051175878</CodePrev>
<CodeCurrent>1335475529</CodeCurrent>
<CodeNext>7328300</CodeNext>
</SpecialK>
<SpecialK>
<FileName>d3d11_tex_mgr.cpp</FileName>
<ErrorCode>V112</ErrorCode>
Expand Down Expand Up @@ -361,6 +377,22 @@
<CodeCurrent>844435421</CodeCurrent>
<CodeNext>0</CodeNext>
</SpecialK>
<SpecialK>
<FileName>d3d11_tex_mgr.cpp</FileName>
<ErrorCode>V547</ErrorCode>
<Message>Expression 'initial != initial_after_release + _' is always true.</Message>
<CodePrev>0</CodePrev>
<CodeCurrent>2953353297</CodeCurrent>
<CodeNext>123</CodeNext>
</SpecialK>
<SpecialK>
<FileName>d3d11_tex_mgr.cpp</FileName>
<ErrorCode>V779</ErrorCode>
<Message>Unreachable code detected. It is possible that an error is present.</Message>
<CodePrev>0</CodePrev>
<CodeCurrent>3525957960</CodeCurrent>
<CodeNext>9417071</CodeNext>
</SpecialK>
<SpecialK>
<FileName>d3d11_tex_mgr.cpp</FileName>
<ErrorCode>V821</ErrorCode>
Expand Down Expand Up @@ -593,6 +625,14 @@
<CodeCurrent>5116</CodeCurrent>
<CodeNext>261911641</CodeNext>
</SpecialK>
<SpecialK>
<FileName>playstation.cpp</FileName>
<ErrorCode>V547</ErrorCode>
<Message>Expression 'pDevice-&gt;pPreparsedData != nullptr' is always false.</Message>
<CodePrev>123</CodePrev>
<CodeCurrent>3170116418</CodeCurrent>
<CodeNext>17733</CodeNext>
</SpecialK>
<SpecialK>
<FileName>screenshot.h</FileName>
<ErrorCode>V3509</ErrorCode>
Expand Down
4 changes: 2 additions & 2 deletions include/SpecialK/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#define SK_YEAR 24
#define SK_MONTH 12
#define SK_DATE 21
#define SK_REV_N 1
#define SK_REV 1
#define SK_REV_N 2
#define SK_REV 2

#ifndef _A2
#define _A2(a) #a
Expand Down
10 changes: 6 additions & 4 deletions include/SpecialK/render/dxgi/dxgi_swapchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ IWrapDXGISwapChain : IDXGISwapChain4

if (ver_ != 0)
{
((IDXGISwapChain1 *)pReal)->GetHwnd (&hWnd_);
static_cast <IDXGISwapChain1 *>
(pReal)->GetHwnd (&hWnd_);

SK_ReleaseAssert (sd.OutputWindow == 0 || sd.OutputWindow == hWnd_);

Expand All @@ -124,7 +125,7 @@ IWrapDXGISwapChain : IDXGISwapChain4
sd.SwapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL );
flip_model.native = rb.active_traits.bOriginallyFlip;

this->IWrapDXGISwapChain::SetPrivateDataInterface (IID_IUnwrappedDXGISwapChain, pReal);
SetPrivateDataInterface (IID_IUnwrappedDXGISwapChain, pReal);

SK_DXGI_SetDebugName ( pReal,
SK_FormatStringW ( L"SK_IWrapDXGISwapChain: pReal=%p", pReal ) );
Expand Down Expand Up @@ -229,7 +230,8 @@ IWrapDXGISwapChain : IDXGISwapChain4

InterlockedIncrement (&SK_DXGI_LiveWrappedSwapChain1s);

((IDXGISwapChain1 *)pReal)->GetHwnd (&hWnd_);
static_cast <IDXGISwapChain1 *>
(pReal)->GetHwnd (&hWnd_);

SK_ReleaseAssert (sd.OutputWindow == 0 || sd.OutputWindow == hWnd_);

Expand All @@ -242,7 +244,7 @@ IWrapDXGISwapChain : IDXGISwapChain4
sd.SwapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL );
flip_model.native = rb.active_traits.bOriginallyFlip;

this->IWrapDXGISwapChain::SetPrivateDataInterface (IID_IUnwrappedDXGISwapChain, pReal);
SetPrivateDataInterface (IID_IUnwrappedDXGISwapChain, pReal);

SK_DXGI_SetDebugName ( pReal,
SK_FormatStringW ( L"SK_IWrapDXGISwapChain: pReal=%p", pReal ) );
Expand Down
4 changes: 2 additions & 2 deletions src/imgui/backends/imgui_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3199,8 +3199,8 @@ SK_D3D12_RenderCtx::init (IDXGISwapChain3 *pSwapChain, ID3D12CommandQueue *pComm
{
frames_.clear ();

DXGI_SWAP_CHAIN_DESC1 swapDesc1 = { };
pSwapChain->GetDesc1 (&swapDesc1);
DXGI_SWAP_CHAIN_DESC1 swapDesc1 = { };
_pSwapChain->GetDesc1 (&swapDesc1);

SK_ReleaseAssert (swapDesc1.BufferCount > 0);
frames_.resize (swapDesc1.BufferCount); // Resize does not clear, if the size is the same
Expand Down
16 changes: 8 additions & 8 deletions src/input/game_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ SK_IWrapGameInput::UnregisterCallback (_In_ GameInputCallbackToken callbackToken
SK_LOG_FIRST_CALL

return
pReal == nullptr ? S_OK :
pReal == nullptr ? true :
pReal->UnregisterCallback (callbackToken, timeoutInMicroseconds);
}

Expand All @@ -708,7 +708,7 @@ SK_IWrapGameInput::CreateDispatcher (_COM_Outptr_ IGameInputDispatcher **dispatc
SK_LOG_FIRST_CALL

return
pReal == nullptr ? S_OK :
pReal == nullptr ? S_OK :
pReal->CreateDispatcher (dispatcher);
}

Expand All @@ -720,7 +720,7 @@ SK_IWrapGameInput::CreateAggregateDevice (_In_ GameInputKind inputK
SK_LOG_FIRST_CALL

return
pReal == nullptr ? S_OK :
pReal == nullptr ? S_OK :
pReal->CreateAggregateDevice (inputKind, device);
}

Expand All @@ -732,7 +732,7 @@ SK_IWrapGameInput::FindDeviceFromId (_In_ APP_LOCAL_DEVICE_ID const *va
SK_LOG_FIRST_CALL

return
pReal == nullptr ? S_OK :
pReal == nullptr ? S_OK :
pReal->FindDeviceFromId (value, device);
}

Expand All @@ -744,7 +744,7 @@ SK_IWrapGameInput::FindDeviceFromObject (_In_ IUnknown *value,
SK_LOG_FIRST_CALL

return
pReal == nullptr ? S_OK :
pReal == nullptr ? S_OK :
pReal->FindDeviceFromObject (value, device);
}

Expand All @@ -756,7 +756,7 @@ SK_IWrapGameInput::FindDeviceFromPlatformHandle (_In_ HANDLE
SK_LOG_FIRST_CALL

return
pReal == nullptr ? S_OK :
pReal == nullptr ? S_OK :
pReal->FindDeviceFromPlatformHandle (value, device);
}

Expand All @@ -768,7 +768,7 @@ SK_IWrapGameInput::FindDeviceFromPlatformString (_In_ LPCWSTR
SK_LOG_FIRST_CALL

return
pReal == nullptr ? S_OK :
pReal == nullptr ? S_OK :
pReal->FindDeviceFromPlatformString (value, device);
}

Expand All @@ -782,7 +782,7 @@ SK_IWrapGameInput::EnableOemDeviceSupport (_In_ uint16_t vendorId,
SK_LOG_FIRST_CALL

return
pReal == nullptr ? S_OK :
pReal == nullptr ? S_OK :
pReal->EnableOemDeviceSupport (vendorId, productId, interfaceNumber, collectionNumber);
}

Expand Down
Loading

0 comments on commit b801cf9

Please sign in to comment.