Skip to content

Commit 9ebbfb3

Browse files
authored
Fix some compiler warnings (#416)
1 parent 3869b47 commit 9ebbfb3

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/Cafe/HW/Latte/Core/Latte.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ struct LatteGPUState_t
6464
{
6565
bool isEnabled;
6666
MPTR physPtr;
67-
volatile uint32 flipRequestCount;
68-
volatile uint32 flipExecuteCount;
67+
std::atomic<uint32> flipRequestCount;
68+
std::atomic<uint32> flipExecuteCount;
6969
}screen[2];
7070
}osScreen;
7171
};

src/Cafe/HW/Latte/Core/LatteThread.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ bool LatteHandleOSScreen_TV()
7878
LatteRenderTarget_copyToBackbuffer(osScreenTVTex[bufferIndexTV]->baseTexture->baseView, false);
7979

8080
if (LatteGPUState.osScreen.screen[0].flipExecuteCount != LatteGPUState.osScreen.screen[0].flipRequestCount)
81-
LatteGPUState.osScreen.screen[0].flipExecuteCount = LatteGPUState.osScreen.screen[0].flipRequestCount;
81+
LatteGPUState.osScreen.screen[0].flipExecuteCount.store(LatteGPUState.osScreen.screen[0].flipRequestCount);
8282
return true;
8383
}
8484

@@ -101,7 +101,7 @@ bool LatteHandleOSScreen_DRC()
101101
LatteRenderTarget_copyToBackbuffer(osScreenDRCTex[bufferIndexDRC]->baseTexture->baseView, true);
102102

103103
if (LatteGPUState.osScreen.screen[1].flipExecuteCount != LatteGPUState.osScreen.screen[1].flipRequestCount)
104-
LatteGPUState.osScreen.screen[1].flipExecuteCount = LatteGPUState.osScreen.screen[1].flipRequestCount;
104+
LatteGPUState.osScreen.screen[1].flipExecuteCount.store(LatteGPUState.osScreen.screen[1].flipRequestCount);
105105
return true;
106106
}
107107

src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRendererCore.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ uint64 VulkanRenderer::draw_calculateGraphicsPipelineHash(const LatteFetchShader
5555
// An alternative would be to use VK_EXT_vertex_input_dynamic_state but it comes with minor overhead
5656
// Regardless, the extension is not well supported as of writing this (July 2021, only 10% of GPUs support it on Windows. Nvidia only)
5757

58-
cemu_assert_debug(fetchShader->key == fetchShader->key); // fetch shaders must be layout compatible, but may have different offsets
58+
cemu_assert_debug(vertexShader->compatibleFetchShader->key == fetchShader->key); // fetch shaders must be layout compatible, but may have different offsets
5959

6060
uint64 stateHash;
6161
stateHash = draw_calculateMinimalGraphicsPipelineHash(fetchShader, lcr);

src/audio/CubebAPI.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ CubebAPI::CubebAPI(cubeb_devid devid, uint32 samplerate, uint32 channels, uint32
7575
output_params.layout = CUBEB_LAYOUT_3F4_LFE;
7676
break;
7777
case 6:
78-
output_params.layout = CUBEB_LAYOUT_QUAD_LFE | CHANNEL_FRONT_CENTER;
78+
output_params.layout = CUBEB_LAYOUT_3F2_LFE_BACK;
7979
break;
8080
case 4:
8181
output_params.layout = CUBEB_LAYOUT_QUAD;

src/gui/CemuUpdateWindow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ void CemuUpdateWindow::WorkerThread()
509509
forceLog_printf("applying update error: %s", sys.what());
510510
}
511511

512-
if ((counter++ / 10) * 10 == counter)
512+
if ((counter++ % 10) == 0)
513513
{
514514
auto* event = new wxCommandEvent(wxEVT_PROGRESS);
515515
event->SetInt(counter);

src/util/Zir/Core/IR.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ namespace ZpIR
207207
// print imports
208208
printf("Imports:\n");
209209
for(auto itr : block->m_imports)
210-
printf(" reg: %s sym:0x%lux\n", getRegisterName(block, itr.reg).c_str(), itr.name);
210+
printf(" reg: %s sym:0x%llx\n", getRegisterName(block, itr.reg).c_str(), itr.name);
211211
// print exports
212212
printf("Exports:\n");
213213
for (auto itr : block->m_exports)
214-
printf(" reg: %s sym:0x%lux\n", getRegisterName(block, itr.reg).c_str(), itr.name);
214+
printf(" reg: %s sym:0x%llx\n", getRegisterName(block, itr.reg).c_str(), itr.name);
215215
// print instructions
216216
printf("Assembly:\n");
217217
IR::__InsBase* instruction = block->m_instructionFirst;

0 commit comments

Comments
 (0)