Skip to content

Commit

Permalink
ParseXS - sort things that might produce output
Browse files Browse the repository at this point in the history
Make sure our output is deterministic.
  • Loading branch information
demerphq committed Nov 9, 2022
1 parent 111376a commit 589b5f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -873,15 +873,15 @@ EOF
" (void)$self->{newXS}(\"$self->{pname}\", XS_$self->{Full_func_name}$self->{file}$self->{proto});\n");
}

for my $operator (keys %{ $self->{OverloadsThisXSUB} }) {
for my $operator (sort keys %{ $self->{OverloadsThisXSUB} }) {
$self->{Overloaded}->{$self->{Package}} = $self->{Packid};
my $overload = "$self->{Package}\::($operator";
push(@{ $self->{InitFileCode} },
" (void)$self->{newXS}(\"$overload\", XS_$self->{Full_func_name}$self->{file}$self->{proto});\n");
}
} # END 'PARAGRAPH' 'while' loop

for my $package (keys %{ $self->{Overloaded} }) { # make them findable with fetchmethod
for my $package (sort keys %{ $self->{Overloaded} }) { # make them findable with fetchmethod
my $packid = $self->{Overloaded}->{$package};
print Q(<<"EOF");
#XS_EUPXS(XS_${packid}_nil); /* prototype to pass -Wmissing-prototypes */
Expand Down Expand Up @@ -968,15 +968,15 @@ EOF
#
EOF

if (%{ $self->{Overloaded} }) {
if (keys %{ $self->{Overloaded} }) {
# once if any overloads
print Q(<<"EOF");
# /* register the overloading (type 'A') magic */
##if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
# PL_amagic_generation++;
##endif
EOF
for my $package (keys %{ $self->{Overloaded} }) {
for my $package (sort keys %{ $self->{Overloaded} }) {
# once for each package with overloads
my $fallback = $self->{Fallback}->{$package} || "&PL_sv_undef";
print Q(<<"EOF");
Expand Down

0 comments on commit 589b5f1

Please sign in to comment.