Fix the few non-portable uses of "char" (where a -1 might be relevant): All uses of char are now either "int", "unsigned char" or char arrays for storing strings. Also, went to consistent "char* foo" coding convention. (There were only a few ambiguous uses.)

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25400 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2014-02-18 23:37:57 +00:00
parent 52c351442c
commit 51cdd90fa8
15 changed files with 72 additions and 72 deletions

View file

@ -9,5 +9,5 @@
// source have to figure out how to create revision.h just to get a build // source have to figure out how to create revision.h just to get a build
// going. However, if it is not updated, it can be a version behind. // going. However, if it is not updated, it can be a version behind.
#define GLSLANG_REVISION "25351" #define GLSLANG_REVISION "25392"
#define GLSLANG_DATE "2014/02/13 12:14:33" #define GLSLANG_DATE "2014/02/18 14:55:42"

View file

@ -56,7 +56,7 @@ namespace glslang {
// read past any white space // read past any white space
void TInputScanner::consumeWhiteSpace(bool& foundNonSpaceTab) void TInputScanner::consumeWhiteSpace(bool& foundNonSpaceTab)
{ {
char c = peek(); // don't accidentally consume anything other than whitespace int c = peek(); // don't accidentally consume anything other than whitespace
while (c == ' ' || c == '\t' || c == '\r' || c == '\n') { while (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
if (c == '\r' || c == '\n') if (c == '\r' || c == '\n')
foundNonSpaceTab = true; foundNonSpaceTab = true;
@ -72,7 +72,7 @@ bool TInputScanner::consumeComment()
return false; return false;
get(); // consume the '/' get(); // consume the '/'
char c = peek(); int c = peek();
if (c == '/') { if (c == '/') {
// a '//' style comment // a '//' style comment
@ -139,7 +139,7 @@ void TInputScanner::consumeWhitespaceComment(bool& foundNonSpaceTab)
consumeWhiteSpace(foundNonSpaceTab); consumeWhiteSpace(foundNonSpaceTab);
// if not starting a comment now, then done // if not starting a comment now, then done
char c = peek(); int c = peek();
if (c != '/' || c < 0) if (c != '/' || c < 0)
return; return;
@ -176,7 +176,7 @@ bool TInputScanner::scanVersion(int& version, EProfile& profile)
return true; return true;
// whitespace // whitespace
char c; int c;
do { do {
c = get(); c = get();
} while (c == ' ' || c == '\t'); } while (c == ' ' || c == '\t');

View file

@ -62,12 +62,12 @@ public:
// anything else is the next character // anything else is the next character
// retrieve the next character and advance one character // retrieve the next character and advance one character
char get() int get()
{ {
if (currentSource >= numSources) if (currentSource >= numSources)
return -1; return -1;
char ret = sources[currentSource][currentChar]; int ret = sources[currentSource][currentChar];
if (ret == '\n') if (ret == '\n')
++loc[currentSource].line; ++loc[currentSource].line;
advance(); advance();
@ -76,7 +76,7 @@ public:
} }
// retrieve the next character, no advance // retrieve the next character, no advance
char peek() int peek()
{ {
if (currentSource >= numSources) if (currentSource >= numSources)
return -1; return -1;

View file

@ -164,7 +164,7 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
{ {
char tokenText[TPpToken::maxTokenLength + 1]; char tokenText[TPpToken::maxTokenLength + 1];
int ltoken, len; int ltoken, len;
char ch; int ch;
ltoken = lReadByte(pTok); ltoken = lReadByte(pTok);
ppToken->loc = parseContext.getCurrentLoc(); ppToken->loc = parseContext.getCurrentLoc();