[PPL-devel] [GIT] ppl/ppl(master): Moved in_assert in Implementation namespace.

Abramo Bagnara abramo.bagnara at gmail.com
Mon Jul 13 15:15:59 CEST 2009


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

Author: Abramo Bagnara <abramo.bagnara at gmail.com>
Date:   Mon Jul 13 15:13:27 2009 +0200

Moved in_assert in Implementation namespace.

---

 src/assert.hh          |   25 ++++++++++++++++---------
 src/globals.cc         |   16 +++++++++++-----
 src/globals.inlines.hh |   10 ++++++++--
 3 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/src/assert.hh b/src/assert.hh
index 4a22012..6e8eb39 100644
--- a/src/assert.hh
+++ b/src/assert.hh
@@ -26,8 +26,6 @@ site: http://www.cs.unipr.it/ppl/ . */
 #include <cassert>
 #include "globals.defs.hh"
 
-namespace Parma_Polyhedra_Library {
-
 #if defined(NDEBUG)
 
 #define PPL_ASSERT(cond__)
@@ -35,6 +33,17 @@ namespace Parma_Polyhedra_Library {
 
 #else
 
+namespace Parma_Polyhedra_Library {
+
+namespace Implementation {
+
+//! Non zero during evaluation of PPL_ASSERT expression.
+extern unsigned int in_assert;
+
+} // namespace Implementation
+
+} // namespace Parma_Polyhedra_Library
+
 #define PPL_DEBUG_PPL_ASSERT 1
 #if !PPL_DEBUG_PPL_ASSERT
 #define PPL_ASSERT(cond__) assert(cond__)
@@ -50,14 +59,12 @@ namespace Parma_Polyhedra_Library {
   } while(0)
 #endif
 
-#define PPL_ASSERT_HEAVY(cond__)		\
-    do {					\
-      ++Parma_Polyhedra_Library::in_assert;	\
-      assert(cond__);				\
-      --Parma_Polyhedra_Library::in_assert;	\
+#define PPL_ASSERT_HEAVY(cond__)				\
+  do {								\
+      ++Parma_Polyhedra_Library::Implementation::in_assert;	\
+      assert(cond__);						\
+      --Parma_Polyhedra_Library::Implementation::in_assert;	\
     } while (0)
 #endif
 
-} // namespace Parma_Polyhedra_Library
-
 #endif // !defined(PPL_assert_hh)
diff --git a/src/globals.cc b/src/globals.cc
index 337190e..1f2c262 100644
--- a/src/globals.cc
+++ b/src/globals.cc
@@ -26,12 +26,18 @@ site: http://www.cs.unipr.it/ppl/ . */
 #include "Constraint.defs.hh"
 #include "Generator.defs.hh"
 
-namespace PPL = Parma_Polyhedra_Library;
+namespace Parma_Polyhedra_Library {
 
-const PPL::Throwable* volatile PPL::abandon_expensive_computations = 0;
+const Throwable* volatile abandon_expensive_computations = 0;
 
 // Initialize Weightwatch_Traits static data members.
-PPL::Weightwatch_Traits::Threshold PPL::Weightwatch_Traits::weight = 0;
-void (*PPL::Weightwatch_Traits::check_function)(void) = 0;
+Weightwatch_Traits::Threshold Weightwatch_Traits::weight = 0;
+void (*Weightwatch_Traits::check_function)(void) = 0;
 
-int PPL::in_assert = 0;
+#ifndef NDEBUG
+namespace Implementation {
+unsigned int in_assert = 0;
+}
+#endif
+
+} // namespace Parma_Polyhedra_Library
diff --git a/src/globals.inlines.hh b/src/globals.inlines.hh
index 80201b6..b3779af 100644
--- a/src/globals.inlines.hh
+++ b/src/globals.inlines.hh
@@ -53,13 +53,19 @@ Throwable::~Throwable() {
 }
 
 #ifndef NDEBUG
-extern int in_assert;
+namespace Implementation {
+
+//! Non zero during evaluation of PPL_ASSERT expression.
+extern unsigned int in_assert;
+
+} // namespace Implementation
+
 #endif
 
 inline void
 maybe_abandon() {
 #ifndef NDEBUG
-  if (in_assert)
+  if (Implementation::in_assert)
     return;
 #endif
   ++Weightwatch_Traits::weight;




More information about the PPL-devel mailing list