diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2014-08-30 01:50:36 +0200 |
---|---|---|
committer | David Disseldorp <ddiss@samba.org> | 2014-08-31 21:21:13 +0200 |
commit | d86f38bef32f7446fcaab1268e7e590a836d44bb (patch) | |
tree | fb60240bc2919196db5778a038aa55bf9704f6d9 /source4/script | |
parent | b97248297c332aa15c9d30393ee498782241259e (diff) | |
download | samba-d86f38bef32f7446fcaab1268e7e590a836d44bb.tar.gz |
find_unused_macros: Remove obsolete script that finds unused macros.
There are various static checkers that can do this nowadays, with
better accuracy.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'source4/script')
-rwxr-xr-x | source4/script/find_unused_macros.pl | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/source4/script/find_unused_macros.pl b/source4/script/find_unused_macros.pl deleted file mode 100755 index 8886835fa33..00000000000 --- a/source4/script/find_unused_macros.pl +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/perl -# Script that reads in C files and prints defines that are used nowhere in the -# code - -# Arguments: C and H files -# Copyright Jelmer Vernooij <jelmer@samba.org>, GPL - -use strict; - -my %defined; -my %used; -my %files; - -my $tmp; -while($tmp = shift) { - $files{$tmp} = $tmp; - open(FI, $tmp); - my $ln = 0; - while(<FI>) { - $ln++; - my $line = $_; - my $cur = ""; - if(/^#define ([A-Za-z0-9_]+)/) { - $defined{$1} = "$tmp:$ln"; - $cur = $1; - } - - $_ = $line; - while(/([A-Za-z0-9_]+)/sgm) { - if($cur ne $1) { $used{$1} = "$tmp:$ln"; } - } - } - close FI; -} - -foreach(keys %defined) { - if(!$used{$_}) { print "$defined{$_}: Macro `$_' is unused\n"; } -} |