tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r895954 - in /tuscany/sca-cpp/trunk: kernel/value.hpp modules/python/eval.hpp modules/scheme/primitive.hpp
Date Tue, 05 Jan 2010 09:17:05 GMT
Author: jsdelfino
Date: Tue Jan  5 09:17:04 2010
New Revision: 895954

URL: http://svn.apache.org/viewvc?rev=895954&view=rev
Log:
Minor cleanup, removed unused poolptr and char value types.

Modified:
    tuscany/sca-cpp/trunk/kernel/value.hpp
    tuscany/sca-cpp/trunk/modules/python/eval.hpp
    tuscany/sca-cpp/trunk/modules/scheme/primitive.hpp

Modified: tuscany/sca-cpp/trunk/kernel/value.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/kernel/value.hpp?rev=895954&r1=895953&r2=895954&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/kernel/value.hpp (original)
+++ tuscany/sca-cpp/trunk/kernel/value.hpp Tue Jan  5 09:17:04 2010
@@ -93,7 +93,7 @@
 public:
 
     enum ValueType {
-        Undefined, Symbol, String, List, Number, Bool, Char, Lambda, Ptr, PoolPtr
+        Undefined, Symbol, String, List, Number, Bool, Lambda, Ptr
     };
 
     value() : type(value::Undefined) {
@@ -119,12 +119,8 @@
             num() = v.num();
         case value::Bool:
             boo() = v.boo();
-        case value::Char:
-            chr() = v.chr();
         case value::Ptr:
             ptr() = v.ptr();
-        case value::PoolPtr:
-            poolptr() = v.poolptr();
         default:
             break;
         }
@@ -185,25 +181,11 @@
         debug_watchValue();
     }
 
-    value(const char chr) : type(value::Char), data(vdata(result(chr))) {
-        debug_inc(countValues);
-        debug_inc(countVValues);
-        debug_watchValue();
-    }
-
-#ifdef _GC_REFCOUNT
     value(const gc_ptr<value> ptr) : type(value::Ptr), data(vdata(result(ptr))) {
         debug_inc(countValues);
         debug_inc(countVValues);
         debug_watchValue();
     }
-#endif
-
-    value(const gc_ptr<value> ptr) : type(value::PoolPtr), data(vdata(result(ptr)))
{
-        debug_inc(countValues);
-        debug_inc(countVValues);
-        debug_watchValue();
-    }
 
     value(const failable<value>& m) : type(value::List),
         data(vdata(result(hasContent(m)? mklist<value>(content(m)) : mklist<value>(value(),
reason(m))))) {
@@ -236,12 +218,8 @@
             num() = v.num();
         case value::Bool:
             boo() = v.boo();
-        case value::Char:
-            chr() = v.chr();
         case value::Ptr:
             ptr() = v.ptr();
-        case value::PoolPtr:
-            poolptr() = v.poolptr();
         default:
             break;
         }
@@ -272,12 +250,8 @@
             return num()() == (double)v;
         case value::Bool:
             return boo()() == (bool)v;
-        case value::Char:
-            return chr()() == (char)v;
         case value::Ptr:
             return v.type == value::Ptr && ptr()() == v.ptr()();
-        case value::PoolPtr:
-            return v.type == value::PoolPtr && poolptr()() == v.poolptr()();
         default:
             return false;
         }
@@ -296,8 +270,6 @@
             return boo()() < (bool)v;
         case value::Number:
             return num()() < (double)v;
-        case value::Char:
-            return chr()() < (char)v;
         default:
             return false;
         }
@@ -316,8 +288,6 @@
             return boo()() > (bool)v;
         case value::Number:
             return num()() > (double)v;
-        case value::Char:
-            return chr()() > (char)v;
         default:
             return false;
         }
@@ -339,11 +309,6 @@
         }
         case value::Bool:
             return boo()()? trueString : falseString;
-        case value::Char: {
-            ostringstream os;
-            os << chr()();
-            return tuscany::str(os);
-        }
         default:
             return emptyString;
         }
