[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

Miklos Vajna vmiklos at collabora.co.uk
Mon Jul 25 06:27:41 UTC 2016


 loolwsd/LOOLWSD.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit aa9902970cef0d9f0921da2c8882c45f9ffbfeef
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Jul 25 08:26:59 2016 +0200

    LOOLWSD: avoid performing multiplication at int level
    
    Change-Id: I5d293482860954144f7664638443d5c72ba9a8cc

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 49ccb5b..f7b7bce 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -220,7 +220,7 @@ static void prespawnChildren()
     }
 
     const auto duration = (std::chrono::steady_clock::now() - lastForkRequestTime);
-    if (std::chrono::duration_cast<std::chrono::milliseconds>(duration).count() <= CHILD_TIMEOUT_SECS * 1000)
+    if (std::chrono::duration_cast<std::chrono::milliseconds>(duration).count() <= static_cast<int64_t>(CHILD_TIMEOUT_SECS) * 1000)
     {
         // Not enough time passed to balance children.
         return;
@@ -284,7 +284,7 @@ static std::shared_ptr<ChildProcess> getNewChild()
 
         Log::debug("getNewChild: No live child, forking more.");
     }
-    while (chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - startTime).count() < CHILD_TIMEOUT_SECS * 4000);
+    while (chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - startTime).count() < static_cast<int64_t>(CHILD_TIMEOUT_SECS) * 4000);
 
     Log::debug("getNewChild: Timed out while waiting for new child.");
     return nullptr;


More information about the Libreoffice-commits mailing list