diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2017-05-17 04:56:59 -0400 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2017-05-17 04:56:59 -0400 |
commit | f8fe9939e4e97aac2c1199cfcc88276d1a571c77 (patch) | |
tree | 1829f7c335c783ac64ba0b8c9e932f331259721d | |
parent | ea636fcd518f69c52e2a2753c5802e2bae66ab0d (diff) | |
download | meson-f8fe9939e4e97aac2c1199cfcc88276d1a571c77.zip meson-f8fe9939e4e97aac2c1199cfcc88276d1a571c77.tar.gz meson-f8fe9939e4e97aac2c1199cfcc88276d1a571c77.tar.bz2 |
Avoid shadowing outer variables.
Though actually, just rename them into something clearer.
-rw-r--r-- | mesonbuild/compilers.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index a325600..97a1064 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -51,8 +51,8 @@ c_suffixes = lang_suffixes['c'] + ('h',) # used in build.py:process_compilers() and build.py:get_dynamic_linker() clike_langs = ('objcpp', 'objc', 'd', 'cpp', 'c', 'fortran',) clike_suffixes = () -for l in clike_langs: - clike_suffixes += lang_suffixes[l] +for _l in clike_langs: + clike_suffixes += lang_suffixes[_l] clike_suffixes += ('h', 'll', 's') # All these are only for C-like languages; see `clike_langs` above. @@ -1017,31 +1017,31 @@ class CCompiler(Compiler): int main() {{ static int a[1-2*!({expression})]; a[0]=0; return 0; }}''' return self.compiles(t.format(**fargs), env, extra_args, dependencies) - def cross_compute_int(self, expression, l, h, guess, prefix, env, extra_args, dependencies): + def cross_compute_int(self, expression, low, high, guess, prefix, env, extra_args, dependencies): if isinstance(guess, int): if self._compile_int('%s == %d' % (expression, guess), prefix, env, extra_args, dependencies): return guess - cur = l - while l < h: - cur = int((l + h) / 2) - if cur == l: + cur = low + while low < high: + cur = int((low + high) / 2) + if cur == low: break if self._compile_int('%s >= %d' % (expression, cur), prefix, env, extra_args, dependencies): - l = cur + low = cur else: - h = cur + high = cur if self._compile_int('%s == %d' % (expression, cur), prefix, env, extra_args, dependencies): return cur raise EnvironmentException('Cross-compile check overflowed') - def compute_int(self, expression, l, h, guess, prefix, env, extra_args=None, dependencies=None): + def compute_int(self, expression, low, high, guess, prefix, env, extra_args=None, dependencies=None): if extra_args is None: extra_args = [] if self.is_cross: - return self.cross_compute_int(expression, l, h, guess, prefix, env, extra_args, dependencies) + return self.cross_compute_int(expression, low, high, guess, prefix, env, extra_args, dependencies) fargs = {'prefix': prefix, 'expression': expression} t = '''#include<stdio.h> {prefix} |