From 968ef4115c086a59c04ce05f8123f6f06e7b9791 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 23 Mar 2018 23:18:11 -0700 Subject: [PATCH] ircd: Fix signage related. --- ircd/json.cc | 6 +++--- ircd/server.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ircd/json.cc b/ircd/json.cc index ac8714495..83231b72a 100644 --- a/ircd/json.cc +++ b/ircd/json.cc @@ -1312,7 +1312,7 @@ size_t ircd::json::array::serialized(const it &b, const it &e) { - const size_t ret(1 + !std::distance(b, e)); + const size_t ret(1 + (b == e)); return std::accumulate(b, e, ret, [] (auto ret, const string_view &value) { @@ -1489,7 +1489,7 @@ size_t ircd::json::serialized(const member *const &begin, const member *const &end) { - const size_t ret(1 + !std::distance(begin, end)); + const size_t ret(1 + (begin == end)); return std::accumulate(begin, end, ret, [] (auto ret, const auto &member) { @@ -1646,7 +1646,7 @@ ircd::json::serialized(const value *const &begin, const value *const &end) { // One opening '[' and either one ']' or comma count. - const size_t ret(1 + !std::distance(begin, end)); + const size_t ret(1 + (begin == end)); return std::accumulate(begin, end, size_t(ret), [] (auto ret, const value &v) { diff --git a/ircd/server.cc b/ircd/server.cc index c972051eb..885452cf2 100644 --- a/ircd/server.cc +++ b/ircd/server.cc @@ -1855,7 +1855,7 @@ noexcept // If the content is chunked encoding and the tag is in the phase of // receiving the chunk head we have to copy what's been received of that // head so far so the grammar can parse a coherent head to continue. - if(tag.state.chunk_length == -1) + if(tag.state.chunk_length == size_t(-1)) { const const_buffer src {