Explorar o código

gdbstub: Don't check if unsigned int is > 0

Sam Spilsbury %!s(int64=10) %!d(string=hai) anos
pai
achega
41ec40e9aa
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/core/gdbstub/gdbstub.cpp

+ 2 - 2
src/core/gdbstub/gdbstub.cpp

@@ -529,7 +529,7 @@ static void ReadRegister() {
         id |= HexCharToValue(command_buffer[2]);
     }
 
-    if (id >= R0_REGISTER && id <= R15_REGISTER) {
+    if (id <= R15_REGISTER) {
         IntToGdbHex(reply, Core::g_app_core->GetReg(id));
     } else if (id == CPSR_REGISTER) {
         IntToGdbHex(reply, Core::g_app_core->GetCPSR());
@@ -584,7 +584,7 @@ static void WriteRegister() {
         id |= HexCharToValue(command_buffer[2]);
     }
 
-    if (id >= R0_REGISTER && id <= R15_REGISTER) {
+    if (id <= R15_REGISTER) {
         Core::g_app_core->SetReg(id, GdbHexToInt(buffer_ptr));
     } else if (id == CPSR_REGISTER) {
         Core::g_app_core->SetCPSR(GdbHexToInt(buffer_ptr));