Skip to content

Commit

Permalink
use IV not "int" for param types especially dims
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Aug 8, 2024
1 parent dd7f28f commit 40c26d8
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions Basic/Primitive/primitive.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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, '
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion IO/Misc/misc.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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(@_)}
Expand Down
4 changes: 2 additions & 2 deletions IO/Pnm/pnm.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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 => '
Expand Down Expand Up @@ -316,7 +316,7 @@ C<im> follows I<strictly> the type of C<type>).

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},
Expand Down
14 changes: 7 additions & 7 deletions Libtmp/GSL/RNG/gsl_random.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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,'),
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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!");
}
Expand All @@ -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);
Expand All @@ -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));
Expand Down
12 changes: 6 additions & 6 deletions Libtmp/GSL/SF/bessel/gsl_sf_bessel.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand All @@ -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)))
Expand All @@ -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)))
Expand All @@ -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)))
Expand All @@ -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)))
Expand All @@ -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)))
Expand Down
4 changes: 2 additions & 2 deletions Libtmp/GSL/SF/coulomb/gsl_sf_coulomb.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Libtmp/Image2D/image2d.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 40c26d8

Please sign in to comment.