Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: openssl/util/ck_errf.pl

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « openssl/util/arx.pl ('k') | openssl/util/clean-depend.pl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/local/bin/perl 1 #!/usr/local/bin/perl
2 # 2 #
3 # This is just a quick script to scan for cases where the 'error' 3 # This is just a quick script to scan for cases where the 'error'
4 # function name in a XXXerr() macro is wrong. 4 # function name in a XXXerr() macro is wrong.
5 # 5 #
6 # Run in the top level by going 6 # Run in the top level by going
7 # perl util/ck_errf.pl */*.c */*/*.c 7 # perl util/ck_errf.pl */*.c */*/*.c
8 # 8 #
9 9
10 my $err_strict = 0;
11 my $bad = 0;
12
10 foreach $file (@ARGV) 13 foreach $file (@ARGV)
11 { 14 {
15 if ($file eq "-strict")
16 {
17 $err_strict = 1;
18 next;
19 }
12 open(IN,"<$file") || die "unable to open $file\n"; 20 open(IN,"<$file") || die "unable to open $file\n";
13 $func=""; 21 $func="";
14 while (<IN>) 22 while (<IN>)
15 { 23 {
16 if (!/;$/ && /^([a-zA-Z].*[\s*])?([A-Za-z_0-9]+)\(.*[),]/) 24 if (!/;$/ && /^([a-zA-Z].*[\s*])?([A-Za-z_0-9]+)\(.*[),]/)
17 { 25 {
18 /^([^()]*(\([^()]*\)[^()]*)*)\(/; 26 /^([^()]*(\([^()]*\)[^()]*)*)\(/;
19 $1 =~ /([A-Za-z_0-9]*)$/; 27 $1 =~ /([A-Za-z_0-9]*)$/;
20 $func = $1; 28 $func = $1;
21 $func =~ tr/A-Z/a-z/; 29 $func =~ tr/A-Z/a-z/;
22 } 30 }
23 » » if (/([A-Z0-9]+)err\(([^,]+)/) 31 » » if (/([A-Z0-9]+)err\(([^,]+)/ && ! /ckerr_ignore/)
24 { 32 {
25 $errlib=$1; 33 $errlib=$1;
26 $n=$2; 34 $n=$2;
27 35
28 if ($func eq "") 36 if ($func eq "")
29 » » » » { print "$file:$.:???:$n\n"; next; } 37 » » » » { print "$file:$.:???:$n\n"; $bad = 1; next; }
30 38
31 if ($n !~ /([^_]+)_F_(.+)$/) 39 if ($n !~ /([^_]+)_F_(.+)$/)
32 { 40 {
33 # print "check -$file:$.:$func:$n\n"; 41 # print "check -$file:$.:$func:$n\n";
34 next; 42 next;
35 } 43 }
36 $lib=$1; 44 $lib=$1;
37 $n=$2; 45 $n=$2;
38 46
39 if ($lib ne $errlib) 47 if ($lib ne $errlib)
40 » » » » { print "$file:$.:$func:$n [${errlib}err]\n"; ne xt; } 48 » » » » { print "$file:$.:$func:$n [${errlib}err]\n"; $b ad = 1; next; }
41 49
42 $n =~ tr/A-Z/a-z/; 50 $n =~ tr/A-Z/a-z/;
43 if (($n ne $func) && ($errlib ne "SYS")) 51 if (($n ne $func) && ($errlib ne "SYS"))
44 » » » » { print "$file:$.:$func:$n\n"; next; } 52 » » » » { print "$file:$.:$func:$n\n"; $bad = 1; next; }
45 # print "$func:$1\n"; 53 # print "$func:$1\n";
46 } 54 }
47 } 55 }
48 close(IN); 56 close(IN);
49 } 57 }
50 58
59 if ($bad && $err_strict)
60 {
61 print STDERR "FATAL: error discrepancy\n";
62 exit 1;
63 }
64
OLDNEW
« no previous file with comments | « openssl/util/arx.pl ('k') | openssl/util/clean-depend.pl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698