]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dtime_.c (G77_dtime_0): Fix types in HAVE_GETRUSAGE case so as not to truncate result...
authorDave Love <d.love@dl.ac.uk>
Tue, 23 Sep 1997 07:06:54 +0000 (07:06 +0000)
committerJeff Law <law@gcc.gnu.org>
Tue, 23 Sep 1997 07:06:54 +0000 (01:06 -0600)
        * libU77/dtime_.c (G77_dtime_0): Fix types in HAVE_GETRUSAGE case
        so as not to truncate results to integer values.
        * libU77/Version.c: Bump.

From-SVN: r15669

gcc/f/runtime/ChangeLog.egcs
gcc/f/runtime/libU77/Version.c
gcc/f/runtime/libU77/dtime_.c

index 575e343d5f0f5b87b2c2d00611c8af36aa27e7f3..0627d937acfc3497f149af11460116e42d3b09a0 100644 (file)
@@ -1,3 +1,9 @@
+1997-09-19  Dave Love  <d.love@dl.ac.uk>
+
+       * libU77/dtime_.c (G77_dtime_0): Fix types in HAVE_GETRUSAGE case
+       so as not to truncate results to integer values.
+       * libU77/Version.c: Bump.
+
 Thu Sep 18 16:58:46 1997  Jeffrey A Law  (law@cygnus.com)
 
        * Makefile.in (stamp-lib): Don't use '$?', explicitly
index 88a2907c21706fab3699d491c88525fdb716fecb..0a278382f51d7d45cba4d8c568b0401d7a3ef789 100644 (file)
@@ -1,6 +1,6 @@
-static char junk[] = "\n@(#) LIBU77 VERSION 19970609\n";
+static char junk[] = "\n@(#) LIBU77 VERSION 19970919\n";
 
-char __G77_LIBU77_VERSION__[] = "0.5.21";
+char __G77_LIBU77_VERSION__[] = "0.5.22-970919";
 
 #include <stdio.h>
 
index dc0accbfdf01536d07943dcb366cb630a0aabac6..9569db3fae016257ec785674eb1fdde36125132e 100644 (file)
@@ -43,21 +43,23 @@ double G77_dtime_0 (tarray)
 double G77_dtime_0 (real tarray[2])
 #endif
 {
-  time_t utime, stime;
-  static time_t old_utime = 0, old_stime = 0;
   /* The getrusage version is only the default for convenience. */
 #ifdef HAVE_GETRUSAGE
+  float utime, stime;
+  static float old_utime = 0.0, old_stime = 0.0;
   struct rusage rbuff;
 
    if (getrusage (RUSAGE_SELF, &rbuff) != 0)
      abort ();
-   utime = ((float) (rbuff.ru_utime).tv_sec +
-          (float) (rbuff.ru_utime).tv_usec/1000000.0);
+   utime = (float) (rbuff.ru_utime).tv_sec +
+          (float) (rbuff.ru_utime).tv_usec/1000000.0;
    tarray[0] = utime - (float) old_utime;
-   stime = ((float) (rbuff.ru_stime).tv_sec +
-          (float) (rbuff.ru_stime).tv_usec/1000000.0);
+   stime = (float) (rbuff.ru_stime).tv_sec +
+          (float) (rbuff.ru_stime).tv_usec/1000000.0;
   tarray[1] = stime - old_stime;
 #else  /* HAVE_GETRUSAGE */
+  time_t utime, stime;
+  static time_t old_utime = 0, old_stime = 0;
   struct tms buffer;
 
 /* NeXTStep seems to define _SC_CLK_TCK but not to have sysconf;