mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-29 10:43:14 +00:00
Change C-style-casts to static_cast in time_helper.h
At the request of @mj-xmr: https://github.com/monero-project/monero/pull/8211#discussion_r822868321
This commit is contained in:
parent
b49ed59166
commit
175b4117a9
1 changed files with 4 additions and 4 deletions
|
@ -58,13 +58,13 @@ namespace misc_utils
|
||||||
inline std::string get_time_interval_string(const time_t& time_)
|
inline std::string get_time_interval_string(const time_t& time_)
|
||||||
{
|
{
|
||||||
time_t tail = time_;
|
time_t tail = time_;
|
||||||
const int days = (int) (tail/(60*60*24));
|
const int days = static_cast<int>(tail/(60*60*24));
|
||||||
tail = tail%(60*60*24);
|
tail = tail%(60*60*24);
|
||||||
const int hours = (int) (tail/(60*60));
|
const int hours = static_cast<int>(tail/(60*60));
|
||||||
tail = tail%(60*60);
|
tail = tail%(60*60);
|
||||||
const int minutes = (int) (tail/(60));
|
const int minutes = static_cast<int>(tail/60);
|
||||||
tail = tail%(60);
|
tail = tail%(60);
|
||||||
const int seconds = (int) tail;
|
const int seconds = static_cast<int>(tail);
|
||||||
|
|
||||||
char tmpbuf[64] = {0};
|
char tmpbuf[64] = {0};
|
||||||
snprintf(tmpbuf, sizeof(tmpbuf) - 1, "d%d.h%d.m%d.s%d", days, hours, minutes, seconds);
|
snprintf(tmpbuf, sizeof(tmpbuf) - 1, "d%d.h%d.m%d.s%d", days, hours, minutes, seconds);
|
||||||
|
|
Loading…
Reference in a new issue