Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update zxlib #5

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

Update zxlib #5

wants to merge 11 commits into from

Conversation

relatko
Copy link
Collaborator

@relatko relatko commented Aug 6, 2024

Update zxlib. Flex almost works

this version does not work, it is here just as zxlib changes reference.
static const char* review_addrvalue = REVIEW_SCREEN_ADDR_VALUE;
static const char* review_keyconfig = "Review";
static const char* review_configvalue = "configuration";
static const char *review_key = REVIEW_SCREEN_TITLE;

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_key is never read.
static const char* review_keyconfig = "Review";
static const char* review_configvalue = "configuration";
static const char *review_key = REVIEW_SCREEN_TITLE;
static const char *review_txvalue = REVIEW_SCREEN_TXN_VALUE;

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_txvalue is never read.
static const char* review_configvalue = "configuration";
static const char *review_key = REVIEW_SCREEN_TITLE;
static const char *review_txvalue = REVIEW_SCREEN_TXN_VALUE;
static const char *review_addrvalue = REVIEW_SCREEN_ADDR_VALUE;

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_addrvalue is never read.
deps/ledger-zxlib/app/ui/view_internal.h Fixed Show fixed Hide fixed
deps/ledger-zxlib/app/ui/view_internal.h Fixed Show fixed Hide fixed
#define INTRO_PAGES 0
#endif

// FIXME: Wait to be fixed on SDK:

Check notice

Code scanning / CodeQL

FIXME comment Note

FIXME comment: Wait to be fixed on SDK:
@@ -85,7 +84,11 @@
}

