diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-13 08:32:06 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-13 08:32:06 +0300 |
| commit | b46f12e185554e0ff63bf54d9491646be089a3ee (patch) | |
| tree | fae98ceba1bacc7f3a082f6baa597becee9109c4 /src/c/fastforge_logic.c | |
| parent | e08d694ff17fe9919979e8cbd6613888a135fc78 (diff) | |
n2: finalize fastforge_logic time handling seam
Diffstat (limited to 'src/c/fastforge_logic.c')
| -rw-r--r-- | src/c/fastforge_logic.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/c/fastforge_logic.c b/src/c/fastforge_logic.c index a88b48e..0f00f76 100644 --- a/src/c/fastforge_logic.c +++ b/src/c/fastforge_logic.c @@ -1,10 +1,12 @@ -#undef _TIME_H_ +#include "fastforge_logic.h" + #ifdef time_t #undef time_t #endif +#undef _TIME_H_ #include <time.h> - -#include "fastforge_logic.h" +typedef time_t ff_sys_time_t; +#define time_t long #include <stdio.h> @@ -66,7 +68,8 @@ time_t local_day_start(time_t timestamp) { return 0; } - struct tm *tm_info = localtime(×tamp); + ff_sys_time_t sys_timestamp = (ff_sys_time_t)timestamp; + struct tm *tm_info = localtime(&sys_timestamp); if (!tm_info) { return 0; } @@ -76,7 +79,7 @@ time_t local_day_start(time_t timestamp) { tm_copy.tm_min = 0; tm_copy.tm_sec = 0; tm_copy.tm_isdst = -1; - return mktime(&tm_copy); + return (time_t)mktime(&tm_copy); } bool running_fast_is_at_target(const FastEntry *entry, time_t now) { |
