X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=blobdiff_plain;f=src%2Fegl%2Fegl-entrypoint-check.py;h=7cbb8a7708afc966595e74ab86dc4d8ab47ba3ec;hp=1e876615028aff0dc80c60ff049d5552b6ca4fe9;hb=351d513e30b3d09f39ee73169fc68e7cdaca1d11;hpb=04bd58ff79eba8e95f33d1feea66c10aa65fb625;ds=sidebyside 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()