mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +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_fadeout(void);
|
||||
|
||||
// clang-format off
|
||||
#define INPUT_CANCEL 0x01 // Cancel button
|
||||
#define INPUT_CONFIRM 0x02 // Confirm button
|
||||
#define INPUT_LONG_CONFIRM 0x04 // Long Confirm button
|
||||
#define INPUT_INFO 0x08 // Info icon
|
||||
// clang-format on
|
||||
|
||||
int ui_user_input(int zones);
|
||||
|
||||
#endif
|
||||
|
@ -55,8 +55,9 @@ START_TEST(test_cashaddr) {
|
||||
rawdata_len = base58_decode_check(valid_cashaddr[i].legacy, HASHER_SHA2D,
|
||||
rawdata, sizeof(rawdata));
|
||||
ck_assert_int_eq(rawdata_len, 21);
|
||||
ck_assert_int_eq(prog[0],
|
||||
rawdata[0] == 0 ? 0x00 : rawdata[0] == 5 ? 0x08 : -1);
|
||||
ck_assert_int_eq(prog[0], rawdata[0] == 0 ? 0x00
|
||||
: rawdata[0] == 5 ? 0x08
|
||||
: -1);
|
||||
ck_assert_int_eq(memcmp(rawdata + 1, prog + 1, 20), 0);
|
||||
ret = cash_addr_encode(rebuild, hrp, prog, 21);
|
||||
ck_assert_int_eq(ret, 1);
|
||||
|
@ -62,6 +62,7 @@ static const uint32_t META_MAGIC_V10 = 0xFFFFFFFF;
|
||||
#define FLAG_PUBLIC_SHIFTED (FLAG_PUBLIC << 8)
|
||||
#define FLAGS_WRITE_SHIFTED (FLAGS_WRITE << 8)
|
||||
|
||||
// clang-format off
|
||||
#define KEY_UUID (0 | APP | FLAG_PUBLIC_SHIFTED) // bytes(12)
|
||||
#define KEY_VERSION (1 | APP) // uint32
|
||||
#define KEY_MNEMONIC (2 | APP) // string(241)
|
||||
@ -80,6 +81,7 @@ static const uint32_t META_MAGIC_V10 = 0xFFFFFFFF;
|
||||
#define KEY_IMPORTED (16 | APP) // bool
|
||||
#define KEY_U2F_ROOT (17 | APP | FLAG_PUBLIC_SHIFTED) // node
|
||||
#define KEY_DEBUG_LINK_PIN (255 | APP | FLAG_PUBLIC_SHIFTED) // string(10)
|
||||
// clang-format on
|
||||
|
||||
#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);
|
||||
}
|
||||
if (addrlen > 10) { // don't split short addresses
|
||||
uint32_t rowlen =
|
||||
(addrlen - 1) / (addrlen <= 42 ? 2 : addrlen <= 63 ? 3 : 4) + 1;
|
||||
uint32_t rowlen = (addrlen - 1) / (addrlen <= 42 ? 2
|
||||
: addrlen <= 63 ? 3
|
||||
: 4) +
|
||||
1;
|
||||
const char **str =
|
||||
split_message((const uint8_t *)address, addrlen, rowlen);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -146,10 +146,8 @@ static void recovery_request(void) {
|
||||
WordRequest resp = {0};
|
||||
memzero(&resp, sizeof(WordRequest));
|
||||
resp.has_type = true;
|
||||
resp.type = awaiting_word == 1
|
||||
? WordRequestType_WordRequestType_Plain
|
||||
: (word_index % 4 == 3)
|
||||
? WordRequestType_WordRequestType_Matrix6
|
||||
resp.type = awaiting_word == 1 ? WordRequestType_WordRequestType_Plain
|
||||
: (word_index % 4 == 3) ? WordRequestType_WordRequestType_Matrix6
|
||||
: WordRequestType_WordRequestType_Matrix9;
|
||||
msg_write(MessageType_MessageType_WordRequest, &resp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user