Mercurial > code
diff C++/Pack.h @ 219:8fc177bbc4a6
Update some code
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 08 May 2014 22:55:48 +0200 |
parents | 523156bb3af5 |
children | c6513d9c696b |
line wrap: on
line diff
--- a/C++/Pack.h Thu May 08 18:57:47 2014 +0200 +++ b/C++/Pack.h Thu May 08 22:55:48 2014 +0200 @@ -58,7 +58,7 @@ static_assert(TypeInfo<T>::supported, "unsupported type"); T ret = convert(value, endian); - out.write(reinterpret_cast<char *>(&ret), TypeInfo<T>::size); + out.write(reinterpret_cast<unsigned char *>(&ret), TypeInfo<T>::size); writeFile(out, endian, args...); } @@ -72,12 +72,15 @@ { static_assert(TypeInfo<T>::supported, "unsupported type"); - in.read(reinterpret_cast<char *>(&value), TypeInfo<T>::size); + in.read(reinterpret_cast<unsigned char *>(&value), TypeInfo<T>::size); value = convert(value, endian); readFile(in, endian, args...); } public: + /** + * Host system endian mode. + */ static const Endian mode; /**