Browse Source

common: allow tal_arr_expand() to have an `n` argument.

It needs to use a non-clashing name for the internal var.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-prep
Rusty Russell 4 years ago
committed by neil saitug
parent
commit
7c3c0b1013
  1. 6
      common/utils.h

6
common/utils.h

@ -47,9 +47,9 @@ void clear_softref_(const tal_t *outer, size_t outersize, void **ptr);
/* Note: p is never a complex expression, otherwise this multi-evaluates! */ /* Note: p is never a complex expression, otherwise this multi-evaluates! */
#define tal_arr_expand(p, s) \ #define tal_arr_expand(p, s) \
do { \ do { \
size_t n = tal_count(*(p)); \ size_t n_ = tal_count(*(p)); \
tal_resize((p), n+1); \ tal_resize((p), n_+1); \
(*(p))[n] = (s); \ (*(p))[n_] = (s); \
} while(0) } while(0)
/** /**

Loading…
Cancel
Save