From d335837525ca150911d46e3c05af949d97551557 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 19 Oct 2018 13:41:50 +0200 Subject: [PATCH] get rid of LIST_INIT --- include/villas/list.h | 8 -------- lib/nodes/iec61850.c | 4 +++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/villas/list.h b/include/villas/list.h index 75205f36f..f3b13630f 100644 --- a/include/villas/list.h +++ b/include/villas/list.h @@ -41,14 +41,6 @@ extern "C" { #define LIST_CHUNKSIZE 16 /** Static list initialization */ -#define LIST_INIT() { \ - .array = NULL, \ - .length = 0, \ - .capacity = 0, \ - .lock = PTHREAD_MUTEX_INITIALIZER, \ - .state = STATE_INITIALIZED \ -} - #define LIST_INIT_STATIC(l) \ __attribute__((constructor(105))) static void UNIQUE(__ctor)() {\ if ((l)->state == STATE_DESTROYED) \ diff --git a/lib/nodes/iec61850.c b/lib/nodes/iec61850.c index 81e8545a2..8dcf789f2 100644 --- a/lib/nodes/iec61850.c +++ b/lib/nodes/iec61850.c @@ -60,11 +60,13 @@ const struct iec61850_type_descriptor type_descriptors[] = { }; /** Each network interface needs a separate receiver */ -static struct list receivers = LIST_INIT(); +static struct list receivers; static pthread_t thread; static EthernetHandleSet hset; static int users = 0; +LIST_INIT_STATIC(&receivers); + static void * iec61850_thread(void *ctx) { int ret;