[Liblas-commits] hg: Do not import external namespaces within liblas namespace.

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Aug 2 12:05:17 EDT 2010


changeset a34577812df9 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=a34577812df9
summary: Do not import external namespaces within liblas namespace.

diffstat:

 apps/chipper.cpp             |  23 +++++++++--------------
 src/detail/reader/header.cpp |   5 +++--
 src/detail/reader/point.cpp  |   4 ++--
 src/detail/writer/base.cpp   |   4 +---
 src/detail/writer/header.cpp |   8 ++++----
 src/detail/writer/point.cpp  |   4 ++--
 src/lasbounds.cpp            |   4 +++-
 src/lasclassification.cpp    |   4 ++--
 test/unit/common.cpp         |   4 ++--
 9 files changed, 28 insertions(+), 32 deletions(-)

diffs (198 lines):

diff -r 812f38ad95f0 -r a34577812df9 apps/chipper.cpp
--- a/apps/chipper.cpp	Sun Aug 01 02:12:30 2010 +0100
+++ b/apps/chipper.cpp	Mon Aug 02 17:09:01 2010 +0100
@@ -38,10 +38,14 @@
  * OF SUCH DAMAGE.
  ****************************************************************************/
 
+#include "chipper.hpp"
+// boost
+#include <boost/cstdint.hpp>
+// std
+#include <cmath>
 
-#include "chipper.hpp"
-
-#include <cmath>
+using namespace boost;
+using namespace std;
 
 /**
 The objective is to split the region into non-overlapping blocks, each
@@ -73,14 +77,7 @@
 be stored.
 **/
 
-namespace liblas
-{
-
-using namespace std;
-using namespace boost;
-
-namespace chipper
-{
+namespace liblas { namespace chipper {
 
 vector<uint32_t> Block::GetIDs() const
 {
@@ -305,6 +302,4 @@
     m_blocks.push_back(b);
 }
 
-} // namespace chipper
-
-} // namespace liblas
+}} // namespace liblas::chipper
diff -r 812f38ad95f0 -r a34577812df9 src/detail/reader/header.cpp
--- a/src/detail/reader/header.cpp	Sun Aug 01 02:12:30 2010 +0100
+++ b/src/detail/reader/header.cpp	Mon Aug 02 17:09:01 2010 +0100
@@ -44,13 +44,14 @@
 #include <liblas/lasheader.hpp>
 #include <liblas/lasvariablerecord.hpp>
 // boost
+#include <boost/cstdint.hpp>
 #include <boost/concept_check.hpp>
 #include <boost/cstdint.hpp>
 
