uri: silence some narrowing conversion warnings

This commit is contained in:
Danny Robson 2022-08-18 13:11:54 +10:00
parent 1828687a7e
commit 52e9309949
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
#include "./uri.hpp" #include "./uri.hpp"
#include "./cast.hpp"
#include "./string.hpp" #include "./string.hpp"
#include "./debug/panic.hpp" #include "./debug/panic.hpp"
@ -183,7 +184,7 @@ uri::set (component c, std::string_view val)
val val
); );
m_offsets[c].second = m_offsets[c].first + val.size (); m_offsets[c].second = cruft::cast::lossless<int> (m_offsets[c].first + val.size ());
for (int i = c + 1; i != component::NUM_COMPONENTS; ++i) { for (int i = c + 1; i != component::NUM_COMPONENTS; ++i) {
m_offsets[i].first += diff; m_offsets[i].first += diff;

View File

@ -91,8 +91,8 @@ cruft::uri::parse (void)
CHECK (starts[idx]); CHECK (starts[idx]);
m_offsets[idx].first = starts[idx] - str; m_offsets[idx].first = cruft::cast::narrow<int> (starts[idx] - str);
m_offsets[idx].second = p - str; m_offsets[idx].second = cruft::cast::narrow<int> ( p - str);
}; };
bool __success = false; bool __success = false;