Skip to content

Commit

Permalink
fix Perl-scalar of unsigned types - fix #458
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Jan 29, 2024
1 parent 960e1c1 commit 103fdc1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Basic/Core/pdlperl.h.PL
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ EOF
for (PDL::Types::types()) {
print OUT "case @{[$_->sym]}: ";
if ($_->real) {
my $upper = uc(my $letter = $_->integer ? 'i' : 'n');
my $upper = uc(my $letter = $_->unsigned ? 'u' : $_->integer ? 'i' : 'n');
print OUT "sv_set${letter}v(outsv, (${upper}V)(inany.value.".$_->ppsym."))";
} else {
my ($fs, $ppsym) = ($_->floatsuffix, $_->ppsym);
Expand Down
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- fix segv if vsearch $x arg is empty (#454) - thanks @djerius
- IO::HDF fix for HDF4 4.2.16 (#439) - thanks @sebastic
- fix GIS::Proj to work better on Windows (#456) - thanks @shawnlaffan
- fix conversion of ulonglong to Perl scalar and therefore stringification (#458) - thanks @vadim-160102 for report

2.084 2023-05-21
- reduce size of PDL_KLUDGE_COPY_X macro to <4096 in line with C standard, to fix for older clang on many BSD
Expand Down
4 changes: 4 additions & 0 deletions t/ops.t
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ TODO: {
cmp_ok longlong($INT_MAX*4)%2, '==', 0, "big longlong modulus: @{[$INT_MAX*4]} % 2";
#skip float intentionally here, since float($INT_MAX)!=$INT_MAX
cmp_ok double($INT_MAX*4)%2 , '==', 0, "big double modulus: @{[$INT_MAX*4]} % 2";

my $u = pdl(ulonglong, [0,1]);
my $compl = ~$u;
is "$compl", '[18446744073709551615 18446744073709551614]', 'ULL get stringified right';
}
}

Expand Down

0 comments on commit 103fdc1

Please sign in to comment.