diff options
author | Mathieu Bridon <[email protected]> | 2018-06-27 12:37:38 +0200 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2018-07-05 12:52:12 +0100 |
commit | fe8a153648f98c6dfbb621f31c212253c06f9467 (patch) | |
tree | 78b15537997acfd893d35997dd62183516fc0818 /src/mapi/glapi/gen | |
parent | d337713ec4f94d5dde101c879fda9c6332a074c3 (diff) |
python: Stabilize some script outputs
In Python, dictionaries and sets are unordered, and as a result their
is no guarantee that running this script twice will produce the same
output.
Using ordered dicts and explicitly sorting items makes the build more
reproducible, and will make it possible to verify that we're not
breaking anything when we move the build scripts to Python 3.
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/mapi/glapi/gen')
-rw-r--r-- | src/mapi/glapi/gen/glX_proto_size.py | 2 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_XML.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/mapi/glapi/gen/glX_proto_size.py b/src/mapi/glapi/gen/glX_proto_size.py index e16dbab3e09..8dbb0af86d7 100644 --- a/src/mapi/glapi/gen/glX_proto_size.py +++ b/src/mapi/glapi/gen/glX_proto_size.py @@ -191,7 +191,7 @@ class glx_enum_function(object): print ' switch( e ) {' - for c in self.count: + for c in sorted(self.count): for e in self.count[c]: first = 1 diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py index a5320e90a1d..1bab5fee51f 100644 --- a/src/mapi/glapi/gen/gl_XML.py +++ b/src/mapi/glapi/gen/gl_XML.py @@ -24,6 +24,7 @@ # Authors: # Ian Romanick <[email protected]> +from collections import OrderedDict from decimal import Decimal import xml.etree.ElementTree as ET import re, sys, string @@ -861,7 +862,7 @@ class gl_item_factory(object): class gl_api(object): def __init__(self, factory): - self.functions_by_name = {} + self.functions_by_name = OrderedDict() self.enums_by_name = {} self.types_by_name = {} |