1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

SKIP_BACK_DECLARE: easier embedded-to-parent typecasting

This commit is contained in:
Maria Matejka
2024-04-26 12:14:33 +02:00
parent 5b713566b8
commit 0fff47aeea
19 changed files with 89 additions and 88 deletions

View File

@@ -482,7 +482,7 @@ sockets_prepare(struct birdloop *loop, struct pfd *pfd)
node *n;
WALK_LIST(n, loop->sock_list)
{
sock *s = SKIP_BACK(sock, n, n);
SKIP_BACK_DECLARE(sock, s, n, n);
uint w = sk_want_events(s);
if (!w)
@@ -1244,7 +1244,7 @@ bird_thread_show_loop(struct bird_thread_show_data *tsd, struct birdloop *loop)
static void
bird_thread_show(struct bird_thread_syncer *sync)
{
struct bird_thread_show_data *tsd = SKIP_BACK(struct bird_thread_show_data, sync, sync);
SKIP_BACK_DECLARE(struct bird_thread_show_data, tsd, sync, sync);
if (!tsd->lp)
tsd->lp = lp_new(tsd->sync.pool);
@@ -1276,7 +1276,7 @@ bird_thread_show(struct bird_thread_syncer *sync)
static void
cmd_show_threads_done(struct bird_thread_syncer *sync)
{
struct bird_thread_show_data *tsd = SKIP_BACK(struct bird_thread_show_data, sync, sync);
SKIP_BACK_DECLARE(struct bird_thread_show_data, tsd, sync, sync);
ASSERT_DIE(birdloop_inside(&main_birdloop));
tsd->cli->cont = NULL;

View File

@@ -110,7 +110,7 @@ struct log_thread_syncer {
static void
lts_done(struct bird_thread_syncer *sync)
{
struct log_thread_syncer *lts = SKIP_BACK(struct log_thread_syncer, sync, sync);
SKIP_BACK_DECLARE(struct log_thread_syncer, lts, sync, sync);
log_lock();
if (lts->lc_close)