]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Only add some functions when really needed
authorDavid Sommerseth <dazo@users.sourceforge.net>
Mon, 15 Nov 2010 07:56:18 +0000 (08:56 +0100)
committerDavid Sommerseth <dazo@users.sourceforge.net>
Thu, 18 Nov 2010 17:54:49 +0000 (18:54 +0100)
The GNU C compiler gave warnings about some functions not being used.
These functions where only used if certian #ifdef sections was enabled.

This patch encapsulates these function declarations with matching #ifdef's
to make it more clear when these functions are needed.

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Peter Stuge <peter@stuge.se>
options.c
reliable.c

index f0b931004ffdb82c99c3db37d630b0bfc8e2fb8c..d0cec7dc6ea9818a88f8442fd09e33839c339214 100644 (file)
--- a/options.c
+++ b/options.c
@@ -2785,6 +2785,7 @@ positive_atoi (const char *str)
   return i < 0 ? 0 : i;
 }
 
+#ifdef WIN32  /* This function is only used when compiling on Windows */
 static unsigned int
 atou (const char *str)
 {
@@ -2792,6 +2793,7 @@ atou (const char *str)
   sscanf (str, "%u", &val);
   return val;
 }
+#endif
 
 static inline bool
 space (unsigned char c)
index a41f2bf120c20085588a67df29149fd5594aca46..e68c2363c526681b10fde60cab5236f4b20e02e9 100644 (file)
@@ -516,6 +516,7 @@ reliable_can_send (const struct reliable *rel)
   return n_current > 0 && !rel->hold;
 }
 
+#ifdef EXPONENTIAL_BACKOFF
 /* return a unique point-in-time to trigger retry */
 static time_t
 reliable_unique_retry (struct reliable *rel, time_t retry)
@@ -535,6 +536,7 @@ reliable_unique_retry (struct reliable *rel, time_t retry)
     }
   return retry;
 }
+#endif
 
 /* return next buffer to send to remote */
 struct buffer *