sys/time_units.h: Convert time conversion to macros

The intent of this patch is to leave all of the semantics of the macros
unchanged, only replacing the easy-to-read static inline conversion
function with a pile of ?: operators.

Ick. This is not a cleanup. However, what it does enable is using constant
results while initializing global variables, which cannot be done with
either static inline functions or even statement expressions, even when
those generate constant results.

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2023-09-21 14:30:30 -07:00 committed by Carles Cufí
parent a8497c5216
commit 8f5d0791bf
2 changed files with 810 additions and 656 deletions

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@
#include <zephyr/types.h>
#include <errno.h>
#include <stddef.h>
#include <stdbool.h>
#include <zephyr/sys/timeutil.h>
/** Convert a civil (proleptic Gregorian) date to days relative to