Fixed 64-bit integer truncation issues in shader translator.

This is an incompatible API change, but one which is necessary in
order to improve correctness of the code. The API version in
ShaderLang.h is updated and, unfortunately, the define renamed to
something less ambiguous due to conflicts on some Android buildbots.
Temporary patches in Chromium and WebKit will be landed separately to
support this upgrade.

BUG=403,404,405,406,407,408,409
Review URL: https://codereview.appspot.com/7300058


Conflicts:
	include/GLSLANG/ShaderLang.h

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1960 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/ShaderLang.cpp b/src/compiler/ShaderLang.cpp
index a0aaf98..d8aae9b 100644
--- a/src/compiler/ShaderLang.cpp
+++ b/src/compiler/ShaderLang.cpp
@@ -22,18 +22,18 @@
 //
 
 static bool checkActiveUniformAndAttribMaxLengths(const ShHandle handle,
-                                                  int expectedValue)
+                                                  size_t expectedValue)
 {
-    int activeUniformLimit = 0;
+    size_t activeUniformLimit = 0;
     ShGetInfo(handle, SH_ACTIVE_UNIFORM_MAX_LENGTH, &activeUniformLimit);
-    int activeAttribLimit = 0;
+    size_t activeAttribLimit = 0;
     ShGetInfo(handle, SH_ACTIVE_ATTRIBUTE_MAX_LENGTH, &activeAttribLimit);
     return (expectedValue == activeUniformLimit && expectedValue == activeAttribLimit);
 }
 
-static bool checkMappedNameMaxLength(const ShHandle handle, int expectedValue)
+static bool checkMappedNameMaxLength(const ShHandle handle, size_t expectedValue)
 {
-    int mappedNameMaxLength = 0;
+    size_t mappedNameMaxLength = 0;
     ShGetInfo(handle, SH_MAPPED_NAME_MAX_LENGTH, &mappedNameMaxLength);
     return (expectedValue == mappedNameMaxLength);
 }
@@ -41,7 +41,7 @@
 static void getVariableInfo(ShShaderInfo varType,
                             const ShHandle handle,
                             int index,
-                            int* length,
+                            size_t* length,
                             int* size,
                             ShDataType* type,
                             char* name,
@@ -70,14 +70,14 @@
     // This size must match that queried by
     // SH_ACTIVE_UNIFORM_MAX_LENGTH and SH_ACTIVE_ATTRIBUTE_MAX_LENGTH
     // in ShGetInfo, below.
-    int activeUniformAndAttribLength = 1 + MAX_SYMBOL_NAME_LEN;
+    size_t activeUniformAndAttribLength = 1 + MAX_SYMBOL_NAME_LEN;
     ASSERT(checkActiveUniformAndAttribMaxLengths(handle, activeUniformAndAttribLength));
     strncpy(name, varInfo.name.c_str(), activeUniformAndAttribLength);
     name[activeUniformAndAttribLength - 1] = 0;
     if (mappedName) {
         // This size must match that queried by
         // SH_MAPPED_NAME_MAX_LENGTH in ShGetInfo, below.
-        int maxMappedNameLength = 1 + MAX_SYMBOL_NAME_LEN;
+        size_t maxMappedNameLength = 1 + MAX_SYMBOL_NAME_LEN;
         ASSERT(checkMappedNameMaxLength(handle, maxMappedNameLength));
         strncpy(mappedName, varInfo.mappedName.c_str(), maxMappedNameLength);
         mappedName[maxMappedNameLength - 1] = 0;
@@ -178,7 +178,7 @@
 int ShCompile(
     const ShHandle handle,
     const char* const shaderStrings[],
-    const int numStrings,
+    size_t numStrings,
     int compileOptions)
 {
     if (!InitThread())
@@ -196,7 +196,7 @@
     return success ? 1 : 0;
 }
 
-void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params)
+void ShGetInfo(const ShHandle handle, ShShaderInfo pname, size_t* params)
 {
     if (!handle || !params)
         return;
@@ -284,7 +284,7 @@
 
 void ShGetActiveAttrib(const ShHandle handle,
                        int index,
-                       int* length,
+                       size_t* length,
                        int* size,
                        ShDataType* type,
                        char* name,
@@ -296,7 +296,7 @@
 
 void ShGetActiveUniform(const ShHandle handle,
                         int index,
-                        int* length,
+                        size_t* length,
                         int* size,
                         ShDataType* type,
                         char* name,
@@ -327,9 +327,9 @@
         ++it;
 
     size_t len = it->first.length() + 1;
-    int max_len = 0;
+    size_t max_len = 0;
     ShGetInfo(handle, SH_NAME_MAX_LENGTH, &max_len);
-    if (static_cast<int>(len) > max_len) {
+    if (len > max_len) {
         ASSERT(false);
         len = max_len;
     }
@@ -340,7 +340,7 @@
     len = it->second.length() + 1;
     max_len = 0;
     ShGetInfo(handle, SH_HASHED_NAME_MAX_LENGTH, &max_len);
-    if (static_cast<int>(len) > max_len) {
+    if (len > max_len) {
         ASSERT(false);
         len = max_len;
     }