Remove now-unused sudo_timeval* macros.

This commit is contained in:
Todd C. Miller
2023-03-15 14:09:06 -06:00
parent 708cdc61ba
commit 14dd995b89

View File

@@ -48,46 +48,6 @@
# endif
#endif
/*
* Macros for operating on struct timeval.
*/
#define sudo_timevalclear(tv) ((tv)->tv_sec = (tv)->tv_usec = 0)
#define sudo_timevalisset(tv) ((tv)->tv_sec || (tv)->tv_usec)
#define sudo_timevalcmp(tv1, tv2, op) \
(((tv1)->tv_sec == (tv2)->tv_sec) ? \
((tv1)->tv_usec op (tv2)->tv_usec) : \
((tv1)->tv_sec op (tv2)->tv_sec))
#define sudo_timevaladd(tv1, tv2, tv3) \
do { \
(tv3)->tv_sec = (tv1)->tv_sec + (tv2)->tv_sec; \
(tv3)->tv_usec = (tv1)->tv_usec + (tv2)->tv_usec; \
if ((tv3)->tv_usec >= 1000000) { \
(tv3)->tv_sec++; \
(tv3)->tv_usec -= 1000000; \
} \
} while (0)
#define sudo_timevalsub(tv1, tv2, tv3) \
do { \
(tv3)->tv_sec = (tv1)->tv_sec - (tv2)->tv_sec; \
(tv3)->tv_usec = (tv1)->tv_usec - (tv2)->tv_usec; \
if ((tv3)->tv_usec < 0) { \
(tv3)->tv_sec--; \
(tv3)->tv_usec += 1000000; \
} \
} while (0)
#ifndef TIMEVAL_TO_TIMESPEC
# define TIMEVAL_TO_TIMESPEC(tv, ts) \
do { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
} while (0)
#endif
/*
* Macros for operating on struct timespec.
*/
@@ -120,6 +80,14 @@
} \
} while (0)
#ifndef TIMEVAL_TO_TIMESPEC
# define TIMEVAL_TO_TIMESPEC(tv, ts) \
do { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
} while (0)
#endif
#ifndef TIMESPEC_TO_TIMEVAL
# define TIMESPEC_TO_TIMEVAL(tv, ts) \
do { \