diff --git a/pp_defc.pl b/pp_defc.pl index ecd2695..3ed0da4 100644 --- a/pp_defc.pl +++ b/pp_defc.pl @@ -1,39 +1,18 @@ sub pp_defc { my ($function, %hash) = @_; $hash{GenericTypes} ||= [qw(F D)]; - my $doc = $hash{Doc} || "\n=for ref\n\nComplex version of L\n\n"; - $hash{Doc} = undef; - my $decl = delete $hash{_decl}; + $hash{Doc} ||= "\n=for ref\n\nComplex version of L\n\n"; + my $decl = delete($hash{_decl}) || ''; $decl =~ s/\$GENERIC\(\)\s*\*/void */g; # dodge float vs float complex ptr problem $hash{Code} = "$decl\n$hash{Code}"; - my %hash2 = %hash; - $hash2{Pars} = join ';', map s/\(2(?:,|(?=\)))/(/ ? "complex $_" : $_, split /;/, $hash2{Pars}; - if ($hash2{RedoDimsCode}) { + $hash{Pars} = join ';', map s/\(2(?:,|(?=\)))/(/ ? "complex $_" : $_, split /;/, $hash{Pars}; + if ($hash{RedoDimsCode}) { # decrement numbers being compared to, or dims offsets - $hash2{RedoDimsCode} =~ s/(>\s*)(\d+)|(\[\s*)(\d+)(\s*\])/ + $hash{RedoDimsCode} =~ s/(>\s*)(\d+)|(\[\s*)(\d+)(\s*\])/ $1 ? $1.($2 - 1) : $3.($4 - 1).$5 /ge; } - pp_def("__Nc$function", %hash2); - pp_add_exported("c$function"); - my $sig = join ';', grep defined, @hash2{qw(Pars OtherPars)}; - pp_addpm(<