Skip to content

Commit 59b75dc

Browse files
committed
merge trans_check_pdls behaviour into type_coerce - #517
1 parent 91f73fb commit 59b75dc

File tree

4 files changed

+7
-20
lines changed

4 files changed

+7
-20
lines changed

lib/PDL/Core/pdlaffine.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ pdl_error pdl_affine_new(pdl *PARENT,pdl *CHILD,PDL_Indx offset,PDL_Indx *dims,P
116116
pdl_params_affine *params = trans->params;
117117
trans->pdls[0] = PARENT;
118118
trans->pdls[1] = CHILD;
119-
PDL_RETERROR(PDL_err, pdl_trans_check_pdls(trans));
120-
char badflag_cache = pdl_trans_badflag_from_inputs((pdl_trans *)trans);
121119
pdl_type_coerce((pdl_trans *)trans);
122120
PARENT = trans->pdls[0];
123121
CHILD = trans->pdls[1];
@@ -137,7 +135,5 @@ pdl_error pdl_affine_new(pdl *PARENT,pdl *CHILD,PDL_Indx offset,PDL_Indx *dims,P
137135
params->sincs[i] = incs[i];
138136
}
139137
PDL_RETERROR(PDL_err, pdl_make_trans_mutual((pdl_trans *)trans));
140-
if (badflag_cache)
141-
CHILD->state |= PDL_BADVAL;
142138
return PDL_err;
143139
}

lib/PDL/Core/pdlapi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,9 +1316,11 @@ pdl_error pdl__type_convert(pdl_trans *trans, int recurse_count) {
13161316
return PDL_err;
13171317
}
13181318

1319+
pdl_error pdl__trans_check_pdls_actual(pdl_trans *trans);
13191320
pdl_error pdl__type_coerce_recprotect(pdl_trans *trans, int recurse_count) {
13201321
pdl_error PDL_err = {0, NULL, 0};
13211322
PDL_RECURSE_CHECK(recurse_count);
1323+
PDL_RETERROR(PDL_err, pdl__trans_check_pdls_actual(trans));
13221324
pdl_datatypes trans_dtype;
13231325
PDL_RETERROR(PDL_err, pdl__transtype_select(trans, &trans_dtype));
13241326
trans->__datatype = trans_dtype;
@@ -1341,7 +1343,7 @@ char pdl_trans_badflag_from_inputs(pdl_trans *trans) {
13411343
return 0; /* CORE21 get rid */
13421344
}
13431345

1344-
pdl_error pdl_trans_check_pdls(pdl_trans *trans) {
1346+
pdl_error pdl__trans_check_pdls_actual(pdl_trans *trans) {
13451347
pdl_error PDL_err = {0, NULL, 0};
13461348
PDL_Indx i;
13471349
pdl_transvtable *vtable = trans->vtable;
@@ -1362,3 +1364,7 @@ pdl_error pdl_trans_check_pdls(pdl_trans *trans) {
13621364
);
13631365
return PDL_err;
13641366
}
1367+
pdl_error pdl_trans_check_pdls(pdl_trans *trans) {
1368+
pdl_error PDL_err = {0, NULL, 0};
1369+
return PDL_err; /* CORE21 get rid */
1370+
}

lib/PDL/Core/pdlconv.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,6 @@ pdl_error pdl__converttypei_new_recprotect(pdl *PARENT, pdl *CHILD, pdl_datatype
255255
pdl_params_converttypei *params = trans->params;
256256
trans->pdls[0] = PARENT;
257257
trans->pdls[1] = CHILD;
258-
PDL_RETERROR(PDL_err, pdl_trans_check_pdls(trans));
259-
if (PARENT->state & PDL_BADVAL) {
260-
trans->bvalflag = 1;
261-
trans->pdls[1]->state |= PDL_BADVAL;
262-
}
263258
trans->__datatype = PARENT->datatype = force_intype;
264259
PDL_RETERROR(PDL_err, pdl__set_output_type_badvalue(trans, recurse_count + 1));
265260
trans->pdls[2] = trans->pdls[1]; /* copy for make_trans_mutual */

lib/PDL/PP.pm

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,15 +1937,6 @@ sub make_vfn_args {
19371937
PDL::PP::Rule::Returns::EmptyString->new("NewXSCoerceMustNS"),
19381938
PDL::PP::Rule::Substitute->new("NewXSCoerceMustCompSubd", "NewXSCoerceMustNS"),
19391939

1940-
PDL::PP::Rule->new("NewXSFindBadStatusNS", [qw(StructName)],
1941-
"Rule to find the bad value status of the input ndarrays",
1942-
sub {
1943-
indent(2, <<EOF);
1944-
PDL_RETERROR(PDL_err, PDL->trans_check_pdls($_[0]));
1945-
EOF
1946-
}),
1947-
PDL::PP::Rule::Substitute->new("NewXSFindBadStatusSubd", "NewXSFindBadStatusNS"),
1948-
19491940
PDL::PP::Rule->new("NewXSStructInit0",
19501941
["StructName","VTableName","ParamStructName","ParamStructType"],
19511942
"Rule to create and initialise the private trans structure",
@@ -1962,7 +1953,6 @@ EOF
19621953
["RunFuncHdr",
19631954
"NewXSStructInit0",
19641955
"NewXSSetTransPDLs",
1965-
"NewXSFindBadStatusSubd",
19661956
"NewXSTypeCoerceSubd",
19671957
"NewXSExtractTransPDLs",
19681958
"MakeCompiledReprSubd",

0 commit comments

Comments
 (0)