1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Fix MSVC warning on streampos to size_t conversion

Fix this warning with MSVC 64 bits:

warning C4244: '=' : conversion from 'std::streampos' to 'size_t',
possible loss of data

Point is that std::streampos could be negative, while size_t
is always non-negative.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2012-02-26 12:04:35 +01:00
parent 2608b9249d
commit 8751b18cf0

View file

@ -383,7 +383,7 @@ bool Book::open(const char* fName) {
return false; // Silently fail if the file is not found
// Get the book size in number of entries, we are already at the end of file
size = tellg() / sizeof(BookEntry);
size = (size_t)tellg() / sizeof(BookEntry);
if (!good())
{