summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-03-14 15:01:52 +0000
committerCarl Hetherington <cth@carlh.net>2019-12-03 17:01:32 +0100
commit9c508f6e70776ac3b2a9f1dd6153cd93e8ad7d62 (patch)
treea6ff8fbf8605eee958885e66fcb48852064d84a8
parent565f3a6b5212bdbcc81e23ec86c771cb6fd7dd12 (diff)
Fix / hide some warnings on Linux.
-rwxr-xr-xsrc/KM_prng.cpp6
-rw-r--r--wscript4
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;
}
diff --git a/wscript b/wscript
index 89f2709..dee54d2 100644
--- a/wscript
+++ b/wscript
@@ -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: