aboutsummaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi/gen/glX_proto_size.py
Commit message (Collapse)AuthorAgeFilesLines
* python: Better sort dictionary keys/valuesMathieu Bridon2018-07-241-4/+2
| | | | | | | | | | | | | | | | | | | In Python 2, dict.keys() and dict.values() both return a list, which can be sorted in two ways: * l.sort() modifies the list in-place; * sorted(l) returns a new, sorted list; In Python 3, dict.keys() and dict.values() do not return lists any more, but iterators. Iterators do not have a .sort() method. This commit moves the build scripts to using sorted() on dict keys and values, which makes them compatible with both Python 2 and Python 3. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* python: Better check for keys in dictsMathieu Bridon2018-07-241-9/+9
| | | | | | | | | | | | Python 3 lost the dict.has_key() method. Instead it requires using the "in" operator. This is also compatible with Python 2. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* python: Use spaces, not tabsMathieu Bridon2018-07-061-4/+4
| | | | | | | | | Python 3 doesn't allow mixing spaces and tabs in a script, contrarily to Python 2. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* python: Use the print functionMathieu Bridon2018-07-061-115/+117
| | | | | | | | | | | | In Python 2, `print` was a statement, but it became a function in Python 3. Using print functions everywhere makes the script compatible with Python versions >= 2.6, including Python 3. Signed-off-by: Mathieu Bridon <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Dylan Baker <[email protected]>
* python: Stabilize some script outputsMathieu Bridon2018-07-051-1/+1
| | | | | | | | | | | | 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]>
* mapi/gen: remove shebang from python scriptsEmil Velikov2017-03-101-1/+0
| | | | | | | | All of those should be executed $PYTHON2/python2 [or equivalent] hence why they are missing the execute bit. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa: make use of HAVE_FUNC_ATTRIBUTE_ALIAS macroEmil Velikov2017-01-181-8/+2
| | | | | | | | | | | We must make sure that xserver has an equivalent one-line change to its configure.ac as the glx/glapi headers get copied over. Then again, xserver does _not_ seem to set HAVE_ALIAS to begin with so one might want to look into that first. Cc: Adam Jackson <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* glapi: Harden GLX request size processing (v2)Adam Jackson2016-05-171-13/+11
| | | | | | | v2: Use == not is for equality testing (Dylan Baker) Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* glapi: glX_proto_size.py: use a main functionDylan Baker2015-05-221-1/+6
| | | | | Signed-off-by: Dylan Baker <[email protected]> Acked-by: Matt Turner <[email protected]>
* glapi: glX_proto_size.py: use argparse instead of getoptDylan Baker2015-05-221-45/+45
| | | | | | | | | | This is roughly equivalent to the original getopt, except that it removes the '-h' short option, which argparse reserves for auto-generated help messages. It does retain the long option specified by the getopt version, and changes the makefile to use that. Signed-off-by: Dylan Baker <[email protected]> Acked-by: Matt Turner <[email protected]>
* Fix a few typosZoë Blade2015-04-271-1/+1
| | | | Reviewed-by: Francisco Jerez <[email protected]>
* glapi: use new-style Python classes.Paul Berry2012-10-161-1/+1
| | | | | | | | | | | | | | | | | An unfortunate quirk of Python 2 is that there are two types of classes: "classic" classes (which are backward compatible with some unfortunate design decisions made early in Python's history), and "new-style" classes. Classic classes have a number of limitations (for example they don't support super()) and are unavailable in Python 3. There's really no reason to use classic classes, except in unmaintained legacy code. For more information see http://www.python.org/download/releases/2.2.3/descrintro/. This patch upgrades the Python code in src/mapi/glapi/gen to use exclusively new-style classes. Tested-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Reformat python code generation scripts to use 4-space indentation.Paul Berry2012-10-101-569/+569
| | | | | | | | | | | | This brings us into accordance with the official Python style guide (http://www.python.org/dev/peps/pep-0008/#indentation). To preserve the indentation of the c code that is generated by these scripts, I've avoided re-indenting triple-quoted strings (unless those strings appear to be docstrings). Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi/glx: For GLX code, use the existing _X_HIDDEN and _X_INTERNAL definesIan Romanick2011-12-131-10/+9
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* glapi: fix generator scripts w.r.t. GLX_USE_APPLEGLBrian Paul2010-05-111-1/+1
| | | | | Commit 80b280db883edc9550484dba03bd5c124b6a9bf9 changed the .c files instead of the .py generator scripts.
* glapi: Move to src/mapi/.Chia-I Wu2010-05-071-0/+704
Move glapi to src/mapi/{glapi,es1api,es2api}.