]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Replace MSG_TEST() macro for static inline msg_test()
authorSteffan Karger <steffan@karger.me>
Sun, 27 Mar 2016 14:18:16 +0000 (16:18 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 4 Apr 2016 18:28:41 +0000 (20:28 +0200)
commitbbde0a766c69f573746461415c6f5cd289272fff
tree713e595313baa8d602d0c90d75fd837f2542d8a3
parentbe16d5f6b050248f503455e4a0e8f3aaaa38bdc7
Replace MSG_TEST() macro for static inline msg_test()

Using a static inline function instead of a macro has the advantages that
(1) 'flags' is not evaluated twice and (2) coverity will stop complaining
that 'Macro compares unsigned to 0 (NO_EFFECT)' each time we use flags
with loglevel 0 (e.g. M_FATAL or M_WARN).

This has a performance impact when compiler optimizations are fully
disabled ('-O0'), but should otherwise be as fast as using a macro.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1459088296-5046-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11368
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/error.c
src/openvpn/error.h
src/openvpn/plugin.c