Module: Mesa
Branch: main
Commit: 5c65a3a98f46b7b67506f34c7a37bcd4dd5da9fb
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5c65a3a98f46b7b67506f34c7a37bcd4dd5da9fb

Author: Marek Olšák <[email protected]>
Date:   Thu Aug 11 07:49:58 2022 -0400

gl_marshal.py: remove/simplify parameters

Acked-By: Mike Blumenkrantz <[email protected]>
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18199>

---

 src/mapi/glapi/gen/gl_marshal.py | 18 ++++--------------
 src/mapi/glapi/gen/meson.build   |  2 +-
 2 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py
index 43f70efb988..0e7eb73f857 100644
--- a/src/mapi/glapi/gen/gl_marshal.py
+++ b/src/mapi/glapi/gen/gl_marshal.py
@@ -21,7 +21,6 @@
 # IN THE SOFTWARE.
 
 import contextlib
-import getopt
 import gl_XML
 import license
 import marshal_XML
@@ -452,27 +451,18 @@ class PrintCode(gl_XML.gl_print_base):
 
 
 def show_usage():
-    print('Usage: %s [-f input_file_name]' % sys.argv[0])
+    print('Usage: %s [file_name] [file_index] [total file count]' % 
sys.argv[0])
     sys.exit(1)
 
 
 if __name__ == '__main__':
-    file_name = 'gl_API.xml'
-
     try:
-        (args, trail) = getopt.getopt(sys.argv[1:], 'm:f:i:n:')
+        file_name = sys.argv[1]
+        file_index = int(sys.argv[2])
+        file_count = int(sys.argv[3])
     except Exception:
         show_usage()
 
-    for (arg,val) in args:
-        if arg == '-f':
-            file_name = val
-        elif arg == '-i':
-            file_index = int(val)
-        elif arg == '-n':
-            file_count = int(val)
-
-    assert file_index < file_count
     printer = PrintCode()
 
     api = gl_XML.parse_GL_API(file_name, marshal_XML.marshal_item_factory())
diff --git a/src/mapi/glapi/gen/meson.build b/src/mapi/glapi/gen/meson.build
index e70fd598310..e5ecd438ad8 100644
--- a/src/mapi/glapi/gen/meson.build
+++ b/src/mapi/glapi/gen/meson.build
@@ -277,7 +277,7 @@ foreach x : ['0', '1', '2', '3', '4', '5', '6', '7']
     'marshal_generated' + x + '.c',
     input : ['gl_marshal.py', 'gl_and_es_API.xml'],
     output : 'marshal_generated' + x + '.c',
-    command : [prog_python, '@INPUT0@', '-f', '@INPUT1@', '-i', x, '-n', '8'],
+    command : [prog_python, '@INPUT0@', '@INPUT1@', x, '8'],
     depend_files : files('marshal_XML.py') + glapi_gen_depends,
     capture : true,
   )

Reply via email to