gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, objecturi, updated. f7cbadf44f7dd5c92


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, objecturi, updated. f7cbadf44f7dd5c921e58334794ac437b1eb821c
Date: Wed, 22 Sep 2010 23:26:02 +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, objecturi has been updated
       via  f7cbadf44f7dd5c921e58334794ac437b1eb821c (commit)
      from  587ae0e20694b0d4e3c7fe71fea7bfd1fe65a672 (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=f7cbadf44f7dd5c921e58334794ac437b1eb821c


commit f7cbadf44f7dd5c921e58334794ac437b1eb821c
Author: Sandro Santilli <address@hidden>
Date:   Thu Sep 23 01:03:19 2010 +0200

    Drop the bool operator for ObjectURI, to avoid getting the kind of 
side-effect that made me waste way too much time to figure out (syntetized 
equality operator); this allowed me to figure some debugging outputs were being 
dumb too (now fixed to do debugging output of ObjectURI rather than printing a 
number). Provide an .empty() method to ObjectURI, for use by those which were 
using !name before (the reason why bool operator was introduced in the first 
place). Sorry for the long commit log line :)

diff --git a/libcore/Button.cpp b/libcore/Button.cpp
index 9444f70..ad524f8 100644
--- a/libcore/Button.cpp
+++ b/libcore/Button.cpp
@@ -228,14 +228,14 @@ namespace {
     void addInstanceProperty(Button& b, DisplayObject* d) {
         if (!d) return;
         const ObjectURI& name = d->get_name();
-        if (!name) return;
+        if (name.empty()) return;
         getObject(&b)->init_member(name, getObject(d), 0);
     }
 
     void removeInstanceProperty(Button& b, DisplayObject* d) {
         if (!d) return;
         const ObjectURI& name = d->get_name();
-        if (!name) return;
+        if (name.empty()) return;
         getObject(&b)->delProperty(name);
     }
 }
diff --git a/libcore/DisplayList.cpp b/libcore/DisplayList.cpp
index a4a7ff7..7044bf4 100644
--- a/libcore/DisplayList.cpp
+++ b/libcore/DisplayList.cpp
@@ -716,6 +716,11 @@ DisplayList::dump() const
 {
     //testInvariant();
 
+    if ( _charsByDepth.empty() ) return;
+
+    string_table& st = getStringTable(*getObject(_charsByDepth.front()));
+    ObjectURI::Logger l(st);
+
     int num=0;
     for (const_iterator it = _charsByDepth.begin(),
             endIt = _charsByDepth.end(); it != endIt; ++it) {
@@ -723,7 +728,7 @@ DisplayList::dump() const
         const DisplayObject* dobj = *it;
         log_debug(_("Item %d(%s) at depth %d (char name %s, type %s)"
                     "Destroyed: %s, unloaded: %s"),
-            num, dobj, dobj->get_depth(), dobj->get_name(), typeName(*dobj),
+            num, dobj, dobj->get_depth(), l.debug(dobj->get_name()), 
typeName(*dobj),
             dobj->isDestroyed(), dobj->unloaded());
         num++;
     }
@@ -1108,12 +1113,18 @@ std::ostream&
 operator<< (std::ostream& os, const DisplayList& dl)
 {
     os << "By depth: ";
+
+    if ( dl._charsByDepth.empty() ) return os;
+
+    string_table& st = getStringTable(*getObject(dl._charsByDepth.front()));
+    ObjectURI::Logger l(st);
+
     for (DisplayList::const_iterator it = dl._charsByDepth.begin(),
             itEnd = dl._charsByDepth.end(); it != itEnd; ++it) {
 
         const DisplayObject* item = *it; 
         if (it != dl._charsByDepth.begin()) os << " | ";
-        os << " name:" << item->get_name()
+        os << " name:" << l.debug(item->get_name())
            << " depth:" << item->get_depth();
     }
 
diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index db89280..640d989 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -1863,7 +1863,7 @@ MovieClip::getLoadedMovie(Movie* extern_movie)
         // Copy own name
         // TODO: check empty != none...
         const ObjectURI& name = get_name();
-        if (name) extern_movie->set_name(name);
+        if (!name.empty()) extern_movie->set_name(name);
 
         // Copy own clip depth (TODO: check this)
         extern_movie->set_clip_depth(get_clip_depth());
@@ -2050,7 +2050,7 @@ public:
         
         const ObjectURI& name = ch->get_name();
         // Don't enumerate unnamed DisplayObjects
-        if (!name) return;
+        if (name.empty()) return;
         
         // Referenceable DisplayObject always have an object.
         assert(getObject(ch));
diff --git a/libcore/ObjectURI.h b/libcore/ObjectURI.h
index d14a384..27ec582 100644
--- a/libcore/ObjectURI.h
+++ b/libcore/ObjectURI.h
@@ -38,9 +38,15 @@ struct ObjectURI
         nameNoCase(0)
     {}
 
+/*
     operator const void*() const {
         return (name == 0) ? 0 : this;
     }
+*/
+
+    bool empty() const {
+        return (name == 0);
+    }
 
     const std::string&
     toString(string_table& st) const

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

Summary of changes:
 libcore/Button.cpp      |    4 ++--
 libcore/DisplayList.cpp |   15 +++++++++++++--
 libcore/MovieClip.cpp   |    4 ++--
 libcore/ObjectURI.h     |    6 ++++++
 4 files changed, 23 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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