[Liblas-commits] hg: clean up comparison warning

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Jun 30 12:27:14 EDT 2011


details:   http://hg.liblas.orghg/rev/5b2e24d3b1e8
changeset: 3054:5b2e24d3b1e8
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Jun 30 11:27:11 2011 -0500
description:
clean up comparison warning

diffstat:

 src/detail/writer/header.cpp |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r cdf8bcc2bef2 -r 5b2e24d3b1e8 src/detail/writer/header.cpp
--- a/src/detail/writer/header.cpp	Thu Jun 30 10:52:05 2011 -0500
+++ b/src/detail/writer/header.cpp	Thu Jun 30 11:27:11 2011 -0500
@@ -172,7 +172,8 @@
             int32_t d = abs(existing_padding);
             m_header.SetHeaderPadding(d);
         } else {
-            if (existing_padding >= m_header.GetHeaderPadding())
+            // cast is safe, we've already checked for < 0
+            if (static_cast<uint32_t>(existing_padding) >= m_header.GetHeaderPadding())
             {
                 m_header.SetHeaderPadding(existing_padding);
             }
@@ -392,6 +393,7 @@
     if (diff < 2) {
         
         m_header.SetDataOffset(m_header.GetDataOffset() + 2);
+        // Seek to the location of the data offset in the header and write a new one.
         m_ofs.seekp(96, std::ios::beg);
         detail::write_n(m_ofs, m_header.GetDataOffset(), sizeof(m_header.GetDataOffset()));
     }    


More information about the Liblas-commits mailing list