Skip to content

Commit bcfaca7

Browse files
committed
remove PP BADFLAGCACHE stuff - #517
1 parent 646af06 commit bcfaca7

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

lib/PDL/Bad.pd

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -822,11 +822,6 @@ EOF
822822
%}
823823
PDL->propagate_badflag_dir($PDL(b), 0, 1, 1); /* always make sure the output is "good" */
824824
},
825-
NewXSFindBadStatusNS => <<'EOF',
826-
PDL_RETERROR(PDL_err, PDL->trans_check_pdls(__privtrans));
827-
char $BADFLAGCACHE() = PDL->trans_badflag_from_inputs(__privtrans);
828-
$BADFLAGCACHE() = 0; /* override, but still need to call the above */
829-
EOF
830825
GenericTypes => $A,
831826
);
832827

lib/PDL/PP.pm

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ sub dosubst_private {
371371
CROAK => sub {"return PDL->make_error(PDL_EUSERERROR, \"Error in $name:\" @{[join ',', @_]})"},
372372
NAME => sub {return $name},
373373
MODULE => sub {return $::PDLMOD},
374-
BADFLAGCACHE => sub { "badflag_cache" },
375374
PDLSTATESETBAD => sub { ($sig->objs->{$_[0]}//confess "Can't get PDLSTATESETBAD for unknown ndarray '$_[0]'")->do_pdlaccess."->state |= PDL_BADVAL" },
376375
PDLSTATESETGOOD => sub { ($sig->objs->{$_[0]}->do_pdlaccess//confess "Can't get PDLSTATESETGOOD for unknown ndarray '$_[0]'")."->state &= ~PDL_BADVAL" },
377376
PDLSTATEISBAD => sub {badflag_isset(($sig->objs->{$_[0]}//confess "Can't get PDLSTATEISBAD for unknown ndarray '$_[0]'")->do_pdlaccess)},
@@ -1943,29 +1942,9 @@ sub make_vfn_args {
19431942
sub {
19441943
indent(2, <<EOF);
19451944
PDL_RETERROR(PDL_err, PDL->trans_check_pdls($_[0]));
1946-
char \$BADFLAGCACHE() = PDL->trans_badflag_from_inputs($_[0]); (void)\$BADFLAGCACHE();
19471945
EOF
19481946
}),
1949-
1950-
PDL::PP::Rule->new("NewXSCopyBadStatusNS",
1951-
["SignatureObj"],
1952-
"Rule to copy the bad value status to the output ndarrays",
1953-
# note: this is executed before the trans_mutual call
1954-
# is made, since the state may be changed by the
1955-
# Code section
1956-
sub {
1957-
my ( $sig ) = @_;
1958-
return '' if @{$sig->names} == (my @outs = $sig->names_out); # no input pdls, no badflag copying needed
1959-
!@outs ? '' : PDL::PP::indent(2, join '', # no outs, ditto
1960-
"if (\$BADFLAGCACHE()) {\n",
1961-
(map " $_->state |= PDL_BADVAL;\n", @outs),
1962-
"}\n");
1963-
}),
1964-
1965-
# expand macros in ...BadStatusCode
1966-
#
19671947
PDL::PP::Rule::Substitute->new("NewXSFindBadStatusSubd", "NewXSFindBadStatusNS"),
1968-
PDL::PP::Rule::Substitute->new("NewXSCopyBadStatusSubd", "NewXSCopyBadStatusNS"),
19691948

19701949
PDL::PP::Rule->new("NewXSStructInit0",
19711950
["StructName","VTableName","ParamStructName","ParamStructType"],
@@ -1989,7 +1968,6 @@ EOF
19891968
"MakeCompiledReprSubd",
19901969
"NewXSCoerceMustCompSubd",
19911970
"NewXSRunTrans",
1992-
"NewXSCopyBadStatusSubd",
19931971
],
19941972
"Generate C function with idiomatic arg list to maybe call from XS",
19951973
sub {

0 commit comments

Comments
 (0)