Replace std::string::npos with umax

This commit is contained in:
Nekotekina 2020-03-05 14:05:23 +03:00
parent 0a41999818
commit 7a8772dafa
18 changed files with 42 additions and 42 deletions

View file

@ -599,7 +599,7 @@ bool gdb_thread::cmd_write_register(gdb_cmd& cmd)
if (th->id_type() == 1) {
auto ppu = static_cast<named_thread<ppu_thread>*>(th.get());
size_t eq_pos = cmd.data.find('=');
if (eq_pos == std::string::npos) {
if (eq_pos == umax) {
GDB.warning("Wrong write_register cmd data '%s'.", cmd.data);
return send_cmd_ack("E02");
}
@ -641,7 +641,7 @@ bool gdb_thread::cmd_write_memory(gdb_cmd& cmd)
{
size_t s = cmd.data.find(',');
size_t s2 = cmd.data.find(':');
if ((s == std::string::npos) || (s2 == std::string::npos)) {
if ((s == umax) || (s2 == umax)) {
GDB.warning("Malformed write memory request received: '%s'.", cmd.data);
return send_cmd_ack("E01");
}
@ -778,7 +778,7 @@ bool gdb_thread::cmd_set_breakpoint(gdb_cmd& cmd)
//software breakpoint
if (type == '0') {
u32 addr = INVALID_PTR;
if (cmd.data.find(';') != std::string::npos) {
if (cmd.data.find(';') != umax) {
GDB.warning("Received request to set breakpoint with condition, but they are not supported.");
return send_cmd_ack("E01");
}