Author: rolf
Date: 2007-06-19 06:22:42 -0400 (Tue, 19 Jun 2007)
New Revision: 80121

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/value.cpp
   trunk/moon/src/value.h
   trunk/moon/src/value.h.in
Log:

        * value.cpp|h|in: Inline the non-DependencyObject
        As* functions as well.

2007-06-19  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>


Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-06-19 10:10:15 UTC (rev 80120)
+++ trunk/moon/src/ChangeLog    2007-06-19 10:22:42 UTC (rev 80121)
@@ -1,4 +1,9 @@
 2007-06-19  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
+
+       * value.cpp|h|in: Inline the non-DependencyObject
+       As* functions as well.
+
+2007-06-19  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
        
        * typegen.cs: Removed some dead code.
        * value.cpp.in: Deleted, not needed anymore.

Modified: trunk/moon/src/value.cpp
===================================================================
--- trunk/moon/src/value.cpp    2007-06-19 10:10:15 UTC (rev 80120)
+++ trunk/moon/src/value.cpp    2007-06-19 10:22:42 UTC (rev 80121)
@@ -260,25 +260,3 @@
        }
 }
 
-bool            Value::AsBool () { checked_get_exact (Type::BOOL, false, 
(bool)u.i32); }
-double          Value::AsDouble () { checked_get_exact (Type::DOUBLE, 0.0, 
u.d); }
-guint64         Value::AsUint64 () { checked_get_exact (Type::UINT64, 0, 
u.ui64); }
-gint64          Value::AsInt64 () { checked_get_exact (Type::INT64, 0, u.i64); 
}
-gint32          Value::AsInt32 () { checked_get_exact (Type::INT32, 0, u.i32); 
}
-Color*          Value::AsColor () { checked_get_exact (Type::COLOR, NULL, 
u.color); }
-Point*          Value::AsPoint () { checked_get_exact (Type::POINT, NULL, 
u.point); }
-Rect*           Value::AsRect  () { checked_get_exact (Type::RECT, NULL, 
u.rect); }
-char*           Value::AsString () { checked_get_exact (Type::STRING, NULL, 
u.s); }
-PointArray*     Value::AsPointArray () { checked_get_exact (Type::POINT_ARRAY, 
NULL, u.point_array); }
-DoubleArray*    Value::AsDoubleArray () { checked_get_exact 
(Type::DOUBLE_ARRAY, NULL, u.double_array); }
-
-RepeatBehavior* Value::AsRepeatBehavior () { checked_get_exact 
(Type::REPEATBEHAVIOR, NULL, u.repeat); }
-Duration*       Value::AsDuration () { checked_get_exact (Type::DURATION, 
NULL, u.duration); }
-KeyTime*        Value::AsKeyTime () { checked_get_exact (Type::KEYTIME, NULL, 
u.keytime); }
-Matrix*         Value::AsMatrix () { checked_get_exact (Type::MATRIX, NULL, 
u.matrix); }
-
-/* nullable primitives (all but bool) */
-double*         Value::AsNullableDouble () { checked_get_exact (Type::DOUBLE, 
NULL, &u.d); }
-guint64*        Value::AsNullableUint64 () { checked_get_exact (Type::UINT64, 
NULL, &u.ui64); }
-gint64*         Value::AsNullableInt64 () { checked_get_exact (Type::INT64, 
NULL, &u.i64); }
-gint32*         Value::AsNullableInt32 () { checked_get_exact (Type::INT32, 
NULL, &u.i32); }

Modified: trunk/moon/src/value.h
===================================================================
--- trunk/moon/src/value.h      2007-06-19 10:10:15 UTC (rev 80120)
+++ trunk/moon/src/value.h      2007-06-19 10:22:42 UTC (rev 80121)
@@ -179,27 +179,29 @@
                return true;
        }
 
-       bool            AsBool ();
-       double          AsDouble ();
-       guint64         AsUint64 ();
-       gint64          AsInt64 ();
-       gint32          AsInt32 ();
 
-       double*         AsNullableDouble ();
-       guint64*        AsNullableUint64 ();
-       gint64*         AsNullableInt64 ();
-       gint32*         AsNullableInt32 ();
+       bool            AsBool ()       { checked_get_exact (Type::BOOL, false, 
(bool)u.i32); }
+       double          AsDouble ()     { checked_get_exact (Type::DOUBLE, 0.0, 
u.d); }
+       guint64         AsUint64 ()     { checked_get_exact (Type::UINT64, 0, 
u.ui64); }
+       gint64          AsInt64 ()      { checked_get_exact (Type::INT64, 0, 
u.i64); }
+       gint32          AsInt32 ()      { checked_get_exact (Type::INT32, 0, 
u.i32); }
+       Color*          AsColor ()      { checked_get_exact (Type::COLOR, NULL, 
u.color); }
+       Point*          AsPoint ()      { checked_get_exact (Type::POINT, NULL, 
u.point); }
+       Rect*           AsRect ()       { checked_get_exact (Type::RECT, NULL, 
u.rect); }
+       char*           AsString ()     { checked_get_exact (Type::STRING, 
NULL, u.s); }
+       PointArray*     AsPointArray () { checked_get_exact (Type::POINT_ARRAY, 
NULL, u.point_array); }
+       DoubleArray*    AsDoubleArray ()        { checked_get_exact 
(Type::DOUBLE_ARRAY, NULL, u.double_array); }
+       
+       RepeatBehavior* AsRepeatBehavior ()     { checked_get_exact 
(Type::REPEATBEHAVIOR, NULL, u.repeat); }
+       Duration*       AsDuration ()   { checked_get_exact (Type::DURATION, 
NULL, u.duration); }
+       KeyTime*        AsKeyTime ()    { checked_get_exact (Type::KEYTIME, 
NULL, u.keytime); }
+       Matrix*         AsMatrix ()     { checked_get_exact (Type::MATRIX, 
NULL, u.matrix); }
 
