]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/47970 (c99_functions.c:611:5: warning: implicit declaration of funct...
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Tue, 8 Nov 2011 10:31:04 +0000 (10:31 +0000)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Tue, 8 Nov 2011 10:31:04 +0000 (10:31 +0000)
PR libfortran/47970
* intrinsics/c99_functions.c (round): Move higher in the file.

From-SVN: r181153

libgfortran/ChangeLog
libgfortran/intrinsics/c99_functions.c

index 82538422db4209c421a065fdc3ff6b7e0747ecb0..becb60128388bdc46a4cef2d964bb4c0d5a6de47 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/47970
+       * intrinsics/c99_functions.c (round): Move higher in the file.
+
 2011-11-07  Janne Blomqvist  <jb@gcc.gnu.org>
 
         PR libfortran/45723
index 9ba5544a02b7ea5ea2fb6f3ea301e156b81d4de1..a95f09ac01d79e7417a7064bce99d2b7e213ac62 100644 (file)
@@ -559,6 +559,37 @@ powf (float x, float y)
 #endif
 
 
+#ifndef HAVE_ROUND
+#define HAVE_ROUND 1
+/* Round to nearest integral value.  If the argument is halfway between two
+   integral values then round away from zero.  */
+double round (double x);
+
+double
+round (double x)
+{
+   double t;
+   if (!isfinite (x))
+     return (x);
+
+   if (x >= 0.0) 
+    {
+      t = floor (x);
+      if (t - x <= -0.5)
+       t += 1.0;
+      return (t);
+    } 
+   else 
+    {
+      t = floor (-x);
+      if (t + x <= -0.5)
+       t += 1.0;
+      return (-t);
+    }
+}
+#endif
+
+
 /* Algorithm by Steven G. Kargl.  */
 
 #if !defined(HAVE_ROUNDL)
@@ -614,36 +645,6 @@ roundl (long double x)
 #endif
 #endif
 
-#ifndef HAVE_ROUND
-#define HAVE_ROUND 1
-/* Round to nearest integral value.  If the argument is halfway between two
-   integral values then round away from zero.  */
-double round (double x);
-
-double
-round (double x)
-{
-   double t;
-   if (!isfinite (x))
-     return (x);
-
-   if (x >= 0.0) 
-    {
-      t = floor (x);
-      if (t - x <= -0.5)
-       t += 1.0;
-      return (t);
-    } 
-   else 
-    {
-      t = floor (-x);
-      if (t + x <= -0.5)
-       t += 1.0;
-      return (-t);
-    }
-}
-#endif
-
 #ifndef HAVE_ROUNDF
 #define HAVE_ROUNDF 1
 /* Round to nearest integral value.  If the argument is halfway between two