From b06f4c0094d3c68be39ada0ed26ae99d51f48013 Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Fri, 1 Feb 2019 12:19:42 +0000 Subject: Cleanup clock_*time includes Clock_gettime, settime and getres implementations are unncessarily complex due to using defines and C file inclusion. Simplify the code by replacing the redundant defines and removing the inclusion, making it much easier to understand. No functional changes. * sysdeps/posix/clock_getres.c (__clock_getres): Cleanup. * sysdeps/unix/clock_gettime.c (__clock_gettime): Cleanup. * sysdeps/unix/clock_settime.c (__clock_settime): Cleanup. * sysdeps/unix/sysv/linux/clock_getres.c (__clock_getres): Cleanup. * sysdeps/unix/sysv/linux/clock_gettime.c (__clock_gettime): Cleanup. * sysdeps/unix/sysv/linux/clock_settime.c (__clock_settime): Cleanup. --- sysdeps/posix/clock_getres.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'sysdeps/posix') diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c index f47715ed6b..dac4761fcc 100644 --- a/sysdeps/posix/clock_getres.c +++ b/sysdeps/posix/clock_getres.c @@ -82,20 +82,11 @@ __clock_getres (clockid_t clock_id, struct timespec *res) switch (clock_id) { -#ifdef SYSDEP_GETRES - SYSDEP_GETRES; -#endif - -#ifndef HANDLED_REALTIME case CLOCK_REALTIME: retval = realtime_getres (res); break; -#endif /* handled REALTIME */ default: -#ifdef SYSDEP_GETRES_CPU - SYSDEP_GETRES_CPU; -#endif #if HP_TIMING_AVAIL if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1)) == CLOCK_THREAD_CPUTIME_ID) @@ -105,7 +96,7 @@ __clock_getres (clockid_t clock_id, struct timespec *res) __set_errno (EINVAL); break; -#if HP_TIMING_AVAIL && !defined HANDLED_CPUTIME +#if HP_TIMING_AVAIL case CLOCK_PROCESS_CPUTIME_ID: case CLOCK_THREAD_CPUTIME_ID: retval = hp_timing_getres (res); -- cgit v1.2.3