Skip to content

Commit 4e2dba4

Browse files
committed
chore: Reformat sources with astyle.
Restyled astyle is fixed now.
1 parent 4359e3a commit 4e2dba4

File tree

149 files changed

+712
-1244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+712
-1244
lines changed

.restyled.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ exclude:
55

66
restylers:
77
- astyle:
8+
image: restyled/restyler-astyle:d7967bcb8b622a98524b7df1da1b02652114cf9a
89
arguments: ["--options=other/astyle/astylerc"]
910
include:
1011
- "**/*.c"
1112
- "**/*.h"
1213
- autopep8
1314
- black
1415
- clang-format:
15-
image: restyled/restyler-clang-format:13.0.1
16+
image: restyled/restyler-clang-format:v16.0.6
1617
include:
1718
- "**/*.cc"
1819
- "**/*.hh"

auto_tests/TCP_test.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static void test_client_invalid(void)
655655
ip_port_tcp_s.port = net_htons(ports[random_u32(rng) % NUM_PORTS]);
656656
ip_port_tcp_s.ip = get_loopback();
657657
TCP_Client_Connection *conn = new_tcp_connection(logger, mem, mono_time, rng, ns, &ip_port_tcp_s,
658-
self_public_key, f_public_key, f_secret_key, nullptr);
658+
self_public_key, f_public_key, f_secret_key, nullptr);
659659

660660
// Run the client's main loop but not the server.
661661
mono_time_update(mono_time);
@@ -709,7 +709,6 @@ static int tcp_data_callback(void *object, int id, const uint8_t *data, uint16_t
709709
return 0;
710710
}
711711

712-
713712
static void test_tcp_connection(void)
714713
{
715714
const Random *rng = os_random();

auto_tests/announce_test.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ static void basic_announce_tests(void)
120120
test_store_data();
121121
}
122122

123-
124123
int main(void)
125124
{
126125
setvbuf(stdout, nullptr, _IONBF, 0);

auto_tests/auto_test_support.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ void print_debug_log(Tox *m, Tox_Log_Level level, const char *file, uint32_t lin
444444
}
445445
}
446446

447-
448447
void print_debug_logger(void *context, Logger_Level level, const char *file, int line, const char *func, const char *message, void *userdata)
449448
{
450449
print_debug_log(nullptr, (Tox_Log_Level) level, file, (uint32_t) line, func, message, userdata);

auto_tests/auto_test_support.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void print_debug_log(Tox *m, Tox_Log_Level level, const char *file, uint32_t lin
6161

6262
// Use this function when setting the log callback on a Logger object
6363
void print_debug_logger(void *context, Logger_Level level, const char *file, int line,
64-
const char *func, const char *message, void *userdata);
64+
const char *func, const char *message, void *userdata);
6565

6666
Tox *tox_new_log(struct Tox_Options *options, Tox_Err_New *err, void *log_user_data);
6767
Tox *tox_new_log_lan(struct Tox_Options *options, Tox_Err_New *err, void *log_user_data, bool lan_discovery);

auto_tests/conference_av_test.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ static void test_groupav(AutoTox *autotoxes)
426426
ck_assert_msg(tox_conference_invite(autotoxes[0].tox, 0, 0, nullptr) != 0, "failed to invite friend");
427427
((State *)autotoxes[0].state)->invited_next = true;
428428

429-
430429
printf("waiting for invitations to be made\n");
431430
uint32_t invited_count = 0;
432431

auto_tests/conference_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ static bool names_propagated(uint32_t tox_count, AutoTox *autotoxes)
174174
return true;
175175
}
176176

177-
178177
/**
179178
* returns a random index at which a list of booleans is false
180179
* (some such index is required to exist)
@@ -357,7 +356,6 @@ static void test_many_group(AutoTox *autotoxes)
357356
nullptr) != 0,
358357
"failed to set group title");
359358

360-
361359
printf("waiting for invitations to be made\n");
362360
uint32_t invited_count = 0;
363361

auto_tests/dht_getnodes_api_test.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,9 @@ static void test_dht_getnodes(AutoTox *autotoxes)
128128
tox_events_callback_dht_get_nodes_response(autotoxes[i].dispatch, getnodes_response_cb);
129129

130130
printf("Peer %zu dht closenode count total/announce-capable: %d/%d\n",
131-
i,
132-
tox_dht_get_num_closelist(autotoxes[i].tox),
133-
tox_dht_get_num_closelist_announce_capable(autotoxes[i].tox)
134-
);
131+
i,
132+
tox_dht_get_num_closelist(autotoxes[i].tox),
133+
tox_dht_get_num_closelist_announce_capable(autotoxes[i].tox));
135134
}
136135

137136
while (!all_nodes_crawled(autotoxes, NUM_TOXES, public_key_list)) {

auto_tests/encryptsave_test.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ static void test_keys(void)
184184
free(in_plaintext2a);
185185
free(out_plaintext2a);
186186

187-
188187
uint8_t encrypted2[44 + TOX_PASS_ENCRYPTION_EXTRA_LENGTH];
189188
ret = tox_pass_encrypt(string, 44, key_char, 12, encrypted2, &encerr);
190189
ck_assert_msg(ret, "generic failure 3: %d", encerr);

auto_tests/file_streaming_test.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,13 @@ static void tox_file_chunk_request(Tox *tox, uint32_t friend_number, uint32_t fi
126126
Tox_Err_File_Send_Chunk error;
127127
tox_file_send_chunk(tox, friend_number, file_number, position, f_data, length, &error);
128128

129-
130129
ck_assert_msg(error == TOX_ERR_FILE_SEND_CHUNK_OK,
131130
"could not send chunk, error num=%d pos=%d len=%d", (int)error, (int)position, (int)length);
132131

133132
++sending_num;
134133
sending_pos += length;
135134
}
136135

137-
138136
static uint8_t num;
139137
static bool file_recv;
140138
static void write_file(Tox *tox, uint32_t friendnumber, uint32_t filenumber, uint64_t position, const uint8_t *data,
@@ -225,8 +223,8 @@ static void file_transfer_test(void)
225223
tox_callback_file_recv(tox3, tox_file_receive);
226224
const uint64_t totalf_size = UINT64_MAX;
227225
Tox_File_Number fnum = tox_file_send(
228-
tox2, 0, TOX_FILE_KIND_DATA, totalf_size, nullptr,
229-
(const uint8_t *)"Gentoo.exe", sizeof("Gentoo.exe"), nullptr);
226+
tox2, 0, TOX_FILE_KIND_DATA, totalf_size, nullptr,
227+
(const uint8_t *)"Gentoo.exe", sizeof("Gentoo.exe"), nullptr);
230228
ck_assert_msg(fnum != UINT32_MAX, "tox_new_file_sender fail");
231229

232230
Tox_Err_File_Get gfierr;

0 commit comments

Comments
 (0)