summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMinty-Meeo <45425365+Minty-Meeo@users.noreply.github.com>2022-07-27 23:54:27 -0500
committerMinty-Meeo <45425365+Minty-Meeo@users.noreply.github.com>2023-03-02 19:54:15 -0600
commitbf079d6d3a857572c1f3f00fd3d525b9922ca809 (patch)
tree2dfb3ed2ebcc82da1b74d0407a43a0a2de1a176a /Source/Core
parent6361586a048dbbf617bc6e09b2f9edae815c3d8c (diff)
[[unlikely]] ASSERT
and other ASSERT usage changes
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Assert.h4
-rw-r--r--Source/Core/Core/CheatSearch.cpp10
-rw-r--r--Source/Core/Core/HW/DVD/DVDInterface.cpp2
-rw-r--r--Source/Core/Core/HW/MMIO.h4
-rw-r--r--Source/Core/Core/PowerPC/Jit64/Jit.cpp2
-rw-r--r--Source/Core/Core/PowerPC/MMU.cpp10
-rw-r--r--Source/Core/DolphinQt/CheatSearchWidget.cpp1
-rw-r--r--Source/Core/DolphinQt/GCMemcardManager.cpp2
-rw-r--r--Source/Core/VideoCommon/LightingShaderGen.cpp2
-rw-r--r--Source/Core/VideoCommon/TextureConversionShader.cpp2
10 files changed, 19 insertions, 20 deletions
diff --git a/Source/Core/Common/Assert.h b/Source/Core/Common/Assert.h
index dd9ce9b1ae..5611e0e04e 100644
--- a/Source/Core/Common/Assert.h
+++ b/Source/Core/Common/Assert.h
@@ -11,7 +11,7 @@
#define ASSERT_MSG(_t_, _a_, _fmt_, ...) \
do \
{ \
- if (!(_a_)) \
+ if (!(_a_)) [[unlikely]] \
{ \
if (!PanicYesNoFmtAssert(_t_, \
"An error occurred.\n\n" _fmt_ "\n\n" \
@@ -32,7 +32,7 @@
#define ASSERT(_a_) \
do \
{ \
- if (!(_a_)) \
+ if (!(_a_)) [[unlikely]] \
{ \
if (!PanicYesNoFmt("An error occurred.\n\n" \
" Condition: {}\n File: {}\n Line: {}\n Function: {}\n\n" \
diff --git a/Source/Core/Core/CheatSearch.cpp b/Source/Core/Core/CheatSearch.cpp
index 101d44726f..8fbfd86c14 100644
--- a/Source/Core/Core/CheatSearch.cpp
+++ b/Source/Core/Core/CheatSearch.cpp
@@ -3,7 +3,6 @@
#include "Core/CheatSearch.h"
-#include <cassert>
#include <functional>
#include <memory>
#include <optional>
@@ -13,6 +12,7 @@
#include <vector>
#include "Common/Align.h"
+#include "Common/Assert.h"
#include "Common/BitUtils.h"
#include "Common/StringUtil.h"
@@ -94,7 +94,7 @@ std::vector<u8> Cheats::GetValueAsByteVector(const Cheats::SearchValue& value)
case Cheats::DataType::F64:
return ToByteVector(Common::swap64(Common::BitCast<u64>(std::get<double>(value.m_value))));
default:
- assert(0);
+ DEBUG_ASSERT(false);
return {};
}
}
@@ -412,7 +412,7 @@ MakeCompareFunctionForSpecificValue(Cheats::CompareType op, const T& old_value)
case Cheats::CompareType::GreaterOrEqual:
return [&](const T& new_value) { return new_value >= old_value; };
default:
- assert(0);
+ DEBUG_ASSERT(false);
return nullptr;
}
}
@@ -436,7 +436,7 @@ MakeCompareFunctionForLastValue(Cheats::CompareType op)
case Cheats::CompareType::GreaterOrEqual:
return [](const T& new_value, const T& old_value) { return new_value >= old_value; };
default:
- assert(0);
+ DEBUG_ASSERT(false);
return nullptr;
}
}
@@ -680,7 +680,7 @@ Cheats::MakeSession(std::vector<MemoryRange> memory_ranges,
return std::make_unique<CheatSearchSession<double>>(std::move(memory_ranges), address_space,
aligned);
default:
- assert(0);
+ DEBUG_ASSERT(false);
return nullptr;
}
}
diff --git a/Source/Core/Core/HW/DVD/DVDInterface.cpp b/Source/Core/Core/HW/DVD/DVDInterface.cpp
index ecbedadb12..28f8227507 100644
--- a/Source/Core/Core/HW/DVD/DVDInterface.cpp
+++ b/Source/Core/Core/HW/DVD/DVDInterface.cpp
@@ -666,7 +666,7 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base, bool is_wii)
if (state_.DISR.BREAK)
{
- DEBUG_ASSERT(0);
+ DEBUG_ASSERT(false);
}
UpdateInterrupts();
diff --git a/Source/Core/Core/HW/MMIO.h b/Source/Core/Core/HW/MMIO.h
index 1b7a6476c6..e25c9ace77 100644
--- a/Source/Core/Core/HW/MMIO.h
+++ b/Source/Core/Core/HW/MMIO.h
@@ -216,13 +216,13 @@ private:
template <>
inline u64 Mapping::Read<u64>(u32 addr)
{
- DEBUG_ASSERT(0);
+ DEBUG_ASSERT(false);
return 0;
}
template <>
inline void Mapping::Write(u32 addr, u64 val)
{
- DEBUG_ASSERT(0);
+ DEBUG_ASSERT(false);
}
} // namespace MMIO
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp
index 62108eea65..dc077f08fc 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp
@@ -319,7 +319,7 @@ bool Jit64::BackPatch(SContext* ctx)
*ptr = Common::swap64(static_cast<u64>(*ptr));
break;
default:
- DEBUG_ASSERT(0);
+ DEBUG_ASSERT(false);
break;
}
}
diff --git a/Source/Core/Core/PowerPC/MMU.cpp b/Source/Core/Core/PowerPC/MMU.cpp
index b8edb0defc..35cfa5af0e 100644
--- a/Source/Core/Core/PowerPC/MMU.cpp
+++ b/Source/Core/Core/PowerPC/MMU.cpp
@@ -558,7 +558,7 @@ std::optional<ReadResult<u32>> HostTryReadInstruction(const Core::CPUThreadGuard
}
}
- ASSERT(0);
+ ASSERT(false);
return std::nullopt;
}
@@ -679,7 +679,7 @@ static std::optional<ReadResult<T>> HostTryReadUX(const Core::CPUThreadGuard& gu
}
}
- ASSERT(0);
+ ASSERT(false);
return std::nullopt;
}
@@ -900,7 +900,7 @@ static std::optional<WriteResult> HostTryWriteUX(const Core::CPUThreadGuard& gua
return WriteResult(true);
}
- ASSERT(0);
+ ASSERT(false);
return std::nullopt;
}
@@ -1051,7 +1051,7 @@ bool HostIsRAMAddress(const Core::CPUThreadGuard& guard, u32 address, RequestedA
return IsRAMAddress<XCheckTLBFlag::NoException>(memory, address, true);
}
- ASSERT(0);
+ ASSERT(false);
return false;
}
@@ -1078,7 +1078,7 @@ bool HostIsInstructionRAMAddress(const Core::CPUThreadGuard& guard, u32 address,
return IsRAMAddress<XCheckTLBFlag::OpcodeNoException>(memory, address, true);
}
- ASSERT(0);
+ ASSERT(false);
return false;
}
diff --git a/Source/Core/DolphinQt/CheatSearchWidget.cpp b/Source/Core/DolphinQt/CheatSearchWidget.cpp
index 66f44c7ee8..3ff88f3c08 100644
--- a/Source/Core/DolphinQt/CheatSearchWidget.cpp
+++ b/Source/Core/DolphinQt/CheatSearchWidget.cpp
@@ -3,7 +3,6 @@
#include "DolphinQt/CheatSearchWidget.h"
-#include <cassert>
#include <functional>
#include <optional>
#include <string>
diff --git a/Source/Core/DolphinQt/GCMemcardManager.cpp b/Source/Core/DolphinQt/GCMemcardManager.cpp
index ebfb919777..8f7646774a 100644
--- a/Source/Core/DolphinQt/GCMemcardManager.cpp
+++ b/Source/Core/DolphinQt/GCMemcardManager.cpp
@@ -401,7 +401,7 @@ static QString GetFormatDescription(Memcard::SavefileFormat format)
case Memcard::SavefileFormat::SAV:
return QObject::tr("Datel MaxDrive/Pro files");
default:
- ASSERT(0);
+ ASSERT(false);
return QObject::tr("Native GCI File");
}
}
diff --git a/Source/Core/VideoCommon/LightingShaderGen.cpp b/Source/Core/VideoCommon/LightingShaderGen.cpp
index 5b34e3c89f..b92e63fe9e 100644
--- a/Source/Core/VideoCommon/LightingShaderGen.cpp
+++ b/Source/Core/VideoCommon/LightingShaderGen.cpp
@@ -70,7 +70,7 @@ static void GenerateLightShader(ShaderCode& object, const LightingUidData& uid_d
swizzle_components, LIGHT_COL_PARAMS(index, swizzle));
break;
default:
- ASSERT(0);
+ ASSERT(false);
}
object.Write("\n");
diff --git a/Source/Core/VideoCommon/TextureConversionShader.cpp b/Source/Core/VideoCommon/TextureConversionShader.cpp
index c3f433811d..c9242de6e5 100644
--- a/Source/Core/VideoCommon/TextureConversionShader.cpp
+++ b/Source/Core/VideoCommon/TextureConversionShader.cpp
@@ -1088,7 +1088,7 @@ std::string GenerateDecodingShader(TextureFormat format, std::optional<TLUTForma
ss << "#define TEXEL_BUFFER_FORMAT_R32G32 1\n";
break;
case NUM_TEXEL_BUFFER_FORMATS:
- ASSERT(0);
+ ASSERT(false);
break;
}