[PPL-devel] [GIT] ppl/ppl(master): Avoid anonymous namespaces in header files.

Roberto Bagnara bagnara at cs.unipr.it
Fri Oct 28 07:55:58 CEST 2011


Module: ppl/ppl
Branch: master
Commit: 667dc51aa88cb9fe27ce4dea732f32684dea992d
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=667dc51aa88cb9fe27ce4dea732f32684dea992d

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Fri Oct 28 07:54:42 2011 +0200

Avoid anonymous namespaces in header files.
Detected by ECLAIR service hedrfile.

---

 src/Bit_Matrix.cc              |    4 ++--
 src/Linear_System.cc           |   10 ++++++----
 src/swapping_sort.templates.hh |    9 +++++++--
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/Bit_Matrix.cc b/src/Bit_Matrix.cc
index e471ec0..e93c8ae 100644
--- a/src/Bit_Matrix.cc
+++ b/src/Bit_Matrix.cc
@@ -46,9 +46,9 @@ PPL::Bit_Matrix::sort_rows() {
   // Sorting without removing duplicates.
   Iter first = rows.begin();
   Iter last = rows.end();
-  swapping_sort(first, last, Bit_Row_Less_Than());
+  Implementation::swapping_sort(first, last, Bit_Row_Less_Than());
   // Moving all the duplicate elements at the end of the vector.
-  Iter new_last = swapping_unique(first, last);
+  Iter new_last = Implementation::swapping_unique(first, last);
   // Removing duplicates.
   rows.erase(new_last, last);
   PPL_ASSERT(OK());
diff --git a/src/Linear_System.cc b/src/Linear_System.cc
index 944b87e..11cf0e0 100644
--- a/src/Linear_System.cc
+++ b/src/Linear_System.cc
@@ -334,9 +334,10 @@ PPL::Linear_System::sort_rows(const dimension_type first_row,
   // First sort without removing duplicates.
   std::vector<Dense_Row>::iterator first = rows.begin() + first_row;
   std::vector<Dense_Row>::iterator last = rows.begin() + last_row;
-  swapping_sort(first, last, Row_Less_Than());
+  Implementation::swapping_sort(first, last, Row_Less_Than());
   // Second, move duplicates to the end.
-  std::vector<Dense_Row>::iterator new_last = swapping_unique(first, last);
+  std::vector<Dense_Row>::iterator new_last
+    = Implementation::swapping_unique(first, last);
   // Finally, remove duplicates.
   rows.erase(new_last, last);
   // NOTE: we cannot check all invariants of the system here,
@@ -512,9 +513,10 @@ PPL::Linear_System::sort_and_remove_with_sat(Bit_Matrix& sat) {
   // First, sort `sys' (keeping `sat' consistent) without removing duplicates.
   With_Bit_Matrix_iterator first(sys.rows.begin(), sat.rows.begin());
   With_Bit_Matrix_iterator last = first + sat.num_rows();
-  swapping_sort(first, last, Row_Less_Than());
+  Implementation::swapping_sort(first, last, Row_Less_Than());
   // Second, move duplicates in `sys' to the end (keeping `sat' consistent).
-  With_Bit_Matrix_iterator new_last = swapping_unique(first, last);
+  With_Bit_Matrix_iterator new_last
+    = Implementation::swapping_unique(first, last);
 
   const dimension_type num_duplicates = last - new_last;
   const dimension_type new_first_pending_row
diff --git a/src/swapping_sort.templates.hh b/src/swapping_sort.templates.hh
index 4abea40..f258050 100644
--- a/src/swapping_sort.templates.hh
+++ b/src/swapping_sort.templates.hh
@@ -27,7 +27,10 @@ site: http://bugseng.com/products/ppl/ . */
 #include <iterator>
 #include <algorithm>
 
-namespace {
+namespace Parma_Polyhedra_Library {
+
+namespace Implementation {
+
 /*
   This sorting algorithm avoids (almost all) copies of objects
   by performing more iter_swap's: it is meant to be used when
@@ -137,6 +140,8 @@ swapping_unique(Iter first, Iter last) {
   return ++current;
 }
 
-} // namespace
+} // namespace Implementation
+
+} // namespace Parma_Polyhedra_Library
 
 #endif // !defined(PPL_swapping_sort_icc)




More information about the PPL-devel mailing list