Skip to content

Commit

Permalink
Fix MSVC build broken by 34d32ce
Browse files Browse the repository at this point in the history
`round` -> `myround`
Remove superflous `floor` calls
  • Loading branch information
SmallJoker committed Apr 17, 2017
1 parent 04cc9de commit 6120251
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/network/serverpackethandler.cpp
Expand Up @@ -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());
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/server.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/util/string.h
Expand Up @@ -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;
Expand Down

0 comments on commit 6120251

Please sign in to comment.