[PPL-devel] [GIT] ppl/ppl(master): Use PPL_DIRTY_TEMP for temporary objects.

Enea Zaffanella zaffanella at cs.unipr.it
Thu May 14 16:19:26 CEST 2009


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Thu May 14 15:46:36 2009 +0200

Use PPL_DIRTY_TEMP for temporary objects.
Also corrected a type causing an assertion failure.

---

 src/Box.inlines.hh   |    4 ++--
 src/Box.templates.hh |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/Box.inlines.hh b/src/Box.inlines.hh
index 665c180..c4a9888 100644
--- a/src/Box.inlines.hh
+++ b/src/Box.inlines.hh
@@ -406,9 +406,9 @@ Box<ITV>::refine_interval_no_check(ITV& itv,
                                           : LESS_THAN, q));
     break;
   default:
-    // Silence an annoying GCC warning.
-    res = I_ANY;
+    // Silence an annoying GCC warning (should never reach this point).
     assert(false);
+    res = I_ANY;
   }
   assert(itv.OK());
   return res;
diff --git a/src/Box.templates.hh b/src/Box.templates.hh
index dbe1a76..3cef96e 100644
--- a/src/Box.templates.hh
+++ b/src/Box.templates.hh
@@ -1465,7 +1465,7 @@ Box<ITV>::wrap_assign(const Variables_Set& vars,
   // FIXME: Build the quadrant interval.
   I_Constraint<Coefficient> lower = i_constraint(GREATER_OR_EQUAL, min_value);
   I_Constraint<Coefficient> upper = i_constraint(LESS_THAN, max_value);
-  ITV quadrant_itv;
+  PPL_DIRTY_TEMP(ITV, quadrant_itv);
   quadrant_itv.build(lower, upper);
 
   if (pcs == 0) {
@@ -1497,11 +1497,11 @@ Box<ITV>::wrap_assign(const Variables_Set& vars,
   // A map associating interval constraints to variable indexes.
   typedef std::map<dimension_type, std::vector<const Constraint*> > map_type;
   map_type var_cs_map;
-  dimension_type c_num_vars = 0;
-  dimension_type c_only_var = 0;
   for (Constraint_System::const_iterator i = cs.begin(),
          i_end = cs.end(); i != i_end; ++i) {
     const Constraint& c = *i;
+    dimension_type c_num_vars = 0;
+    dimension_type c_only_var = 0;
     if (extract_interval_constraint(c, cs_space_dim,
                                     c_num_vars, c_only_var)) {
       if (c_num_vars == 1) {
@@ -1521,7 +1521,7 @@ Box<ITV>::wrap_assign(const Variables_Set& vars,
     }
   }
 
-  ITV refinement_itv;
+  PPL_DIRTY_TEMP(ITV, refinement_itv);
   const map_type::const_iterator var_cs_map_end = var_cs_map.end();
   // Loop through the variable indexes in `vars'.
   for (Variables_Set::const_iterator i = vars.begin(); i != vs_end; ++i) {




More information about the PPL-devel mailing list