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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Show address from menu in STAX and FLEX
Robert Lukoťka committed Dec 31, 2024
commit ed4f518cae7a823183b51f5b71190ff9f4df90ac
17 changes: 16 additions & 1 deletion deps/ledger-zxlib/app/ui/view_nbgl.c
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
#include "nbgl_use_case.h"
#include "ux.h"
#include "view_internal.h"
#include "menu_handler.h"

#ifdef APP_SECRET_MODE_ENABLED
zxerr_t secret_enabled();
@@ -87,6 +88,8 @@

static void h_approve_internal(void) { h_approve(review_type); }

static void h_view_address(void);

#ifdef TARGET_STAX
#define MAX_INFO_LIST_ITEM_PER_PAGE 3
#else // TARGET_FLEX
@@ -96,8 +99,11 @@
static const char *const INFO_KEYS_PAGE[] = {"Version", "Developed by", "Website", "License"};
static const char *const INFO_VALUES_PAGE[] = {APPVERSION, "Zondax AG", "https://zondax.ch", "Apache 2.0"};

static const char SHOW_STORED_PUBKEY_TEXT[] = "Show address";

static nbgl_contentInfoList_t infoList = {0};
static nbgl_genericContents_t settingContents = {0};
static nbgl_homeAction_t showStoredPubkey = {};
static nbgl_contentSwitch_t switches[SETTINGS_SWITCHES_NB_LEN];

static void h_expert_toggle() { app_mode_set_expert(!app_mode_expert()); }
@@ -252,33 +258,33 @@
UNUSED(index);
UNUSED(page);

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;
}
}

static void settings_screen_callback(uint8_t index, nbgl_content_t *content) {
@@ -345,8 +351,13 @@
infoList.infoContents = INFO_VALUES_PAGE;
infoList.infoTypes = INFO_KEYS_PAGE;

showStoredPubkey.text = SHOW_STORED_PUBKEY_TEXT;
showStoredPubkey.icon = NULL;
showStoredPubkey.callback = h_view_address;
showStoredPubkey.style = SOFT_HOME_ACTION;

nbgl_useCaseHomeAndSettings(MENU_MAIN_APP_LINE1, &C_icon_stax_64, home_text, INIT_HOME_PAGE, &settingContents,
&infoList, NULL, app_quit);
&infoList, &showStoredPubkey, app_quit);
}

void view_message_impl(const char *title, const char *message) {
@@ -505,4 +516,8 @@
}
}

static void h_view_address() {
handleMenuShowAddress();
}

