From: "cron2 (Code Review)" Date: Mon, 15 Dec 2025 15:47:53 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <45fc0a45a56e4a853f13a44fdfd4f5ce6e825f7f-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="qG1KiEBWFPo="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: multi: Fix various conversion warnings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --qG1KiEBWFPo= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#10) to the change originally created b= y flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1313?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by plaisthos Change subject: multi: Fix various conversion warnings ...................................................................... multi: Fix various conversion warnings Mostly make required casts explicit. Change-Id: I88cd7e1ebb49e97db33bad75c4fbbe23d196e964 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1313 Message-Id: <20251215145840.18310-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 073.html Signed-off-by: Gert Doering --- M src/openvpn/multi.c 1 file changed, 8 insertions(+), 15 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/13/1313/10 diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 20d72c1..92eac6f 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -245,11 +245,6 @@ #endif -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - #ifdef ENABLE_ASYNC_PUSH static uint32_t /* @@ -2809,8 +2804,8 @@ multi_process_file_closed(struct multi_context *m, const unsigned int mpp_= flags) { char buffer[INOTIFY_EVENT_BUFFER_SIZE]; - size_t buffer_i =3D 0; - int r =3D read(m->top.c2.inotify_fd, buffer, INOTIFY_EVENT_BUFFER_SIZE= ); + ssize_t buffer_i =3D 0; + ssize_t r =3D read(m->top.c2.inotify_fd, buffer, INOTIFY_EVENT_BUFFER_= SIZE); while (buffer_i < r) { @@ -2942,21 +2937,23 @@ static inline unsigned int compute_wakeup_sigma(const struct timeval *delta) { + ASSERT(delta->tv_sec >=3D 0); + ASSERT(delta->tv_usec >=3D 0); if (delta->tv_sec < 1) { /* if < 1 sec, fuzz =3D # of microseconds / 8 */ - return delta->tv_usec >> 3; + return (unsigned int)(delta->tv_usec >> 3); } else { /* if < 10 minutes, fuzz =3D 13.1% of timeout */ if (delta->tv_sec < 600) { - return delta->tv_sec << 17; + return (unsigned int)(delta->tv_sec << 17); } else { - return 120000000; /* if >=3D 10 minutes, fuzz =3D 2 minutes */ + return 120 * 1000000; /* if >=3D 10 minutes, fuzz =3D 2 minute= s */ } } } @@ -3743,7 +3740,7 @@ for (i =3D 0; i < parm.packet_size; ++i) { - ASSERT(buf_write_u8(&buf, get_random() & 0xFF)); + ASSERT(buf_write_u8(&buf, (uint8_t)(get_random() & 0xFF))); } for (i =3D 0; i < parm.n_packets; ++i) @@ -3959,10 +3956,6 @@ return count; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static void management_delete_event(void *arg, event_t event) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1313?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: I88cd7e1ebb49e97db33bad75c4fbbe23d196e964 Gerrit-Change-Number: 1313 Gerrit-PatchSet: 10 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --qG1KiEBWFPo= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #10 to the change originally created by flichtenhe= ld.

View Change

The following approvals got outdated and were remov= ed: Code-Review+2 by plaisthos

multi: Fix various conversion w=
arnings

Mostly make required casts explicit.

Change-Id: I88cd= 7e1ebb49e97db33bad75c4fbbe23d196e964
Signed-off-by: Frank Lichtenheld &l= t;frank@...2641...>
Acked-by: Arne Schwabe <arne-openvpn@...2477...= .>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1313
Message= -Id: <20251215145840.18310-1-gert@...1296...>
URL: https://www.mai= l-archive.com/openvpn-devel@lists.sourceforge.net/msg35073.html
Signed-o= ff-by: Gert Doering <gert@...1296...>
---
M src/openvpn/multi.c=
1 file changed, 8 insertions(+), 15 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/13/1313/1=
0
diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
= index 20d72c1..92eac6f 100644
--- a/src/openvpn/multi= .c
+++ b/src/openvpn/multi.c
@@ -245,11 +24= 5,6 @@

#endif
-#if defined(__GNUC__) || defin= ed(__clang__)
-#pragma = GCC diagnostic push
-#p= ragma GCC diagnostic ignored "-Wconversion"
-#endif
-
#ifdef ENABLE_ASYNC_PUSH
static uint32_t
/*
@@ -2809,8 +2804,8 @@=
multi_process_file_closed(struct multi_context *m, const = unsigned int mpp_flags)
{
char buffer= [INOTIFY_EVENT_BUFFER_SIZE];
- size_t buffer_i =3D 0;
- int r =3D read(m->top.c2.inotify_fd, buffer, INOTIFY_EVE= NT_BUFFER_SIZE);
+ = ssize_t buffer_i =3D 0;
+ ssize_t r =3D read(m->top.c2.inotify_fd, buffer, INOTIFY_EVENT_= BUFFER_SIZE);

while (buffer_i < r= )
{
@@ -2942,21 +2937,23 @@
= static inline unsigned int
compute_wakeup_sigma(con= st struct timeval *delta)
{
+ ASSERT(delta->tv_sec >=3D 0);
= + ASSERT(delta->tv_usec &= gt;=3D 0);
if (delta->tv_sec < 1)
{
/* if < 1 sec, fuzz =3D # of microseco= nds / 8 */
- ret= urn delta->tv_usec >> 3;
+ return (unsigned int)(delta->tv_usec >> 3);<= /span>
}
else
{
/* if < 10 minutes, fuzz =3D 13.1% of timeout */
if (delta->tv_sec < 600)
= {
- ret= urn delta->tv_sec << 17;
+ return (unsigned int)(delta->tv_sec << 1= 7);
}
else
{

- = return 120000000; /* if >=3D 10 minutes, fuzz =3D 2 minutes */=
+ return 120 * 1= 000000; /* if >=3D 10 minutes, fuzz =3D 2 minutes */
= }
}
}
@@ -3743,= 7 +3740,7 @@

for (i =3D 0; i <= ; parm.packet_size; ++i)
{
- ASSERT(buf_write_u8(&buf, g= et_random() & 0xFF));
+ ASSERT(buf_write_u8(&buf, (uint8_t)(get_random() &= ; 0xFF)));
}

= for (i =3D 0; i < parm.n_packets; ++i)
@@ -3959,10= +3956,6 @@
return count;
}
-#if defined(_= _GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-<= /span>
static void
management_delete_event(void = *arg, event_t event)
{

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I88cd7e1ebb49e97db33bad75c4f= bbe23d196e964
Gerrit-Change-Number: 1313
Gerrit-PatchSet: 10
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --qG1KiEBWFPo=--