From: Razvan Cojocaru <[email protected]> Turn the CM_* defines into enum context_mode and use it for struct context.mode, so -Wswitch covers switches over it.
Drop the stale CM_THREAD mention from the comments. Change-Id: Ifa05b9fd06e5d52818c91c5b160b6dd06ec71396 Signed-off-by: Razvan Cojocaru <[email protected]> Acked-by: Lev Stipakov <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2333 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2333 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Lev Stipakov <[email protected]> diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 8b64944..10a232c 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -2768,6 +2768,9 @@ case CM_CHILD_TCP: sec = c->options.ce.connect_retry_seconds; break; + + default: + break; } #ifdef ENABLE_DEBUG diff --git a/src/openvpn/openvpn.h b/src/openvpn/openvpn.h index ad6be88..cbda2e3 100644 --- a/src/openvpn/openvpn.h +++ b/src/openvpn/openvpn.h @@ -430,6 +430,16 @@ }; +/** Role of a context within the OpenVPN process */ +enum context_mode +{ + CM_P2P, /**< standalone point-to-point session or client */ + CM_TOP, /**< top level of a multi-client or point-to-multipoint server */ + CM_TOP_CLONE, /**< clone of a CM_TOP context for one thread */ + CM_CHILD_UDP, /**< child context of a CM_TOP */ + CM_CHILD_TCP, /**< child context of a CM_TOP */ +}; + /** * Contains all state information for one tunnel. * @@ -443,22 +453,14 @@ */ struct context { - struct options options; /**< Options loaded from command line or - * configuration file. */ + struct options options; /**< Options loaded from command line or + * configuration file. */ - bool first_time; /**< True on the first iteration of - * OpenVPN's main loop. */ + bool first_time; /**< True on the first iteration of + * OpenVPN's main loop. */ - /* context modes */ -#define CM_P2P 0 /* standalone point-to-point session or client */ -#define CM_TOP 1 /* top level of a multi-client or point-to-multipoint server */ -#define CM_TOP_CLONE 2 /* clone of a CM_TOP context for one thread */ -#define CM_CHILD_UDP 3 /* child context of a CM_TOP or CM_THREAD */ -#define CM_CHILD_TCP 4 /* child context of a CM_TOP or CM_THREAD */ - int mode; /**< Role of this context within the - * OpenVPN process. Valid values are \c - * CM_P2P, \c CM_TOP, \c CM_TOP_CLONE, - * \c CM_CHILD_UDP, and \c CM_CHILD_TCP. */ + enum context_mode mode; /**< Role of this context within the + * OpenVPN process. */ struct multi_context *multi; /**< Pointer to the main P2MP context. * Non-NULL only when mode == CM_TOP. */ _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
