Commit fe9a8189f82005a377e8bb17f87d946992bdd401

Daniel Mendler 2019-05-07T10:56:13

sanitize comments in helper.pl

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 =~ /^(<<<<<<<|=======|>>>>>>>)([^<=>]|$)/;