[Liblas-commits] hg: fix #187 and #186 -- warning about size_type
and use resize ...
liblas-commits at liblas.org
liblas-commits at liblas.org
Mon Sep 20 12:41:12 EDT 2010
changeset 400bf7b7c425 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=400bf7b7c425
summary: fix #187 and #186 -- warning about size_type and use resize instead of reserve for spare vector because some platforms suck
diffstat:
apps/chipper.cpp | 2 +-
apps/chipper.hpp | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r 0b74c96b407b -r 400bf7b7c425 apps/chipper.cpp
--- a/apps/chipper.cpp Sun Sep 12 11:26:50 2010 -0500
+++ b/apps/chipper.cpp Mon Sep 20 11:41:03 2010 -0500
@@ -105,7 +105,7 @@
count = m_reader->GetHeader().GetPointRecordsCount();
xvec.reserve(count);
yvec.reserve(count);
- spare.reserve(count);
+ spare.resize(count);
count = 0;
while (m_reader->ReadNextPoint()) {
diff -r 0b74c96b407b -r 400bf7b7c425 apps/chipper.hpp
--- a/apps/chipper.hpp Sun Sep 12 11:26:50 2010 -0500
+++ b/apps/chipper.hpp Mon Sep 20 11:41:03 2010 -0500
@@ -40,6 +40,8 @@
{ return m_vec.size(); }
void reserve(std::vector<PtRef>::size_type n)
{ m_vec.reserve(n); }
+ void resize(std::vector<PtRef>::size_type n)
+ { m_vec.resize(n); }
void push_back(const PtRef& ref)
{ m_vec.push_back(ref); }
std::vector<PtRef>::iterator begin()
@@ -98,9 +100,9 @@
{}
void Chip();
- boost::uint32_t GetBlockCount()
+ std::vector<Block>::size_type GetBlockCount()
{ return m_blocks.size(); }
- const Block& GetBlock(boost::uint32_t i)
+ const Block& GetBlock(std::vector<Block>::size_type i)
{ return m_blocks[i]; }
private:
More information about the Liblas-commits
mailing list