[geos-commits] [SCM] geos branch svn-3.6 updated. 05ae13d4391082df9b6e2252d77848577d6f1697

git at osgeo.org git at osgeo.org
Tue Apr 25 01:36:48 PDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "geos".

The branch, svn-3.6 has been updated
       via  05ae13d4391082df9b6e2252d77848577d6f1697 (commit)
       via  c8053dd2d4640a9176096cd355393efdec3b39fe (commit)
      from  687d2b49a9acc2de82f5bfd481e3aaa8d9b45af7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 05ae13d4391082df9b6e2252d77848577d6f1697
Author: Mateusz Łoskot <mateusz at loskot.net>
Date:   Mon Apr 24 20:28:54 2017 +0200

    Avoid use of internal geos/util/math.h
    
    Copy java_math_round geos/util/math.cpp to xmltester.cpp.
    Declared functions are internal to the library
    and not included in GEOS shared library exports.
    
    Fixes #831

diff --git a/tests/xmltester/XMLTester.cpp b/tests/xmltester/XMLTester.cpp
index 2505232..5673b8e 100644
--- a/tests/xmltester/XMLTester.cpp
+++ b/tests/xmltester/XMLTester.cpp
@@ -1,4 +1,4 @@
-/**********************************************************************
+/**********************************************************************
  *
  * GEOS - Geometry Engine Open Source
  * http://geos.osgeo.org
@@ -39,7 +39,6 @@
 #include <geos/operation/buffer/BufferOp.h>
 #include <geos/util.h>
 #include <geos/util/Interrupt.h>
-#include <geos/util/math.h>
 //#include <geos/geomgraph.h>
 #include <geos/io/WKBReader.h>
 #include <geos/io/WKBWriter.h>
@@ -88,6 +87,34 @@ using std::runtime_error;
 
 namespace {
 
+// Asymmetric Rounding Algorithm  - equivalent to Java Math.round()
+// Copy from geos/util/math.cpp
+double java_math_round(double val)
+{
+	double n;
+	double f = std::fabs(std::modf(val, &n));
+
+	if (val >= 0)
+	{
+		if (f < 0.5) {
+			return std::floor(val);
+		} else if (f > 0.5) {
+			return std::ceil(val);
+		} else {
+			return (n + 1.0);
+		}
+	} else {
+		if (f < 0.5) {
+			return std::ceil(val);
+		} else if (f > 0.5) {
+			return std::floor(val);
+		} else {
+			return n;
+		}
+	}
+} // java_math_round
+
+
 // a utility function defining a very simple method to indent a line of text
 const char * getIndent( unsigned int numIndents )
 {
@@ -335,7 +362,7 @@ XMLTester::printTest(bool success, const std::string& expected_result, const std
         std::cout << " test" << testCount << ": "
             << opSignature; 
         std::cout << ": " << (success?"ok.":"failed.");
-        std::cout << " (" << std::setprecision(15) << geos::util::round(prof.getTot()/1000) << " ms)" << std::endl;
+        std::cout << " (" << std::setprecision(15) << java_math_round(prof.getTot()/1000) << " ms)" << std::endl;
 
         std::cout << "\tDescription: " << curr_case_desc << std::endl;
 

commit c8053dd2d4640a9176096cd355393efdec3b39fe
Author: Mateusz Łoskot <mateusz at loskot.net>
Date:   Tue Apr 18 14:39:28 2017 +0200

    Add NMAKE_VER from VS 2017 Version 15.1

diff --git a/nmake.opt b/nmake.opt
index 9dd202b..6cfe4a6 100644
--- a/nmake.opt
+++ b/nmake.opt
@@ -144,6 +144,9 @@ GEOS_MSC = 1900
 !ELSEIF "$(_NMAKE_VER)" == "14.10.25017.0"
 GEOS_MSVC = 14.10
 GEOS_MSC = 1910
+!ELSEIF "$(_NMAKE_VER)" == "14.10.25019.0"
+GEOS_MSVC = 14.10
+GEOS_MSC = 1910
 !ELSE
 GEOS_MSVC = 0.0
 GEOS_MSC = 0

-----------------------------------------------------------------------

Summary of changes:
 nmake.opt                     |    3 +++
 tests/xmltester/XMLTester.cpp |   33 ++++++++++++++++++++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
geos


More information about the geos-commits mailing list