mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 08:34:20 +01:00
common: tal_dup_talarr() helper.
This is a common thing to do, so create a macro. Unfortunately, it still needs the type arg, because the paramter may be const, and the return cannot be, and C doesn't have a general "(-const)" cast. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -16,7 +16,7 @@ struct msg_queue *msg_queue_new(const tal_t *ctx)
|
||||
|
||||
static void do_enqueue(struct msg_queue *q, const u8 *add TAKES)
|
||||
{
|
||||
tal_arr_expand(&q->q, tal_dup_arr(q, u8, add, tal_count(add), 0));
|
||||
tal_arr_expand(&q->q, tal_dup_talarr(q, u8, add));
|
||||
|
||||
/* In case someone is waiting */
|
||||
io_wake(q);
|
||||
|
||||
Reference in New Issue
Block a user