From 696c0904f8ab56d08f23ec23291bc742ee792f43 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Tue, 4 Apr 2023 13:21:25 -0400 Subject: [PATCH] Update some c-style casts -> reinterpret_cast --- src/core/gdbstub/gdbstub.cpp | 5 +++-- src/core/gdbstub/hio.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 0a4f8769c..073ecdc0e 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -851,9 +851,10 @@ static void ReadMemory() { MemToGdbHex(reply, data.data(), len); reply[len * 2] = '\0'; - LOG_DEBUG(Debug_GDBStub, "ReadMemory result: {}", (char*)reply); + auto reply_str = reinterpret_cast(reply); - SendReply(reinterpret_cast(reply)); + LOG_DEBUG(Debug_GDBStub, "ReadMemory result: {}", reply_str); + SendReply(reply_str); } /// Modify location in memory with data received from the gdb client. diff --git a/src/core/gdbstub/hio.cpp b/src/core/gdbstub/hio.cpp index 50fd1a0fb..b19535c21 100644 --- a/src/core/gdbstub/hio.cpp +++ b/src/core/gdbstub/hio.cpp @@ -140,13 +140,14 @@ void HandleHioReply(const u8* const command_buffer, const u32 command_length) { return; } - u64 unsigned_retval = HexToInt((u8*)command_parts[0].data(), command_parts[0].size()); + u64 unsigned_retval = + HexToInt(reinterpret_cast(command_parts[0].data()), command_parts[0].size()); current_hio_request.retval *= unsigned_retval; if (command_parts.size() > 1) { // Technically the errno could be signed but in practice this doesn't happen current_hio_request.gdb_errno = - HexToInt((u8*)command_parts[1].data(), command_parts[1].size()); + HexToInt(reinterpret_cast(command_parts[1].data()), command_parts[1].size()); } else { current_hio_request.gdb_errno = 0; } @@ -228,7 +229,7 @@ bool HandlePendingHioRequestPacket() { case 's': // strings are written as {pointer}/{length} fmt::format_to(std::back_inserter(packet), ",{:x}/{:x}", - (u32)current_hio_request.parameters[i], + static_cast(current_hio_request.parameters[i]), current_hio_request.string_lengths[nStr++]); break;