[Liblas-commits] hg: VS2010 lint

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Jan 5 19:10:42 EST 2011


details:   http://hg.liblas.orghg/rev/fce75ae5ce1f
changeset: 2697:fce75ae5ce1f
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Wed Jan 05 15:27:07 2011 -0800
description:
VS2010 lint
Subject: hg: tighten up vector copy

details:   http://hg.liblas.orghg/rev/ddba37c0a960
changeset: 2698:ddba37c0a960
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Wed Jan 05 16:10:05 2011 -0800
description:
tighten up vector copy

diffstat:

 src/detail/reader/zipreader.cpp |  15 +++++----------
 src/transform.cpp               |   8 ++++++++
 2 files changed, 13 insertions(+), 10 deletions(-)

diffs (52 lines):

diff -r 4cced99adb20 -r ddba37c0a960 src/detail/reader/zipreader.cpp
--- a/src/detail/reader/zipreader.cpp	Wed Jan 05 12:49:41 2011 -0800
+++ b/src/detail/reader/zipreader.cpp	Wed Jan 05 16:10:05 2011 -0800
@@ -196,10 +196,6 @@
     
 void ZipReaderImpl::ReadIdiom(bool recordPoint)
 {
-    //////m_point_reader->read();
-    //////++m_current;
-    //////*m_point = m_point_reader->GetPoint();
-
     bool ok = false;
     try
     {
@@ -217,13 +213,12 @@
     if (recordPoint)
     {
         std::vector<boost::uint8_t>& data = m_point->GetData();
-        assert(m_zipPoint->m_lz_point_size == data.size());
+
+        unsigned int size = m_zipPoint->m_lz_point_size;
+        assert(size == data.size());
         
-        for (unsigned int i=0; i<m_zipPoint->m_lz_point_size; i++)
-        {
-            data[i] = m_zipPoint->m_lz_point_data[i];
-            //printf("%d %d\n", v[i], i);
-        }
+        unsigned char* p = m_zipPoint->m_lz_point_data;
+        data.assign(p, p+size);
 
         ++m_current;
     }
diff -r 4cced99adb20 -r ddba37c0a960 src/transform.cpp
--- a/src/transform.cpp	Wed Jan 05 12:49:41 2011 -0800
+++ b/src/transform.cpp	Wed Jan 05 16:10:05 2011 -0800
@@ -46,7 +46,15 @@
 #include <boost/concept_check.hpp>
 #include <boost/tokenizer.hpp>
 #include <boost/lexical_cast.hpp>
+
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable: 4100) // unreferenced formal param
+#endif
 #include <boost/algorithm/string/erase.hpp>
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
 
 // std
 #include <sstream>


More information about the Liblas-commits mailing list