diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-03-14 15:01:52 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-12-03 17:01:32 +0100 |
| commit | 9c508f6e70776ac3b2a9f1dd6153cd93e8ad7d62 (patch) | |
| tree | a6ff8fbf8605eee958885e66fcb48852064d84a8 | |
| parent | 565f3a6b5212bdbcc81e23ec86c771cb6fd7dd12 (diff) | |
Fix / hide some warnings on Linux.
| -rwxr-xr-x | src/KM_prng.cpp | 6 | ||||
| -rw-r--r-- | wscript | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/KM_prng.cpp b/src/KM_prng.cpp index 5afc598..31ae93e 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; } @@ -19,12 +19,16 @@ def configure(conf): conf.env.TARGET_WINDOWS = conf.options.target_windows conf.env.TARGET_OSX = sys.platform == 'darwin' + conf.env.TARGET_LINUX = not conf.env.TARGET_WINDOWS and not conf.env.TARGET_OSX conf.env.STATIC = conf.options.static conf.env.VERSION = VERSION if conf.env.TARGET_OSX: conf.env.append_value('CXXFLAGS', ['-Wno-unused-result', '-Wno-unused-parameter', '-Wno-unused-local-typedef']) + if conf.env.TARGET_LINUX: + conf.env.append_value('CXXFLAGS', ['-Wno-unused-result']) + conf.check_cfg(package='openssl', args='--cflags --libs', uselib_store='OPENSSL', mandatory=True) if conf.options.target_windows: |
