Skip to content

Commit

Permalink
Modified the set_stride_xd functions in zfp.f90 so that stride values…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
diegorsjv committed Apr 11, 2023
1 parent f15d007 commit fbca454
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fortran/zfp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit fbca454

Please sign in to comment.