diff --git a/include/ircd/buffer/buffer.h b/include/ircd/buffer/buffer.h index b376ba8c8..4df46d544 100644 --- a/include/ircd/buffer/buffer.h +++ b/include/ircd/buffer/buffer.h @@ -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); diff --git a/ircd/lexical.cc b/ircd/lexical.cc index 192b449d6..7184d68ce 100644 --- a/ircd/lexical.cc +++ b/ircd/lexical.cc @@ -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 { diff --git a/modules/m_room.cc b/modules/m_room.cc index 364d1ff2a..70abb3d01 100644 --- a/modules/m_room.cc +++ b/modules/m_room.cc @@ -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 {