Skip to content

Commit

Permalink
Fix some trivial sign-compare compiler warnings
Browse files Browse the repository at this point in the history
Change-Id: I1918c43202b87f0c987bfd9155c739da7dd02632
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg30455.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
flichtenheld authored and cron2 committed Jan 15, 2025
1 parent 758d281 commit 6d91eda
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/openvpn/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ foreign_options_copy_dns(struct options *o, struct env_set *es)

while (server)
{
for (int i = 0; i < server->addr_count; ++i)
for (size_t i = 0; i < server->addr_count; ++i)
{
if (server->addr[i].family == AF_INET)
{
Expand Down
12 changes: 4 additions & 8 deletions src/openvpn/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -3132,8 +3132,7 @@ static const struct proto_names proto_names[] = {
int
ascii2proto(const char *proto_name)
{
int i;
for (i = 0; i < SIZE(proto_names); ++i)
for (size_t i = 0; i < SIZE(proto_names); ++i)
{
if (!strcmp(proto_name, proto_names[i].short_form))
{
Expand All @@ -3146,8 +3145,7 @@ ascii2proto(const char *proto_name)
sa_family_t
ascii2af(const char *proto_name)
{
int i;
for (i = 0; i < SIZE(proto_names); ++i)
for (size_t i = 0; i < SIZE(proto_names); ++i)
{
if (!strcmp(proto_name, proto_names[i].short_form))
{
Expand All @@ -3160,8 +3158,7 @@ ascii2af(const char *proto_name)
const char *
proto2ascii(int proto, sa_family_t af, bool display_form)
{
unsigned int i;
for (i = 0; i < SIZE(proto_names); ++i)
for (size_t i = 0; i < SIZE(proto_names); ++i)
{
if (proto_names[i].proto_af == af && proto_names[i].proto == proto)
{
Expand All @@ -3183,9 +3180,8 @@ const char *
proto2ascii_all(struct gc_arena *gc)
{
struct buffer out = alloc_buf_gc(256, gc);
int i;

for (i = 0; i < SIZE(proto_names); ++i)
for (size_t i = 0; i < SIZE(proto_names); ++i)
{
if (i)
{
Expand Down
2 changes: 1 addition & 1 deletion src/openvpn/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ warn_on_use_of_common_subnets(openvpn_net_ctx_t *ctx)
{
struct gc_arena gc = gc_new();
struct route_gateway_info rgi;
const int needed = (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED);
const unsigned int needed = (RGI_ADDR_DEFINED|RGI_NETMASK_DEFINED);

get_default_gateway(&rgi, ctx);
if ((rgi.flags & needed) == needed)
Expand Down

0 comments on commit 6d91eda

Please sign in to comment.