From ebc3e7d639a0f7a024e218ac3887b6fdc7f0da49 Mon Sep 17 00:00:00 2001 From: Abdullah Sowayan Date: Thu, 31 May 2007 03:16:02 +0000 Subject: Thu May 31 03:12:50 UTC 2007 Abdullah Sowayan --- ACE/ChangeLog | 7 +++++++ ACE/bin/fuzz.pl | 30 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 25d9cac7efb..0cce2f8d5d9 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,10 @@ +Thu May 31 03:12:50 UTC 2007 Abdullah Sowayan + + * bin/fuzz.pl: + + Tabs shouldn't be used as per ACE/TAO/CIAO coding guidlines. + Extended fuzz to detect tabs in the source code. + Wed May 30 00:17:35 UTC 2007 Abdullah Sowayan * ace/config-macros.h: diff --git a/ACE/bin/fuzz.pl b/ACE/bin/fuzz.pl index f883e625804..dc763c522a3 100755 --- a/ACE/bin/fuzz.pl +++ b/ACE/bin/fuzz.pl @@ -287,6 +287,34 @@ sub check_for_noncvs_files () } } +# This test checks for the use of tabs, spaces should be used instead of tabs +sub check_for_tab () +{ + print "Running tabs check\n"; + foreach $file (@files_cpp, @files_inl, @files_h, @files_idl) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while () { + ++$line; + if (/FUZZ\: disable check_for_tab/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_tab/) { + $disable = 0; + } + if ($disable == 0 and m/^\s*\t/) { + print_error ("$file:$.: tab found"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + # This test checks for the use of "inline" instead of ACE_INLINE sub check_for_inline () @@ -1264,6 +1292,7 @@ if (!getopts ('cdhl:t:mv') || $opt_h) { check_for_inline_in_cpp check_for_id_string check_for_newline + check_for_tab check_for_inline check_for_math_include check_for_line_length @@ -1320,6 +1349,7 @@ check_for_makefile_variable () if ($opt_l >= 1); check_for_inline_in_cpp () if ($opt_l >= 2); check_for_id_string () if ($opt_l >= 1); check_for_newline () if ($opt_l >= 1); +check_for_tab() if ($opt_l >= 1); check_for_inline () if ($opt_l >= 2); check_for_math_include () if ($opt_l >= 3); check_for_synch_include () if ($opt_l >= 6); -- cgit v1.2.1