-       Color*          AsColor ();
-       Point*          AsPoint ();
-       Rect*           AsRect  ();
-       char*           AsString ();
-       RepeatBehavior* AsRepeatBehavior ();
-       Duration*       AsDuration ();
-       KeyTime*        AsKeyTime ();
-       PointArray*     AsPointArray ();
-       DoubleArray*    AsDoubleArray ();
-       Matrix*         AsMatrix ();
+       /* nullable primitives (all but bool) */
+       double*         AsNullableDouble ()     { checked_get_exact 
(Type::DOUBLE, NULL, &u.d); }
+       guint64*        AsNullableUint64 ()     { checked_get_exact 
(Type::UINT64, NULL, &u.ui64); }
+       gint64*         AsNullableInt64 ()      { checked_get_exact 
(Type::INT64, NULL, &u.i64); }
+       gint32*         AsNullableInt32 ()      { checked_get_exact 
(Type::INT32, NULL, &u.i32); }
 
        DependencyObject*              AsDependencyObject () { 
checked_get_subclass (Type::DEPENDENCY_OBJECT, DependencyObject) }
        Animation*                     AsAnimation () { checked_get_subclass 
(Type::ANIMATION, Animation) }

Modified: trunk/moon/src/value.h.in
===================================================================
--- trunk/moon/src/value.h.in   2007-06-19 10:10:15 UTC (rev 80120)
+++ trunk/moon/src/value.h.in   2007-06-19 10:22:42 UTC (rev 80121)
@@ -73,27 +73,29 @@
                return true;
        }
 
-       bool            AsBool ();
-       double          AsDouble ();
-       guint64         AsUint64 ();
-       gint64          AsInt64 ();
-       gint32          AsInt32 ();
 
-       double*         AsNullableDouble ();
-       guint64*        AsNullableUint64 ();
-       gint64*         AsNullableInt64 ();
-       gint32*         AsNullableInt32 ();
+       bool            AsBool ()       { checked_get_exact (Type::BOOL, false, 
(bool)u.i32); }
+       double          AsDouble ()     { checked_get_exact (Type::DOUBLE, 0.0, 
u.d); }
+       guint64         AsUint64 ()     { checked_get_exact (Type::UINT64, 0, 
u.ui64); }
+       gint64          AsInt64 ()      { checked_get_exact (Type::INT64, 0, 
u.i64); }
+       gint32          AsInt32 ()      { checked_get_exact (Type::INT32, 0, 
u.i32); }
+       Color*          AsColor ()      { checked_get_exact (Type::COLOR, NULL, 
u.color); }
+       Point*          AsPoint ()      { checked_get_exact (Type::POINT, NULL, 
u.point); }
+       Rect*           AsRect ()       { checked_get_exact (Type::RECT, NULL, 
u.rect); }
+       char*           AsString ()     { checked_get_exact (Type::STRING, 
NULL, u.s); }
+       PointArray*     AsPointArray () { checked_get_exact (Type::POINT_ARRAY, 
NULL, u.point_array); }
+       DoubleArray*    AsDoubleArray ()        { checked_get_exact 
(Type::DOUBLE_ARRAY, NULL, u.double_array); }
+       
+       RepeatBehavior* AsRepeatBehavior ()     { checked_get_exact 
(Type::REPEATBEHAVIOR, NULL, u.repeat); }
+       Duration*       AsDuration ()   { checked_get_exact (Type::DURATION, 
NULL, u.duration); }
+       KeyTime*        AsKeyTime ()    { checked_get_exact (Type::KEYTIME, 
NULL, u.keytime); }
+       Matrix*         AsMatrix ()     { checked_get_exact (Type::MATRIX, 
NULL, u.matrix); }
 
-       Color*          AsColor ();
-       Point*          AsPoint ();
-       Rect*           AsRect  ();
-       char*           AsString ();
-       RepeatBehavior* AsRepeatBehavior ();
-       Duration*       AsDuration ();
-       KeyTime*        AsKeyTime ();
-       PointArray*     AsPointArray ();
-       DoubleArray*    AsDoubleArray ();
-       Matrix*         AsMatrix ();
+       /* nullable primitives (all but bool) */
+       double*         AsNullableDouble ()     { checked_get_exact 
(Type::DOUBLE, NULL, &u.d); }
+       guint64*        AsNullableUint64 ()     { checked_get_exact 
(Type::UINT64, NULL, &u.ui64); }
+       gint64*         AsNullableInt64 ()      { checked_get_exact 
(Type::INT64, NULL, &u.i64); }
+       gint32*         AsNullableInt32 ()      { checked_get_exact 
(Type::INT32, NULL, &u.i32); }
 
 /*DO_AS*/
   

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to