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:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user