Skip to content

Commit

Permalink
Switch double to PDL_Anyval where usage is generic
Browse files Browse the repository at this point in the history
This is for setting any type of PDL value.  Original
code assumed (double) worked for everything.  Now we
need to handle (64bit ints) as well.
  • Loading branch information
devel-chm authored and mohawk2 committed Mar 2, 2015
1 parent 7d8e32c commit fbbfbe8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Basic/Core/Core.xs
Expand Up @@ -247,8 +247,8 @@ void propagate_badvalue( pdl *it ) {


/* this is horrible - the routines from bad should perhaps be here instead ? */
double pdl_get_badvalue( int datatype ) {
double retval;
PDL_Anyval pdl_get_badvalue( int datatype ) {
PDL_Anyval retval;
switch ( datatype ) {

#include "pdldataswitch.c"
Expand All @@ -260,8 +260,8 @@ double pdl_get_badvalue( int datatype ) {
} /* pdl_get_badvalue() */


double pdl_get_pdl_badvalue( pdl *it ) {
double retval;
PDL_Anyval pdl_get_pdl_badvalue( pdl *it ) {
PDL_Anyval retval;
int datatype;

#if BADVAL_PER_PDL
Expand Down Expand Up @@ -619,7 +619,7 @@ sclr_c(it)
PDL_Indx nullp = 0;
PDL_Indx dummyd = 1;
PDL_Indx dummyi = 1;
double result;
PDL_Anyval result;
CODE:
/* get the first element of a piddle and return as
* Perl double scalar (NV)
Expand All @@ -645,7 +645,7 @@ at_c(x,position)
PDL_Indx * pos;
int npos;
int ipos;
double result;
PDL_Anyval result;
CODE:
pdl_make_physvaffine( x );

Expand Down Expand Up @@ -681,7 +681,7 @@ at_bad_c(x,position)
int npos;
int ipos;
int badflag;
double result;
PDL_Anyval result;
CODE:
pdl_make_physvaffine( x );

Expand Down Expand Up @@ -777,12 +777,12 @@ listref_c(x)
#if BADVAL
/*
# note:
# the badvalue is stored in a double, but that's what pdl_at()
# the badvalue is stored in a PDL_Anyval, but that's what pdl_at()
# returns
*/

SV *sv;
double pdl_val, pdl_badval;
PDL_Anyval pdl_val, pdl_badval;
int badflag = (x->state & PDL_BADVAL) > 0;
# if BADVAL_USENAN
/* do we have to bother about NaN's? */
Expand Down Expand Up @@ -847,7 +847,7 @@ void
set_c(x,position,value)
pdl* x
SV* position
double value
PDL_Anyval value
PREINIT:
PDL_Indx * pos;
int npos;
Expand Down

0 comments on commit fbbfbe8

Please sign in to comment.