From: Marco Costalba Date: Sun, 26 Feb 2012 11:04:35 +0000 (+0100) Subject: Fix MSVC warning on streampos to size_t conversion X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=8751b18cf0b5ddb9d7549a465444d5ace215a097;hp=2608b9249d9c25a699c8db8725e35bd4ec0b65ab 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 --- diff --git a/src/book.cpp b/src/book.cpp index d5bab90b..1dd5aa6d 100644 --- a/src/book.cpp +++ b/src/book.cpp @@ -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()) {