diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-09-10 21:22:05 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-09-10 21:22:54 -0700 |
commit | ef93983344e748124ac9bc218700cee14a0df947 (patch) | |
tree | 0d76e8c9a0a381082608f445ddc69ec9f7a7e311 /src/sysdep.c | |
parent | fc389d3a836c11893ac5c5894915e9b8b4868799 (diff) | |
download | emacs-ef93983344e748124ac9bc218700cee14a0df947.tar.gz |
Adjust to TIMESPEC_HZ renaming
Adjust to lib/timespec.h’s renaming of TIMESPEC_RESOLUTION and
LOG10_TIMESPEC_RESOLUTION to TIMESPEC_HZ and
LOG10_TIMESPEC_HZ. The old names were misnomers.
All uses changed.
Diffstat (limited to 'src/sysdep.c')
-rw-r--r-- | src/sysdep.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 52afa2f0e16..ecbbbbc0ef3 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -3078,16 +3078,15 @@ time_from_jiffies (unsigned long long tval, long hz) if (TYPE_MAXIMUM (time_t) < s) time_overflow (); - if (LONG_MAX - 1 <= ULLONG_MAX / TIMESPEC_RESOLUTION - || frac <= ULLONG_MAX / TIMESPEC_RESOLUTION) - ns = frac * TIMESPEC_RESOLUTION / hz; + if (LONG_MAX - 1 <= ULLONG_MAX / TIMESPEC_HZ + || frac <= ULLONG_MAX / TIMESPEC_HZ) + ns = frac * TIMESPEC_HZ / hz; else { /* This is reachable only in the unlikely case that HZ * HZ exceeds ULLONG_MAX. It calculates an approximation that is guaranteed to be in range. */ - long hz_per_ns = (hz / TIMESPEC_RESOLUTION - + (hz % TIMESPEC_RESOLUTION != 0)); + long hz_per_ns = hz / TIMESPEC_HZ + (hz % TIMESPEC_HZ != 0); ns = frac / hz_per_ns; } @@ -3123,16 +3122,16 @@ get_up_time (void) if (TYPE_MAXIMUM (time_t) < upsec) { upsec = TYPE_MAXIMUM (time_t); - upfrac = TIMESPEC_RESOLUTION - 1; + upfrac = TIMESPEC_HZ - 1; } else { int upfraclen = upfrac_end - upfrac_start; - for (; upfraclen < LOG10_TIMESPEC_RESOLUTION; upfraclen++) + for (; upfraclen < LOG10_TIMESPEC_HZ; upfraclen++) upfrac *= 10; - for (; LOG10_TIMESPEC_RESOLUTION < upfraclen; upfraclen--) + for (; LOG10_TIMESPEC_HZ < upfraclen; upfraclen--) upfrac /= 10; - upfrac = min (upfrac, TIMESPEC_RESOLUTION - 1); + upfrac = min (upfrac, TIMESPEC_HZ - 1); } up = make_timespec (upsec, upfrac); } |