Skip to content

Commit 78147f3

Browse files
committed
ExtUtils::ParseXS: reindent block
Indent a block of code which was wrapped in new braces by the previous commit. White space only.
1 parent 8f459ca commit 78147f3

File tree

1 file changed

+92
-92
lines changed

1 file changed

+92
-92
lines changed

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm

Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,121 +1705,121 @@ EOF
17051705
# ----------------------------------------------------------------
17061706

17071707
{
1708-
# Depending on whether the XSUB has a prototype, work out how to
1709-
# invoke one of the newXS() function variants. Set these:
1710-
#
1711-
my $newXS; # the newXS() variant to be called in the boot section
1712-
my $file_arg; # an extra ', file' arg to be passed to newXS call
1713-
my $proto_arg; # an extra e.g. ', "$@"' arg to be passed to newXS call
1714-
1715-
$proto_arg = "";
1708+
# Depending on whether the XSUB has a prototype, work out how to
1709+
# invoke one of the newXS() function variants. Set these:
1710+
#
1711+
my $newXS; # the newXS() variant to be called in the boot section
1712+
my $file_arg; # an extra ', file' arg to be passed to newXS call
1713+
my $proto_arg; # an extra e.g. ', "$@"' arg to be passed to newXS call
17161714

1717-
unless($self->{ProtoThisXSUB}) {
1718-
# no prototype
1719-
$newXS = "newXS_deffile";
1720-
$file_arg = "";
1721-
}
1722-
else {
1723-
# needs prototype
1724-
$newXS = "newXSproto_portable";
1725-
$file_arg = ", file";
1715+
$proto_arg = "";
17261716

1727-
if ($self->{ProtoThisXSUB} eq 2) {
1728-
# User has specified an empty prototype
1717+
unless($self->{ProtoThisXSUB}) {
1718+
# no prototype
1719+
$newXS = "newXS_deffile";
1720+
$file_arg = "";
17291721
}
1730-
elsif ($self->{ProtoThisXSUB} eq 1) {
1731-
# Protoype enabled, but to be auto-generated by us
1732-
my $s = ';';
1733-
if ($min_arg_count < $args_count) {
1734-
$s = '';
1735-
# $self->{proto_arg} was populated during argument / typemap
1736-
# processing. Each element contains the prototype for that arg,
1737-
# typically '$'.
1738-
$self->{proto_arg}->[$min_arg_count] .= ";";
1722+
else {
1723+
# needs prototype
1724+
$newXS = "newXSproto_portable";
1725+
$file_arg = ", file";
1726+
1727+
if ($self->{ProtoThisXSUB} eq 2) {
1728+
# User has specified an empty prototype
17391729
}
1740-
push @{ $self->{proto_arg} }, "$s\@"
1741-
if $seen_ellipsis; # '...' was seen in XSUB signature
1730+
elsif ($self->{ProtoThisXSUB} eq 1) {
1731+
# Protoype enabled, but to be auto-generated by us
1732+
my $s = ';';
1733+
if ($min_arg_count < $args_count) {
1734+
$s = '';
1735+
# $self->{proto_arg} was populated during argument / typemap
1736+
# processing. Each element contains the prototype for that arg,
1737+
# typically '$'.
1738+
$self->{proto_arg}->[$min_arg_count] .= ";";
1739+
}
1740+
push @{ $self->{proto_arg} }, "$s\@"
1741+
if $seen_ellipsis; # '...' was seen in XSUB signature
17421742

1743-
$proto_arg = join ("", grep defined, @{ $self->{proto_arg} } );
1744-
}
1745-
else {
1746-
# User has manually specified a prototype
1747-
$proto_arg = $self->{ProtoThisXSUB};
1748-
}
1743+
$proto_arg = join ("", grep defined, @{ $self->{proto_arg} } );
1744+
}
1745+
else {
1746+
# User has manually specified a prototype
1747+
$proto_arg = $self->{ProtoThisXSUB};
1748+
}
17491749

1750-
$proto_arg = qq{, "$proto_arg"};
1751-
}
1750+
$proto_arg = qq{, "$proto_arg"};
1751+
}
17521752

1753-
# Now use those values to append suitable newXS() and other code
1754-
# into @{ $self->{InitFileCode} }, for later insertion into the
1755-
# boot sub.
1753+
# Now use those values to append suitable newXS() and other code
1754+
# into @{ $self->{InitFileCode} }, for later insertion into the
1755+
# boot sub.
17561756

1757-
if ($self->{XsubAliases} and keys %{ $self->{XsubAliases} }) {
1758-
# For the main XSUB and for each alias name, generate a newXS() call
1759-
# and 'XSANY.any_i32 = ix' line.
1757+
if ($self->{XsubAliases} and keys %{ $self->{XsubAliases} }) {
1758+
# For the main XSUB and for each alias name, generate a newXS() call
1759+
# and 'XSANY.any_i32 = ix' line.
17601760

1761-
# Make the main name one of the aliases if it isn't already
1762-
$self->{XsubAliases}->{ $self->{pname} } = 0
1763-
unless defined $self->{XsubAliases}->{ $self->{pname} };
1761+
# Make the main name one of the aliases if it isn't already
1762+
$self->{XsubAliases}->{ $self->{pname} } = 0
1763+
unless defined $self->{XsubAliases}->{ $self->{pname} };
17641764

1765-
foreach my $xname (sort keys %{ $self->{XsubAliases} }) {
1766-
my $value = $self->{XsubAliases}{$xname};
1767-
push(@{ $self->{InitFileCode} }, Q(<<"EOF"));
1765+
foreach my $xname (sort keys %{ $self->{XsubAliases} }) {
1766+
my $value = $self->{XsubAliases}{$xname};
1767+
push(@{ $self->{InitFileCode} }, Q(<<"EOF"));
17681768
# cv = $newXS(\"$xname\", XS_$self->{Full_func_name}$file_arg$proto_arg);
17691769
# XSANY.any_i32 = $value;
17701770
EOF
1771+
}
17711772
}
1772-
}
1773-
elsif (@{ $self->{Attributes} }) {
1774-
# Generate a standard newXS() call, plus a single call to
1775-
# apply_attrs_string() call with the string of attributes.
1776-
push(@{ $self->{InitFileCode} }, Q(<<"EOF"));
1773+
elsif (@{ $self->{Attributes} }) {
1774+
# Generate a standard newXS() call, plus a single call to
1775+
# apply_attrs_string() call with the string of attributes.
1776+
push(@{ $self->{InitFileCode} }, Q(<<"EOF"));
17771777
# cv = $newXS(\"$self->{pname}\", XS_$self->{Full_func_name}$file_arg$proto_arg);
17781778
# apply_attrs_string("$self->{Package}", cv, "@{ $self->{Attributes} }", 0);
17791779
EOF
1780-
}
1781-
elsif ($self->{interface}) {
1782-
# For each interface name, generate both a newXS() and
1783-
# XSINTERFACE_FUNC_SET() call.
1784-
foreach my $yname (sort keys %{ $self->{Interfaces} }) {
1785-
my $value = $self->{Interfaces}{$yname};
1786-
$yname = "$self->{Package}\::$yname" unless $yname =~ /::/;
1787-
push(@{ $self->{InitFileCode} }, Q(<<"EOF"));
1780+
}
1781+
elsif ($self->{interface}) {
1782+
# For each interface name, generate both a newXS() and
1783+
# XSINTERFACE_FUNC_SET() call.
1784+
foreach my $yname (sort keys %{ $self->{Interfaces} }) {
1785+
my $value = $self->{Interfaces}{$yname};
1786+
$yname = "$self->{Package}\::$yname" unless $yname =~ /::/;
1787+
push(@{ $self->{InitFileCode} }, Q(<<"EOF"));
17881788
# cv = $newXS(\"$yname\", XS_$self->{Full_func_name}$file_arg$proto_arg);
17891789
# $self->{interface_macro_set}(cv,$value);
17901790
EOF
1791+
}
1792+
}
1793+
elsif ($newXS eq 'newXS_deffile'){
1794+
# Modified default: generate a standard newXS() call; but
1795+
# work around the CPAN 'P5NCI' distribution doing:
1796+
# #undef newXS
1797+
# #define newXS ;
1798+
# by omitting the initial (void).
1799+
# XXX DAPM 2024:
1800+
# this branch was originally: "elsif ($newXS eq 'newXS')"
1801+
# but when the standard name for the newXS variant changed in
1802+
# xsubpp, it was changed here too. So this branch no longer actually
1803+
# handles a workaround for '#define newXS ;'. I also don't
1804+
# understand how just omitting the '(void)' fixed the problem.
1805+
push(@{ $self->{InitFileCode} },
1806+
" $newXS(\"$self->{pname}\", XS_$self->{Full_func_name}$file_arg$proto_arg);\n");
1807+
}
1808+
else {
1809+
# Default: generate a standard newXS() call
1810+
push(@{ $self->{InitFileCode} },
1811+
" (void)$newXS(\"$self->{pname}\", XS_$self->{Full_func_name}$file_arg$proto_arg);\n");
17911812
}
1792-
}
1793-
elsif ($newXS eq 'newXS_deffile'){
1794-
# Modified default: generate a standard newXS() call; but
1795-
# work around the CPAN 'P5NCI' distribution doing:
1796-
# #undef newXS
1797-
# #define newXS ;
1798-
# by omitting the initial (void).
1799-
# XXX DAPM 2024:
1800-
# this branch was originally: "elsif ($newXS eq 'newXS')"
1801-
# but when the standard name for the newXS variant changed in
1802-
# xsubpp, it was changed here too. So this branch no longer actually
1803-
# handles a workaround for '#define newXS ;'. I also don't
1804-
# understand how just omitting the '(void)' fixed the problem.
1805-
push(@{ $self->{InitFileCode} },
1806-
" $newXS(\"$self->{pname}\", XS_$self->{Full_func_name}$file_arg$proto_arg);\n");
1807-
}
1808-
else {
1809-
# Default: generate a standard newXS() call
1810-
push(@{ $self->{InitFileCode} },
1811-
" (void)$newXS(\"$self->{pname}\", XS_$self->{Full_func_name}$file_arg$proto_arg);\n");
1812-
}
18131813

1814-
# For every overload operator, generate an additional newXS()
1815-
# call to add an alias such as "Foo::(<=>" for this XSUB.
1814+
# For every overload operator, generate an additional newXS()
1815+
# call to add an alias such as "Foo::(<=>" for this XSUB.
18161816

1817-
for my $operator (sort keys %{ $self->{OverloadsThisXSUB} }) {
1818-
$self->{Overloaded}->{$self->{Package}} = $self->{Packid};
1819-
my $overload = "$self->{Package}\::($operator";
1820-
push(@{ $self->{InitFileCode} },
1821-
" (void)$newXS(\"$overload\", XS_$self->{Full_func_name}$file_arg$proto_arg);\n");
1822-
}
1817+
for my $operator (sort keys %{ $self->{OverloadsThisXSUB} }) {
1818+
$self->{Overloaded}->{$self->{Package}} = $self->{Packid};
1819+
my $overload = "$self->{Package}\::($operator";
1820+
push(@{ $self->{InitFileCode} },
1821+
" (void)$newXS(\"$overload\", XS_$self->{Full_func_name}$file_arg$proto_arg);\n");
1822+
}
18231823

18241824
}
18251825

0 commit comments

Comments
 (0)