aboutsummaryrefslogtreecommitdiff
path: root/src/core/debugger/gdbstub.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-06-01 01:40:18 -0400
committerMorph <39850852+Morph1984@users.noreply.github.com>2022-06-01 01:40:18 -0400
commita32f6e9d8e994bfdc5a1f67c38dd3a5123710440 (patch)
treebb2eb7a4a8350385fad8703cd1a8fcc92ff0f82a /src/core/debugger/gdbstub.cpp
parentde2f2e5140eb85311e0fd844c580d6726adf7e03 (diff)
gdbstub: Explicitly cast return type to u8
Otherwise, the addition promotes the returned value to an int instead of keeping it as a u8.
Diffstat (limited to 'src/core/debugger/gdbstub.cpp')
-rw-r--r--src/core/debugger/gdbstub.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/debugger/gdbstub.cpp b/src/core/debugger/gdbstub.cpp
index 718c45952d..ee75981658 100644
--- a/src/core/debugger/gdbstub.cpp
+++ b/src/core/debugger/gdbstub.cpp
@@ -358,8 +358,8 @@ std::optional<std::string> GDBStub::DetachCommand() {
}
u8 GDBStub::CalculateChecksum(std::string_view data) {
- return static_cast<u8>(
- std::accumulate(data.begin(), data.end(), u8{0}, [](u8 lhs, u8 rhs) { return lhs + rhs; }));
+ return std::accumulate(data.begin(), data.end(), u8{0},
+ [](u8 lhs, u8 rhs) { return static_cast<u8>(lhs + rhs); });
}
void GDBStub::SendReply(std::string_view data) {