Fix pedantic clang warnings. (nw)

This commit is contained in:
couriersud 2017-03-30 23:24:48 +02:00
parent aacee827fe
commit 0c1b6430d0
2 changed files with 3 additions and 3 deletions

View File

@ -317,8 +317,8 @@ public:
char b[4];
if (m_strm.read(&b[0], 1) != 1)
return false;
const unsigned l = pstring::traits_type::codelen(b);
for (unsigned i = 1; i < l; i++)
const std::size_t l = pstring::traits_type::codelen(b);
for (std::size_t i = 1; i < l; i++)
if (m_strm.read(&b[i], 1) != 1)
return false;
c = pstring::traits_type::code(b);

View File

@ -110,7 +110,7 @@ public:
const_iterator &operator=(const const_iterator &rhs) noexcept = default;
const_iterator &operator=(const_iterator &&rhs) noexcept = default;
const_iterator& operator++() noexcept { p += traits_type::codelen(&(*p)); return *this; }
const_iterator& operator++() noexcept { p += static_cast<difference_type>(traits_type::codelen(&(*p))); return *this; }
const_iterator operator++(int) noexcept { const_iterator tmp(*this); operator++(); return tmp; }
bool operator==(const const_iterator& rhs) const noexcept { return p == rhs.p; }