Skip to content

Commit 6120251

Browse files
committedApr 17, 2017
Fix MSVC build broken by 34d32ce
`round` -> `myround` Remove superflous `floor` calls
1 parent 04cc9de commit 6120251

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed
 

Diff for: ‎src/network/serverpackethandler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ void Server::handleCommand_ClientReady(NetworkPacket* pkt)
726726
if (m_shutdown_timer > 0.0f) {
727727
std::wstringstream ws;
728728
ws << L"*** Server shutting down in "
729-
<< duration_to_string(round(m_shutdown_timer)).c_str() << ".";
729+
<< duration_to_string(myround(m_shutdown_timer)).c_str() << ".";
730730
SendChatMessage(pkt->getPeerId(), ws.str());
731731
}
732732
}

Diff for: ‎src/server.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ void Server::AsyncRunStep(bool initial_step)
10471047
std::wstringstream ws;
10481048

10491049
ws << L"*** Server shutting down in "
1050-
<< duration_to_string(round(m_shutdown_timer - dtime)).c_str()
1050+
<< duration_to_string(myround(m_shutdown_timer - dtime)).c_str()
10511051
<< ".";
10521052

10531053
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
35023502
std::wstringstream ws;
35033503

35043504
ws << L"*** Server shutting down in "
3505-
<< duration_to_string(round(m_shutdown_timer)).c_str()
3505+
<< duration_to_string(myround(m_shutdown_timer)).c_str()
35063506
<< ".";
35073507

35083508
infostream << wide_to_utf8(ws.str()).c_str() << std::endl;

Diff for: ‎src/util/string.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,9 @@ inline const char *bool_to_cstr(bool val)
616616

617617
inline const std::string duration_to_string(int sec)
618618
{
619-
int min = floor(sec / 60);
619+
int min = sec / 60;
620620
sec %= 60;
621-
int hour = floor(min / 60);
621+
int hour = min / 60;
622622
min %= 60;
623623

624624
std::stringstream ss;

0 commit comments

Comments
 (0)
Please sign in to comment.