mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 10:55:57 -04:00
Merge branch 'streamsize'
This commit is contained in:
commit
304f1d1931
@ -79,7 +79,11 @@ private:
|
||||
template <class SS>
|
||||
typename std::enable_if<std::is_base_of<std::istream, SS>::value, size_t>::type ReadHelper(void* ptr, size_t size, size_t maxnum) {
|
||||
stream_.read(static_cast<char*>(ptr), size * maxnum);
|
||||
size_t nread = stream_.gcount();
|
||||
|
||||
// http://en.cppreference.com/w/cpp/io/streamsize:
|
||||
// "Except in the constructors of std::strstreambuf,
|
||||
// negative values of std::streamsize are never used"
|
||||
size_t nread = static_cast<size_t>(stream_.gcount());
|
||||
|
||||
// eof is OK
|
||||
if (stream_.rdstate() == (std::ios_base::eofbit | std::ios_base::failbit))
|
||||
|
Loading…
x
Reference in New Issue
Block a user