sanitize comments in helper.pl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/bn_mp_n_root_ex.c b/bn_mp_n_root_ex.c
index 032b440..42be929 100644
--- a/bn_mp_n_root_ex.c
+++ b/bn_mp_n_root_ex.c
@@ -43,7 +43,7 @@ int mp_n_root_ex(const mp_int *a, mp_digit b, mp_int *c, int fast)
ilog2 = mp_count_bits(a);
/*
- GCC and clang do not understand the sizeof(bla) tests and complain,
+ GCC and clang do not understand the sizeof tests and complain,
icc (the Intel compiler) seems to understand, at least it doesn't complain.
2 of 3 say these macros are necessary, so there they are.
*/
diff --git a/helper.pl b/helper.pl
index 67fec0f..4aac574 100755
--- a/helper.pl
+++ b/helper.pl
@@ -25,6 +25,12 @@ sub write_file {
return;
}
+sub sanitize_comments {
+ my($content) = @_;
+ $content =~ s{/\*(.*?)\*/}{my $x=$1; $x =~ s/\w/x/g; "/*$x*/";}egs;
+ return $content;
+}
+
sub check_source {
my @all_files = (
bsd_glob("makefile*"),
@@ -37,6 +43,7 @@ sub check_source {
my $troubles = {};
my $lineno = 1;
my $content = read_file($file);
+ $content = sanitize_comments $content;
push @{$troubles->{crlf_line_end}}, '?' if $content =~ /\r/;
for my $l (split /\n/, $content) {
push @{$troubles->{merge_conflict}}, $lineno if $l =~ /^(<<<<<<<|=======|>>>>>>>)([^<=>]|$)/;