gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-242-gbc73260
Date: Sun, 10 Apr 2011 13:05:59 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  bc73260c53332ee45f11968acb6da4917feea352 (commit)
       via  e840954ed29019068b0171f5a264988a578cd67a (commit)
      from  a6acec8606c4dac4c642ad863d951f278ee3ab5a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=bc73260c53332ee45f11968acb6da4917feea352


commit bc73260c53332ee45f11968acb6da4917feea352
Author: Benjamin Wolsey <address@hidden>
Date:   Sun Apr 10 14:36:21 2011 +0200

    Const correct.

diff --git a/libcore/asobj/XMLNode_as.cpp b/libcore/asobj/XMLNode_as.cpp
index e00ec30..d80a0e9 100644
--- a/libcore/asobj/XMLNode_as.cpp
+++ b/libcore/asobj/XMLNode_as.cpp
@@ -170,7 +170,7 @@ XMLNode_as::childNodes()
 }
 
 bool
-XMLNode_as::hasChildNodes()
+XMLNode_as::hasChildNodes() const
 {
     return !_children.empty();
 }
@@ -295,8 +295,9 @@ XMLNode_as::setAttribute(const std::string& name, const 
std::string& value)
 
 bool
 XMLNode_as::getPrefixForNamespace(const std::string& ns, std::string& prefix)
