aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-21 14:33:20 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-21 14:33:20 +0000
commit8b1789c71ff21b066138fc3eab03f40b1e68f67a (patch)
treeacf2fbc658727767e0448af5a20c5bd506d9b9b0 /src/common/util.c
parentb3c0d066e535d33d9ed271e92eb30cdefb18385e (diff)
downloadtor-8b1789c71ff21b066138fc3eab03f40b1e68f67a.tar.gz
tor-8b1789c71ff21b066138fc3eab03f40b1e68f67a.zip
r18336@catbus: nickm | 2008-02-21 09:33:15 -0500
Patch from Sebastian Hahn: remove obsolete timeval manipulation functions. svn:r13653
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 64464d953f..4cb6f1d6d2 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -969,43 +969,6 @@ tv_udiff(const struct timeval *start, const struct timeval *end)
return udiff;
}
-/** Return -1 if *a \< *b, 0 if *a==*b, and 1 if *a \> *b.
- */
-int
-tv_cmp(const struct timeval *a, const struct timeval *b)
-{
- if (a->tv_sec > b->tv_sec)
- return 1;
- if (a->tv_sec < b->tv_sec)
- return -1;
- if (a->tv_usec > b->tv_usec)
- return 1;
- if (a->tv_usec < b->tv_usec)
- return -1;
- return 0;
-}
-
-/** Increment *a by the number of seconds and microseconds in *b.
- */
-void
-tv_add(struct timeval *a, const struct timeval *b)
-{
- a->tv_usec += b->tv_usec;
- a->tv_sec += b->tv_sec + (a->tv_usec / 1000000);
- a->tv_usec %= 1000000;
-}
-
-/** Increment *a by <b>ms</b> milliseconds.
- */
-void
-tv_addms(struct timeval *a, long ms)
-{
- uint64_t us = ms * 1000;
- a->tv_usec += us % 1000000;
- a->tv_sec += (us / 1000000) + (a->tv_usec / 1000000);
- a->tv_usec %= 1000000;
-}
-
/** Yield true iff <b>y</b> is a leap-year. */
#define IS_LEAPYEAR(y) (!(y % 4) && ((y % 100) || !(y % 400)))
/** Helper: Return the number of leap-days between Jan 1, y1 and Jan 1, y2. */