From: "cron2 (Code Review)" Date: Wed, 15 Jan 2025 14:33:08 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <3853e8478d0b24010e4250d3c1aba2c110165382-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="3CdRgMsd3pQ="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Fix some trivial sign-compare compiler warnings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --3CdRgMsd3pQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#4) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/865?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: Fix some trivial sign-compare compiler warnings ...................................................................... Fix some trivial sign-compare compiler warnings Change-Id: I1918c43202b87f0c987bfd9155c739da7dd02632 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Message-Id: <20250114165206.13187-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30= 455.html Signed-off-by: Gert Doering --- M src/openvpn/options.c M src/openvpn/socket.c M src/openvpn/tun.c 3 files changed, 6 insertions(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/65/865/4 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index eb0d9b5..3ef4d78 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -1448,7 +1448,7 @@ while (server) { - for (int i =3D 0; i < server->addr_count; ++i) + for (size_t i =3D 0; i < server->addr_count; ++i) { if (server->addr[i].family =3D=3D AF_INET) { diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index f9f2a3b..7765372 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -3132,8 +3132,7 @@ int ascii2proto(const char *proto_name) { - int i; - for (i =3D 0; i < SIZE(proto_names); ++i) + for (size_t i =3D 0; i < SIZE(proto_names); ++i) { if (!strcmp(proto_name, proto_names[i].short_form)) { @@ -3146,8 +3145,7 @@ sa_family_t ascii2af(const char *proto_name) { - int i; - for (i =3D 0; i < SIZE(proto_names); ++i) + for (size_t i =3D 0; i < SIZE(proto_names); ++i) { if (!strcmp(proto_name, proto_names[i].short_form)) { @@ -3160,8 +3158,7 @@ const char * proto2ascii(int proto, sa_family_t af, bool display_form) { - unsigned int i; - for (i =3D 0; i < SIZE(proto_names); ++i) + for (size_t i =3D 0; i < SIZE(proto_names); ++i) { if (proto_names[i].proto_af =3D=3D af && proto_names[i].proto =3D= =3D proto) { @@ -3183,9 +3180,8 @@ proto2ascii_all(struct gc_arena *gc) { struct buffer out =3D alloc_buf_gc(256, gc); - int i; - for (i =3D 0; i < SIZE(proto_names); ++i) + for (size_t i =3D 0; i < SIZE(proto_names); ++i) { if (i) { diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 7fbd6c3..33830fc 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -669,7 +669,7 @@ { struct gc_arena gc =3D gc_new(); struct route_gateway_info rgi; - const int needed =3D (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED); + const unsigned int needed =3D (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED); get_default_gateway(&rgi, ctx); if ((rgi.flags & needed) =3D=3D needed) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/865?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I1918c43202b87f0c987bfd9155c739da7dd02632 Gerrit-Change-Number: 865 Gerrit-PatchSet: 4 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --3CdRgMsd3pQ= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #4 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outda= ted and were removed: Code-Review+2 by cron2

Fix some trivial sign-compare compiler warnings
<= br>Change-Id: I1918c43202b87f0c987bfd9155c739da7dd02632
Signed-off-by: F= rank Lichtenheld <frank@...2641...>
Acked-by: Gert Doering <ger= t@...1296...>
Message-Id: <20250114165206.13187-1-gert@...1296...&= gt;
URL: https://www.mail-archive.com/openvpn-devel@...475...= t/msg30455.html
Signed-off-by: Gert Doering <gert@...1296...>
-= --
M src/openvpn/options.c
M src/openvpn/socket.c
M src/openvpn/tu= n.c
3 files changed, 6 insertions(+), 10 deletions(-)

git pull=
 ssh://gerrit.openvpn.net:29418/openvpn refs/changes/65/865/4
diff =
--git a/src/openvpn/options.c b/src/openvpn/options.c
index= eb0d9b5..3ef4d78 100644
--- a/src/openvpn/options.c=
+++ b/src/openvpn/options.c
@@ -1448,7 +1448,7 @@=

while (server)
= {
- for (int i = =3D 0; i < server->addr_count; ++i)
+ for (size_t i =3D 0; i < server->addr_c= ount; ++i)
{
if (serv= er->addr[i].family =3D=3D AF_INET)
{=
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.cindex f9f2a3b..7765372 100644
--- a/src/openvpn/soc= ket.c
+++ b/src/openvpn/socket.c
@@ -3132,8= +3132,7 @@
int
ascii2proto(const char *p= roto_name)
{
- int i;
- = for (i =3D 0; i < SIZE(proto_names); ++i)
+ for (size_t i =3D 0; i < SIZE(proto_names)= ; ++i)
{
if (!strcmp(proto_na= me, proto_names[i].short_form))
{
= @@ -3146,8 +3145,7 @@
sa_family_t
ascii2a= f(const char *proto_name)
{
- int i;
- for (i =3D 0; i < SIZE(proto_names); ++i)
+ for (size_t i =3D 0; i < SI= ZE(proto_names); ++i)
{
if (!= strcmp(proto_name, proto_names[i].short_form))
{
@@ -3160,8 +3158,7 @@
const char * proto2ascii(int proto, sa_family_t af, bool display_form) {
- unsigne= d int i;
- for (i = =3D 0; i < SIZE(proto_names); ++i)
+ for (size_t i =3D 0; i < SIZE(proto_names); ++i)
{
if (proto_names[i].proto_af = =3D=3D af && proto_names[i].proto =3D=3D proto)
= {
@@ -3183,9 +3180,8 @@
proto2ascii_= all(struct gc_arena *gc)
{
struct buf= fer out =3D alloc_buf_gc(256, gc);
- int i;

- for (i =3D 0; i < SIZE(proto_names); ++i)=
+ for (size_t i =3D 0; i= < SIZE(proto_names); ++i)
{
= if (i)
{
diff --git a/src/openv= pn/tun.c b/src/openvpn/tun.c
index 7fbd6c3..33830fc 100644<= /span>
--- a/src/openvpn/tun.c
+++ b/src/openvpn/t= un.c
@@ -669,7 +669,7 @@
{
struct gc_arena gc =3D gc_new();

struct route_ga= teway_info rgi;
- co= nst int needed =3D (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED);
+ const unsigned int needed =3D (R= GI_ADDR_DEFINED|RGI_NETMASK_DEFINED);

= get_default_gateway(&rgi, ctx);
if ((rgi.flags &= amp; needed) =3D=3D needed)

To view, vi= sit chang= e 865. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1918c43202b87f0c987bfd9155c= 739da7dd02632
Gerrit-Change-Number: 865
Gerrit-PatchSet: 4
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>
Gerrit-MessageType: newpatchset
--3CdRgMsd3pQ=--