From 63459e687ed45ec9e16842c267af33b5c77e5f00 Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Mon, 25 Dec 2017 01:42:18 +0100 Subject: [PATCH] More fixes for issues reported by Codacy --- tools/include_optimize.rb | 6 +++--- tools/miniswig/create_docu.cpp | 2 -- tools/png_recompress.sh | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tools/include_optimize.rb b/tools/include_optimize.rb index 5183da9abc3..1064b554805 100755 --- a/tools/include_optimize.rb +++ b/tools/include_optimize.rb @@ -3,7 +3,7 @@ def write_file_without_lines(source, lines, without_lines) out = File.new(source, 'w') lines.each_with_index { |v, i| - if without_lines.member? i then + if without_lines.member? i out.print "//", v else out.print v @@ -16,7 +16,7 @@ def optimize(source, target) lines = File.new(source).readlines() includes = [] lines.each_with_index { |v, i| - if v =~ /^#include/ then + if v =~ /^#include/ # puts v includes << i end @@ -29,7 +29,7 @@ def optimize(source, target) write_file_without_lines(source, lines, [i]) ret = system("scons", "-u", target) - if ret then + if ret puts "INCUNNEEDED #{source} #{lines[i].chop}" unneeded_includes << i end diff --git a/tools/miniswig/create_docu.cpp b/tools/miniswig/create_docu.cpp index d7d8d345dd9..e47788ab8a9 100644 --- a/tools/miniswig/create_docu.cpp +++ b/tools/miniswig/create_docu.cpp @@ -10,8 +10,6 @@ void DocuCreator::create_docu(Namespace* ns) { - std::string fromfile = original_file != "" ? original_file : inputfile; - writer.openTag("documentation"); writer.openTag("namespace"); writer.writeAttribute("name", ns->name); diff --git a/tools/png_recompress.sh b/tools/png_recompress.sh index 1e164464c67..5399ed893d0 100755 --- a/tools/png_recompress.sh +++ b/tools/png_recompress.sh @@ -66,8 +66,6 @@ if ! type advpng > /dev/null 2>&1; then exit 1 fi -TMPPATH="$$.png-recompress" - echo -e "Please wait, this can take a \e[1mlong\e[0m time." dooptipng() {