Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix strlen calls, also remove flush intrinsic. #20

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fortran/legacy_fortran_api_examples.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ program example_fortran_api
function strlen(s) result(l) bind(c, name='strlen')
use, intrinsic :: iso_c_binding
character(c_char) :: s
integer(c_int) :: l
integer(c_long) :: l
end function
end interface

Expand Down
2 changes: 1 addition & 1 deletion src/odc/api/odc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pure function strlen(str) result(len) bind(c)
use, intrinsic :: iso_c_binding
implicit none
type(c_ptr), intent(in), value :: str
integer(c_int) :: len
integer(c_long) :: len
end function
end interface

Expand Down
10 changes: 5 additions & 5 deletions tests/f_api/odc_header.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ program odc_header
call check_call(frame%initialise(reader), 'initialising frame')

write(output_unit, '(a,a)') 'File: ', trim(path)
call flush(output_unit)
flush(output_unit)

nframe = 1

Expand All @@ -50,7 +50,7 @@ program odc_header

write(output_unit, '(a,i0,a,i0,a,i0)') ' Frame: ', nframe, ', Row count: ', nrows, &
', Column count: ', ncols
call flush(output_unit)
flush(output_unit)

! Get number of properties encoded in the frame
call check_call(frame%properties_count(nproperties), 'getting property count')
Expand All @@ -75,7 +75,7 @@ program odc_header

write(output_unit, '(a,i0,a,a,a,a,a,i0)') ' Column: ', col, ', Name: ', name, &
', Type: ', type_name, ', Size: ', element_size
call flush(output_unit)
flush(output_unit)

! Process bitfields only
if (type == ODC_BITFIELD) then
Expand All @@ -87,14 +87,14 @@ program odc_header

write(output_unit, '(a,i0,a,a,a,i0,a,i0)') ' Bitfield: ', bf, ', Name: ', bf_name, &
', Offset: ', bf_offset, ', Nbits: ', bf_size
call flush(output_unit)
flush(output_unit)
end do
end if
end do

nframe = nframe + 1
write(output_unit, '(a)') ''
call flush(output_unit)
flush(output_unit)

! Advances to the next frame in the stream in non-aggregated mode
err = frame%next()
Expand Down