summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/gdbstub/gdbstub.cpp20
-rw-r--r--src/core/hle/service/dsp_dsp.cpp4
-rw-r--r--src/core/hw/gpu.cpp4
-rw-r--r--src/core/loader/3dsx.cpp6
-rw-r--r--src/core/tracer/recorder.cpp24
5 files changed, 29 insertions, 29 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp
index ae0c116ef..1360ee845 100644
--- a/src/core/gdbstub/gdbstub.cpp
+++ b/src/core/gdbstub/gdbstub.cpp
@@ -374,7 +374,7 @@ static void SendReply(const char* reply) {
memset(command_buffer, 0, sizeof(command_buffer));
- command_length = strlen(reply);
+ command_length = static_cast<u32>(strlen(reply));
if (command_length + 4 > sizeof(command_buffer)) {
LOG_ERROR(Debug_GDBStub, "command_buffer overflow in SendReply");
return;
@@ -515,7 +515,7 @@ static bool IsDataAvailable() {
return false;
}
- return FD_ISSET(gdbserver_socket, &fd_socket);
+ return FD_ISSET(gdbserver_socket, &fd_socket) != 0;
}
/// Send requested register to gdb client.
@@ -633,10 +633,10 @@ static void ReadMemory() {
auto start_offset = command_buffer+1;
auto addr_pos = std::find(start_offset, command_buffer+command_length, ',');
- PAddr addr = HexToInt(start_offset, addr_pos - start_offset);
+ PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset));
start_offset = addr_pos+1;
- u32 len = HexToInt(start_offset, (command_buffer + command_length) - start_offset);
+ u32 len = HexToInt(start_offset, static_cast<u32>((command_buffer + command_length) - start_offset));
LOG_DEBUG(Debug_GDBStub, "gdb: addr: %08x len: %08x\n", addr, len);
@@ -658,11 +658,11 @@ static void ReadMemory() {
static void WriteMemory() {
auto start_offset = command_buffer+1;
auto addr_pos = std::find(start_offset, command_buffer+command_length, ',');
- PAddr addr = HexToInt(start_offset, addr_pos - start_offset);
+ PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset));
start_offset = addr_pos+1;
auto len_pos = std::find(start_offset, command_buffer+command_length, ':');
- u32 len = HexToInt(start_offset, len_pos - start_offset);
+ u32 len = HexToInt(start_offset, static_cast<u32>(len_pos - start_offset));
u8* dst = Memory::GetPointer(addr);
if (!dst) {
@@ -752,10 +752,10 @@ static void AddBreakpoint() {
auto start_offset = command_buffer+3;
auto addr_pos = std::find(start_offset, command_buffer+command_length, ',');
- PAddr addr = HexToInt(start_offset, addr_pos - start_offset);
+ PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset));
start_offset = addr_pos+1;
- u32 len = HexToInt(start_offset, (command_buffer + command_length) - start_offset);
+ u32 len = HexToInt(start_offset, static_cast<u32>((command_buffer + command_length) - start_offset));
if (type == BreakpointType::Access) {
// Access is made up of Read and Write types, so add both breakpoints
@@ -800,10 +800,10 @@ static void RemoveBreakpoint() {
auto start_offset = command_buffer+3;
auto addr_pos = std::find(start_offset, command_buffer+command_length, ',');
- PAddr addr = HexToInt(start_offset, addr_pos - start_offset);
+ PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset));
start_offset = addr_pos+1;
- u32 len = HexToInt(start_offset, (command_buffer + command_length) - start_offset);
+ u32 len = HexToInt(start_offset, static_cast<u32>((command_buffer + command_length) - start_offset));
if (type == BreakpointType::Access) {
// Access is made up of Read and Write types, so add both breakpoints
diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp
index 995bee3f9..274fc751a 100644
--- a/src/core/hle/service/dsp_dsp.cpp
+++ b/src/core/hle/service/dsp_dsp.cpp
@@ -288,7 +288,7 @@ static void WriteProcessPipe(Service::Interface* self) {
ASSERT_MSG(Memory::GetPointer(buffer) != nullptr, "Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe_index, size, buffer);
std::vector<u8> message(size);
- for (size_t i = 0; i < size; i++) {
+ for (u32 i = 0; i < size; i++) {
message[i] = Memory::Read8(buffer + i);
}
@@ -403,7 +403,7 @@ static void GetPipeReadableSize(Service::Interface* self) {
cmd_buff[0] = IPC::MakeHeader(0xF, 2, 0);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
- cmd_buff[2] = DSP::HLE::GetPipeReadableSize(pipe);
+ cmd_buff[2] = static_cast<u32>(DSP::HLE::GetPipeReadableSize(pipe));
LOG_DEBUG(Service_DSP, "pipe=%u, unknown=0x%08X, return cmd_buff[2]=0x%08X", pipe_index, unknown, cmd_buff[2]);
}
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index 2fe856293..a4dfb7e43 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -188,10 +188,10 @@ inline void Write(u32 addr, const T data) {
u32 output_gap = config.texture_copy.output_gap * 16;
size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap);
- Memory::RasterizerFlushRegion(config.GetPhysicalInputAddress(), contiguous_input_size);
+ Memory::RasterizerFlushRegion(config.GetPhysicalInputAddress(), static_cast<u32>(contiguous_input_size));
size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap);
- Memory::RasterizerFlushAndInvalidateRegion(config.GetPhysicalOutputAddress(), contiguous_output_size);
+ Memory::RasterizerFlushAndInvalidateRegion(config.GetPhysicalOutputAddress(), static_cast<u32>(contiguous_output_size));
u32 remaining_size = config.texture_copy.size;
u32 remaining_input = input_width;
diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp
index 48a11ef81..98e7ab48f 100644
--- a/src/core/loader/3dsx.cpp
+++ b/src/core/loader/3dsx.cpp
@@ -178,11 +178,11 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, Shared
for (unsigned current_inprogress = 0; current_inprogress < remaining && pos < end_pos; current_inprogress++) {
const auto& table = reloc_table[current_inprogress];
LOG_TRACE(Loader, "(t=%d,skip=%u,patch=%u)", current_segment_reloc_table,
- (u32)table.skip, (u32)table.patch);
+ static_cast<u32>(table.skip), static_cast<u32>(table.patch));
pos += table.skip;
s32 num_patches = table.patch;
while (0 < num_patches && pos < end_pos) {
- u32 in_addr = (u8*)pos - program_image.data();
+ u32 in_addr = static_cast<u32>(reinterpret_cast<u8*>(pos) - program_image.data());
u32 addr = TranslateAddr(*pos, &loadinfo, offsets);
LOG_TRACE(Loader, "Patching %08X <-- rel(%08X,%d) (%08X)",
base_addr + in_addr, addr, current_segment_reloc_table, *pos);
@@ -284,7 +284,7 @@ ResultStatus AppLoader_THREEDSX::ReadRomFS(std::shared_ptr<FileUtil::IOFile>& ro
// Check if the 3DSX has a RomFS...
if (hdr.fs_offset != 0) {
u32 romfs_offset = hdr.fs_offset;
- u32 romfs_size = file.GetSize() - hdr.fs_offset;
+ u32 romfs_size = static_cast<u32>(file.GetSize()) - hdr.fs_offset;
LOG_DEBUG(Loader, "RomFS offset: 0x%08X", romfs_offset);
LOG_DEBUG(Loader, "RomFS size: 0x%08X", romfs_size);
diff --git a/src/core/tracer/recorder.cpp b/src/core/tracer/recorder.cpp
index c6dc35c83..7abaacf70 100644
--- a/src/core/tracer/recorder.cpp
+++ b/src/core/tracer/recorder.cpp
@@ -26,17 +26,17 @@ void Recorder::Finish(const std::string& filename) {
// Calculate file offsets
auto& initial = header.initial_state_offsets;
- initial.gpu_registers_size = initial_state.gpu_registers.size();
- initial.lcd_registers_size = initial_state.lcd_registers.size();
- initial.pica_registers_size = initial_state.pica_registers.size();
- initial.default_attributes_size = initial_state.default_attributes.size();
- initial.vs_program_binary_size = initial_state.vs_program_binary.size();
- initial.vs_swizzle_data_size = initial_state.vs_swizzle_data.size();
- initial.vs_float_uniforms_size = initial_state.vs_float_uniforms.size();
- initial.gs_program_binary_size = initial_state.gs_program_binary.size();
- initial.gs_swizzle_data_size = initial_state.gs_swizzle_data.size();
- initial.gs_float_uniforms_size = initial_state.gs_float_uniforms.size();
- header.stream_size = stream.size();
+ initial.gpu_registers_size = static_cast<u32>(initial_state.gpu_registers.size());
+ initial.lcd_registers_size = static_cast<u32>(initial_state.lcd_registers.size());
+ initial.pica_registers_size = static_cast<u32>(initial_state.pica_registers.size());
+ initial.default_attributes_size = static_cast<u32>(initial_state.default_attributes.size());
+ initial.vs_program_binary_size = static_cast<u32>(initial_state.vs_program_binary.size());
+ initial.vs_swizzle_data_size = static_cast<u32>(initial_state.vs_swizzle_data.size());
+ initial.vs_float_uniforms_size = static_cast<u32>(initial_state.vs_float_uniforms.size());
+ initial.gs_program_binary_size = static_cast<u32>(initial_state.gs_program_binary.size());
+ initial.gs_swizzle_data_size = static_cast<u32>(initial_state.gs_swizzle_data.size());
+ initial.gs_float_uniforms_size = static_cast<u32>(initial_state.gs_float_uniforms.size());
+ header.stream_size = static_cast<u32>(stream.size());
initial.gpu_registers = sizeof(header);
initial.lcd_registers = initial.gpu_registers + initial.gpu_registers_size * sizeof(u32);
@@ -68,7 +68,7 @@ void Recorder::Finish(const std::string& filename) {
DEBUG_ASSERT(stream_element.extra_data.size() == 0);
break;
}
- header.stream_offset += stream_element.extra_data.size();
+ header.stream_offset += static_cast<u32>(stream_element.extra_data.size());
}
try {