[PPL-devel] [GIT] ppl/ppl(sparse_matrices): CO_Tree: use CHAR_BITS instead of 8.

Marco Poletti poletti.marco at gmail.com
Fri May 7 20:55:46 CEST 2010


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

Author: Marco Poletti <poletti.marco at gmail.com>
Date:   Fri May  7 17:08:43 2010 +0200

CO_Tree: use CHAR_BITS instead of 8.

---

 src/CO_Tree.cc      |    6 +++---
 src/CO_Tree.defs.hh |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/CO_Tree.cc b/src/CO_Tree.cc
index 292a7be..afc2807 100644
--- a/src/CO_Tree.cc
+++ b/src/CO_Tree.cc
@@ -50,7 +50,7 @@ PPL::CO_Tree::CO_Tree(const std::vector<data_type>& v) {
   }
 
   // This is static and with static allocation, to improve performance.
-  static std::pair<dimension_type,char> stack[5*8*sizeof(dimension_type)];
+  static std::pair<dimension_type,char> stack[5*CHAR_BIT*sizeof(dimension_type)];
   dimension_type stack_first_empty = 0;
 
   // A pair (n, operation) in the stack means:
@@ -236,7 +236,7 @@ PPL::CO_Tree::move_data_from(CO_Tree& tree) {
   PPL_ASSERT(itr->first != unused_index);
 
   // This is static and with static allocation, to improve performance.
-  static std::pair<dimension_type,char> stack[5*8*sizeof(dimension_type)];
+  static std::pair<dimension_type,char> stack[5*CHAR_BIT*sizeof(dimension_type)];
   dimension_type stack_first_empty = 0;
 
   // A pair (n, operation) in the stack means:
@@ -905,7 +905,7 @@ PPL::CO_Tree
                                           const data_type& value,
                                           bool added_key) {
   // This is static and with static allocation, to improve performance.
-  static std::pair<dimension_type,char> stack[5*8*sizeof(dimension_type)];
+  static std::pair<dimension_type,char> stack[5*CHAR_BIT*sizeof(dimension_type)];
   dimension_type stack_first_empty = 0;
 
   // A pair (n, operation) in the stack means:
diff --git a/src/CO_Tree.defs.hh b/src/CO_Tree.defs.hh
index 79c7421..0c119af 100644
--- a/src/CO_Tree.defs.hh
+++ b/src/CO_Tree.defs.hh
@@ -274,7 +274,7 @@ private:
 
   private:
 
-    static const dimension_type max_depth = sizeof(dimension_type)*8;
+    static const dimension_type max_depth = sizeof(dimension_type)*CHAR_BIT;
 
     static void fill_level_data(level_data* p, dimension_type min_depth,
                                 dimension_type max_depth);
@@ -542,7 +542,7 @@ private:
   //! pos[0] is not used.
   //! pos[j], for j>0, is the position in the vEB layout of the node passed
   //! at depth j.
-  dimension_type pos[8*sizeof(dimension_type)];
+  dimension_type pos[CHAR_BIT*sizeof(dimension_type)];
 #endif // defined(USE_PPL_CO_TREE_VEB_LAYOUT)
 
 #ifdef USE_PPL_CO_TREE_BFS_LAYOUT
@@ -699,7 +699,7 @@ private:
   //! pos[0] is not used.
   //! pos[j], for j>0, is the position in the vEB layout of the node passed
   //! at depth j.
-  dimension_type pos[8*sizeof(dimension_type)];
+  dimension_type pos[CHAR_BIT*sizeof(dimension_type)];
 #endif // defined(USE_PPL_CO_TREE_VEB_LAYOUT)
 
 #ifdef USE_PPL_CO_TREE_BFS_LAYOUT




More information about the PPL-devel mailing list