[build] remove use of memset

This commit is contained in:
Timothy Stack 2022-04-04 11:53:47 -07:00
parent 5eaf1c4332
commit 292724d7ad
3 changed files with 6 additions and 3 deletions

View File

@ -55,7 +55,7 @@ struct date_time_scanner {
void clear()
{
this->dts_base_time = 0;
memset(&this->dts_base_tm, 0, sizeof(this->dts_base_tm));
this->dts_base_tm = exttm{};
this->dts_fmt_lock = -1;
this->dts_fmt_len = -1;
};

View File

@ -97,6 +97,11 @@ struct exttm {
unsigned int et_flags{0};
long et_gmtoff{0};
exttm()
{
memset(&this->et_tm, 0, sizeof(this->et_tm));
}
bool operator==(const exttm& other) const
{
return memcmp(this, &other, sizeof(exttm)) == 0;

View File

@ -201,7 +201,6 @@ public:
time_t now;
time(&now);
memset(&tm, 0, sizeof(tm));
tm.et_tm = *gmtime(&now);
return this->adjust(tm);
};
@ -210,7 +209,6 @@ public:
{
struct exttm tm;
memset(&tm, 0, sizeof(tm));
tm.et_tm = *gmtime(&tv.tv_sec);
tm.et_nsec = tv.tv_usec * 1000;
return this->adjust(tm);