Skip to content

Commit 091e4bd

Browse files
indent
1 parent d6d566c commit 091e4bd

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/dynamic/pool.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <sys/types.h>
1111
#include <sys/epoll.h>
1212

13-
1413
#include "list.h"
1514
#include "buffer.h"
1615
#include "vector.h"
@@ -137,7 +136,7 @@ static void pool_update(pool *pool)
137136

138137
while (pool->workers_count > workers_goal)
139138
{
140-
e = pool_send(pool, (pool_message[]){{.type = POOL_MESSAGE_WORKER}});
139+
e = pool_send(pool, (pool_message[]) {{.type = POOL_MESSAGE_WORKER}});
141140
if (e == -1)
142141
break;
143142
pool->workers_count--;
@@ -146,7 +145,7 @@ static void pool_update(pool *pool)
146145
while (!list_empty(&pool->jobs_queued))
147146
{
148147
user = list_front(&pool->jobs_queued);
149-
e = pool_send(pool, (pool_message[]){{.type = POOL_MESSAGE_JOB, .user = user}});
148+
e = pool_send(pool, (pool_message[]) {{.type = POOL_MESSAGE_JOB, .user = user}});
150149
if (e == -1)
151150
break;
152151
list_splice(list_front(&pool->jobs_waiting), user);
@@ -252,7 +251,7 @@ core_id pool_enqueue(pool *pool, core_callback *callback, void *state)
252251
pool_activated = 1;
253252
job = list_push_back(&pool->jobs_queued, NULL, sizeof *job);
254253
*job = (core_handler) {.callback = callback, .state = state};
255-
pool->jobs_count ++;
254+
pool->jobs_count++;
256255

257256
pool_update(pool);
258257

test/pool.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,15 @@ void fails(__attribute__((unused)) void **unused)
186186
debug_socketpair = 0;
187187
assert_int_equal(pool_errors(&p), 1);
188188
core_destruct(NULL);
189-
190189
}
191190

192191
int main()
193192
{
194193
const struct CMUnitTest tests[] =
195-
{
196-
cmocka_unit_test(basic),
197-
cmocka_unit_test(fails),
198-
};
194+
{
195+
cmocka_unit_test(basic),
196+
cmocka_unit_test(fails),
197+
};
199198

200199
return cmocka_run_group_tests(tests, NULL, NULL);
201200
}

0 commit comments

Comments
 (0)