#endif
Binary file modified tests/snapshots/flex/test_app_mainmenu/part0/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part0/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part0/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part0/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part0/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part1/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part2/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part2/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part2/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part2/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part2/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/part2/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_get_public_key_expert/00000.png
Binary file modified tests/snapshots/flex/test_get_public_key_expert/00003.png
Binary file modified tests/snapshots/flex/test_get_public_key_slot/part0/00004.png
Binary file modified tests/snapshots/flex/test_get_public_key_slot/part1/00004.png
Binary file modified tests/snapshots/flex/test_get_slot_accepted/part0/00004.png
Binary file modified tests/snapshots/flex/test_get_slot_accepted/part1/00005.png
Binary file modified tests/snapshots/flex/test_get_slot_accepted/part2/00004.png
Binary file modified tests/snapshots/flex/test_get_slot_refused/00003.png
Binary file modified tests/snapshots/flex/test_message_normal/part0/00004.png
Binary file modified tests/snapshots/flex/test_message_normal/part1/00000.png
Binary file modified tests/snapshots/flex/test_message_normal/part1/00003.png
Binary file modified tests/snapshots/flex/test_message_normal/part2/00005.png
Binary file modified tests/snapshots/flex/test_message_normal/part3/00005.png
Binary file modified tests/snapshots/flex/test_message_normal/part4/00005.png
Binary file modified tests/snapshots/flex/test_message_normal/part5/00000.png
Binary file modified tests/snapshots/flex/test_message_normal/part5/00003.png
Binary file modified tests/snapshots/flex/test_transaction_expert/part0/00000.png
Binary file modified tests/snapshots/flex/test_transaction_expert/part0/00003.png
Binary file modified tests/snapshots/flex/test_transaction_expert/part1/00007.png
Binary file modified tests/snapshots/flex/test_transaction_expert/part2/00007.png
Binary file modified tests/snapshots/flex/test_transaction_params/part1/00009.png
Binary file modified tests/snapshots/flex/test_transaction_params/part10/00007.png
Binary file modified tests/snapshots/flex/test_transaction_params/part11/00007.png
Binary file modified tests/snapshots/flex/test_transaction_params/part12/00007.png
Binary file modified tests/snapshots/flex/test_transaction_params/part2/00009.png
Binary file modified tests/snapshots/flex/test_transaction_params/part3/00009.png
Binary file modified tests/snapshots/flex/test_transaction_params/part4/00009.png
Binary file modified tests/snapshots/flex/test_transaction_params/part5/00009.png
Binary file modified tests/snapshots/flex/test_transaction_params/part6/00009.png
Binary file modified tests/snapshots/flex/test_transaction_params/part7/00009.png
Binary file modified tests/snapshots/flex/test_transaction_params/part8/00009.png
Binary file modified tests/snapshots/flex/test_transaction_params/part9/00007.png
Binary file modified tests/snapshots/flex/test_transaction_refused/00003.png
Binary file modified tests/snapshots/flex/test_transaction_slot/00004.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part0/00009.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part1/00004.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part10/00008.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part12/00009.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part14/00009.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part15/00009.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part2/00009.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part3/00009.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part4/00009.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part6/00008.png
Binary file modified tests/snapshots/flex/test_transaction_slot/part8/00008.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part0/00000.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part0/00001.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part0/00002.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part0/00003.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part0/00004.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified tests/snapshots/stax/test_app_mainmenu/part1/00004.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part2/00000.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part2/00001.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part2/00002.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part2/00003.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part2/00004.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/part2/00005.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified tests/snapshots/stax/test_get_public_key_expert/00000.png
Binary file modified tests/snapshots/stax/test_get_public_key_expert/00003.png
Binary file modified tests/snapshots/stax/test_get_public_key_slot/part0/00004.png
Binary file modified tests/snapshots/stax/test_get_public_key_slot/part1/00004.png
Binary file modified tests/snapshots/stax/test_get_slot_accepted/part0/00004.png
Binary file modified tests/snapshots/stax/test_get_slot_accepted/part1/00004.png
Binary file modified tests/snapshots/stax/test_get_slot_accepted/part2/00004.png
Binary file modified tests/snapshots/stax/test_get_slot_refused/00003.png
Binary file modified tests/snapshots/stax/test_message_normal/part0/00004.png
Binary file modified tests/snapshots/stax/test_message_normal/part1/00000.png
Binary file modified tests/snapshots/stax/test_message_normal/part1/00003.png
Binary file modified tests/snapshots/stax/test_message_normal/part2/00005.png
Binary file modified tests/snapshots/stax/test_message_normal/part3/00004.png
Binary file modified tests/snapshots/stax/test_message_normal/part4/00005.png
Binary file modified tests/snapshots/stax/test_message_normal/part5/00000.png
Binary file modified tests/snapshots/stax/test_message_normal/part5/00003.png
Binary file modified tests/snapshots/stax/test_transaction_expert/part0/00000.png
Binary file modified tests/snapshots/stax/test_transaction_expert/part0/00003.png
Binary file modified tests/snapshots/stax/test_transaction_expert/part1/00006.png
Binary file modified tests/snapshots/stax/test_transaction_expert/part2/00006.png
Binary file modified tests/snapshots/stax/test_transaction_params/part1/00007.png
Binary file modified tests/snapshots/stax/test_transaction_params/part10/00006.png
Binary file modified tests/snapshots/stax/test_transaction_params/part11/00006.png
Binary file modified tests/snapshots/stax/test_transaction_params/part12/00006.png
Binary file modified tests/snapshots/stax/test_transaction_params/part2/00007.png
Binary file modified tests/snapshots/stax/test_transaction_params/part3/00007.png
Binary file modified tests/snapshots/stax/test_transaction_params/part4/00007.png
Binary file modified tests/snapshots/stax/test_transaction_params/part5/00007.png
Binary file modified tests/snapshots/stax/test_transaction_params/part6/00007.png
Binary file modified tests/snapshots/stax/test_transaction_params/part7/00007.png
Binary file modified tests/snapshots/stax/test_transaction_params/part8/00007.png
Binary file modified tests/snapshots/stax/test_transaction_params/part9/00006.png
Binary file modified tests/snapshots/stax/test_transaction_refused/00003.png
Binary file modified tests/snapshots/stax/test_transaction_slot/00004.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part0/00007.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part1/00004.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part10/00007.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part12/00008.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part14/00007.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part15/00008.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part2/00007.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part3/00007.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part4/00007.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part6/00007.png
Binary file modified tests/snapshots/stax/test_transaction_slot/part8/00007.png
11 changes: 3 additions & 8 deletions tests/test_app_mainmenu.py
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ def test_app_mainmenu(firmware, backend, navigator, test_name):
""" Check the behavior of the device main menu """

