HASH: Change kind of local variables.

Local variables remain and offset cannot be larger than the size of
input array, so they can be 4-byte integers.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2020-05-13 08:32:27 -03:00
parent e1e025017a
commit 3dbbd0b8b1

View File

@ -93,7 +93,7 @@ module hash
! local variables
!
integer(kind=8) :: remain, offset
integer(kind=4) :: remain, offset
! local arrays
!
@ -135,7 +135,7 @@ module hash
hash = seed + prime5
end if
hash = hash + int(4 * n, kind = 8)
hash = hash + 4_8 * n
do while (remain >= 2)
chk(1) = transfer(input(offset:offset+1), chk(1))
@ -190,7 +190,7 @@ module hash
! local variables
!
integer(kind=8) :: remain, offset
integer(kind=4) :: remain, offset
! local arrays
!
@ -232,7 +232,7 @@ module hash
hash = seed + prime5
end if
hash = hash + int(8 * n, kind = 8)
hash = hash + 8_8 * n
do while (remain >= 1)
hash = ieor(hash, xxh64_round(0_8, transfer(input(offset), 0_8)))
@ -276,7 +276,7 @@ module hash
! local variables
!
integer(kind=8) :: remain, offset
integer(kind=4) :: remain, offset
! local arrays
!
@ -318,7 +318,7 @@ module hash
hash = seed + prime5
end if
hash = hash + int(8 * n, kind = 8)
hash = hash + 8_8 * n
do while (remain >= 1)
hash = ieor(hash, xxh64_round(0_8, transfer(input(offset), 0_8)))
@ -362,7 +362,7 @@ module hash
! local variables
!
integer(kind=8) :: remain, offset
integer(kind=4) :: remain, offset
! local arrays
!
@ -404,7 +404,7 @@ module hash
hash = seed + prime5
end if
hash = hash + int(16 * n, kind = 8)
hash = hash + 16_8 * n
if (remain == 1) then
hash = ieor(hash, xxh64_round(0_8, transfer(dreal(input(offset)), 0_8)))