From a4a99de0eb17b1de1be99534b5184fd1f1c53c37 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 29 Jun 2020 00:22:02 -0700 Subject: [PATCH] [constexpr] bswap --- src/hb.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb.hh b/src/hb.hh index 0512304b0..1e8919861 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -515,9 +515,9 @@ _hb_roundf (float x) { return floorf (x + .5f); } #define roundf(x) _hb_roundf(x) /* Endian swap, used in Windows related backends */ -static inline uint16_t hb_uint16_swap (const uint16_t v) +static inline constexpr uint16_t hb_uint16_swap (uint16_t v) { return (v >> 8) | (v << 8); } -static inline uint32_t hb_uint32_swap (const uint32_t v) +static inline constexpr uint32_t hb_uint32_swap (uint32_t v) { return (hb_uint16_swap (v) << 16) | hb_uint16_swap (v >> 16); } /*