From: "flichtenheld (Code Review)" Date: Mon, 13 Oct 2025 12:38:44 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="pP/b5HRay/4="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: schedule: Fix conversion warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --pP/b5HRay/4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1270?usp=3Demail to review the following change. Change subject: schedule: Fix conversion warning ...................................................................... schedule: Fix conversion warning Return value of random() is safe to cast. Change-Id: I5e6cb3a287a2e8e1584036307b4c21bb68050c6a Signed-off-by: Frank Lichtenheld --- M src/openvpn/schedule.c 1 file changed, 1 insertion(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/70/1270/1 diff --git a/src/openvpn/schedule.c b/src/openvpn/schedule.c index 1389889..bf6693f 100644 --- a/src/openvpn/schedule.c +++ b/src/openvpn/schedule.c @@ -65,25 +65,16 @@ } #endif -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - static inline void schedule_set_pri(struct schedule_entry *e) { - e->pri =3D random(); + e->pri =3D (unsigned int)random(); if (e->pri < 1) { e->pri =3D 1; } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - /* This is the master key comparison routine. A key is * simply a struct timeval containing the absolute time for * an event. The unique treap priority (pri) is used to ensure -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1270?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I5e6cb3a287a2e8e1584036307b4c21bb68050c6a Gerrit-Change-Number: 1270 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --pP/b5HRay/4= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

schedule: Fix conversion warning

Ret= urn value of random() is safe to cast.

Change-Id: I5e6cb3a287a2e8e15= 84036307b4c21bb68050c6a
Signed-off-by: Frank Lichtenheld <frank@...2375...= 41...>
---
M src/openvpn/schedule.c
1 file changed, 1 insertion= (+), 10 deletions(-)

git pull ssh://gerrit.openv=
pn.net:29418/openvpn refs/changes/70/1270/1
diff --git a/src/openvp=
n/schedule.c b/src/openvpn/schedule.c
index 1389889..bf6693= f 100644
--- a/src/openvpn/schedule.c
+++ b= /src/openvpn/schedule.c
@@ -65,25 +65,16 @@
}
#endif

-#if defined(__GNUC__) || defined(__clang__)<= br>-#pragma GCC diagnostic push
-#pragma GCC diagnostic = ignored "-Wconversion"
-#endif
-
static inline void
schedule_set_pri(struct s= chedule_entry *e)
{
- e->pri =3D random();
+ e->pri =3D (unsigned int)random();
= if (e->pri < 1)
{
= e->pri =3D 1;
}
}
=
-#if defined(__= GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
/* This is the master key comparison routine. A key is
* simply a struct timeval containing the absolute time for
* an event. The unique treap priority (pri) is used to en= sure

To view, visit change 1270. To unsubsc= ribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5e6cb3a287a2e8e1584036307b4= c21bb68050c6a
Gerrit-Change-Number: 1270
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --pP/b5HRay/4=--