Fix warnings

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2026-05-06 11:31:07 +02:00
parent 49564e2e5e
commit 1be7acaedd
11 changed files with 76 additions and 60 deletions

View File

@@ -64,6 +64,19 @@ int settimeofday(const struct timeval* tp, const struct timezone* tzp)
}
#endif
struct tm *gmtime_utc(const time_t *timep, struct tm *result) {
#ifdef _WIN32
struct tm *tmp = gmtime(timep);
if (tmp == NULL) {
return NULL;
}
*result = *tmp;
return result;
#else
return gmtime_r(timep, result);
#endif
}
#ifdef ENABLE_EMULATION
bool set_rtc = true;
#else
@@ -79,7 +92,7 @@ void set_rtc_time(time_t t) {
struct timespec tv = {.tv_sec = t, .tv_nsec = 0};
aon_timer_set_time(&tv);
#else
struct timeval tv = {.tv_sec = t, .tv_usec = 0};
struct timeval tv = {.tv_sec = (long)t, .tv_usec = 0};
settimeofday(&tv, NULL);
#endif
set_rtc = true;