- Moved the implementation for ShCompile to the compiler class so that internal details about compiler can be encapsulated. Now we do not need to expose built-in symbol table.
- Fixed a few const violations.
- Added CollectAttribsUniforms class.
BUG=26
Review URL: http://codereview.appspot.com/2263041
git-svn-id: https://angleproject.googlecode.com/svn/trunk@437 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/preprocessor/compile.h b/src/compiler/preprocessor/compile.h
index 5bfa902..69e3425 100644
--- a/src/compiler/preprocessor/compile.h
+++ b/src/compiler/preprocessor/compile.h
@@ -89,10 +89,10 @@
// Globals used to communicate between PaParseStrings() and yy_input()and
// also across the files.(gen_glslang.cpp and scanner.c)
//
- int PaWhichStr; // which string we're parsing
- int* PaStrLen; // array of lengths of the PaArgv strings
- int PaArgc; // count of strings in the array
- char** PaArgv; // our array of strings to parse
+ int PaWhichStr; // which string we're parsing
+ const int* PaStrLen; // array of lengths of the PaArgv strings
+ int PaArgc; // count of strings in the array
+ const char* const* PaArgv; // our array of strings to parse
unsigned int tokensBeforeEOF : 1;
};
diff --git a/src/compiler/preprocessor/preprocess.h b/src/compiler/preprocessor/preprocess.h
index 0602c91..3fcaa0d 100644
--- a/src/compiler/preprocessor/preprocess.h
+++ b/src/compiler/preprocessor/preprocess.h
@@ -47,5 +47,5 @@
int InitCPPStruct(void);
int InitScanner(CPPStruct *cpp);
int InitAtomTable(AtomTable *atable, int htsize);
-int ScanFromString(char *s);
+int ScanFromString(const char *s);
char* GetStringOfAtom(AtomTable *atable, int atom);
diff --git a/src/compiler/preprocessor/scanner.c b/src/compiler/preprocessor/scanner.c
index c77d271..c9fc2fa 100644
--- a/src/compiler/preprocessor/scanner.c
+++ b/src/compiler/preprocessor/scanner.c
@@ -170,7 +170,7 @@
}
} // str_ungetch
-int ScanFromString(char *s)
+int ScanFromString(const char *s)
{
StringInputSrc *in = malloc(sizeof(StringInputSrc));
diff --git a/src/compiler/preprocessor/scanner.h b/src/compiler/preprocessor/scanner.h
index 571fe57..c12c97b 100644
--- a/src/compiler/preprocessor/scanner.h
+++ b/src/compiler/preprocessor/scanner.h
@@ -73,7 +73,7 @@
} InputSrc;
int InitScanner(CPPStruct *cpp); // Intialise the cpp scanner.
-int ScanFromString(char *); // Start scanning the input from the string mentioned.
+int ScanFromString(const char *); // Start scanning the input from the string mentioned.
int check_EOF(int); // check if we hit a EOF abruptly
void CPPErrorToInfoLog(char *); // sticking the msg,line into the Shader's.Info.log
void SetLineNumber(int);