summaryrefslogtreecommitdiff
path: root/libjava/posix.cc
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@waitaki.otago.ac.nz>2002-03-09 05:48:38 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2002-03-09 05:48:38 +0000
commitf1148658f16fa29a944bd843fd69352e142a4d0e (patch)
tree731b401f81555a083df2ff581cd3cd333c141f21 /libjava/posix.cc
parenta85cd40702d3b6d5bf305d3de0993d1e0ee42eaa (diff)
downloadgcc-f1148658f16fa29a944bd843fd69352e142a4d0e.tar.gz
posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get truncated to int.
* posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get truncated to int. From-SVN: r50479
Diffstat (limited to 'libjava/posix.cc')
-rw-r--r--libjava/posix.cc6
1 files changed, 3 insertions, 3 deletions
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();