[Liblas-commits] libpc: tidying up

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Mar 1 16:03:53 EST 2011


details:   http://hg.liblas.orglibpc/rev/40ec0bda8eea
changeset: 140:40ec0bda8eea
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Tue Mar 01 12:52:18 2011 -0800
description:
tidying up
Subject: libpc: was using wrong filesize

details:   http://hg.liblas.orglibpc/rev/1c217e0c092e
changeset: 141:1c217e0c092e
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Tue Mar 01 12:52:38 2011 -0800
description:
was using wrong filesize

diffstat:

 apps/Application.cpp  |  17 +++++++++--------
 test/unit/support.cpp |   4 ++--
 2 files changed, 11 insertions(+), 10 deletions(-)

diffs (62 lines):

diff -r 39b353aa9339 -r 1c217e0c092e apps/Application.cpp
--- a/apps/Application.cpp	Tue Mar 01 11:37:19 2011 -0800
+++ b/apps/Application.cpp	Tue Mar 01 12:52:38 2011 -0800
@@ -64,14 +64,6 @@
     // parse the command line
     parseOptions();
 
-    // do any user-level sanity checking
-    bool happy = validateOptions();
-    if (!happy)
-    {
-        outputHelp();
-        return 1;
-    }
-
     // handle the well-known options
     if (hasOption("version")) 
     {
@@ -85,6 +77,14 @@
         return 0;
     }
 
+    // do any user-level sanity checking
+    bool happy = validateOptions();
+    if (!happy)
+    {
+        outputHelp();
+        return 1;
+    }
+
     boost::timer timer;
     
     // call derived function
@@ -141,6 +141,7 @@
     {
         const po::options_description* options = *iter;
         std::cout << *options;
+        std::cout << std::endl;
     }
 
     std::cout <<"\nFor more information, see the full documentation for libPC at:\n";
diff -r 39b353aa9339 -r 1c217e0c092e test/unit/support.cpp
--- a/test/unit/support.cpp	Tue Mar 01 11:37:19 2011 -0800
+++ b/test/unit/support.cpp	Tue Mar 01 12:52:38 2011 -0800
@@ -44,7 +44,7 @@
 bool compare_files(const std::string& file1, const std::string& file2)
 {
     uintmax_t len1x = libpc::Utils::fileSize(file1);
-    uintmax_t len2x = libpc::Utils::fileSize(file1);
+    uintmax_t len2x = libpc::Utils::fileSize(file2);
     size_t len1 = (size_t)len1x; // BUG
     size_t len2 = (size_t)len2x;
 
@@ -62,7 +62,7 @@
     char* buf2 = new char[len2];
 
     str1->read(buf1,len1);
-    str2->read (buf2,len2);
+    str2->read(buf2,len2);
 
     libpc::Utils::closeFile(str1);
     libpc::Utils::closeFile(str2);


More information about the Liblas-commits mailing list