From: Matheus Afonso Martins Moreira Date: Wed, 21 Feb 2024 02:16:41 +0000 (-0300) Subject: faces/totp: define TOTP data array size function X-Git-Url: https://git.earman.xyz/?a=commitdiff_plain;h=48e7fb1a7cd7e78c5ad2d8b3819425a05fa0c641;p=sensor-watch.git 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. --- 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;