@@ -358,8 +323,6 @@
             return (double)num()();
         case value::Bool:
             return boo()()? 1.0 : 0.0;
-        case value::Char:
-            return (double)chr()();
         default:
             return 0.0;
         }
@@ -374,8 +337,6 @@
             return (int)num()();
         case value::Bool:
             return boo()()? 1 : 0;
-        case value::Char:
-            return (int)chr()();
         default:
             return 0;
         }
@@ -390,38 +351,14 @@
             return (int)num()() != 0;
         case value::Bool:
             return boo()();
-        case value::Char:
-            return (int)chr()() != 0;
-        default:
-            return 0;
-        }
-    }
-
-    operator const char() const {
-        switch(type) {
-        case value::Symbol:
-        case value::String:
-            return 0;
-        case value::Number:
-            return (char)num()();
-        case value::Bool:
-            return (char)boo()();
-        case value::Char:
-            return chr()();
         default:
             return 0;
         }
     }
 
-#ifdef _GC_REFCOUNT
     operator const gc_ptr<value>() const {
         return ptr()();
     }
-#endif
-
-    operator const gc_ptr<value>() const {
-        return poolptr()();
-    }
 
     operator const list<value>() const {
         return lst()();
@@ -452,18 +389,10 @@
         return vdata<bool()> ();
     }
 
-    lambda<char()>& chr() const {
-        return vdata<char()> ();
-    }
-
     lambda<gc_ptr<value>()>& ptr() const {
         return vdata<gc_ptr<value>()> ();
     }
 
-    lambda<gc_ptr<value>()>& poolptr() const {
-        return vdata<gc_ptr<value>()> ();
-    }
-
     lambda<string()>& str() const {
         return vdata<string()> ();
     }
@@ -536,20 +465,12 @@
             return out << "true";
         else
             return out << "false";
-    case value::Char:
-        return out << v.chr()();
     case value::Ptr: {
         const gc_ptr<value> p =  v.ptr()();
         if (p == gc_ptr<value>(NULL))
             return out << "gc_ptr::null";
         return out << "gc_ptr::" << p;
     }
-    case value::PoolPtr: {
-        const gc_ptr<value> p =  v.poolptr()();
-        if (p == gc_ptr<value>(NULL))
-            return out << "pool_ptr::null";
-        return out << "pool_ptr::" << p;
-    }
     default:
         return out << "undefined";
     }
@@ -612,13 +533,6 @@
 }
 
 /**
- * Returns true if a value is a character.
- */
-const bool isChar(const value& v) {
-    return type(v) == value::Char;
-}
-
-/**
  * Returns true if a value is a pointer.
  */
 const bool isPtr(const value& v) {
@@ -626,13 +540,6 @@
 }
 
 /**
- * Returns true if a value is a pooled pointer.
- */
-const bool isPoolPtr(const value& v) {
-    return type(v) == value::PoolPtr;
-}
-
-/**
  * Returns true if a value is a tagged list.
  */
 const bool isTaggedList(const value& exp, value tag) {

Modified: tuscany/sca-cpp/trunk/modules/python/eval.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/eval.hpp?rev=895954&r1=895953&r2=895954&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/python/eval.hpp Tue Jan  5 09:17:04 2010
@@ -150,10 +150,6 @@
         return PyFloat_FromDouble((double)v);
     case value::Bool:
         return (bool)v? Py_True : Py_False;
-    case value::Char:
-        return PyInt_FromLong((long)((char)v));
-    case value::Ptr:
-        return NULL;
     default:
         return NULL;
     }

Modified: tuscany/sca-cpp/trunk/modules/scheme/primitive.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/scheme/primitive.hpp?rev=895954&r1=895953&r2=895954&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/scheme/primitive.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/scheme/primitive.hpp Tue Jan  5 09:17:04 2010
@@ -189,8 +189,6 @@
         return true;
     if(isBool(exp))
         return true;
-    if(isChar(exp))
-        return true;
     if(isLambda(exp))
         return true;
     return false;



Mime
View raw message