1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Treat all warnings as errors: never commit code which generates compiler warnings! Never!

The CI will reject your merges from now on!
This commit is contained in:
Steffen Vogel 2016-09-13 21:50:35 -04:00
parent 9fbe67f0da
commit f80a58c1b4
3 changed files with 5 additions and 8 deletions

View file

@ -32,7 +32,7 @@ LIB_LDFLAGS = -shared
LIB_LDLIBS = -ldl -lrt
CFLAGS += -std=c11 -Iinclude -Iinclude/villas -I. -MMD -mcx16
CFLAGS += -Wall -fdiagnostics-color=auto
CFLAGS += -Wall -Werror -fdiagnostics-color=auto
CFLAGS += -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1 -DV=$(V)
LDFLAGS += -pthread -L. -Wl,-rpath,'$$ORIGIN'

View file

@ -32,7 +32,8 @@ struct lstack_head {
struct lstack {
struct lstack_node *node_buffer;
_Atomic struct lstack_head head, free;
_Atomic struct lstack_head head; /**> List of stack elements */
_Atomic struct lstack_head free; /**> List of unused elements */
_Atomic size_t size, avail;
};

View file

@ -69,13 +69,9 @@ int lstack_init(struct lstack *lstack, size_t maxsz)
lstack->node_buffer[i-1].next = &lstack->node_buffer[i];
lstack->node_buffer[maxsz - 1].next = NULL;
/* List of unused elements */
lstack->free.aba = ATOMIC_VAR_INIT(0);
lstack->free.node = ATOMIC_VAR_INIT(lstack->node_buffer);
/* List of stack elements */
lstack->head.aba = ATOMIC_VAR_INIT(0);
lstack->head.node = ATOMIC_VAR_INIT(NULL);
lstack->free = ATOMIC_VAR_INIT(((struct lstack_head) { 0, lstack->node_buffer }));
lstack->head = ATOMIC_VAR_INIT(((struct lstack_head) { 0, NULL }));
lstack->size = ATOMIC_VAR_INIT(0);
lstack->avail = ATOMIC_VAR_INIT(maxsz);