Browse code

Only add some functions when really needed

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>

David Sommerseth authored on 2010/11/15 16:56:18
Showing 2 changed files
... ...
@@ -2785,6 +2785,7 @@ positive_atoi (const char *str)
2785 2785
   return i < 0 ? 0 : i;
2786 2786
 }
2787 2787
 
2788
+#ifdef WIN32  /* This function is only used when compiling on Windows */
2788 2789
 static unsigned int
2789 2790
 atou (const char *str)
2790 2791
 {
... ...
@@ -2792,6 +2793,7 @@ atou (const char *str)
2792 2792
   sscanf (str, "%u", &val);
2793 2793
   return val;
2794 2794
 }
2795
+#endif
2795 2796
 
2796 2797
 static inline bool
2797 2798
 space (unsigned char c)
... ...
@@ -516,6 +516,7 @@ reliable_can_send (const struct reliable *rel)
516 516
   return n_current > 0 && !rel->hold;
517 517
 }
518 518
 
519
+#ifdef EXPONENTIAL_BACKOFF
519 520
 /* return a unique point-in-time to trigger retry */
520 521
 static time_t
521 522
 reliable_unique_retry (struct reliable *rel, time_t retry)
... ...
@@ -535,6 +536,7 @@ reliable_unique_retry (struct reliable *rel, time_t retry)
535 535
     }
536 536
   return retry;
537 537
 }
538
+#endif
538 539
 
539 540
 /* return next buffer to send to remote */
540 541
 struct buffer *