From fbca454079a465828129455885bae9d78ada8bcd Mon Sep 17 00:00:00 2001 From: diegojv Date: Tue, 11 Apr 2023 10:20:59 +0200 Subject: [PATCH] Modified the set_stride_xd functions in zfp.f90 so that stride values are actually passed by value and not by reference as they were. This resulted in segmentation faults when using strided compression with the Fortran bindings --- fortran/zfp.f90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fortran/zfp.f90 b/fortran/zfp.f90 index f671d1449..8418b0e51 100644 --- a/fortran/zfp.f90 +++ b/fortran/zfp.f90 @@ -464,25 +464,25 @@ subroutine zfp_field_set_size_4d(field, nx, ny, nz, nw) bind(c, name="zfp_field_ subroutine zfp_field_set_stride_1d(field, sx) bind(c, name="zfp_field_set_stride_1d") import type(c_ptr), value :: field - integer(c_ptrdiff_t) :: sx + integer(c_ptrdiff_t), value :: sx end subroutine subroutine zfp_field_set_stride_2d(field, sx, sy) bind(c, name="zfp_field_set_stride_2d") import type(c_ptr), value :: field - integer(c_ptrdiff_t) :: sx, sy + integer(c_ptrdiff_t), value :: sx, sy end subroutine subroutine zfp_field_set_stride_3d(field, sx, sy, sz) bind(c, name="zfp_field_set_stride_3d") import type(c_ptr), value :: field - integer(c_ptrdiff_t) :: sx, sy, sz + integer(c_ptrdiff_t), value :: sx, sy, sz end subroutine subroutine zfp_field_set_stride_4d(field, sx, sy, sz, sw) bind(c, name="zfp_field_set_stride_4d") import type(c_ptr), value :: field - integer(c_ptrdiff_t) :: sx, sy, sz, sw + integer(c_ptrdiff_t), value :: sx, sy, sz, sw end subroutine function zfp_field_set_metadata(field, encoded_metadata) result(is_success) bind(c, name="zfp_field_set_metadata")