Skip to content

Commit bbd5b8c

Browse files
committed
style: reformat sources with clang-format 14.0.6
1 parent 6f12645 commit bbd5b8c

File tree

6 files changed

+107
-60
lines changed

6 files changed

+107
-60
lines changed

src/board/TLoRaPagerBoard.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,8 @@ void TLoRaPagerBoard::shutdown(bool save_data)
19531953
LORA_CS,
19541954
LORA_RST,
19551955
LORA_BUSY,
1956-
LORA_IRQ};
1956+
LORA_IRQ
1957+
};
19571958

19581959
for (auto pin : pins)
19591960
{

src/chat/infra/meshcore/crypto/ed25519/sha512.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ static const uint64_t K[80] = {
5757

5858
/* Various logical functions */
5959

60-
#define ROR64c(x, y) \
61-
(((((x) & UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)(y) & UINT64_C(63))) | \
62-
((x) << ((uint64_t)(64 - ((y) & UINT64_C(63)))))) & \
60+
#define ROR64c(x, y) \
61+
(((((x)&UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)(y)&UINT64_C(63))) | \
62+
((x) << ((uint64_t)(64 - ((y)&UINT64_C(63)))))) & \
6363
UINT64_C(0xFFFFFFFFFFFFFFFF))
6464

6565
#define STORE64H(x, y) \
@@ -71,7 +71,7 @@ static const uint64_t K[80] = {
7171
(y)[4] = (unsigned char)(((x) >> 24) & 255); \
7272
(y)[5] = (unsigned char)(((x) >> 16) & 255); \
7373
(y)[6] = (unsigned char)(((x) >> 8) & 255); \
74-
(y)[7] = (unsigned char)((x) & 255); \
74+
(y)[7] = (unsigned char)((x)&255); \
7575
}
7676

7777
#define LOAD64H(x, y) \
@@ -85,7 +85,7 @@ static const uint64_t K[80] = {
8585
#define Ch(x, y, z) (z ^ (x & (y ^ z)))
8686
#define Maj(x, y, z) (((x | y) & z) | (x & y))
8787
#define S(x, n) ROR64c(x, n)
88-
#define R(x, n) (((x) & UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)n))
88+
#define R(x, n) (((x)&UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)n))
8989
#define Sigma0(x) (S(x, 28) ^ S(x, 34) ^ S(x, 39))
9090
#define Sigma1(x) (S(x, 14) ^ S(x, 18) ^ S(x, 41))
9191
#define Gamma0(x) (S(x, 1) ^ S(x, 8) ^ R(x, 7))

src/chat/infra/meshtastic/compression/unishox2.h

Lines changed: 90 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -61,97 +61,137 @@
6161

6262
/// Default Horizontal codes. When composition of text is know beforehand, the other hcodes in this section can be used to achieve
6363
/// more compression.
64-
#define USX_HCODES_DFLT \
65-
(const unsigned char[]){ \
66-
0x00, 0x40, 0x80, 0xC0, 0xE0}
64+
#define USX_HCODES_DFLT \
65+
(const unsigned char[]) \
66+
{ \
67+
0x00, 0x40, 0x80, 0xC0, 0xE0 \
68+
}
6769
/// Length of each default hcode
68-
#define USX_HCODE_LENS_DFLT \
69-
(const unsigned char[]){ \
70-
2, 2, 2, 3, 3}
70+
#define USX_HCODE_LENS_DFLT \
71+
(const unsigned char[]) \
72+
{ \
73+
2, 2, 2, 3, 3 \
74+
}
7175

7276
/// Horizontal codes preset for English Alphabet content only
73-
#define USX_HCODES_ALPHA_ONLY \
74-
(const unsigned char[]){ \
75-
0x00, 0x00, 0x00, 0x00, 0x00}
77+
#define USX_HCODES_ALPHA_ONLY \
78+
(const unsigned char[]) \
79+
{ \
80+
0x00, 0x00, 0x00, 0x00, 0x00 \
81+
}
7682
/// Length of each Alpha only hcode
7783
#define USX_HCODE_LENS_ALPHA_ONLY \
78-
(const unsigned char[]){ \
79-
0, 0, 0, 0, 0}
84+
(const unsigned char[]) \
85+
{ \
86+
0, 0, 0, 0, 0 \
87+
}
8088

8189
/// Horizontal codes preset for Alpha Numeric content only
82-
#define USX_HCODES_ALPHA_NUM_ONLY \
83-
(const unsigned char[]){ \
84-
0x00, 0x00, 0x80, 0x00, 0x00}
90+
#define USX_HCODES_ALPHA_NUM_ONLY \
91+
(const unsigned char[]) \
92+
{ \
93+
0x00, 0x00, 0x80, 0x00, 0x00 \
94+
}
8595
/// Length of each Alpha numeric hcode
8696
#define USX_HCODE_LENS_ALPHA_NUM_ONLY \
87-
(const unsigned char[]){ \
88-
1, 0, 1, 0, 0}
97+
(const unsigned char[]) \
98+
{ \
99+
1, 0, 1, 0, 0 \
100+
}
89101

90102
/// Horizontal codes preset for Alpha Numeric and Symbol content only
91103
#define USX_HCODES_ALPHA_NUM_SYM_ONLY \
92-
(const unsigned char[]){ \
93-
0x00, 0x80, 0xC0, 0x00, 0x00}
104+
(const unsigned char[]) \
105+
{ \
106+
0x00, 0x80, 0xC0, 0x00, 0x00 \
107+
}
94108
/// Length of each Alpha numeric and symbol hcodes
95109
#define USX_HCODE_LENS_ALPHA_NUM_SYM_ONLY \
96-
(const unsigned char[]){ \
97-
1, 2, 2, 0, 0}
110+
(const unsigned char[]) \
111+
{ \
112+
1, 2, 2, 0, 0 \
113+
}
98114

99115
/// Horizontal codes preset favouring Alphabet content
100-
#define USX_HCODES_FAVOR_ALPHA \
101-
(const unsigned char[]){ \
102-
0x00, 0x80, 0xA0, 0xC0, 0xE0}
116+
#define USX_HCODES_FAVOR_ALPHA \
117+
(const unsigned char[]) \
118+
{ \
119+
0x00, 0x80, 0xA0, 0xC0, 0xE0 \
120+
}
103121
/// Length of each hcode favouring Alpha content
104122
#define USX_HCODE_LENS_FAVOR_ALPHA \
105-
(const unsigned char[]){ \
106-
1, 3, 3, 3, 3}
123+
(const unsigned char[]) \
124+
{ \
125+
1, 3, 3, 3, 3 \
126+
}
107127

108128
/// Horizontal codes preset favouring repeating sequences
109-
#define USX_HCODES_FAVOR_DICT \
110-
(const unsigned char[]){ \
111-
0x00, 0x40, 0xC0, 0x80, 0xE0}
129+
#define USX_HCODES_FAVOR_DICT \
130+
(const unsigned char[]) \
131+
{ \
132+
0x00, 0x40, 0xC0, 0x80, 0xE0 \
133+
}
112134
/// Length of each hcode favouring repeating sequences
113135
#define USX_HCODE_LENS_FAVOR_DICT \
114-
(const unsigned char[]){ \
115-
2, 2, 3, 2, 3}
136+
(const unsigned char[]) \
137+
{ \
138+
2, 2, 3, 2, 3 \
139+
}
116140

117141
/// Horizontal codes preset favouring symbols
118-
#define USX_HCODES_FAVOR_SYM \
119-
(const unsigned char[]){ \
120-
0x80, 0x00, 0xA0, 0xC0, 0xE0}
142+
#define USX_HCODES_FAVOR_SYM \
143+
(const unsigned char[]) \
144+
{ \
145+
0x80, 0x00, 0xA0, 0xC0, 0xE0 \
146+
}
121147
/// Length of each hcode favouring symbols
122148
#define USX_HCODE_LENS_FAVOR_SYM \
123-
(const unsigned char[]){ \
124-
3, 1, 3, 3, 3}
149+
(const unsigned char[]) \
150+
{ \
151+
3, 1, 3, 3, 3 \
152+
}
125153

126154
// #define USX_HCODES_FAVOR_UMLAUT {0x00, 0x40, 0xE0, 0xC0, 0x80}
127155
// #define USX_HCODE_LENS_FAVOR_UMLAUT {2, 2, 3, 3, 2}
128156

129157
/// Horizontal codes preset favouring umlaut letters
130-
#define USX_HCODES_FAVOR_UMLAUT \
131-
(const unsigned char[]){ \
132-
0x80, 0xA0, 0xC0, 0xE0, 0x00}
158+
#define USX_HCODES_FAVOR_UMLAUT \
159+
(const unsigned char[]) \
160+
{ \
161+
0x80, 0xA0, 0xC0, 0xE0, 0x00 \
162+
}
133163
/// Length of each hcode favouring umlaut letters
134164
#define USX_HCODE_LENS_FAVOR_UMLAUT \
135-
(const unsigned char[]){ \
136-
3, 3, 3, 3, 1}
165+
(const unsigned char[]) \
166+
{ \
167+
3, 3, 3, 3, 1 \
168+
}
137169

138170
/// Horizontal codes preset for no repeating sequences
139-
#define USX_HCODES_NO_DICT \
140-
(const unsigned char[]){ \
141-
0x00, 0x40, 0x80, 0x00, 0xC0}
171+
#define USX_HCODES_NO_DICT \
172+
(const unsigned char[]) \
173+
{ \
174+
0x00, 0x40, 0x80, 0x00, 0xC0 \
175+
}
142176
/// Length of each hcode for no repeating sequences
143177
#define USX_HCODE_LENS_NO_DICT \
144-
(const unsigned char[]){ \
145-
2, 2, 2, 0, 2}
178+
(const unsigned char[]) \
179+
{ \
180+
2, 2, 2, 0, 2 \
181+
}
146182

147183
/// Horizontal codes preset for no Unicode characters
148-
#define USX_HCODES_NO_UNI \
149-
(const unsigned char[]){ \
150-
0x00, 0x40, 0x80, 0xC0, 0x00}
184+
#define USX_HCODES_NO_UNI \
185+
(const unsigned char[]) \
186+
{ \
187+
0x00, 0x40, 0x80, 0xC0, 0x00 \
188+
}
151189
/// Length of each hcode for no Unicode characters
152190
#define USX_HCODE_LENS_NO_UNI \
153-
(const unsigned char[]){ \
154-
2, 2, 2, 2, 0}
191+
(const unsigned char[]) \
192+
{ \
193+
2, 2, 2, 2, 0 \
194+
}
155195

156196
extern const char* USX_FREQ_SEQ_DFLT[];
157197
extern const char* USX_FREQ_SEQ_TXT[];

src/gps/usecase/track_recorder.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ bool TrackRecorder::ensureDir() const
9191
String TrackRecorder::makeTrackPath() const
9292
{
9393
time_t now = time(nullptr);
94-
struct tm tm_utc{};
94+
struct tm tm_utc
95+
{
96+
};
9597
char time_buf[32] = {0};
9698
if (now > 0 && gmtime_r(&now, &tm_utc))
9799
{
@@ -114,7 +116,9 @@ String TrackRecorder::isoTime(time_t t)
114116
{
115117
t = time(nullptr);
116118
}
117-
struct tm tm_utc{};
119+
struct tm tm_utc
120+
{
121+
};
118122
char buf[32] = {0};
119123
if (t > 0 && gmtime_r(&t, &tm_utc))
120124
{

src/sstv/sstv_service.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ void sstv_task(void*)
703703
}
704704
auto* mono_buf = static_cast<int16_t*>(malloc(kSamplesPerBlock * sizeof(int16_t)));
705705
auto* resampled = static_cast<int16_t*>(malloc(kResampleMaxOut * sizeof(int16_t)));
706-
auto* line_rgb = static_cast<uint8_t (*)[4]>(malloc(320 * 4));
706+
auto* line_rgb = static_cast<uint8_t(*)[4]>(malloc(320 * 4));
707707
if (!mono_buf || !resampled || !line_rgb)
708708
{
709709
free(line_rgb);

src/ui/screens/team/team_ui_store.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ std::string iso_time(time_t t)
138138
{
139139
t = time(nullptr);
140140
}
141-
struct tm tm_utc{};
141+
struct tm tm_utc
142+
{
143+
};
142144
char buf[32] = {0};
143145
if (t > 0 && gmtime_r(&t, &tm_utc))
144146
{

0 commit comments

Comments
 (0)