From 40c26d82d14774b2c71d14c26347b5b14e9c3159 Mon Sep 17 00:00:00 2001 From: Ed J Date: Thu, 8 Aug 2024 01:52:32 +0100 Subject: [PATCH] use IV not "int" for param types especially dims --- Basic/Primitive/primitive.pd | 6 +++--- IO/Misc/misc.pd | 2 +- IO/Pnm/pnm.pd | 4 ++-- Libtmp/GSL/RNG/gsl_random.pd | 14 +++++++------- Libtmp/GSL/SF/bessel/gsl_sf_bessel.pd | 12 ++++++------ Libtmp/GSL/SF/coulomb/gsl_sf_coulomb.pd | 4 ++-- Libtmp/Image2D/image2d.pd | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Basic/Primitive/primitive.pd b/Basic/Primitive/primitive.pd index a61d5f6c0..81d983d85 100644 --- a/Basic/Primitive/primitive.pd +++ b/Basic/Primitive/primitive.pd @@ -1268,7 +1268,7 @@ pp_def($_->{Name}, Pars => 'in(n); '.$_->{WeightPar}.$_->{HistType}. '[o] hist(m)', GenericTypes => [ppdefs_all], # set outdim by Par! - OtherPars => 'double step; double min; int msize => m', + OtherPars => 'double step; double min; IV msize => m', HandleBad => 1, RedoDimsCode => 'if ($SIZE(m) == 0) $CROAK("called with m dim of 0");', Code => pp_line_numbers(__LINE__-1, ' @@ -1372,8 +1372,8 @@ pp_def($_->{Name}, Pars => 'ina(n); inb(n); '.$_->{WeightPar}.$_->{HistType}. '[o] hist(ma,mb)', GenericTypes => [ppdefs_all], # set outdim by Par! - OtherPars => 'double stepa; double mina; int masize => ma; - double stepb; double minb; int mbsize => mb;', + OtherPars => 'double stepa; double mina; IV masize => ma; + double stepb; double minb; IV mbsize => mb;', HandleBad => 1, RedoDimsCode => ' if ($SIZE(ma) == 0) $CROAK("called with ma dim of 0"); diff --git a/IO/Misc/misc.pd b/IO/Misc/misc.pd index 22e94e020..2eeba16bc 100644 --- a/IO/Misc/misc.pd +++ b/IO/Misc/misc.pd @@ -1254,7 +1254,7 @@ EOPM pp_def('rasc', Pars => '[o] nums(n); int [o] ierr(n)', - OtherPars => 'PerlIO *fp; int num => n', + OtherPars => 'PerlIO *fp; IV num => n', PMFunc => '', PMCode => <<'EOF', sub rasc {PDL->rasc(@_)} diff --git a/IO/Pnm/pnm.pd b/IO/Pnm/pnm.pd index 4df2aa09d..0a74ab16c 100644 --- a/IO/Pnm/pnm.pd +++ b/IO/Pnm/pnm.pd @@ -275,7 +275,7 @@ EOD pp_def('pnminraw', Pars => 'type(); byte+ [o] im(m,n); byte [t] buf(llen)', - OtherPars => 'int ms => m; int ns => n; + OtherPars => 'IV ms => m; IV ns => n; int isbin; PerlIO *fp', GenericTypes => [qw(B U L)], RedoDimsCode => ' @@ -316,7 +316,7 @@ C follows I the type of C). pp_def( 'pnminascii', Pars => 'type(); byte+ [o] im(m,n)', - OtherPars => 'int ms => m; int ns => n; + OtherPars => 'IV ms => m; IV ns => n; int format; PerlIO *fp', GenericTypes => [qw(B U S L)], CHeader => qq{#include "get.h"\n}, diff --git a/Libtmp/GSL/RNG/gsl_random.pd b/Libtmp/GSL/RNG/gsl_random.pd index efc4d34bf..5c0e5cca9 100644 --- a/Libtmp/GSL/RNG/gsl_random.pd +++ b/Libtmp/GSL/RNG/gsl_random.pd @@ -535,7 +535,7 @@ EOF pp_def('get_int', Pars => '[o]a()', GenericTypes => ['F','D'], - OtherPars => 'int n; gsl_rng *rng', + OtherPars => 'IV n; gsl_rng *rng', Code => ' $a() = gsl_rng_uniform_int($COMP(rng),$COMP(n));', PMCode => make_get_sub('get_int','$n,'), @@ -855,7 +855,7 @@ my $MAX_DIMENSIONS = 100; pp_defnd('ran_dir_nd', Pars => '[o]x(n)', GenericTypes => ['F','D'], - OtherPars => 'int ns => n; gsl_rng *rng', + OtherPars => 'IV ns => n; gsl_rng *rng', Code =>' double xxx[' . $MAX_DIMENSIONS .']; gsl_ran_dir_nd($COMP(rng), $COMP(ns), xxx); @@ -937,7 +937,7 @@ $obj->ran_choose(PDL->sequence(PDL::indx(), 0+@in),my $pout = PDL->zeroes(PDL::i pp_def('ran_ver', Pars => '[o]x(n)', GenericTypes => ['F','D'], - OtherPars => 'double x0; double r;int ns => n; gsl_rng *rng', + OtherPars => 'double x0; double r;IV ns => n; gsl_rng *rng', Code =>' double xx=$COMP(x0); @@ -968,7 +968,7 @@ EOF pp_def('ran_caos', Pars => '[o]x(n)', GenericTypes => ['F','D'], - OtherPars => 'double m; int ns => n; gsl_rng *rng', + OtherPars => 'double m; IV ns => n; gsl_rng *rng', Code =>' double xx=gsl_ran_gaussian($COMP(rng),0.1)+0.5; @@ -1126,7 +1126,7 @@ ran_discrete_preproc(rng, p) gsl_rng * rng pdl * p CODE: - int n; + IV n; if (p->ndims!=1 || p->datatype!=PDL_D) { barf("Bad input to ran_discrete_preproc!"); } @@ -1141,7 +1141,7 @@ ran_shuffle(rng, in) gsl_rng * rng pdl * in CODE: - int size, n; + IV size, n; PDL->barf_if_error(PDL->make_physical(in)); n = in->nvals; size = PDL->howbig(in->datatype); @@ -1154,7 +1154,7 @@ ran_choose(rng, in, out) pdl * in pdl * out CODE: - int size, n,m; + IV size, n,m; if (in->datatype != out->datatype) barf("Data Types must match for ran_chooser"); PDL->barf_if_error(PDL->make_physical(in)); diff --git a/Libtmp/GSL/SF/bessel/gsl_sf_bessel.pd b/Libtmp/GSL/SF/bessel/gsl_sf_bessel.pd index bdd3c84f6..869223571 100644 --- a/Libtmp/GSL/SF/bessel/gsl_sf_bessel.pd +++ b/Libtmp/GSL/SF/bessel/gsl_sf_bessel.pd @@ -39,7 +39,7 @@ $e() = r.err; pp_def('gsl_sf_bessel_Jn_array', GenericTypes => ['D'], - OtherPars =>'int s; int n=>num', + OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_Jn_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) @@ -62,7 +62,7 @@ $e() = r.err; pp_def('gsl_sf_bessel_Yn_array', GenericTypes => ['D'], - OtherPars =>'int s; int n=>num', + OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_Yn_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) @@ -85,7 +85,7 @@ $e() = r.err; pp_def('gsl_sf_bessel_I_array', GenericTypes => ['D'], - OtherPars =>'int s; int n=>num', + OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_In_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) @@ -108,7 +108,7 @@ $e() = r.err; pp_def('gsl_sf_bessel_In_scaled_array', GenericTypes => ['D'], - OtherPars =>'int s; int n=>num', + OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_In_scaled_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) @@ -131,7 +131,7 @@ $e() = r.err; pp_def('gsl_sf_bessel_K_array', GenericTypes => ['D'], - OtherPars =>'int s; int n=>num', + OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_Kn_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) @@ -154,7 +154,7 @@ $e() = r.err; pp_def('gsl_sf_bessel_Kn_scaled_array', GenericTypes => ['D'], - OtherPars =>'int s; int n=>num', + OtherPars =>'int s; IV n=>num', Pars=>'double x(); double [o]y(num)', Code =>' GSLERR(gsl_sf_bessel_Kn_scaled_array,($COMP(s),$COMP(s)+$COMP(n)-1,$x(),$P(y))) diff --git a/Libtmp/GSL/SF/coulomb/gsl_sf_coulomb.pd b/Libtmp/GSL/SF/coulomb/gsl_sf_coulomb.pd index 55b332819..d89ff0d2c 100644 --- a/Libtmp/GSL/SF/coulomb/gsl_sf_coulomb.pd +++ b/Libtmp/GSL/SF/coulomb/gsl_sf_coulomb.pd @@ -43,7 +43,7 @@ $e() = r.err; pp_def('gsl_sf_coulomb_wave_FGp_array', GenericTypes => ['D'], - OtherPars =>'double lam_min; int kmax=>n; double eta', + OtherPars =>'double lam_min; IV kmax=>n; double eta', Pars=>'double x(); double [o]fc(n); double [o]fcp(n); double [o]gc(n); double [o]gcp(n); int [o]ovfw(); double [o]fe(n); double [o]ge(n);', Code =>' int s; @@ -60,7 +60,7 @@ else {$ovfw()=0;}} pp_def('gsl_sf_coulomb_wave_sphF_array', GenericTypes => ['D'], - OtherPars =>'double lam_min; int kmax=>n; double eta', + OtherPars =>'double lam_min; IV kmax=>n; double eta', Pars=>'double x(); double [o]fc(n); int [o]ovfw(); double [o]fe(n);', Code =>' int s; diff --git a/Libtmp/Image2D/image2d.pd b/Libtmp/Image2D/image2d.pd index 7112a93cb..315b7ccb5 100644 --- a/Libtmp/Image2D/image2d.pd +++ b/Libtmp/Image2D/image2d.pd @@ -396,7 +396,7 @@ Note: this routine does the median over all points in a rectangular EOD Pars => 'a(m,n); [o]b(m,n); indx [t]mapi(isize=CALC($SIZE(p) + $SIZE(m))); indx [t]mapj(jsize=CALC($SIZE(q) + $SIZE(n)))', - OtherPars => 'int p_size=>p; int q_size=>q; int opt;', + OtherPars => 'IV p_size=>p; IV q_size=>q; int opt;', PMCode => <<'EOF', sub PDL::med2df { my $opt; $opt = pop @_ if ref($_[$#_]) eq 'HASH'; @@ -1878,7 +1878,7 @@ output image does not map onto one in the input image. EOD HandleBad => 0, Pars => 'img(m,n); ldouble px(np,np); ldouble py(np,np); [o] warp(m,n); ldouble [t] poly(np); ldouble [t] kernel(ns)', - OtherPars => 'char *kernel_type; double noval; int nsamples => ns', + OtherPars => 'char *kernel_type; double noval; IV nsamples => ns', GenericTypes => [ qw(F D E) ], PMCode => <<'EOF', # support routine