From d656f885728652e2545fc5459287679ac4e73181 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Thu, 18 Nov 2021 23:53:40 +0100 Subject: [PATCH] style(all): reformat with clang-format 13.0 --- core/embed/extmod/modtrezorui/display.c | 9 ++++----- legacy/firmware/crypto.c | 10 ++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/core/embed/extmod/modtrezorui/display.c b/core/embed/extmod/modtrezorui/display.c index 61a97b319..703b3c4ae 100644 --- a/core/embed/extmod/modtrezorui/display.c +++ b/core/embed/extmod/modtrezorui/display.c @@ -288,15 +288,14 @@ void display_avatar(int x, int y, const void *data, uint32_t datalen, if (px >= x0 && px <= x1 && py >= y0 && py <= y1) { int d = (px - AVATAR_IMAGE_SIZE / 2) * (px - AVATAR_IMAGE_SIZE / 2) + (py - AVATAR_IMAGE_SIZE / 2) * (py - AVATAR_IMAGE_SIZE / 2); - // inside border area if (d < AVATAR_BORDER_LOW) { + // inside border area PIXELDATA((decomp_out[0] << 8) | decomp_out[1]); - } else - // outside border area - if (d > AVATAR_BORDER_HIGH) { + } else if (d > AVATAR_BORDER_HIGH) { + // outside border area PIXELDATA(bgcolor); - // border area } else { + // border area #if AVATAR_ANTIALIAS d = 31 * (d - AVATAR_BORDER_LOW) / (AVATAR_BORDER_HIGH - AVATAR_BORDER_LOW); diff --git a/legacy/firmware/crypto.c b/legacy/firmware/crypto.c index 043f5d963..fa408a62f 100644 --- a/legacy/firmware/crypto.c +++ b/legacy/firmware/crypto.c @@ -223,9 +223,8 @@ int cryptoMessageVerify(const CoinInfo *coin, const uint8_t *message, len != address_prefix_bytes_len(coin->address_type) + 20) { return 2; } - } else - // segwit-in-p2sh - if (signature[0] >= 35 && signature[0] <= 38) { + } else if (signature[0] >= 35 && signature[0] <= 38) { + // segwit-in-p2sh size_t len = base58_decode_check(address, coin->curve->hasher_base58, addr_raw, MAX_ADDR_RAW_SIZE); ecdsa_get_address_segwit_p2sh_raw(pubkey, coin->address_type_p2sh, @@ -235,9 +234,8 @@ int cryptoMessageVerify(const CoinInfo *coin, const uint8_t *message, len != address_prefix_bytes_len(coin->address_type_p2sh) + 20) { return 2; } - } else - // segwit - if (signature[0] >= 39 && signature[0] <= 42) { + } else if (signature[0] >= 39 && signature[0] <= 42) { + // segwit int witver = 0; size_t len = 0; if (!coin->bech32_prefix ||