From 238b545b862f2ac9217065ee01091129d2855361 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Tue, 30 Dec 2008 11:34:58 +0100 Subject: [PATCH] --- yaml --- r: 125437 b: refs/heads/master c: 483b41218fa9d5172312a9e294aaf78e22b266e6 h: refs/heads/master i: 125435: 0d0d87e20c418877926b4c28f97e93f4db5939ad v: v3 --- [refs] | 2 +- trunk/scripts/headers_check.pl | 47 +++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 4fdce56e1b6a..1f510247ee2c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 521b0c774d1350aac18f5cd35831469a4e879d72 +refs/heads/master: 483b41218fa9d5172312a9e294aaf78e22b266e6 diff --git a/trunk/scripts/headers_check.pl b/trunk/scripts/headers_check.pl index 72924a7fcf1e..b62c319611a2 100644 --- a/trunk/scripts/headers_check.pl +++ b/trunk/scripts/headers_check.pl @@ -34,9 +34,11 @@ $lineno = 0; while ($line = ) { $lineno++; - check_include(); - check_prototypes(); - check_config(); + &check_include(); + &check_asm_types(); + &check_sizetypes(); + &check_prototypes(); + &check_config(); } close FH; } @@ -73,3 +75,42 @@ sub check_config } } +my $linux_asm_types; +sub check_asm_types() +{ + if ($lineno == 1) { + $linux_asm_types = 0; + } elsif ($linux_asm_types >= 1) { + return; + } + if ($line =~ m/^\s*#\s*include\s+/) { + $linux_asm_types = 1; + printf STDERR "$filename:$lineno: " . + "include of is preferred over \n" + # Warn until headers are all fixed + #$ret = 1; + } +} + +my $linux_types; +sub check_sizetypes +{ + if ($lineno == 1) { + $linux_types = 0; + } elsif ($linux_types >= 1) { + return; + } + if ($line =~ m/^\s*#\s*include\s+/) { + $linux_types = 1; + return; + } + if ($line =~ m/__[us](8|16|32|64)\b/) { + printf STDERR "$filename:$lineno: " . + "found __[us]{8,16,32,64} type " . + "without #include \n"; + $linux_types = 2; + # Warn until headers are all fixed + #$ret = 1; + } +} +