Skip to content

Commit

Permalink
Merge pull request #2349 from TurkeyMan/fix_const_violation
Browse files Browse the repository at this point in the history
Fixes a const violation where atomicLoad erases const from the return value
merged-on-behalf-of: Sönke Ludwig <[email protected]>
  • Loading branch information
dlang-bot authored Aug 21, 2019
2 parents 4bf3f58 + bcdc91e commit 2ea51dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/vibe/crypto/cryptorand.d
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ final class SystemRNG : RandomNumberStream {
version (linux) static if (LinuxMaybeHasGetrandom)
{
import core.atomic : atomicLoad, atomicStore;
auto p = atomicLoad(*cast(const shared GET_RANDOM*) &hasGetRandom);
GET_RANDOM p = atomicLoad(*cast(const shared GET_RANDOM*) &hasGetRandom);
if (p == GET_RANDOM.UNINITIALIZED)
{
p = initHasGetRandom() ? GET_RANDOM.AVAILABLE
Expand Down

0 comments on commit 2ea51dc

Please sign in to comment.