diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-03-14 15:01:52 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-11-23 23:31:38 +0100 |
| commit | 5b084268d59dd155006a34aed45083be916ce88a (patch) | |
| tree | ae6a4cce9e95009699e620844ce51feeb9b6711d /src/KM_prng.cpp | |
| parent | 3f91b7bdb1232df77349f33b82f18b535e99c505 (diff) | |
Fix / hide some warnings on Linux.
Diffstat (limited to 'src/KM_prng.cpp')
| -rwxr-xr-x | src/KM_prng.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/KM_prng.cpp b/src/KM_prng.cpp index 2b34e2e..b0a5a9f 100755 --- a/src/KM_prng.cpp +++ b/src/KM_prng.cpp @@ -116,7 +116,8 @@ public: AutoMutex Lock(m_Lock); AES_set_encrypt_key(sha_buf, RNG_KEY_SIZE_BITS, &m_Context); - *(ui32_t*)(m_ctr_buf + 12) = 1; + ui32_t* m_ctr_buf_int = reinterpret_cast<ui32_t*> (m_ctr_buf + 12); + *m_ctr_buf_int = 1; } // @@ -130,7 +131,8 @@ public: while ( gen_count + RNG_BLOCK_SIZE <= len ) { AES_encrypt(m_ctr_buf, buf + gen_count, &m_Context); - *(ui32_t*)(m_ctr_buf + 12) += 1; + ui32_t* m_ctr_buf_int = reinterpret_cast<ui32_t*> (m_ctr_buf + 12); + *m_ctr_buf_int += 1; gen_count += RNG_BLOCK_SIZE; } |
