Patch: Re: java testsuite regressions

Bryce McKinlay bryce@waitaki.otago.ac.nz
Fri Mar 8 21:47:00 GMT 2002


Per Bothner wrote:

> The following failures are new in the gcc3 branch since the last time
> I did 'make check'. 


This patch fixes it.

regards

Bryce.


2002-03-09  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

        * posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get
        truncated to int.

Index: posix.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/posix.cc,v
retrieving revision 1.3.2.2
diff -u -r1.3.2.2 posix.cc
--- posix.cc    2002/03/08 16:35:10     1.3.2.2
+++ posix.cc    2002/03/09 05:42:54
@@ -30,13 +30,13 @@
 #if defined (HAVE_GETTIMEOFDAY)
   timeval tv;
   gettimeofday (&tv, NULL);
-  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
+  return (tv.tv_sec * 1000LL) + (tv.tv_usec / 1000LL);
 #elif defined (HAVE_TIME)
-  return time (NULL) * 1000;
+  return time (NULL) * 1000LL;
 #elif defined (HAVE_FTIME)
   struct timeb t;
   ftime (&t);
-  return t.time * 1000 + t.millitm;
+  return (t.time * 1000LL) + t.millitm;
 #elif defined (ECOS)
   // FIXME.
   return _clock();



More information about the Java mailing list