Browse Source

Fix unused variables warnings

Daniel Mensinger 7 months ago
parent
commit
3581839f4c
No account linked to committer's email address

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

@@ -520,7 +520,7 @@ int dummy;
520 520
         # This will be set as dependencies of all the target's sources. At the
521 521
         # same time, also deal with generated sources that need to be compiled.
522 522
         generated_source_files = []
523
-        for rel_src, gensrc in generated_sources.items():
523
+        for rel_src, _ in generated_sources.items():
524 524
             dirpart, fnamepart = os.path.split(rel_src)
525 525
             raw_src = File(True, dirpart, fnamepart)
526 526
             if self.environment.is_source(rel_src) and not self.environment.is_header(rel_src):
@@ -585,7 +585,7 @@ int dummy;
585 585
             obj_list.append(self.generate_single_compile(target, src, 'vala', [], header_deps))
586 586
 
587 587
         # Generate compile targets for all the pre-existing sources for this target
588
-        for f, src in target_sources.items():
588
+        for _, src in target_sources.items():
589 589
             if not self.environment.is_header(src):
590 590
                 if self.environment.is_llvm_ir(src):
591 591
                     obj_list.append(self.generate_llvm_ir_compile(target, src))
@@ -912,7 +912,7 @@ int dummy;
912 912
         # Add possible java generated files to src list
913 913
         generated_sources = self.get_target_generated_sources(target)
914 914
         gen_src_list = []
915
-        for rel_src, gensrc in generated_sources.items():
915
+        for rel_src, _ in generated_sources.items():
916 916
             dirpart, fnamepart = os.path.split(rel_src)
917 917
             raw_src = File(True, dirpart, fnamepart)
918 918
             if rel_src.endswith('.java'):
@@ -1041,7 +1041,7 @@ int dummy;
1041 1041
     def generate_single_java_compile(self, src, target, compiler, args):
1042 1042
         deps = [os.path.join(self.get_target_dir(l), l.get_filename()) for l in target.link_targets]
1043 1043
         generated_sources = self.get_target_generated_sources(target)
1044
-        for rel_src, gensrc in generated_sources.items():
1044
+        for rel_src, _ in generated_sources.items():
1045 1045
             if rel_src.endswith('.java'):
1046 1046
                 deps.append(rel_src)
1047 1047
         rel_src = src.rel_to_builddir(self.build_to_src)
@@ -1227,7 +1227,7 @@ int dummy;
1227 1227
                 if len(target.install_dir) > 3 and target.install_dir[3] is True:
1228 1228
                     target.install_dir[3] = os.path.join(self.environment.get_datadir(), 'gir-1.0')
1229 1229
         # Detect gresources and add --gresources arguments for each
1230
-        for (gres, gensrc) in other_src[1].items():
1230
+        for (_, gensrc) in other_src[1].items():
1231 1231
             if isinstance(gensrc, modules.GResourceTarget):
1232 1232
                 gres_xml, = self.get_custom_target_sources(gensrc)
1233 1233
                 args += ['--gresources=' + gres_xml]

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

@@ -457,7 +457,7 @@ class Vs2010Backend(backends.Backend):
457 457
 
458 458
     def add_target_deps(self, root, target):
459 459
         target_dict = {target.get_id(): target}
460
-        for name, dep in self.get_target_deps(target_dict).items():
460
+        for _, dep in self.get_target_deps(target_dict).items():
461 461
             if dep.get_id() in self.handled_target_deps[target.get_id()]:
462 462
                 # This dependency was already handled manually.
463 463
                 continue

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

@@ -345,7 +345,7 @@ class XCodeBackend(backends.Backend):
345 345
         self.ofile.write('/* End PBXFileReference section */\n')
346 346
 
347 347
     def generate_pbx_frameworks_buildphase(self):
348
-        for tname, t in self.build.targets.items():
348
+        for _, t in self.build.targets.items():
349 349
             self.ofile.write('\n/* Begin PBXFrameworksBuildPhase section */\n')
350 350
             self.write_line('%s /* %s */ = {\n' % (t.buildphasemap['Frameworks'], 'Frameworks'))
351 351
             self.indent_level += 1
@@ -587,7 +587,7 @@ class XCodeBackend(backends.Backend):
587 587
 
588 588
     def generate_pbx_sources_build_phase(self):
589 589
         self.ofile.write('\n/* Begin PBXSourcesBuildPhase section */\n')
590
-        for name, phase_id in self.source_phase.items():
590
+        for name, _ in self.source_phase.items():
591 591
             t = self.build.targets[name]
592 592
             self.write_line('%s /* Sources */ = {' % (t.buildphasemap[name]))
593 593
             self.indent_level += 1

+ 1
- 1
mesonbuild/interpreter.py View File

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

+ 3
- 3
mesonbuild/mintro.py View File

@@ -117,11 +117,11 @@ def list_installed(installdata):
117 117
         for t in installdata.targets:
118 118
             res[os.path.join(installdata.build_dir, t.fname)] = \
119 119
                 os.path.join(installdata.prefix, t.outdir, os.path.basename(t.fname))
120
-        for path, installpath, unused_prefix in installdata.data:
120
+        for path, installpath, _ in installdata.data:
121 121
             res[path] = os.path.join(installdata.prefix, installpath)
122
-        for path, installdir, unused_custom_install_mode in installdata.headers:
122
+        for path, installdir, _ in installdata.headers:
123 123
             res[path] = os.path.join(installdata.prefix, installdir, os.path.basename(path))
124
-        for path, installpath, unused_custom_install_mode in installdata.man:
124
+        for path, installpath, _ in installdata.man:
125 125
             res[path] = os.path.join(installdata.prefix, installpath)
126 126
     return res
127 127
 

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

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

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

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

+ 1
- 1
run_project_tests.py View File

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

+ 1
- 1
run_tests.py View File

@@ -136,7 +136,7 @@ def find_vcxproj_with_target(builddir, target):
136 136
         p = r'<TargetName>{}</TargetName>\s*<TargetExt>\{}</TargetExt>'.format(t, ext)
137 137
     else:
138 138
         p = r'<TargetName>{}</TargetName>'.format(t)
139
-    for root, dirs, files in os.walk(builddir):
139
+    for _, _, files in os.walk(builddir):
140 140
         for f in fnmatch.filter(files, '*.vcxproj'):
141 141
             f = os.path.join(builddir, f)
142 142
             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():
132 132
     # The python module uses an older build system format and is not easily parseable.
133 133
     # We add the python module libraries manually.
134 134
     modules.append(Module('python', 'Python', ['boost_python', 'boost_python3', 'boost_numpy', 'boost_numpy3']))
135
-    for (root, dirs, files) in os.walk(LIBS):
135
+    for (root, _, files) in os.walk(LIBS):
136 136
         for f in files:
137 137
             if f == "libraries.json":
138 138
                 projectdir = os.path.dirname(root)

Loading…
Cancel
Save