sanitize comments in helper.pl

This commit is contained in:
Daniel Mendler 2019-05-07 10:56:13 +02:00
parent 2ea04fb782
commit fe9a8189f8
No known key found for this signature in database
GPG Key ID: D88ADB2A2693CA43
2 changed files with 8 additions and 1 deletions

View File

@ -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.
*/

View File

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