@@ -10,37 +10,16 @@ logical(c_bool) function logical_not(L) bind(C)
10
10
11
11
logical (c_bool), intent (in ), value :: L
12
12
13
- logical :: Ld
14
- integer :: i
15
- integer (C_INT) :: ic
16
-
17
- character (* ), parameter :: fmt = ' (a16,2x,i3,2x,z8)'
18
-
19
- ! > avoid uninitialized variable warning
20
- i = 0
21
- ic = 0
22
- Ld = .false.
23
-
24
- ! > workaround for nvfortran 24.3 etc.
25
- ! ! nvfortran reference guide:
26
13
! ! The logical constants .TRUE. and .FALSE. are defined to be the four-byte values -1 and 0 respectively.
27
14
! ! A logical expression is defined to be .TRUE. if its least significant bit is 1 and .FALSE. otherwise.
28
- ! if(L) then
29
- ! logical_not = .false._C_BOOL
30
- ! else
31
- ! logical_not = .true._C_BOOL
32
- ! endif
33
15
34
16
logical_not = .not. L
35
17
36
18
print ' (/, a, l1, a, l1)' , " logical_not(" , L, " ): " , logical_not
37
19
38
20
39
- print ' (a16,2x,a,2x,a8)' , " storage_size()" , " bits" , " hex"
40
- print fmt, " logical:" , storage_size(Ld), Ld
41
- print fmt, " C_BOOL: " , storage_size(L), L
42
- print fmt, " integer: " , storage_size(i), i
43
- print fmt, " C_INT: " , storage_size(ic), ic
21
+ print ' (a16,2x,a,2x,a8,2x,a8)' , " storage_size()" , " bits" , " hex(in)" , " hex(out)"
22
+ print ' (a16,2x,i3,2x,z8,2x,z8)' , " C_BOOL: " , storage_size(L), L, logical_not
44
23
45
24
end function logical_not
46
25
0 commit comments