From 1ccb2e72fc00b6e0008d561aa0f0e74f0727f414 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 17 Jan 2024 09:43:33 -0500 Subject: [PATCH] Eliminate a few further macros. --- Analyser/Static/Disassembler/Z80.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Analyser/Static/Disassembler/Z80.cpp b/Analyser/Static/Disassembler/Z80.cpp index 1bd1542e0..c35adbab1 100644 --- a/Analyser/Static/Disassembler/Z80.cpp +++ b/Analyser/Static/Disassembler/Z80.cpp @@ -56,11 +56,11 @@ class Accessor { bool overrun_ = false; }; -#define x(v) (v >> 6) -#define y(v) ((v >> 3) & 7) -#define q(v) ((v >> 3) & 1) -#define p(v) ((v >> 4) & 3) -#define z(v) (v & 7) +constexpr uint8_t x(uint8_t v) { return v >> 6; } +constexpr uint8_t y(uint8_t v) { return (v >> 3) & 7; } +constexpr uint8_t q(uint8_t v) { return (v >> 3) & 1; } +constexpr uint8_t p(uint8_t v) { return (v >> 4) & 3; } +constexpr uint8_t z(uint8_t v) { return v & 7; } Instruction::Condition condition_table[] = { Instruction::Condition::NZ, Instruction::Condition::Z,