+using namespace boost;
+
 namespace liblas { namespace detail { namespace reader {
 
-using namespace boost;
-
 Header::Header(std::istream& ifs)
     : m_ifs(ifs)
     , m_header(new liblas::Header())
diff -r 812f38ad95f0 -r a34577812df9 src/detail/reader/point.cpp
--- a/src/detail/reader/point.cpp	Sun Aug 01 02:12:30 2010 +0100
+++ b/src/detail/reader/point.cpp	Mon Aug 02 17:09:01 2010 +0100
@@ -50,11 +50,11 @@
 #include <cstring>
 #include <sstream> 
 
-namespace liblas { namespace detail { namespace reader {
-
 using namespace boost;
 using namespace std;
 
+namespace liblas { namespace detail { namespace reader {
+
 Point::Point(std::istream& ifs, HeaderPtr header)
     : m_ifs(ifs)
     , m_header(header)
diff -r 812f38ad95f0 -r a34577812df9 src/detail/writer/base.cpp
--- a/src/detail/writer/base.cpp	Sun Aug 01 02:12:30 2010 +0100
+++ b/src/detail/writer/base.cpp	Mon Aug 02 17:09:01 2010 +0100
@@ -47,9 +47,7 @@
 
 namespace liblas { namespace detail {
 
-using namespace boost;
-
-WriterBase::WriterBase(std::ostream& ofs, uint32_t& count)
+WriterBase::WriterBase(std::ostream& ofs, boost::uint32_t& count)
     : m_pointCount(count)
     , m_ofs(ofs)
 {
diff -r 812f38ad95f0 -r a34577812df9 src/detail/writer/header.cpp
--- a/src/detail/writer/header.cpp	Sun Aug 01 02:12:30 2010 +0100
+++ b/src/detail/writer/header.cpp	Mon Aug 02 17:09:01 2010 +0100
@@ -58,13 +58,13 @@
 #include <string>
 #include <vector>
 
-namespace liblas { namespace detail { namespace writer {
-
 using namespace boost;
 using namespace std;
 
-Header::Header(std::ostream& ofs, uint32_t& count, liblas::Header const& header) :
-    Base(ofs, count)
+namespace liblas { namespace detail { namespace writer {
+
+Header::Header(std::ostream& ofs, uint32_t& count, liblas::Header const& header)
+    : Base(ofs, count)
 {
     m_header = header;
 }
diff -r 812f38ad95f0 -r a34577812df9 src/detail/writer/point.cpp
--- a/src/detail/writer/point.cpp	Sun Aug 01 02:12:30 2010 +0100
+++ b/src/detail/writer/point.cpp	Mon Aug 02 17:09:01 2010 +0100
@@ -51,10 +51,10 @@
 #include <cmath>
 #include <sstream> 
 
+using namespace boost;
+
 namespace liblas { namespace detail { namespace writer {
 
-using namespace boost;
-
 Point::Point(std::ostream& ofs, uint32_t& count, const liblas::Header& header)
     : Base(ofs, count)
     , m_ofs(ofs)
diff -r 812f38ad95f0 -r a34577812df9 src/lasbounds.cpp
--- a/src/lasbounds.cpp	Sun Aug 01 02:12:30 2010 +0100
+++ b/src/lasbounds.cpp	Mon Aug 02 17:09:01 2010 +0100
@@ -42,6 +42,7 @@
 #include <liblas/lasbounds.hpp>
 #include <liblas/laspoint.hpp>
 // boost
+#include <boost/cstdint.hpp>
 #include <boost/array.hpp>
 #include <boost/concept_check.hpp>
 // std
@@ -50,6 +51,8 @@
 #include <string>
 #include <sstream>
 
+using namespace boost;
+
 namespace liblas { 
 
 Bounds::Bounds()
@@ -128,7 +131,6 @@
 
 void Bounds::verify()
 {
-
     for (uint32_t d = 0; d < 3; ++d)
     {
         if (min(d) > max(d) )
diff -r 812f38ad95f0 -r a34577812df9 src/lasclassification.cpp
--- a/src/lasclassification.cpp	Sun Aug 01 02:12:30 2010 +0100
+++ b/src/lasclassification.cpp	Mon Aug 02 17:09:01 2010 +0100
@@ -47,6 +47,8 @@
 #include <cstddef>
 #include <string>
 
+using namespace boost;
+
 namespace {
 
 static std::string g_class_names[] =
@@ -89,8 +91,6 @@
 
 namespace liblas {
 
-using namespace boost;
-
 std::size_t const Classification::class_table_size = detail::static_array_size(g_class_names);
 
 std::string Classification::GetClassName() const
diff -r 812f38ad95f0 -r a34577812df9 test/unit/common.cpp
--- a/test/unit/common.cpp	Sun Aug 01 02:12:30 2010 +0100
+++ b/test/unit/common.cpp	Mon Aug 02 17:09:01 2010 +0100
@@ -14,10 +14,10 @@
 // std
 #include <string>
 
+using namespace boost;
+
 namespace tut {
 
-using namespace boost;
-
 void test_default_header(liblas::Header const& h)
 {
     using liblas::Header;


More information about the Liblas-commits mailing list