[Liblas-commits] hg: 4 new changesets
liblas-commits at liblas.org
liblas-commits at liblas.org
Tue Oct 26 20:16:15 EDT 2010
changeset 09e85faf3739 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=09e85faf3739
summary: Do not compare floats in specialized ensure_equal function in tut::
changeset 67c49bffc7c0 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=67c49bffc7c0
summary: Added value_type alias to Ranges and Bounds.
changeset b94c6e255f4f in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=b94c6e255f4f
summary: Unified data type in Bounds test comparison, instead of mising float with int.
changeset 2b1236aaf3b6 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=2b1236aaf3b6
summary: More CXX compilation flags for GCC
diffstat:
CMakeLists.txt | 7 ++++++-
include/liblas/lasbounds.hpp | 6 ++++--
test/unit/lasbounds_test.cpp | 19 +++++++++----------
test/unit/tut/tut_assert.hpp | 2 +-
4 files changed, 20 insertions(+), 14 deletions(-)
diffs (92 lines):
diff -r 4c84ffb7b8d5 -r 2b1236aaf3b6 CMakeLists.txt
--- a/CMakeLists.txt Wed Oct 27 00:44:58 2010 +0100
+++ b/CMakeLists.txt Wed Oct 27 01:15:57 2010 +0100
@@ -102,8 +102,13 @@
endif()
else()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+
+ # Recommended C++ compilation flags
+ # -Weffc++
+ set(LIBLAS_GCC_CXX_FLAGS
+ "-pedantic -ansi -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-long-long -ansi")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${LIBLAS_GCC_CXX_FLAGS}")
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
endif()
diff -r 4c84ffb7b8d5 -r 2b1236aaf3b6 include/liblas/lasbounds.hpp
--- a/include/liblas/lasbounds.hpp Wed Oct 27 00:44:58 2010 +0100
+++ b/include/liblas/lasbounds.hpp Wed Oct 27 01:15:57 2010 +0100
@@ -67,7 +67,9 @@
public:
T min;
T max;
-
+
+ typedef T value_type;
+
Range(T mmin=std::numeric_limits<T>::max(), T mmax=std::numeric_limits<T>::min())
: min(mmin), max(mmax) {};
@@ -168,7 +170,7 @@
{
public:
-
+ typedef T value_type;
typedef typename std::vector< Range<T> >::size_type size_type;
typedef typename std::vector< Range<T> > RangeVec;
diff -r 4c84ffb7b8d5 -r 2b1236aaf3b6 test/unit/lasbounds_test.cpp
--- a/test/unit/lasbounds_test.cpp Wed Oct 27 00:44:58 2010 +0100
+++ b/test/unit/lasbounds_test.cpp Wed Oct 27 01:15:57 2010 +0100
@@ -35,20 +35,19 @@
template<>
void to::test<1>()
{
-
-
Ranges rngs;
rngs.push_back(xrng);
rngs.push_back(yrng);
rngs.push_back(zrng);
- liblas::Bounds<double> b(rngs);
- ensure_equals(b.minx(), 0);
- ensure_equals(b.maxx(), 100);
- ensure_equals(b.miny(), 0);
- ensure_equals(b.maxy(), 200);
- ensure_equals(b.minz(), 0);
- ensure_equals(b.maxz(), 300);
+ typedef liblas::Bounds<double> b_t;
+ b_t b(rngs);
+ ensure_equals(b.minx(), b_t::value_type(0));
+ ensure_equals(b.maxx(), b_t::value_type(100));
+ ensure_equals(b.miny(), b_t::value_type(0));
+ ensure_equals(b.maxy(), b_t::value_type(200));
+ ensure_equals(b.minz(), b_t::value_type(0));
+ ensure_equals(b.maxz(), b_t::value_type(300));
}
template<>
@@ -87,4 +86,4 @@
liblas::Range<double> r;
ensure(r.empty());
}
-}
\ No newline at end of file
+}
diff -r 4c84ffb7b8d5 -r 2b1236aaf3b6 test/unit/tut/tut_assert.hpp
--- a/test/unit/tut/tut_assert.hpp Wed Oct 27 00:44:58 2010 +0100
+++ b/test/unit/tut/tut_assert.hpp Wed Oct 27 01:15:57 2010 +0100
@@ -135,7 +135,7 @@
{
const double diff = actual - expected;
- if ( (actual != expected) && !((diff <= epsilon) && (diff >= -epsilon )) )
+ if ( !((diff <= epsilon) && (diff >= -epsilon )) )
{
std::ostringstream ss;
detail::msg_prefix(ss,msg)
More information about the Liblas-commits
mailing list