diff options
| author | 2016-04-25 16:10:03 -0400 | |
|---|---|---|
| committer | 2016-05-07 11:41:55 -0400 | |
| commit | 0a31e373f1728316b3dfed391ddcb99a474e4102 (patch) | |
| tree | 1b1bcf1af2398481e7208610f6a2e49264fe11db /src/core | |
| parent | Merge pull request #1736 from MerryMage/sdl2-sink (diff) | |
| download | yuzu-0a31e373f1728316b3dfed391ddcb99a474e4102.tar.gz yuzu-0a31e373f1728316b3dfed391ddcb99a474e4102.tar.xz yuzu-0a31e373f1728316b3dfed391ddcb99a474e4102.zip | |
fixup simple type conversions where possible
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 20 | ||||
| -rw-r--r-- | src/core/hle/service/dsp_dsp.cpp | 4 | ||||
| -rw-r--r-- | src/core/hw/gpu.cpp | 4 | ||||
| -rw-r--r-- | src/core/loader/3dsx.cpp | 6 | ||||
| -rw-r--r-- | src/core/tracer/recorder.cpp | 24 |
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) { | |||
| 374 | 374 | ||
| 375 | memset(command_buffer, 0, sizeof(command_buffer)); | 375 | memset(command_buffer, 0, sizeof(command_buffer)); |
| 376 | 376 | ||
| 377 | command_length = strlen(reply); | 377 | command_length = static_cast<u32>(strlen(reply)); |
| 378 | if (command_length + 4 > sizeof(command_buffer)) { | 378 | if (command_length + 4 > sizeof(command_buffer)) { |
| 379 | LOG_ERROR(Debug_GDBStub, "command_buffer overflow in SendReply"); | 379 | LOG_ERROR(Debug_GDBStub, "command_buffer overflow in SendReply"); |
| 380 | return; | 380 | return; |
| @@ -515,7 +515,7 @@ static bool IsDataAvailable() { | |||
| 515 | return false; | 515 | return false; |
| 516 | } | 516 | } |
| 517 | 517 | ||
| 518 | return FD_ISSET(gdbserver_socket, &fd_socket); | 518 | return FD_ISSET(gdbserver_socket, &fd_socket) != 0; |
| 519 | } | 519 | } |
| 520 | 520 | ||
| 521 | /// Send requested register to gdb client. | 521 | /// Send requested register to gdb client. |
| @@ -633,10 +633,10 @@ static void ReadMemory() { | |||
| 633 | 633 | ||
| 634 | auto start_offset = command_buffer+1; | 634 | auto start_offset = command_buffer+1; |
| 635 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); | 635 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); |
| 636 | PAddr addr = HexToInt(start_offset, addr_pos - start_offset); | 636 | PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset)); |
| 637 | 637 | ||
| 638 | start_offset = addr_pos+1; | 638 | start_offset = addr_pos+1; |
| 639 | u32 len = HexToInt(start_offset, (command_buffer + command_length) - start_offset); | 639 | u32 len = HexToInt(start_offset, static_cast<u32>((command_buffer + command_length) - start_offset)); |
| 640 | 640 | ||
| 641 | LOG_DEBUG(Debug_GDBStub, "gdb: addr: %08x len: %08x\n", addr, len); | 641 | LOG_DEBUG(Debug_GDBStub, "gdb: addr: %08x len: %08x\n", addr, len); |
| 642 | 642 | ||
| @@ -658,11 +658,11 @@ static void ReadMemory() { | |||
| 658 | static void WriteMemory() { | 658 | static void WriteMemory() { |
| 659 | auto start_offset = command_buffer+1; | 659 | auto start_offset = command_buffer+1; |
| 660 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); | 660 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); |
| 661 | PAddr addr = HexToInt(start_offset, addr_pos - start_offset); | 661 | PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset)); |
| 662 | 662 | ||
| 663 | start_offset = addr_pos+1; | 663 | start_offset = addr_pos+1; |
| 664 | auto len_pos = std::find(start_offset, command_buffer+command_length, ':'); | 664 | auto len_pos = std::find(start_offset, command_buffer+command_length, ':'); |
| 665 | u32 len = HexToInt(start_offset, len_pos - start_offset); | 665 | u32 len = HexToInt(start_offset, static_cast<u32>(len_pos - start_offset)); |
| 666 | 666 | ||
| 667 | u8* dst = Memory::GetPointer(addr); | 667 | u8* dst = Memory::GetPointer(addr); |
| 668 | if (!dst) { | 668 | if (!dst) { |
| @@ -752,10 +752,10 @@ static void AddBreakpoint() { | |||
| 752 | 752 | ||
| 753 | auto start_offset = command_buffer+3; | 753 | auto start_offset = command_buffer+3; |
| 754 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); | 754 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); |
| 755 | PAddr addr = HexToInt(start_offset, addr_pos - start_offset); | 755 | PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset)); |
| 756 | 756 | ||
| 757 | start_offset = addr_pos+1; | 757 | start_offset = addr_pos+1; |
| 758 | u32 len = HexToInt(start_offset, (command_buffer + command_length) - start_offset); | 758 | u32 len = HexToInt(start_offset, static_cast<u32>((command_buffer + command_length) - start_offset)); |
| 759 | 759 | ||
| 760 | if (type == BreakpointType::Access) { | 760 | if (type == BreakpointType::Access) { |
| 761 | // Access is made up of Read and Write types, so add both breakpoints | 761 | // Access is made up of Read and Write types, so add both breakpoints |
| @@ -800,10 +800,10 @@ static void RemoveBreakpoint() { | |||
| 800 | 800 | ||
| 801 | auto start_offset = command_buffer+3; | 801 | auto start_offset = command_buffer+3; |
| 802 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); | 802 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); |
| 803 | PAddr addr = HexToInt(start_offset, addr_pos - start_offset); | 803 | PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset)); |
| 804 | 804 | ||
| 805 | start_offset = addr_pos+1; | 805 | start_offset = addr_pos+1; |
| 806 | u32 len = HexToInt(start_offset, (command_buffer + command_length) - start_offset); | 806 | u32 len = HexToInt(start_offset, static_cast<u32>((command_buffer + command_length) - start_offset)); |
| 807 | 807 | ||
| 808 | if (type == BreakpointType::Access) { | 808 | if (type == BreakpointType::Access) { |
| 809 | // Access is made up of Read and Write types, so add both breakpoints | 809 | // 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) { | |||
| 288 | ASSERT_MSG(Memory::GetPointer(buffer) != nullptr, "Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe_index, size, buffer); | 288 | ASSERT_MSG(Memory::GetPointer(buffer) != nullptr, "Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe_index, size, buffer); |
| 289 | 289 | ||
| 290 | std::vector<u8> message(size); | 290 | std::vector<u8> message(size); |
| 291 | for (size_t i = 0; i < size; i++) { | 291 | for (u32 i = 0; i < size; i++) { |
| 292 | message[i] = Memory::Read8(buffer + i); | 292 | message[i] = Memory::Read8(buffer + i); |
| 293 | } | 293 | } |
| 294 | 294 | ||
| @@ -403,7 +403,7 @@ static void GetPipeReadableSize(Service::Interface* self) { | |||
| 403 | 403 | ||
| 404 | cmd_buff[0] = IPC::MakeHeader(0xF, 2, 0); | 404 | cmd_buff[0] = IPC::MakeHeader(0xF, 2, 0); |
| 405 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | 405 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error |
| 406 | cmd_buff[2] = DSP::HLE::GetPipeReadableSize(pipe); | 406 | cmd_buff[2] = static_cast<u32>(DSP::HLE::GetPipeReadableSize(pipe)); |
| 407 | 407 | ||
| 408 | LOG_DEBUG(Service_DSP, "pipe=%u, unknown=0x%08X, return cmd_buff[2]=0x%08X", pipe_index, unknown, cmd_buff[2]); | 408 | LOG_DEBUG(Service_DSP, "pipe=%u, unknown=0x%08X, return cmd_buff[2]=0x%08X", pipe_index, unknown, cmd_buff[2]); |
| 409 | } | 409 | } |
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) { | |||
| 188 | u32 output_gap = config.texture_copy.output_gap * 16; | 188 | u32 output_gap = config.texture_copy.output_gap * 16; |
| 189 | 189 | ||
| 190 | size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap); | 190 | size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap); |
| 191 | Memory::RasterizerFlushRegion(config.GetPhysicalInputAddress(), contiguous_input_size); | 191 | Memory::RasterizerFlushRegion(config.GetPhysicalInputAddress(), static_cast<u32>(contiguous_input_size)); |
| 192 | 192 | ||
| 193 | size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap); | 193 | size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap); |
| 194 | Memory::RasterizerFlushAndInvalidateRegion(config.GetPhysicalOutputAddress(), contiguous_output_size); | 194 | Memory::RasterizerFlushAndInvalidateRegion(config.GetPhysicalOutputAddress(), static_cast<u32>(contiguous_output_size)); |
| 195 | 195 | ||
| 196 | u32 remaining_size = config.texture_copy.size; | 196 | u32 remaining_size = config.texture_copy.size; |
| 197 | u32 remaining_input = input_width; | 197 | 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 | |||
| 178 | for (unsigned current_inprogress = 0; current_inprogress < remaining && pos < end_pos; current_inprogress++) { | 178 | for (unsigned current_inprogress = 0; current_inprogress < remaining && pos < end_pos; current_inprogress++) { |
| 179 | const auto& table = reloc_table[current_inprogress]; | 179 | const auto& table = reloc_table[current_inprogress]; |
| 180 | LOG_TRACE(Loader, "(t=%d,skip=%u,patch=%u)", current_segment_reloc_table, | 180 | LOG_TRACE(Loader, "(t=%d,skip=%u,patch=%u)", current_segment_reloc_table, |
| 181 | (u32)table.skip, (u32)table.patch); | 181 | static_cast<u32>(table.skip), static_cast<u32>(table.patch)); |
| 182 | pos += table.skip; | 182 | pos += table.skip; |
| 183 | s32 num_patches = table.patch; | 183 | s32 num_patches = table.patch; |
| 184 | while (0 < num_patches && pos < end_pos) { | 184 | while (0 < num_patches && pos < end_pos) { |
| 185 | u32 in_addr = (u8*)pos - program_image.data(); | 185 | u32 in_addr = static_cast<u32>(reinterpret_cast<u8*>(pos) - program_image.data()); |
| 186 | u32 addr = TranslateAddr(*pos, &loadinfo, offsets); | 186 | u32 addr = TranslateAddr(*pos, &loadinfo, offsets); |
| 187 | LOG_TRACE(Loader, "Patching %08X <-- rel(%08X,%d) (%08X)", | 187 | LOG_TRACE(Loader, "Patching %08X <-- rel(%08X,%d) (%08X)", |
| 188 | base_addr + in_addr, addr, current_segment_reloc_table, *pos); | 188 | base_addr + in_addr, addr, current_segment_reloc_table, *pos); |
| @@ -284,7 +284,7 @@ ResultStatus AppLoader_THREEDSX::ReadRomFS(std::shared_ptr<FileUtil::IOFile>& ro | |||
| 284 | // Check if the 3DSX has a RomFS... | 284 | // Check if the 3DSX has a RomFS... |
| 285 | if (hdr.fs_offset != 0) { | 285 | if (hdr.fs_offset != 0) { |
| 286 | u32 romfs_offset = hdr.fs_offset; | 286 | u32 romfs_offset = hdr.fs_offset; |
| 287 | u32 romfs_size = file.GetSize() - hdr.fs_offset; | 287 | u32 romfs_size = static_cast<u32>(file.GetSize()) - hdr.fs_offset; |
| 288 | 288 | ||
| 289 | LOG_DEBUG(Loader, "RomFS offset: 0x%08X", romfs_offset); | 289 | LOG_DEBUG(Loader, "RomFS offset: 0x%08X", romfs_offset); |
| 290 | LOG_DEBUG(Loader, "RomFS size: 0x%08X", romfs_size); | 290 | 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) { | |||
| 26 | // Calculate file offsets | 26 | // Calculate file offsets |
| 27 | auto& initial = header.initial_state_offsets; | 27 | auto& initial = header.initial_state_offsets; |
| 28 | 28 | ||
| 29 | initial.gpu_registers_size = initial_state.gpu_registers.size(); | 29 | initial.gpu_registers_size = static_cast<u32>(initial_state.gpu_registers.size()); |
| 30 | initial.lcd_registers_size = initial_state.lcd_registers.size(); | 30 | initial.lcd_registers_size = static_cast<u32>(initial_state.lcd_registers.size()); |
| 31 | initial.pica_registers_size = initial_state.pica_registers.size(); | 31 | initial.pica_registers_size = static_cast<u32>(initial_state.pica_registers.size()); |
| 32 | initial.default_attributes_size = initial_state.default_attributes.size(); | 32 | initial.default_attributes_size = static_cast<u32>(initial_state.default_attributes.size()); |
| 33 | initial.vs_program_binary_size = initial_state.vs_program_binary.size(); | 33 | initial.vs_program_binary_size = static_cast<u32>(initial_state.vs_program_binary.size()); |
| 34 | initial.vs_swizzle_data_size = initial_state.vs_swizzle_data.size(); | 34 | initial.vs_swizzle_data_size = static_cast<u32>(initial_state.vs_swizzle_data.size()); |
| 35 | initial.vs_float_uniforms_size = initial_state.vs_float_uniforms.size(); | 35 | initial.vs_float_uniforms_size = static_cast<u32>(initial_state.vs_float_uniforms.size()); |
| 36 | initial.gs_program_binary_size = initial_state.gs_program_binary.size(); | 36 | initial.gs_program_binary_size = static_cast<u32>(initial_state.gs_program_binary.size()); |
| 37 | initial.gs_swizzle_data_size = initial_state.gs_swizzle_data.size(); | 37 | initial.gs_swizzle_data_size = static_cast<u32>(initial_state.gs_swizzle_data.size()); |
| 38 | initial.gs_float_uniforms_size = initial_state.gs_float_uniforms.size(); | 38 | initial.gs_float_uniforms_size = static_cast<u32>(initial_state.gs_float_uniforms.size()); |
| 39 | header.stream_size = stream.size(); | 39 | header.stream_size = static_cast<u32>(stream.size()); |
| 40 | 40 | ||
| 41 | initial.gpu_registers = sizeof(header); | 41 | initial.gpu_registers = sizeof(header); |
| 42 | initial.lcd_registers = initial.gpu_registers + initial.gpu_registers_size * sizeof(u32); | 42 | initial.lcd_registers = initial.gpu_registers + initial.gpu_registers_size * sizeof(u32); |
| @@ -68,7 +68,7 @@ void Recorder::Finish(const std::string& filename) { | |||
| 68 | DEBUG_ASSERT(stream_element.extra_data.size() == 0); | 68 | DEBUG_ASSERT(stream_element.extra_data.size() == 0); |
| 69 | break; | 69 | break; |
| 70 | } | 70 | } |
| 71 | header.stream_offset += stream_element.extra_data.size(); | 71 | header.stream_offset += static_cast<u32>(stream_element.extra_data.size()); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | try { | 74 | try { |