posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get truncated to int.
authorBryce McKinlay <bryce@waitaki.otago.ac.nz>
Sat, 9 Mar 2002 05:48:38 +0000 (05:48 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Sat, 9 Mar 2002 05:48:38 +0000 (05:48 +0000)
        * posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get
        truncated to int.

From-SVN: r50479

libjava/ChangeLog
libjava/posix.cc

index 88c610cfca0a66dda410e2db2efce422ef6b89b5..08ed381140306ef9f0516906fd3858b7ed96abbd 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-09  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
+
+       * posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get
+       truncated to int.
+
 2002-03-08  Tom Tromey  <tromey@redhat.com>
 
        * include/jni.h: Include stdio.h.
index f4b76962e35f61594632f039a2a927ed2e4848a7..6b0ea8cad3c7ed9c729ab87e54cacb7a9fff97b5 100644 (file)
@@ -30,13 +30,13 @@ _Jv_platform_gettimeofday ()
 #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();