summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-19 10:43:11 +0000
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-19 10:43:11 +0000
commitf7a00615feee6e441602455139bfec5c5229476f (patch)
treef968a2650357b12c8888ff6b37091a65baa18b63
parentc34d15451ad4d9200cc3cdc456fdbb9d7d67b600 (diff)
downloadgcc-f7a00615feee6e441602455139bfec5c5229476f.tar.gz
Increase clock resolution for system_clock_8.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155359 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libgfortran/ChangeLog7
-rw-r--r--libgfortran/intrinsics/system_clock.c11
2 files changed, 12 insertions, 6 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 936163965c7..162915287a5 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,10 @@
+2009-12-19 Janne Blomqvist <jb@gcc.gnu.org>
+
+ * intrinsics/system_clock.c: Fix library name in comment, move TCK
+ definition into functions.
+ (system_clock_4): Remove unused struct timezone.
+ (system_clock_8): Remove unused struct timezone, increase TCK.
+
2009-12-08 Tobias Burnus <burnus@net-b.de>
PR fortran/41711
diff --git a/libgfortran/intrinsics/system_clock.c b/libgfortran/intrinsics/system_clock.c
index cf32b8d83fc..7806059ccdf 100644
--- a/libgfortran/intrinsics/system_clock.c
+++ b/libgfortran/intrinsics/system_clock.c
@@ -1,7 +1,7 @@
/* Implementation of the SYSTEM_CLOCK intrinsic.
Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
-This file is part of the GNU Fortran 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
@@ -28,7 +28,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY)
# include <sys/time.h>
-# define TCK 1000
#elif defined(HAVE_TIME_H)
# include <time.h>
# define TCK 1
@@ -57,13 +56,13 @@ system_clock_4(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate,
GFC_INTEGER_4 mx;
#if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY)
+#define TCK 1000
struct timeval tp1;
- struct timezone tzp;
if (sizeof (tp1.tv_sec) < sizeof (GFC_INTEGER_4))
internal_error (NULL, "tv_sec too small");
- if (gettimeofday(&tp1, &tzp) == 0)
+ if (gettimeofday(&tp1, NULL) == 0)
{
GFC_UINTEGER_4 ucnt = (GFC_UINTEGER_4) tp1.tv_sec * TCK;
ucnt += (tp1.tv_usec + 500000 / TCK) / (1000000 / TCK);
@@ -118,13 +117,13 @@ system_clock_8 (GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate,
GFC_INTEGER_8 mx;
#if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY)
+#define TCK 1000000
struct timeval tp1;
- struct timezone tzp;
if (sizeof (tp1.tv_sec) < sizeof (GFC_INTEGER_4))
internal_error (NULL, "tv_sec too small");
- if (gettimeofday(&tp1, &tzp) == 0)
+ if (gettimeofday(&tp1, NULL) == 0)
{
if (sizeof (tp1.tv_sec) < sizeof (GFC_INTEGER_8))
{