]> git.sesse.net Git - stockfish/commitdiff
Fix silly icc remark #2259
authorMarco Costalba <mcostalba@gmail.com>
Fri, 12 Aug 2011 08:53:32 +0000 (10:53 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 12 Aug 2011 10:54:54 +0000 (11:54 +0100)
Another stupid remark to quiet out:

remark #2259: non-pointer conversion from "int" to "UINT16={unsigned short}"
may lose significant bits

In this case icc always converts to an integer the result of a shift operation
if the bit size of the operand is smaller, hence the warning when assignin
back to n.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/book.cpp

index 0cf4ed0d6c262d97228cc427ac59d3a384e71dfd..fcaccf6f7560fe92c24cccc22428166f77ca5e03 100644 (file)
@@ -511,7 +511,7 @@ Book& Book::operator>>(T& n) {
   n = 0;
 
   for (size_t i = 0; i < sizeof(T); i++)
-      n = (n << 8) + (T)bookFile.get();
+      n = T((n << 8) + bookFile.get());
 
   return *this;
 }