@@ -1448,7 +1448,7 @@
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)
{
@@ -3131,8 +3131,7 @@
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))
{
@@ -3145,8 +3144,7 @@
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))
{
@@ -3159,8 +3157,7 @@
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)
{
@@ -3182,9 +3179,8 @@
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)
{
@@ -631,7 +631,7 @@
{
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)
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/+/865?usp=email to review the following change. Change subject: Fix some trivial sign-compare compiler warnings ...................................................................... Fix some trivial sign-compare compiler warnings Change-Id: I1918c43202b87f0c987bfd9155c739da7dd02632 Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> --- 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/1