diff options
author | Marcel Raad <MarcelRaad@users.noreply.github.com> | 2018-05-11 01:59:21 +0200 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-05-10 19:59:21 -0400 |
commit | 7c1d296283fab97a2a5d34445b8c4adca0b9ea0e (patch) | |
tree | 9444a3cfe124d3f185c27e331d3a733d5c412dc8 /crc.h | |
parent | a07a0e5e5f5f9ad8c3533202b6a7cd3a8036f5f4 (diff) | |
download | cryptopp-git-7c1d296283fab97a2a5d34445b8c4adca0b9ea0e.tar.gz |
Fix clang warnings in headers (#655)
* remove superfluous semicolon
* Remove C-style casts from public headers
clang warns about them with -Wold-style-cast. It also warns about
implicitly casting away const with -Wcast-qual. Fix both by removing
unnecessary casts and converting the remaining ones to C++ casts.
Diffstat (limited to 'crc.h')
-rw-r--r-- | crc.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -34,7 +34,7 @@ public: std::string AlgorithmName() const {return StaticAlgorithmName();}
void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);}
- byte GetCrcByte(size_t i) const {return ((byte *)&(m_crc))[i];}
+ byte GetCrcByte(size_t i) const {return reinterpret_cast<const byte *>(&m_crc)[i];}
protected:
void Reset() {m_crc = CRC32_NEGL;}
@@ -59,7 +59,7 @@ public: std::string AlgorithmName() const {return StaticAlgorithmName();}
void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);}
- byte GetCrcByte(size_t i) const {return ((byte *)&(m_crc))[i];}
+ byte GetCrcByte(size_t i) const {return reinterpret_cast<const byte *>(&m_crc)[i];}
protected:
void Reset() {m_crc = CRC32_NEGL;}
|