Make some portability improvements identified by Christophe: A few size_t, a couple "../Include", and a whole bunch of parenthesizing "(A && B) || (C && D)", because some compilers don't believe humans know && is higher precedence than ||.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23379 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-10-04 02:27:06 +00:00
parent 61c2d1410a
commit e50441ad94
12 changed files with 106 additions and 105 deletions

View file

@ -37,14 +37,14 @@
#include "Versions.h"
namespace glslang {
//
// A character scanner that seamlessly, on read-only strings, reads across an
// array of strings without assuming null termination.
//
class TInputScanner {
public:
TInputScanner(int n, const char* const i[], int L[]) : numSources(n), sources(i), lengths(L), currentSource(0), currentChar(0) { }
TInputScanner(int n, const char* const i[], size_t L[]) : numSources(n), sources(i), lengths(L), currentSource(0), currentChar(0) { }
// return of -1 means end of strings,
// anything else is the next character
@ -65,7 +65,7 @@ public:
void advance()
{
++currentChar;
if (currentChar >= lengths[currentSource]) {
if (currentChar >= static_cast<int>(lengths[currentSource])) {
++currentSource;
currentChar = 0;
while (currentSource < numSources && lengths[currentSource] == 0)
@ -100,7 +100,7 @@ public:
protected:
int numSources; // number of strings in source
const char* const *sources; // array of strings
const int *lengths; // length of each string
const size_t *lengths; // length of each string
int currentSource;
int currentChar;
};