diff --git a/src/board/TLoRaPagerBoard.cpp b/src/board/TLoRaPagerBoard.cpp index 45fd353f..fbfcc8c5 100644 --- a/src/board/TLoRaPagerBoard.cpp +++ b/src/board/TLoRaPagerBoard.cpp @@ -1953,7 +1953,8 @@ void TLoRaPagerBoard::shutdown(bool save_data) LORA_CS, LORA_RST, LORA_BUSY, - LORA_IRQ}; + LORA_IRQ + }; for (auto pin : pins) { diff --git a/src/chat/infra/meshcore/crypto/ed25519/sha512.c b/src/chat/infra/meshcore/crypto/ed25519/sha512.c index 955b8c32..1f317a5c 100644 --- a/src/chat/infra/meshcore/crypto/ed25519/sha512.c +++ b/src/chat/infra/meshcore/crypto/ed25519/sha512.c @@ -57,9 +57,9 @@ static const uint64_t K[80] = { /* Various logical functions */ -#define ROR64c(x, y) \ - (((((x) & UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)(y) & UINT64_C(63))) | \ - ((x) << ((uint64_t)(64 - ((y) & UINT64_C(63)))))) & \ +#define ROR64c(x, y) \ + (((((x)&UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)(y)&UINT64_C(63))) | \ + ((x) << ((uint64_t)(64 - ((y)&UINT64_C(63)))))) & \ UINT64_C(0xFFFFFFFFFFFFFFFF)) #define STORE64H(x, y) \ @@ -71,7 +71,7 @@ static const uint64_t K[80] = { (y)[4] = (unsigned char)(((x) >> 24) & 255); \ (y)[5] = (unsigned char)(((x) >> 16) & 255); \ (y)[6] = (unsigned char)(((x) >> 8) & 255); \ - (y)[7] = (unsigned char)((x) & 255); \ + (y)[7] = (unsigned char)((x)&255); \ } #define LOAD64H(x, y) \ @@ -85,7 +85,7 @@ static const uint64_t K[80] = { #define Ch(x, y, z) (z ^ (x & (y ^ z))) #define Maj(x, y, z) (((x | y) & z) | (x & y)) #define S(x, n) ROR64c(x, n) -#define R(x, n) (((x) & UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)n)) +#define R(x, n) (((x)&UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)n)) #define Sigma0(x) (S(x, 28) ^ S(x, 34) ^ S(x, 39)) #define Sigma1(x) (S(x, 14) ^ S(x, 18) ^ S(x, 41)) #define Gamma0(x) (S(x, 1) ^ S(x, 8) ^ R(x, 7)) diff --git a/src/chat/infra/meshtastic/compression/unishox2.h b/src/chat/infra/meshtastic/compression/unishox2.h index 18ff2e6a..90822972 100644 --- a/src/chat/infra/meshtastic/compression/unishox2.h +++ b/src/chat/infra/meshtastic/compression/unishox2.h @@ -61,97 +61,137 @@ /// Default Horizontal codes. When composition of text is know beforehand, the other hcodes in this section can be used to achieve /// more compression. -#define USX_HCODES_DFLT \ - (const unsigned char[]){ \ - 0x00, 0x40, 0x80, 0xC0, 0xE0} +#define USX_HCODES_DFLT \ + (const unsigned char[]) \ + { \ + 0x00, 0x40, 0x80, 0xC0, 0xE0 \ + } /// Length of each default hcode -#define USX_HCODE_LENS_DFLT \ - (const unsigned char[]){ \ - 2, 2, 2, 3, 3} +#define USX_HCODE_LENS_DFLT \ + (const unsigned char[]) \ + { \ + 2, 2, 2, 3, 3 \ + } /// Horizontal codes preset for English Alphabet content only -#define USX_HCODES_ALPHA_ONLY \ - (const unsigned char[]){ \ - 0x00, 0x00, 0x00, 0x00, 0x00} +#define USX_HCODES_ALPHA_ONLY \ + (const unsigned char[]) \ + { \ + 0x00, 0x00, 0x00, 0x00, 0x00 \ + } /// Length of each Alpha only hcode #define USX_HCODE_LENS_ALPHA_ONLY \ - (const unsigned char[]){ \ - 0, 0, 0, 0, 0} + (const unsigned char[]) \ + { \ + 0, 0, 0, 0, 0 \ + } /// Horizontal codes preset for Alpha Numeric content only -#define USX_HCODES_ALPHA_NUM_ONLY \ - (const unsigned char[]){ \ - 0x00, 0x00, 0x80, 0x00, 0x00} +#define USX_HCODES_ALPHA_NUM_ONLY \ + (const unsigned char[]) \ + { \ + 0x00, 0x00, 0x80, 0x00, 0x00 \ + } /// Length of each Alpha numeric hcode #define USX_HCODE_LENS_ALPHA_NUM_ONLY \ - (const unsigned char[]){ \ - 1, 0, 1, 0, 0} + (const unsigned char[]) \ + { \ + 1, 0, 1, 0, 0 \ + } /// Horizontal codes preset for Alpha Numeric and Symbol content only #define USX_HCODES_ALPHA_NUM_SYM_ONLY \ - (const unsigned char[]){ \ - 0x00, 0x80, 0xC0, 0x00, 0x00} + (const unsigned char[]) \ + { \ + 0x00, 0x80, 0xC0, 0x00, 0x00 \ + } /// Length of each Alpha numeric and symbol hcodes #define USX_HCODE_LENS_ALPHA_NUM_SYM_ONLY \ - (const unsigned char[]){ \ - 1, 2, 2, 0, 0} + (const unsigned char[]) \ + { \ + 1, 2, 2, 0, 0 \ + } /// Horizontal codes preset favouring Alphabet content -#define USX_HCODES_FAVOR_ALPHA \ - (const unsigned char[]){ \ - 0x00, 0x80, 0xA0, 0xC0, 0xE0} +#define USX_HCODES_FAVOR_ALPHA \ + (const unsigned char[]) \ + { \ + 0x00, 0x80, 0xA0, 0xC0, 0xE0 \ + } /// Length of each hcode favouring Alpha content #define USX_HCODE_LENS_FAVOR_ALPHA \ - (const unsigned char[]){ \ - 1, 3, 3, 3, 3} + (const unsigned char[]) \ + { \ + 1, 3, 3, 3, 3 \ + } /// Horizontal codes preset favouring repeating sequences -#define USX_HCODES_FAVOR_DICT \ - (const unsigned char[]){ \ - 0x00, 0x40, 0xC0, 0x80, 0xE0} +#define USX_HCODES_FAVOR_DICT \ + (const unsigned char[]) \ + { \ + 0x00, 0x40, 0xC0, 0x80, 0xE0 \ + } /// Length of each hcode favouring repeating sequences #define USX_HCODE_LENS_FAVOR_DICT \ - (const unsigned char[]){ \ - 2, 2, 3, 2, 3} + (const unsigned char[]) \ + { \ + 2, 2, 3, 2, 3 \ + } /// Horizontal codes preset favouring symbols -#define USX_HCODES_FAVOR_SYM \ - (const unsigned char[]){ \ - 0x80, 0x00, 0xA0, 0xC0, 0xE0} +#define USX_HCODES_FAVOR_SYM \ + (const unsigned char[]) \ + { \ + 0x80, 0x00, 0xA0, 0xC0, 0xE0 \ + } /// Length of each hcode favouring symbols #define USX_HCODE_LENS_FAVOR_SYM \ - (const unsigned char[]){ \ - 3, 1, 3, 3, 3} + (const unsigned char[]) \ + { \ + 3, 1, 3, 3, 3 \ + } // #define USX_HCODES_FAVOR_UMLAUT {0x00, 0x40, 0xE0, 0xC0, 0x80} // #define USX_HCODE_LENS_FAVOR_UMLAUT {2, 2, 3, 3, 2} /// Horizontal codes preset favouring umlaut letters -#define USX_HCODES_FAVOR_UMLAUT \ - (const unsigned char[]){ \ - 0x80, 0xA0, 0xC0, 0xE0, 0x00} +#define USX_HCODES_FAVOR_UMLAUT \ + (const unsigned char[]) \ + { \ + 0x80, 0xA0, 0xC0, 0xE0, 0x00 \ + } /// Length of each hcode favouring umlaut letters #define USX_HCODE_LENS_FAVOR_UMLAUT \ - (const unsigned char[]){ \ - 3, 3, 3, 3, 1} + (const unsigned char[]) \ + { \ + 3, 3, 3, 3, 1 \ + } /// Horizontal codes preset for no repeating sequences -#define USX_HCODES_NO_DICT \ - (const unsigned char[]){ \ - 0x00, 0x40, 0x80, 0x00, 0xC0} +#define USX_HCODES_NO_DICT \ + (const unsigned char[]) \ + { \ + 0x00, 0x40, 0x80, 0x00, 0xC0 \ + } /// Length of each hcode for no repeating sequences #define USX_HCODE_LENS_NO_DICT \ - (const unsigned char[]){ \ - 2, 2, 2, 0, 2} + (const unsigned char[]) \ + { \ + 2, 2, 2, 0, 2 \ + } /// Horizontal codes preset for no Unicode characters -#define USX_HCODES_NO_UNI \ - (const unsigned char[]){ \ - 0x00, 0x40, 0x80, 0xC0, 0x00} +#define USX_HCODES_NO_UNI \ + (const unsigned char[]) \ + { \ + 0x00, 0x40, 0x80, 0xC0, 0x00 \ + } /// Length of each hcode for no Unicode characters #define USX_HCODE_LENS_NO_UNI \ - (const unsigned char[]){ \ - 2, 2, 2, 2, 0} + (const unsigned char[]) \ + { \ + 2, 2, 2, 2, 0 \ + } extern const char* USX_FREQ_SEQ_DFLT[]; extern const char* USX_FREQ_SEQ_TXT[]; diff --git a/src/gps/usecase/track_recorder.cpp b/src/gps/usecase/track_recorder.cpp index 0f987a56..39446339 100644 --- a/src/gps/usecase/track_recorder.cpp +++ b/src/gps/usecase/track_recorder.cpp @@ -91,7 +91,9 @@ bool TrackRecorder::ensureDir() const String TrackRecorder::makeTrackPath() const { time_t now = time(nullptr); - struct tm tm_utc{}; + struct tm tm_utc + { + }; char time_buf[32] = {0}; if (now > 0 && gmtime_r(&now, &tm_utc)) { @@ -114,7 +116,9 @@ String TrackRecorder::isoTime(time_t t) { t = time(nullptr); } - struct tm tm_utc{}; + struct tm tm_utc + { + }; char buf[32] = {0}; if (t > 0 && gmtime_r(&t, &tm_utc)) { diff --git a/src/sstv/sstv_service.cpp b/src/sstv/sstv_service.cpp index 52914b4e..bc53f2c7 100644 --- a/src/sstv/sstv_service.cpp +++ b/src/sstv/sstv_service.cpp @@ -703,7 +703,7 @@ void sstv_task(void*) } auto* mono_buf = static_cast(malloc(kSamplesPerBlock * sizeof(int16_t))); auto* resampled = static_cast(malloc(kResampleMaxOut * sizeof(int16_t))); - auto* line_rgb = static_cast(malloc(320 * 4)); + auto* line_rgb = static_cast(malloc(320 * 4)); if (!mono_buf || !resampled || !line_rgb) { free(line_rgb); diff --git a/src/ui/screens/team/team_ui_store.cpp b/src/ui/screens/team/team_ui_store.cpp index de0ea1c8..122d62d6 100644 --- a/src/ui/screens/team/team_ui_store.cpp +++ b/src/ui/screens/team/team_ui_store.cpp @@ -138,7 +138,9 @@ std::string iso_time(time_t t) { t = time(nullptr); } - struct tm tm_utc{}; + struct tm tm_utc + { + }; char buf[32] = {0}; if (t > 0 && gmtime_r(&t, &tm_utc)) {