[waffle] [PATCH 2/2] wflinfo: Properly handle minor versions > 9
Jordan Justen
jordan.l.justen at intel.com
Tue Apr 29 08:39:19 PDT 2014
Previously -V 1.40 would be treated the same as -V 5.0.
Instead, whenever a minor version is requested greater
than 9, bump the major version, and use 0 for the minor
version.
This leads to -V 1.40 being interpreted as -V 2.0.
Alternatively, we might treat minor versions greater
than 9 as an error.
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
src/utils/wflinfo.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
index 386bdd0..982311d 100644
--- a/src/utils/wflinfo.c
+++ b/src/utils/wflinfo.c
@@ -336,6 +336,12 @@ parse_args(int argc, char *argv[], struct options *opts)
usage_error_printf("'%s' is not a valid OpenGL version",
optarg);
}
+ if (minor > 9) {
+ // If a minor version greater than 9 was requested, then
+ // bump the major version and use 0 for the minor.
+ major++;
+ minor = 0;
+ }
opts->context_version = 10 * major + minor;
break;
}
--
1.9.2
More information about the waffle
mailing list