Skip to content

Commit

Permalink
Merge pull request #460 from LedgerHQ/xch/nbgl-constification
Browse files Browse the repository at this point in the history
lib_nbgl: Constify nbgl_layoutTagValueList_t pairs element
  • Loading branch information
xchapron-ledger authored Oct 31, 2023
2 parents 4569539 + 4a02f17 commit 5893d08
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib_nbgl/include/nbgl_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib_nbgl/src/nbgl_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion lib_nbgl/src/nbgl_use_case.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit 5893d08

Please sign in to comment.