Changeset: d39f5ed3b06d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d39f5ed3b06d
Modified Files:
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_fround.c
Branch: default
Log Message:

Move Windows versions of round and trunc to file where they are needed.


diffs (70 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -49,31 +49,6 @@
 #endif
 #include "mal_instruction.h"
 
-/* Windows doesn't have round or trunc, but it does have floor and ceil */
-#ifndef HAVE_ROUND
-static inline double
-round(double val)
-{
-       /* round to nearest integer, away from zero */
-       if (val < 0)
-               return -floor(-val + 0.5);
-       else
-               return floor(val + 0.5);
-}
-#endif
-
-#ifndef HAVE_TRUNC
-static inline double
-trunc(double val)
-{
-       /* round to integer, towards zero */
-       if (val < 0)
-               return ceil(val);
-       else
-               return floor(val);
-}
-#endif
-
 static int
 rel_is_table( sql_rel *rel )
 {
diff --git a/sql/backends/monet5/sql_fround.c b/sql/backends/monet5/sql_fround.c
--- a/sql/backends/monet5/sql_fround.c
+++ b/sql/backends/monet5/sql_fround.c
@@ -37,6 +37,31 @@ static lng scales[20] = {
        LL_CONSTANT(1000000000000000000)
 };
 
+/* Windows doesn't have round or trunc, but it does have floor and ceil */
+#ifndef HAVE_ROUND
+static inline double
+round(double val)
+{
+       /* round to nearest integer, away from zero */
+       if (val < 0)
+               return -floor(-val + 0.5);
+       else
+               return floor(val + 0.5);
+}
+#endif
+
+#ifndef HAVE_TRUNC
+static inline double
+trunc(double val)
+{
+       /* round to integer, towards zero */
+       if (val < 0)
+               return ceil(val);
+       else
+               return floor(val);
+}
+#endif
+
 static inline flt
 flt_dec_round_body_nonil(flt v, flt r)
 {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to