srctree

Johan parent b9e57391 ec2c6411 91a197ec
Merge pull request #368 from johnor/default-compare-operator-cpu

Use compiler generated comparison operator for cpu registers
core/include/nes/core/imos6502.h added: 6, removed: 10, total 0
@@ -26,6 +26,9 @@ struct CpuRegisters {
uint8_t x; // x index
uint8_t y; // y index
uint8_t p; // status
 
[[nodiscard]] constexpr bool operator==(
const CpuRegisters &) const = default;
};
 
struct CpuState {
 
core/test/src/icpu_helpers.cpp added: 6, removed: 10, total 0
@@ -5,11 +5,6 @@
 
namespace n_e_s::core {
 
bool operator==(const CpuRegisters &a, const CpuRegisters &b) {
return a.pc == b.pc && a.sp == b.sp && a.a == b.a && a.x == b.x &&
a.y == b.y && a.p == b.p;
}
 
// Required by gtest to use pascal case.
// NOLINTNEXTLINE(readability-identifier-naming)
void PrintTo(const CpuRegisters &r, std::ostream *os) {
 
core/test/src/icpu_helpers.h added: 6, removed: 10, total 0
@@ -6,8 +6,6 @@
 
namespace n_e_s::core {
 
bool operator==(const CpuRegisters &a, const CpuRegisters &b);
 
// Required by gtest to use pascal case.
// NOLINTNEXTLINE(readability-identifier-naming)
void PrintTo(const CpuRegisters &r, std::ostream *os);