From: Alex Rousskov Date: Fri, 14 Oct 2011 22:43:20 +0000 (-0600) Subject: Avoid "double to int" compiler warnings. X-Git-Tag: BumpSslServerFirst.take01~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75017bc9818bae0f22a79e0ec60e0aad6e152577;p=thirdparty%2Fsquid.git Avoid "double to int" compiler warnings. Could also use integer arithmetic instead of 1e3 double, but it is often safer to use doubles when it comes to formulas because significant integer rounding errors are difficult to spot. --- diff --git a/src/DiskIO/IpcIo/IpcIoFile.cc b/src/DiskIO/IpcIo/IpcIoFile.cc index 3f6a889e5d..cb8869d138 100644 --- a/src/DiskIO/IpcIo/IpcIoFile.cc +++ b/src/DiskIO/IpcIo/IpcIoFile.cc @@ -367,7 +367,7 @@ IpcIoFile::canWait() const if (ioRate > 0) { // if there are N requests pending, the new one will wait at // least N/max-swap-rate seconds - rateWait = 1e3 * queue->outSize(diskId) / ioRate; + rateWait = static_cast(1e3 * queue->outSize(diskId) / ioRate); // adjust N/max-swap-rate value based on the queue "balance" // member, in case we have been borrowing time against future // I/O already