client = FlowCommandSender(backend)
choiceIdShowAdderess = 5 if firmware.device == "stax" else 4;

# Navigate in the main menu, click "View address"
if firmware.device == "nanos":
@@ -41,10 +42,7 @@ def test_app_mainmenu(firmware, backend, navigator, test_name):
]
else:
instructions = [
NavInsID.USE_CASE_HOME_SETTINGS,
NavInsID.USE_CASE_SETTINGS_NEXT,
NavInsID.USE_CASE_SETTINGS_NEXT,
NavInsID.USE_CASE_CHOICE_CONFIRM,
NavIns(NavInsID.CHOICE_CHOOSE, [choiceIdShowAdderess]),
NavInsID.USE_CASE_REVIEW_TAP,
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CONFIRM,
NavInsID.USE_CASE_SETTINGS_MULTI_PAGE_EXIT
@@ -79,10 +77,7 @@ def test_app_mainmenu(firmware, backend, navigator, test_name):
]
else:
instructions = [
NavInsID.USE_CASE_HOME_SETTINGS,
NavInsID.USE_CASE_SETTINGS_NEXT,
NavInsID.USE_CASE_SETTINGS_NEXT,
NavInsID.USE_CASE_CHOICE_CONFIRM,
NavIns(NavInsID.CHOICE_CHOOSE, [choiceIdShowAdderess]),
NavInsID.USE_CASE_REVIEW_TAP,
NavInsID.USE_CASE_REVIEW_TAP,
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CONFIRM,

Unchanged files with check annotations Beta

// Review string can be customizable in each app
#if !defined(REVIEW_SCREEN_TITLE) && !defined(REVIEW_SCREEN_TX_VALUE) && !defined(REVIEW_SCREEN_ADDR_VALUE)
#define REVIEW_SCREEN_TITLE "Please"

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_key is never read.
#define REVIEW_SCREEN_TXN_VALUE "review"

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_txvalue is never read.
#define REVIEW_SCREEN_ADDR_VALUE "review"

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_addrvalue is never read.
#endif
#ifdef APP_BLINDSIGN_MODE_ENABLED
#define REVIEW_BLINDSIGN_MESSAGE_TITLE "Warning"

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable shortcut_key is never read.
#define REVIEW_BLINDSIGN_MESSAGE_VALUE \
"Tx details not verifiable. " \
"Could lose all assets"
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_configvalue = "configuration";

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_configvalue is never read.
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_skip_value = "BlindSign";

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_skip_value is never read.
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.
static const char *review_skip_value_msg = "not verifiable";

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_skip_value_msg is never read.
static const char *review_skip_key_msg_2 = "Could lose";

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_skip_key_msg_2 is never read.
static const char *review_skip_value_msg_2 = "all assets";

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_skip_value_msg_2 is never read.
// Review msg string can be customizable in each app
#if !defined(REVIEW_MSG_TITLE) && !defined(REVIEW_MSG_VALUE)
#define REVIEW_MSG_VALUE "review"
#endif
static const char *review_msgKey = REVIEW_MSG_TITLE;

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_msgKey is never read.
static const char *review_msgValue = REVIEW_MSG_VALUE;

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable review_msgValue is never read.
static const char *shortcut_key = SHORTCUT_TITLE;
static const char *shortcut_value = SHORTCUT_VALUE;

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable shortcut_value is never read.
#if defined(TARGET_NANOS)
#if defined(APP_BLINDSIGN_MODE_ENABLED)
#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:
// https://github.com/LedgerHQ/ledger-secure-sdk/blob/fe169b19c7445f2477c26035a827c22ba9f84964/lib_nbgl/include/nbgl_use_case.h#L59
#if defined(TARGET_STAX) || defined(TARGET_FLEX)
#ifdef NB_MAX_DISPLAYED_PAIRS_IN_REVIEW
// passed page count, go to next index
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.
extraScreens--;
};
if (viewdata.itemCount > 0 && viewdata.itemIdx < (viewdata.itemCount - 1 + extraScreens)) {
// passed page count, go to next index
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.
extraScreens--;
};
if (viewdata.itemCount > 0 && viewdata.itemIdx < (viewdata.itemCount - 1 + extraScreens)) {
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.
}
void h_review_update() {
return 1;
case BUTTON_EVT_RELEASED | BUTTON_LEFT:
// h_paging_init();

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
run_ux_review_flow((review_type_e)review_type, &ux_review_flow_2_start_step);
return 1;
}
str[1] = (utf8_int8_t)(0x80 | (utf8_int8_t)((chr >> 6) & 0x3f));
str[2] = (utf8_int8_t)(0x80 | (utf8_int8_t)(chr & 0x3f));
str += 3;
} else { /* if (0 == ((int)0xffe00000 & chr)) { */

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
/* 4-byte/21-bit utf8 code point
* (0b11110xxx 0b10xxxxxx 0b10xxxxxx 0b10xxxxxx) */
if (n < 4) {
}
utf8_constexpr14_impl utf8_int32_t utf8lwrcodepoint(utf8_int32_t cp) {
if (((0x0041 <= cp) && (0x005a >= cp)) || ((0x00c0 <= cp) && (0x00d6 >= cp)) ||
((0x00d8 <= cp) && (0x00de >= cp)) || ((0x0391 <= cp) && (0x03a1 >= cp)) ||
((0x03a3 <= cp) && (0x03ab >= cp)) || ((0x0410 <= cp) && (0x042f >= cp))) {

Check notice

Code scanning / CodeQL

Complex condition Note

Complex condition: too many logical operations in this expression.
cp += 32;
} else if ((0x0400 <= cp) && (0x040f >= cp)) {
cp += 80;
} 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.
cp |= 0x1;
} else if (((0x0139 <= cp) && (0x0148 >= cp)) || ((0x0179 <= cp) && (0x017e >= cp)) ||
((0x01af <= cp) && (0x01b0 >= cp)) || ((0x01b3 <= cp) && (0x01b6 >= cp)) ||
((0x01cd <= cp) && (0x01dc >= cp))) {

Check notice

Code scanning / CodeQL

Complex condition Note

Complex condition: too many logical operations in this expression.
cp += 1;
cp &= ~0x1;
} else {
}
utf8_constexpr14_impl utf8_int32_t utf8uprcodepoint(utf8_int32_t cp) {
if (((0x0061 <= cp) && (0x007a >= cp)) || ((0x00e0 <= cp) && (0x00f6 >= cp)) ||
((0x00f8 <= cp) && (0x00fe >= cp)) || ((0x03b1 <= cp) && (0x03c1 >= cp)) ||
((0x03c3 <= cp) && (0x03cb >= cp)) || ((0x0430 <= cp) && (0x044f >= cp))) {

Check notice

Code scanning / CodeQL

Complex condition Note

Complex condition: too many logical operations in this expression.
cp -= 32;
} else if ((0x0450 <= cp) && (0x045f >= cp)) {
cp -= 80;
} 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.
cp &= ~0x1;
} else if (((0x0139 <= cp) && (0x0148 >= cp)) || ((0x0179 <= cp) && (0x017e >= cp)) ||
((0x01af <= cp) && (0x01b0 >= cp)) || ((0x01b3 <= cp) && (0x01b6 >= cp)) ||
((0x01cd <= cp) && (0x01dc >= cp))) {

Check notice

Code scanning / CodeQL

Complex condition Note

Complex condition: too many logical operations in this expression.
cp -= 1;
cp |= 0x1;
} else {
// get bit
const uint16_t byteIdx = bitIdx >> 3u;
const uint8_t mask = 0x80u >> (bitIdx & 0x7u);
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.
// Shift bcd
for (uint16_t j = 0; j < bcdOutLen; j++) {
// get bit
const uint16_t byteIdx = bitIdx >> 3u;
const uint8_t mask = 0x80u >> (bitIdx & 0x7u);
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.
// Shift bcd
for (uint16_t j = 0; j < bcdOutLen; j++) {
extern "C" {
#endif
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).
buffer_state_t flash; // Flash
void buffering_init(uint8_t *ram_buffer, size_t ram_buffer_size, uint8_t *flash_buffer, size_t flash_buffer_size) {
date->tm_year = 0;
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.
}
if (date->tm_year == 0 || date->tm_year == yearLookupSize) {