From: "cron2 (Code Review)" Date: Wed, 8 Apr 2026 12:39:55 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <605980521e035331a4d70b2cc87d0adfd90226b3-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="fLnCS5LYKzM="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Clarify operator precedence in a & b ? c : d List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --fLnCS5LYKzM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#3) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1619?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: Clarify operator precedence in a & b ? c : d ...................................................................... Clarify operator precedence in a & b ? c : d As suggested by cppcheck. Change-Id: Ia153e0de888c0ee21199b192f3471ce4c08cb5c7 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1619 Message-Id: <20260407205235.31126-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36= 545.html Signed-off-by: Gert Doering --- M src/openvpn/error.h M src/openvpn/options.c M src/openvpnserv/common.c 3 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/19/1619/3 diff --git a/src/openvpn/error.h b/src/openvpn/error.h index 1198994..3b742d7 100644 --- a/src/openvpn/error.h +++ b/src/openvpn/error.h @@ -397,7 +397,7 @@ static inline msglvl_t nonfatal(const msglvl_t err) { - return err & M_FATAL ? (err ^ M_FATAL) | M_NONFATAL : err; + return (err & M_FATAL) ? (err ^ M_FATAL) | M_NONFATAL : err; } static inline int diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 713dcf4..b8d0f5a 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -7044,12 +7044,12 @@ if (options->routes->flags & RG_REROUTE_GW) { setenv_int(es, "route_redirect_gateway_ipv4", - options->routes->flags & RG_BLOCK_LOCAL ? 2 : 1); + (options->routes->flags & RG_BLOCK_LOCAL) ? 2 : 1); } if (options->routes_ipv6 && (options->routes_ipv6->flags & RG_RERO= UTE_GW)) { setenv_int(es, "route_redirect_gateway_ipv6", - options->routes->flags & RG_BLOCK_LOCAL ? 2 : 1); + (options->routes->flags & RG_BLOCK_LOCAL) ? 2 : 1); } #ifdef _WIN32 /* we need this here to handle pushed --redirect-gateway */ diff --git a/src/openvpnserv/common.c b/src/openvpnserv/common.c index f60e2f2..7fc8c14 100644 --- a/src/openvpnserv/common.c +++ b/src/openvpnserv/common.c @@ -276,7 +276,7 @@ const WCHAR *mesg[] =3D { msg[0], msg[1] }; ReportEvent(hEventSource, - flags & MSG_FLAGS_ERROR ? EVENTLOG_ERROR_TYPE : EVENTL= OG_INFORMATION_TYPE, + (flags & MSG_FLAGS_ERROR) ? EVENTLOG_ERROR_TYPE : EVEN= TLOG_INFORMATION_TYPE, 0, EVT_TEXT_2, NULL, -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1619?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ia153e0de888c0ee21199b192f3471ce4c08cb5c7 Gerrit-Change-Number: 1619 Gerrit-PatchSet: 3 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --fLnCS5LYKzM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #3 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by cron2

Clarify operator precedence in a &a=
mp; b ? c : d

As suggested by cppcheck.

Change-Id: Ia153e0de8= 88c0ee21199b192f3471ce4c08cb5c7
Signed-off-by: Frank Lichtenheld <fra= nk@...2641...>
Acked-by: Gert Doering <gert@...1296...>
Gerr= it URL: https://gerrit.openvpn.net/c/openvpn/+/1619
Message-Id: <2026= 0407205235.31126-1-gert@...1296...>
URL: https://www.mail-archive.com= /openvpn-devel@lists.sourceforge.net/msg36545.html
Signed-off-by: Gert D= oering <gert@...1296...>
---
M src/openvpn/error.h
M src/ope= nvpn/options.c
M src/openvpnserv/common.c
3 files changed, 4 insertio= ns(+), 4 deletions(-)

git pull ssh://gerrit.open=
vpn.net:29418/openvpn refs/changes/19/1619/3
diff --git a/src/openv=
pn/error.h b/src/openvpn/error.h
index 1198994..3b742d7 100= 644
--- a/src/openvpn/error.h
+++ b/src/ope= nvpn/error.h
@@ -397,7 +397,7 @@
static in= line msglvl_t
nonfatal(const msglvl_t err)
{
- return err &am= p; M_FATAL ? (err ^ M_FATAL) | M_NONFATAL : err;
+ return (err & M_FATAL) ? (err ^ M_FATA= L) | M_NONFATAL : err;
}

static inline int
diff --git a/src/openvpn/options.c b/sr= c/openvpn/options.c
index 713dcf4..b8d0f5a 100644--- a/src/openvpn/options.c
+++ b/src/openvpn/option= s.c
@@ -7044,12 +7044,12 @@
if (op= tions->routes->flags & RG_REROUTE_GW)
{<= /span>
setenv_int(es, "route_redirect_gateway_ip= v4",
- = options->routes->flags & RG_BLOCK_LOCAL ? 2 : 1);
+ (= options->routes->flags & RG_BLOCK_LOCAL) ? 2 : 1);
}

if (options->routes_ipv6 &&= ; (options->routes_ipv6->flags & RG_REROUTE_GW))
= {
setenv_int(es, "route_redirect= _gateway_ipv6",
- = options->routes->flags & RG_BLOCK_LOCAL ? 2= : 1);
+ = (options->routes->flags & RG_BLOCK_LOCAL) ? 2 : 1);
}
#ifdef _WIN32
= /* we need this here to handle pushed --redirect-gateway */
= diff --git a/src/openvpnserv/common.c b/src/openvpnserv/common.c
index f60e2f2..7fc8c14 100644
--- a/src/openvpn= serv/common.c
+++ b/src/openvpnserv/common.c
@@ -276,7 +276,7 @@


const WCHA= R *mesg[] =3D { msg[0], msg[1] };
ReportEvent(hEve= ntSource,
- = flags & MSG_FLAGS_ERROR ? EVENTLOG_ERROR_TYPE : EVENTLOG_INFORM= ATION_TYPE,
+ = (flags & MSG_FLAGS_ERROR) ? EVENTLOG_ERROR_TYPE : EVENTLOG_= INFORMATION_TYPE,
0,
= EVT_TEXT_2,
NULL,<= /span>

To view, visit change 1619. To unsubscribe,= or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia153e0de888c0ee21199b192f34= 71ce4c08cb5c7
Gerrit-Change-Number: 1619
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --fLnCS5LYKzM=--