gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/as_object.h server/asobj...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ChangeLog server/as_object.h server/asobj...
Date: Tue, 20 Mar 2007 15:57:56 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     07/03/20 15:57:56

Modified files:
        .              : ChangeLog 
        server         : as_object.h 
        server/asobj   : NetStreamFfmpeg.cpp 
        testsuite/actionscript.all: LocalConnection.as 

Log message:
                * server/as_object.h: Remove the ensureType for raw pointers in 
favour
                of the one for intrusive pointers; the former is now unused.
                * server/asobj/NetStreamFfmpeg.cpp: Update for changes in 
ensureType.
                * testsuite/actionscript.all/LocalConnection.as: Expect two more
                successes.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2645&r2=1.2646
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_object.h?cvsroot=gnash&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/LocalConnection.as?cvsroot=gnash&r1=1.10&r2=1.11

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2645
retrieving revision 1.2646
diff -u -b -r1.2645 -r1.2646
--- ChangeLog   20 Mar 2007 15:51:49 -0000      1.2645
+++ ChangeLog   20 Mar 2007 15:57:56 -0000      1.2646
@@ -76,6 +76,11 @@
        the AS stack in the hopes that it magically has a property which might
        be the object that is to be deleted. Instead, traverse the stack using
        delVariable().
+       * server/as_object.h: Remove the ensureType for raw pointers in favour
+       of the one for intrusive pointers; the former is now unused.
+       * server/asobj/NetStreamFfmpeg.cpp: Update for changes in ensureType.
+       * testsuite/actionscript.all/LocalConnection.as: Expect two more
+       successes.
 
 2007-03-19 Sandro Santilli <address@hidden>
 

Index: server/as_object.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_object.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- server/as_object.h  20 Mar 2007 15:01:20 -0000      1.48
+++ server/as_object.h  20 Mar 2007 15:57:56 -0000      1.49
@@ -465,16 +465,16 @@
 };
 
 /// Template which does a dynamic cast for as_object pointers. It throws an
-/// error if the dynamic cast fails.
+/// exception if the dynamic cast fails.
 /// @param T the class to which the obj pointer should be cast.
 /// @param obj the pointer to be cast.
 /// @return If the cast succeeds, the pointer cast to the requested type.
 ///         Otherwise, NULL.
 template <typename T>
-T*
-ensureType (as_object* obj)
+boost::intrusive_ptr<T>
+ensureType (boost::intrusive_ptr<as_object> obj)
 {
-       T* ret = dynamic_cast<T*>(obj);
+       boost::intrusive_ptr<T> ret = boost::dynamic_pointer_cast<T>(obj);
 
        if (!ret) {
                std::string     target = typeid(T).name(),
@@ -507,30 +507,6 @@
         return ret;
 }
 
-/// Template which does a dynamic cast for as_object pointers. It throws an
-/// error if the dynamic cast fails.
-/// @param T the class to which the obj pointer should be cast.
-/// @param obj the pointer to be cast.
-/// @return If the cast succeeds, the pointer cast to the requested type.
-///         Otherwise, NULL.
-template <typename T>
-boost::intrusive_ptr<T>
-ensureType (boost::intrusive_ptr<as_object> obj)
-{
-       boost::intrusive_ptr<T> ret = boost::dynamic_pointer_cast<T>(obj);
-
-       // This path is fairly unlikely, so it's a potential  __builtin_expect.
-       if (!ret) {
-               std::ostringstream stream;
-               stream  << "builtin method or gettersetter for " 
-                       << typeid(T).name() << " called from "
-                       << typeid(obj).name() << " instance.";
-
-               throw ActionException(stream.str());
-        }
-        return ret;
-}
-
 
 
 } // namespace gnash

Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- server/asobj/NetStreamFfmpeg.cpp    9 Mar 2007 14:38:29 -0000       1.21
+++ server/asobj/NetStreamFfmpeg.cpp    20 Mar 2007 15:57:56 -0000      1.22
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: NetStreamFfmpeg.cpp,v 1.21 2007/03/09 14:38:29 tgc Exp $ */
+/* $Id: NetStreamFfmpeg.cpp,v 1.22 2007/03/20 15:57:56 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -156,7 +156,7 @@
 {
 
        NetStreamFfmpeg* ns = static_cast<NetStreamFfmpeg*>(opaque);
-       NetConnection* nc = ns->_netCon;
+       boost::intrusive_ptr<NetConnection> nc = ns->_netCon;
 
        size_t ret = nc->read(static_cast<void*>(buf), buf_size);
        ns->inputPos += ret;
@@ -169,7 +169,7 @@
 NetStreamFfmpeg::seekMedia(void *opaque, offset_t offset, int whence){
 
        NetStreamFfmpeg* ns = static_cast<NetStreamFfmpeg*>(opaque);
-       NetConnection* nc = ns->_netCon;
+       boost::intrusive_ptr<NetConnection> nc = ns->_netCon;
 
 
        // Offset is absolute new position in the file
@@ -236,7 +236,7 @@
 NetStreamFfmpeg::startPlayback(NetStreamFfmpeg* ns)
 {
 
-       NetConnection* nc = ns->_netCon;
+       boost::intrusive_ptr<NetConnection> nc = ns->_netCon;
        assert(nc);
 
        // Pass stuff from/to the NetConnection object.

Index: testsuite/actionscript.all/LocalConnection.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/LocalConnection.as,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- testsuite/actionscript.all/LocalConnection.as       20 Mar 2007 14:55:09 
-0000      1.10
+++ testsuite/actionscript.all/LocalConnection.as       20 Mar 2007 15:57:56 
-0000      1.11
@@ -22,7 +22,7 @@
 // compile this test case with Ming makeswf, and then
 // execute it like this gnash -1 -r 0 -v out.swf
 
-rcsid="$Id: LocalConnection.as,v 1.10 2007/03/20 14:55:09 strk Exp $";
+rcsid="$Id: LocalConnection.as,v 1.11 2007/03/20 15:57:56 bjacques Exp $";
 
 #include "dejagnu.as"
 
@@ -86,8 +86,8 @@
 var ret = tmp.connect("lc_test");
 
 // There's no such 'getname' method of LocalConnection !!!
-xcheck_equals(typeof(tmp.getname), 'undefined');
-xcheck_equals(typeof(tmp.getName), 'undefined');
+check_equals(typeof(tmp.getname), 'undefined');
+check_equals(typeof(tmp.getName), 'undefined');
 
 // NOTE: This test will fail if a shared memory segment of the same
 // name exists. So the first time it'll pass, then it'll fail.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]