From 8751b18cf0b5ddb9d7549a465444d5ace215a097 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 26 Feb 2012 12:04:35 +0100 Subject: [PATCH] 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 --- src/book.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()) { -- 2.39.2