From cfa2611550bc7da65855a78af0574b65deb81766 Mon Sep 17 00:00:00 2001 From: Green Lightning Date: Thu, 6 Jan 2022 21:12:03 +0100 Subject: [PATCH] Add specializations of swapEndian to avoid compiler warnings (#30) --- happly.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/happly.h b/happly.h index 01d8450..46ded3e 100644 --- a/happly.h +++ b/happly.h @@ -238,6 +238,10 @@ T swapEndian(T val) { return val; } +// The following specializations for single-byte types are used to avoid compiler warnings. +template <> int8_t swapEndian(int8_t val) { return val; } +template <> uint8_t swapEndian(uint8_t val) { return val; } + // Unpack flattened list from the convention used in TypedListProperty template