]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
cleanup: avoid using ~0 - generic
authorAlon Bar-Lev <alon.barlev@gmail.com>
Thu, 29 Mar 2012 09:16:39 +0000 (11:16 +0200)
committerDavid Sommerseth <davids@redhat.com>
Mon, 2 Apr 2012 09:54:01 +0000 (11:54 +0200)
Use limits.h for maximum value.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
config-msvc.h
configure.ac
src/openvpn/route.c
src/openvpn/syshead.h

index 0e42505138be0eb93095aebd2769765588d8d503..99c00f9fc25b0b306b6a72e765ad0a72144dcd7f 100644 (file)
@@ -30,6 +30,7 @@
 #define HAVE_STRERROR 1
 #define HAVE_STRINGS_H 1
 #define HAVE_STRING_H 1
+#define HAVE_LIMITS_H 1
 #define HAVE_SYSTEM 1
 #define HAVE_TIME 1
 #define HAVE_TIME_H 1
index ef346978ad320eaa8158e18a7217894e44585c02..e962323f5986215411dac59708343797face8a38 100644 (file)
@@ -354,7 +354,7 @@ AX_EMPTY_ARRAY
 AC_CHECK_SIZEOF([unsigned int])
 AC_CHECK_SIZEOF([unsigned long])
 AC_CHECK_HEADERS([ \
-       stdio.h stdarg.h \
+       stdio.h stdarg.h limits.h \
        time.h errno.h fcntl.h io.h direct.h \
        ctype.h sys/types.h sys/socket.h \
        signal.h unistd.h dlfcn.h \
index bf7af631818df00c9f6c17ef127271c59828b0b9..a628e774f4007f1da63ef58890f2e2704c242fd5 100644 (file)
@@ -2386,7 +2386,7 @@ get_default_gateway (struct route_gateway_info *rgi)
       {
        char line[256];
        int count = 0;
-       unsigned int lowest_metric = ~0;
+       unsigned int lowest_metric = UINT_MAX;
        in_addr_t best_gw = 0;
        bool found = false;
        while (fgets (line, sizeof (line), fp) != NULL)
index e60dc44d61585e6a431a04d94a141a1b6492c3ab..0595b67d262d5dcfe79ba01fda8081c4454ed440 100644 (file)
 #include <signal.h>
 #endif
 
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
 #endif