gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/xml.cpp server/aso...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/asobj/xml.cpp server/aso...
Date: Wed, 04 Apr 2007 09:02:10 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/04/04 09:02:10

Modified files:
        .              : ChangeLog 
        server/asobj   : xml.cpp xmlnode.cpp 
        testsuite/actionscript.all: XML.as 

Log message:
                * server/asobj/xml.cpp: remove debugging lines, return undefined
                  from getBytesLoaded,getBytesTotal if the XML was not loaded.
                * server/asobj/xmlnode.cpp: remove debugging lines.
                * testsuite/actionscript.all/XML.as: all current tests pass now
                  (but we need more tests);

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2774&r2=1.2775
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xml.cpp?cvsroot=gnash&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xmlnode.cpp?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/XML.as?cvsroot=gnash&r1=1.20&r2=1.21

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2774
retrieving revision 1.2775
diff -u -b -r1.2774 -r1.2775
--- ChangeLog   4 Apr 2007 08:46:41 -0000       1.2774
+++ ChangeLog   4 Apr 2007 09:02:10 -0000       1.2775
@@ -1,5 +1,13 @@
 2007-04-04 Sandro Santilli <address@hidden>
 
+       * server/asobj/xml.cpp: remove debugging lines, return undefined
+         from getBytesLoaded,getBytesTotal if the XML was not loaded.
+       * server/asobj/xmlnode.cpp: remove debugging lines.
+       * testsuite/actionscript.all/XML.as: all current tests pass now
+         (but we need more tests);
+
+2007-04-04 Sandro Santilli <address@hidden>
+
        * server/asobj/xmlnode.cpp (stringify): stop feeding NULL 
          pointers to output operators !
        * server/asobj/xml.cpp (xml_new): support a string as first

