Commit 53977f1c by Alexis Hetu Committed by Alexis Hétu

Re fixed minor warning

Turns out switching from 'size_t' to 'int' created different warnings. Using 'unsigned int' solves all warnings. Change-Id: I2c6c96fe6ed881bb6ce63717d53c8c5864273157 Reviewed-on: https://swiftshader-review.googlesource.com/5702Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent cf5be24a
...@@ -346,7 +346,7 @@ namespace es2 ...@@ -346,7 +346,7 @@ namespace es2
GLint Program::getUniformLocation(const std::string &name) const GLint Program::getUniformLocation(const std::string &name) const
{ {
int subscript = GL_INVALID_INDEX; unsigned int subscript = GL_INVALID_INDEX;
std::string baseName = es2::ParseUniformName(name, &subscript); std::string baseName = es2::ParseUniformName(name, &subscript);
size_t numUniforms = uniformIndex.size(); size_t numUniforms = uniformIndex.size();
...@@ -368,7 +368,7 @@ namespace es2 ...@@ -368,7 +368,7 @@ namespace es2
GLuint Program::getUniformIndex(const std::string &name) const GLuint Program::getUniformIndex(const std::string &name) const
{ {
int subscript = GL_INVALID_INDEX; unsigned int subscript = GL_INVALID_INDEX;
std::string baseName = es2::ParseUniformName(name, &subscript); std::string baseName = es2::ParseUniformName(name, &subscript);
// The app is not allowed to specify array indices other than 0 for arrays of basic types // The app is not allowed to specify array indices other than 0 for arrays of basic types
...@@ -429,7 +429,7 @@ namespace es2 ...@@ -429,7 +429,7 @@ namespace es2
GLuint Program::getUniformBlockIndex(const std::string &name) const GLuint Program::getUniformBlockIndex(const std::string &name) const
{ {
int subscript = GL_INVALID_INDEX; unsigned int subscript = GL_INVALID_INDEX;
std::string baseName = es2::ParseUniformName(name, &subscript); std::string baseName = es2::ParseUniformName(name, &subscript);
size_t numUniformBlocks = getActiveUniformBlockCount(); size_t numUniformBlocks = getActiveUniformBlockCount();
...@@ -1366,7 +1366,7 @@ namespace es2 ...@@ -1366,7 +1366,7 @@ namespace es2
for(const std::string &indexedTfVaryingName : transformFeedbackVaryings) for(const std::string &indexedTfVaryingName : transformFeedbackVaryings)
{ {
int subscript = GL_INVALID_INDEX; unsigned int subscript = GL_INVALID_INDEX;
std::string tfVaryingName = es2::ParseUniformName(indexedTfVaryingName, &subscript); std::string tfVaryingName = es2::ParseUniformName(indexedTfVaryingName, &subscript);
bool hasSubscript = (subscript != GL_INVALID_INDEX); bool hasSubscript = (subscript != GL_INVALID_INDEX);
......
...@@ -1180,7 +1180,7 @@ namespace es2 ...@@ -1180,7 +1180,7 @@ namespace es2
return false; return false;
} }
std::string ParseUniformName(const std::string &name, int *outSubscript) std::string ParseUniformName(const std::string &name, unsigned int *outSubscript)
{ {
// Strip any trailing array operator and retrieve the subscript // Strip any trailing array operator and retrieve the subscript
size_t open = name.find_last_of('['); size_t open = name.find_last_of('[');
......
...@@ -60,7 +60,7 @@ namespace es2 ...@@ -60,7 +60,7 @@ namespace es2
// Parse the base uniform name and array index. Returns the base name of the uniform. outSubscript is // Parse the base uniform name and array index. Returns the base name of the uniform. outSubscript is
// set to GL_INVALID_INDEX if the provided name is not an array or the array index is invalid. // set to GL_INVALID_INDEX if the provided name is not an array or the array index is invalid.
std::string ParseUniformName(const std::string &name, int *outSubscript); std::string ParseUniformName(const std::string &name, unsigned int *outSubscript);
} }
namespace es2sw namespace es2sw
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment