OSDN Git Service

Re fixed minor warning
authorAlexis Hetu <sugoi@google.com>
Mon, 27 Jun 2016 20:04:31 +0000 (16:04 -0400)
committerAlexis Hétu <sugoi@google.com>
Mon, 27 Jun 2016 20:21:19 +0000 (20:21 +0000)
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/5702
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/OpenGL/libGLESv2/Program.cpp
src/OpenGL/libGLESv2/utilities.cpp
src/OpenGL/libGLESv2/utilities.h

index 957f83a..af3b21d 100644 (file)
@@ -346,7 +346,7 @@ namespace es2
 
        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);
 
                size_t numUniforms = uniformIndex.size();
@@ -368,7 +368,7 @@ namespace es2
 
        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);
 
                // The app is not allowed to specify array indices other than 0 for arrays of basic types
@@ -429,7 +429,7 @@ namespace es2
 
        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);
 
                size_t numUniformBlocks = getActiveUniformBlockCount();
@@ -1366,7 +1366,7 @@ namespace es2
 
                for(const std::string &indexedTfVaryingName : transformFeedbackVaryings)
                {
-                       int subscript = GL_INVALID_INDEX;
+                       unsigned int subscript = GL_INVALID_INDEX;
                        std::string tfVaryingName = es2::ParseUniformName(indexedTfVaryingName, &subscript);
                        bool hasSubscript = (subscript != GL_INVALID_INDEX);
 
index 73a5a4e..70ff932 100644 (file)
@@ -1180,7 +1180,7 @@ namespace es2
                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
                size_t open = name.find_last_of('[');
index 2b904e0..6a4d408 100644 (file)
@@ -60,7 +60,7 @@ namespace es2
 
        // 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.
-       std::string ParseUniformName(const std::string &name, int *outSubscript);
+       std::string ParseUniformName(const std::string &name, unsigned int *outSubscript);
 }
 
 namespace es2sw