From 4a02f17df6190e8e7e4369f8a95d969ee4a8236c Mon Sep 17 00:00:00 2001 From: Xavier Chapron Date: Tue, 31 Oct 2023 14:11:14 +0100 Subject: [PATCH] lib_nbgl: Constify nbgl_layoutTagValueList_t pairs element --- lib_nbgl/include/nbgl_layout.h | 2 +- lib_nbgl/src/nbgl_layout.c | 4 ++-- lib_nbgl/src/nbgl_use_case.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_nbgl/include/nbgl_layout.h b/lib_nbgl/include/nbgl_layout.h index 98908a004..a77bed124 100644 --- a/lib_nbgl/include/nbgl_layout.h +++ b/lib_nbgl/include/nbgl_layout.h @@ -155,7 +155,7 @@ typedef nbgl_layoutTagValue_t *(*nbgl_tagValueCallback_t)(uint8_t pairIndex); * @brief This structure contains a list of [tag,value] pairs */ typedef struct { - nbgl_layoutTagValue_t + const nbgl_layoutTagValue_t *pairs; ///< array of [tag,value] pairs (nbPairs items). If NULL, callback is used instead nbgl_tagValueCallback_t callback; ///< function to call to retrieve a given pair uint8_t nbPairs; ///< number of pairs in pairs array (or max number of pairs to retrieve with diff --git a/lib_nbgl/src/nbgl_layout.c b/lib_nbgl/src/nbgl_layout.c index dc90ebc44..9a7fa691d 100644 --- a/lib_nbgl/src/nbgl_layout.c +++ b/lib_nbgl/src/nbgl_layout.c @@ -1597,8 +1597,8 @@ int nbgl_layoutAddTagValueList(nbgl_layout_t *layout, const nbgl_layoutTagValueL } for (i = 0; i < list->nbPairs; i++) { - nbgl_layoutTagValue_t *pair; - uint16_t fullHeight = 0, usableWidth; + const nbgl_layoutTagValue_t *pair; + uint16_t fullHeight = 0, usableWidth; if (list->pairs != NULL) { pair = &list->pairs[i]; diff --git a/lib_nbgl/src/nbgl_use_case.c b/lib_nbgl/src/nbgl_use_case.c index 653cf3ba4..9349091f9 100644 --- a/lib_nbgl/src/nbgl_use_case.c +++ b/lib_nbgl/src/nbgl_use_case.c @@ -214,7 +214,7 @@ static void pageCallback(int token, uint8_t index) } } else if (token == DETAILS_BUTTON_TOKEN) { - nbgl_layoutTagValue_t *pair; + const nbgl_layoutTagValue_t *pair; if (staticReviewContext.tagValueList.pairs != NULL) { pair = &staticReviewContext.tagValueList.pairs[staticReviewContext.currentPairIndex]; }