From 65b37c5221809b98b025d7c092aadc7d995906f6 Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 17 Mar 2018 17:33:00 +0000 Subject: [PATCH] Tidy headers fix. --- tools/tidyHeaders.sh | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/tools/tidyHeaders.sh b/tools/tidyHeaders.sh index cc88a52..fc3ee25 100755 --- a/tools/tidyHeaders.sh +++ b/tools/tidyHeaders.sh @@ -119,20 +119,10 @@ function cleanHeader($headerFile) } echo "\t- $line"; } - - if (!in_array($line, $lines)) + else if (!in_array($line, $lines)) { $functions[] = $line; } - else - { - if (!$hasChanges) - { - echo "$headerFile\n"; - $hasChanges = true; - } - echo "\t- $line"; - } } preg_match($struct_pattern, $line, $matches); @@ -154,20 +144,10 @@ function cleanHeader($headerFile) } echo "\t- $line"; } - - if (!in_array($line, $lines)) + else if (!in_array($line, $lines)) { $structs[] = $line; } - else - { - if (!$hasChanges) - { - echo "$headerFile\n"; - $hasChanges = true; - } - echo "\t- $line"; - } } preg_match($define_pattern, $line, $matches); @@ -189,20 +169,10 @@ function cleanHeader($headerFile) } echo "\t- $line"; } - - if (!in_array($line, $lines)) + else if (!in_array($line, $lines)) { $defines[] = $line; } - else - { - if (!$hasChanges) - { - echo "$headerFile\n"; - $hasChanges = true; - } - echo "\t- $line"; - } } } @@ -230,7 +200,7 @@ function recurseDir($dir) { recurseDir("$dir/$file"); } - else if (strstr($file, ".h") !== FALSE && strstr($file, "main.h") === FALSE && && strstr($file, "savepng") === FALSE) + else if (strstr($file, ".h") !== FALSE && strstr($file, "main.h") === FALSE && strstr($file, "savepng") === FALSE) { cleanHeader("$dir/$file"); }