Skip to content

Commit 45908e3

Browse files
committed
fortran lint
1 parent 7ce29a0 commit 45908e3

File tree

10 files changed

+14
-14
lines changed

10 files changed

+14
-14
lines changed

cmake/abi_check/main.f90

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ end function addtwo
2020
if (addone(2) /= 3) then
2121
write(stderr,*) "ERROR: 2+1 /= ", addone(2)
2222
error stop
23-
endif
23+
end if
2424

2525
if (addtwo(2) /= 4) then
2626
write(stderr,*) "ERROR: 2+2 /= ", addtwo(2)
2727
error stop
28-
endif
28+
end if
2929

3030
print *, "OK: Fortran main with C,C++ libraries"
3131

src/poly_type/base_mod.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ subroutine destructor(self)
4242
deallocate(self%D)
4343
else
4444
print *, "D was not allocated"
45-
endif
45+
end if
4646

4747
end subroutine destructor
4848

test/array/array.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ subroutine timestwo_cpp(v, N) bind(C)
3030
if(any(A /= [4,8,12])) then
3131
write(stderr,*) "A = ", A
3232
error stop "fortran call timestwo_cpp failed"
33-
endif
33+
end if
3434

3535
print *, "OK: Fortran array"
3636

test/iso_fortran_binding/cfi_allocate.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ subroutine dealloc3d(x) bind(c)
2727
call alloc3d(x)
2828
if (allocated(x)) then
2929
print *, "x has been allocated like x(", (LBOUND(x,i), UBOUND(x,i), i=1,3), ")"
30-
endif
30+
end if
3131

3232
call dealloc3d(x)
3333
if (allocated(x)) error stop "CFI_deallocate failed"

test/pointer/pointer_bounds.f90

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ subroutine Lneg1_C(A) bind(C)
4343
if (lbound(A,1) /= 1) then
4444
write(error_unit,'(a,i0)') "Lneg1_C: unexpected lbound(A,1) ", lbound(A,1)
4545
error stop
46-
endif
46+
end if
4747
if (ubound(A,1) /= 4) then
4848
write(error_unit, '(a,i0)') "Lneg1_C: unexpected ubound(A,1) ", ubound(A,1)
4949
error stop
50-
endif
50+
end if
5151
end subroutine lneg1_C
5252
end program

test/sleep/test_sleep.f90

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ program sleep_demo
1818
call get_command_argument(1, argv, status=ierr)
1919
if (ierr /= 0) error stop "please specify milliseconds to sleep"
2020
read(argv, '(i6)') millisec
21-
endif
21+
end if
2222

2323
if (millisec <= 0) error stop "please specify positive milliseconds to sleep"
2424

@@ -32,12 +32,12 @@ program sleep_demo
3232
!> slept less than half expected time
3333
write(stderr, '(a, f9.6)') 'ERROR: measured sleep time too short (millisec): ', t_ms
3434
error stop
35-
endif
35+
end if
3636
if (t_ms > 2 * millisec) then
3737
!> slept more than twice expected time
3838
write(stderr, '(a, f9.6)') 'ERROR: measure sleep time too long (millisec): ', t_ms
3939
error stop
40-
endif
40+
end if
4141

4242
print '(A, F6.1)', 'OK: test_sleep: slept for (ms): ', t_ms
4343

test/string/print.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ subroutine f_print(s, L) bind(C)
2020
do i = 1, len(buf)
2121
if (s(i) == C_NULL_CHAR) exit
2222
buf(i:i) = s(i)
23-
enddo
23+
end do
2424
allocate(character(len_trim(buf)) :: fs)
2525
fs = trim(buf)
2626
end block

test/struct/struct_rx.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pure subroutine struct_check_f(s) bind(C)
3636
do i = 1, len(buf)
3737
if (s%my_char(i) == c_null_char) exit
3838
buf(i:i) = s%my_char(i)
39-
enddo
39+
end do
4040
allocate(character(len_trim(buf)) :: my_char)
4141
my_char = trim(buf)
4242
end block

test/time/strptime.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ integer(C_INT) function strptime(str,format,tm) bind(C)
2525
rc = strptime(trim(str)// c_null_char, trim(fmt)// c_null_char, tm)
2626
if(rc == 0) then
2727
error stop "strptime failed"
28-
endif
28+
end if
2929

3030
print '(a3,1x,i4,1x,i2,1x,i2,1x,i2,1x,i2,1x,i2)', "OK:", &
3131
tm%tm_year+1900, tm%tm_mon+1, tm%tm_mday, tm%tm_hour, tm%tm_min, tm%tm_sec

test/vector/vector.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ subroutine timestwo_cpp(a, a2, L) bind (c)
2828
!! dummy data
2929
do i=1,N
3030
x(i) = int(i, C_INT)
31-
enddo
31+
end do
3232

3333
call timestwo_c(x, x2, size(x, kind=C_SIZE_T))
3434
if (any(2*x /= x2)) error stop 'x2 /= 2*x'

0 commit comments

Comments
 (0)