Mesa (master): egl/entrypoint-check: split sort-check into a function

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Aug 8 14:02:47 UTC 2020


Module: Mesa
Branch: master
Commit: 351d513e30b3d09f39ee73169fc68e7cdaca1d11
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=351d513e30b3d09f39ee73169fc68e7cdaca1d11

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Fri Apr  3 12:23:27 2020 +0200

egl/entrypoint-check: split sort-check into a function

Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4448>

---

 src/egl/egl-entrypoint-check.py | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/src/egl/egl-entrypoint-check.py b/src/egl/egl-entrypoint-check.py
index 1e876615028..7cbb8a7708a 100644
--- a/src/egl/egl-entrypoint-check.py
+++ b/src/egl/egl-entrypoint-check.py
@@ -5,6 +5,21 @@ import argparse
 PREFIX = 'EGL_ENTRYPOINT('
 SUFFIX = ')'
 
+
+def check_entrypoint_sorted(entrypoints):
+    print('Checking that EGL API entrypoints are sorted...')
+
+    for i, _ in enumerate(entrypoints):
+        # Can't compare the first one with the previous
+        if i == 0:
+            continue
+        if entrypoints[i - 1] > entrypoints[i]:
+            print('ERROR: ' + entrypoints[i] + ' should come before ' + entrypoints[i - 1])
+            exit(1)
+
+    print('All good :)')
+
+
 def main():
     parser = argparse.ArgumentParser()
     parser.add_argument('header')
@@ -20,17 +35,7 @@ def main():
             assert line.endswith(SUFFIX)
             entrypoints.append(line[len(PREFIX):-len(SUFFIX)])
 
-    print('Checking EGL API entrypoints are sorted')
-
-    for i, _ in enumerate(entrypoints):
-        # Can't compare the first one with the previous
-        if i == 0:
-            continue
-        if entrypoints[i - 1] > entrypoints[i]:
-            print('ERROR: ' + entrypoints[i] + ' should come before ' + entrypoints[i - 1])
-            exit(1)
-
-    print('All good :)')
+    check_entrypoint_sorted(entrypoints)
 
 if __name__ == '__main__':
     main()



More information about the mesa-commit mailing list