yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

Merge pull request #723 from lioncash/gdb

gdbstub: Get rid of a few signed/unsigned comparisons
This commit is contained in:
bunnei 2018-07-19 16:12:40 -07:00 committed by GitHub
commit ec468c990d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -205,7 +205,7 @@ static Kernel::Thread* FindThreadById(int id) {
for (u32 core = 0; core < Core::NUM_CPU_CORES; core++) { for (u32 core = 0; core < Core::NUM_CPU_CORES; core++) {
const auto& threads = Core::System::GetInstance().Scheduler(core)->GetThreadList(); const auto& threads = Core::System::GetInstance().Scheduler(core)->GetThreadList();
for (auto& thread : threads) { for (auto& thread : threads) {
if (thread->GetThreadId() == id) { if (thread->GetThreadId() == static_cast<u32>(id)) {
current_core = core; current_core = core;
return thread.get(); return thread.get();
} }
@ -214,7 +214,7 @@ static Kernel::Thread* FindThreadById(int id) {
return nullptr; return nullptr;
} }
static u64 RegRead(int id, Kernel::Thread* thread = nullptr) { static u64 RegRead(std::size_t id, Kernel::Thread* thread = nullptr) {
if (!thread) { if (!thread) {
return 0; return 0;
} }
@ -234,7 +234,7 @@ static u64 RegRead(int id, Kernel::Thread* thread = nullptr) {
} }
} }
static void RegWrite(int id, u64 val, Kernel::Thread* thread = nullptr) { static void RegWrite(std::size_t id, u64 val, Kernel::Thread* thread = nullptr) {
if (!thread) { if (!thread) {
return; return;
} }
@ -744,7 +744,7 @@ static bool IsDataAvailable() {
fd_set fd_socket; fd_set fd_socket;
FD_ZERO(&fd_socket); FD_ZERO(&fd_socket);
FD_SET(gdbserver_socket, &fd_socket); FD_SET(static_cast<u32>(gdbserver_socket), &fd_socket);
struct timeval t; struct timeval t;
t.tv_sec = 0; t.tv_sec = 0;
@ -793,7 +793,7 @@ static void ReadRegisters() {
u8* bufptr = buffer; u8* bufptr = buffer;
for (int reg = 0; reg <= SP_REGISTER; reg++) { for (u32 reg = 0; reg <= SP_REGISTER; reg++) {
LongToGdbHex(bufptr + reg * 16, RegRead(reg, current_thread)); LongToGdbHex(bufptr + reg * 16, RegRead(reg, current_thread));
} }
@ -807,7 +807,7 @@ static void ReadRegisters() {
bufptr += 8; bufptr += 8;
for (int reg = UC_ARM64_REG_Q0; reg <= UC_ARM64_REG_Q0 + 31; reg++) { for (u32 reg = UC_ARM64_REG_Q0; reg <= UC_ARM64_REG_Q0 + 31; reg++) {
LongToGdbHex(bufptr + reg * 16, RegRead(reg, current_thread)); LongToGdbHex(bufptr + reg * 16, RegRead(reg, current_thread));
} }
@ -858,7 +858,7 @@ static void WriteRegisters() {
if (command_buffer[0] != 'G') if (command_buffer[0] != 'G')
return SendReply("E01"); return SendReply("E01");
for (int i = 0, reg = 0; reg <= FPSCR_REGISTER; i++, reg++) { for (u32 i = 0, reg = 0; reg <= FPSCR_REGISTER; i++, reg++) {
if (reg <= SP_REGISTER) { if (reg <= SP_REGISTER) {
RegWrite(reg, GdbHexToLong(buffer_ptr + i * 16), current_thread); RegWrite(reg, GdbHexToLong(buffer_ptr + i * 16), current_thread);
} else if (reg == PC_REGISTER) { } else if (reg == PC_REGISTER) {