From e4a5a755d0b3bcac595641ce5f690ee45d3f5ade Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 23 Jun 2019 00:05:32 -0600 Subject: [PATCH] ircd::base: Fix lack of constexpr ceil(). --- include/ircd/base.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ircd/base.h b/include/ircd/base.h index 47e8d699e..f3487272d 100644 --- a/include/ircd/base.h +++ b/include/ircd/base.h @@ -58,7 +58,7 @@ ircd::b64decode_size(const string_view &in) constexpr size_t ircd::b64decode_size(const size_t &in) { - return ceil(in * 0.75); + return (in * 0.75) + 1; //XXX: constexpr ceil() } inline size_t @@ -70,7 +70,7 @@ ircd::b64encode_unpadded_size(const const_buffer &in) constexpr size_t ircd::b64encode_unpadded_size(const size_t &in) { - return ceil(in * (4.0 / 3.0)); + return (in * (4.0 / 3.0)) + 1; //XXX: constexpr ceil() } inline size_t @@ -82,7 +82,7 @@ ircd::b64encode_size(const const_buffer &in) constexpr size_t ircd::b64encode_size(const size_t &in) { - return ceil(in * (4.0 / 3.0)) + (3 - in % 3) % 3; + return ((in * (4.0 / 3.0)) + 1) + (3 - in % 3) % 3; //XXX: constexpr ceil } inline size_t