diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-09 05:48:38 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-09 05:48:38 +0000 |
commit | 1291074bb963891af9acc7755e1ede686f80b496 (patch) | |
tree | 731b401f81555a083df2ff581cd3cd333c141f21 | |
parent | bfe3e4b4faa088483a1bd5b0f07c219e6d9597e7 (diff) | |
download | gcc-1291074bb963891af9acc7755e1ede686f80b496.tar.gz |
* posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get
truncated to int.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50479 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libjava/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/posix.cc | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 88c610cfca0..08ed3811403 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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. diff --git a/libjava/posix.cc b/libjava/posix.cc index f4b76962e35..6b0ea8cad3c 100644 --- a/libjava/posix.cc +++ b/libjava/posix.cc @@ -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(); |