Skip to content

Commit 6f12645

Browse files
committed
style: apply clang-format to satisfy CI format check
1 parent c948461 commit 6f12645

File tree

5 files changed

+55
-102
lines changed

5 files changed

+55
-102
lines changed

src/board/TLoRaPagerBoard.cpp

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

19591958
for (auto pin : pins)
19601959
{

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

Lines changed: 50 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -61,137 +61,97 @@
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-
{ \
67-
0x00, 0x40, 0x80, 0xC0, 0xE0 \
68-
}
64+
#define USX_HCODES_DFLT \
65+
(const unsigned char[]){ \
66+
0x00, 0x40, 0x80, 0xC0, 0xE0}
6967
/// Length of each default hcode
70-
#define USX_HCODE_LENS_DFLT \
71-
(const unsigned char[]) \
72-
{ \
73-
2, 2, 2, 3, 3 \
74-
}
68+
#define USX_HCODE_LENS_DFLT \
69+
(const unsigned char[]){ \
70+
2, 2, 2, 3, 3}
7571

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

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

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

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

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

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

154126
// #define USX_HCODES_FAVOR_UMLAUT {0x00, 0x40, 0xE0, 0xC0, 0x80}
155127
// #define USX_HCODE_LENS_FAVOR_UMLAUT {2, 2, 3, 3, 2}
156128

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

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

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

196156
extern const char* USX_FREQ_SEQ_DFLT[];
197157
extern const char* USX_FREQ_SEQ_TXT[];

src/gps/usecase/track_recorder.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ bool TrackRecorder::ensureDir() const
9191
String TrackRecorder::makeTrackPath() const
9292
{
9393
time_t now = time(nullptr);
94-
struct tm tm_utc
95-
{
96-
};
94+
struct tm tm_utc{};
9795
char time_buf[32] = {0};
9896
if (now > 0 && gmtime_r(&now, &tm_utc))
9997
{
@@ -116,9 +114,7 @@ String TrackRecorder::isoTime(time_t t)
116114
{
117115
t = time(nullptr);
118116
}
119-
struct tm tm_utc
120-
{
121-
};
117+
struct tm tm_utc{};
122118
char buf[32] = {0};
123119
if (t > 0 && gmtime_r(&t, &tm_utc))
124120
{

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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@ std::string iso_time(time_t t)
138138
{
139139
t = time(nullptr);
140140
}
141-
struct tm tm_utc
142-
{
143-
};
141+
struct tm tm_utc{};
144142
char buf[32] = {0};
145143
if (t > 0 && gmtime_r(&t, &tm_utc))
146144
{

0 commit comments

Comments
 (0)