diff --git a/app/shell.d b/app/shell.d index 3cf12d32..49d8f213 100644 --- a/app/shell.d +++ b/app/shell.d @@ -792,8 +792,8 @@ int command_regs(int argc, const(char) **argv) { bool show = rselect == null || strcmp(rselect, reg.info.name) == 0; if (show == false) continue; char[20] normal = void, hexdec = void; - adbg_register_format(normal.ptr, 20, reg, FORMAT_DEC); - adbg_register_format(hexdec.ptr, 20, reg, FORMAT_HEXPADDED); + adbg_register_format(normal.ptr, 20, reg, AdbgRegFormat.dec); + adbg_register_format(hexdec.ptr, 20, reg, AdbgRegFormat.hexPadded); printf("%-8s 0x%8s %s\n", reg.info.name, hexdec.ptr, normal.ptr); found = true; } diff --git a/src/adbg/debugger/thread.d b/src/adbg/debugger/thread.d index 8fa572d0..537e9d74 100644 --- a/src/adbg/debugger/thread.d +++ b/src/adbg/debugger/thread.d @@ -40,11 +40,11 @@ enum AdbgRegType : ubyte { f32, f64 } -//TODO: Rename to AdbgRegFormat -enum { - FORMAT_DEC, - FORMAT_HEX, - FORMAT_HEXPADDED, +/// Register +enum AdbgRegFormat { + dec, + hex, + hexPadded, } /// Register name and type. @@ -232,13 +232,13 @@ version (Windows) { /// reg = Register. /// format = String format. /// Returns: Number of characters written. -size_t adbg_register_format(char *buffer, size_t len, adbg_register_t *reg, int format) { +size_t adbg_register_format(char *buffer, size_t len, adbg_register_t *reg, AdbgRegFormat format) { if (reg == null || buffer == null || len == 0) return 0; const(char) *sformat = void; - switch (format) { - case FORMAT_DEC: + switch (format) with (AdbgRegFormat) { + case dec: switch (reg.info.type) with (AdbgRegType) { case u8, u16, u32, u64: sformat = "%llu"; break; @@ -249,10 +249,10 @@ size_t adbg_register_format(char *buffer, size_t len, adbg_register_t *reg, int return 0; } break; - case FORMAT_HEX: + case hex: sformat = "%llx"; break; - case FORMAT_HEXPADDED: + case hexPadded: switch (reg.info.type) with (AdbgRegType) { case u8: sformat = "%02x"; break; case u16: sformat = "%04x"; break;