diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pulse/timeval.c | 2 | ||||
-rw-r--r-- | src/pulse/timeval.h | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/pulse/timeval.c b/src/pulse/timeval.c index 180e0159..7a19638d 100644 --- a/src/pulse/timeval.c +++ b/src/pulse/timeval.c @@ -140,7 +140,7 @@ struct timeval* pa_timeval_add(struct timeval *tv, pa_usec_t v) { tv->tv_usec += (suseconds_t) v; /* Normalize */ - while (tv->tv_usec >= PA_USEC_PER_SEC) { + while ((unsigned) tv->tv_usec >= PA_USEC_PER_SEC) { tv->tv_sec++; tv->tv_usec -= PA_USEC_PER_SEC; } diff --git a/src/pulse/timeval.h b/src/pulse/timeval.h index 09d53974..2e9e3ca3 100644 --- a/src/pulse/timeval.h +++ b/src/pulse/timeval.h @@ -34,12 +34,12 @@ PA_C_DECL_BEGIN -#define PA_MSEC_PER_SEC 1000 -#define PA_USEC_PER_SEC 1000000 -#define PA_NSEC_PER_SEC 1000000000 -#define PA_USEC_PER_MSEC 1000 -#define PA_NSEC_PER_MSEC 1000000 -#define PA_NSEC_PER_USEC 1000 +#define PA_MSEC_PER_SEC ((pa_usec_t) 1000ULL) +#define PA_USEC_PER_SEC ((pa_usec_t) 1000000ULL) +#define PA_NSEC_PER_SEC ((pa_usec_t) 1000000000ULL) +#define PA_USEC_PER_MSEC ((pa_usec_t) 1000ULL) +#define PA_NSEC_PER_MSEC ((pa_usec_t) 1000000ULL) +#define PA_NSEC_PER_USEC ((pa_usec_t) 1000ULL) struct timeval; |