src/Types.h
changeset 172 48cffae8c9e0
parent 168 4d0fff61d65e
child 184 387d76b1e981
     1.1 --- a/src/Types.h	Sun Aug 12 13:22:56 2012 -0700
     1.2 +++ b/src/Types.h	Sun Aug 12 20:48:49 2012 -0700
     1.3 @@ -301,7 +301,7 @@
     1.4      PrimitiveType type_;
     1.5      union {
     1.6          int i_;
     1.7 -        bool b_;
     1.8 +        float f_;
     1.9      };
    1.10  
    1.11    public:
    1.12 @@ -311,10 +311,10 @@
    1.13          b.i_ = i;
    1.14          return b;
    1.15      }
    1.16 -    static BoxedPrimitive Bool(bool v) {
    1.17 +    static BoxedPrimitive Float(float f) {
    1.18          BoxedPrimitive b;
    1.19 -        b.type_ = PrimitiveType_Bool;
    1.20 -        b.b_ = v;
    1.21 +        b.type_ = PrimitiveType_Float;
    1.22 +        b.f_ = f;
    1.23          return b;
    1.24      }
    1.25  
    1.26 @@ -325,9 +325,9 @@
    1.27          assert(type() == PrimitiveType_Int32);
    1.28          return i_;
    1.29      }
    1.30 -    bool toBool() const {
    1.31 -        assert(type() == PrimitiveType_Bool);
    1.32 -        return b_;
    1.33 +    float toFloat() const {
    1.34 +        assert(type() == PrimitiveType_Float);
    1.35 +        return f_;
    1.36      }
    1.37  };
    1.38