mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
style: reformat with clang-format 11
This commit is contained in:
parent
453df567d3
commit
93215ae3c7
@ -56,10 +56,13 @@ void ui_screen_fail(void);
|
|||||||
void ui_fadein(void);
|
void ui_fadein(void);
|
||||||
void ui_fadeout(void);
|
void ui_fadeout(void);
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#define INPUT_CANCEL 0x01 // Cancel button
|
#define INPUT_CANCEL 0x01 // Cancel button
|
||||||
#define INPUT_CONFIRM 0x02 // Confirm button
|
#define INPUT_CONFIRM 0x02 // Confirm button
|
||||||
#define INPUT_LONG_CONFIRM 0x04 // Long Confirm button
|
#define INPUT_LONG_CONFIRM 0x04 // Long Confirm button
|
||||||
#define INPUT_INFO 0x08 // Info icon
|
#define INPUT_INFO 0x08 // Info icon
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
int ui_user_input(int zones);
|
int ui_user_input(int zones);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -55,8 +55,9 @@ START_TEST(test_cashaddr) {
|
|||||||
rawdata_len = base58_decode_check(valid_cashaddr[i].legacy, HASHER_SHA2D,
|
rawdata_len = base58_decode_check(valid_cashaddr[i].legacy, HASHER_SHA2D,
|
||||||
rawdata, sizeof(rawdata));
|
rawdata, sizeof(rawdata));
|
||||||
ck_assert_int_eq(rawdata_len, 21);
|
ck_assert_int_eq(rawdata_len, 21);
|
||||||
ck_assert_int_eq(prog[0],
|
ck_assert_int_eq(prog[0], rawdata[0] == 0 ? 0x00
|
||||||
rawdata[0] == 0 ? 0x00 : rawdata[0] == 5 ? 0x08 : -1);
|
: rawdata[0] == 5 ? 0x08
|
||||||
|
: -1);
|
||||||
ck_assert_int_eq(memcmp(rawdata + 1, prog + 1, 20), 0);
|
ck_assert_int_eq(memcmp(rawdata + 1, prog + 1, 20), 0);
|
||||||
ret = cash_addr_encode(rebuild, hrp, prog, 21);
|
ret = cash_addr_encode(rebuild, hrp, prog, 21);
|
||||||
ck_assert_int_eq(ret, 1);
|
ck_assert_int_eq(ret, 1);
|
||||||
|
@ -62,24 +62,26 @@ static const uint32_t META_MAGIC_V10 = 0xFFFFFFFF;
|
|||||||
#define FLAG_PUBLIC_SHIFTED (FLAG_PUBLIC << 8)
|
#define FLAG_PUBLIC_SHIFTED (FLAG_PUBLIC << 8)
|
||||||
#define FLAGS_WRITE_SHIFTED (FLAGS_WRITE << 8)
|
#define FLAGS_WRITE_SHIFTED (FLAGS_WRITE << 8)
|
||||||
|
|
||||||
#define KEY_UUID (0 | APP | FLAG_PUBLIC_SHIFTED) // bytes(12)
|
// clang-format off
|
||||||
#define KEY_VERSION (1 | APP) // uint32
|
#define KEY_UUID (0 | APP | FLAG_PUBLIC_SHIFTED) // bytes(12)
|
||||||
#define KEY_MNEMONIC (2 | APP) // string(241)
|
#define KEY_VERSION (1 | APP) // uint32
|
||||||
#define KEY_LANGUAGE (3 | APP | FLAG_PUBLIC_SHIFTED) // string(17)
|
#define KEY_MNEMONIC (2 | APP) // string(241)
|
||||||
#define KEY_LABEL (4 | APP | FLAG_PUBLIC_SHIFTED) // string(33)
|
#define KEY_LANGUAGE (3 | APP | FLAG_PUBLIC_SHIFTED) // string(17)
|
||||||
|
#define KEY_LABEL (4 | APP | FLAG_PUBLIC_SHIFTED) // string(33)
|
||||||
#define KEY_PASSPHRASE_PROTECTION (5 | APP | FLAG_PUBLIC_SHIFTED) // bool
|
#define KEY_PASSPHRASE_PROTECTION (5 | APP | FLAG_PUBLIC_SHIFTED) // bool
|
||||||
#define KEY_HOMESCREEN (6 | APP | FLAG_PUBLIC_SHIFTED) // bytes(1024)
|
#define KEY_HOMESCREEN (6 | APP | FLAG_PUBLIC_SHIFTED) // bytes(1024)
|
||||||
#define KEY_NEEDS_BACKUP (7 | APP) // bool
|
#define KEY_NEEDS_BACKUP (7 | APP) // bool
|
||||||
#define KEY_FLAGS (8 | APP) // uint32
|
#define KEY_FLAGS (8 | APP) // uint32
|
||||||
#define KEY_U2F_COUNTER (9 | APP | FLAGS_WRITE_SHIFTED) // uint32
|
#define KEY_U2F_COUNTER (9 | APP | FLAGS_WRITE_SHIFTED) // uint32
|
||||||
#define KEY_UNFINISHED_BACKUP (11 | APP) // bool
|
#define KEY_UNFINISHED_BACKUP (11 | APP) // bool
|
||||||
#define KEY_AUTO_LOCK_DELAY_MS (12 | APP) // uint32
|
#define KEY_AUTO_LOCK_DELAY_MS (12 | APP) // uint32
|
||||||
#define KEY_NO_BACKUP (13 | APP) // bool
|
#define KEY_NO_BACKUP (13 | APP) // bool
|
||||||
#define KEY_INITIALIZED (14 | APP | FLAG_PUBLIC_SHIFTED) // uint32
|
#define KEY_INITIALIZED (14 | APP | FLAG_PUBLIC_SHIFTED) // uint32
|
||||||
#define KEY_NODE (15 | APP) // node
|
#define KEY_NODE (15 | APP) // node
|
||||||
#define KEY_IMPORTED (16 | APP) // bool
|
#define KEY_IMPORTED (16 | APP) // bool
|
||||||
#define KEY_U2F_ROOT (17 | APP | FLAG_PUBLIC_SHIFTED) // node
|
#define KEY_U2F_ROOT (17 | APP | FLAG_PUBLIC_SHIFTED) // node
|
||||||
#define KEY_DEBUG_LINK_PIN (255 | APP | FLAG_PUBLIC_SHIFTED) // string(10)
|
#define KEY_DEBUG_LINK_PIN (255 | APP | FLAG_PUBLIC_SHIFTED) // string(10)
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#define MAX_SESSIONS_COUNT 10
|
#define MAX_SESSIONS_COUNT 10
|
||||||
|
|
||||||
|
@ -695,8 +695,10 @@ void layoutAddress(const char *address, const char *desc, bool qrcode,
|
|||||||
oledDrawString(0, 0 * 9, desc, FONT_STANDARD);
|
oledDrawString(0, 0 * 9, desc, FONT_STANDARD);
|
||||||
}
|
}
|
||||||
if (addrlen > 10) { // don't split short addresses
|
if (addrlen > 10) { // don't split short addresses
|
||||||
uint32_t rowlen =
|
uint32_t rowlen = (addrlen - 1) / (addrlen <= 42 ? 2
|
||||||
(addrlen - 1) / (addrlen <= 42 ? 2 : addrlen <= 63 ? 3 : 4) + 1;
|
: addrlen <= 63 ? 3
|
||||||
|
: 4) +
|
||||||
|
1;
|
||||||
const char **str =
|
const char **str =
|
||||||
split_message((const uint8_t *)address, addrlen, rowlen);
|
split_message((const uint8_t *)address, addrlen, rowlen);
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
|
@ -146,11 +146,9 @@ static void recovery_request(void) {
|
|||||||
WordRequest resp = {0};
|
WordRequest resp = {0};
|
||||||
memzero(&resp, sizeof(WordRequest));
|
memzero(&resp, sizeof(WordRequest));
|
||||||
resp.has_type = true;
|
resp.has_type = true;
|
||||||
resp.type = awaiting_word == 1
|
resp.type = awaiting_word == 1 ? WordRequestType_WordRequestType_Plain
|
||||||
? WordRequestType_WordRequestType_Plain
|
: (word_index % 4 == 3) ? WordRequestType_WordRequestType_Matrix6
|
||||||
: (word_index % 4 == 3)
|
: WordRequestType_WordRequestType_Matrix9;
|
||||||
? WordRequestType_WordRequestType_Matrix6
|
|
||||||
: WordRequestType_WordRequestType_Matrix9;
|
|
||||||
msg_write(MessageType_MessageType_WordRequest, &resp);
|
msg_write(MessageType_MessageType_WordRequest, &resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user