Author: toshok
Date: 2007-06-07 00:16:45 -0400 (Thu, 07 Jun 2007)
New Revision: 78813
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/brush.cpp
trunk/moon/src/runtime.cpp
trunk/moon/src/runtime.h
Log:
* runtime.h, runtime.cpp: add a special void* ctor to value so
pointers aren't silently converted to bool (bad c++, bad!), and
have that ctor output a warning message to the console, along with
the likely cause.
* brush.cpp: need to deref the Color* in the Value ctor.
2007-06-06 Chris Toshok <[EMAIL PROTECTED]>
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-06-07 04:03:19 UTC (rev 78812)
+++ trunk/moon/src/ChangeLog 2007-06-07 04:16:45 UTC (rev 78813)
@@ -1,5 +1,14 @@
2007-06-06 Chris Toshok <[EMAIL PROTECTED]>
+ * runtime.h, runtime.cpp: add a special void* ctor to value so
+ pointers aren't silently converted to bool (bad c++, bad!), and
+ have that ctor output a warning message to the console, along with
+ the likely cause.
+
+ * brush.cpp: need to deref the Color* in the Value ctor.
+
+2007-06-06 Chris Toshok <[EMAIL PROTECTED]>
+
* animation.cpp: new dump of the animation stuff. this is much
closer in spirit and implementation to that of WPF's
timing/animation system. it's not perfect yet, but it's much,
Modified: trunk/moon/src/brush.cpp
===================================================================
--- trunk/moon/src/brush.cpp 2007-06-07 04:03:19 UTC (rev 78812)
+++ trunk/moon/src/brush.cpp 2007-06-07 04:16:45 UTC (rev 78813)
@@ -88,7 +88,7 @@
void
solid_color_brush_set_color (SolidColorBrush *solid_color_brush, Color *color)
{
- solid_color_brush->SetValue (SolidColorBrush::ColorProperty, Value
(color));
+ solid_color_brush->SetValue (SolidColorBrush::ColorProperty, Value
(*color));
}
SolidColorBrush*
Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp 2007-06-07 04:03:19 UTC (rev 78812)
+++ trunk/moon/src/runtime.cpp 2007-06-07 04:16:45 UTC (rev 78813)
@@ -161,6 +161,11 @@
u.s= g_strdup (s);
}
+Value::Value (void*)
+{
+ g_warning ("This is not what you want to do here. You're passing an
unrecognized pointer type to Value. usually this means you need to deref a
structured type and hitting the void* ctor");
+}
+
Value::~Value ()
{
if (k == STRING)
Modified: trunk/moon/src/runtime.h
===================================================================
--- trunk/moon/src/runtime.h 2007-06-07 04:03:19 UTC (rev 78812)
+++ trunk/moon/src/runtime.h 2007-06-07 04:16:45 UTC (rev 78813)
@@ -229,6 +229,7 @@
Value (Point pt);
Value (Rect rect);
Value (const char* s);
+ Value (void* v); // this is for finding improper uses of the Value
ctors - do NOT use this.
~Value ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches