From 5a640234c343110aeacf3815dcc71a240ed58997 Mon Sep 17 00:00:00 2001 From: Nathan Fisher Date: Mon, 12 Feb 2024 19:17:00 -0500 Subject: [PATCH] Continue refactor --- datetime.c | 4 ++-- include/epoch.h | 2 +- test/dtfromtimespec.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/datetime.c b/datetime.c index b0644ba..8e3909b 100644 --- a/datetime.c +++ b/datetime.c @@ -146,6 +146,6 @@ void dateTimeFromTimestampParts(int64_t seconds, int64_t nanoseconds, DateTime * } } -void dateTimeFromTimespec(struct timespec *ts, DateTime *dt) { - dateTimeFromTimestampParts(ts->tv_sec, ts->tv_nsec, dt); +void dateTimeFromTimespec(DateTime *self, struct timespec *ts) { + dateTimeFromTimestampParts(ts->tv_sec, ts->tv_nsec, self); } diff --git a/include/epoch.h b/include/epoch.h index 1cd3b1c..bbee84a 100644 --- a/include/epoch.h +++ b/include/epoch.h @@ -148,6 +148,6 @@ void dateTimeGetTimespec (DateTime *self, struct timespec *ts); Weekday dateTimeGetWeekday (DateTime *self); void dateTimeFromTimestampParts (int64_t seconds, int64_t nanoseconds, DateTime *dt); -void dateTimeFromTimespec (struct timespec *ts, DateTime *dt); +void dateTimeFromTimespec (DateTime *self, struct timespec *ts); #endif // !LIBEPOCH_H diff --git a/test/dtfromtimespec.c b/test/dtfromtimespec.c index 49fdade..19accbc 100644 --- a/test/dtfromtimespec.c +++ b/test/dtfromtimespec.c @@ -8,7 +8,7 @@ int main() { ts.tv_nsec = 42; ts.tv_sec = 1706571482; - dateTimeFromTimespec(&ts, &dt); + dateTimeFromTimespec(&dt, &ts); assert(dt.year.year == 2024); assert(dt.month == January); assert(dt.day == 29);