Index: server/asobj/xml.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xml.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- server/asobj/xml.cpp        4 Apr 2007 08:46:42 -0000       1.30
+++ server/asobj/xml.cpp        4 Apr 2007 09:02:10 -0000       1.31
@@ -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: xml.cpp,v 1.30 2007/04/04 08:46:42 strk Exp $ */
+/* $Id: xml.cpp,v 1.31 2007/04/04 09:02:10 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -89,7 +89,7 @@
     _bytes_loaded(0),
     _bytes_total(0)
 {
-    GNASH_REPORT_FUNCTION;
+    //GNASH_REPORT_FUNCTION;
 #ifdef DEBUG_MEMORY_ALLOCATION
     log_msg("Creating XML data at %p \n", this);
 #endif
@@ -105,10 +105,10 @@
     _bytes_loaded(0),
     _bytes_total(0)
 {
-    GNASH_REPORT_FUNCTION;
-//#ifdef DEBUG_MEMORY_ALLOCATION
+    //GNASH_REPORT_FUNCTION;
+#ifdef DEBUG_MEMORY_ALLOCATION
     log_msg("Creating XML data at %p \n", this);
-//#endif
+#endif
     parseXML(xml_in);
 }
 
@@ -275,7 +275,8 @@
 bool
 XML::parseDoc(xmlDocPtr document, bool mem)
 {
-    GNASH_REPORT_FUNCTION;  
+    //GNASH_REPORT_FUNCTION;  
+
     xmlNodePtr cur;
 
     if (document == 0) {
@@ -292,9 +293,6 @@
         _children.push_back(child);
     }  
 
-    log_msg("parseDoc: %u childrens for XML %p after parsing", 
_children.size(), (void*)this);
-
-    _loaded = true;
     return true;
 }
 
@@ -303,9 +301,9 @@
 bool
 XML::parseXML(const std::string& xml_in)
 {
-    GNASH_REPORT_FUNCTION;
+    //GNASH_REPORT_FUNCTION;
 
-    log_msg("Parse XML from memory: %s", xml_in.c_str());
+    //log_msg("Parse XML from memory: %s", xml_in.c_str());
 
     if (xml_in.empty()) {
         log_error("XML data is empty!");
@@ -316,7 +314,7 @@
     //dump_memory_stats(__FUNCTION__, __LINE__, "before xmlParseMemory");
 #endif
 
-    _bytes_total = _bytes_loaded = xml_in.size();
+    //_bytes_total = _bytes_loaded = xml_in.size();
     
     bool ret=true;
 
@@ -375,6 +373,7 @@
     xmlCleanupParser();
     xmlFreeDoc(_doc);
     xmlMemoryDump();
+    _loaded = true;
 
     onLoadEvent(true);
 
@@ -564,27 +563,6 @@
     o.init_member("send", new builtin_function(xml_send));
     o.init_member("sendAndLoad", new builtin_function(xml_sendandload));
 
-    // Properties
-
-#if 0
-    boost::intrusive_ptr<builtin_function> gettersetter;
-
-    gettersetter = new builtin_function(&xml_nodename, NULL);
-    o.init_property("nodeName", *gettersetter, *gettersetter);
-
-    gettersetter = new builtin_function(&xml_nodevalue, NULL);
-    o.init_property("nodeValue", *gettersetter, *gettersetter);
-
-    gettersetter = new builtin_function(&xml_firstchild, NULL);
-    o.init_property("firstChild", *gettersetter, *gettersetter);
-
-    gettersetter = new builtin_function(&xml_lastchild, NULL);
-    o.init_property("lastChild", *gettersetter, *gettersetter);
-
-    gettersetter = new builtin_function(&xml_childnodes, NULL);
-    o.init_property("childNodes", *gettersetter, *gettersetter);
-#endif
-
 }
 
 static as_object*
@@ -738,13 +716,27 @@
 as_value xml_getbytesloaded(const fn_call& fn)
 {
     boost::intrusive_ptr<XML> ptr = ensureType<XML>(fn.this_ptr);
+    if ( ptr->loaded() )
+       {
     return as_value(ptr->getBytesLoaded());
+    }
+       else
+       {
+               return as_value();
+    }
 }
 
 as_value xml_getbytestotal(const fn_call& fn)
 {
     boost::intrusive_ptr<XML> ptr = ensureType<XML>(fn.this_ptr);
+    if ( ptr->loaded() )
+       {
     return as_value(ptr->getBytesTotal());
+       }
+       else
+       {
+               return as_value();
+       }
 }
 
 as_value xml_parsexml(const fn_call& fn)

Index: server/asobj/xmlnode.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xmlnode.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- server/asobj/xmlnode.cpp    4 Apr 2007 08:46:42 -0000       1.22
+++ server/asobj/xmlnode.cpp    4 Apr 2007 09:02:10 -0000       1.23
@@ -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: xmlnode.cpp,v 1.22 2007/04/04 08:46:42 strk Exp $ */
+/* $Id: xmlnode.cpp,v 1.23 2007/04/04 09:02:10 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -169,7 +169,7 @@
 boost::intrusive_ptr<XMLNode>
 XMLNode::firstChild()
 {
-    GNASH_REPORT_FUNCTION;
+    //GNASH_REPORT_FUNCTION;
        if ( _children.empty() ) return NULL;
        return _children.front();
 }
@@ -342,8 +342,10 @@
 
 //    log_msg("%s: processing for object %s <%p>\n", __PRETTY_FUNCTION__, 
nodename, xml);
 
+#ifdef GNASH_DEBUG
     log_msg("Stringifying node %p with name %s, value %s, %u attributes and %u 
childs",
                     (void*)&xml, nodename, nodevalue, xml._attributes.size(), 
xml._children.size());
+#endif
 
     // Create the beginning of the tag
     if (nodename)
@@ -572,13 +574,13 @@
 static as_value
 xmlnode_tostring(const fn_call& fn)
 {
-    GNASH_REPORT_FUNCTION;
+    //GNASH_REPORT_FUNCTION;
     
     boost::intrusive_ptr<XMLNode> ptr = ensureType<XMLNode>(fn.this_ptr);
     
     std::stringstream ss;
     ptr->toString(ss);
-    log_msg("Stringstream: %s", ss.str().c_str());
+    //log_msg("Stringstream: %s", ss.str().c_str());
 
     return as_value(ss.str());
 }

Index: testsuite/actionscript.all/XML.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/XML.as,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- testsuite/actionscript.all/XML.as   3 Apr 2007 13:22:24 -0000       1.20
+++ testsuite/actionscript.all/XML.as   4 Apr 2007 09:02:10 -0000       1.21
@@ -20,7 +20,7 @@
 // compile this test case with Ming makeswf, and then
 // execute it like this gnash -1 -r 0 -v out.swf
 
-rcsid="$Id: XML.as,v 1.20 2007/04/03 13:22:24 strk Exp $";
+rcsid="$Id: XML.as,v 1.21 2007/04/04 09:02:10 strk Exp $";
 
 #include "dejagnu.as"
 #include "utils.as"
@@ -265,8 +265,8 @@
 // Since we didn't *load* the XML, but we
 // just *parsed* it, expect getBytesLoaded 
 // and getBytesTotal to return undefined
-xcheck_equals(tmp.getBytesLoaded(), undefined);
-xcheck_equals(tmp.getBytesTotal(), undefined);
+check_equals(tmp.getBytesLoaded(), undefined);
+check_equals(tmp.getBytesTotal(), undefined);
 
 if (tmp.getBytesLoaded() == tmp.getBytesTotal()) {
     pass("bytes count are the same");




reply via email to

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