Skip to content

Commit 3ef6efd

Browse files
minadsjaeckel
authored andcommitted
sort tommath_class.h dependencies: this makes it easier to see changes
1 parent 7eb6f32 commit 3ef6efd

File tree

2 files changed

+350
-342
lines changed

2 files changed

+350
-342
lines changed

helper.pl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ sub update_dep
314314

315315
print "Processing $filename\n";
316316

317-
# convert filename to upper case so we can use it as a define
317+
# convert filename to upper case so we can use it as a define
318318
$define =~ tr/[a-z]/[A-Z]/;
319319
$define =~ tr/\./_/;
320320
print {$class} "# define $define\n";
@@ -339,7 +339,7 @@ sub update_dep
339339
$apply = 1;
340340
}
341341
while (<$src>) {
342-
if (!($_ =~ /tommath\.h/)) {
342+
if ($_ !~ /tommath\.h/) {
343343
print {$out} $_;
344344
}
345345
}
@@ -378,17 +378,22 @@ sub update_dep
378378
$content =~ s{/\*.*?\*/}{}gs;
379379

380380
# scan for mp_* and make classes
381+
my @deps = ();
381382
foreach my $line (split /\n/, $content) {
382383
while ($line =~ /(fast_)?(s_)?mp\_[a-z_0-9]*(?=\()|(?<=\()mp\_[a-z_0-9]*(?=,)/g) {
383384
my $a = $&;
384385
next if $a eq "mp_err";
385386
$a =~ tr/[a-z]/[A-Z]/;
386387
$a = 'BN_' . $a . '_C';
387-
if (!($list =~ /$a/)) {
388-
print {$class} "# define $a\n";
389-
}
390-
$list = $list . ',' . $a;
388+
push @deps, $a;
389+
}
390+
}
391+
@deps = sort(@deps);
392+
foreach my $a (@deps) {
393+
if ($list !~ /$a/) {
394+
print {$class} "# define $a\n";
391395
}
396+
$list = $list . ',' . $a;
392397
}
393398
$depmap{$filename} = $list;
394399

0 commit comments

Comments
 (0)