[Liblas-commits] hg: 4 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Mar 16 16:54:39 EDT 2010


changeset 0a9a2d52077e in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=0a9a2d52077e
summary: clean up some warnings

changeset e8ab0ce9ac80 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=e8ab0ce9ac80
summary: We don't need the header to make a WriterImpl, just the stream.  The client must call WriteHeader explicitly themselves

changeset 20022c1dfe27 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=20022c1dfe27
summary: clean up more warnings

changeset 24aa6508d530 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=24aa6508d530
summary: clean up more warnings

diffstat:

 apps/lasindex.cpp                       |   3 ++-
 apps/lasinfo.c                          |   2 +-
 include/liblas/detail/writer/writer.hpp |   2 +-
 src/detail/writer/writer.cpp            |   2 +-
 src/gt_citation.cpp                     |   2 +-
 src/las_c_api.cpp                       |   2 +-
 src/lasspatialreference.cpp             |  10 +++++++++-
 src/laswriter.cpp                       |   2 +-
 8 files changed, 17 insertions(+), 8 deletions(-)

diffs (130 lines):

diff -r 97e95df3c389 -r 24aa6508d530 apps/lasindex.cpp
--- a/apps/lasindex.cpp	Tue Mar 16 14:14:49 2010 -0600
+++ b/apps/lasindex.cpp	Tue Mar 16 14:54:17 2010 -0600
@@ -40,7 +40,6 @@
     {
         delete istrm;
         throw std::runtime_error("Reading stream was not able to be created");
-        exit(1);
     }
     return istrm;
 }
@@ -63,6 +62,8 @@
         const liblas::Point& p = reader->GetPoint();
         index->insert(const_cast<liblas::Point&>(p), id);
     }
+
+	detail::ignore_unused_variable_warning(dimension);
 }
 int main(int argc, char* argv[])
 {
diff -r 97e95df3c389 -r 24aa6508d530 apps/lasinfo.c
--- a/apps/lasinfo.c	Tue Mar 16 14:14:49 2010 -0600
+++ b/apps/lasinfo.c	Tue Mar 16 14:54:17 2010 -0600
@@ -213,8 +213,8 @@
         else
         {
             usage();
+            fprintf(stderr, "ERROR: unknown argument '%s'\n",argv[i]);
             exit(1);
-            fprintf(stderr, "ERROR: unknown argument '%s'\n",argv[i]);
         }
     }
 
diff -r 97e95df3c389 -r 24aa6508d530 include/liblas/detail/writer/writer.hpp
--- a/include/liblas/detail/writer/writer.hpp	Tue Mar 16 14:14:49 2010 -0600
+++ b/include/liblas/detail/writer/writer.hpp	Tue Mar 16 14:54:17 2010 -0600
@@ -95,7 +95,7 @@
 {
 public:
 
-    static WriterImpl* Create(std::ostream& ofs, liblas::Header const& header);
+    static WriterImpl* Create(std::ostream& ofs);
     static void Destroy(WriterImpl* p);
 };
 
diff -r 97e95df3c389 -r 24aa6508d530 src/detail/writer/writer.cpp
--- a/src/detail/writer/writer.cpp	Tue Mar 16 14:14:49 2010 -0600
+++ b/src/detail/writer/writer.cpp	Tue Mar 16 14:54:17 2010 -0600
@@ -190,7 +190,7 @@
 
 
 
-WriterImpl* WriterFactory::Create(std::ostream& ofs, liblas::Header const& header)
+WriterImpl* WriterFactory::Create(std::ostream& ofs)
 {
     if (!ofs)
     {
diff -r 97e95df3c389 -r 24aa6508d530 src/gt_citation.cpp
--- a/src/gt_citation.cpp	Tue Mar 16 14:14:49 2010 -0600
+++ b/src/gt_citation.cpp	Tue Mar 16 14:54:17 2010 -0600
@@ -198,7 +198,7 @@
     OGRBoolean nameFound = FALSE;
     while((pStr-psCitation+1)< nCitationLen)
     {
-        if( (pDelimit = strstr(pStr, "|")) )
+        if( (pDelimit = strstr(pStr, "|")) != NULL )
         {
             osName = "";
             osName.append(pStr, pDelimit-pStr);
diff -r 97e95df3c389 -r 24aa6508d530 src/las_c_api.cpp
--- a/src/las_c_api.cpp	Tue Mar 16 14:14:49 2010 -0600
+++ b/src/las_c_api.cpp	Tue Mar 16 14:54:17 2010 -0600
@@ -749,7 +749,7 @@
     try {
         liblas::Point* p = ((liblas::Point*) hPoint);
         std::vector<liblas::uint8_t> d = p->GetExtraData();
-        *length = d.size();
+		*length = static_cast<liblas::uint16_t>(d.size());
         *data = (liblas::uint8_t*) malloc (*length * sizeof(liblas::uint8_t));
         for (liblas::uint16_t i=0; i < *length; i++) {
             (*data)[i] = d[i];
diff -r 97e95df3c389 -r 24aa6508d530 src/lasspatialreference.cpp
--- a/src/lasspatialreference.cpp	Tue Mar 16 14:14:49 2010 -0600
+++ b/src/lasspatialreference.cpp	Tue Mar 16 14:54:17 2010 -0600
@@ -371,6 +371,7 @@
 std::string SpatialReference::GetWKT( WKTModeFlag mode_flag ) const 
 {
 #ifndef HAVE_GDAL
+	detail::ignore_unused_variable_warning(mode_flag);
     return std::string();
 #else
     GTIFDefn sGTIFDefn;
@@ -403,8 +404,11 @@
             
             delete poSRS;
         }
+#else
+		detail::ignore_unused_variable_warning(mode_flag);
 #endif
-        
+
+
         if (pszWKT)
         {
             std::string tmp(pszWKT);
@@ -548,8 +552,12 @@
 #endif
 #endif
 
+#ifndef HAVE_LIBGEOTIFF
+#ifndef HAVE_GDAL
     // If we have neither GDAL nor proj.4, we can't do squat
     return std::string();
+#endif
+#endif
 }
 
 void SpatialReference::SetProj4(std::string const& v)
diff -r 97e95df3c389 -r 24aa6508d530 src/laswriter.cpp
--- a/src/laswriter.cpp	Tue Mar 16 14:14:49 2010 -0600
+++ b/src/laswriter.cpp	Tue Mar 16 14:54:17 2010 -0600
@@ -54,7 +54,7 @@
 {
 
 Writer::Writer(std::ostream& ofs, Header const& header) :
-    m_pimpl(detail::WriterFactory::Create(ofs, header)), m_header(header),
+    m_pimpl(detail::WriterFactory::Create(ofs)), m_header(header),
     m_ofs(ofs)
 {
     m_pimpl->WriteHeader(m_header);


More information about the Liblas-commits mailing list