+    const
 {
-    XMLNode_as* node = this;
+    const XMLNode_as* node = this;
     StringPairs::const_iterator it; 
     StringPairs attrs;
     
@@ -332,8 +333,9 @@ XMLNode_as::getPrefixForNamespace(const std::string& ns, 
std::string& prefix)
 
 void
 XMLNode_as::getNamespaceForPrefix(const std::string& prefix, std::string& ns)
+    const
 {
-    XMLNode_as* node = this;
+    const XMLNode_as* node = this;
     StringPairs::const_iterator it; 
     StringPairs attrs;
     
@@ -359,7 +361,7 @@ XMLNode_as::getNamespaceForPrefix(const std::string& 
prefix, std::string& ns)
 }
 
 bool
-XMLNode_as::extractPrefix(std::string& prefix)
+XMLNode_as::extractPrefix(std::string& prefix) const
 {
     prefix.clear();
     if (_name.empty()) return false;
diff --git a/libcore/asobj/XMLNode_as.h b/libcore/asobj/XMLNode_as.h
index 50e9400..8b251ab 100644
--- a/libcore/asobj/XMLNode_as.h
+++ b/libcore/asobj/XMLNode_as.h
@@ -90,18 +90,20 @@ public:
     /// Set name of this node
     void nodeNameSet(const std::string& name) { _name = name; }
 
-    bool extractPrefix(std::string& prefix);
+    bool extractPrefix(std::string& prefix) const;
 
     /// Set value of this node
     void nodeValueSet(const std::string& value) { _value = value; }
 
     /// Performs a recursive search of node attributes to find a match
-    void getNamespaceForPrefix(const std::string& prefix, std::string& ns);
+    void getNamespaceForPrefix(const std::string& prefix, std::string& ns)
+        const;
 
     /// Performs a recursive search of node attributes to find a match
     //
     /// @return false if no match found.
-    bool getPrefixForNamespace(const std::string& ns, std::string& prefix);
+    bool getPrefixForNamespace(const std::string& ns, std::string& prefix)
+        const;
 
     void setNamespaceURI(const std::string& value) {
         _namespaceURI = value;
@@ -113,7 +115,7 @@ public:
 
     ///  Returns true if the specified node has child nodes; otherwise,
     ///  returns false.
-    bool hasChildNodes();
+    bool hasChildNodes() const;
 
     XMLNode_as* firstChild() const;
     XMLNode_as* lastChild() const;

http://git.savannah.gnu.org/cgit//commit/?id=e840954ed29019068b0171f5a264988a578cd67a


commit e840954ed29019068b0171f5a264988a578cd67a
Author: Benjamin Wolsey <address@hidden>
Date:   Sun Apr 10 14:19:33 2011 +0200

    Cleanup XML_as.
    
    Remove unused functions, remove unnecessary empty lines, update
    documentation.

diff --git a/libcore/asobj/XML_as.cpp b/libcore/asobj/XML_as.cpp
index cd2349a..013b13f 100644
--- a/libcore/asobj/XML_as.cpp
+++ b/libcore/asobj/XML_as.cpp
@@ -17,31 +17,28 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+#include "XMLNode_as.h"
+
+#include <string>
+#include <sstream>
+#include <vector>
+#include <algorithm>
+#include <boost/assign/list_of.hpp>
+#include <boost/algorithm/string/compare.hpp>
+#include <boost/algorithm/string/replace.hpp>
 
 #include "log.h"
-#include "as_function.h" //for as_function
+#include "as_function.h" 
 #include "fn_call.h"
 #include "Global_as.h"
-
 #include "LoadableObject.h"
-#include "XMLNode_as.h"
 #include "XML_as.h"
 #include "NativeFunction.h"
 #include "VM.h"
 #include "namedStrings.h"
 #include "StringPredicates.h"
-#include "GnashException.h" // for ActionException
 #include "Object.h"
 
-#include <string>
-#include <sstream>
-#include <vector>
-#include <algorithm>
-#include <boost/assign/list_of.hpp>
-#include <boost/algorithm/string/compare.hpp>
-#include <boost/algorithm/string/replace.hpp>
-
-
 namespace gnash {
 
 // Forward declarations
@@ -78,7 +75,6 @@ namespace {
 
     void attachXMLProperties(as_object& o);
        void attachXMLInterface(as_object& o);
-
 }
 
 
@@ -150,7 +146,6 @@ void
 XML_as::parseAttribute(XMLNode_as* node, xml_iterator& it,
         const xml_iterator end, Attributes& attributes)
 {
-
     const std::string terminators("\r\t\n >=");
 
     xml_iterator ourend = std::find_first_of(it, end,
@@ -263,13 +258,11 @@ XML_as::parseDocTypeDecl(xml_iterator& it, const 
xml_iterator end)
     it = ourend + 1;
 }
 
-
 void
 XML_as::parseXMLDecl(xml_iterator& it, const xml_iterator end)
 {
     std::string content;
-    if (!parseNodeWithTerminator(it, end, "?>", content))
-    {
+    if (!parseNodeWithTerminator(it, end, "?>", content)) {
         _status = XML_UNTERMINATED_XML_DECL;
         return;
     }
@@ -279,7 +272,6 @@ XML_as::parseXMLDecl(xml_iterator& it, const xml_iterator 
end)
 
     // This is appended to any xmlDecl already there.
     _xmlDecl += os.str();
-
 }
 
 // The iterator should be pointing to the first char after the '<'
@@ -287,7 +279,6 @@ void
 XML_as::parseTag(XMLNode_as*& node, xml_iterator& it,
         const xml_iterator end)
 {
-
     bool closing = (*it == '/');
     if (closing) ++it;
 
@@ -460,7 +451,6 @@ XML_as::parseCData(XMLNode_as* node, xml_iterator& it,
     childNode->nodeValueSet(content);
     childNode->nodeTypeSet(Text);
     node->appendChild(childNode);
-    
 }
 
 
@@ -482,29 +472,23 @@ XML_as::parseXML(const std::string& xml)
 
     const bool iw = ignoreWhite();
 
-    while (it != end && _status == XML_OK)
-    {
-        if (*it == '<')
-        {
+    while (it != end && _status == XML_OK) {
+        if (*it == '<') {
             ++it;
-            if (textMatch(it, end, "!DOCTYPE", false))
-            {
+            if (textMatch(it, end, "!DOCTYPE", false)) {
                 // We should not advance past the DOCTYPE label, as
                 // the case is preserved.
                 parseDocTypeDecl(it, end);
             }
-            else if (textMatch(it, end, "?xml", false))
-            {
+            else if (textMatch(it, end, "?xml", false)) {
                 // We should not advance past the xml label, as
                 // the case is preserved.
                 parseXMLDecl(it, end);
             }
-            else if (textMatch(it, end, "!--"))
-            {
+            else if (textMatch(it, end, "!--")) {
                 parseComment(node, it, end);
             }
-            else if (textMatch(it, end, "![CDATA["))
-            {
+            else if (textMatch(it, end, "![CDATA[")) {
                 parseCData(node, it, end);
             }
             else parseTag(node, it, end);
@@ -536,7 +520,6 @@ XML_as::clear()
 void
 xml_class_init(as_object& where, const ObjectURI& uri)
 {
-
     Global_as& gl = getGlobal(where);
     as_object* cl = gl.createClass(&xml_new, 0);
 
@@ -553,7 +536,6 @@ xml_class_init(as_object& where, const ObjectURI& uri)
     }
     
     where.init_member(uri, cl, as_object::DefaultFlags);
-
 }
 
 void
@@ -588,7 +570,6 @@ attachXMLProperties(as_object& o)
 void
 attachXMLInterface(as_object& o)
 {
-
     VM& vm = getVM(o);
     Global_as& gl = getGlobal(o);
 
@@ -607,13 +588,11 @@ attachXMLInterface(as_object& o)
     o.init_member("sendAndLoad", vm.getNative(301, 2), flags);
     o.init_member("onData", gl.createFunction(xml_onData), flags);
     o.init_member("onLoad", gl.createFunction(xml_onLoad), flags);
-
 }
 
 as_value
 xml_new(const fn_call& fn)
 {
-
     as_object* obj = ensure<ValidThis>(fn);
 
     if (fn.nargs && !fn.arg(0).is_undefined()) {
@@ -751,7 +730,6 @@ xml_createElement(const fn_call& fn)
 as_value
 xml_createTextNode(const fn_call& fn)
 {
-
     if (fn.nargs > 0) {
         const std::string& text = fn.arg(0).to_string();
         XMLNode_as* xml_obj = new XMLNode_as(getGlobal(fn));
@@ -792,8 +770,7 @@ xml_xmlDecl(const fn_call& fn)
 {
     XML_as* ptr = ensure<ThisIsNative<XML_as> >(fn);
 
-    if (!fn.nargs)
-    {
+    if (!fn.nargs) {
         // Getter
         const std::string& xml = ptr->getXMLDecl();
         if (xml.empty()) return as_value();
@@ -806,7 +783,6 @@ xml_xmlDecl(const fn_call& fn)
     ptr->setXMLDecl(xml);
     
     return as_value();
-
 }
 
 as_value
@@ -855,7 +831,6 @@ xml_onLoad(const fn_call& /*fn*/)
 as_value
 xml_onData(const fn_call& fn)
 {
-
     as_object* thisPtr = fn.this_ptr;
     assert(thisPtr);
 
@@ -885,7 +860,6 @@ bool
 textMatch(xml_iterator& it, const xml_iterator end,
         const std::string& match, bool advance)
 {
-
     const std::string::size_type len = match.length();
 
     if (static_cast<size_t>(end - it) < len) return false;
@@ -972,7 +946,6 @@ setIdMap(as_object& xml, XMLNode_as& childNode, const 
std::string& val)
 const Entities&
 getEntities()
 {
-
     static const Entities entities = boost::assign::map_list_of
         ("&amp;", "&")
         ("&quot;", "\"")
@@ -981,7 +954,6 @@ getEntities()
         ("&apos;", "'");
 
     return entities;
-
 }
 
 } // anonymous namespace 
diff --git a/libcore/asobj/XML_as.h b/libcore/asobj/XML_as.h
index 1ee00cb..4402613 100644
--- a/libcore/asobj/XML_as.h
+++ b/libcore/asobj/XML_as.h
@@ -120,10 +120,6 @@ public:
     ///
     void parseXML(const std::string& xml);
 
-    XMLNode_as* createElement(const std::string& name);
-
-    XMLNode_as* createTextNode(const std::string& name);
-
     ParseStatus status() const {
         return _status;
     }
@@ -140,13 +136,12 @@ public:
         _loaded = st;
     }
   
-    /// \brief
-    /// Return true if ignoreWhite property was set to anything evaluating
-    /// to true.
+    /// Return current ignoreWhite property.
     bool ignoreWhite() const {
         return _ignoreWhite;
     }
 
+    /// Set ignoreWhite property.
     void ignoreWhite(bool ignore) {
         _ignoreWhite = ignore;
     }

-----------------------------------------------------------------------

Summary of changes:
 libcore/asobj/XMLNode_as.cpp |   10 ++++--
 libcore/asobj/XMLNode_as.h   |   10 ++++--
 libcore/asobj/XML_as.cpp     |   64 ++++++++++++------------------------------
 libcore/asobj/XML_as.h       |    9 +----
 4 files changed, 32 insertions(+), 61 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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