From 48e7fb1a7cd7e78c5ad2d8b3819425a05fa0c641 Mon Sep 17 00:00:00 2001 From: Matheus Afonso Martins Moreira Date: Tue, 20 Feb 2024 23:16:41 -0300 Subject: [PATCH] faces/totp: define TOTP data array size function Computes the size of the array of TOTP records. The compiler will likely evaluate it at compile time. --- movement/watch_faces/complication/totp_face.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/movement/watch_faces/complication/totp_face.c b/movement/watch_faces/complication/totp_face.c index dcdc957..4ab77c3 100644 --- a/movement/watch_faces/complication/totp_face.c +++ b/movement/watch_faces/complication/totp_face.c @@ -65,6 +65,10 @@ static totp_t totp_data[] = { // END OF KEY DATA. //////////////////////////////////////////////////////////////////////////////// +static inline size_t _totp_num(void) { + return sizeof(totp_data) / sizeof(*totp_data); +} + static void _update_display(totp_state_t *totp_state) { char buf[14]; div_t result;