Update some c-style casts -> reinterpret_cast

This commit is contained in:
Ian Chamberlain 2023-04-04 13:21:25 -04:00
parent 6e45de760e
commit 696c0904f8
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
2 changed files with 7 additions and 5 deletions

View File

@ -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<char*>(reply);
SendReply(reinterpret_cast<char*>(reply));
LOG_DEBUG(Debug_GDBStub, "ReadMemory result: {}", reply_str);
SendReply(reply_str);
}
/// Modify location in memory with data received from the gdb client.

View File

@ -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<const u8*>(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<const u8*>(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<u32>(current_hio_request.parameters[i]),
current_hio_request.string_lengths[nStr++]);
break;