diff options
| author | 2015-07-25 12:50:32 -0700 | |
|---|---|---|
| committer | 2015-07-25 12:50:32 -0700 | |
| commit | 9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1 (patch) | |
| tree | 732bc1b978397a05fab07d5443fe05534ea39b37 /src | |
| parent | Merge pull request #981 from Subv/checkboxes (diff) | |
| parent | Vertex Shader : Undo casting (diff) | |
| download | yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.tar.gz yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.tar.xz yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.zip | |
Merge pull request #892 from zawata/another-warning-fixes
Yet More Warning Fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra_qt/debugger/graphics_cmdlists.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/debugger/graphics_vertex_shader.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/debugger/profiler.cpp | 2 | ||||
| -rw-r--r-- | src/common/string_util.cpp | 2 | ||||
| -rw-r--r-- | src/core/core_timing.cpp | 2 | ||||
| -rw-r--r-- | src/core/loader/3dsx.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/command_processor.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 32 | ||||
| -rw-r--r-- | src/video_core/pica.h | 2 |
9 files changed, 24 insertions, 24 deletions
diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index 392ff570b..de10bce1f 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp | |||
| @@ -170,7 +170,7 @@ GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(p | |||
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | int GPUCommandListModel::rowCount(const QModelIndex& parent) const { | 172 | int GPUCommandListModel::rowCount(const QModelIndex& parent) const { |
| 173 | return pica_trace.writes.size(); | 173 | return static_cast<int>(pica_trace.writes.size()); |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | int GPUCommandListModel::columnCount(const QModelIndex& parent) const { | 176 | int GPUCommandListModel::columnCount(const QModelIndex& parent) const { |
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index db622d846..f42a2f4ce 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp | |||
| @@ -34,7 +34,7 @@ int GraphicsVertexShaderModel::columnCount(const QModelIndex& parent) const { | |||
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | int GraphicsVertexShaderModel::rowCount(const QModelIndex& parent) const { | 36 | int GraphicsVertexShaderModel::rowCount(const QModelIndex& parent) const { |
| 37 | return info.code.size(); | 37 | return static_cast<int>(info.code.size()); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | QVariant GraphicsVertexShaderModel::headerData(int section, Qt::Orientation orientation, int role) const { | 40 | QVariant GraphicsVertexShaderModel::headerData(int section, Qt::Orientation orientation, int role) const { |
diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index 2ac1748b7..89b28c2f4 100644 --- a/src/citra_qt/debugger/profiler.cpp +++ b/src/citra_qt/debugger/profiler.cpp | |||
| @@ -74,7 +74,7 @@ int ProfilerModel::rowCount(const QModelIndex& parent) const | |||
| 74 | if (parent.isValid()) { | 74 | if (parent.isValid()) { |
| 75 | return 0; | 75 | return 0; |
| 76 | } else { | 76 | } else { |
| 77 | return results.time_per_category.size() + 2; | 77 | return static_cast<int>(results.time_per_category.size() + 2); |
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | 80 | ||
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 2e80809ab..b2f7f7b1d 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp | |||
| @@ -313,7 +313,7 @@ static std::string UTF16ToUTF8(const std::wstring& input) | |||
| 313 | std::string output; | 313 | std::string output; |
| 314 | output.resize(size); | 314 | output.resize(size); |
| 315 | 315 | ||
| 316 | if (size == 0 || size != WideCharToMultiByte(CP_UTF8, 0, input.data(), input.size(), &output[0], output.size(), nullptr, nullptr)) | 316 | if (size == 0 || size != WideCharToMultiByte(CP_UTF8, 0, input.data(), static_cast<int>(input.size()), &output[0], static_cast<int>(output.size()), nullptr, nullptr)) |
| 317 | output.clear(); | 317 | output.clear(); |
| 318 | 318 | ||
| 319 | return output; | 319 | return output; |
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 72006a53e..20f2da0fe 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -502,7 +502,7 @@ void Advance() { | |||
| 502 | Core::g_app_core->down_count += diff; | 502 | Core::g_app_core->down_count += diff; |
| 503 | } | 503 | } |
| 504 | if (advance_callback) | 504 | if (advance_callback) |
| 505 | advance_callback(cycles_executed); | 505 | advance_callback(static_cast<int>(cycles_executed)); |
| 506 | } | 506 | } |
| 507 | 507 | ||
| 508 | void LogPendingEvents() { | 508 | void LogPendingEvents() { |
diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index d043fa9bd..530837d08 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp | |||
| @@ -191,7 +191,7 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, Shared | |||
| 191 | *pos = (addr); | 191 | *pos = (addr); |
| 192 | break; | 192 | break; |
| 193 | case 1: | 193 | case 1: |
| 194 | *pos = (addr - in_addr); | 194 | *pos = static_cast<u32>(addr - in_addr); |
| 195 | break; | 195 | break; |
| 196 | default: | 196 | default: |
| 197 | break; //this should never happen | 197 | break; //this should never happen |
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 92ba8754f..43ae06181 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp | |||
| @@ -103,7 +103,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 103 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[0], 0x23c): | 103 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[0], 0x23c): |
| 104 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[1], 0x23d): | 104 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[1], 0x23d): |
| 105 | { | 105 | { |
| 106 | unsigned index = id - PICA_REG_INDEX(command_buffer.trigger[0]); | 106 | unsigned index = static_cast<unsigned>(id - PICA_REG_INDEX(command_buffer.trigger[0])); |
| 107 | u32* head_ptr = (u32*)Memory::GetPhysicalPointer(regs.command_buffer.GetPhysicalAddress(index)); | 107 | u32* head_ptr = (u32*)Memory::GetPhysicalPointer(regs.command_buffer.GetPhysicalAddress(index)); |
| 108 | g_state.cmd_list.head_ptr = g_state.cmd_list.current_ptr = head_ptr; | 108 | g_state.cmd_list.head_ptr = g_state.cmd_list.current_ptr = head_ptr; |
| 109 | g_state.cmd_list.length = regs.command_buffer.GetSize(index) / sizeof(u32); | 109 | g_state.cmd_list.length = regs.command_buffer.GetSize(index) / sizeof(u32); |
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index d24c0f11e..fc9faffc3 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp | |||
| @@ -85,7 +85,7 @@ void GeometryDumper::AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2) { | |||
| 85 | vertices.push_back(v1); | 85 | vertices.push_back(v1); |
| 86 | vertices.push_back(v2); | 86 | vertices.push_back(v2); |
| 87 | 87 | ||
| 88 | int num_vertices = vertices.size(); | 88 | size_t num_vertices = vertices.size(); |
| 89 | faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 }); | 89 | faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 }); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| @@ -241,8 +241,8 @@ void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data | |||
| 241 | 241 | ||
| 242 | dvle.main_offset_words = main_offset; | 242 | dvle.main_offset_words = main_offset; |
| 243 | dvle.output_register_table_offset = write_offset - dvlb.dvle_offset; | 243 | dvle.output_register_table_offset = write_offset - dvlb.dvle_offset; |
| 244 | dvle.output_register_table_size = output_info_table.size(); | 244 | dvle.output_register_table_size = static_cast<uint32_t>(output_info_table.size()); |
| 245 | QueueForWriting((u8*)output_info_table.data(), output_info_table.size() * sizeof(OutputRegisterInfo)); | 245 | QueueForWriting((u8*)output_info_table.data(), static_cast<u32>(output_info_table.size() * sizeof(OutputRegisterInfo))); |
| 246 | 246 | ||
| 247 | // TODO: Create a label table for "main" | 247 | // TODO: Create a label table for "main" |
| 248 | 248 | ||
| @@ -497,31 +497,31 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture | |||
| 497 | // Lookup base value | 497 | // Lookup base value |
| 498 | Math::Vec3<int> ret; | 498 | Math::Vec3<int> ret; |
| 499 | if (differential_mode) { | 499 | if (differential_mode) { |
| 500 | ret.r() = differential.r; | 500 | ret.r() = static_cast<int>(differential.r); |
| 501 | ret.g() = differential.g; | 501 | ret.g() = static_cast<int>(differential.g); |
| 502 | ret.b() = differential.b; | 502 | ret.b() = static_cast<int>(differential.b); |
| 503 | if (x >= 2) { | 503 | if (x >= 2) { |
| 504 | ret.r() += differential.dr; | 504 | ret.r() += static_cast<int>(differential.dr); |
| 505 | ret.g() += differential.dg; | 505 | ret.g() += static_cast<int>(differential.dg); |
| 506 | ret.b() += differential.db; | 506 | ret.b() += static_cast<int>(differential.db); |
| 507 | } | 507 | } |
| 508 | ret.r() = Color::Convert5To8(ret.r()); | 508 | ret.r() = Color::Convert5To8(ret.r()); |
| 509 | ret.g() = Color::Convert5To8(ret.g()); | 509 | ret.g() = Color::Convert5To8(ret.g()); |
| 510 | ret.b() = Color::Convert5To8(ret.b()); | 510 | ret.b() = Color::Convert5To8(ret.b()); |
| 511 | } else { | 511 | } else { |
| 512 | if (x < 2) { | 512 | if (x < 2) { |
| 513 | ret.r() = Color::Convert4To8(separate.r1); | 513 | ret.r() = Color::Convert4To8(static_cast<u8>(separate.r1)); |
| 514 | ret.g() = Color::Convert4To8(separate.g1); | 514 | ret.g() = Color::Convert4To8(static_cast<u8>(separate.g1)); |
| 515 | ret.b() = Color::Convert4To8(separate.b1); | 515 | ret.b() = Color::Convert4To8(static_cast<u8>(separate.b1)); |
| 516 | } else { | 516 | } else { |
| 517 | ret.r() = Color::Convert4To8(separate.r2); | 517 | ret.r() = Color::Convert4To8(static_cast<u8>(separate.r2)); |
| 518 | ret.g() = Color::Convert4To8(separate.g2); | 518 | ret.g() = Color::Convert4To8(static_cast<u8>(separate.g2)); |
| 519 | ret.b() = Color::Convert4To8(separate.b2); | 519 | ret.b() = Color::Convert4To8(static_cast<u8>(separate.b2)); |
| 520 | } | 520 | } |
| 521 | } | 521 | } |
| 522 | 522 | ||
| 523 | // Add modifier | 523 | // Add modifier |
| 524 | unsigned table_index = (x < 2) ? table_index_1.Value() : table_index_2.Value(); | 524 | unsigned table_index = static_cast<int>((x < 2) ? table_index_1.Value() : table_index_2.Value()); |
| 525 | 525 | ||
| 526 | static const std::array<std::array<u8, 2>, 8> etc1_modifier_table = {{ | 526 | static const std::array<std::array<u8, 2>, 8> etc1_modifier_table = {{ |
| 527 | { 2, 8 }, { 5, 17 }, { 9, 29 }, { 13, 42 }, | 527 | { 2, 8 }, { 5, 17 }, { 9, 29 }, { 13, 42 }, |
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index aec6f0660..38599a7a3 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h | |||
| @@ -913,7 +913,7 @@ struct Regs { | |||
| 913 | 913 | ||
| 914 | #define ADD_FIELD(name) \ | 914 | #define ADD_FIELD(name) \ |
| 915 | do { \ | 915 | do { \ |
| 916 | map.insert({PICA_REG_INDEX(name), #name}); \ | 916 | map.insert({static_cast<u32>(PICA_REG_INDEX(name)), #name}); \ |
| 917 | /* TODO: change to Regs::name when VS2015 and other compilers support it */ \ | 917 | /* TODO: change to Regs::name when VS2015 and other compilers support it */ \ |
| 918 | for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(Regs().name) / 4; ++i) \ | 918 | for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(Regs().name) / 4; ++i) \ |
| 919 | map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \ | 919 | map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \ |