Browse Source

Fix unused variables warnings

tags/0.51.0
Daniel Mensinger 1 year ago
parent
commit
3581839f4c
No known key found for this signature in database GPG Key ID: 54DD94C131E277D4
10 changed files with 17 additions and 17 deletions
  1. +5
    -5
      mesonbuild/backend/ninjabackend.py
  2. +1
    -1
      mesonbuild/backend/vs2010backend.py
  3. +2
    -2
      mesonbuild/backend/xcodebackend.py
  4. +1
    -1
      mesonbuild/interpreter.py
  5. +3
    -3
      mesonbuild/mintro.py
  6. +1
    -1
      mesonbuild/scripts/depfixer.py
  7. +1
    -1
      mesonbuild/wrap/wrap.py
  8. +1
    -1
      run_project_tests.py
  9. +1
    -1
      run_tests.py
  10. +1
    -1
      tools/boost_names.py

+ 5
- 5
mesonbuild/backend/ninjabackend.py View File

@@ -520,7 +520,7 @@ int dummy;
# This will be set as dependencies of all the target's sources. At the
# same time, also deal with generated sources that need to be compiled.
generated_source_files = []
for rel_src, gensrc in generated_sources.items():
for rel_src, _ in generated_sources.items():
dirpart, fnamepart = os.path.split(rel_src)
raw_src = File(True, dirpart, fnamepart)
if self.environment.is_source(rel_src) and not self.environment.is_header(rel_src):
@@ -585,7 +585,7 @@ int dummy;
obj_list.append(self.generate_single_compile(target, src, 'vala', [], header_deps))

# Generate compile targets for all the pre-existing sources for this target
for f, src in target_sources.items():
for _, src in target_sources.items():
if not self.environment.is_header(src):
if self.environment.is_llvm_ir(src):
obj_list.append(self.generate_llvm_ir_compile(target, src))
@@ -912,7 +912,7 @@ int dummy;
# Add possible java generated files to src list
generated_sources = self.get_target_generated_sources(target)
gen_src_list = []
for rel_src, gensrc in generated_sources.items():
for rel_src, _ in generated_sources.items():
dirpart, fnamepart = os.path.split(rel_src)
raw_src = File(True, dirpart, fnamepart)
if rel_src.endswith('.java'):
@@ -1041,7 +1041,7 @@ int dummy;
def generate_single_java_compile(self, src, target, compiler, args):
deps = [os.path.join(self.get_target_dir(l), l.get_filename()) for l in target.link_targets]
generated_sources = self.get_target_generated_sources(target)
for rel_src, gensrc in generated_sources.items():
for rel_src, _ in generated_sources.items():
if rel_src.endswith('.java'):
deps.append(rel_src)
rel_src = src.rel_to_builddir(self.build_to_src)
@@ -1227,7 +1227,7 @@ int dummy;
if len(target.install_dir) > 3 and target.install_dir[3] is True:
target.install_dir[3] = os.path.join(self.environment.get_datadir(), 'gir-1.0')
# Detect gresources and add --gresources arguments for each
for (gres, gensrc) in other_src[1].items():
for (_, gensrc) in other_src[1].items():
if isinstance(gensrc, modules.GResourceTarget):
gres_xml, = self.get_custom_target_sources(gensrc)
args += ['--gresources=' + gres_xml]


+ 1
- 1
mesonbuild/backend/vs2010backend.py View File

@@ -457,7 +457,7 @@ class Vs2010Backend(backends.Backend):

def add_target_deps(self, root, target):
target_dict = {target.get_id(): target}
for name, dep in self.get_target_deps(target_dict).items():
for _, dep in self.get_target_deps(target_dict).items():
if dep.get_id() in self.handled_target_deps[target.get_id()]:
# This dependency was already handled manually.
continue


+ 2
- 2
mesonbuild/backend/xcodebackend.py View File

@@ -345,7 +345,7 @@ class XCodeBackend(backends.Backend):
self.ofile.write('/* End PBXFileReference section */\n')

def generate_pbx_frameworks_buildphase(self):
for tname, t in self.build.targets.items():
for _, t in self.build.targets.items():
self.ofile.write('\n/* Begin PBXFrameworksBuildPhase section */\n')
self.write_line('%s /* %s */ = {\n' % (t.buildphasemap['Frameworks'], 'Frameworks'))
self.indent_level += 1
@@ -587,7 +587,7 @@ class XCodeBackend(backends.Backend):

def generate_pbx_sources_build_phase(self):
self.ofile.write('\n/* Begin PBXSourcesBuildPhase section */\n')
for name, phase_id in self.source_phase.items():
for name, _ in self.source_phase.items():
t = self.build.targets[name]
self.write_line('%s /* Sources */ = {' % (t.buildphasemap[name]))
self.indent_level += 1


+ 1
- 1
mesonbuild/interpreter.py View File

@@ -2193,7 +2193,7 @@ class Interpreter(InterpreterBase):
def check_cross_stdlibs(self):
if self.build.environment.is_cross_build():
props = self.build.environment.properties.host
for l, c in self.build.cross_compilers.items():
for l, _ in self.build.cross_compilers.items():
try:
di = mesonlib.stringlistify(props.get_stdlib(l))
if len(di) != 2:


+ 3
- 3
mesonbuild/mintro.py View File

@@ -117,11 +117,11 @@ def list_installed(installdata):
for t in installdata.targets:
res[os.path.join(installdata.build_dir, t.fname)] = \
os.path.join(installdata.prefix, t.outdir, os.path.basename(t.fname))
for path, installpath, unused_prefix in installdata.data:
for path, installpath, _ in installdata.data:
res[path] = os.path.join(installdata.prefix, installpath)
for path, installdir, unused_custom_install_mode in installdata.headers:
for path, installdir, _ in installdata.headers:
res[path] = os.path.join(installdata.prefix, installdir, os.path.basename(path))
for path, installpath, unused_custom_install_mode in installdata.man:
for path, installpath, _ in installdata.man:
res[path] = os.path.join(installdata.prefix, installpath)
return res



+ 1
- 1
mesonbuild/scripts/depfixer.py View File

@@ -180,7 +180,7 @@ class Elf(DataSizes):
def parse_sections(self):
self.bf.seek(self.e_shoff)
self.sections = []
for i in range(self.e_shnum):
for _ in range(self.e_shnum):
self.sections.append(SectionHeader(self.bf, self.ptrsize, self.is_le))

def read_str(self):


+ 1
- 1
mesonbuild/wrap/wrap.py View File

@@ -338,7 +338,7 @@ class Resolver:
"""
Copy directory tree. Overwrites also read only files.
"""
for src_dir, dirs, files in os.walk(root_src_dir):
for src_dir, _, files in os.walk(root_src_dir):
dst_dir = src_dir.replace(root_src_dir, root_dst_dir, 1)
if not os.path.exists(dst_dir):
os.makedirs(dst_dir)


+ 1
- 1
run_project_tests.py View File

@@ -819,7 +819,7 @@ if __name__ == '__main__':
print(l, '\n')
except UnicodeError:
print(l.encode('ascii', errors='replace').decode(), '\n')
for name, dirs, skip in all_tests:
for name, dirs, _ in all_tests:
dirs = (x.name for x in dirs)
for k, g in itertools.groupby(dirs, key=lambda x: x.split()[0]):
tests = list(g)


+ 1
- 1
run_tests.py View File

@@ -136,7 +136,7 @@ def find_vcxproj_with_target(builddir, target):
p = r'<TargetName>{}</TargetName>\s*<TargetExt>\{}</TargetExt>'.format(t, ext)
else:
p = r'<TargetName>{}</TargetName>'.format(t)
for root, dirs, files in os.walk(builddir):
for _, _, files in os.walk(builddir):
for f in fnmatch.filter(files, '*.vcxproj'):
f = os.path.join(builddir, f)
with open(f, 'r', encoding='utf-8') as o:


+ 1
- 1
tools/boost_names.py View File

@@ -132,7 +132,7 @@ def get_modules_2():
# The python module uses an older build system format and is not easily parseable.
# We add the python module libraries manually.
modules.append(Module('python', 'Python', ['boost_python', 'boost_python3', 'boost_numpy', 'boost_numpy3']))
for (root, dirs, files) in os.walk(LIBS):
for (root, _, files) in os.walk(LIBS):
for f in files:
if f == "libraries.json":
projectdir = os.path.dirname(root)


Loading…
Cancel
Save