build: quiesce type conversion warnings

This commit is contained in:
Danny Robson 2016-06-29 17:55:12 +10:00
parent 0e29675ef5
commit 74fc943f53
3 changed files with 11 additions and 2 deletions

View File

@ -23,7 +23,8 @@
#include "./ice.hpp" #include "./ice.hpp"
#include "endian.hpp" #include "../endian.hpp"
#include "../debug.hpp"
#include <cstdint> #include <cstdint>
@ -180,7 +181,7 @@ ice_sboxes_init (void)
ice_smod[j][row] ice_smod[j][row]
) << (24 - j * 8); ) << (24 - j * 8);
ice_sbox[j][i] = ice_perm32 (p); ice_sbox[j][i] = ice_perm32 (static_cast<uint32_t>(p));
} }
} }
} }
@ -394,6 +395,8 @@ ice::set (const uint64_t *_key_first, const uint64_t *_key_last)
auto key = reinterpret_cast<const uint8_t*> (_key_first); auto key = reinterpret_cast<const uint8_t*> (_key_first);
if (m_rounds == 8) { if (m_rounds == 8) {
CHECK_EQ (_key_last - _key_first, 8 * 2 + 1);
std::array<uint16_t,4> kb; std::array<uint16_t,4> kb;
for (unsigned i = 0; i < 4; i++) for (unsigned i = 0; i < 4; i++)
@ -404,6 +407,8 @@ ice::set (const uint64_t *_key_first, const uint64_t *_key_last)
} }
for (unsigned i = 0; i < m_size; i++) { for (unsigned i = 0; i < m_size; i++) {
CHECK_EQ ((unsigned)(_key_last - _key_first), m_size * 8u + 4u * 2u + 1u);
std::array<uint16_t,4> kb; std::array<uint16_t,4> kb;
for (unsigned j = 0; j < 4; j++) for (unsigned j = 0; j < 4; j++)

View File

@ -388,6 +388,8 @@ json::tree::node::as_chars (void) const&
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
namespace json { namespace tree { namespace json { namespace tree {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuseless-cast"
template <> template <>
bool node::as (void) const bool node::as (void) const
{ {
@ -446,6 +448,7 @@ namespace json { namespace tree {
{ {
return static_cast<int64_t> (as_sint ()); return static_cast<int64_t> (as_sint ());
} }
#pragma GCC diagnostic pop
} } } }

View File

@ -19,6 +19,7 @@
using util::rand::lcg; using util::rand::lcg;
///////////////////////////////////////////////////////////////////////////////
template <typename T> template <typename T>
static constexpr static constexpr
bool is_coprime (T M, T C) bool is_coprime (T M, T C)