OSDN Git Service

Simplify time() usage.
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Nov 2011 18:30:38 +0000 (18:30 +0000)
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Nov 2011 18:30:38 +0000 (18:30 +0000)
2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

* intrinsics/time_1.h (gf_gettime): Simplify time() usage.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181228 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/intrinsics/time_1.h

index f299ccb..f0b64c9 100644 (file)
@@ -1,5 +1,9 @@
 2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>
 
+       * intrinsics/time_1.h (gf_gettime): Simplify time() usage.
+
+2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>
+
        * configure.ac (AC_STDC_HEADERS): Remove.
        (AC_HEADER_TIME): Remove.
        (AC_HAVE_HEADERS, AC_CHECK_HEADERS): Move into a single invocation
index 73977cb..327f7cf 100644 (file)
@@ -213,9 +213,8 @@ gf_gettime (time_t * secs, long * usecs)
   *usecs = tv.tv_usec;
   return err;
 #else
-  time_t t, t2;
-  t = time (&t2);
-  *secs = t2;
+  time_t t = time (NULL);
+  *secs = t;
   *usecs = 0;
   if (t == ((time_t)-1))
     return -1;