Author: jbevain
Date: 2007-10-11 11:43:00 -0400 (Thu, 11 Oct 2007)
New Revision: 87337
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/collection.cpp
Log:
2007-10-11 Jb Evain <[EMAIL PROTECTED]>
* collection.cpp: replace dynamic_casts with plain casts
as per Miguel suggestion.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-10-11 14:53:46 UTC (rev 87336)
+++ trunk/moon/src/ChangeLog 2007-10-11 15:43:00 UTC (rev 87337)
@@ -1,5 +1,10 @@
2007-10-11 Jb Evain <[EMAIL PROTECTED]>
+ * collection.cpp: replace dynamic_casts with plain casts
+ as per Miguel suggestion.
+
+2007-10-11 Jb Evain <[EMAIL PROTECTED]>
+
* collection.cpp|h: add, implement and expose the
MediaAttributeCollection::GetItemByName method.
Modified: trunk/moon/src/collection.cpp
===================================================================
--- trunk/moon/src/collection.cpp 2007-10-11 14:53:46 UTC (rev 87336)
+++ trunk/moon/src/collection.cpp 2007-10-11 15:43:00 UTC (rev 87337)
@@ -663,9 +663,9 @@
static bool
media_attribute_by_name_finder (List::Node *node, void *data)
{
- Collection::Node *cn = dynamic_cast<Collection::Node *> (node);
- MediaAttribute *attribute = dynamic_cast<MediaAttribute *> (cn->obj);
- const char *name = reinterpret_cast<const char *> (data);
+ Collection::Node *cn = (Collection::Node *) node;
+ MediaAttribute *attribute = (MediaAttribute *) cn->obj;
+ const char *name = (const char *) data;
Value *value = attribute->GetValue (DependencyObject::NameProperty);
if (!value)
@@ -675,13 +675,13 @@
}
MediaAttribute *
-MediaAttributeCollection::GetItemByName (const char *attribute_name)
+MediaAttributeCollection::GetItemByName (const char *name)
{
- char *name = (char *) attribute_name;
- List::Node *node = list->Find (media_attribute_by_name_finder, name);
- Collection::Node *cn = dynamic_cast<Collection::Node *> (node);
+ Collection::Node *cn = (Collection::Node *) list->Find
(media_attribute_by_name_finder, (char *) name);
+ if (!cn)
+ return NULL;
- return dynamic_cast<MediaAttribute *> (cn->obj);
+ return (MediaAttribute *) cn->obj;
}
Collection *
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches