summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-06-20 16:46:14 -0400
committerGravatar GitHub2018-06-20 16:46:14 -0400
commitc3e95086b66dfa4214892dcddb9fd6f865037c1e (patch)
tree859f41acecbdcfcbdf19df80903a045d6e2b0bcb /src
parentImplement GetAvailableLanguageCodes2 (#575) (diff)
parentBuild: Fixed some MSVC warnings in various parts of the code. (diff)
downloadyuzu-c3e95086b66dfa4214892dcddb9fd6f865037c1e.tar.gz
yuzu-c3e95086b66dfa4214892dcddb9fd6f865037c1e.tar.xz
yuzu-c3e95086b66dfa4214892dcddb9fd6f865037c1e.zip
Merge pull request #576 from Subv/warnings1
Build: Fixed some MSVC warnings in various parts of the code.
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/partition_filesystem.cpp6
-rw-r--r--src/core/file_sys/partition_filesystem.h6
-rw-r--r--src/core/hle/kernel/svc.cpp4
-rw-r--r--src/core/hle/service/audio/audren_u.cpp2
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp3
-rw-r--r--src/video_core/engines/maxwell_3d.cpp5
-rw-r--r--src/video_core/engines/shader_bytecode.h4
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_shader_manager.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp4
12 files changed, 24 insertions, 22 deletions
diff --git a/src/core/file_sys/partition_filesystem.cpp b/src/core/file_sys/partition_filesystem.cpp
index 808254ecc..86a01a5eb 100644
--- a/src/core/file_sys/partition_filesystem.cpp
+++ b/src/core/file_sys/partition_filesystem.cpp
@@ -73,21 +73,21 @@ u32 PartitionFilesystem::GetNumEntries() const {
73 return pfs_header.num_entries; 73 return pfs_header.num_entries;
74} 74}
75 75
76u64 PartitionFilesystem::GetEntryOffset(int index) const { 76u64 PartitionFilesystem::GetEntryOffset(u32 index) const {
77 if (index > GetNumEntries()) 77 if (index > GetNumEntries())
78 return 0; 78 return 0;
79 79
80 return content_offset + pfs_entries[index].fs_entry.offset; 80 return content_offset + pfs_entries[index].fs_entry.offset;
81} 81}
82 82
83u64 PartitionFilesystem::GetEntrySize(int index) const { 83u64 PartitionFilesystem::GetEntrySize(u32 index) const {
84 if (index > GetNumEntries()) 84 if (index > GetNumEntries())
85 return 0; 85 return 0;
86 86
87 return pfs_entries[index].fs_entry.size; 87 return pfs_entries[index].fs_entry.size;
88} 88}
89 89
90std::string PartitionFilesystem::GetEntryName(int index) const { 90std::string PartitionFilesystem::GetEntryName(u32 index) const {
91 if (index > GetNumEntries()) 91 if (index > GetNumEntries())
92 return ""; 92 return "";
93 93
diff --git a/src/core/file_sys/partition_filesystem.h b/src/core/file_sys/partition_filesystem.h
index 573c90057..65cf572f4 100644
--- a/src/core/file_sys/partition_filesystem.h
+++ b/src/core/file_sys/partition_filesystem.h
@@ -27,9 +27,9 @@ public:
27 Loader::ResultStatus Load(const std::vector<u8>& file_data, size_t offset = 0); 27 Loader::ResultStatus Load(const std::vector<u8>& file_data, size_t offset = 0);
28 28
29 u32 GetNumEntries() const; 29 u32 GetNumEntries() const;
30 u64 GetEntryOffset(int index) const; 30 u64 GetEntryOffset(u32 index) const;
31 u64 GetEntrySize(int index) const; 31 u64 GetEntrySize(u32 index) const;
32 std::string GetEntryName(int index) const; 32 std::string GetEntryName(u32 index) const;
33 u64 GetFileOffset(const std::string& name) const; 33 u64 GetFileOffset(const std::string& name) const;
34 u64 GetFileSize(const std::string& name) const; 34 u64 GetFileSize(const std::string& name) const;
35 35
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 097416e9e..69ba7b777 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -749,7 +749,7 @@ static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) {
749 ASSERT(thread->owner_process->ideal_processor != THREADPROCESSORID_DEFAULT); 749 ASSERT(thread->owner_process->ideal_processor != THREADPROCESSORID_DEFAULT);
750 // Set the target CPU to the one specified in the process' exheader. 750 // Set the target CPU to the one specified in the process' exheader.
751 core = thread->owner_process->ideal_processor; 751 core = thread->owner_process->ideal_processor;
752 mask = 1 << core; 752 mask = 1ull << core;
753 } 753 }
754 754
755 if (mask == 0) { 755 if (mask == 0) {
@@ -766,7 +766,7 @@ static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) {
766 } 766 }
767 767
768 // Error out if the input core isn't enabled in the input mask. 768 // Error out if the input core isn't enabled in the input mask.
769 if (core < Core::NUM_CPU_CORES && (mask & (1 << core)) == 0) { 769 if (core < Core::NUM_CPU_CORES && (mask & (1ull << core)) == 0) {
770 return ResultCode(ErrorModule::Kernel, ErrCodes::InvalidCombination); 770 return ResultCode(ErrorModule::Kernel, ErrCodes::InvalidCombination);
771 } 771 }
772 772
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index 6e8002bc9..c7653f654 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -328,7 +328,7 @@ bool AudRenU::IsFeatureSupported(AudioFeatures feature, u32_le revision) const {
328 u32_be version_num = (revision - Common::MakeMagic('R', 'E', 'V', '0')); // Byte swap 328 u32_be version_num = (revision - Common::MakeMagic('R', 'E', 'V', '0')); // Byte swap
329 switch (feature) { 329 switch (feature) {
330 case AudioFeatures::Splitter: 330 case AudioFeatures::Splitter:
331 return version_num >= 2; 331 return version_num >= 2u;
332 default: 332 default:
333 return false; 333 return false;
334 } 334 }
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
index 79aab87f9..ed7b6dc03 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
@@ -121,8 +121,9 @@ u32 nvhost_gpu::AllocateObjectContext(const std::vector<u8>& input, std::vector<
121} 121}
122 122
123u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& output) { 123u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& output) {
124 if (input.size() < sizeof(IoctlSubmitGpfifo)) 124 if (input.size() < sizeof(IoctlSubmitGpfifo)) {
125 UNIMPLEMENTED(); 125 UNIMPLEMENTED();
126 }
126 IoctlSubmitGpfifo params{}; 127 IoctlSubmitGpfifo params{};
127 std::memcpy(&params, input.data(), sizeof(IoctlSubmitGpfifo)); 128 std::memcpy(&params, input.data(), sizeof(IoctlSubmitGpfifo));
128 NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}", 129 NGLOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}",
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 86e9dc998..93c43c8cb 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -328,8 +328,9 @@ std::vector<Texture::FullTextureInfo> Maxwell3D::GetStageTextures(Regs::ShaderSt
328 328
329 Texture::FullTextureInfo tex_info{}; 329 Texture::FullTextureInfo tex_info{};
330 // TODO(Subv): Use the shader to determine which textures are actually accessed. 330 // TODO(Subv): Use the shader to determine which textures are actually accessed.
331 tex_info.index = (current_texture - tex_info_buffer.address - TextureInfoOffset) / 331 tex_info.index =
332 sizeof(Texture::TextureHandle); 332 static_cast<u32>(current_texture - tex_info_buffer.address - TextureInfoOffset) /
333 sizeof(Texture::TextureHandle);
333 334
334 // Load the TIC data. 335 // Load the TIC data.
335 if (tex_handle.tic_id != 0) { 336 if (tex_handle.tic_id != 0) {
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 5ff861b04..cb4db0679 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -372,7 +372,7 @@ union Instruction {
372 BitField<31, 4, u64> component_mask; 372 BitField<31, 4, u64> component_mask;
373 373
374 bool IsComponentEnabled(size_t component) const { 374 bool IsComponentEnabled(size_t component) const {
375 return ((1 << component) & component_mask) != 0; 375 return ((1ull << component) & component_mask) != 0;
376 } 376 }
377 } tex; 377 } tex;
378 378
@@ -391,7 +391,7 @@ union Instruction {
391 391
392 ASSERT(component_mask_selector < mask.size()); 392 ASSERT(component_mask_selector < mask.size());
393 393
394 return ((1 << component) & mask[component_mask_selector]) != 0; 394 return ((1ull << component) & mask[component_mask_selector]) != 0;
395 } 395 }
396 } texs; 396 } texs;
397 397
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 833ff8273..3ba20f978 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -633,7 +633,7 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
633 633
634 state.Apply(); 634 state.Apply();
635 635
636 return current_bindpoint + entries.size(); 636 return current_bindpoint + static_cast<u32>(entries.size());
637} 637}
638 638
639u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program, u32 current_unit, 639u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program, u32 current_unit,
@@ -679,7 +679,7 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program,
679 679
680 state.Apply(); 680 state.Apply();
681 681
682 return current_unit + entries.size(); 682 return current_unit + static_cast<u32>(entries.size());
683} 683}
684 684
685void RasterizerOpenGL::BindFramebufferSurfaces(const Surface& color_surface, 685void RasterizerOpenGL::BindFramebufferSurfaces(const Surface& color_surface,
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index b2a61024e..61d670dcb 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -575,7 +575,7 @@ void CachedSurface::UploadGLTexture(const MathUtil::Rectangle<u32>& rect, GLuint
575 glCompressedTexImage2D(GL_TEXTURE_2D, 0, tuple.internal_format, 575 glCompressedTexImage2D(GL_TEXTURE_2D, 0, tuple.internal_format,
576 static_cast<GLsizei>(rect.GetWidth() * GetCompresssionFactor()), 576 static_cast<GLsizei>(rect.GetWidth() * GetCompresssionFactor()),
577 static_cast<GLsizei>(rect.GetHeight() * GetCompresssionFactor()), 0, 577 static_cast<GLsizei>(rect.GetHeight() * GetCompresssionFactor()), 0,
578 size, &gl_buffer[buffer_offset]); 578 static_cast<GLsizei>(size), &gl_buffer[buffer_offset]);
579 } else { 579 } else {
580 glTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, static_cast<GLsizei>(rect.GetWidth()), 580 glTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, static_cast<GLsizei>(rect.GetWidth()),
581 static_cast<GLsizei>(rect.GetHeight()), tuple.format, tuple.type, 581 static_cast<GLsizei>(rect.GetHeight()), tuple.format, tuple.type,
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index fc80d4b29..65fed77ef 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -535,7 +535,7 @@ private:
535 */ 535 */
536 void SetRegister(const Register& reg, u64 elem, const std::string& value, 536 void SetRegister(const Register& reg, u64 elem, const std::string& value,
537 u64 dest_num_components, u64 value_num_components, u64 dest_elem) { 537 u64 dest_num_components, u64 value_num_components, u64 dest_elem) {
538 std::string dest = GetRegister(reg, dest_elem); 538 std::string dest = GetRegister(reg, static_cast<u32>(dest_elem));
539 if (dest_num_components > 1) { 539 if (dest_num_components > 1) {
540 dest += GetSwizzle(elem); 540 dest += GetSwizzle(elem);
541 } 541 }
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp
index 7c00beb33..d7167b298 100644
--- a/src/video_core/renderer_opengl/gl_shader_manager.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp
@@ -38,8 +38,8 @@ void MaxwellUniformData::SetFromRegs(const Maxwell3D::State::ShaderStageInfo& sh
38 const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs; 38 const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs;
39 39
40 // TODO(bunnei): Support more than one viewport 40 // TODO(bunnei): Support more than one viewport
41 viewport_flip[0] = regs.viewport_transform[0].scale_x < 0.0 ? -1.0 : 1.0; 41 viewport_flip[0] = regs.viewport_transform[0].scale_x < 0.0 ? -1.0f : 1.0f;
42 viewport_flip[1] = regs.viewport_transform[0].scale_y < 0.0 ? -1.0 : 1.0; 42 viewport_flip[1] = regs.viewport_transform[0].scale_y < 0.0 ? -1.0f : 1.0f;
43} 43}
44 44
45} // namespace GLShader 45} // namespace GLShader
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 44f0c8a01..1f1e48425 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -196,13 +196,13 @@ void OpenGLState::Apply() const {
196 } 196 }
197 197
198 // Textures 198 // Textures
199 for (size_t i = 0; i < std::size(texture_units); ++i) { 199 for (int i = 0; i < std::size(texture_units); ++i) {
200 if (texture_units[i].texture_2d != cur_state.texture_units[i].texture_2d) { 200 if (texture_units[i].texture_2d != cur_state.texture_units[i].texture_2d) {
201 glActiveTexture(TextureUnits::MaxwellTexture(i).Enum()); 201 glActiveTexture(TextureUnits::MaxwellTexture(i).Enum());
202 glBindTexture(GL_TEXTURE_2D, texture_units[i].texture_2d); 202 glBindTexture(GL_TEXTURE_2D, texture_units[i].texture_2d);
203 } 203 }
204 if (texture_units[i].sampler != cur_state.texture_units[i].sampler) { 204 if (texture_units[i].sampler != cur_state.texture_units[i].sampler) {
205 glBindSampler(i, texture_units[i].sampler); 205 glBindSampler(static_cast<GLuint>(i), texture_units[i].sampler);
206 } 206 }
207 // Update the texture swizzle 207 // Update the texture swizzle
208 if (texture_units[i].swizzle.r != cur_state.texture_units[i].swizzle.r || 208 if (texture_units[i].swizzle.r != cur_state.texture_units[i].swizzle.r ||