From 61202513208b23d3e7a2a91d10aba154e6cbf352 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Mon, 17 Apr 2017 13:49:48 +0200 Subject: [PATCH] Fix MSVC build broken by 34d32ce `round` -> `myround` Remove superflous `floor` calls --- src/network/serverpackethandler.cpp | 2 +- src/server.cpp | 4 ++-- src/util/string.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 2e4c5b6be..174b827f0 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -726,7 +726,7 @@ void Server::handleCommand_ClientReady(NetworkPacket* pkt) if (m_shutdown_timer > 0.0f) { std::wstringstream ws; ws << L"*** Server shutting down in " - << duration_to_string(round(m_shutdown_timer)).c_str() << "."; + << duration_to_string(myround(m_shutdown_timer)).c_str() << "."; SendChatMessage(pkt->getPeerId(), ws.str()); } } diff --git a/src/server.cpp b/src/server.cpp index 5328b6897..a9e5c3d08 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1047,7 +1047,7 @@ void Server::AsyncRunStep(bool initial_step) std::wstringstream ws; ws << L"*** Server shutting down in " - << duration_to_string(round(m_shutdown_timer - dtime)).c_str() + << duration_to_string(myround(m_shutdown_timer - dtime)).c_str() << "."; infostream << wide_to_utf8(ws.str()).c_str() << std::endl; @@ -3502,7 +3502,7 @@ void Server::requestShutdown(const std::string &msg, bool reconnect, float delay std::wstringstream ws; ws << L"*** Server shutting down in " - << duration_to_string(round(m_shutdown_timer)).c_str() + << duration_to_string(myround(m_shutdown_timer)).c_str() << "."; infostream << wide_to_utf8(ws.str()).c_str() << std::endl; diff --git a/src/util/string.h b/src/util/string.h index c155d2f4a..1a0b9f60d 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -616,9 +616,9 @@ inline const char *bool_to_cstr(bool val) inline const std::string duration_to_string(int sec) { - int min = floor(sec / 60); + int min = sec / 60; sec %= 60; - int hour = floor(min / 60); + int hour = min / 60; min %= 60; std::stringstream ss; -- 2.25.1