From 1e6def6a5a35171018e262ae8b74460344055784 Mon Sep 17 00:00:00 2001 From: Francesco Paolo Lovergine Date: Thu, 21 Sep 2023 11:32:43 +0200 Subject: [PATCH 1/2] Removed use of now discouraged FFI::Platypus::Declare module. --- Changes | 6 +++--- Makefile.PL | 1 - lib/Geo/GDAL/FFI/VSI/File.pm | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index 6385bf2..93bf026 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,7 @@ Revision history for Perl extension Geo::GDAL::FFI -0.11 - - +0.11 unreleased + - Removed use of to FFI::Platypus::Declare, now discouraged. 0.10 July 10, 2023 - Add dependency to FFI::Platypus::Declare @@ -55,4 +55,4 @@ Revision history for Perl extension Geo::GDAL::FFI 0.01 Apr 6, 2018 - Included all basic functionality but lots of docs and methods to do. - \ No newline at end of file + diff --git a/Makefile.PL b/Makefile.PL index c57258c..7297ea1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -66,7 +66,6 @@ use Config; PREREQ_PM => { PkgConfig => 0.23026, FFI::Platypus => 0, - FFI::Platypus::Declare => 0, PDL => 0, Sort::Versions => 0, Alien::gdal => 0, diff --git a/lib/Geo/GDAL/FFI/VSI/File.pm b/lib/Geo/GDAL/FFI/VSI/File.pm index 3095f16..cd06f79 100644 --- a/lib/Geo/GDAL/FFI/VSI/File.pm +++ b/lib/Geo/GDAL/FFI/VSI/File.pm @@ -5,7 +5,6 @@ use warnings; use Encode qw(decode encode); use Carp; use FFI::Platypus::Buffer; -use FFI::Platypus::Declare; our $VERSION = 0.1100; @@ -45,7 +44,8 @@ sub Read { sub Write { my ($self, $buf) = @_; my $len = do {use bytes; length($buf)}; - my $address = cast 'string' => 'opaque', $buf; + my $ffi = FFI::Platypus->new(); + my $address = $ffi->cast 'string' => 'opaque', $buf; return Geo::GDAL::FFI::VSIFWriteL($address, 1, $len, $self->{handle}); } From 82eac25ccbfdee32b9b6d6d28eea41a3899db715 Mon Sep 17 00:00:00 2001 From: Francesco Paolo Lovergine <53651+fpl@users.noreply.github.com> Date: Fri, 22 Sep 2023 09:27:28 +0200 Subject: [PATCH 2/2] Fixing missing () in File.pm --- lib/Geo/GDAL/FFI/VSI/File.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Geo/GDAL/FFI/VSI/File.pm b/lib/Geo/GDAL/FFI/VSI/File.pm index cd06f79..9075e48 100644 --- a/lib/Geo/GDAL/FFI/VSI/File.pm +++ b/lib/Geo/GDAL/FFI/VSI/File.pm @@ -45,7 +45,7 @@ sub Write { my ($self, $buf) = @_; my $len = do {use bytes; length($buf)}; my $ffi = FFI::Platypus->new(); - my $address = $ffi->cast 'string' => 'opaque', $buf; + my $address = $ffi->cast('string' => 'opaque', $buf); return Geo::GDAL::FFI::VSIFWriteL($address, 1, $len, $self->{handle}); }