// passed page count, go to next index
if (viewdata.itemCount > 0 && viewdata.itemIdx < (viewdata.itemCount - 1 + INCLUDE_ACTIONS_COUNT)) {
uint8_t extraScreens = INCLUDE_ACTIONS_COUNT;
if (review_type == REVIEW_MSG && extraScreens > 0) {

Check warning

Code scanning / CodeQL

Comparison result is always the same Warning

Comparison is always false because extraScreens <= 0.
@@ -104,7 +107,11 @@
}

// passed page count, go to next index
if (viewdata.itemCount > 0 && viewdata.itemIdx < (viewdata.itemCount - 1 + INCLUDE_ACTIONS_COUNT)) {
uint8_t extraScreens = INCLUDE_ACTIONS_COUNT;
if (review_type == REVIEW_MSG && extraScreens > 0) {

Check warning

Code scanning / CodeQL

Comparison result is always the same Warning

Comparison is always false because extraScreens <= 0.
@@ -183,6 +185,11 @@
//////////////////////////
//////////////////////////

static void h_view_address() {
handleMenuShowAddress();
// view_review_show_impl();

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
deps/ledger-zxlib/src/timeutils.c Fixed Show fixed Hide fixed
@relatko relatko force-pushed the update-zxlib branch 2 times, most recently from f33465a to 28e1712 Compare August 6, 2024 20:49
deps/README.md Outdated
@@ -0,0 +1,10 @@
## Updating zx-lib

Menu feaure requires us o change zxlib menu layout. Thus insead of a submodule, we have ledger-zxlib included as a copy. In case you need to update zxlib, this is the list of changes performed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo:
Menu feature requires us to... instead

And below:
Menu contains

Fixes an issue on stax on screens containing 6 entries.
@relatko relatko force-pushed the update-zxlib branch 2 times, most recently from 69c3416 to b39923a Compare September 27, 2024 13:32
Fixed too many arguments CI issue
Robert Lukoťka added 2 commits December 30, 2024 11:09
STAX and FLEX menu feature not merged into zxlib yet
static const char *review_key = REVIEW_SCREEN_TITLE;
static const char *review_txvalue = REVIEW_SCREEN_TXN_VALUE;
static const char *review_addrvalue = REVIEW_SCREEN_ADDR_VALUE;
static const char *review_keyconfig = "Review";

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_keyconfig is never read.
static const char *review_txvalue = REVIEW_SCREEN_TXN_VALUE;
static const char *review_addrvalue = REVIEW_SCREEN_ADDR_VALUE;
static const char *review_keyconfig = "Review";
static const char *review_configvalue = "configuration";

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_configvalue is never read.
static const char *review_addrvalue = REVIEW_SCREEN_ADDR_VALUE;
static const char *review_keyconfig = "Review";
static const char *review_configvalue = "configuration";
static const char *review_skip_key = "Warning";

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_skip_key is never read.
static const char *review_keyconfig = "Review";
static const char *review_configvalue = "configuration";
static const char *review_skip_key = "Warning";
static const char *review_skip_value = "BlindSign";

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_skip_value is never read.
static const char *review_configvalue = "configuration";
static const char *review_skip_key = "Warning";
static const char *review_skip_value = "BlindSign";
static const char *review_skip_key_msg = "Tx details";

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_skip_key_msg is never read.
Comment on lines +1400 to +1405
} else if (((0x0100 <= cp) && (0x012f >= cp)) || ((0x0132 <= cp) && (0x0137 >= cp)) ||
((0x014a <= cp) && (0x0177 >= cp)) || ((0x0182 <= cp) && (0x0185 >= cp)) ||
((0x01a0 <= cp) && (0x01a5 >= cp)) || ((0x01de <= cp) && (0x01ef >= cp)) ||
((0x01f8 <= cp) && (0x021f >= cp)) || ((0x0222 <= cp) && (0x0233 >= cp)) ||
((0x0246 <= cp) && (0x024f >= cp)) || ((0x03d8 <= cp) && (0x03ef >= cp)) ||
((0x0460 <= cp) && (0x0481 >= cp)) || ((0x048a <= cp) && (0x04ff >= cp))) {

Check notice

Code scanning / CodeQL

Complex condition Note

Complex condition: too many logical operations in this expression.
@@ -69,20 +68,19 @@
// get bit
const uint16_t byteIdx = bitIdx >> 3u;
const uint8_t mask = 0x80u >> (bitIdx & 0x7u);
carry = (uint8_t) ((binValue[binValueLen - byteIdx - 1] & mask) > 0);
carry = (uint8_t)((binValue[binValueLen - byteIdx - 1] & mask) > 0);

Check warning

Code scanning / CodeQL

Sign check of bitwise operation Warning

Potentially unsafe sign check of a bitwise operation.
@@ -135,11 +132,11 @@
// get bit
const uint16_t byteIdx = bitIdx >> 3u;
const uint8_t mask = 0x80u >> (bitIdx & 0x7u);
carry = (uint8_t) ((binValue[byteIdx] & mask) > 0);
carry = (uint8_t)((binValue[byteIdx] & mask) > 0);

Check warning

Code scanning / CodeQL

Sign check of bitwise operation Warning

Potentially unsafe sign check of a bitwise operation.
#include <zxmacros.h>

#ifdef __cplusplus
extern "C" {
#endif

buffer_state_t ram; // Ram
buffer_state_t flash; // Flash
buffer_state_t ram; // Ram

Check notice

Code scanning / CodeQL

Short global name Note

Poor global variable name 'ram'. Prefer longer, descriptive names for globals (eg. kMyGlobalConstant, not foo).
while (date->tm_year < yearLookupSize && yearLookup[date->tm_year] <= time) date->tm_year++;
const uint16_t yearLookupSize = sizeof(yearLookup) / sizeof(yearLookup[0]);
while (date->tm_year < yearLookupSize && yearLookup[date->tm_year] <= time) {
date->tm_year++;

Check warning

Code scanning / CodeQL

Year field changed using an arithmetic operation without checking for leap year Warning

Field
tm_year
on variable
date
has been modified, but no appropriate check for LeapYear was found.
Comment on lines +255 to +281
switch (token) {
case EXPERT_MODE_TOKEN:
h_expert_toggle();
break;

#ifdef APP_ACCOUNT_MODE_ENABLED
case ACCOUNT_MODE_TOKEN:
account_enabled();
break;
#endif

#ifdef APP_SECRET_MODE_ENABLED
case SECRET_MODE_TOKEN:
secret_enabled();
break;
#endif

#ifdef APP_BLINDSIGN_MODE_ENABLED
case BLINDSIGN_MODE_TOKEN:
h_blindsign_toggle();
break;
#endif

default:
ZEMU_LOGF(50, "Toggling setting not found\n")
break;
}

Check notice

Code scanning / CodeQL

No trivial switch statements Note

This switch statement should either handle more cases, or be rewritten as an if statement.
@cedelavergne-ledger
Copy link

cedelavergne-ledger commented Jan 2, 2025

Good job 😉

Seems it is ready now to be merged?

Most probably, the next step will be to open a PR on LedgerHQ organization, from your develop branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants