summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2022-01-17 00:21:58 -0800
committerPokechu22 <Pokechu022@gmail.com>2022-02-13 14:38:59 -0800
commit50d93499269fb3d8a444cea6ae4da6daad2a2c10 (patch)
tree8297acb59dce185af00e9ab245f4f1d320021db2 /Source/Core
parent5f9e04be1d73b3c9ec8aa66defcedbc6f7106c46 (diff)
Fix integer sign difference comparison warnings
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Core.cpp2
-rw-r--r--Source/Core/DiscIO/VolumeVerifier.cpp7
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp6
3 files changed, 8 insertions, 7 deletions
diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp
index a945d72276..08b615f5bf 100644
--- a/Source/Core/Core/Core.cpp
+++ b/Source/Core/Core/Core.cpp
@@ -1031,7 +1031,7 @@ int AddOnStateChangedCallback(StateChangedCallbackFunc callback)
bool RemoveOnStateChangedCallback(int* handle)
{
- if (handle && *handle >= 0 && s_on_state_changed_callbacks.size() > *handle)
+ if (handle && *handle >= 0 && s_on_state_changed_callbacks.size() > static_cast<size_t>(*handle))
{
s_on_state_changed_callbacks[*handle] = StateChangedCallbackFunc();
*handle = -1;
diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp
index 252cf427b6..593fb49b33 100644
--- a/Source/Core/DiscIO/VolumeVerifier.cpp
+++ b/Source/Core/DiscIO/VolumeVerifier.cpp
@@ -1113,10 +1113,11 @@ void VolumeVerifier::Process()
bytes_to_read = Common::AlignUp(content.size, 0x40);
content_read = true;
- if (m_content_index + 1 < m_content_offsets.size() &&
- m_content_offsets[m_content_index + 1] < m_progress + bytes_to_read)
+ const u16 next_content_index = m_content_index + 1;
+ if (next_content_index < m_content_offsets.size() &&
+ m_content_offsets[next_content_index] < m_progress + bytes_to_read)
{
- excess_bytes = m_progress + bytes_to_read - m_content_offsets[m_content_index + 1];
+ excess_bytes = m_progress + bytes_to_read - m_content_offsets[next_content_index];
}
}
else if (m_content_index < m_content_offsets.size() &&
diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
index 77bb8c8bd3..fb300a370f 100644
--- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp
@@ -376,7 +376,7 @@ void CodeViewWidget::Update()
void CodeViewWidget::CalculateBranchIndentation()
{
- const size_t rows = rowCount();
+ const u32 rows = rowCount();
const size_t columns = m_branches.size();
if (rows < 1 || columns < 1)
return;
@@ -442,7 +442,7 @@ void CodeViewWidget::CalculateBranchIndentation()
};
const u32 first_visible_addr = AddressForRow(0);
- const u32 last_visible_addr = AddressForRow(static_cast<int>(rows - 1));
+ const u32 last_visible_addr = AddressForRow(rows - 1);
if (first_visible_addr <= last_visible_addr)
{
@@ -456,7 +456,7 @@ void CodeViewWidget::CalculateBranchIndentation()
// first_visible_addr to fffffffc, and the second for 00000000 to last_visible_addr.
// That means we need to find the row corresponding to 00000000.
int addr_zero_row = -1;
- for (int row = 0; row < rows; row++)
+ for (u32 row = 0; row < rows; row++)
{
if (AddressForRow(row) == 0)
{