From 92c7559e1f2356526e950dfae39cbd86fc601f45 Mon Sep 17 00:00:00 2001 From: Lukas Zeller Date: Sat, 25 Jun 2022 00:44:28 +0200 Subject: [PATCH 1/2] platform:linux:SystemTimeSupport: make compatible with time64 (64-bit time_t, as in musl) --- src/platform/Linux/SystemTimeSupport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/Linux/SystemTimeSupport.cpp b/src/platform/Linux/SystemTimeSupport.cpp index fc16459c302391..200d234044cb78 100644 --- a/src/platform/Linux/SystemTimeSupport.cpp +++ b/src/platform/Linux/SystemTimeSupport.cpp @@ -92,7 +92,7 @@ CHIP_ERROR ClockImpl::SetClock_RealTime(Microseconds64 aNewCurTime) const time_t timep = tv.tv_sec; struct tm calendar; localtime_r(&timep, &calendar); - ChipLogProgress(DeviceLayer, "Real time clock set to %ld (%04d/%02d/%02d %02d:%02d:%02d UTC)", tv.tv_sec, calendar.tm_year, + ChipLogProgress(DeviceLayer, "Real time clock set to %lld (%04d/%02d/%02d %02d:%02d:%02d UTC)", static_cast(tv.tv_sec), calendar.tm_year, calendar.tm_mon, calendar.tm_mday, calendar.tm_hour, calendar.tm_min, calendar.tm_sec); } #endif // CHIP_PROGRESS_LOGGING From e4426da40a1982d8403372da0f241978cd6eb844 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Sun, 26 Jun 2022 20:05:52 +0000 Subject: [PATCH 2/2] Restyled by clang-format --- src/platform/Linux/SystemTimeSupport.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform/Linux/SystemTimeSupport.cpp b/src/platform/Linux/SystemTimeSupport.cpp index 200d234044cb78..7eed058256ac3e 100644 --- a/src/platform/Linux/SystemTimeSupport.cpp +++ b/src/platform/Linux/SystemTimeSupport.cpp @@ -92,8 +92,9 @@ CHIP_ERROR ClockImpl::SetClock_RealTime(Microseconds64 aNewCurTime) const time_t timep = tv.tv_sec; struct tm calendar; localtime_r(&timep, &calendar); - ChipLogProgress(DeviceLayer, "Real time clock set to %lld (%04d/%02d/%02d %02d:%02d:%02d UTC)", static_cast(tv.tv_sec), calendar.tm_year, - calendar.tm_mon, calendar.tm_mday, calendar.tm_hour, calendar.tm_min, calendar.tm_sec); + ChipLogProgress(DeviceLayer, "Real time clock set to %lld (%04d/%02d/%02d %02d:%02d:%02d UTC)", + static_cast(tv.tv_sec), calendar.tm_year, calendar.tm_mon, calendar.tm_mday, calendar.tm_hour, + calendar.tm_min, calendar.tm_sec); } #endif // CHIP_PROGRESS_LOGGING return CHIP_NO_ERROR;