[Liblas-commits] hg-main-tree: lint
liblas-commits at liblas.org
liblas-commits at liblas.org
Mon Apr 25 17:40:52 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/e3d0dd5687b3
changeset: 646:e3d0dd5687b3
user: Michael P. Gerlek <mpg at flaxen.com>
date: Mon Apr 25 14:40:42 2011 -0700
description:
lint
diffstat:
apps/pcview/Engine.cpp | 3 ++-
src/Options.cpp | 2 +-
src/filters/Chipper.cpp | 12 ++++++++----
3 files changed, 11 insertions(+), 6 deletions(-)
diffs (68 lines):
diff -r b5679e136165 -r e3d0dd5687b3 apps/pcview/Engine.cpp
--- a/apps/pcview/Engine.cpp Mon Apr 25 14:28:56 2011 -0700
+++ b/apps/pcview/Engine.cpp Mon Apr 25 14:40:42 2011 -0700
@@ -322,6 +322,7 @@
return;
}
+bool s_drawCube = true;
void Engine::doDisplay()
{
@@ -358,7 +359,7 @@
glTranslated(-minx-delx/2.0,-miny-dely/2.0,(-minz-delx/2.0)/zAdjust);
- if (1)
+ if (s_drawCube)
{
// draw cube
glBegin(GL_LINES);
diff -r b5679e136165 -r e3d0dd5687b3 src/Options.cpp
--- a/src/Options.cpp Mon Apr 25 14:28:56 2011 -0700
+++ b/src/Options.cpp Mon Apr 25 14:40:42 2011 -0700
@@ -132,7 +132,7 @@
}
-std::ostream& operator<<(std::ostream& ostr, const Options& options)
+std::ostream& operator<<(std::ostream& ostr, const Options& /*options*/)
{
// ostr << " Num points: " << stage.getNumPoints() << std::endl;
//
diff -r b5679e136165 -r e3d0dd5687b3 src/filters/Chipper.cpp
--- a/src/filters/Chipper.cpp Mon Apr 25 14:28:56 2011 -0700
+++ b/src/filters/Chipper.cpp Mon Apr 25 14:40:42 2011 -0700
@@ -46,6 +46,7 @@
#include <boost/scoped_ptr.hpp>
#include <iostream>
+#include <limits>
using namespace std;
using namespace libpc::filters::chipper;
@@ -149,9 +150,12 @@
libpc::Schema const& schema = m_prevStage.getSchema();
boost::uint64_t count = m_prevStage.getNumPoints();
- xvec.reserve(count);
- yvec.reserve(count);
- spare.resize(count);
+ if (count > std::numeric_limits<std::size_t>::max())
+ throw libpc_error("numPoints too large for Chipper");
+ boost::uint32_t count32 = (boost::uint32_t)count;
+ xvec.reserve(count32);
+ yvec.reserve(count32);
+ spare.resize(count32);
// boost::uint32_t chunks = count/m_threshold;
@@ -170,7 +174,7 @@
double yoffset = dimY.getNumericOffset();
std::size_t num_points_loaded = 0;
- std::size_t num_points_to_load = count;
+ std::size_t num_points_to_load = count32;
boost::scoped_ptr<SequentialIterator> iter(m_prevStage.createSequentialIterator());
More information about the Liblas-commits
mailing list