0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd: Reduce several strict-overflow & related warnings.

This commit is contained in:
Jason Volk 2019-03-01 11:35:07 -08:00
parent b15fd581c7
commit 70a47c98b1
3 changed files with 11 additions and 11 deletions

View file

@ -293,9 +293,9 @@ ircd::buffer::move(it &dest,
{
assert(dest <= stop);
const it ret(dest);
const ssize_t &srcsz(size(src));
const ssize_t &remain(std::distance(ret, stop));
const ssize_t &mvsz(std::min(srcsz, remain));
const size_t &srcsz(size(src));
const size_t &remain(std::distance(ret, stop));
const size_t &mvsz(std::min(srcsz, remain));
dest += mvsz;
assert(dest <= stop);
assert(mvsz <= srcsz);
@ -313,9 +313,9 @@ ircd::buffer::copy(it &dest,
{
assert(dest <= stop);
const it ret(dest);
const ssize_t &srcsz(size(src));
const ssize_t &remain(std::distance(ret, stop));
const ssize_t &cpsz(std::min(srcsz, remain));
const size_t &srcsz(size(src));
const size_t &remain(std::distance(ret, stop));
const size_t &cpsz(std::min(srcsz, remain));
dest += cpsz;
assert(dest <= stop);
assert(cpsz <= srcsz);

View file

@ -415,10 +415,10 @@ ircd::replace(const string_view &s,
const char &before,
const string_view &after)
{
const auto occurs
{
const uint32_t occurs
(
std::count(begin(s), end(s), before)
};
);
const size_t size
{

View file

@ -832,7 +832,7 @@ room_herd(const m::room &room,
return true;
});
ssize_t i(0);
size_t i(0);
for(const m::event::id &event_id : event_ids)
if(exists(event_id))
{
@ -845,7 +845,7 @@ room_herd(const m::room &room,
room
};
for(; i >= 0 && head.count() > 1; --i)
for(; i + 1 >= 1 && head.count() > 1; --i)
{
const auto eid
{