]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
system_clock.c (system_clock_4, [...]): Add missing returns, reformat a bit.
authorAndreas Jaeger <aj@suse.de>
Sun, 15 May 2005 15:33:12 +0000 (17:33 +0200)
committerAndreas Jaeger <aj@gcc.gnu.org>
Sun, 15 May 2005 15:33:12 +0000 (17:33 +0200)
* intrinsics/system_clock.c (system_clock_4, system_clock_8): Add
missing returns, reformat a bit.

* io/write.c (nml_write_obj): Use %d again - and cast to int,
st_sprintf does not handle %ld.

From-SVN: r99722

libgfortran/ChangeLog
libgfortran/intrinsics/system_clock.c
libgfortran/io/write.c

index 38be6a37fb119cc8af528cc19a1dca29fba76d16..cfb62a32ad164c6798ca6e71005ecfeaaa79e61e 100644 (file)
@@ -1,5 +1,11 @@
 2005-05-15  Andreas Jaeger  <aj@suse.de>
 
+       * intrinsics/system_clock.c (system_clock_4, system_clock_8): Add
+       missing returns, reformat a bit.
+
+       * io/write.c (nml_write_obj): Use %d again - and cast to int,
+       st_sprintf does not handle %ld.
+
        * io/unit.c (is_internal_unit): Add void as parameter list.
 
        * io/transfer.c: Move prototype declarations before the functions.
index 1d6455831cf03c33ca1d88f3fdda3d2b3d5b42e0..17c7bb62097e0695024abe99dc562de20176a464 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the SYSTEM_CLOCK intrinsic.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
 
@@ -104,9 +104,13 @@ system_clock_4(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate,
     }
   else
     {
-      if (count != NULL) *count = - GFC_INTEGER_4_HUGE;
-      if (count_rate != NULL) *count_rate = 0;
-      if (count_max != NULL) *count_max = 0;
+      if (count != NULL)
+       *count = - GFC_INTEGER_4_HUGE;
+      if (count_rate != NULL)
+       *count_rate = 0;
+      if (count_max != NULL)
+       *count_max = 0;
+      return;
     }
 #elif defined(HAVE_TIME_H)
   time_t t, t1;
@@ -118,7 +122,7 @@ system_clock_4(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate,
       cnt = - GFC_INTEGER_4_HUGE;
       mx = 0;
     }
-  else if (t0 == (time_t) -2) 
+  else if (t0 == (time_t) -2)
     t0 = t1;
   else
     {
@@ -131,9 +135,12 @@ system_clock_4(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate,
   cnt = - GFC_INTEGER_4_HUGE;
   mx = 0;
 #endif
-  if (count != NULL) *count = cnt;
-  if (count_rate != NULL) *count_rate = TCK;
-  if (count_max != NULL) *count_max = mx;
+  if (count != NULL)
+    *count = cnt;
+  if (count_rate != NULL)
+    *count_rate = TCK;
+  if (count_max != NULL)
+    *count_max = mx;
 }
 
 
@@ -180,9 +187,14 @@ system_clock_8 (GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate,
     }
   else
     {
-      if (count != NULL) *count = - GFC_INTEGER_8_HUGE;
-      if (count_rate != NULL) *count_rate = 0;
-      if (count_max != NULL) *count_max = 0;
+      if (count != NULL)
+       *count = - GFC_INTEGER_8_HUGE;
+      if (count_rate != NULL)
+       *count_rate = 0;
+      if (count_max != NULL)
+       *count_max = 0;
+
+      return;
     }
 #elif defined(HAVE_TIME_H)
   time_t t, t1;
@@ -194,7 +206,7 @@ system_clock_8 (GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate,
       cnt = - GFC_INTEGER_8_HUGE;
       mx = 0;
     }
-  else if (t0 == (time_t) -2) 
+  else if (t0 == (time_t) -2)
     t0 = t1;
   else
     {
index 86ca40ffa4cc6b44ec9b8cebeb33003945eea3f1..494a7a9bd42cc29549177d154de099483b3258da 100644 (file)
@@ -1490,7 +1490,7 @@ nml_write_obj (namelist_info * obj, index_type offset,
                {
                  strcat (ext_name, dim_i ? "" : "(");
                  clen = strlen (ext_name);
-                 st_sprintf (ext_name + clen, "%ld", (long) obj->ls[dim_i].idx);
+                 st_sprintf (ext_name + clen, "%d", (int) obj->ls[dim_i].idx);
                  strcat (ext_name, (dim_i == obj->var_rank - 1) ? ")" : ",");
                }