summaryrefslogtreecommitdiffstats
path: root/opengl/tools/glgen/src/ParameterChecker.java
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-02-22 19:34:06 -0800
committerMathias Agopian <mathias@google.com>2013-02-25 13:28:06 -0800
commit006c792d99859341201d19f2b86886cc6ee525b4 (patch)
treec600eac8af2915a39ed2ae0ca8aaeefb8f915a2d /opengl/tools/glgen/src/ParameterChecker.java
parentf5c7cb316cc8c8e2d6ae93a659ac771420cbfa2b (diff)
downloadframeworks_native-006c792d99859341201d19f2b86886cc6ee525b4.zip
frameworks_native-006c792d99859341201d19f2b86886cc6ee525b4.tar.gz
frameworks_native-006c792d99859341201d19f2b86886cc6ee525b4.tar.bz2
add some missing parameter validation in GLES java bindings
- added support for comments in checks.spec - added most missing checks - added and commented with // special-cased functions - added and commented with # functions that are still missing validation checks - moved glGet* to a special case and updated all the "pnames" from the khronos spec - changed ifcheck to default to 1 value. this allows us to simplify the checks.spec file and handle unknown pnames automatically (they'll be validated against 1 value, if it happens to need more, the call will go through but the validation will not happen). - refactored the cpp headers in to a common header + GLES version specific header Bug: 7402895 Change-Id: Ie8fcc713188dd4819dfa55e5398e6b53ae9a14af
Diffstat (limited to 'opengl/tools/glgen/src/ParameterChecker.java')
-rw-r--r--opengl/tools/glgen/src/ParameterChecker.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/opengl/tools/glgen/src/ParameterChecker.java b/opengl/tools/glgen/src/ParameterChecker.java
index bff6d86..fbc47fb 100644
--- a/opengl/tools/glgen/src/ParameterChecker.java
+++ b/opengl/tools/glgen/src/ParameterChecker.java
@@ -22,8 +22,21 @@ public class ParameterChecker {
HashMap<String,String[]> map = new HashMap<String,String[]>();
public ParameterChecker(BufferedReader reader) throws Exception {
- String s;
- while ((s = reader.readLine()) != null) {
+ String line;
+ while ((line = reader.readLine()) != null) {
+ String s = line.trim();
+
+ // skip empty lines
+ if (s.isEmpty()) {
+ continue;
+ }
+
+ // skip single-line comments
+ if (s.startsWith("//") ||
+ s.startsWith("#")) {
+ continue;
+ }
+
String[] tokens = s.split("\\s");
map.put(tokens[0], tokens);
}