diff --git a/include/boost/endian/buffers.hpp b/include/boost/endian/buffers.hpp index 039c93e..a76ccd1 100644 --- a/include/boost/endian/buffers.hpp +++ b/include/boost/endian/buffers.hpp @@ -240,14 +240,14 @@ namespace endian static T load_little(const unsigned char* bytes) BOOST_NOEXCEPT { return static_cast(*bytes | (static_cast(next::load_little(bytes + 1)) << 8)); } - static void store_big(char* bytes, T value) BOOST_NOEXCEPT + static void store_big(unsigned char* bytes, T value) BOOST_NOEXCEPT { - *(bytes - 1) = static_cast(value); + *(bytes - 1) = static_cast(value); next::store_big(bytes - 1, static_cast(static_cast(value) >> 8)); } - static void store_little(char* bytes, T value) BOOST_NOEXCEPT + static void store_little(unsigned char* bytes, T value) BOOST_NOEXCEPT { - *bytes = static_cast(value); + *bytes = static_cast(value); next::store_little(bytes + 1, static_cast(static_cast(value) >> 8)); } }; @@ -259,10 +259,10 @@ namespace endian { return *(bytes - 1); } static T load_little(const unsigned char* bytes) BOOST_NOEXCEPT { return *bytes; } - static void store_big(char* bytes, T value) BOOST_NOEXCEPT - { *(bytes - 1) = static_cast(value); } - static void store_little(char* bytes, T value) BOOST_NOEXCEPT - { *bytes = static_cast(value); } + static void store_big(unsigned char* bytes, T value) BOOST_NOEXCEPT + { *(bytes - 1) = static_cast(value); } + static void store_little(unsigned char* bytes, T value) BOOST_NOEXCEPT + { *bytes = static_cast(value); } }; @@ -273,10 +273,10 @@ namespace endian { return *reinterpret_cast(bytes - 1); } static T load_little(const unsigned char* bytes) BOOST_NOEXCEPT { return *reinterpret_cast(bytes); } - static void store_big(char* bytes, T value) BOOST_NOEXCEPT - { *(bytes - 1) = static_cast(value); } - static void store_little(char* bytes, T value) BOOST_NOEXCEPT - { *bytes = static_cast(value); } + static void store_big(unsigned char* bytes, T value) BOOST_NOEXCEPT + { *(bytes - 1) = static_cast(value); } + static void store_little(unsigned char* bytes, T value) BOOST_NOEXCEPT + { *bytes = static_cast(value); } }; template @@ -330,7 +330,7 @@ namespace endian } # endif unrolled_byte_loops::store_big - (static_cast(bytes) + n_bytes, value); + (static_cast(bytes) + n_bytes, value); } template @@ -349,7 +349,7 @@ namespace endian } # endif unrolled_byte_loops::store_little - (static_cast(bytes), value); + (static_cast(bytes), value); } } // namespace detail