Merge pull request #2070 from mesonbuild/lgtmfixex

Static analyzer fixes
pull/2073/head
Jussi Pakkanen 8 years ago committed by GitHub
commit f77c3176ab
  1. 1
      mesonbuild/backend/xcodebackend.py
  2. 1
      mesonbuild/dependencies/ui.py
  3. 24
      mesonbuild/interpreter.py
  4. 2
      mesonbuild/scripts/depfixer.py
  5. 1
      mesonbuild/scripts/vcstagger.py
  6. 1
      tools/ac_converter.py
  7. 1
      tools/cmake2meson.py

@ -483,7 +483,6 @@ class XCodeBackend(backends.Backend):
% (self.buildconflistmap[tname], tname)) % (self.buildconflistmap[tname], tname))
self.write_line('buildPhases = (') self.write_line('buildPhases = (')
self.indent_level += 1 self.indent_level += 1
t = self.build.targets[tname]
for bpname, bpval in t.buildphasemap.items(): for bpname, bpval in t.buildphasemap.items():
self.write_line('%s /* %s yyy */,' % (bpval, bpname)) self.write_line('%s /* %s yyy */,' % (bpval, bpname))
self.indent_level -= 1 self.indent_level -= 1

@ -390,7 +390,6 @@ class SDL2Dependency(ExternalDependency):
return return
except Exception as e: except Exception as e:
mlog.debug('SDL 2 not found via pkgconfig. Trying next, error was:', str(e)) mlog.debug('SDL 2 not found via pkgconfig. Trying next, error was:', str(e))
pass
if DependencyMethods.SDLCONFIG in self.methods: if DependencyMethods.SDLCONFIG in self.methods:
sdlconf = shutil.which('sdl2-config') sdlconf = shutil.which('sdl2-config')
if sdlconf: if sdlconf:

@ -2007,9 +2007,6 @@ class Interpreter(InterpreterBase):
raise DependencyException(m.format(name)) raise DependencyException(m.format(name))
dep = cached_dep dep = cached_dep
else: else:
# We need to actually search for this dep
exception = None
dep = None
# If the dependency has already been configured, possibly by # If the dependency has already been configured, possibly by
# a higher level project, try to use it first. # a higher level project, try to use it first.
if 'fallback' in kwargs: if 'fallback' in kwargs:
@ -2022,13 +2019,15 @@ class Interpreter(InterpreterBase):
except KeyError: except KeyError:
pass pass
# We need to actually search for this dep
exception = None
dep = None
# Search for it outside the project # Search for it outside the project
if not dep: try:
try: dep = dependencies.find_external_dependency(name, self.environment, kwargs)
dep = dependencies.find_external_dependency(name, self.environment, kwargs) except DependencyException as e:
except DependencyException as e: exception = e
exception = e
pass
# Search inside the projects list # Search inside the projects list
if not dep or not dep.found(): if not dep or not dep.found():
@ -2809,11 +2808,8 @@ different subdirectory.
found = self.check_contains(element, args) found = self.check_contains(element, args)
if found: if found:
return True return True
try: if element == item:
if element == item: return True
return True
except Exception:
pass
return False return False
def is_subproject(self): def is_subproject(self):

@ -337,7 +337,7 @@ def run(args):
print('This application resets target rpath.') print('This application resets target rpath.')
print('Don\'t run this unless you know what you are doing.') print('Don\'t run this unless you know what you are doing.')
print('%s: <binary file> <prefix>' % sys.argv[0]) print('%s: <binary file> <prefix>' % sys.argv[0])
exit(1) sys.exit(1)
with Elf(args[0]) as e: with Elf(args[0]) as e:
if len(args) == 1: if len(args) == 1:
e.print_rpath() e.print_rpath()

@ -36,6 +36,7 @@ def run(args):
infile, outfile, fallback, source_dir, replace_string, regex_selector = args[0:6] infile, outfile, fallback, source_dir, replace_string, regex_selector = args[0:6]
command = args[6:] command = args[6:]
config_vcs_tag(infile, outfile, fallback, source_dir, replace_string, regex_selector, command) config_vcs_tag(infile, outfile, fallback, source_dir, replace_string, regex_selector, command)
return 0
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(run(sys.argv[1:])) sys.exit(run(sys.argv[1:]))

@ -39,7 +39,6 @@ function_data = \
'HAVE_POSIX_MEMALIGN': ('posix_memalign', 'stdlib.h'), 'HAVE_POSIX_MEMALIGN': ('posix_memalign', 'stdlib.h'),
'HAVE_SIGACTION': ('sigaction', 'signal.h'), 'HAVE_SIGACTION': ('sigaction', 'signal.h'),
'HAVE_ALARM': ('alarm', 'unistd.h'), 'HAVE_ALARM': ('alarm', 'unistd.h'),
'HAVE_CLOCK_GETTIME': ('clock_gettime', 'time.h'),
'HAVE_CTIME_R': ('ctime_r', 'time.h'), 'HAVE_CTIME_R': ('ctime_r', 'time.h'),
'HAVE_DRAND48': ('drand48', 'stdlib.h'), 'HAVE_DRAND48': ('drand48', 'stdlib.h'),
'HAVE_FLOCKFILE': ('flockfile', 'stdio.h'), 'HAVE_FLOCKFILE': ('flockfile', 'stdio.h'),

@ -74,7 +74,6 @@ class Lexer:
lineno += 1 lineno += 1
col = 1 col = 1
line_start = mo.end() line_start = mo.end()
pass
elif tid == 'varexp': elif tid == 'varexp':
yield(Token('varexp', match_text[2:-1])) yield(Token('varexp', match_text[2:-1]))
else: else:

Loading…
Cancel
Save