Fixed Windows warnings
- Removed unused variables
- Removed unreachable code
- Fixed size_t <-> int conversions
- Fixed uninitialized variables
Change-Id: Ifc3912e92b8f0710094e939bd0da4757148b559a
Reviewed-on: https://swiftshader-review.googlesource.com/5681
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/Shader/PixelPipeline.cpp b/src/Shader/PixelPipeline.cpp
index e353c27..5987768 100644
--- a/src/Shader/PixelPipeline.cpp
+++ b/src/Shader/PixelPipeline.cpp
@@ -378,9 +378,9 @@
void PixelPipeline::blendTexture(Vector4s &temp, Vector4s &texture, int stage)
{
- Vector4s *arg1;
- Vector4s *arg2;
- Vector4s *arg3;
+ Vector4s *arg1 = nullptr;
+ Vector4s *arg2 = nullptr;
+ Vector4s *arg3 = nullptr;
Vector4s res;
Vector4s constant;
diff --git a/src/Shader/Shader.cpp b/src/Shader/Shader.cpp
index deb6180..d61dcde 100644
--- a/src/Shader/Shader.cpp
+++ b/src/Shader/Shader.cpp
@@ -1457,7 +1457,7 @@
usedSamplers |= 1 << i;
}
- const Shader::Instruction *Shader::getInstruction(unsigned int i) const
+ const Shader::Instruction *Shader::getInstruction(size_t i) const
{
ASSERT(i < instruction.size());
diff --git a/src/Shader/Shader.hpp b/src/Shader/Shader.hpp
index 6b93999..3cd08a3 100644
--- a/src/Shader/Shader.hpp
+++ b/src/Shader/Shader.hpp
@@ -552,7 +552,7 @@
void append(Instruction *instruction);
void declareSampler(int i);
- const Instruction *getInstruction(unsigned int i) const;
+ const Instruction *getInstruction(size_t i) const;
int size(unsigned long opcode) const;
static int size(unsigned long opcode, unsigned short version);
diff --git a/src/Shader/VertexShader.cpp b/src/Shader/VertexShader.cpp
index 06dd1b2..733c113 100644
--- a/src/Shader/VertexShader.cpp
+++ b/src/Shader/VertexShader.cpp
@@ -30,7 +30,7 @@
for(int i = 0; i < MAX_VERTEX_INPUTS; i++)
{
- input[i] = Semantic(-1, -1);
+ input[i] = Semantic();
}
if(vs) // Make a copy
@@ -62,7 +62,7 @@
for(int i = 0; i < MAX_VERTEX_INPUTS; i++)
{
- input[i] = Semantic(-1, -1);
+ input[i] = Semantic();
}
optimize();