Skip to content

Commit e280805

Browse files
committed
Resolve MSVC C4146 Warning
1 parent 6f630a8 commit e280805

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/random/php_random_uint128.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static inline uint64_t php_random_pcgoneseq128xslrr64_rotr64(php_random_uint128_
8181
v = (num.hi ^ num.lo),
8282
s = num.hi >> 58U;
8383

84-
return (v >> s) | (v << ((-s) & 63));
84+
return (v >> s) | (v << ((~s + 1) & 63));
8585
}
8686
# else
8787
typedef __uint128_t php_random_uint128_t;
@@ -121,7 +121,7 @@ static inline uint64_t php_random_pcgoneseq128xslrr64_rotr64(php_random_uint128_
121121
v = ((uint64_t) (num >> 64U)) ^ (uint64_t) num,
122122
s = num >> 122U;
123123

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

0 commit comments

Comments
 (0)