Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc: Codacy and compiler warnings cleanup. #10376

Merged
merged 6 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pcsx2-gsrunner/test_run_dumps.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run_regression_test(runner, dumpdir, renderer, upscale, renderhacks, paralle

if upscale != 1.0:
args.extend(["-upscale", str(upscale)])

if renderhacks is not None:
args.extend(["-renderhacks", renderhacks])

Expand Down
2 changes: 1 addition & 1 deletion pcsx2/DEV9/PacketReader/IP/UDP/DNS/DNS_Classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace PacketReader::IP::UDP::DNS
//null char
*offset += 1;
}
void DNS_QuestionEntry::WriteDNS_String(u8* buffer, int* offset, std::string value)
void DNS_QuestionEntry::WriteDNS_String(u8* buffer, int* offset, const std::string& value)
{
int segmentLength = 0;
int segmentStart = 0;
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/DEV9/PacketReader/IP/UDP/DNS/DNS_Classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace PacketReader::IP::UDP::DNS

private:
void ReadDNS_String(u8* buffer, int* offset, std::string* value);
void WriteDNS_String(u8* buffer, int* offset, std::string value);
void WriteDNS_String(u8* buffer, int* offset, const std::string& value);
};

class DNS_ResponseEntry : public DNS_QuestionEntry
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/GS/GSRingHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void* GSRingHeap::alloc_internal(size_t size, size_t align_mask, size_t prefix_s
size_t used = m_current_buffer->m_amt_allocated.load(std::memory_order_relaxed) - 1;
if (used * 4 < total)
{
fprintf(stderr, "GSRingHeap: Orphaning %zdmb buffer with low usage of %d%%, check that allocations are actually being deallocated approximately in order\n", total / mb, static_cast<int>((used * 100) / total));
fprintf(stderr, "GSRingHeap: Orphaning %zumb buffer with low usage of %d%%, check that allocations are actually being deallocated approximately in order\n", total / mb, static_cast<int>((used * 100) / total));
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions pcsx2/GS/Renderers/DX12/GSDevice12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,9 @@ bool GSDevice12::CreateSwapChain()
Console.WriteLn("Creating a %dx%d windowed swap chain", swap_chain_desc.Width, swap_chain_desc.Height);
hr = m_dxgi_factory->CreateSwapChainForHwnd(
m_command_queue.get(), window_hwnd, &swap_chain_desc, nullptr, nullptr, m_swap_chain.put());

if (FAILED(hr))
Console.Warning("Failed to create windowed swap chain.");
}

hr = m_dxgi_factory->MakeWindowAssociation(window_hwnd, DXGI_MWA_NO_WINDOW_CHANGES);
Expand Down
1 change: 0 additions & 1 deletion pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,6 @@ void GSRendererHW::Draw()
if (height_invalid && m_cached_ctx.FRAME.FBW <= 1 &&
TryToResolveSinglePageFramebuffer(m_cached_ctx.FRAME, true))
{
const GSVector2i fb_size = PCRTCDisplays.GetFramebufferSize(-1);
const GSVector2i& pgs = GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].pgs;
ReplaceVerticesWithSprite(
GetDrawRectForPages(m_cached_ctx.FRAME.FBW, m_cached_ctx.FRAME.PSM, (m_r.w + (pgs.y - 1)) / pgs.y),
Expand Down
4 changes: 2 additions & 2 deletions pcsx2/x86/ix86-32/iR5900.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,7 @@ void recompileNextInstruction(bool delayslot, bool swapped_delay_slot)

else if (COP2IsQOP(cpuRegs.code))
{
Console.Warning("Possible incorrect Q value used in COP2. If the game is broken, please report to http://github.com/pcsx2/pcsx2.");
Console.Warning("Possible incorrect Q value used in COP2. If the game is broken, please report to https://github.com/pcsx2/pcsx2.");
for (u32 i = s_pCurBlockEx->startpc; i < s_nEndBlock; i += 4)
{
std::string disasm = "";
Expand All @@ -1923,7 +1923,7 @@ void recompileNextInstruction(bool delayslot, bool swapped_delay_slot)
if ((_Rd_ == 16 && s & 1) || (_Rd_ == 17 && s & 2) || (_Rd_ == 18 && s & 4))
{
std::string disasm;
Console.Warning("Possible old value used in COP2 code. If the game is broken, please report to http://github.com/pcsx2/pcsx2.");
Console.Warning("Possible old value used in COP2 code. If the game is broken, please report to https://github.com/pcsx2/pcsx2.");
for (u32 i = s_pCurBlockEx->startpc; i < s_nEndBlock; i += 4)
{
disasm = "";
Expand Down