[Liblas-commits] hg: 4 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Aug 25 20:02:35 EDT 2010


changeset 0db27d102308 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=0db27d102308
summary: Avoid double copies of Classification, copies of string. Shorten long type definition.

changeset d58e38c6db71 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=d58e38c6db71
summary: Do not use hungarian notation

changeset b145915552a8 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=b145915552a8
summary: Warnings cleanup, missing namepsace qualification, tidy up.

changeset 158033bce582 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=158033bce582
summary: Missing boost namepsace import to find integer types.

diffstat:

 apps/lasindex_test.cpp                      |   3 +++
 include/liblas/detail/index/indexoutput.hpp |   2 +-
 include/liblas/detail/utility.hpp           |   4 +++-
 include/liblas/lasspatialreference.hpp      |   4 ++--
 src/lasreader.cpp                           |  13 ++++++++-----
 src/lasspatialreference.cpp                 |   8 +++++---
 6 files changed, 22 insertions(+), 12 deletions(-)

diffs (125 lines):

diff -r e830e28ab4d6 -r 158033bce582 apps/lasindex_test.cpp
--- a/apps/lasindex_test.cpp	Thu Aug 26 00:52:52 2010 +0100
+++ b/apps/lasindex_test.cpp	Thu Aug 26 01:02:23 2010 +0100
@@ -1,6 +1,8 @@
 // lasindex_test.cpp : Defines the entry point for the console application.
 //
 
+#include <boost/cstdint.hpp>
+
 #include <iosfwd>
 #include <iostream>
 #include <cstdio>
@@ -18,6 +20,7 @@
 #include <liblas/lasindex.hpp>
 
 using namespace liblas;
+using namespace boost;
 
 #ifdef _WIN32
 #define compare_no_case(a,b,n)  _strnicmp( (a), (b), (n) )
diff -r e830e28ab4d6 -r 158033bce582 include/liblas/detail/index/indexoutput.hpp
--- a/include/liblas/detail/index/indexoutput.hpp	Thu Aug 26 00:52:52 2010 +0100
+++ b/include/liblas/detail/index/indexoutput.hpp	Thu Aug 26 01:02:23 2010 +0100
@@ -100,7 +100,7 @@
 inline void WriteVLRData_str(IndexVLRData& dest, char * const src, T const srclen, Q& pos)
 {
  	// copy srclen bytes to destination
-	memcpy(&dest[pos], src, srclen);
+    std::memcpy(&dest[pos], src, srclen);
     // error if writing past array end
     if (static_cast<size_t>(pos) + static_cast<size_t>(srclen) > dest.size())
 		throw std::out_of_range("liblas::detail::WriteVLRData_str: array index out of range");
diff -r e830e28ab4d6 -r 158033bce582 include/liblas/detail/utility.hpp
--- a/include/liblas/detail/utility.hpp	Thu Aug 26 00:52:52 2010 +0100
+++ b/include/liblas/detail/utility.hpp	Thu Aug 26 01:02:23 2010 +0100
@@ -443,7 +443,9 @@
     std::string::size_type size() const { return m_oss.str().size(); }
 
     void operator()(char* data, void* aux)
-    {
+    {     
+        ::boost::ignore_unused_variable_warning(aux);
+
         if (0 != data)
         {
             m_oss << data;
diff -r e830e28ab4d6 -r 158033bce582 include/liblas/lasspatialreference.hpp
--- a/include/liblas/lasspatialreference.hpp	Thu Aug 26 00:52:52 2010 +0100
+++ b/include/liblas/lasspatialreference.hpp	Thu Aug 26 01:02:23 2010 +0100
@@ -127,8 +127,8 @@
     /// eCompoundOK indicating the the returned WKT may be a compound 
     /// coordinate system if there is vertical coordinate system info 
     /// available.
-    std::string GetWKT( WKTModeFlag mode_flag = eHorizontalOnly ) const;
-    std::string GetWKT( WKTModeFlag mode_flag, bool bPretty) const;
+    std::string GetWKT(WKTModeFlag mode_flag = eHorizontalOnly) const;
+    std::string GetWKT(WKTModeFlag mode_flag, bool pretty) const;
     
     /// Sets the SRS using GDAL's OGC WKT. If GDAL is not linked, this 
     /// operation has no effect.
diff -r e830e28ab4d6 -r 158033bce582 src/lasreader.cpp
--- a/src/lasreader.cpp	Thu Aug 26 00:52:52 2010 +0100
+++ b/src/lasreader.cpp	Thu Aug 26 01:02:23 2010 +0100
@@ -363,7 +363,8 @@
     using liblas::property_tree::ptree;
     ptree pt;
     
-    boost::array<boost::uint32_t, 32> classes;
+    typedef boost::array<boost::uint32_t, 32> classes_type;
+    classes_type classes;
     boost::uint32_t synthetic = 0;
     boost::uint32_t withheld = 0;
     boost::uint32_t keypoint = 0;
@@ -482,10 +483,12 @@
     
     ptree klasses;
     
-    for (boost::array<boost::uint32_t,32>::size_type i=0; i < classes.size(); i++) {
-        if (classes[i] != 0) {
-            liblas::Classification c = liblas::Classification(i, false, false, false);
-            std::string name = c.GetClassName();
+    for (classes_type::size_type i=0; i < classes.size(); i++)
+    {
+        if (classes[i] != 0)
+        {
+            liblas::Classification c(i, false, false, false);
+            std::string const& name = c.GetClassName();
 
             klasses.put("name", name);
             klasses.put("count", classes[i]);
diff -r e830e28ab4d6 -r 158033bce582 src/lasspatialreference.cpp
--- a/src/lasspatialreference.cpp	Thu Aug 26 00:52:52 2010 +0100
+++ b/src/lasspatialreference.cpp	Thu Aug 26 01:02:23 2010 +0100
@@ -376,10 +376,12 @@
 }
 
 /// Fetch the SRS as WKT
-std::string SpatialReference::GetWKT( WKTModeFlag mode_flag , bool bPretty) const 
+std::string SpatialReference::GetWKT(WKTModeFlag mode_flag , bool pretty) const 
 {
 #ifndef HAVE_GDAL
 	boost::ignore_unused_variable_warning(mode_flag);
+    boost::ignore_unused_variable_warning(pretty);
+
     return std::string();
 #else
     GTIFDefn sGTIFDefn;
@@ -393,7 +395,7 @@
     {
         pszWKT = GTIFGetOGISDefn( m_gtiff, &sGTIFDefn );
 
-            if (bPretty) {
+            if (pretty) {
                 OGRSpatialReference* poSRS = (OGRSpatialReference*) OSRNewSpatialReference(NULL);
                 char *pszOrigWKT = pszWKT;
                 poSRS->importFromWkt( &pszOrigWKT );
@@ -419,7 +421,7 @@
             pszWKT = NULL;
 
             poSRS->StripVertical();
-            if (bPretty) 
+            if (pretty) 
                 poSRS->exportToPrettyWkt(&pszWKT, false);
             else
                 poSRS->exportToWkt( &pszWKT );


More information about the Liblas-commits mailing list