[Liblas-commits] hg: 2 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Oct 26 22:56:41 EDT 2010


changeset b2b5990609c3 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=b2b5990609c3
summary: clean up direct comparisons of floats and replace with detail::compare_distance

changeset 78c86d242055 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=78c86d242055
summary: update OpenInput prototype

diffstat:

 apps/laskernel.hpp |  2 +-
 apps/oci_util.cpp  |  1 -
 apps/oci_util.hpp  |  2 +-
 src/lasheader.cpp  |  7 ++++---
 src/lasschema.cpp  |  5 ++++-
 5 files changed, 10 insertions(+), 7 deletions(-)

diffs (68 lines):

diff -r 2b1236aaf3b6 -r 78c86d242055 apps/laskernel.hpp
--- a/apps/laskernel.hpp	Wed Oct 27 01:15:57 2010 +0100
+++ b/apps/laskernel.hpp	Tue Oct 26 21:56:29 2010 -0500
@@ -92,7 +92,7 @@
 #define compare_no_case(a,b,n)  strncasecmp( (a), (b), (n) )
 #endif
 
-std::istream* OpenInput(std::string const& filename, bool bEnd);
+// std::istream* OpenInput(std::string const& filename, bool bEnd);
 std::string TryReadFileData(std::string const& filename);
 std::vector<char> TryReadRawFileData(std::string const& filename);
 bool term_progress(std::ostream& os, double complete);
diff -r 2b1236aaf3b6 -r 78c86d242055 apps/oci_util.cpp
--- a/apps/oci_util.cpp	Wed Oct 27 01:15:57 2010 +0100
+++ b/apps/oci_util.cpp	Tue Oct 26 21:56:29 2010 -0500
@@ -1,7 +1,6 @@
 #include "oci_util.hpp"
 
 
-
 std::string ReadSQLData(std::string filename)
 {
     std::istream* infile = OpenInput(filename.c_str(), true);
diff -r 2b1236aaf3b6 -r 78c86d242055 apps/oci_util.hpp
--- a/apps/oci_util.hpp	Wed Oct 27 01:15:57 2010 +0100
+++ b/apps/oci_util.hpp	Tue Oct 26 21:56:29 2010 -0500
@@ -33,7 +33,7 @@
                     std::string cloudColumnName);
 std::string to_upper(const std::string&);
 std::string ReadSQLData(std::string filename);
-std::istream* OpenInput(std::string filename, bool bEnd) ;
+std::istream* OpenInput(std::string const& filename, bool bEnd) ;
 
 #ifdef _WIN32
 #define compare_no_case(a,b,n)  _strnicmp( (a), (b), (n) )
diff -r 2b1236aaf3b6 -r 78c86d242055 src/lasheader.cpp
--- a/src/lasheader.cpp	Wed Oct 27 01:15:57 2010 +0100
+++ b/src/lasheader.cpp	Tue Oct 26 21:56:29 2010 -0500
@@ -439,10 +439,11 @@
 
 void Header::SetScale(double x, double y, double z)
 {
+
     double const minscale = 0.01;
-    m_scales.x = (0 == x) ? minscale : x;
-    m_scales.y = (0 == y) ? minscale : y;
-    m_scales.z = (0 == z) ? minscale : z;
+    m_scales.x = (detail::compare_distance(0.0, x)) ? minscale : x;
+    m_scales.y = (detail::compare_distance(0.0, y)) ? minscale : y;
+    m_scales.z = (detail::compare_distance(0.0, z)) ? minscale : z;
 }
 
 double Header::GetOffsetX() const
diff -r 2b1236aaf3b6 -r 78c86d242055 src/lasschema.cpp
--- a/src/lasschema.cpp	Wed Oct 27 01:15:57 2010 +0100
+++ b/src/lasschema.cpp	Tue Oct 26 21:56:29 2010 -0500
@@ -436,7 +436,10 @@
         d.IsSigned(issigned);
         d.IsRequired(isrequired);
         d.SetPosition(position);
-        if (min != max && min != 0 && max != 0) {
+        if (!detail::compare_distance(max, min ) && 
+            !detail::compare_distance(0.0, min) &&
+            !detail::compare_distance(0.0, max))
+        {
             d.SetMinimum(min);
             d.SetMaximum(max);
         }


More information about the Liblas-commits mailing list