Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/random/php_random_uint128.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static inline uint64_t php_random_pcgoneseq128xslrr64_rotr64(php_random_uint128_
v = (num.hi ^ num.lo),
s = num.hi >> 58U;

return (v >> s) | (v << ((-s) & 63));
return (v >> s) | (v << ((~s + 1) & 63));
}
# else
typedef __uint128_t php_random_uint128_t;
Expand Down Expand Up @@ -121,7 +121,7 @@ static inline uint64_t php_random_pcgoneseq128xslrr64_rotr64(php_random_uint128_
v = ((uint64_t) (num >> 64U)) ^ (uint64_t) num,
s = num >> 122U;

return (v >> s) | (v << ((-s) & 63));
return (v >> s) | (v << ((~s + 1) & 63));
}
# endif

Expand Down