Skip to content

Commit 6f84b34

Browse files
committed
Removed redundant imports.
1 parent 449bcc3 commit 6f84b34

File tree

18 files changed

+16
-33
lines changed

18 files changed

+16
-33
lines changed

examples/dirent/dirent.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
! Licence: ISC
55
program main
66
!! Prints the contents of a file system directory to stdout (unsorted).
7-
use, intrinsic :: iso_c_binding
87
use, intrinsic :: iso_fortran_env, only: stderr => error_unit
98
use :: unix
109
implicit none

examples/fifo/fifo.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ program main
99
!! ```
1010
!! $ echo "Hello, World!" > /tmp/fifo
1111
!! ```
12-
use, intrinsic :: iso_c_binding
1312
use :: unix
1413
implicit none
1514

examples/fork/fork.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
program main
66
!! Example program that forks the main process and opens two anonymous pipes
77
!! for IPC.
8-
use, intrinsic :: iso_c_binding
98
use :: unix
109
implicit none
1110

examples/irc/irc.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
! Licence: ISC
55
module irc
66
!! IRC connectivity module.
7-
use, intrinsic :: iso_c_binding
87
use, intrinsic :: iso_fortran_env, only: i8 => int64, stderr => error_unit, stdout => output_unit
98
use :: unix
109
implicit none

examples/mqueue/mqueue.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ program main
5656
!! The size of the buffer passed to `c_mq_receive()` must be greater than
5757
!! the MQ message size given by `mq_getattr()`. We may set the max. message
5858
!! size with `mq_setattr()` beforehand.
59-
use, intrinsic :: iso_c_binding
6059
use :: unix
6160
implicit none
6261
character(len=*), parameter :: MQ_NAME = '/fortran' ! New MQ in, e.g., `/mnt/mqueue/<name>`.

examples/msg/msg.f90

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
! Licence: ISC
55
module ipc
66
!! IPC abstraction module.
7-
use, intrinsic :: iso_c_binding
87
use :: unix
98
implicit none
109
private
@@ -58,7 +57,6 @@ end module ipc
5857
program main
5958
!! Example that sends and receives a message with UNIX System V message
6059
!! queues.
61-
use, intrinsic :: iso_c_binding
6260
use, intrinsic :: iso_fortran_env, only: stderr => error_unit, stdout => output_unit
6361
use :: unix
6462
use :: ipc

examples/mutex/mutex.f90

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
! Licence: ISC
55
module mutex
66
!! Mutex module.
7-
use, intrinsic :: iso_c_binding
87
use :: unix
98
implicit none
109

@@ -31,7 +30,6 @@ end module mutex
3130

3231
program main
3332
!! Example that shows threaded access to a global variable, using a mutex.
34-
use, intrinsic :: iso_c_binding
3533
use :: unix
3634
use :: mutex
3735
implicit none

examples/os/os.F90

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,41 +34,43 @@ end module os
3434

3535
program main
3636
!! Prints the name of the operating system to stdout, using pre-processor
37-
!! macros. Compile the source code with parameter `-cpp` (GNU Fortran) or
38-
!! `-fpp` (IFORT) and `-D__<OS identifier>__`, for example:
37+
!! macros. Pass the parameter `-D__<OS identifier>__` to GNU Fortran, for
38+
!! example:
3939
!!
4040
!! ```
41-
!! $ gfortran -cpp -D__linux__ -o os os.f90
42-
!! $ gfortran -cpp -D__FreeBSD__ -o os os.f90
43-
!! $ gfortran -cpp -D__APPLE__ -o os os.f90
44-
!! $ ifort -fpp -o os os.f90
41+
!! $ gfortran -D__linux__ -o os os.F90
42+
!! $ gfortran -D__FreeBSD__ -o os os.F90
43+
!! $ gfortran -D__APPLE__ -o os os.F90
44+
!! $ ifort -o os os.F90
4545
!! ```
4646
use :: os
4747
implicit none
4848
integer :: current_os
4949

50-
print '(a)', 'Current Operating System'
51-
print '(a)', repeat('-', 24)
50+
print '("Current Operating System")'
51+
print '(24("-"))'
5252

5353
current_os = os_type()
5454

55+
write (* , '("Name: ")', advance='no')
56+
5557
select case (current_os)
5658
case (OS_UNKNOWN)
57-
print '("Name: ", a)', 'Unknown OS'
59+
print '("Unknown OS")'
5860

5961
case (OS_WINDOWS)
60-
print '("Name: ", a)', 'Microsoft Windows (Cygwin, MSYS2)'
62+
print '("Microsoft Windows (Cygwin, MSYS2)")'
6163

6264
case (OS_MACOS)
63-
print '("Name: ", a)', 'macOS'
65+
print '("macOS")'
6466

6567
case (OS_LINUX)
66-
print '("Name: ", a)', 'GNU/Linux'
68+
print '("GNU/Linux")'
6769

6870
case (OS_FREEBSD)
69-
print '("Name: ", a)', 'FreeBSD'
71+
print '("FreeBSD")'
7072

7173
case default
72-
print '(a)', 'Error'
74+
print '("Error")'
7375
end select
7476
end program main

examples/pid/pid.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
! Licence: ISC
55
program main
66
!! Example program that outputs the process id.
7-
use, intrinsic :: iso_c_binding
87
use :: unix
98
implicit none
109

examples/pipe/pipe.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
! Licence: ISC
55
program main
66
!! Example that demonstrates IPC via bidirectional pipes.
7-
use, intrinsic :: iso_c_binding
87
use :: unix
98
implicit none
109

0 commit comments

Comments
 (0)