From c67bc00bb70a93b17d0c5574a535f82c8427bdc8 Mon Sep 17 00:00:00 2001 From: Randolph Voorhies Date: Wed, 19 Jun 2013 14:53:26 -0700 Subject: [PATCH] Making sure we're using size_t in load/saveBinary --- include/cereal/binary_archive/binary_archive.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cereal/binary_archive/binary_archive.hpp b/include/cereal/binary_archive/binary_archive.hpp index c3f1f1d9..869b9541 100644 --- a/include/cereal/binary_archive/binary_archive.hpp +++ b/include/cereal/binary_archive/binary_archive.hpp @@ -45,7 +45,7 @@ namespace cereal //! Writes size bytes of data to the output stream void saveBinary( const void * data, size_t size ) { - auto const writtenSize = itsStream.rdbuf()->sputn( reinterpret_cast( data ), size ); + size_t const writtenSize = itsStream.rdbuf()->sputn( reinterpret_cast( data ), size ); if(writtenSize != size) throw Exception("Failed to write " + std::to_string(size) + " bytes to output stream! Wrote " + std::to_string(writtenSize)); @@ -100,7 +100,7 @@ namespace cereal //! Reads size bytes of data from the input stream void loadBinary( void * const data, size_t size ) { - auto const readSize = itsStream.rdbuf()->sgetn( reinterpret_cast( data ), size ); + size_t const readSize = itsStream.rdbuf()->sgetn( reinterpret_cast( data ), size ); if(readSize != size) throw Exception("Failed to read " + std::to_string(size) + " bytes from input stream! Read " + std::to_string(readSize));