mirror of https://github.com/tstack/lnav.git
[build] remove use of memset
This commit is contained in:
parent
5eaf1c4332
commit
292724d7ad
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue