[PPL-devel] [GIT] ppl/ppl(master): Use an explicitly signed char type when dealing with numeric info.

Enea Zaffanella zaffanella at cs.unipr.it
Wed Nov 2 11:39:47 CET 2011


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Wed Nov  2 08:42:59 2011 +0100

Use an explicitly signed char type when dealing with numeric info.
Detected by ECLAIR service utypflag.

---

 src/CO_Tree.cc           |    4 ++--
 src/CO_Tree.templates.hh |    5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/CO_Tree.cc b/src/CO_Tree.cc
index 3c0a9fd..3f3caa1 100644
--- a/src/CO_Tree.cc
+++ b/src/CO_Tree.cc
@@ -1002,7 +1002,7 @@ PPL::CO_Tree::move_data_from(CO_Tree& tree) {
   // with operation 0, one element with operation 2 and one element
   // with operation 3. An additional element with operation 1 can be at the
   // top of the tree.
-  static std::pair<dimension_type,char>
+  static std::pair<dimension_type, signed char>
     stack[5*CHAR_BIT*sizeof(dimension_type)];
 
   dimension_type stack_first_empty = 0;
@@ -1025,7 +1025,7 @@ PPL::CO_Tree::move_data_from(CO_Tree& tree) {
     // top_n         = stack.top().first;
     // top_operation = stack.top().second;
     const dimension_type top_n = stack[stack_first_empty - 1].first;
-    const char top_operation = stack[stack_first_empty - 1].second;
+    const signed char top_operation = stack[stack_first_empty - 1].second;
 
     switch (top_operation) {
 
diff --git a/src/CO_Tree.templates.hh b/src/CO_Tree.templates.hh
index d00df4f..15d5b67 100644
--- a/src/CO_Tree.templates.hh
+++ b/src/CO_Tree.templates.hh
@@ -1,4 +1,3 @@
-
 /* CO_Tree class implementation: non-inline template functions.
    Copyright (C) 2001-2010 Roberto Bagnara <bagnara at cs.unipr.it>
    Copyright (C) 2010-2011 BUGSENG srl (http://bugseng.com)
@@ -54,7 +53,7 @@ CO_Tree::CO_Tree(Iterator i, dimension_type n) {
   // with operation 0, one element with operation 2 and one element
   // with operation 3. An additional element with operation 1 can be at the
   // top of the tree.
-  static std::pair<dimension_type,char>
+  static std::pair<dimension_type, signed char>
     stack[4*CHAR_BIT*sizeof(dimension_type)+1];
 
   dimension_type stack_first_empty = 0;
@@ -77,7 +76,7 @@ CO_Tree::CO_Tree(Iterator i, dimension_type n) {
     // top_n         = stack.top().first;
     // top_operation = stack.top().second;
     const dimension_type top_n = stack[stack_first_empty - 1].first;
-    const char top_operation = stack[stack_first_empty - 1].second;
+    const signed char top_operation = stack[stack_first_empty - 1].second;
 
     switch (top_operation) {
 




More information about the PPL-devel mailing list