[PPL-devel] [GIT] ppl/ppl(master): Converted weight threshold to unsigned long long.

Abramo Bagnara abramo.bagnara at gmail.com
Mon Jul 13 18:46:57 CEST 2009


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

Author: Abramo Bagnara <abramo.bagnara at gmail.com>
Date:   Mon Jul 13 18:46:47 2009 +0200

Converted weight threshold to unsigned long long.

---

 src/Weight_Profiler.defs.hh |    6 +++---
 src/globals.defs.hh         |    4 ++--
 src/globals.inlines.hh      |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/Weight_Profiler.defs.hh b/src/Weight_Profiler.defs.hh
index 5b67aa6..542156d 100644
--- a/src/Weight_Profiler.defs.hh
+++ b/src/Weight_Profiler.defs.hh
@@ -31,7 +31,7 @@ class Weight_Profiler {
   enum { DISCARDED = 0, VALID = 1 };
 public:
   Weight_Profiler(const char* file, int line,
-		  Weightwatch_Traits::Threshold delta,
+		  Weightwatch_Traits::Delta delta,
 		  double tmin = 0, double tmax = 0)
     : file(file), line(line), delta(delta),
       tmin(tmin), tmax(tmax) {
@@ -56,7 +56,7 @@ public:
     assert(r >= 0);
   }
   void end(unsigned int factor = 1) {
-    Weightwatch_Traits::weight += delta * factor;
+    Weightwatch_Traits::weight += (Weightwatch_Traits::Threshold) delta * factor;
     struct timespec start = stamp;
     begin();
     double elapsed;
@@ -87,7 +87,7 @@ public:
  private:
   const char *file;
   int line;
-  Weightwatch_Traits::Threshold delta;
+  Weightwatch_Traits::Delta delta;
   double tmin;
   double tmax;
 
diff --git a/src/globals.defs.hh b/src/globals.defs.hh
index ae45312..b36d575 100644
--- a/src/globals.defs.hh
+++ b/src/globals.defs.hh
@@ -95,10 +95,10 @@ compute_capacity(dimension_type requested_size,
 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
 struct Weightwatch_Traits {
   //! The type used to specify thresholds for computational weight.
-  typedef unsigned int Threshold;
+  typedef unsigned long long Threshold;
 
   //! The type used to specify increments of computational weight.
-  typedef unsigned int Delta;
+  typedef unsigned long long Delta;
 
   //! Returns the current computational weight.
   static const Threshold& get();
diff --git a/src/globals.inlines.hh b/src/globals.inlines.hh
index b0f4d3c..fd1f749 100644
--- a/src/globals.inlines.hh
+++ b/src/globals.inlines.hh
@@ -40,7 +40,7 @@ Weightwatch_Traits::get() {
 
 inline bool
 Weightwatch_Traits::less_than(const Threshold& a, const Threshold& b) {
-  return b - a < 1U << (sizeof(Threshold)*8-1);
+  return b - a < 1ULL << (sizeof(Threshold)*8-1);
 }
 
 inline void




More information about the PPL-devel mailing list