Skip to content

Commit

Permalink
fix negative kind value in some compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Oct 2, 2024
1 parent fcf50a0 commit ba97d21
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/src/fortran/lib/constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ View source code :source:`fortran/include/constants.f90`
:type: integer
.. f:variable:: i4t
:type: integer
.. f:variable:: i19t
.. f:variable:: i18t
:type: integer

A set of digit type constraints that denote how many decimal digits a number can support.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/fortran/lib/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ View source code :source:`fortran/include/utils.f90`
This stores the answer to a generic problem, storing multiple potential types. If the type field contains
:f:var:`errort`, there was an error in generating the answer. If it is :f:var:`int64t`, it holds data of
type ``integer(i19t)``. If it is :f:var:`stringt`, it holds an allocatable character array.
type ``integer(i18t)``. If it is :f:var:`stringt`, it holds an allocatable character array.

:f integer(i19t) int_value:
:f integer(i18t) int_value:
:f character(len=:) string_value:
:fattrs string_value: allocatable
:f integer(i1d) type:
Expand Down
2 changes: 1 addition & 1 deletion fortran/src/include/constants.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module constants

integer, parameter :: i1t = selected_int_kind(1)
integer, parameter :: i4t = selected_int_kind(4)
integer, parameter :: i19t = selected_int_kind(19)
integer, parameter :: i18t = selected_int_kind(18)

integer(i1t), parameter :: errort = 0
integer(i1t), parameter :: int64t = 1
Expand Down
4 changes: 2 additions & 2 deletions fortran/src/include/utils.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module utils
implicit none

type :: AnswerT
integer(i19t) :: int_value
integer(i18t) :: int_value
character(len=:), allocatable :: string_value
integer(i1t) :: type
end type AnswerT
Expand Down Expand Up @@ -51,7 +51,7 @@ end function get_data_file
function get_answer(id) result(answer)
type(AnswerT) :: answer
integer(i4t), intent(in) :: id
integer(i19t) :: i, j
integer(i18t) :: i, j
integer :: ios, row_start, row_end, line_length
character(len=:), allocatable :: text
character(len=32) :: val
Expand Down

0 comments on commit ba97d21

Please sign in to comment.