[PPL-devel] [GIT] ppl/ppl(master): Prefer bool field.

Abramo Bagnara abramo.bagnara at gmail.com
Thu Feb 23 13:10:41 CET 2012


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

Author: Abramo Bagnara <abramo.bagnara at gmail.com>
Date:   Thu Feb 23 13:10:35 2012 +0100

Prefer bool field.

---

 src/Concrete_Expression.defs.hh    |    2 +-
 src/Concrete_Expression.inlines.hh |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Concrete_Expression.defs.hh b/src/Concrete_Expression.defs.hh
index 05c1bcb..655e119 100644
--- a/src/Concrete_Expression.defs.hh
+++ b/src/Concrete_Expression.defs.hh
@@ -102,7 +102,7 @@ public:
 private:
   //! A 32-bit word encoding the type.
   struct Implementation {
-    unsigned int bounded_integer:1;
+    bool bounded_integer:1;
     unsigned int bounded_integer_type_width:23;
     unsigned int bounded_integer_type_representation:2;
     unsigned int bounded_integer_type_overflow:2;
diff --git a/src/Concrete_Expression.inlines.hh b/src/Concrete_Expression.inlines.hh
index 2c5ce6a..29566d1 100644
--- a/src/Concrete_Expression.inlines.hh
+++ b/src/Concrete_Expression.inlines.hh
@@ -37,7 +37,7 @@ Concrete_Expression_Type
                   const Bounded_Integer_Type_Representation representation,
                   const Bounded_Integer_Type_Overflow overflow) {
   Implementation impl;
-  impl.bounded_integer = 1U;
+  impl.bounded_integer = true;
   impl.bounded_integer_type_width = width;
   impl.bounded_integer_type_representation = representation;
   impl.bounded_integer_type_overflow = overflow;
@@ -50,7 +50,7 @@ inline Concrete_Expression_Type
 Concrete_Expression_Type
 ::floating_point(const Floating_Point_Format format) {
   Implementation impl;
-  impl.bounded_integer = 0;
+  impl.bounded_integer = false;
   impl.floating_point_format = format;
   // Arbitrary choices to ensure determinism.
   impl.bounded_integer_type_width = BITS_128;
@@ -61,12 +61,12 @@ Concrete_Expression_Type
 
 inline bool
 Concrete_Expression_Type::is_bounded_integer() const {
-  return impl.bounded_integer != 0;
+  return impl.bounded_integer;
 }
 
 inline bool
 Concrete_Expression_Type::is_floating_point() const {
-  return impl.bounded_integer == 0;
+  return !impl.bounded_integer;
 }
 
 inline Bounded_Integer_Type_Width




More information about the PPL-devel mailing list