From 906aec0df58c9b0fb411edca1934e7263e5d339f Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 26 Dec 2021 13:30:57 -0500 Subject: [PATCH] ac_converter: use better style for header check iteration underscorifying and upper casing the header name is superior to duplicating it. --- tools/ac_converter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/ac_converter.py b/tools/ac_converter.py index c3b954c43..f2a559988 100755 --- a/tools/ac_converter.py +++ b/tools/ac_converter.py @@ -382,7 +382,7 @@ with open(sys.argv[1], encoding='utf-8') as f: tarr = token.split('_')[1:-1] tarr = [x.lower() for x in tarr] hname = '/'.join(tarr) + '.h' - headers.append((token, hname)) + headers.append(hname) # Check for functions. try: @@ -413,13 +413,13 @@ cdata = configuration_data()''') # Convert header checks. print('check_headers = [') -for token, hname in headers: - print(f" ['{token}', '{hname}'],") +for hname in headers: + print(f" '{hname}',") print(']\n') print('''foreach h : check_headers - if cc.has_header(h.get(1)) - cdata.set(h.get(0), 1) + if cc.has_header(h) + cdata.set('HAVE_' + h.underscorify().to_upper(), 1) endif endforeach ''')