]> git.eshelyaron.com Git - emacs.git/commitdiff
Adjust to TIMESPEC_HZ renaming
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Sep 2018 04:22:05 +0000 (21:22 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Sep 2018 04:22:54 +0000 (21:22 -0700)
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.

lib-src/profile.c
src/gtkutil.c
src/process.c
src/sysdep.c
src/systime.h

index 3818d33e68945ea6fe794d9210072ffa749cdc5a..cccdfbc7c84aa7caf95bd562ce7e19cc0f1288ed 100644 (file)
@@ -43,7 +43,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 static struct timespec TV1;
 static int watch_not_started = 1; /* flag */
 static char time_string[INT_STRLEN_BOUND (uintmax_t) + sizeof "."
-                       + LOG10_TIMESPEC_RESOLUTION];
+                       + LOG10_TIMESPEC_HZ];
 
 /* Reset the stopwatch to zero.  */
 
@@ -66,7 +66,7 @@ get_time (void)
   int ns = TV2.tv_nsec;
   if (watch_not_started)
     exit (EXIT_FAILURE);  /* call reset_watch first ! */
-  sprintf (time_string, "%"PRIuMAX".%0*d", s, LOG10_TIMESPEC_RESOLUTION, ns);
+  sprintf (time_string, "%"PRIuMAX".%0*d", s, LOG10_TIMESPEC_HZ, ns);
   return time_string;
 }
 \f
index 4250355a2f65f8d7a51d875b0b91ceaa106b5dcc..6212e1af4e81a6d2ca9cede2ba229713c235b23d 100644 (file)
@@ -1867,7 +1867,7 @@ xg_maybe_add_timer (gpointer data)
   if (timespec_valid_p (next_time))
     {
       time_t s = next_time.tv_sec;
-      int per_ms = TIMESPEC_RESOLUTION / 1000;
+      int per_ms = TIMESPEC_HZ / 1000;
       int ms = (next_time.tv_nsec + per_ms - 1) / per_ms;
       if (s <= ((guint) -1 - ms) / 1000)
        dd->timerid = g_timeout_add (s * 1000 + ms, xg_maybe_add_timer, dd);
index 4d96e469767b219d35293f71e5a7fc0241190f04..b4ba641f31b32060f564be51ace375eed9a4445e 100644 (file)
@@ -252,7 +252,7 @@ static EMACS_INT update_tick;
 # define HAVE_SEQPACKET
 #endif
 
-#define READ_OUTPUT_DELAY_INCREMENT (TIMESPEC_RESOLUTION / 100)
+#define READ_OUTPUT_DELAY_INCREMENT (TIMESPEC_HZ / 100)
 #define READ_OUTPUT_DELAY_MAX       (READ_OUTPUT_DELAY_INCREMENT * 5)
 #define READ_OUTPUT_DELAY_MAX_MAX   (READ_OUTPUT_DELAY_INCREMENT * 7)
 
@@ -5478,7 +5478,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
              have waited a long amount of time due to repeated
              timers.  */
          struct timespec huge_timespec
-           = make_timespec (TYPE_MAXIMUM (time_t), 2 * TIMESPEC_RESOLUTION);
+           = make_timespec (TYPE_MAXIMUM (time_t), 2 * TIMESPEC_HZ);
          struct timespec cmp_time = huge_timespec;
          if (wait < TIMEOUT
               || (wait_proc
index 52afa2f0e1628601a7d45ceb4d3c29e0d79e86ac..ecbbbbc0ef34315622fb01d95e6403293d7a4362 100644 (file)
@@ -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);
        }
index b2f893714b32c8acdf0b57b6c5a2f342fc37464f..ede3d4eb12d08c435737436cc5372606ae07fd4d 100644 (file)
@@ -58,8 +58,8 @@ invalid_timespec (void)
 }
 
 /* Return true if TIME is a valid timespec.  This currently doesn't worry
-   about whether tv_nsec is less than TIMESPEC_RESOLUTION; leap seconds
-   might cause a problem if it did.  */
+   about whether tv_nsec is less than TIMESPEC_HZ; leap seconds might
+   cause a problem if it did.  */
 INLINE bool
 timespec_valid_p (struct timespec t)
 {