]> git.ipfire.org Git - thirdparty/suricata.git/commit
atomics: add SC_ATOMIC_INITPTR macro
authorVictor Julien <victor@inliniac.net>
Sun, 12 Apr 2020 09:09:34 +0000 (11:09 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Apr 2020 12:37:34 +0000 (14:37 +0200)
commitc83a607b6aebc9c270f5e1631f73e7a40947cb27
treeec953fc2c2b9a7291cccef5c893a42d531846a1c
parent531ff3ddeca3d14104875bf8bd1e06a1bbdd6f11
atomics: add SC_ATOMIC_INITPTR macro

Until now both atomic ints and pointers were initialized by SC_ATOMIC_INIT
by setting them to 0. However, C11's atomic pointer type cannot be
initialized this way w/o causing compiler warnings.

As a preparation to supporting C11's atomics, this patch introduces a
new macro to initialize atomic pointers and updates the relevant callers
to use it.
src/flow-manager.c
src/flow-worker.c
src/tm-threads.c
src/util-atomic.c
src/util-atomic.h
src/util-var-name.c