Bläddra i källkod

video_core/control_flow: Make program_size for ScanFlow() a std::size_t

Prevents a truncation warning from occurring with MSVC. Also the
internal data structures already treat it as a size_t, so this is just a
discrepancy in the interface.
Lioncash 7 år sedan
förälder
incheckning
47df844338
2 ändrade filer med 4 tillägg och 5 borttagningar
  1. 2 2
      src/video_core/shader/control_flow.cpp
  2. 2 3
      src/video_core/shader/control_flow.h

+ 2 - 2
src/video_core/shader/control_flow.cpp

@@ -413,8 +413,8 @@ bool TryQuery(CFGRebuildState& state) {
 }
 }
 } // Anonymous namespace
 } // Anonymous namespace
 
 
-std::optional<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code, u32 program_size,
-                                              u32 start_address) {
+std::optional<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code,
+                                              std::size_t program_size, u32 start_address) {
     CFGRebuildState state{program_code, program_size, start_address};
     CFGRebuildState state{program_code, program_size, start_address};
     // Inspect Code and generate blocks
     // Inspect Code and generate blocks
     state.labels.clear();
     state.labels.clear();

+ 2 - 3
src/video_core/shader/control_flow.h

@@ -4,7 +4,6 @@
 
 
 #pragma once
 #pragma once
 
 
-#include <cstring>
 #include <list>
 #include <list>
 #include <optional>
 #include <optional>
 #include <unordered_set>
 #include <unordered_set>
@@ -57,7 +56,7 @@ struct ShaderCharacteristics {
     std::unordered_set<u32> labels{};
     std::unordered_set<u32> labels{};
 };
 };
 
 
-std::optional<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code, u32 program_size,
-                                              u32 start_address);
+std::optional<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code,
+                                              std::size_t program_size, u32 start_address);
 
 
 } // namespace VideoCommon::Shader
 } // namespace VideoCommon::Shader